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.
Michael Albinus [Sun, 13 Oct 2024 16:05:39 +0000 (18:05 +0200)]
Describe how to add an ELPA package to Tramp
* doc/misc/tramp.texi: Use @dots{} where appropriate.
(External packages): Rename subsection "Timers, process filters,
process sentinels, redisplay".
(Extension packages): New node.
(Top, Files directories and localnames): Add it to @menu.
Eli Zaretskii [Sat, 12 Oct 2024 17:55:47 +0000 (20:55 +0300)]
Improve face font selection on MS-Windows
* lisp/net/dictionary.el (dictionary-word-definition-face):
Special-case w32.
* lisp/faces.el (face-font-family-alternatives): Add a few modern
font families.
Pengji Zhang [Wed, 28 Aug 2024 11:11:35 +0000 (19:11 +0800)]
Improve tests for flow-fill
* test/lisp/mail/flow-fill-tests.el
(fill-flow-tests-fill-flowed-decode): Remove debug message.
(fill-flow-tests-fill-flowed-encode): Actually test function
`fill-flowed-encode', which requires `use-hard-newline' to be
non-nil. Also adjust test input to check behavior of the
function under different cases. (Bug#72870)
Pengji Zhang [Wed, 28 Aug 2024 10:57:35 +0000 (18:57 +0800)]
Flow fill texts after the last hard newline
* lisp/mail/flow-fill.el (fill-flowed-encode): Use `(point-max)'
as `end' if there are no remaining hard newlines in buffer.
This ensures that the last paragraph will always be encoded,
even without a trailing hard newline. (Bug#72870)
Diancheng Wang [Tue, 8 Oct 2024 03:11:24 +0000 (11:11 +0800)]
Stop highlighting current line when debuggee is running
* lisp/progmodes/gud.el (gud-hide-current-line-indicator): New
function.
(gud-sentinel):
* lisp/progmodes/gdb-mi.el (gdb-starting): Use it. (Bug#73687)
F. Jason Park [Fri, 11 Oct 2024 21:25:43 +0000 (14:25 -0700)]
Use erc-compat analog for window-no-other-p
* lisp/erc/erc-compat.el (erc-compat--window-no-other-p): New function.
* lisp/erc/erc-speedbar.el (erc-speedbar-toggle-nicknames-window-lock):
Use compat adapter for `window-no-other-p'.
F. Jason Park [Thu, 10 Oct 2024 23:17:03 +0000 (16:17 -0700)]
Add baseline test coverage for erc-match
* lisp/erc/erc-match.el (erc-pal-highlight-type)
(erc-fool-highlight-type, erc-dangerous-host-highlight-type): Clarify
some areas in doc strings.
* test/lisp/erc/erc-match-tests.el: Require `erc-test-common' library.
(erc-match-tests--assert-face-absent)
(erc-match-tests--assert-face-present)
(erc-match-tests--assert-speaker-highlighted)
(erc-match-tests--assert-speaker-only-highlighted)
(erc-match-tests--perform)
(erc-match-tests--hl-type-nick): New functions.
(erc-match-message/pal/nick, erc-match-message/fool/nick)
(erc-match-message/dangerous-host/nick): New tests.
(erc-match-tests--hl-type-message): New function.
(erc-match-message/pal/message)
(erc-match-message/fool/message)
(erc-match-message/dangerous-host/message): New tests.
(erc-match-tests--hl-type-all): New function.
(erc-match-message/pal/all, erc-match-message/fool/all)
(erc-match-message/dangerous-host/all): New tests.
(erc-match-tests--hl-type-nick-or-keyword): New function.
(erc-match-message/current-nick/nick-or-keyword): New test.
(erc-match-tests--hl-type-keyword): New function.
(erc-match-message/keyword/keyword): New test.
(erc-match-tests--log-matches): New function.
(erc-log-matches): New test.
* test/lisp/erc/resources/erc-tests-common.el: Require `erc-d-i'.
(erc-tests-common-add-cmem, erc-tests-common-parse-line)
(erc-tests-common-simulate-line)
(erc-tests-common-simulate-privmsg): New functions.
F. Jason Park [Fri, 27 Sep 2024 04:34:25 +0000 (21:34 -0700)]
Crystallize erc-nicks-track-faces behavior
* etc/ERC-NEWS: Mention changes to `erc-track-faces-normal-list' and
`erc-track-faces-priority-list'. Also mention new choice variant for
option `erc-nicks-track-faces', although that's arguably just a bug fix
because it makes good on previously unrealized behavior implied by the
doc strings.
* lisp/erc/erc-nicks.el (erc-nicks-skip-faces): Remove faces applied by
the `match' module, namely, `erc-current-nick-face', `erc-pal-face', and
`erc-fool-face'. That module runs its hooks after `button' on
`erc-insert-modify-hook', and because `nicks' piggybacks on `button', it
can never encounter those faces while assaying.
(erc-nicks-track-faces): Update doc, and introduce new `t' value choice.
(erc-nicks-mode, erc-nicks-disable): Update removals from
`erc-track--alt-normals-function' to reflect recent renamings.
(erc-nicks--reject-uninterned-faces): Use helper.
(erc-nicks--oursp, erc-nicks--ours-p): Rename former to latter to
respect project style guidelines regarding predicates.
(erc-nicks-track-normal-max-rank): New variable.
(erc-nicks--check-normals, erc-nicks--assess-track-faces): Rename former
to latter, and change purpose to checking for "normals" membership,
ranks position, and incumbent face ownership. Remove unused CONTENDERS
parameter. Additionally, change behavior to consider replacing the
current mode-line face when it's not `nicks' owned if it's explicitly
ranked lower than `erc-default-face'.
(erc-nicks--track-prioritize, erc-nicks--track-always): New
complementary functions implementing the t and `prioritize' variants of
`erc-nicks-track-faces'. Both make use of the factored-out
`erc-nicks--check-normals' logic.
(erc-nicks--setup-track-integration): Add `erc-nicks--track-always' to
`erc-track--alt-normals-function' when `erc-track-normal-faces' is t.
* lisp/erc/erc-track.el (erc-track--massage-nick-button-faces): Change
type of symbol property `erc-track--obsolete-faces' for options
`erc-track-faces-priority-list' and friends from a boolean to an alist.
(erc-track-faces-priority-list): Add new face for buttonized speakers.
(erc-track-faces-normal-list): Add new face for buttonized speakers.
Also add `erc-notice-face'.
(erc-track--priority-faces): New local variable to cache ranked faces
and complement `erc-track--normal-faces'.
(erc-track--setup): Initialize new `erc-track--priority-faces' variable,
and refactor.
(erc-track--alt-normals-function): Doc.
(erc-track--select-mode-line-face): Update expected type of `ranks'
parameter.
(erc-track-modified-channels): Fix wrong-type bug occurring when
`erc-track-ignore-normal-contenders-p' and
`erc-track-priority-faces-only' are both non-nil. Also fix subtle
compatibility oversight regarding an empty face list returned by
`erc-track--collect-faces-in'.
* test/lisp/erc/erc-nicks-tests.el: Load helpers and fixtures library.
(erc-nicks-tests--track-faces): New function.
(erc-nicks-track-faces/prioritize, erc-nicks-track-faces/defer)
(erc-nicks-track-faces/nil, erc-nicks-track-faces/t): New tests.
* test/lisp/erc/erc-track-tests.el
(erc-track-tests--select-mode-line-face): Update expected type of mocked
parameter.
(erc-track-tests--modified-channels/baseline): New function.
(erc-track-modified-channels/baseline)
(erc-track-modified-channels/baseline/mention)
(erc-track-modified-channels/baseline/ignore)
(erc-track-modified-channels/baseline/mention/ignore)
(erc-track-modified-channels/priority-only-all/baseline)
(erc-track-modified-channels/priority-only-all/sans-notice): New tests.
* test/lisp/erc/resources/erc-tests-common.el
(erc-tests-common-track-modified-channels)
(erc-tests-common-track-modified-channels-sans-setup): New functions.
(Bug67767)
F. Jason Park [Mon, 30 Sep 2024 09:10:02 +0000 (02:10 -0700)]
Don't create directory in erc-truncate compat check
* lisp/erc/erc-log.el (erc-log--check-writable-nocreate-p): New variable.
(erc-logging-enabled): Use `erc-log--save-in-progress-p' flag to
conditionally avoid creating a directory when checking if the location
is writable.
(erc-log--call-when-logging-enabled-sans-module)
(erc-log--check-legacy-implicit-enabling-by-truncate): Rename former to
latter, and guard against creating a ~/log directory just to see if it's
writable when calling `erc-logging-enabled'.
(erc-truncate-mode): Explain legacy "implicit logging" behavior in doc
string.
* lisp/erc/erc-truncate.el (erc-truncate--warn-about-logging): Make more
concise, and defer to `erc-truncate-mode' doc string for particulars.
* lisp/erc/erc.el (erc-directory-writable-p): Add comment to rename on
next non-patch release.
F. Jason Park [Wed, 2 Oct 2024 23:41:39 +0000 (16:41 -0700)]
; Add face customization to ERC's sample config
* doc/misc/erc.texi (Sample Configuration): Move `erc-modules' twiddling
from a `use-package' :config section to a :custom section. In the past,
this would sometimes provoke module-loading issues, but it seems to work
fine on Emacs 30, even with repeated eval'ing of the `use-package' form.
This sample config is meant for users running the latest release anyhow.
Also add a new `use-package' block for `erc-match' showing how to
customize a face using inheritance. Add a corresponding section further
down showing the same via Customize.