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'.
Spencer Baugh [Tue, 13 Feb 2024 17:20:39 +0000 (12:20 -0500)]
Check daemon is initialized before suppressing its init errors
Previously, the default error handler would correctly suppress
unhandled errors raised when IS_DAEMON and the initial frame
was current, since this is the normal state of operation for a
daemon-mode Emacs. However, this also incorrectly suppressed
errors raised while a daemon-mode Emacs was starting up.
Now, errors raised while a daemon-mode Emacs is starting up will be
handled just like errors when a non-daemon Emacs is starting up.
This was previously the case before changes for bug#1310 and
bug#1836, which added the suppression of errors when IS_DAEMON.
DAEMON_RUNNING didn't exist at the time of those changes, but now
it does, so we can do better.
* src/keyboard.c (Fcommand_error_default_function): Check
!DAEMON_RUNNING in addition to IS_DAEMON. (Bug#68799)
* src/lisp.h (DAEMON_RUNNING): Add a clarifying comment about
what this #define means.
Spencer Baugh [Wed, 14 Feb 2024 16:09:33 +0000 (11:09 -0500)]
Add context to errors thrown by server-start during startup
When server-start errors during startup, the error is printed to
the terminal without context. To help the user understand
better what went wrong, that printed error now mentions that the
error came from starting up the daemon.
* lisp/startup.el (command-line): Catch and annotate errors
thrown by server-start. (bug#68799)
Emanuel Berg [Tue, 23 Jan 2024 13:21:49 +0000 (14:21 +0100)]
Make erc-cmd-AMSG session local; add /GMSG, /AME and /GME
* etc/ERC-NEWS: Mention new slash commands.
* lisp/erc/erc.el (erc-cmd-AMSG): Make it consistent with the doc
string by only affecting the current connection.
(erc-cmd-GMSG, erc-cmd-AME, erc-cmd-GME): New IRC slash commands.
* test/lisp/erc/erc-scenarios-misc-commands.el
(erc-scenarios-misc-commands--AMSG-GMSG-AME-GME): New test.
* test/lisp/erc/resources/commands/amsg-barnet.eld: New file.
* test/lisp/erc/resources/commands/amsg-foonet.eld: New file.
(Bug#68401)
F. Jason Park [Thu, 22 Feb 2024 04:08:37 +0000 (20:08 -0800)]
; Don't mention erc-branded Compat macros in ERC-NEWS
* doc/misc/erc.texi: Change fancy SASL example to also demonstrate
`let'-binding a local module.
* etc/ERC-NEWS: Don't mention `erc-compat-call' and
`erc-compat-function' because Emacs now ships with a compat.el stub
library.
* lisp/erc/erc-backend.el (erc-decode-parsed-server-response): Add
comments.
* lisp/erc/erc.el (erc): Mention return value.
Stefan Monnier [Fri, 23 Feb 2024 22:03:10 +0000 (17:03 -0500)]
diff-mode.el (diff-refine-nonmodified): New option
* lisp/vc/diff-mode.el (diff-font-lock-keywords): Refer directly to
font-lock faces.
(diff-apply-hunk): Use `user-error` for errors usually not due to bugs.
(diff--refine-propertize): New function.
(diff-refine-nonmodified): New custom var (bug#61396).
(diff--refine-hunk): Use them.
Stefan Monnier [Fri, 23 Feb 2024 21:46:01 +0000 (16:46 -0500)]
elisp-mode.el: Use `handler-bind` instead of `debug-on-error`
* lisp/progmodes/elisp-mode.el (elisp-enable-lexical-binding):
Don't get fooled by a global binding of `lexical-binding` to t.
(elisp--eval-last-sexp-fake-value): Delete var.
(elisp--eval-defun): Don't let-bind `debug-on-error` since it's
already arranged by the only caller.
(eval-last-sexp, eval-defun): Use `handler-bind` instead of
`debug-on-error`.