Dmitry Gutov [Fri, 15 Dec 2023 23:48:29 +0000 (01:48 +0200)]
(vc-print-log-setup-buttons): Start "previous" history with specified revision
* lisp/vc/vc-git.el (vc-git-file-name-changes-switches): Remove
the comment above the option. Seems unnecessary now.
* lisp/vc/vc.el (vc-print-log-setup-buttons): Start the "previous"
change history buffer with the specified revision, rather than
have the sentinel jump to it. Apparently in some cases the
history of the old name can't be found. In others, the log just
shows faster. But note the caveat described in the second new
comment (bug#55871).
Dmitry Gutov [Fri, 15 Dec 2023 23:36:47 +0000 (01:36 +0200)]
Show buttons below vc-log even when REVISION is specified
E.g. in the vc-print-branch-log which specifies start revision.
* lisp/vc/vc.el (vc-print-log-internal): Remove outdated comment.
(vc-print-log-setup-buttons): Only special-case non-nil
IS-START-REVISION when LIMIT=1. We often do need buttons for logs
that start with a particular revision, because those are still limited
by vc-log-show-limit.
Dmitry Gutov [Fri, 15 Dec 2023 20:26:59 +0000 (22:26 +0200)]
Support viewing VC change history across renames (Git, Hg)
* lisp/vc/vc.el (vc-print-log-setup-buttons):
When the log ends at a rename, add a button to jump to the
previous names. Use the new backend action 'file-name-changes'.
João Távora [Thu, 14 Dec 2023 22:56:33 +0000 (22:56 +0000)]
Jsonrpc: add new jsonrpc-autoport-bootstrap helper
This will help Eglot and some other extensions connect to network
servers that are started with a call to a local program.
* lisp/jsonrpc.el (jsonrpc--process-sentinel): Also delete inferior.
(jsonrpc-process-connection): Add -autoport-inferior slot.
(initialize-instance jsonrpc-process-connection): Check
process-creating function arity. Use jsonrpc-forwarding-buffer
(jsonrpc-autoport-bootstrap): New helper.
(Version): Bump to 1.0.20.
João Távora [Thu, 14 Dec 2023 16:32:54 +0000 (16:32 +0000)]
Eglot: beware activation in fundamental-mode
In the specific situation of visiting a buffer via M-. with
eglot-extend-to-xref set to t, it was found that buffer was first
visited in fundamental mode, running after-change-major-mode-hook, and
then again in the proper major mode for the file. The call to
eglot-current-server of the first visit returned non-nil which cause
two didOpen notifications to be issued for the same file.
Furthermore, in the first call, eglot--languageId to returned nil,
prompting an error from servers such as rust-analyzer.
See also: https://github.com/joaotavora/eglot/discussions/1330
* lisp/progmodes/eglot.el (eglot-current-server): Watch out for
fundamental-mode.
Po Lu [Thu, 14 Dec 2023 05:24:42 +0000 (13:24 +0800)]
Respect Language & Input preferences under Android
* doc/emacs/android.texi (Android Environment):
* doc/emacs/cmdargs.texi (General Variables): Mention the manner
in which the default language environment is selected on
Android.
* lisp/startup.el (normal-top-level): If android and
initial-window-system, call android-locale-for-system-language
for the default locale name.
* lisp/term/android-win.el (android-locale-for-system-language):
New function.
* src/androidfns.c (syms_of_androidfns_for_pdumper): New
function.
(syms_of_androidfns) <Vandroid_os_language>: New variable.
Call syms_of_androidfns_for_pdumper both now and after
loading the dump image.
João Távora [Mon, 11 Dec 2023 00:01:03 +0000 (00:01 +0000)]
Jsonrpc: rework fix for bug#60088
Try to decouple receiving text and processing messages in the event
loop. This should allow for requests within requests in both Eglot
and the Dape extension (https://github.com/svaante/dape).
jsonrpc-connection-receive is now called from timers after the process
filter finished. Because of this, a detail is that any serialization
errors are now thrown from timers instead of the synchronous process
filter, and there's no good way to test this in ert, so a test has
been deleted.
Eric Abrahamsen [Fri, 8 Dec 2023 17:39:58 +0000 (09:39 -0800)]
Provide option to forward Gnus messages with all (most) headers
Bug#67520
* lisp/gnus/gnus-msg.el (gnus-summary-mail-forward): Accept symbolic
prefix to let-bind message-forward-included-headers to nil, which will
include most original message headers in the forwarded copy.
(gnus-summary-post-forward): Corresponding arglist update.
Stefan Kangas [Sun, 10 Dec 2023 21:06:54 +0000 (22:06 +0100)]
Mark `;#@` as :safe for asm-comment-char
* lisp/progmodes/asm-mode.el (asm--safe-comment-char-p): New function
that returns true for characters #, @, and ;.
(asm-comment-char): Use new function as :safe predicate.
Stefan Kangas [Sun, 10 Dec 2023 21:04:51 +0000 (22:04 +0100)]
; Use ?c instead of integer in local variables
* exec/loader-armeabi.s (timespec):
* exec/loader-mips64el.s (__start):
* exec/loader-mipsel.s (__start): Use ?c instead of integer in local
variables.
Yuan Fu [Sun, 10 Dec 2023 09:24:25 +0000 (01:24 -0800)]
Fix c-ts-mode indent heuristic (bug#67417)
This is a continuation of the first two patches for bug#67417. The
c-ts-mode--prev-line-match heuristic we added is too broad, so for now
we are just adding a very specific heuristic for the else case.
* lisp/progmodes/c-ts-mode.el:
(c-ts-mode--prev-line-match): Remove function.
(c-ts-mode--else-heuristic): New function.
(c-ts-mode--indent-styles): Use c-ts-mode--else-heuristic.
nverno [Wed, 22 Nov 2023 00:33:04 +0000 (16:33 -0800)]
Fix c-ts-mode indentation (bug#67357)
1. In a compund_statement, we indent the first sibling against the
parent, and the rest siblings against their previous sibling. But
this strategy falls apart when the first sibling is not on its own
line. We should regard the first sibling that is on its own line as
the "first sibling"", and indent it against the parent.
2. In linux style, in a do-while statement, if the do-body is
bracket-less, the "while" keyword is indented to the same level as the
do-body. It should be indented to align with the "do" keyword
instead.
* lisp/progmodes/c-ts-mode.el:
(c-ts-mode--no-prev-standalone-sibling): New function.
(c-ts-mode--indent-styles): Use
c-ts-mode--no-prev-standalone-sibling. Add while keyword indent rule.
* test/lisp/progmodes/c-ts-mode-resources/indent.erts: New tests.
Dmitry Gutov [Sat, 9 Dec 2023 17:04:55 +0000 (19:04 +0200)]
ruby-mode: Better detect regexp vs division (bug#67569)
* lisp/progmodes/ruby-mode.el (ruby-syntax-before-regexp-re):
Add grouping around methods from the whitelist.
(ruby-syntax-propertize): Also look for spaces around the slash.
Manuel Giraud [Sat, 9 Dec 2023 12:02:19 +0000 (13:02 +0100)]
Fix desktop-save for dired buffers (bug#66697)
* lisp/dired.el (dired-desktop-save-p): Move all logic here. Carry on
when 'desktop-files-not-to-save' is nil.
(dired-desktop-buffer-misc-data): Use it.
Eshel Yaron [Tue, 5 Dec 2023 20:04:43 +0000 (21:04 +0100)]
; Hide completion preview when switching windows
* lisp/completion-preview.el
(completion-preview--window-selection-change): New function.
(completion-preview-active-mode): Add it to
'window-selection-change-functions'. (Bug#67650)
Remove old VC packages from 'package-alist' after installing
* lisp/emacs-lisp/package-vc.el (package-vc--unpack-1): Wait for all
system operations to have been completed, before proceeding to remove
old package descriptors from 'package-alist'. This avoids loosing a
package if an error occurs during upgrades.
Jared Finder [Sat, 9 Dec 2023 08:17:05 +0000 (10:17 +0200)]
Fix dragging mode line on text terminals with a mouse (bug#67457)
* lisp/xt-mouse.el (xterm-mouse-translate-1): Fix the 'event-kind'
property of mouse-movement symbols emitted by xt-mouse.
* lisp/term/linux.el (terminal-init-linux): Call 'gpm-mouse-mode'
to set up the terminal for the mouse, if needed.
Po Lu [Sat, 9 Dec 2023 03:49:04 +0000 (11:49 +0800)]
Correct phantom point generation and MDAP
* src/sfnt.c (sfnt_interpret_mdrp): Cease applying cvt
cut in, as this is contrary to the specification.
(sfnt_interpret_simple_glyph): Correct typo.
(main): Revise tests.
Dmitry Gutov [Fri, 8 Dec 2023 20:30:48 +0000 (22:30 +0200)]
project-any-command: Change the method for passing project root
* lisp/progmodes/project.el (project-any-command): Change the
check which decides whether 'project-current-directory-override'
should be used. Instead of looking in project-prefix-map, see
whether the command's name starts with 'project-', or the symbol
has the property 'project-command' (bug#67171).
Eric Abrahamsen [Fri, 8 Dec 2023 17:48:51 +0000 (09:48 -0800)]
Ensure CID filenames are unique when browsing Gnus article HTML
Bug#67002
* lisp/gnus/gnus-art.el (gnus-article-browse-html-save-cid-content):
It's possible that multiple CID parts will have the same filename,
leading to temporary files clobbering one another during browsing.
This ensures that the temporary filenames are unique.
This allow showing a basic preview buffer or no preview buffer at all.
* lisp/register.el (register-use-preview): Use choice with three
options.
(register-read-with-preview): Use a basic buffer without navigation,
highlighting etc... when register-use-preview is nil, and no buffer
at all when set to 'never.
Po Lu [Fri, 8 Dec 2023 02:55:02 +0000 (10:55 +0800)]
Display glyphs whose first contours commence at origin
* src/sfnt.c (sfnt_build_append): Don't disregard redundant
motion if outline is empty. Problem encountered in the "M"
glyph within Source Code Pro VF Italic.
Dmitry Gutov [Fri, 8 Dec 2023 02:12:21 +0000 (04:12 +0200)]
js-ts-mode: Highlight property shorthands in assignments
* lisp/progmodes/js.el (js--treesit-lhs-identifier-query): Match
property shorthands (which turn into variable reference).
(js--treesit-fontify-assignment-lhs): Use the matches.
Dmitry Gutov [Fri, 8 Dec 2023 01:58:18 +0000 (03:58 +0200)]
(js--treesit-font-lock-settings): Highlight parameters in function expression
* lisp/progmodes/js.el (js--treesit-font-lock-settings):
Highlight parameters in a function expression (the node type
'function'). Make the matcher for 'formal_parameters' independent
of the parent, that just created duplication.
Dmitry Gutov [Fri, 8 Dec 2023 01:48:45 +0000 (03:48 +0200)]
(js--treesit-font-lock-settings): Remove some duplicates
* lisp/progmodes/js.el (js--treesit-font-lock-settings):
Remove queries from 'function' that duplicate entries in
'definition' (one of them with a typo).
* lisp/net/tramp-crypt.el (tramp-crypt-file-name-p): Exclude lock files.
(tramp-crypt-file-name-handler-alist): Use `identity' for
`abbreviate-file-name'.
(tramp-crypt-add-directory, tramp-crypt-remove-directory):
Adapt docstrings.
(tramp-crypt-cleanup-connection): New defun. Add it to
`tramp-cleanup-connection-hook'
Liu Hui [Thu, 16 Nov 2023 03:45:28 +0000 (11:45 +0800)]
Add option eshell-history-append
* lisp/eshell/em-hist.el (eshell-history-append): New option.
(eshell--save-history): New function.
(eshell-hist-initialize):
(eshell-save-some-history): Replace eshell-write-history with
eshell--save-history, which respects the new option.
* doc/misc/eshell.texi (History): Document the change.
* etc/NEWS: Announce the change. (Bug#66700)
João Távora [Tue, 5 Dec 2023 21:40:49 +0000 (15:40 -0600)]
ElDoc: make eldoc-display-in-echo-are useful from M-x eldoc
M-x eldoc is ElDoc's interactive entry point for on-demand
documentation for users that don't want the behind-the-scenes idle
timer behaviour.
However, eldoc-display-in-echo-area, a member of
eldoc-display-functions, refused to do anything because it thought it
didn't have permission to use the echo area, which isn't true
in interactive use cases. Fix that.
See also: https://github.com/joaotavora/eglot/discussions/1328
* lisp/emacs-lisp/eldoc.el (eldoc-display-in-echo-area): Use
INTERACTIVE argument. Rework comments.
(Version): Bump to 1.15.0
Stefan Monnier [Tue, 5 Dec 2023 19:24:45 +0000 (14:24 -0500)]
(package-activate-all): Be more robust when quickstart fails
Quickstart can fail in all kinds of ways, for example if a package
was removed without updating the quickstart file.
* lisp/emacs-lisp/package.el (package-activate-all): Revert to the slow
path if the quickstart signals an error.
(package--activate-all): Fix compilation warning without an autoload.
Jens Schmidt [Mon, 20 Nov 2023 22:42:01 +0000 (23:42 +0100)]
Update handling of advices during preload
* lisp/emacs-lisp/comp-common.el
(native-comp-never-optimize-functions): Remove macroexpand and
rename-buffer from default value.
* lisp/emacs-lisp/comp.el (comp-call-optim-form-call): Document call
optimization for advised primitives.
* lisp/emacs-lisp/nadvice.el (advice-add): Remove references to TODOs
that were completed already earlier.
* lisp/loadup.el: Disallow advices during preload. (Bug#67005)