Po Lu [Mon, 11 Sep 2023 01:32:44 +0000 (09:32 +0800)]
Properly set text conversion style within ERC buffers
* lisp/erc/erc.el (erc-mode): Register
`erc-check-text-conversion' as a local post command hook.
(set-text-conversion-style): New function. Detect if point is
within the input prompt, then enable or disable text conversion
correspondingly.
F. Jason Park [Sat, 22 Jul 2023 07:46:44 +0000 (00:46 -0700)]
Consider all windows in erc-scrolltobottom-mode
* etc/ERC-NEWS: Add entry for option `erc-scrolltobottom-all', and
mention explicit hook-depth intervals reserved by ERC.
* lisp/erc/erc-backend.el (erc--hide-prompt): Change hook depth on
`pre-command-hook' from 91 to 80.
* lisp/erc/erc-goodies.el (erc-input-line-position): Mention secondary
role when new option `erc-scroll-to-bottom-relaxed' is non-nil.
(erc-scrolltobottom-all): New option that decides whether module
`scrolltobottom' affects all windows or just the selected one, as it
always has.
(erc-scrolltobottom-relaxed): New option to leave the prompt
stationary instead of forcing it to the bottom of the window.
(erc-scrolltobottom-mode, erc-scrolltobottom-enable,
erc-scrolltobottom-disable): Use `erc--scrolltobottom-setup' instead
of `erc-add-scroll-to-bottom' for adding and removing local hooks and
instead of ranging over buffers when removing them. Also add and
remove new hook members when `erc-scrolltobottom-all' is non-nil.
(erc--scrolltobottom-relaxed-commands,
erc--scrolltobottom-window-info,
erc--scrolltobottom-post-force-commands,
erc--scrolltobottom-relaxed-skip-commands): New internal variables.
(erc--scrolltobottom-on-pre-command
erc--scrolltobottom-on-post-command): New functions resembling
`erc-possibly-scroll-to-bottom' that try to avoid scrolling repeatedly
for no reason.
(erc--scrolltobottom-on-pre-command-relaxed,
erc--scrolltobottom-on-post-command-relaxed): New commands to help
implement `erc-scroll-to-bottom-relaxed'.
(erc--scrolltobottom-at-prompt-minibuffer-active): New function to
scroll to bottom on window configuration changes when using the
minibuffer.
(erc--scrolltobottom-all): New function to scroll all windows
displaying the current buffer.
(erc-add-scroll-to-bottom): Deprecate this function because it is now
unused in the default client and trivial to implement otherwise.
(erc--scrolltobottom-setup): New generic function to perform teardown
as well as setup depending on the state of the module's mode variable.
Also add an implementation specifically for `erc-scrolltobottom-all'
that locally modifies different sets of hooks depending on
`erc-scrolltobottom-relaxed'.
(erc--scrolltobottom-on-pre-insert): New generic function that
remembers the last `window-start' and maybe the current screen line
before inserting a message, in order to restore it afterward.
(erc--scrolltobottom-confirm): New function, a replacement for
`erc-scroll-to-bottom' that returns non-nil when it's actually
recentered the window. For now, used only when
`erc-scrolltobottom-all' is enabled.
(erc-move-to-prompt-setup): Add `erc-move-to-prompt' to
`pre-command-hook' at a depth of 70 in the current buffer.
(erc-keep-place-mode, erc-keep-place-enable): Change hook depth from 0
to 85.
(erc--keep-place-indicator-setup): Add overlay arrow `after-string' in
non-graphical settings in case users have time stamps or other content
occupying the left margin.
(erc-keep-place-indicator-mode, erc-keep-place-indicator-enable):
Change hook depth from 90 to 85 locally so as not to conflict with a
value of t, for append.
(erc--keep-place-indicator-on-global-module): Change hook depth from
90 to 85 locally.
* test/lisp/erc/erc-scenarios-scrolltobottom-relaxed.el: New file.
* test/lisp/erc/erc-scenarios-scrolltobottom.el: New file.
* test/lisp/erc/resources/erc-scenarios-common.el
(erc-scenarios-common--term-size, erc-scenarios-common--run-in-term,
erc-scenarios-common-interactive-debug-term-p,
erc-scenarios-common-with-noninteractive-in-term): New test macro and
supporting helper function and variables to facilitate running
scenario-based tests in an inferior Emacs, in term-mode.
(erc-scenarios-common--at-win-end-p,
erc-scenarios-common--above-win-end-p,
erc-scenarios-common--prompt-past-win-end-p,
erc-scenarios-common--recenter-top-bottom-around,
erc-scenarios-common--recenter-top-bottom,
erc-scenarios-scrolltobottom--normal): New test fixture and assertion
helper functions.
* test/lisp/erc/resources/scrolltobottom/help.eld: New file.
(Bug#64855)
F. Jason Park [Thu, 31 Aug 2023 06:15:22 +0000 (23:15 -0700)]
Add optional timezone param to erc-echo-timestamp
* etc/ERC-NEWS: Move `erc-echo-timestamp' from misc section
to own entry, and mention option `erc-echo-timestamp-zone'.
* lisp/erc/erc-stamp.el (erc-echo-timestamps): Mention that some
finagling is required if enabling this option after activating the
module.
(erc-echo-timestamp-format): Add additional Custom choice constants
and make the existing default one of them.
(erc-echo-timestamp-zone): New option to specify timezone for option
`erc-echo-timestamps' and function `erc-echo-timestamp'.
(erc-stamp-mode, erc-stamp-enable, erc-stamp-disable): Call
`erc-stamp--setup' instead of `erc-munge-invisibility-spec'.
(erc-stamp--current-time): Use `current-time' instead of
`erc-current-time'.
(erc-add-timestamp): Improve readability slightly, and change
`fboundp' to `functionp' to avoid signaling an error when the
variable's value is not a symbol.
(erc-munge-invisibility-spec): Perform teardown when boolean flag
options, like `erc-timestamp-intangible' and `erc-echo-timestamps' are
nil.
(erc-stamp--setup): Call `erc-munge-invisibility-spec', possibly
binding timestamp options to nil to force a tear down).
(erc-stamp--last-stamp, erc-stamp--on-clear-message): New function and
helper state variable to tell Emacs not to clear the current timestamp
message when navigating within the same IRC message.
(erc-echo-timestamp): Add optional `zone' parameter, to be passed
directly to `format-time-string', when non-interactive, and massaged
sensibly otherwise. Set the local variable `erc-stamp--last-stamp'.
* test/lisp/erc/erc-stamp-tests.el (erc-echo-timestamp): New test.
(Bug#60936)
F. Jason Park [Sat, 26 Aug 2023 02:03:26 +0000 (19:03 -0700)]
; Allow alternate ert-info text in ERC test utility
* test/lisp/erc/erc-tests.el
(erc-tests--assert-printed-in-subprocess): Don't insist that arguments
to the Emacs "-load" invocation option be actual disk files.
* test/lisp/erc/resources/erc-d/erc-d-t.el
(erc-d-t--wait-message-prefix, erc-d-t-wait-for, erc-d-t-ensure-for):
Add and use new variable to make `ert-info' message prefix adjustable.
The immediate use for this is to make it easier to distinguish between
consecutive assertions in which the first waits for a condition and
the second ensures it holds for some duration.
* test/lisp/erc/resources/erc-d/erc-d-u.el
(erc-d-u--read-exchange-default): Skip killed buffers.
* test/lisp/erc/resources/erc-d/erc-d.el: Typo.
* test/lisp/erc/resources/base/assoc/bouncer-history/barnet.eld: Timeouts.
* test/lisp/erc/resources/base/assoc/bouncer-history/foonet.eld: Timeouts.
* test/lisp/erc/resources/base/assoc/bumped/again.eld: Timeouts.
* test/lisp/erc/resources/base/assoc/bumped/foisted.eld: Timeouts.
* test/lisp/erc/resources/base/assoc/bumped/refoisted.eld: Timeouts.
* test/lisp/erc/resources/base/flood/soju.eld: Timeouts.
* test/lisp/erc/resources/base/netid/bouncer/barnet.eld: Timeouts.
* test/lisp/erc/resources/base/netid/bouncer/foonet.eld: Timeouts.
* test/lisp/erc/resources/base/reconnect/aborted-dupe.eld: Timeouts.
* test/lisp/erc/resources/base/reconnect/aborted.eld: Timeouts.
* test/lisp/erc/resources/base/renick/self/qual-chester.eld: Timeouts.
* test/lisp/erc/resources/base/renick/self/qual-tester.eld: Timeouts.
* test/lisp/erc/resources/erc-d/resources/dynamic-barnet.eld: Timeouts.
* test/lisp/erc/resources/erc-d/resources/dynamic-foonet.eld: Timeouts.
* test/lisp/erc/resources/erc-d/resources/linger.eld: Timeouts.
* test/lisp/erc/resources/join/legacy/foonet.eld: Timeouts.
F. Jason Park [Sat, 2 Sep 2023 03:05:35 +0000 (20:05 -0700)]
Allow login to contain NUH delimiters in erc-parse-user
* lisp/erc/erc.el (erc--parse-user-regexp-legacy,
erc--parse-user-regexp-pedantic): New constants. The first is the
original pattern that matches across line endings. The second
disallows multiline strings and interprets excess delimiting
characters as part of the middle, "user" component as per RFC1459.
The latter distinction is largely academic because most servers reject
such logins anyway, but bridges to other protocols and future
extensions may need to exploit this for novel uses.
(erc--parse-user-regexp): New variable, currently set to
`erc--parse-user-regexp-legacy'.
(erc-parse-user): Keep original pattern as default, but do so
indirectly via `erc--parse-user-regexp'.
* test/lisp/erc/erc-tests.el (erc-parse-user): New test.
Jim Porter [Thu, 7 Sep 2023 00:01:06 +0000 (17:01 -0700)]
Wait for all processes in a pipeline before resuming an Eshell command
Previously, we only waited until the tail process was finished, but
now, we wait for all of them. This is more consistent with other
shells, and prevents some cases of a process's output coming *after*
we continued past its pipeline.
* lisp/eshell/esh-cmd.el (eshell-resume-command): Simplify
conditionals, and check that all the foreground processes are dead
before resuming Eshell command.
* test/lisp/eshell/esh-cmd-tests.el
(esh-cmd-test/pipeline-wait/multi-proc): New test.
Jim Porter [Mon, 3 Apr 2023 05:41:29 +0000 (22:41 -0700)]
Collect all processes in an Eshell pipeline, not just the head and tail
This has the extra benefit that Eshell now only considers a pipeline
to be done when *all* of its processes are done (previously, it
checked only the last one in the pipeline).
* lisp/eshell/esh-util.el (eshell-process-pair-p)
(eshell-make-process-pair): Rename to...
(eshell-process-list-p, eshell-make-process-list): ... these, and
handle lists of processes. Update callers.
* lisp/eshell/esh-cmd.el (eshell-head-process): Use 'car'.
(eshell-tail-process): Get the last element of the list.
(eshell-do-pipelines): Return a list of all processes in the pipeline.
(eshell-do-pipelines-synchronously): Return the result of the first
command (usually t or nil).
(eshell-execute-pipeline): Simplify.
(eshell-do-eval): Pass all processes to 'eshell/wait'.
* lisp/font-lock.el (font-lock-verbose)
* lisp/image-mode.el (image-auto-resize)
* lisp/gnus/message.el (message-openpgp-header): Arrange for 'other'
to be the last choice. (Bug#65852)
* src/lisp.h (union vectorlike_header): Rewrite the description of the
header word layout, with some useful added precision and the customary
ASCII art for bit fields.
Point will skips empty lines and optionally goto the other
end when encountering a boundary.
* lisp/dired.el (dired-movement-style): Control whether to
skip empty lines and whether to cycle through non-empty
lines.
* lisp/dired.el (dired-next-line): Add a new movement style
controlled by `dired-movement-style'.
* etc/NEWS (dired-movement-style):
Felix Dietrich [Sun, 6 Aug 2023 04:01:24 +0000 (06:01 +0200)]
Make ‘mailcap-viewer-passes-test’ return t for viewers without tests
* lisp/net/mailcap.el (mailcap-viewer-passes-test):
Make ‘mailcap-viewer-passes-test’ follow its docstring and return t
for viewers without a test. (Bug#65224)
* test/lisp/net/mailcap-tests.el
(mailcap-viewer-passes-test-w/o-test-returns-t): New test.
* src/xterm.c (handle_one_xevent): The construct ``allows to
<infinitive>'' is not English inasmuch as no direct object to
``allows'' is provided. Correct and rephrase each instance of such a
construct within our documentation and commentary.
Yuan Fu [Sat, 9 Sep 2023 19:35:13 +0000 (12:35 -0700)]
Fix treesit-node-at wrt local parsers
* lisp/treesit.el (treesit-node-at): Don't compute language at point
first. Because treesit-language-at uses treesit-node-at with a
language argument. Only call treesit-language-at when PARSER-OR-LANG
is nil.
because they are very much an indicator of a mistake (such as
misplaced brackets), and since they are deleted by the optimiser, any
other warnings there are lost and the user wouldn't know that
something is wrong otherwise.
Don't cache warnings between bytecode compilation tests
* test/lisp/emacs-lisp/bytecomp-tests.el
(bytecomp-tests--with-fresh-warnings): New macro.
(test-byte-comp-compile-and-load, bytecomp--with-warning-test):
Use it.
Po Lu [Sat, 9 Sep 2023 07:49:47 +0000 (15:49 +0800)]
Update Android port
* src/android-asset.h (android_asset_read_internal): Return an
error indication if an exception arises while reading.
(AAsset_getBuffer): Free BUFFER using the C library free
function.
Jim Porter [Sat, 9 Sep 2023 05:24:06 +0000 (22:24 -0700)]
; Fix last change
* test/lisp/eshell/esh-proc-tests.el
(esh-proc-test/sigpipe-exits-process): Make sure we have no *new*
processes, instead of making sure we have no processes at all.
For some reason the intervals case failed to push the var to
`loop-for-bindings` before pushing to `loop-for-sets`.
AFAICT this was the only place where we made that mistake.
Stefan Monnier [Fri, 8 Sep 2023 23:18:28 +0000 (19:18 -0400)]
(tempo-user-elements): Make it a proper hook
* lisp/tempo.el (tempo-user-element-functions): Rename from
`tempo-user-elements`.
(tempo-user-elements): Preserve as obsolete alias.
(tempo-is-user-element): Use `run-hook-with-args-until-success`.
Stefan Kangas [Fri, 8 Sep 2023 14:47:33 +0000 (16:47 +0200)]
Mark two flyspell functions as internal
* lisp/textmodes/flyspell.el: Minor doc fix.
(flyspell--mode-on, flyspell--mode-off): Rename from
'flyspell-mode-on' and 'flyspell-mode-off'. The old names are
preserved as obsolete aliases.
Po Lu [Fri, 8 Sep 2023 08:12:12 +0000 (16:12 +0800)]
Properly detect content files in Doc View
* lisp/doc-view.el (doc-view-mode): Detect if file name starts
with /content or /assets, and don't regard it as available to
subprocesses in that case.
Po Lu [Fri, 8 Sep 2023 02:37:18 +0000 (10:37 +0800)]
Permit XLFD names to exceed 255 characters
* doc/lispref/display.texi (Low-Level Font)
<font-xlfd-name>: Document new argument `long-xlfds'.
* etc/NEWS: Mention removal of XLFD length restrictions.
* src/font.c (font_build_object): Dynamically allocate XLFD,
permitting them to surpass 255 characters in length.
(font_parse_xlfd_1): Cease rejecting XLFDs more than 255
characters in length.
(font_dynamic_unparse_xlfd): New function. Like
font_unparse_xlfd, but allocate the XLFD dynamically.
(font_delete_unmatched): Dynamically allocate XLFD if necessary.
(Ffont_xlfd_name): New arg LONG_XLFDs. If t, return a
dynamically allocated XLFD. All callers changed.
* src/font.h: Update prototypes.
* src/fontset.c (Fnew_fontset): Dynamically allocate XLFD when
establishing fontset name.
Yuan Fu [Thu, 7 Sep 2023 23:04:29 +0000 (16:04 -0700)]
Change treesit-local-parsers-in to treesit-local-parsers-on
To improve consistency. We already have treesit-node-at and
treesit-node-on.
* doc/lispref/parsing.texi (Multiple Languages): Update manual.
* lisp/treesit.el (treesit-local-parsers-on): Change to in.
(treesit-font-lock-fontify-region): Change to in.
Stefan Kangas [Wed, 6 Sep 2023 09:21:39 +0000 (11:21 +0200)]
Error when trying to make nil or t obsolete
* lisp/emacs-lisp/byte-run.el (make-obsolete, make-obsolete-variable):
Signal error if the symbol to make obsolete is nil or t. (Bug#62248)
(byte-run--constant-obsolete-warning): New function.
* test/lisp/emacs-lisp/byte-run-tests.el: New file.
* lisp/minibuffer.el (minibuffer--regexp-propertize):
The original regexp had 83 backslashes in 147 characters which may be
some kind of record. This transformation cuts it down to 6, and the
generated regexp string is about 14 % shorter.
* admin/unidata/emoji-zwj.awk: More efficient code generation
Hoist the `eval-when-compile` to encompass the entire list, since
backquote forms aren't automatically evaluated at compile time.
This results in a single constant list in the generated code, and
much less actual code.
Stefan Kangas [Thu, 7 Sep 2023 15:48:14 +0000 (17:48 +0200)]
Update docs for (co-)maintainer changes
* admin/MAINTAINERS: Add information on current maintainers as a
canonical place to find this information.
* doc/emacs/ack.texi (Acknowledgments): Update for recent
Emacs (co-)maintainer changes.
* admin/make-tarball.txt: Add note as a reminder to update the above
before making a new release.
Jens Schmidt [Tue, 29 Aug 2023 20:14:48 +0000 (22:14 +0200)]
Improve documentation of EPG
* lisp/epg.el (epg-context-set-passphrase-callback): Update
GnuPG-version-dependent information in docstring and refer to
Info node `(epa)' for details.
(epg-start-edit-key): Replace description of arguments by a
reference to `epg-edit-key'.
(epg-edit-key): More precisely describe callback operation and
arguments and provide an example of how to edit a key. (Bug#65603)
john muhl [Mon, 4 Sep 2023 16:36:42 +0000 (11:36 -0500)]
Fix java-ts-mode tests (bug#65738)
* admin/notes/tree-sitter/build-module/batch.sh (languages):
Add Java.
* lisp/progmodes/java-ts-mode.el (java-ts-mode): Pass a list
to 'treesit-thing-settings'.
martin rudalics [Wed, 6 Sep 2023 08:09:49 +0000 (10:09 +0200)]
New minor mode 'minibuffer-regexp-mode'
This mode is for editing regexps in minibuffer, it highlights
parens via `show-paren-mode' and `blink-matching-paren' in a
user-friendly way, avoids reporting false paren mismatches,
and makes sexp navigation more intuitive.
* lisp/minibuffer.el (minibuffer-regexp-mode)
(minibuffer--regexp-primed, minibuffer--regexp-prompt-regexp):
New variables.
(minibuffer--regexp-propertize, minibuffer--regexp-primed)
(minibuffer--regexp-before-change)
(minibuffer--regexp-after-change)
(minibuffer--regexp-post-self-insert, minibuffer--regexp-setup)
(minibuffer--regexp-exit, minibuffer-regexp-mode): New functions.
(minibuffer-regexp-prompts): New option.
* doc/lispref/minibuf.texi (Minibuffer Misc): Document the new
mode and its option.
Po Lu [Thu, 7 Sep 2023 01:35:59 +0000 (09:35 +0800)]
Port Proced to Android
* configure.ac (HAVE_PROCFS): Define if opsys is `android'.
* src/android.c (android_set_task_name): New function.
(android_run_select_thread, android_run_debug_thread): Set the
name of the LWP for debugging purposes.
* src/process.c (create_process): Set F_SETPIPE_SZ on Android in
addition to GNU/Linux.
* src/sysdep.c (procfs_ttyname, system_process_attributes)
[__ANDROID__]: Enable procfs_ttyname on Android systems.
(project-try-vc): When found non-VC project root, still search for the backend
* lisp/progmodes/project.el (project-try-vc): When finding a
non-VC project root, still try to search for the containing
responsible VC backend, if any (bug#65704).
* lisp/textmodes/tex-mode.el (tex-recenter-output-buffer): Check
that 'display-buffer' returned a window, rather than nil, before
selecting it. (Bug#65762)