Po Lu [Sat, 10 Sep 2022 10:49:53 +0000 (18:49 +0800)]
Fix compliance with the XDND specification when dropping on a proxy
* src/xterm.c (x_dnd_send_enter, x_dnd_send_position)
(x_dnd_send_leave, x_dnd_send_drop, x_dnd_do_drop): New
parameter `toplevel'. Use it as the window in sent client
messages.
(x_dnd_cancel_dnd_early, x_dnd_cleanup_drag_and_drop)
(x_dnd_process_quit, x_dnd_update_state, handle_one_xevent)
(x_connection_closed): Give the right toplevel to the client
message sending functions.
Make `format-prompt' use `substitute-command-keys'
* doc/lispref/minibuf.texi (Text from Minibuffer): Mention it.
* lisp/minibuffer.el (format-prompt): Run through
`substitute-command-keys' (bug#51040).
Stefan Kangas [Sat, 10 Sep 2022 05:29:48 +0000 (07:29 +0200)]
Doc fixes for 'text-quoting-style'
* doc/lispref/help.texi (Keys in Documentation): Remove duplicate
entry for 'text-quoting-style'. Document the function with the same
name instead.
* src/doc.c (Ftext_quoting_style): Doc fix: clarify the return values.
(syms_of_doc) <Vtext_quoting_style>: Doc fix: clarify that you should
not read the value of this variable directly; use Ftext_quoting_style
instead (bug#51040).
Po Lu [Sat, 10 Sep 2022 01:35:49 +0000 (09:35 +0800)]
Fix several printfs for 32 bit systems
* lib-src/emacsclient.c (main): Use right length modifier when
printing uintmax_t.
* src/alloc.c (check_pure_size): Use right length modifier when
printing ptrdiff_t.
Stefan Kangas [Fri, 9 Sep 2022 21:56:24 +0000 (23:56 +0200)]
Accept "-w" as safe value for vc-git-annotate-switches
* lisp/vc/vc-git.el
(vc-git-annotate-switches-safe-p): New predicate function.
(vc-git-annotate-switches): Use above new predicate function to
check if it's :safe.
Paul Eggert [Fri, 9 Sep 2022 20:22:16 +0000 (15:22 -0500)]
Fix problem with Glib 2.73.2+ and SIGCHLD handler
This code fix is by Stefan Monnier (Bug#57699).
* src/process.c (init_process_emacs) [HAVE_GLIB && !WINDOWSNT]:
Adjust to Glib 2.73.2 behavior change on Linux kernel 5.3+.
* lisp/comint.el
(comint-indent-input-line):
(comint-indent-input-line-default):
(comint-indent-input-region):
(comint-indent-input-region-default): New functions that implement a
general mechanism for input indentation through an indirect buffer in
comint derived major modes.
* lisp/shell.el (shell-mode): Set up input indentation according to
sh-mode (bug#51940).
* lisp/shell.el (shell-mode): Enable highlighting of non-existent
commands if requested.
(shell-highlight-undef-aliases):
(shell-highlight-undef-remote-file-name-inhibit-cache): New user
options.
(shell-highlight-undef-mode): New minor mode.
(shell-highlight-undef-defined-face):
(shell-highlight-undef-undefined-face):
(shell-highlight-undef-alias-face): New faces.
(shell-highlight-undef--exec-cache):
(shell-highlight-undef--face):
(shell-highlight-undef-keywords):
(shell-highlight-undef-regexp):
(shell-highlight-undef--executable-find):
(shell-highlight-undef-matcher):
(shell-highlight-undef--indirect):
(shell-highlight--setup):
(shell-highlight-undef-reset-mode): New functions and buffer local
variables (bug#51940).
* lisp/ielm.el (ielm-comint-fl-enable): New user option to control
input fontification.
(ielm-indirect-setup-hook): New hook.
(inferior-emacs-lisp-mode): Set up and enable input fontification.
* lisp/comint.el
(comint-indent-input-line):
(comint-indent-input-line-default):
(comint-indent-input-region):
(comint-indent-input-region-default): New functions that implement a
general mechanism for input indentation through an indirect buffer in
comint derived major modes.
* lisp/shell.el (shell-mode): Set up input indentation according to
sh-mode (bug#51940).
* lisp/comint.el
(comint-indent-input-line):
(comint-indent-input-line-default):
(comint-indent-input-region):
(comint-indent-input-region-default): New functions that implement a
general mechanism for input indentation through an indirect buffer in
comint derived major modes.
* lisp/shell.el (shell-mode): Set up input indentation according to
sh-mode (bug#51940).
Implement a general input fontification mechanism for comint modes
* lisp/comint.el
(comint-indent-input-line):
(comint-indent-input-line-default):
(comint-indent-input-region):
(comint-indent-input-region-default): New functions that implement a
general mechanism for input indentation through an indirect buffer in
comint derived major modes.
* lisp/shell.el (shell-mode): Set up input indentation according to
sh-mode (bug#51940).
* lisp/emacs-lisp/backtrace.el (backtrace-mode-map): Don't bind
the "s" command, because it's meaningless outside modes that have
set the backtrace-goto-source-functions variable (and only edebug
does that) (bug#57674).
* lisp/emacs-lisp/edebug.el (edebug-pop-to-backtrace): Use it.
(edebug-backtrace-mode-map, edebug-backtrace-mode): New mode.
Michael Albinus [Fri, 9 Sep 2022 15:10:28 +0000 (17:10 +0200)]
Make use of rx in Tramp backward compatoble
* lisp/net/tramp-compat.el (tramp-compat-rx--runtime-params): New defvar.
(tramp-compat-rx--transform-items)
(tramp-compat-rx--transform-item, tramp-compat-rx--transform):
New defuns. Suggested by Mattias Engdegård <mattiase@acm.org>.
(tramp-compat-rx): New defalias or defmacro.
(tramp-compat-string-replace, tramp-compat-string-search):
Use regexp-quote.
Stefan Kangas [Fri, 9 Sep 2022 00:32:08 +0000 (02:32 +0200)]
Display librsvg error when loading bad SVG
* src/image.c (svg_load_image): Display the error message from librsvg
when parsing a bad SVG image file.
* test/manual/image-tests.el
(image-tests-load-image/svg-invalid): New test.
Jim Porter [Wed, 7 Sep 2022 20:58:31 +0000 (13:58 -0700)]
; Fix a race condition in an Eshell test
* test/lisp/eshell/esh-proc-tests.el
(esh-proc-test/sigpipe-exits-process): Use "|&" when creating the
pipeline to prevent an extra pipe process from being started.
The mutation of `args` was unsafe because that array was
later reused (and assumed unchanged) by the caller.
https://lists.gnu.org/archive/html/emacs-devel/2022-09/msg00329.html
Augusto Stoffel [Thu, 8 Sep 2022 07:56:59 +0000 (09:56 +0200)]
Add prefix argument to outline-cycle-buffer
* lisp/outline.el (outline-cycle-buffer): Add prefix argument to show
headings up to a given level. Handle the case where the top
heading level is not 1.
Sam James [Wed, 7 Sep 2022 03:57:33 +0000 (04:57 +0100)]
Recognize zstandard (.zst) compressed Info files
* lisp/info.el (Info-suffix-list): Recognize .zst file extension
from the zstd compression tool. This allows reading Info pages
compressed with 'zstd'. (Bug#57636)
Michael Albinus [Thu, 8 Sep 2022 08:36:08 +0000 (10:36 +0200)]
Make call of remote `id' more performant in Tramp
* lisp/net/tramp-adb.el (tramp-adb-handle-file-exists-p): New defun.
(tramp-adb-file-name-handler-alist): Use it.
(tramp-adb-handle-file-executable-p)
(tramp-adb-handle-file-readable-p)
(tramp-adb-handle-file-writable-p)
(tramp-adb-handle-get-remote-uid)
(tramp-adb-handle-get-remote-gid)
(tramp-adb-handle-get-remote-groups): Use caches consequently.
* lisp/net/tramp-sh.el (tramp-perl-id, tramp-python-id): New defconsts.
(tramp-sh-handle-get-remote-uid, tramp-sh-handle-get-remote-gid)
(tramp-sh-handle-get-remote-groups): Use caches consequently.
(tramp-sh-handle-file-writable-p): Use `file-writable-p'.
(tramp-expand-script): Handle also "python" expansion.
(tramp-get-remote-id): Do not set connection property anymore,
this is done differently now.
(tramp-get-remote-uid-with-id, tramp-get-remote-uid-with-perl)
(tramp-get-remote-uid-with-python, tramp-get-remote-gid-with-id)
(tramp-get-remote-gid-with-perl)
(tramp-get-remote-gid-with-python): Remove.
* lisp/net/tramp.el (tramp-check-cached-permissions):
Call `tramp-get-remote-groups' only if needed.
(tramp-get-remote-groups): Do not return default value.
(tramp-read-id-output): New defun.
* test/lisp/net/tramp-tests.el (tramp--test-deftest-with-perl):
Suppress also remote `id'.
Add new user option 'diff-add-log-use-relative-names'
* .dir-locals.el: Set new option to t
* etc/NEWS: Mention new option.
* lisp/vc/diff-mode.el (diff-add-log-use-relative-names): Add new option.
(diff-add-log-current-defuns): Use new option.
* doc/emacs/maintaining.texi (Log Buffer): Mention new option.
Po Lu [Thu, 8 Sep 2022 05:20:33 +0000 (13:20 +0800)]
Avoid selecting for excessive output configuration events
* src/xterm.c (x_term_init): Only select for
RROutputPropertyNotify if GTK is in use. Emacs doesn't need it
itself, and output property changes will otherwise lead to 2
second freezes over connections with high network latency.
Morgan Smith [Thu, 8 Sep 2022 00:12:44 +0000 (02:12 +0200)]
image-dired: Fix moving forward when marking files
* lisp/image/image-dired.el (image-dired--do-mark-command): Make
movement consistent regardless of the value of
image-dired-marking-shows-next. (Bug#57651)
Eli Zaretskii [Wed, 7 Sep 2022 13:20:29 +0000 (16:20 +0300)]
Add instructions to 'standard-display-by-replacement-char'
* lisp/disp-table.el (standard-display-by-replacement-char): Add a
preamble to the generated code with instructions. Suggested by
Richard Stallman <rms@gnu.org>.
We no longer care enough about non-lexbind code generation for it
to merit special attention; better to keep the code simple.
Suggested by Philip Kaludercic in
https://lists.gnu.org/archive/html/emacs-devel/2022-09/msg00354.html .
* lisp/subr.el (dolist, dotimes): Use uninterned symbols for variable
bindings generated by the macros, and discard the alternative code
versions for non-lexbind code. Use sensible variable names.
Eli Zaretskii [Tue, 6 Sep 2022 12:09:09 +0000 (15:09 +0300)]
Fix the MS-Windows build
* lib-src/emacsclient.c (DEFAULT_TIMEOUT): Move out of the
!WINDOWSNT condition, to fix the MS-Windows compilation.
(set_socket_timeout) [WINDOWSNT]: Protect against too-large values
of timeout.
Stefan Kangas [Tue, 6 Sep 2022 11:57:01 +0000 (13:57 +0200)]
Don't mention very old Emacs versions in docs
* doc/misc/mh-e.texi (Conventions):
* doc/misc/reftex.texi (Problems and Work-Arounds):
* doc/misc/viper.texi (Loading Viper): Delete references to
very old versions of Emacs.
Po Lu [Tue, 6 Sep 2022 11:39:05 +0000 (19:39 +0800)]
Correctly handle frame synchronization on fullscreen KWin
* src/xfns.c (x_set_use_frame_synchronization): Announce that we
do not want the compositor to unredirect the frame while
fullscreen.
* src/xterm.c (x_atom_refs): New atom
`_NET_WM_BYPASS_COMPOSITOR'.
* src/xterm.h (struct x_display_info): Likewise.
Kai Tetzlaff [Mon, 28 Feb 2022 10:08:07 +0000 (11:08 +0100)]
Fix (mostly multibyte) issues in sieve-manage.el (Bug#54154)
The managesieve protocol (s. RFC5804) requires support for (a sightly
restricted variant of) UTF-8 in script content and script names. This
commit fixes/improves the handling of multibyte characters.
In addition, `sieve-manage-getscript' now properly handles NO
responses from the server instead of inflooping.
There are also some logging improvements.
* lisp/net/sieve-manage.el
(sieve-manage--append-to-log):
(sieve-manage--message):
(sieve-manage--error):
(sieve-manage-encode):
(sieve-manage-decode):
(sieve-manage-no-p): New functions.
(sieve-manage-make-process-buffer): Switch process buffer to unibyte.
(sieve-manage-open-server): Add `:coding 'raw-text-unix` to
`open-network-stream' call. Use unix EOLs in order to keep matching
CRLF (aka "\r\n") intact.
(sieve-manage-send): Make sure that UTF-8 multibyte characters are
properly encoded before sending data to the server.
(sieve-manage-getscript):
(sieve-manage-putscript): Use the changes above to fix down/uploading
scripts containing UTF-8 multibyte characters.
(sieve-manage-listscripts):
(sieve-manage-havespace)
(sieve-manage-getscript)
(sieve-manage-putscript):
(sieve-manage-deletescript):
(sieve-manage-setactive): Use the changes above to fix handling of
script names which contain UTF-8 multibyte characters.
(sieve-manage-parse-string):
(sieve-manage-getscript): Add handling of server responses with type
NO. Abort `sieve-manage-getscript' and show error message in message
area.
(sieve-manage-erase):
(sieve-manage-drop-next-answer):
(sieve-manage-parse-crlf): Return erased/dropped data (instead of nil).
(sieve-sasl-auth):
(sieve-manage-getscript):
(sieve-manage-erase):
(sieve-manage-open-server):
(sieve-manage-open):
(sieve-manage-send): Improve logging.
* lisp/find-lisp.el (find-lisp-find-dired-other-window): New command.
(find-lisp-find-dired): Improve the doc string.
(find-lisp-find-dired-subdirectories): Clarify doc string.
(find-lisp-find-dired-subdirs-other-window): New command.
(find-lisp-find-dired-internal): Adjust to allow being called by
the new command.
(find-lisp-format): Make symlink output more regular.
Apply syntax highlighting for all python f-strings
* lisp/progmodes/python.el (python--f-string-p)
(python--font-lock-f-strings): Edit functions to use a regular
expression matching all f-strings (bug#56757).