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).
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).
rust-ts-mode--comment-docstring: Fix/improve the previous change
* lisp/progmodes/rust-ts-mode.el
(rust-ts-mode--comment-docstring): Match also "inner" line docs.
Stop rebinding 'end' and use the argument's value in the
'treesit-fontify-with-override' call.
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.
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.
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)
Eshel Yaron [Sun, 3 Dec 2023 19:44:16 +0000 (20:44 +0100)]
Optionally ask for confirmation before overwriting registers
Commands can now call 'register-read-with-preview' with optional
argument CONFIRM to ask the user for confirmation if they choose a
register that is already in use, subject to new user option
'register-confirm-overwrite'. Commands that write to registers are
adapted to make use of this new argument. When asking for
confirmation, Emacs also highlights the selected register in
the *Register Preview* buffer.
* lisp/register.el (register-confirm-overwrite): New user option.
(register-preview): New optional argument HIGHLIGHT.
(register-read-with-preview): Use them. New optional arg CONFIRM.
(point-to-register,window-configuration-to-register)
(frame-configuration-to-register,number-to-register)
(copy-to-register,copy-rectangle-to-register)
* lisp/textmodes/picture.el (picture-clear-rectangle-to-register)
* lisp/calc/calc-yank.el (calc-copy-to-register)
* lisp/cedet/semantic/senator.el (senator-copy-tag-to-register)
* lisp/frameset.el (frameset-to-register)
* lisp/kmacro.el (kmacro-to-register)
* lisp/play/gametree.el (gametree-layout-to-register): Use new arg.
* doc/lispref/text.texi (Registers): Update.
* etc/NEWS: Announce.
* 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)
Spencer Baugh [Thu, 23 Nov 2023 13:37:29 +0000 (13:37 +0000)]
Deselect the selected completion candidate when typing
minibuffer-choose-completion-or-exit submits the selected completion
candidate, if any, ignoring the contents of the minibuffer. But a
user might select a completion candidate and then want to type
something else in the minibuffer and submit what they typed.
Now typing will automatically deselect the selected completion
candidate so that minibuffer-choose-completion-or-exit will not choose
it.
minibuffer-choose-completion has the same behavior as before, and is
not affected by the deselection.
* lisp/minibuffer.el (completion-auto-deselect, completions--deselect)
(completions--after-change): Add.
(minibuffer-completion-help): Add completions--after-change hook.
(minibuffer-next-completion): Bind completion-auto-deselect to nil to
avoid immediately deselecting the completion.
(minibuffer-choose-completion-or-exit): Bind
choose-completion-deselect-if-after so deselection takes effect.
(display-completion-list): Guarantee a newline at the beginning of
*Completions* to avoid ambiguity about candidate selection.
* lisp/simple.el (choose-completion-deselect-if-after): Add.
(choose-completion): Check choose-completion-deselect-if-after.
* etc/NEWS: Announce.
Eli Zaretskii [Sun, 3 Dec 2023 16:29:09 +0000 (18:29 +0200)]
Improve 'window-text-pixel-size' when buffer includes images
* src/xdisp.c (window_text_pixel_size): Fix computation of Y when
IGNORE_LINE_AT_END is non-nil and there's a 'display' property at
TO. Improve movement to beginning of screen line at start. Fix
computation of Y when lines are truncated and a line begins with a
'display' property at TO.
(produce_image_glyph): Don't crop image glyph when word-wrap is in
effect. (Bug#67533)
Vladimir Kazanov [Sun, 26 Nov 2023 11:48:16 +0000 (11:48 +0000)]
Add ert-font-lock
Add ert-font-lock as well as unit tests and testing resources.
* lisp/emacs-lisp/ert-font-lock.el: New library.
* test/lisp/emacs-lisp/ert-font-lock-resources/broken.js:
* test/lisp/emacs-lisp/ert-font-lock-resources/correct.js:
* test/lisp/emacs-lisp/ert-font-lock-tests.el: Unit tests.
(Bug#67460)
Eli Zaretskii [Sat, 2 Dec 2023 15:05:51 +0000 (10:05 -0500)]
Merge from origin/emacs-29
5f882f4ee97 ; Fix doc string punctuation in ruby-ts-mode.el. 546a68925c9 Fix 'Info-goto-node-web' when NODE is given in various forms 7ff943044e9 Fix setting cursor when the window's op line has 'line-pr... 7f0bef47ddd Drop extra parenthesis in example code in Emacs Lisp Intr... fbaf113bf38 rust-ts-mode: appropriately fontify doc strings bd62bdbc680 Fix example code in Emacs Lisp Introduction manual c7e459132a9 Fix example in Emacs Lisp Intro manual a6e9c26c8f4 ; * doc/emacs/files.texi (Save Commands): Fix last change. f6a06ed6c5d Elisp manual: Mention 'write-region' for saving the buffer 4774a3abb4b Document, that PROCESS of signal-process can be a string ab126284081 Fix typescript-ts-mode indentation for switch statements
Eli Zaretskii [Sat, 2 Dec 2023 15:05:50 +0000 (10:05 -0500)]
Merge from origin/emacs-29
cd477bf07d8 Fix behavior of 'split-root-window-*' with 'C-u' 2e5d47f578a ; * doc/lispintro/emacs-lisp-intro.texi (copy-to-buffer):... c46700deb0a Add more text to clarify the behavior of 'with-current-bu... 687c416ce9b Fix example in Emacs user manual 835902179cd ; Fix recent change in 'c-ts-mode' 169a5ff7524 ; Fix typo in Gnus manual (bug#67469). 30841c71a5d Mention Titankey in Tramp, which has passed the tests dab7cc241f4 Fix c-ts-mode indentation after if/else (bug#67417) f8d9dc26c78 Fix indentation for else clause in c-ts-mode (bug#67417) bf0b0c9c73d Ensure that directory is expanded in package-vc-checkout e551dd72f79 * etc/PROBLEMS: Add entry about pinentry with gpgsm. (Bu...
john muhl [Tue, 14 Nov 2023 22:25:43 +0000 (16:25 -0600)]
Improve font-locking in lua-ts-mode (bug#67554)
* lisp/progmodes/lua-ts-mode.el (lua-ts-mode): Move property
highlighting to level 4.
(lua-ts--keywords): Remove `true', `false' and `nil' from
keywords.
(lua-ts--font-lock-settings): Highlight assignments, functions
and labels in more places. Distinguish comment delimiters.
(lua-ts--comment-font-lock): New function.
Eli Zaretskii [Sat, 2 Dec 2023 13:25:08 +0000 (15:25 +0200)]
Fix 'Info-goto-node-web' when NODE is given in various forms
* lisp/info.el (Info-goto-node-web): Support all forms of node
input, per 'Info-read-node-name's documentation, and extract
FILENAME from NODE if given there. Default NODE to "Top" if not
provided by the user. (Bug#67531)
(Info-url-for-node): Support browsing the "Top" node.
Eshel Yaron [Sun, 26 Nov 2023 16:00:32 +0000 (17:00 +0100)]
Facilitate using Completion Preview with the mouse (bug#67479)
Allow users to accept the completion suggestion by clicking on it, and
to cycle between completion suggestions by scrolling (with a mouse
wheel or a trackpad) over the preview.
Also display a message by default when cycling to inform the user
about the index of the current suggestion out of the available total.
* lisp/completion-preview.el (completion-preview-highlight): New face.
(completion-preview-message-format): New user option.
(completion-preview--mouse-map): New keymap.
(completion-preview--try-table, completion-preview--show)
(completion-preview-next-candidate): Apply 'keymap' and 'mouse-face'
properties to completion preview string.
(completion-preview--internal-commands): Add 'mwheel-scroll'. This
prevents incidental scrolls outside of the preview from dismissing the
preview when you actually want to cycle it.
(completion-preview--active-p): New function. Use it as a
'completion-predicate' symbol property for commands that should only
be used when the preview is shown to otherwise exclude these commands
from M-x completion candidates.
We need to print the string representation (one char) of an eventual
key description e.g. "^X" instead of "C-x".
However the key description is still displayed in a display property.
* lisp/register.el (register-preview-default): Use `string' to print register.
* lisp/progmodes/rust-ts-mode.el
(rust-ts-mode--comment-docstring): New function.
(rust-ts-mode--font-lock-settings): Use it
(https://lists.gnu.org/archive/html/emacs-devel/2023-12/msg00019.html).
Eli Zaretskii [Fri, 1 Dec 2023 12:15:30 +0000 (14:15 +0200)]
Fix mode-line-inactive face
* src/xfaces.c (Finternal_set_lisp_face_attribute): Fix validation
of the :style attribute of :box. Previously, nil for :style was not
accepted, which causes 'mode-line-inactive' face to be rejected.
(Bug#67567)
Eli Zaretskii [Fri, 1 Dec 2023 08:47:27 +0000 (10:47 +0200)]
Fix example in Emacs Lisp Intro manual
* doc/lispintro/emacs-lisp-intro.texi (beginning-of-buffer opt
arg): Fix indentation in example. Reported by Xiyue Deng
<manphiz@gmail.com>. (Bug#67560)
Eli Zaretskii [Thu, 30 Nov 2023 15:17:02 +0000 (17:17 +0200)]
Fix validation of :box face attribute
* src/xfaces.c (Finternal_set_lisp_face_attribute): Fix the logic
of validating the :box attribute. The previous code would always
allow invalid attributes of :box as long as the invalid attribute
was the last in the list. (Bug#67404)
Ulrich Müller [Wed, 29 Nov 2023 09:24:06 +0000 (10:24 +0100)]
Update Calc units table
* lisp/calc/calc-units.el (math-standard-units): Update to 2018
CODATA adjustment. Use exact value for V0. Update some spellings,
e.g. "Planck constant" instead of "Planck's constant".
* lisp/indent.el (indent-for-tab-command): Use `syntax-class` to fix
longstanding thinko introduced back in 2020 in commit 64c851166442.
Rework the check for `syn` because TAB always completed when
`tab-first-completion` had value `word-or-paren` or `word-or-paren-or-punct`.
Eli Zaretskii [Wed, 29 Nov 2023 14:14:03 +0000 (16:14 +0200)]
Fix behavior of 'split-root-window-*' with 'C-u'
* lisp/window.el (split-root-window-below)
(split-root-window-right): Fix the 'interactive' form to work with
raw 'C-u' as well. (Bug#67459)
(split-window-below, split-window-right, split-root-window-below)
(split-root-window-right): Doc fix.
A minibuffer is used now instead of read-key.
Registers in preview buffer are now filtered according to type of
registers the current command requires.
Navigation with C-n/p or up/down is now provided and update
minibuffer.
Current register is highlighted in preview buffer.
* lisp/register.el: (register-preview-default-keys)
(register-use-preview): New user variables.
(register-preview-info): New structure to store various info for
preview.
(register-command-info): New generic.
(register-preview-forward-line): New, provide navigation in preview
buffer.
(register-preview-next, register-preview-previous): New, navigation.
(register-type): New, returns register type.
(register--type): Generic fn, new, returns register type according
to value.
(register-of-type-alist): New, filter register-alist according to
type.
(register-preview): Signature changed, use TYPES now.
(register-preview-get-defaults): New generic, compute defauts
according to action.
(register-read-with-preview): Now use read-from-minibuffer and
minibuffer-setup-hook.
* lisp/emacs-lisp/cl-generic.el: Add a call to
'cl--generic-prefill-dispatchers' to fix a build error.
Various improvements to font-lock-settings for elixir-ts-mode
Changes and made from conversations from the Elixir slack channel,
the github issue
https://github.com/wkirschbaum/elixir-ts-mode/issues/35 and bug#67246.
* lisp/progmodes/elixir-ts-mode.el
(elixir-ts--font-lock-settings): Update features.
(elixir-ts-mode): Update treesit-font-lock-feature-list.
(elixir-ts-font-comment-doc-identifier-face): Rename to
elixir-ts-comment-doc-identifier.
(elixir-ts-font-comment-doc-attribute-face): Rename to
elixir-ts-comment-doc-attribute.
(elixir-ts-font-sigil-name-face): Rename to elixir-ts-sigil-name.
(elixir-ts-atom-key-face)
(elixir-ts-keyword-key-face)
(elixir-ts-attribute-face): Add new custom face.