aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* initHEADmasterEthan Morgan37 hours79-173/+483
|
* troff: fix SIGFPE when using modulus operatorG. Branden Robinson2025-11-091-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I uncovered this problem while writing unit tests for GNU troff's delimited expression handling. Plan 9 troff's numeric expression evaluator handles division by zero but not modulus by zero. Fixes: $ echo '.if %0%0% .tm true' | 9 troff Floating point exception (core dumped) $ echo '.if 1%0 .tm true' | 9 troff Floating point exception (core dumped) After this patch: $ echo '.if %0%0% .tm true' | 9 troff x T utf x res 720 1 1 x init troff: modulus by zero.; stdin:1 troff: modulus by zero.; stdin:1 x trailer V0 x stop $ echo '.if 1%0 .tm true' | 9 troff x T utf x res 720 1 1 x init troff: modulus by zero.; stdin:1 x trailer V0 x stop
* cmd/devdraw: handle X11 selections betterScott Schwartz2025-11-041-1/+2
| | | | | | | | | x11-screen.c accepts selection targets with the MIME type "text/plain;charset-UTF8", but it should do so case insensitively. The current code draws an error when working with xfce4-terminal 1.0.4, which sends lower case. To reproduce, run acme, snarf some text, then paste in the terminal. acme will report: acme: cannot handle selection request for 'text/plain;charset=utf-8' (590)
* tmac/tmac.an*: work around formatter bugG. Branden Robinson2025-10-262-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ...when rendering some man pages, such as those of ncurses. I did not manage (nor seriously attempt) to identify the root cause of this bug. ncurses's use of `SH` and `SS` man(7) macros is unremarkable.[1] I cannot account for why the less(1) man page renders fine and ncurses pages like insstr(3) do not. But render badly they do, emitting *roff logic as formatted output. ``` $ 9 nroff -man $(man -w insstr) | grep -F .ss | cat -v "'''if^GNAME^GSYNOPSIS^G .ss 18 NAME "'''if^GSYNOPSIS^GSYNOPSIS^G .ss 18 SYNOPSIS "'''if^GDESCRIPTION^GSYNOPSIS^G .ss 18 DESCRIPTION "'''if^GRETURN^GSYNOPSIS^G .ss 18 RETURN VALUE "'''if^GNOTES^GSYNOPSIS^G .ss 18 NOTES "'''if^GEXTENSIONS^GSYNOPSIS^G .ss 18 EXTENSIONS "'''if^GPORTABILITY^GSYNOPSIS^G .ss 18 PORTABILITY "'''if^GHISTORY^GSYNOPSIS^G .ss 18 HISTORY "'''if^GSEE^GSYNOPSIS^G .ss 18 SEE ALSO ``` With this patch: ``` $ 9 nroff -man $(man -w insstr) | grep -F .ss | cat -v | grep . || echo NO OUTPUT NO OUTPUT ``` I do observe that the problem seems to correspond to the only use in the package of the old-fashioned `'''` commenting convention _within a macro definition_. I have a notion of how GNU troff works, but little about AT&T troff. That said, if I were to try to get to the bottom of this problem, I'd look into if and how the no-break command character is handled differently in copy mode. I see nothing in CSTR #54 to suggest that the command characters have different meanings in copy mode and its complement.[2] My solution is to use idiomatic comment syntax inside macro definitions. [1] https://github.com/ThomasDickey/ncurses-snapshots/blob/d5dc8a4a7c15474652d73dee37d905c8205f6ab4/man/curs_insstr.3x#L47 [2] unnamed in AT&T documentation but which I term "interpretation mode" in groff
* nroff: bad symbold definition on command line.Dan Cross2025-10-101-1/+1
| | | | | | | `-DTDEVNAME=...` should be `-DNDEVNAME=...`. We've been defaulting for "37", probably forever. Signed-off-by: Dan Cross <cross@gajendra.net>
* tmac/tmac.an*: support `lq`, `rq` stringsG. Branden Robinson2025-10-102-0/+16
| | | | | | | | | | | | | | | | | | | | | | | The `lq` and `rq` strings are not a groffism, but _almost_ universally portable to man(7) renderers. They originate in 4BSD (1980).[1] They entered Unix System V with SVR4 (1988 or 1989).[2] mandoc(1) has supported them since its inception.[3] * tmac/tmac.an: * tmac/tmac.antimes: Do it. Use U+201C and U+201D if the output device is "utf", otherwise define them as `` and ''. Don't define them as `"` because that breaks when interpolating the strings in macro arguments.[4] [1] https://minnie.tuhs.org/cgi-bin/utree.pl?file=4BSD/usr/lib/tmac/tmac.an.new [2] https://github.com/ryanwoodsmall/oldsysv/blob/e68293af91e2dc39f5f29c20d7e429f9e0cabc75/sysvr4/svr4/ucbcmd/troff/troff.d/tmac.d/an#L46 [3] https://cvsweb.openbsd.org/cgi-bin/cvsweb/src/usr.bin/mandoc/predefs.in?rev=1.1&content-type=text/x-cvsweb-markup [4] https://www.gnu.org/software/groff/manual/groff.html.node/Calling-Macros.html "For the (neutral) double quote, you have recourse to an obscure syntactical feature of AT&T troff. ..."
* devdraw: work around XWayland pointer warpingRuss Cox2025-10-091-0/+23
|
* devdraw: fix dangling elseArusekk2025-10-091-2/+2
| | | | | | | | | | | | Because of a dangling else, after adding a name to an image with 'N', it was immediately deleted, resulting in Enoname in response to 'n'. This went mostly unnoticed, since plan9port itself does not use named images, but it can break external applications like truedraw[1]. [1]: https://git.sr.ht/~arusekk/truedraw Fixes: c66b52501b63 ("new draw server")
* man: remove -s from usage messageAnthony Sorace2025-09-231-1/+1
|
* B: Print usage message to stderrJordan Niethe2025-09-061-1/+1
| | | | | | | B's usage message redirects its stderr to stdout instead of vice versa. Fix this. Signed-off-by: Jordan Niethe <jniethe5@gmail.com>
* ci: bump actions/checkout from 4 to 5dependabot[bot]2025-08-121-2/+2
| | | | | | | | | | | | | | | | Bumps [actions/checkout](https://github.com/actions/checkout) from 4 to 5. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/v4...v5) --- updated-dependencies: - dependency-name: actions/checkout dependency-version: '5' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com>
* ci: bump actions/checkout from 3 to 4dependabot[bot]2025-07-271-2/+2
| | | | | | | | | | | | | | | | Bumps [actions/checkout](https://github.com/actions/checkout) from 3 to 4. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/v3...v4) --- updated-dependencies: - dependency-name: actions/checkout dependency-version: '4' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com>
* tmac/tmac.an: define .MR in a groff compatible wayDmitri Vereshchagin2025-07-27297-1623/+1623
| | | | | | | | | | | | | | | | groff 1.23.0 added .MR to its -man macro package. The NEWS file states that the inclusion of the macro "was prompted by its introduction to Plan 9 from User Space's troff in August 2020." From d32deab it seems that the name for Plan 9 from User Space's implementation was suggested by groff maintainer G. Brandon Robinson. Not sure if the intention was to make these definitions compatible, but it would be nice if they were. Currently, Plan 9 from User Space's .MR expects its second argument to be parenthesized. groff's .MR does not. This results in extra parentheses appearing in manual references when viewing Plan 9 from User Space's manual pages on a system using groff.
* ci: add Dependabot for GitHub ActionsKare Nuorteva2025-07-271-0/+10
| | | | | | | | Dependabot automatically maintains GitHub Actions workflows by sending Pull Requests to project when action updates are released. Dependabot labels the pull requests 'ci: bump actions/checkout from v3 to v4'. Dependabot opens a maximum of five Pull Requests at a time and reviews the need for PRs once a week.
* src/cmd/rc: import rc syntax `delim{cmd} for splitting commands from 9atomlufia2025-07-277-10/+38
| | | | Co-authored-by: <ori@eigenstate.org>
* .gitignore: ignore macOS .DS_Store filesKare Nuorteva2025-07-271-0/+1
|
* SunOS: silence some warningsDan Cross2025-07-252-2/+2
| | | | | | Give `-Wformat=0` on illumos/Solaris so that the build does not complain about `execlp` not having a sentinel (it's nil). Also fix an integer size issue when casting to a void pointer.
* DragonFly: fix buildDan Cross2025-07-253-4/+13
| | | | Fix the build for DragonFlyBSD.
* libthread: remove check for LinuxThreadsDan Cross2025-07-251-15/+0
| | | | | | | | | | | libthread had code in `_pthreadinit` to test for LinuxThreads, and error if it was in use. This hasn't been relevant since Linux 2.6, and I can't imagine there are many people trying to build (recent) plan9port on systems that old. Unfortunately, this code violated aliasing rules, and compilers were complaining about it. But, since it likely hasn't had much relevance in 20ish years, we can probably just remove it.
* all: remove need for `-fcommon`Dan Cross2025-07-2539-193/+339
| | | | | | | | | | Use `extern` where appropriate so that we can remove `-fcommon` on macOS and others. On macOS, `-fcommon` generates a number of linker warnings. I've tested building on macOS, Linux, FreeBSD, NetBSD, OpenBSD and illumos. I am not in a position to test on AIX or other more esoteric platforms, however.
* rio: proper prototypes in `fns.h`Dan Cross2025-07-2510-93/+98
| | | | | Use proper function prototypes in `fns.h`, that include argument type information.
* all: clean up misleading indentation warningsDan Cross2025-07-256-22/+28
| | | | | | | | | Misleading indentation warnings are actually useful, as they will occasionally reveal actual bugs (cf the apple `goto fail` security bug from a few years ago). Newer versions of clang (at least) are more aggressive about warnings in this regard, which has exposed a few warnings that are annoying. However, they are easy to address.
* sort: rename kcmp to keycmpDan Cross2025-07-241-6/+6
| | | | | Fixes: #648 Fixes: #655
* INSTALL: set defaults for awk and egrepDan Cross2025-07-241-6/+2
| | | | | | | Set defaults for `awk` and `egrep`, instead of setting things multiple times when specializing on OS, and using a default in a `case` statement. This is cleaner and less error-prone.
* warnings: fix warnings on newer compilersDan Cross2025-07-245-15/+21
| | | | | | | | | | Mostly turning the crank on fixing simple warnings: arrays, for instance, can never be nil. A couple of pointers should have been initialized to `nil` before being tested. Some logic in `troff` was simplified: basically, an `if` statement had a condition that must have always been true if that section of code were being executed at all.
* config: add $egrepDan Cross2025-07-239-11/+27
| | | | | | | | | | | Introduce a new variable set in $PLAN9/config: $egrep, which is conditionally set to either `egrep` or `grep -E`, based on platform, and use this when we want to invoke `egrep`. This works around the endless warnings from GNU grep stating that `egrep` is deprecated in favor of `grep -E`, when run on e.g. Linux.
* 9c: change -std=c17 to -stc=c11 based on feedback in \#716erentar2025-07-221-1/+1
|
* u.h: define __USE_POSIX to make glibc happyerentar2025-07-221-1/+1
| | | | glibc will only expose sigjmp_buf if __USE_POSIX is defined.
* 9c: Explicitly set c standard as newer changes in c23 break compilationerentar2025-07-221-0/+1
|
* 9c: "-Wdeprecated-pragma" is only present in clang and is absent from gccerentar2025-07-221-1/+0
|
* libflate: fiz inflatezlibblockRuss Cox2025-05-081-2/+2
| | | | This has obviously never been run.
* cmd/devdraw: avoid use of X button state fieldRoger Peppe2025-03-291-51/+12
| | | | | | | | | | | | | | | | | | This bug is an intermittent annoyance and does not seem likely to be fixed soon. It means that every so often my acme becomes unusable because it behaves as if a mouse button is permanently set. Avoid that issue by keeping track of mouse button state directly. While we're about it, fix another annoying issue: under Linux the FocusOut event reset the kstate field but not the kbuttons field, meaning that the buttons state could inappropriately persist. This happened occasionally by accident, but was easy to reproduce: with the mouse button held down, drag outside the window and click Alt-Tab to switch away from the window. We see a KeyDown event followed by FocusOut but no KeyUp event. Change-Id: I3708316478c80c41806d7157ae9929c6cd84b662
* .gitignore: add bin/mntgenIgor Burago2025-02-171-0/+1
|
* dist/main.html: remove dead link to Belorussian translationmacie2025-02-171-2/+0
| | | | | | According to web.archive.org this link is dead since 2012/2013. According to original issue (http://codereview.appspot.com/4251044) that translation could be a machine translation.
* man: don't paginate when using nroffAnthony Sorace2025-01-292-6/+9
| | | | | | This tells bin/man to set the register L to very high to avoid pagination and updates tmac/tmac.an to use that value, if it's set, to set the page length. This is per Plan 9's rc/bin/man and sys/lib/tmac/tmac.an.
* mac: arrange for arm64 run on arm64Russ Cox2024-10-222-3/+11
| | | | Makes 9term.app work again (not put you in an x86_64 jail).
* devdraw: handle shift of real mouse buttons correctlyRuss Cox2024-06-172-10/+23
|
* lib9: skip buggy S_ISCHR check in disksize on OpenBSDRuss Cox2024-06-151-2/+0
| | | | The portable code is already checking S_ISCHR anyway.
* man: update indexesRuss Cox2024-06-153-3/+11
|
* acme: remove debug printRuss Cox2024-06-151-1/+0
|
* acme: shift button 3 for reverse searchRuss Cox2024-06-1514-99/+269
| | | | | An experiment. Let's see if it's any good. Also document the Mac conventions in devdraw(3).
* all: quiet macOS build againRuss Cox2024-06-152-1/+5
|
* Remove redundant echoKevin Hovsäter2024-05-311-1/+0
|
* INSTALL: fix $PLAN9 in messageRuss Cox2024-04-061-0/+2
|
* tpic: clean upRuss Cox2024-04-065-8/+14
|
* acme: clean up environment after execRuss Cox2024-04-061-0/+9
| | | | Make up for the lack of a real rfork(RFENVG).
* .github/workflows/actions.yaml: Run CI on pull requests tooSevan Janiyan2024-01-091-1/+5
| | | | Not just on pushes
* .travis.yml: DeleteSevan Janiyan2024-01-091-41/+0
| | | | Service is no longer around.
* README.md: Add GH actions badgeSevan Janiyan2024-01-091-1/+1
|
* .github/workflows/actions.yaml: AddSevan Janiyan2024-01-091-0/+20
| | | | | | | | | Basic configuration which builds p9p on latest Ubuntu & macOS. Skipped on adding more operating systems as build would hold up waiting for runners, whereas with -latest targets, build starts immediately. Supported runners can be found on https://docs.github.com/en/actions/using-jobs/choosing-the-runner-for-a-job