Stefan Monnier [Thu, 21 Sep 2023 15:47:31 +0000 (11:47 -0400)]
regex-emacs.c (mutually_exclusive_aux): Rework again
Rework the way we handle loops. This new code does not really work
better than the previous one, but it has the advantage of being "fail
safe" and also that we can dynamically check if our assumptions about
the shape of the bytecode are satisfied or not.
* src/regex-emacs.c (mutually_exclusive_aux): Replace `done_beg` and
`done_end` with `loop_beg` and `loop_end`.
(mutually_exclusive_p): Adjust accordingly.
(analyze_first): Fix incorrect assertion.
Alan Mackenzie [Wed, 20 Sep 2023 15:51:17 +0000 (15:51 +0000)]
Insert symbol `debug' into two condition-case handlers
This fixes bug#65622. Also correct a mismatch between a
function to which advice is added, and that from which it is
removed.
* lisp/emacs-lisp/macroexp.el (internal-macroexpand-for-load):
Add a `debug' to the condition-case handler for `error', so
that a useful backtrace will be produced on a macro expansion
error.
* lisp/progmodes/elisp-mode.el (elisp--local-variables): Add
`debug' to a condition-case handler, as above. In the
advice-remove call, give the same function, macroexpand-1, as
in the corresponding advice-add call.
João Távora [Wed, 20 Sep 2023 10:00:19 +0000 (11:00 +0100)]
Eglot: better consider diagnostics at point on code action requests
* lisp/progmodes/eglot.el (eglot--code-action-bounds): Rename from
eglot--code-action-bounds. Rework to consider diagnostics.
(eglot-code-actions): Use new eglot--code-action-bounds.
(eglot--code-action): Use new eglot--code-action-bounds.
Paul Eggert [Wed, 20 Sep 2023 08:04:32 +0000 (01:04 -0700)]
Fix off-by-1 typo in vadd_to_log
* src/xdisp.c (vadd_to_log): Fix off-by-1 typo that I introduced
in commit fbee6265a72a4129d2efbf15a622b13e8b4aae9f
dated Thu Aug 13 13:48:28 2015 -0700.
Problem and fix reported by Robert Pluim (Bug#66098#11).
Juri Linkov [Tue, 19 Sep 2023 17:51:07 +0000 (20:51 +0300)]
* lisp/tab-bar.el (tab-bar-auto-width): Don't check if width changes.
Remove the condition '(< curr-width prev-width)' that was intended to check
if the width stopped to change. But actually it's not only unneeded,
but causes a bug: when the name contains a combining character, then
the width doesn't change, and the name truncation stops too early.
Don't use pointer arithmetic for pointer tagging (bug#65491)
This makes for safer code when tagging null pointers in particular,
since pointer arithmetic on NULL is undefined and therefore can be
assumed, by the compiler, not to occur.
* src/lisp.h (untagged_ptr): Remove.
(TAG_PTR): Cast to uintptr_t instead of untagged_ptr.
* doc/misc/modus-themes.org
(Option for reloading the theme on custom change)
(Option for disabling other themes while loading Modus)
(Option for completion framework aesthetics)
(Option for org-mode block styles, Get a single color from the palette)
(Add padding to mode line, Note on SHR fonts)
(Note on goto-address-mode faces): Use correct markup for 'nil'.
(Custom Org todo keyword and priority faces): Reword statements and
update the value of sample configuration blocks.
(Use more spacious margins or padding in Emacs frames): Mention the
'spacious-padding' package on GNU ELPA.
(Full support for packages or face groups): Document newly supported
packages and remove those that are no longer covered explicitly.
(Indirectly covered packages): Note that css-mode is covered
indirectly.
(Acknowledgements): Expand list of people who have helped with the
project.
* etc/themes/modus-operandi-deuteranopia-theme.el (unless): Add
theme-autoload cookie and relevant metadata.
(modus-operandi-deuteranopia): Expand or tweak the palette, where
necessary.
* etc/themes/modus-operandi-theme.el (unless): Add theme-autoload
cookie and relevant metadata.
(modus-operandi): Expand or tweak the palette, where necessary.
* etc/themes/modus-operandi-tinted-theme.el (unless): Add
theme-autoload cookie and relevant metadata.
(modus-operandi-tinted): Expand or tweak the palette, where necessary.
* etc/themes/modus-operandi-tritanopia-theme.el (unless): Add
theme-autoload cookie and relevant metadata.
(modus-operandi-tritanopia): Expand or tweak the palette, where
necessary.
* etc/themes/modus-vivendi-deuteranopia-theme.el (unless): Add
theme-autoload cookie and relevant metadata.
(modus-vivendi-deuteranopia): Expand or tweak the palette, where
necessary.
* etc/themes/modus-vivendi-theme.el (unless): Add theme-autoload
cookie and relevant metadata.
(modus-vivendi): Expand or tweak the palette, where necessary.
* etc/themes/modus-vivendi-tinted-theme.el (unless): Add
theme-autoload cookie and relevant metadata.
(modus-vivendi-tinted): Expand or tweak the palette, where necessary.
* etc/themes/modus-vivendi-tritanopia-theme.el (unless): Add
theme-autoload cookie and relevant metadata.
(modus-vivendi-tritanopia): Expand or tweak the palette, where
necessary.
* etc/themes/modus-themes.el (modus-themes-preset-overrides-faint)
(modus-themes-preset-overrides-intense)
(modus-themes-preset-overrides-warmer): Make minor tweaks.
(modus-themes--annotate-theme, modus-themes--select-prompt)
(modus-themes--toggle-theme-p, modus-themes-toggle)
(modus-themes--list-colors-prompt, modus-themes--heading)
(modus-themes-faces): Refine internal functions.
The detailed release notes are available here:
<https://protesilaos.com/codelog/2023-09-19-modus-themes-4-3-0/>.
Po Lu [Tue, 19 Sep 2023 11:57:14 +0000 (19:57 +0800)]
Update Android port
* src/android.c (android_exception_check_1)
(android_exception_check_2, android_exception_check_3)
(android_exception_check_4): Permit each object to be NULL.
(android_browse_url): Release VALUE if an exception transpires.
Alan Mackenzie [Tue, 19 Sep 2023 10:25:34 +0000 (10:25 +0000)]
Don't use ellipses while cl-printing strings.
This fixes bug#65680. The former use of print-length as a
bound on the length of the printed string was erroneous,
causing error messages preceding backtracees to get
unnecessarily truncated to 50 characters.
* lisp/emacs-lisp/cl-print.el (cl-print-object <string>):
Remove the substitution of ellipses for long strings.
* test/lisp/emacs-lisp/cl-print-tests.el
(cl-print-tests-ellipsis-string): Remove this test.
Don't use pointer arithmetic for untagging Lisp values (bug#65491)
* src/lisp.h (XUNTAG):
Instead of casting a Lisp value to char * and subtracting the tag,
cast it to a suitable integral type and work on that.
This should result in identical or at least equivalent code, except
that it avoids potential problems arising from the restrictions on
pointer arithmetic in C. In particular, a null pointer can be neither
an operand in nor the result of pointer arithmetic.
C compilers know this and would, prior to this change, optimise
XUNTAG(obj, Lisp_Int0, mytype) != NULL
to 1. This means, for example, that make_pointer_integer and
XFIXNUMPTR could not be entrusted with null pointers, and
next_vector in alloc.c was unsafe to use.
Jim Porter [Mon, 18 Sep 2023 17:17:12 +0000 (10:17 -0700)]
Fix another race condition when waiting for Eshell processes
When checking if the other processes in our pipeline are "alive", we
also need to check whether their sentinels are finished. Otherwise,
we might proceed with command evaluation while one of the other
processes is still cleaning up.
* lisp/eshell/esh-proc.el (eshell-process-active-p): New function...
(eshell-wait-for-process)
* lisp/eshell/esh-cmd.el (eshell-resume-command): ... use it.
Po Lu [Mon, 18 Sep 2023 06:13:30 +0000 (14:13 +0800)]
Correct crash in child processes under armeabi Android
* exec/trace.c (process_system_call) <READLINKAT_SYSCALL>:
Examine tracee->waiting_for_syscall and avoid rewriting user
arguments if a system call is presently being executed by the
kernel. Reported by Romário Rios <romariorios@protonmail.com>.
Danny Freeman [Fri, 15 Sep 2023 15:29:05 +0000 (11:29 -0400)]
Offset ranges before applying embedded tree-sitter parser
This feature would allow treesitter major modes to easily specify
offsets when using embeded parsers. A potential use case for this is
javascript template strings, when we want to apply a different parser
to the string's contents, but do not want to include the template
string's delimiters.
* lisp/treesit.el
(treesit-query-range): Accept an optional offest arg, apply the offset
to all returned ranges.
(treesit-range-rules): Accept an optional :offset keyword arg to adjust
ranges an embded parser is applied to.
(treesit-update-ranges): Forward optional :offset setting from
`treesit-range-rules' to `treesit-query-rang'.
* test/lisp/treesit-tests.el
(treesit-range-offset): Tests the new offset functionality.
Jim Porter [Mon, 18 Sep 2023 04:06:46 +0000 (21:06 -0700)]
Use 'eshell-with-temp-command' (indirectly) to parse Eshell script files
* lisp/eshell/esh-cmd.el (eshell--region-p): New function.
(eshell-with-temp-command, eshell-parse-command): Support
'(:file . FILENAME)' to use the contents of FILENAME.
* lisp/eshell/em-script.el (eshell-source-file): Call
'eshell-parse-command' and use backticks.
* java/org/gnu/emacs/EmacsDrawRectangle.java (perform): Call
damageRect with integer coordinates in lieu of consing a new
Rect.
* java/org/gnu/emacs/EmacsDrawable.java (damageRect) <IIII>:
Declare a new variant of damageRect, accepting four integers
designating the extents of the damage rectangle.
* java/org/gnu/emacs/EmacsPixmap.java (damageRect) <IIII>: New
stub.
* java/org/gnu/emacs/EmacsView.java (damageRect) <IIII>:
Implement this overloaded variant of damageRect.
* src/android.c (android_init_emacs_drawable)
(android_init_emacs_window): Move search for `damageRect' to
android_init_emacs_window.
(android_damage_window): Call IIII variant of `damageRect' to
avoid consing a new rectangle. Ameliorate dynamic method
dispatch overhead.
F. Jason Park [Thu, 7 Sep 2023 02:40:11 +0000 (19:40 -0700)]
Spoof channel users in erc-button--phantom-users-mode
* lisp/erc/erc-backend.el (erc--cmem-from-nick-function): Update
forward declaration.
(erc-server-PRIVMSG): Use new name for `erc--user-from-nick-function',
now `erc--cmem-from-nick-function'.
* lisp/erc/erc-button.el (erc-button--phantom-users,
erc-button--phantom-cmems): Rename former to latter.
(erc-button--fallback-user-function,
erc-button--fallback-cmem-function): Rename former to latter.
(erc--phantom-channel-user, erc--phantom-server-user): New superficial
`cl-struct' definitions "subclassing" `erc-channel-user' and
`erc-server-user'. Note that these symbols lack an `erc-button'
prefix.
(erc-button--add-phantom-speaker): Look for channel member instead of
server user, creating one if necessary. Return a made-up
`erc-channel-user' along with a fake `erc-server-user'.
(erc-button--get-phantom-user, erc-button--get-phantom-cmem): Rename
former to latter.
(erc-button--phantom-users-mode, erc-button--phantom-users-enable,
erc-button--phantom-users-disable): Use updated "cmem" names for
function-valued interface variables and their implementing functions.
Remove obsolete comment.
(erc-button-add-nickname-buttons): Attempt to query fallback function
for channel member instead of server user.
* lisp/erc/erc.el (erc--user-from-nick-function,
erc--cmem-from-nick-function): Rename former to latter.
(erc--examine-nick, erc--cmem-get-existing): Rename former to
latter. (Bug#60933)
F. Jason Park [Wed, 13 Sep 2023 12:42:24 +0000 (05:42 -0700)]
Run erc--scrolltobottom-on-pre-insert unconditionally
* lisp/erc/erc-goodies.el (erc--scrolltobottom-all): Pass `no-force'
argument to `set-window-start'.
(erc--scrolltobottom-on-pre-insert): Convert from generic to normal
function and drop `erc-input' method completely. A non-nil `insertp'
slot means a message is marked for insertion in the read-only portion
of the buffer, above the prompt. But conditionally restoring window
parameters based on that flag is insufficient because the window still
needs adjusting whenever input is typed, regardless of whether it's
erased or "inserted." (Bug#64855)
F. Jason Park [Mon, 11 Sep 2023 05:55:16 +0000 (22:55 -0700)]
; Fix example in display-buffer section of ERC manual
* doc/misc/erc.texi: Fix `display-buffer-alist' example and mention
that it's only meant for users of Emacs 29 and above.
* test/lisp/erc/erc-tests.el (erc-setup-buffer--custom-action): Add
simplistic test case for example in manual.
Stefan Kangas [Sun, 17 Sep 2023 20:56:00 +0000 (22:56 +0200)]
Rename describe-map-tree to help--describe-map-tree
This function should have been made internal in the first place.
* lisp/help.el (help--describe-map-tree): Rename from
'describe-map-tree'. Keep old name as an obsolete alias, and update
all callers.
Expanded defcustom type byte-compilation warnings (bug#65852)
Warn about more kinds of mistakes in :type arguments of `defcustom`
and `define-widget`. These include:
- misplaced keyword args, as in (const red :tag "A reddish hue")
- missing subordinate types, as in (repeat :tag "List of names")
or (choice list string)
- duplicated values, as in (choice (const yes) (const yes))
- misplaced `other` member, as in
(choice (const red) (other nil) (const blue))
- various type name mistakes, as in (vector bool functionp)
* lisp/emacs-lisp/bytecomp.el (byte-compile--defcustom-type-quoted)
(byte-compile-nogroup-warn): Remove.
(byte-compile-normal-call): Remove call to the above.
(bytecomp--cus-warn, bytecomp--check-cus-type)
(bytecomp--custom-declare): New.
Michael Albinus [Sun, 17 Sep 2023 10:13:14 +0000 (12:13 +0200)]
Make "toolbox" and "flatpak" multi-hop completion capable in Tramp
* lisp/net/tramp-container.el (tramp-skeleton-completion-function):
Bind `tramp-verbose' to 0.
(tramp-toolbox--completion-function)
(tramp-flatpak--completion-function): Use METHOD as argument.
Use `tramp-skeleton-completion-function'.
(tramp-completion-multi-hop-methods): Add "toolbox" and "flatpak".
Add prettify-symbols configuration to 'rust-ts-mode'
* lisp/progmodes/rust-ts-mode.el
(rust-ts-mode-prettify-symbols-alist): New variable.
(rust-ts-mode--prettify-symbols-compose-p): New function.
(rust-ts-mode): Use it.
Eli Zaretskii [Sun, 17 Sep 2023 05:26:46 +0000 (01:26 -0400)]
Merge from origin/emacs-29
bcf287bd114 typescript-ts-mode.el: Minor touches 67c82710764 Improve namespacing situation WRT to recent change in typ... 33ff4fed03d Make move-end-of-line in minibuffer consistent (bug#65980)
Improve namespacing situation WRT to recent change in typescript-ts-mode.el
* lisp/progmodes/typescript-ts-mode.el
(typescript-ts--syntax-propertize):
Rename from ts-ts--syntax-propertize.
(tsx-ts--syntax-propertize-captures):
Rename from ts-ts--syntax-propertize-captures.
(typescript-ts--s-p-query):
Rename from ts-ts--s-p-query.
Update all references (bug#65470).
Michael Albinus [Sat, 16 Sep 2023 18:35:35 +0000 (20:35 +0200)]
Make "kubernetes" multi-hop completion capable in Tramp
* lisp/net/tramp-container.el (tramp-skeleton-completion-function):
New defmacro.
(tramp-container--completion-function): Use it.
(tramp-kubernetes--completion-function): Use METHOD as argument.
Use `tramp-skeleton-completion-function'.
(tramp-skeleton-kubernetes-vector): New defmacro.
(tramp-kubernetes--current-context)
(tramp-kubernetes--current-context-data): Use it.
(tramp-completion-multi-hop-methods): Add "kubernetes".
Don't use pointer arithmetic for untagging Lisp values
* src/lisp.h (XUNTAG):
Instead of casting a Lisp value to char * and subtracting the tag,
cast it to a suitable integral type and work on that.
This should result in identical or at least equivalent code, except
that it avoids potential problems arising from the restrictions on
pointer arithmetic in C. In particular, a null pointer can be neither
an operand in nor the result of pointer arithmetic.
C compilers know this and would, prior to this change, optimise
XUNTAG(obj, Lisp_Int0, mytype) != NULL
to 1. This means, for example, that make_pointer_integer and
XFIXNUMPTR could not be entrusted with null pointers, and
next_vector in alloc.c was unsafe to use.
* src/alloc.c: The size of a vector block is bound by the number of
words, not bytes, represented by the pseudovector header RESTSIZE
field, because that limits how big a PVEC_FREE object can be.
Stefan Kangas [Sat, 16 Sep 2023 12:34:20 +0000 (14:34 +0200)]
Add missing builtin package declarations
* lisp/finder.el (finder--builtins-alist): Add new package
directories 'leim' and 'obsolete' as part of the 'emacs' package.
Add new package directory 'use-package' as part of the
'use-package' package.
* lisp/net/eudc-capf.el:
* lisp/net/eudcb-ecomplete.el:
* lisp/net/eudcb-macos-contacts.el:
* lisp/net/eudcb-mailabbrev.el: Declare library as part of the
'eudc' package.
* lisp/mail/ietf-drums-date.el: Declare library as part of the
'ietf-drums' package.
* lisp/image/image-dired-dired.el:
* lisp/image/image-dired-external.el:
* lisp/image/image-dired-tags.el:
* lisp/image/image-dired-util.el: Declare library as part of the
'image-dired' package.
* lisp/emacs-lisp/oclosure.el:
* lisp/keymap.el:
* lisp/progmodes/c-ts-common.el: Declare library as part of the
'emacs' package. (Bug#62751)
Eli Zaretskii [Sat, 16 Sep 2023 11:36:49 +0000 (07:36 -0400)]
Merge from origin/emacs-29
755ae813a6a ; Declare some treesit.c functions in typescript-ts-mode.el. 89fa204b706 Fix loss of encrypted data in plstore.el d9a1175a611 Close SQL database when corresponding 'sqlite-mode' buffe... cbd8fac283a Fix Unicode normalization of characters 825be05b379 Support one-time passwords in Tramp f880b94e649 Fix the 'C' and 'c' categories of characters 58fd212d8a2 Fix Emoji zooming commands 8970cdd009a ; Fix last change. ba924be4522 ; * etc/DEBUG: Improve the redisplay section. e110312ad95 ; * doc/lispref/minibuf.texi (Text from Minibuffer): Ment... 65f4810003b tsx-ts-mode--font-lock-compatibility-bb1f97b: Improve 6fe11b88ed0 Avoid using --display in emacsclient to reuse frames on PGTK 2fc7463c0e5 ; * INSTALL: Don't advertise -O3. (Bug#65988) 29055412f2d ; Fix doc string of 'lsh' 738d8543337 Support emacsclient on Windows with server on GNU or Unix... f0a89fa1d0e ; * lisp/saveplace.el (save-place-ignore-files-regexp): F... c9cb8ee0fc0 Fix defcustom in saveplace.el (Bug#65977) 5ec8be1d589 ; * lisp/subr.el (string-suffix-p, string-prefix-p): Doc ... 809305e6d8f Fix 'window-text-pixel-size' when there are several image... ea14b0dcc20 : Doc fix. 01e8a0c6cbf Doc fix for prettify-symbols-unprettify-at-point 0065621d0d3 (report_overlay_modification): Fix bug#65929 6cc6455e931 Fix SVG colors (bug#56182) 9396d73942e * doc/emacs/text.texi (Outline Minor Mode): Add a note ab... a65d1a5a167 Improve documentation of 'list-abbrevs' 5dcc4b7eab1 Tweak s-p-f for js-ts-mode 1fb2fb501f3 typescript-ts-mode, tsx-ts-mode: Fix syntax properties fo... 946b395e7e1 * lisp/progmodes/c-ts-mode.el (c++-ts-mode): Provide (bug... 33ee3e588fd Fix regression of treesit_cursor_helper_1 d11d81dfcc6 ; Fix doc typos (Bug#65868) 6554ec22465 Update docs for passing of Thien-Thi Nguyen 5ab2792d5c1 Update defvar usage tips example in manual 35d88c657e1 Document using Flymake together with Eglot 3f04efe9e7d ; * src/font.h (struct font): Comment about use of averag... 459b5f6b6d1 ; * admin/authors.el (authors-aliases): Update. 0c029ae8bcb ; tweak etc/TODO item
Jens Schmidt [Tue, 30 May 2023 21:00:56 +0000 (23:00 +0200)]
Fix loss of encrypted data in plstore.el
* lisp/plstore.el (plstore--insert-buffer): Fix loss of encrypted
data when a plstore gets opened and saved without being decrypted
between these steps. (Bug#63627)
Earl Hyatt [Sat, 19 Aug 2023 22:26:45 +0000 (18:26 -0400)]
Make using Edmacro easier for long sequences of keys
* lisp/edmacro.el (edmacro-set-macro-to-region-lines)
(edmacro-reverse-key-order): New command and user option to
make working with longer lists of keys, such as from
'kmacro-edit-lossage', easier.
(edit-kbd-macro): Move regexps used to identify parts of
buffer to internal variables.
(edmacro--macro-lines-regexp, edmacro-mode-font-lock-keywords):
Allow noting whether the most recent line of keys is displayed
first.
(edmacro-mode-map): Bind the new command to 'C-c C-r'.
(edmacro-mode): Describe the new command in the mode
documentation string.
* doc/emacs/kmacro.texi (Edit Keyboard Macro): Mention
'edmacro-insert-key' and the newly added
'edmacro-set-macro-to-region-lines' and
'edmacro-reverse-key-line-order'.
* etc/NEWS (Edmacro): Add section describing the new features.
Eli Zaretskii [Sat, 16 Sep 2023 09:17:23 +0000 (12:17 +0300)]
Fix Unicode normalization of characters
* lisp/international/ucs-normalize.el
(ucs-normalize-composition-exclusions, check-range): Update from
Unicode 15.0 data. (Bug#65996)
* test/lisp/international/ucs-normalize-tests.el
(ucs-normalize-tests--failing-lines-part1)
(ucs-normalize-tests--failing-lines-part2): Update to reflect
changes in ucs-normalize.el.
* admin/notes/unicode: Mention the updates in ucs-normalize.el.
Po Lu [Sat, 16 Sep 2023 02:38:46 +0000 (10:38 +0800)]
Update Android port
* java/org/gnu/emacs/EmacsContextMenu.java (display): Return
false if the list of menu buttons is empty, lest Android cease
displaying menus on the assumption that Emacs is defective.
* src/fns.c (sort_list): Render sentence motion commands
functional within commentary
* src/sfntfont.c (sfntfont_list_family): Sort and deduplicate
the returned family list and make it a list of symbols.
(syms_of_sfntfont) <Qstring_lessp>: New defsym.
Stefan Monnier [Fri, 15 Sep 2023 18:44:59 +0000 (14:44 -0400)]
(mutually_exclusive_p): Fix the regression from commit 6fad73d7cc53
Commit 6fad73d7cc53 throws away some useful optimization because
it misfired in some cases (as seen in bug#657260). Here we try to
recover those useful optimizations with a slightly more careful
algorithm.
* src/regex-emacs.c (mutually_exclusive_aux): Rename from
`mutually_exclusive_p`. Add two new args. Improve the
case where we need to recurse.
(mutually_exclusive_p): New function defined on top of it.
* test/src/regex-emacs-tests.el (regexp-tests-backtrack-optimization):
Re-enable the test.
* src/regex-emacs.c (mutually_exclusive_exactn)
(mutually_exclusive_charset): New functions, extracted from
`mutually_exclusive_p`.
(mutually_exclusive_p): Use them.
* lisp/progmodes/typescript-ts-mode.el
(tsx-ts-mode--font-lock-compatibility-bb1f97b):
Test the more complex query, because the current one leads to
false positives (mentioned in bug#65470).