Sebastián Monía [Mon, 14 Oct 2024 01:00:03 +0000 (21:00 -0400)]
Use vtable in eww-list-buffers and add function eww-buffer-list
* lisp/net/eww.el (eww-buffer-list): New function.
(eww-list-buffers): Move logic to...
(eww--list-buffers-display-table, eww--list-buffers-get-data):
... these, and use 'vtable'.
(eww-buffer-select, eww-buffer-show, eww-buffer-kill)
(eww-buffers-mode-map): Use 'vtable-current-object'.
(eww-buffers-mode): Set 'revert-buffer-function'
Lin Sun [Sun, 20 Oct 2024 08:05:19 +0000 (10:05 +0200)]
Enhance the auto-revert to avoid revert a buffer in short time
* lisp/autorevert.el (auto-revert--last-time): New defvar.
(auto-revert-handler, auto-revert-notify-handler): Use it.
* test/lisp/autorevert-tests.el (with-auto-revert-test): Set
`auto-revert--lockout-interval' correctly.
john muhl [Sun, 29 Sep 2024 00:11:03 +0000 (19:11 -0500)]
Add ability to crossfade between songs in 'mpc'
* lisp/mpc.el (mpc-cmd-crossfade):
(mpc-toggle-crossfade): New function.
(mpc-crossfade-time): New option.
(mpc-mode-menu): Add menu item to toggle crossfade. (Bug#73891)
Jim Porter [Sat, 19 Oct 2024 18:52:42 +0000 (11:52 -0700)]
Lazily convert numeric strings to Lisp numbers in Eshell
This should reduce the number of issues with Eshell converting strings
to numbers too aggressively and losing information (e.g. "001" -> 1)
while still allowing almost all of the beneficial uses, like summing a
list of numeric strings with '+'.
* lisp/eshell/esh-util.el (eshell--do-mark-numeric-string): New
function.
(eshell-convert-to-number): Make obsolete in favor of...
(eshell-mark-numeric-string): ... this. Update callers.
* lisp/eshell/esh-arg.el (eshell--numberlike-p): New function...
(eshell-concat-1): ... use it.
* test/lisp/eshell/esh-util-tests.el: Reimplement type conversion tests
to use 'eshell-convertible-to-number-p' instead.
* test/lisp/eshell/esh-var-tests.el
(esh-var-test/interp-var-splice-concat, esh-var-test/interp-concat-cmd)
(esh-var-test/interp-convert-var-split-indices)
(esh-var-test/interp-convert-quoted-var-split-indices)
(esh-var-test/interp-convert-cmd-multiline)
(esh-var-test/interp-convert-cmd-split-indices): Adjust tests to check
the new behavior.
* doc/misc/eshell.texi (Type Conversion): New section.
(Expansion): Clarify concatenation behavior.
Álvaro Ramírez [Wed, 2 Oct 2024 10:36:57 +0000 (11:36 +0100)]
Hide default-directory absolute file name in dired-hide-details-mode
* lisp/dired.el (dired-hide-details-hide-absolute-location):
New user option.
(dired-insert-directory, dired-build-subdir-alist): Use it to
hide absolute file name of the directory.
(dired-hide-details-mode): Update doc string.
* test/lisp/dired-tests.el
(dired-test-hide-absolute-location-enabled)
(dired-test-hide-absolute-location-disabled): New tests
Morgan Willcock [Sat, 5 Oct 2024 17:33:51 +0000 (18:33 +0100)]
Rewrite Speedbar expansion for all descendants (bug#73533)
Rewrite 'speedbar-expand-line-descendants' to avoid getting into
an infinite loop by reaching max-lisp-eval-depth. The new
method avoids querying and displaying information for every
movement, instead using a single message to indicate that
expansion is in progress, and so is significantly faster. The
narrowing per item introduced by the fix for bug#35014 is
removed because it prevented expanded descendant items when the
top-level item was already expanded.
* lisp/speedbar.el (speedbar--get-line-indent-level): New
function to return the indentation level of the current line.
(speedbar-expand-line-descendants): Use simpler line motion and
no recursion. Output messages indicating when expansion is in
progress and when it is completed. Fix expansion of descendants
where the top-level item was already expanded.
F. Jason Park [Tue, 15 Oct 2024 02:32:16 +0000 (19:32 -0700)]
Don't autoload erc-modules
* doc/misc/erc.texi (Modules): Recommend using `describe-variable'
instead of `customize-option' because the latter needs the symbol to be
loaded.
* lisp/erc/erc.el (erc-modules): Remove autoload cookie because it
caused customizations for this option to load the main library. This
reverts the thrust of bb894845 "Teach customize-option about
erc-modules", which was added in ERC 5.6 and Emacs 30. The motivation
for the original offending change was to allow new users to run M-x
customize-option RET erc-modules RET immediately after startup instead
of M-x customize-group RET, followed by an I-search. (Bug#73812)
F. Jason Park [Mon, 14 Oct 2024 05:45:05 +0000 (22:45 -0700)]
Move experimental module querypoll to erc-notify
* etc/ERC-NEWS: Announce migration of misplaced `querypoll' module from
erc-goodies.el to erc-notify.el.
* lisp/erc/erc-goodies.el: Move all definitions associated with
experimental module `querypoll' to erc-notify.
* lisp/erc/erc-notify.el (erc--querypoll-ring)
(erc--querypoll-timer, erc-querypoll-exclude-regexp)
(erc-querypoll-mode, erc-querypoll-enable, erc-querypoll-disable)
(erc--queries-current-p, erc-querypoll-period-params)
(erc--querypoll-compute-period, erc--querypoll-target-in-chan-p)
(erc--querypoll-get-length, erc--querypoll-get-next)
(erc--querypoll-subscribe, erc--querypoll-on-352)
(erc--querypoll-send): Move here from erc-goodies.
* test/lisp/erc/erc-goodies-tests.el (erc--querypoll-compute-period)
(erc--querypoll-target-in-chan-p, erc--querypoll-get-length)
(erc--querypoll-get-next): Move to new file erc-notify-tests.el.
* test/lisp/erc/erc-notify-tests.el: New file. The `querypoll' module
was first introduced as part of bug#70928 in ERC 5.6.
F. Jason Park [Sat, 12 Oct 2024 01:12:16 +0000 (18:12 -0700)]
; Undo erroneous change in ERC's sample configuration
* doc/misc/erc.texi (Sample Configuration): Remove `erc-modules' from
the `:custom' section of the `use-package' declaration for feature `erc'
because its presence there depends on `:defer' being non-nil, and this
configuration is supposed to be `:defer' agnostic. This reverts part of 3f1ce47f "; Add face customization to ERC's sample config".
* etc/ERC-NEWS: Mention `erc-modules' no longer being autoloaded.
* lisp/erc/erc-match.el (erc-text-matched-hooks): Explain expected
format of non-NUH matches.
* test/lisp/erc/erc-match-tests.el (test/lisp/erc/erc-match-tests.el):
Inhibit messages when running non-interactively.
Dmitry Gutov [Sat, 19 Oct 2024 01:25:52 +0000 (02:25 +0100)]
Fix the regression in dired-backup-diff's diff-goto-source behavior
* lisp/vc/diff-mode.el (diff-find-source-location): Undo part of
the previous change, so that 'reverse' does not affect whether the
"other file" is used (bug#62731).
(diff-apply-hunk): Make that choice here.
john muhl [Tue, 8 Oct 2024 17:24:27 +0000 (12:24 -0500)]
Fix naming of buffers for tags ending in Y in 'mpc'
* lisp/mpc.el (mpc-tagbrowser-buf): Use 'mpc-tagbrowser-tag-name'
to ensure buffers corresponding to tags that end in Y are
correctly pluralized; e.g. the tag "Directory" should create a
buffer named "*MPC Directories*" not "*MPC Directorys".
Eli Zaretskii [Fri, 18 Oct 2024 12:46:17 +0000 (15:46 +0300)]
; Fix last documentation change
* doc/misc/efaq.texi (Colors on a TTY):
* doc/lispref/frames.texi (Font and Color Parameters):
* doc/emacs/cmdargs.texi (Colors X): More accurate documentation
of TTY color modes and 'tty-color-mode' frame parameter.
(Bug#73813)
Robert Pluim [Fri, 18 Oct 2024 09:22:52 +0000 (11:22 +0200)]
Explain tty-color-mode frame parameter more.
* doc/emacs/cmdargs.texi (Colors X): Explain that tty color
support is dynamic.
* doc/lispref/frames.texi (Font and Color Parameters): Explain
that 'tty-color-mode' can be changed on the fly.
* doc/misc/efaq.texi (Colors on a TTY): Explain how to disable
'tty-color-mode', either at startup or dynamically.
Sean Whitton [Fri, 18 Oct 2024 09:08:53 +0000 (17:08 +0800)]
Replace my recent change to vc-start-logentry
* lisp/vc/vc-dispatcher.el (vc-start-logentry): Restore previous
logic for determining the parent buffer from before my recent
change to this function. If the attempt to determine the parent
buffer fails, signal an error immediately.
(vc-dispatcher-browsing): Consider derived modes of
log-view-mode, too, as indicating that we are in a directory
browser.
Visuwesh [Thu, 17 Oct 2024 04:10:34 +0000 (09:40 +0530)]
Make djvused emit UTF-8 encoded text
* lisp/doc-view.el (doc-view--djvu-outline): Pass -u to djvused
to make it emit UTF-8 encoded text rather than using octal
escapes for non-ASCII string. (bug#73846)
Stefan Monnier [Thu, 17 Oct 2024 15:39:19 +0000 (11:39 -0400)]
(track-changes--after): Fix problem found in bug#73041
When calling `track-changes--before` (e.g. because of a missing
b-f-c or for some other reason), it sets `track-changes--before-end`
to the right value so we shouldn't increment it right after.
Also, we should update `track-changes--buffer-size` before
calling `track-changes--before` so it doesn't risk signaling
a spurious inconsistency.
* lisp/emacs-lisp/track-changes.el (track-changes--after):
Update `track-changes--buffer-size` earlier, and don't increment
`track-changes--before-end` when we call `track-changes--before`.
Yuan Fu [Tue, 15 Oct 2024 02:31:12 +0000 (19:31 -0700)]
Fix c-ts-mode--anchor-prev-sibling (bug#73661)
* lisp/progmodes/c-ts-mode.el:
(c-ts-mode--anchor-prev-sibling): Fix parentheses and use a
slightly more efficient function.
* test/lisp/progmodes/c-ts-mode-resources/indent.erts: Replace
the tab in the test code with spaces.
Earl Hyatt [Sun, 13 Oct 2024 17:44:18 +0000 (13:44 -0400)]
Fix formatting of long keyboard macros by 'list-keyboard-macros'.
* lisp/kmacro.el (kmacro-menu--refresh): Include the second
argument of 'format-kbd-macro' so that the formatted keyboard
macro is on a single line. (Bug#73797)
Stefan Monnier [Thu, 17 Oct 2024 16:38:18 +0000 (12:38 -0400)]
mpc.el: Misc tweaks.
* lisp/mpc.el: Require `cl-lib` at run-time.
Don't require `subr-x` any more.
(mpc-status-callbacks): Improve docstring.
(mpc-cover-image-find): Avoid `and-let*`.
(mpc-cover-image-p): Use `member-ignore-case` to recover the
behavior before last patch.
(mpc-cover-image-find, mpc-cover-image-p): Move to later in the
file to avoid compiler warning.
(mpc-format, mpc-notifications-title, mpc-notifications-body):
Tweak docstring.
(mpc--notifications-format): Create only one temp buffer and use
the faster `cl-some` since we know the arg is a list.
(mpc-notifications-notify): Prefer `when-let*` since all the other
`*-let` we use are also of the `let*`family.
john muhl [Mon, 16 Sep 2024 00:52:25 +0000 (19:52 -0500)]
Add notifications support to 'mpc' (Bug#73538)
* lisp/mpc.el (mpc-notifications, mpc-notifications-title)
(mpc-notifications-body): New option.
(mpc--notifications-id): New variable.
(mpc-notifications-notify, mpc-cover-image-find)
(mpc-cover-image-p, mpc--notifications-format): New function.
(mpc-format): Use 'mpc-cover-find' and expand docstring to
include details about the FORMAT-SPEC.
(mpc-status-callbacks): Add file callback for
notifications.
Sean Whitton [Thu, 17 Oct 2024 13:14:45 +0000 (21:14 +0800)]
; * lisp/vc/vc.el: Drop some old notes
Firstly, we are unlikely to do any unifying, because both amend
capabilities have been around for a long time now and we don't
want to break people's usage. Secondly, there is now a plan for
dealing with dangerous git operations described in bug#64055.
* lisp/vc/log-view.el (log-edit): Require.
(log-view-modify-change-comment): When log-edit-hook would
insert an empty Summary header, prepend one to the old comment.
Sean Whitton [Thu, 17 Oct 2024 13:04:38 +0000 (21:04 +0800)]
New get-change-comment VC backend action
This gets us closer to using log-view-modify-change-comment with modern
VCS. What remains is implementing the modify-change-comment backend
action for those VCS.
* lisp/vc/vc.el: New get-change-comment backend action.
(vc-modify-change-comment): Pass the backend to vc-start-logentry.
* lisp/vc/log-view.el (log-view-extract-comment): Use new
get-change-comment action.
* lisp/vc/vc-git.el (vc-git-get-change-comment): Factor out of
vc-git-log-edit-toggle-amend.
Sean Whitton [Thu, 17 Oct 2024 12:57:07 +0000 (20:57 +0800)]
vc-start-logentry: Use current buffer as parent buffer more often
* lisp/vc/vc-dispatcher.el (vc-start-logentry): When determining
the parent buffer, if get-file-buffer returns nil, use the
current buffer. Also, if the first file is a directory, don't
try to call get-file-buffer, just use the current buffer.
Sean Whitton [Thu, 17 Oct 2024 12:11:53 +0000 (20:11 +0800)]
More consistently propertize Log Edit headers as fields
* lisp/vc/log-edit.el (log-edit--make-header-line): Factor out
of log-edit-insert-message-template.
(log-edit-set-header): Call log-edit--make-header-line so that
the Log Edit header is propertized as a field.
Jim Porter [Sat, 5 Oct 2024 05:26:01 +0000 (22:26 -0700)]
Add support for chaining conditionals in Eshell
* lisp/eshell/esh-cmd.el (eshell-structure-basic-command): Check for the
presence of the conditional. Allow any number of BODY forms.
(eshell-rewrite-if-command): Add support for 'else' keyword and chained
conditionals.
* test/lisp/eshell/esh-cmd-tests.el (esh-cmd-test/if-else-statement):
Test 'else' keyword.
(esh-cmd-test/if-else-statement-chain): New test.
* doc/misc/eshell.texi (Control Flow): Document this change.
Jim Porter [Sat, 5 Oct 2024 04:45:04 +0000 (21:45 -0700)]
Improve correctness of Eshell sub-forms
This makes sure that we treat Eshell sub-forms (whether Lisp or command
forms) as values when appropriate, or as regular invocations. This
requires a bit more explicit work, but helps to resolve some of the
surprising differences between Lisp and command forms in complex Eshell
statements.
* lisp/eshell/esh-cmd.el (eshell-subcommand-arg-values): Make obsolete.
(eshell-parse-lisp-argument): Don't add 'eshell-command-to-value' here.
(eshell-rewrite-sexp-command): Don't check for 'eshell-command-to-value
here'; instead check for 'eshell-lisp-command'.
(eshell-structure-basic-command): Check for 'eshell-lisp-command'.
(eshell-term-as-value): New function...
(eshell-rewrite-named-command, eshell-rewrite-for-command): ... call it.
Jim Porter [Wed, 18 Sep 2024 05:05:50 +0000 (22:05 -0700)]
Simplify creation of Eshell command forms
Previously, Eshell over-aggressively converted subcommands, which forced
control flow commands to undo that change.
* lisp/eshell/esh-cmd.el (eshell-pre-rewrite-command-hook): Remove
'eshell-subcommand-arg-values' call from here...
(eshell-rewrite-named-command): ... and put it here.
(eshell-invokify-arg): Make obsolete.
(eshell-structure-basic-command): Handle subcommand test forms.
(eshell-rewrite-for-command, eshell-rewrite-while-command)
(eshell-rewrite-if-command): Don't call 'eshell-invokify-arg'; it's not
necessary.
Add suffixes individually and use minor mode directly
* lisp/jka-cmpr-hook.el (jka-compr-install): Add jka-compr
suffixes individually with add-to-list rather than append.
* (with-auto-compression-mode): Use auto-compression-mode minor mode.
Alan Mackenzie [Wed, 16 Oct 2024 13:17:26 +0000 (13:17 +0000)]
CC Mode: Fix dodgy lisp `let' form.
* lisp/progmodes/cc-engine.el (c-forward-sws): Move a `setq'
form from out of a let binding. This form could have been
affected by the byte compiler bug bug#67116 before this was
fixed.
Alan Mackenzie [Tue, 15 Oct 2024 21:08:41 +0000 (21:08 +0000)]
CC Mode: Rationalize and optimize cache invalidation (2).
Replace separate syntax-table text property changes and cache
invalidation with macros which do both together. Correct a bug
in the invocation of XEmacs's map-extents.
* lisp/progmodes/cc-defs.el (c-put-syntax-table-trim-caches)
(c-clear-syntax-table-trim-caches)
(c-clear-syntax-table-properties-trim-caches)
(c-clear-syntax-table-with-value-trim-caches)
(c-clear-syntax-table-with-value-on-char-trim-caches)
(c-put-syntax-table-properties-on-char-trim-caches): New
macros.
(c-clear-char-properties, c-clear-char-property-with-value)
(c-clear-char-property-with-value-on-char): Correct the
invocation of XEmacs's map-extents by returning nil from the
mapping function to prevent premature exit from map-extents.
(c-clear-char-property-with-value-function)
(c-clear-char-property-with-value)
(c-clear-char-property-with-value-on-char-function)
(c-clear-char-property-with-value-on-char)
(c-put-char-properties-on-char): Enhance to return the position
of the first changed char property (or nil).
* lisp/progmodes/cc-awk.el
(c-awk-set-string-regexp-syntax-table-properties)
(c-awk-set-syntax-table-properties)
* lisp/progmodes/cc-engine.el
(c-depropertize-ml-string-delims)
(c-after-change-unmark-ml-strings, c-propertize-ml-string-id)
(c-propertize-ml-string-opener, c-depropertize-ml-string)
(c-depropertize-ml-strings-in-region)
* lisp/progmodes/cc-mode.el (c-depropertize-CPP)
(c-neutralize-CPP-line, c-put-syn-tab, c-clear-syn-tab)
(c-parse-quotes-before-change, c-parse-quotes-after-change)
(c-before-change-fix-comment-escapes)
(c-after-change-fix-comment-escapes): Use the new macros from
cc-defs.el.
* lisp/progmodes/cc-mode.el
(c-trim-cache-first-punctuation-prop): Remove.
(c-depropertize-CPP): Remove calls to the above function.
Dan Christensen [Fri, 11 Oct 2024 13:31:52 +0000 (15:31 +0200)]
Report correct unread count for nnimap groups
* lisp/gnus/nnimap.el (nnimap-request-group): Use '(1 . 0) range
as default, and calculate the actual range the same way as other
backends. (Bug@72949)
Yuan Fu [Tue, 8 Oct 2024 00:24:32 +0000 (17:24 -0700)]
Set treesit-primary-parser for tree-sitter modes
I debated whether to do this, since technically speaking it's
not needed for single-language modes. But ultimately it's
better to be explicit and set a good example with builtin modes.