Stefan Monnier [Mon, 4 Mar 2024 18:24:34 +0000 (13:24 -0500)]
syncdoc-type-hierarchy.el: Adjust to changes in `cl-preloaded.el`
* admin/syncdoc-type-hierarchy.el (syncdoc-lispref-dir):
Use `macroexp-file-name`.
(syncdoc-hierarchy): New var.
(syncdoc-insert-dot-content, syncdoc-make-type-table): Use it.
(syncdoc-update-type-hierarchy): Don't crash if `dot` is absent.
Michael Albinus [Mon, 4 Mar 2024 14:44:24 +0000 (15:44 +0100)]
tramp-androidsu.el code cleanup
* lisp/net/tramp-androidsu.el (tramp-androidsu-generate-wrapper):
Prefer #' notation for function names.
(tramp-androidsu-handle-copy-file)
(tramp-androidsu-handle-file-local-copy)
(tramp-androidsu-handle-make-symbolic-link)
(tramp-androidsu-handle-rename-file)
(tramp-androidsu-handle-write-region): Don't use a wrapper.
(tramp-adb-connection-local-default-ps-profile): Don't initialize,
this happens in tramp-db.el.
While it did simplify code, there aren't much in the way of technical
benefits the change at this time, and there were protest against the
unwarranted style change.
Martin Rudalics [Mon, 4 Mar 2024 09:33:49 +0000 (10:33 +0100)]
Fix 'set-window-configuration' and 'window-state-put'
Fix some bugs with 'window-state-put' (Bug#69093). Add new
hook 'window-kept-windows-functions' (Bug#68235).
* doc/lispref/windows.texi (Window Configurations): Mention
'window-kept-windows-functions'.
(Window Hooks): Describe new abnormal hook
'window-kept-windows-functions'.
* src/marker.c (Fmarker_last_position): New function to return
the last position of a marker even if its buffer is now dead.
* src/window.c (Fset_window_configuration): If
'window-kept-windows-functions' is non-nil, do not delete any
window whose buffer is now dead but remember all such windows in
a list to pass to 'window-kept-windows-functions'. Run
'window-kept-windows-functions' if it is non-nil.
(Vwindow_kept_windows_functions): New abnormal hook run by
Fset_window_configuration and 'window-state-put' with two
arguments - the frame whose configuration is restored and a list
of entries for each window whose buffer was found dead during
restoration. Each entry is a list of four elements, the window,
the dead buffer, and the last know positions of the start and
point of that window.
* lisp/window.el (window-state-put-kept-windows)
(window-state-put-selected-window): New variables.
(window--state-put-2): Make sure buffer is live before restoring
its state. Set 'window-state-put-selected-window' to state's
selected window. If 'window-kept-windows-functions' is non-nil,
do not delete any windows whose buffer is found dead but
remember all such windows in a list to pass to
'window-kept-windows-functions'.
(window-state-put): Run 'window-kept-windows-functions' if it is
non-nil. Select window recorded in
'window-state-put-selected-window'.
Stefan Monnier [Mon, 4 Mar 2024 04:08:16 +0000 (23:08 -0500)]
(major-mode-remap(-defaults)): New var and function (bug#69191)
While `major-mode-remap-alist` provides a way for users to indicate the
major mode of their choice, we need a similar variable for the
use of packages.
This patch adds a new `major-mode-remap-defaults` and changes various
packages to obey it or make use of it.
I think it nicely cleans the regexp duplication between CC-mode and
`c-ts-mode.el` and also makes it easier/cleaner for users to override
the changes made by `*-ts-mode.el`.
* lisp/files.el (major-mode-remap-defaults): New variable.
(major-mode-remap): New function.
(set-auto-mode-0): Use it.
* doc/lispref/modes.texi (Auto Major Mode): Document them.
* lisp/textmodes/tex-mode.el (tex--redirect-to-submode):
Use `major-mode-remap`.
(major-mode-remap-defaults): Set it to remap AUCTeX modes by default.
* lisp/progmodes/ruby-ts-mode.el (auto-mode-alist): Leave it alone.
(major-mode-remap-defaults): Set this one instead.
* lisp/progmodes/c-ts-mode.el (c-or-c++-ts-mode): Use `major-mode-remap`.
(auto-mode-alist): Leave it alone.
(major-mode-remap-defaults): Set this one instead.
* lisp/org/ox.el (org-export-to-buffer): Modernize docstring accordingly.
* lisp/progmodes/cc-mode.el (c-or-c++-mode):
* lisp/org/ox-latex.el (org-latex-export-as-latex):
* lisp/org/ox-koma-letter.el (org-koma-letter-export-as-latex):
* lisp/org/ox-beamer.el (org-beamer-export-as-latex):
Use `major-mode-remap` when available.
Stefan Monnier [Sun, 3 Mar 2024 23:08:50 +0000 (18:08 -0500)]
(cl--typeof-types): Rework to fix some regressions
Initialize the variables directly in their declaration, so
there no time where they exist but aren't yet initialized.
This also allows us to mark `cl--typeof-types` as a `defconst` again.
More importantly, specify the DAG by direct supertypes rather
than direct subtypes. This is slightly less compact, but it's
necessary to let us specify the *order* of the supertypes,
which is necessary for example to preserve the desired ordering
of methods when several methods can be applied.
Fix a few more regressions, such as removing `atom` from the parents
of `function` since some lists are considered as functions,
adding `number-or-marker` as supertype of `integer-or-marker`,
and re-adding `native-comp-unit`.
I carefully compared all elements of `cl--typeof-types` to make
sure they are the same as before (with one exception for `null`).
* lisp/emacs-lisp/cl-preloaded.el (cl--type-hierarchy): Delete var.
(cl--direct-supertypes-of-type, cl--typeof-types):
Initialize directly in the declaration.
(cl--supertypes-lane, cl--supertypes-lanes-res): Delete vars.
(cl--supertypes-for-typeof-types-rec)
(cl--supertypes-for-typeof-types): Delete functions.
Stefan Monnier [Sat, 2 Mar 2024 19:48:29 +0000 (14:48 -0500)]
ox-texinfo:: Require only TEXINFO_DIR_CATEGORY
Until now @dircategory/@direntry entries were added only if
both TEXINFO_DIR_CATEGORY and TEXINFO_DIR_TITLE were set.
And the setting of TEXINFO_DIR_TITLE had to be careful to
provide exactly the right syntax.
This patch changes various things in this regard:
- Only require TEXINFO_DIR_CATEGORY in order to generate
`@dircategory` and `@direntry`.
- Use the document title by default if TEXINFO_DIR_DESC is missing.
- Use the filename by default when TEXINFO_DIR_TITLE is missing.
- Try and make it harder to provide a direntry that does not
have the right format or refers to a different filename than
the one we're outputting to.
* lisp/org/ox-texinfo.el: Remove redundant `:group` arguments.
Prefer #' to quote function names.
(org-texinfo-template): Use sane defaults for `@direntry`.
* doc/misc/org.org (Texinfo specific export settings): Adjust accordingly.
This is necessary to prepare the dictionary buffer for further processing
that also includes setting buffer-read-only to nil to be able to insert text.
(bug#69312)
Juri Linkov [Sat, 2 Mar 2024 17:31:07 +0000 (19:31 +0200)]
* lisp/net/dictionary.el: Better handling of messages and errors.
(dictionary-do-search, dictionary-do-matching): Insert formatted
messages to the top of the output buffer instead of displaying
transient messages in the echo area (bug#69312).
(dictionary-do-matching, dictionary-lookup-definition)
(dictionary-popup-matching-words): Use 'user-error'
instead of 'error' for non-technical errors.
Juri Linkov [Sat, 2 Mar 2024 17:22:30 +0000 (19:22 +0200)]
* lisp/replace.el (perform-replace): Accept default bindings in lookup-key.
Set ACCEPT-DEFAULT arg of lookup-key to t (bug#69342).
This will allow the users to ignore unbound keys with
‘(define-key query-replace-map [t] 'ignore)’.
Kazuhiro Ito [Fri, 1 Mar 2024 23:44:56 +0000 (08:44 +0900)]
Fix Japanese language environment on Cygwin and MS-Windows
* lisp/language/japan-util.el
(setup-japanese-environment-internal): Prefer UTF-8 for Cygwin and
other Posix hosts; prefer Codepage 932 on DOS/Windows. (Bug#69493)
Eli Zaretskii [Tue, 27 Feb 2024 11:12:15 +0000 (13:12 +0200)]
Avoid assertion violations in bidi.c
* src/bidi.c (bidi_resolve_brackets): Move assertion about
'resolved_level' to where it belongs. This avoids unnecessary
aborts when the character is not a bracket type and doesn't need
BPA resolution. (Bug#69421)
Eli Zaretskii [Sat, 24 Feb 2024 13:12:57 +0000 (15:12 +0200)]
Fix infinite recursion in gdb-mi.el
* lisp/progmodes/gdb-mi.el: (gdb-clear-partial-output)
(gdb-clear-inferior-io): Set inhibit-read-only, to avoid
signaling errors in process filter. (Bug#69327)
Eshel Yaron [Sun, 3 Mar 2024 15:57:26 +0000 (16:57 +0100)]
Allow completion tables to designate normal/exceptional candidates
Completion tables can now provide a "normal predicate" via the new
'normal-predicate' metadata entry. The normal predicate determines
which candidates are normal and which are not. Non-normal candidates
are called exceptional candidates, and, by default, they are excluded.
However, if all possible completions are exceptional, we make an
exception, and include exceptional completions, as they are all that
remains.
This generalizes and subsumes the existing mechanisms of
'completion-ignored-extensions' and the internal buffer-name filtering
that read-buffer performs.
We also provide a new minibuffer command 'C-x ~' to toggle inclusion of
exceptional candidates interactively during completion. When
exceptional candidates are included among normal candidates, we
highlight the exceptions with a dedicated face.
Eshel Yaron [Sun, 3 Mar 2024 08:40:45 +0000 (09:40 +0100)]
; Fix dictionary name completion annotations
* lisp/net/dictionary.el (dictionary-dictionaries): Decode
server response as UTF-8.
(dictionary-completing-read-dictionary): Use 'string-width'
to calculate string width.
Eshel Yaron [Sat, 2 Mar 2024 10:53:15 +0000 (11:53 +0100)]
Deprecate 'completion-regexp-list'
This variable doesn't provide any distinct functionality,
because the completion predicate supports regular expression
matching as a special case. It's also unused except for one
command, where it causes bugs (see Bug#69501). All in all,
'completion-regexp-list' doesn't carry its own weight.
Po Lu [Sat, 2 Mar 2024 06:04:56 +0000 (14:04 +0800)]
Implement dead key combination on Android
* src/android.c (android_init_key_character_map)
(android_get_dead_char): New functions.
(android_wc_lookup_string): New argument COMPOSE_STATE. Ignore
key events with the COMBINING_ACCENT flag set while recording
their character values there, and combine such characters with
the key event when processing a subsequent key event.
* src/androidgui.h (struct android_compose_status): New
structure.
* src/androidterm.c (handle_one_android_event): Port dead key
combination code from X. (bug#69321)
Wilson Snyder [Fri, 1 Mar 2024 17:11:07 +0000 (12:11 -0500)]
Verilog-mode update from upstream https://github.com/veripool/verilog-mode
* lisp/progmodes/verilog-mode.el (verilog-auto-inst)
(verilog-auto-inst-param): Remove intended formfeeds. Our ability to
detect unintended formfeeds elsewhere outweighs their limited utility here.
Contributed by Mattias Engdegård.
(verilog-at-constraint-p)
(verilog-at-struct-mv-p, verilog-at-struct-p, verilog-calc-1)
(verilog-in-case-region-p, verilog-in-fork-region-p)
(verilog-in-generate-region-p, verilog-set-auto-endcomments):
Fix indentation problem when there is a signal named "module_something"
(#1861). Cleanup RexEx groupings.
(verilog-read-sub-decls-expr):
Fix apostrophe parser in AUTOWIRE (#1854) (#1855).
(verilog-auto-inst-port): Fix AUTOINST
multi-dimensional array [] substitution. Reported by Caleb Begly.
(verilog-property-re, verilog-beg-of-statement, verilog-calc-1):
Concurrent SVA statement pattern-matching learns 'restrict property' and
'cover sequence' expression for proper indentation around those constructs. This
addresses more patterns in IEEE 1800-2017's 'concurrent_sasertion_statement'
grammar.
(verilog-read-sub-decls-line):
Fix `verilog-auto-ignore-concat' with parenthesis signals.
Reported by Dmitri Sorkin.
(verilog-simplify-range-expression): Fix
`verilog-auto-inst-param-value' confusing structure selects.
Reported by Mike Bertone.
Juri Linkov [Thu, 29 Feb 2024 17:50:04 +0000 (19:50 +0200)]
Add tabulated-list-groups and Buffer-menu-group-by (bug#69305)
* doc/lispref/modes.texi (Tabulated List Mode):
Add defvar tabulated-list-groups.
* lisp/buff-menu.el (Buffer-menu-group-by): New defcustom.
(Buffer-menu-unmark-all-buffers): Use tabulated-list-get-entry
to check whether the current line contains an entry.
(list-buffers-noselect): Enable outline-minor-mode
for tabulated-list-groups.
(list-buffers--refresh): When Buffer-menu-group-by is non-nil,
set tabulated-list-groups.
(Buffer-menu-group-by-mode, Buffer-menu-group-by-root):
New functions.
* lisp/emacs-lisp/tabulated-list.el (tabulated-list-groups):
New buffer-local variable.
(tabulated-list-print-fake-header): Add distinct overlay
property 'fake-header'.
(tabulated-list-header-overlay-p): Filter out overlays that
don't have the property 'fake-header'.
(tabulated-list-print): Use the variable 'tabulated-list-groups'
to sort entries in groups separately.
(tabulated-list-print-entries): New function factored out from
'tabulated-list-print'.
* test/lisp/emacs-lisp/tabulated-list-tests.el (tabulated-list-groups):
New test.
Eli Zaretskii [Thu, 29 Feb 2024 13:37:19 +0000 (15:37 +0200)]
Improve documentation of recent changes in comp-run.el
* lisp/emacs-lisp/comp-run.el
(native-comp-async-warnings-errors-kind): Rename from
'native-comp-async-report-warnings-errors-kind', and rename
'importants' to 'important'; all users changed. Doc fix.
Po Lu [Thu, 29 Feb 2024 02:59:09 +0000 (10:59 +0800)]
Fix subprocess creation in directories managed by tramp-androidsu
* lisp/net/tramp-androidsu.el
(tramp-androidsu-maybe-open-connection): Set connection property
remote-namespace to t or nil subject to whether su runs in the
global mount namespace.
(tramp-androidsu-adb-handle-make-process): Delete function.
(tramp-androidsu-make-process): New function.
(tramp-androidsu-file-name-handler-alist): Switch to
tramp-androidsu-make-process.
Andrea Corallo [Mon, 19 Feb 2024 16:40:04 +0000 (17:40 +0100)]
Make type hierarchy textual representation a table
* etc/syncdoc-type-hierarchy.el (syncdoc-make-type-table): New function.
(syncdoc-update-type-hierarchy): Make use of.
* doc/lispref/type_hierarchy.txt: Regenerate.
Liu Hui [Wed, 21 Feb 2024 04:40:06 +0000 (12:40 +0800)]
Fix Python shell completion test failures
* test/lisp/progmodes/python-tests.el
(python-tests-with-temp-buffer-with-shell): Set XDG_CACHE_HOME
to a temporary directory.
(python-tests--pythonstartup-file): New function.
(python-shell-completion-at-point-jedi-completer)
(python-shell-completion-at-point-ipython): Use Jedi as the
native completion backend when possible. (bug#68559)
Po Lu [Wed, 28 Feb 2024 04:23:32 +0000 (12:23 +0800)]
; Fix last change
* lisp/net/tramp-androidsu.el
(tramp-androidsu-handle-write-region): Delete function.
(tramp-androidsu-sh-handle-write-region): New function.
(tramp-androidsu-file-name-handler-alist): Avoid infinite
recursion by replacing handle-write-region with the tramp-sh
implementation.
Po Lu [Wed, 28 Feb 2024 04:05:59 +0000 (12:05 +0800)]
Lift restrictions on `tramp-androidsu's app data access
* lisp/net/tramp-adb.el (tramp-adb-handle-copy-file): Remove
code now unnecessary.
* lisp/net/tramp-androidsu.el
(tramp-androidsu-mount-global-namespace): New user option.
(tramp-androidsu-su-mm-supported): New variable.
(tramp-androidsu-maybe-open-connection): Detect whether su
supports the -mm option, and provide it if so.
(tramp-androidsu-adb-handle-copy-file)
(tramp-androidsu-adb-handle-rename-file): Delete functions.
(tramp-androidsu-sh-handle-copy-file)
(tramp-androidsu-sh-handle-rename-file): New functions.
(tramp-androidsu-file-name-handler-alist): Switch to tramp-sh's
copy and rename handlers.
Stefan Monnier [Tue, 27 Feb 2024 13:24:45 +0000 (08:24 -0500)]
vhdl-mode.el: Reduce use of `eval`
* lisp/progmodes/vhdl-mode.el (vhdl--re2-region): New function.
(vhdl--signal-regions-functions): New constant, extracted from
`vhdl-update-sensitivity-list`.
(vhdl-update-sensitivity-list): Use it.
Po Lu [Tue, 27 Feb 2024 02:05:56 +0000 (10:05 +0800)]
Disable process tracing before launching /system/bin/su
* lisp/net/tramp-androidsu.el
(tramp-androidsu-maybe-open-connection): Disable process tracing
around start-process, that the setuid su binary may be started
regardless of its status.
* test/lisp/emacs-lisp/edebug-tests.el (edebug-tests-trivial-backquote):
Don't use obsolete `edebug-eval-defun`.
(edebug-tests-trivial-comma): Use `inhibit-read-only`; don't use
obsolete `edebug-eval-defun`; and fix bug#69406 by binding
`eval-expression-debug-on-error`.
Eli Zaretskii [Mon, 26 Feb 2024 17:26:04 +0000 (19:26 +0200)]
Fix display of reordered Arabic text
* src/xdisp.c (compute_stop_pos): Fix a year-old thinko in
handling auto-composed characters. It was introduced as part
of solving bug#62780, which optimized the search for composable
characters. (Bug#69384)
Po Lu [Mon, 26 Feb 2024 06:13:14 +0000 (14:13 +0800)]
Introduce a new TRAMP method `androidsu'
* doc/misc/tramp.texi (Quick Start Guide): Document the new
method.
* etc/NEWS (Tramp): Announce new method.
* lisp/net/tramp-adb.el (tramp-adb-handle-file-attributes)
(tramp-adb-handle-directory-files-and-attributes)
(tramp-adb-handle-file-name-all-completions): Properly print
ls's exit status in the presence of a pipe.
(tramp-adb-handle-copy-file): If the androidsu backend is in
use, call cp rather than adb push.
(tramp-adb-send-command): Disable ADB-specific code under
androidsu.
(tramp-adb-send-command-and-check): New argument
COMMAND-AUGMENTED-P.
Michael Albinus [Sun, 25 Feb 2024 09:06:09 +0000 (10:06 +0100)]
'read-passwd' can toggle the visibility of passwords
* doc/lispref/minibuf.texi (Reading a Password):
* etc/NEWS: 'read-passwd' can toggle the visibility of passwords.
* etc/images/README: Mention the new images below.
* etc/images/conceal.pbm:
* etc/images/conceal.svg:
* etc/images/reveal.pbm:
* etc/images/reveal.svg: New images.
* lisp/simple.el (read-passwd--mode-line-buffer)
(read-passwd--mode-line-icon): New defvars.
(read-passwd--toggle-visibility, read-passwd-mode): New defuns.
* lisp/subr.el (read-passwd-map): Add 'TAB' binding.
(read-passwd--hide-password): New defvar.
(read-passwd--hide-password): Rename function from
`read-password--hide-password'. Adapt callees. Implement both
hiding and showing the password. (Bug#69237)
(read-passwd): Call `read-passwd-mode'.