* lisp/emacs-lisp/warnings.el (warning-suppress-action)
(warning-suppress-log-action): Removed.
New icon.
(warnings-suppress): New helper function.
(display-warning): Use it (bug#46025).
* lisp/help.el (describe-bindings): Don't force buttons on
(bug#56691).
* lisp/outline.el (outline-minor-mode-use-buttons): Default
buttons on in special-mode buffers.
* lisp/outline.el (outline-minor-mode-buttons): Remove.
(outline-open, outline-close): New icons.
(outline-minor-mode-highlight-buffer): Use the new predicate to
switch on/off.
(outline--make-button): Remove.
(outline--make-button-overlay): Use icons.el instantiation.
(outline--valid-emoji-p): Remove.
(outline--valid-char-p): Remove.
(outline--insert-open-button, outline--insert-close-button): Make
point movement better in *Help* buffers.
* doc/emacs/custom.texi (Specific Customization): Mention it.
* doc/emacs/display.texi (Icons): New node.
* doc/lispref/display.texi (Icons): New node.
* lisp/button.el (buttonize):
(button--properties, buttonize-region): Allow not overriding faces.
* lisp/cus-edit.el (custom-save-all): Save icons.
(custom-icon): New widget.
(custom-icon-value-create, custom-toggle-hide-icon)
(custom--icons-widget-value, custom-icon-set): Helper functions
for the widget.
(customize-icon): Main command.
(custom-icon-state-set, custom-icon-state): Helper functions.
(custom-theme-set-icons): Function to be used by theme writers.
(custom-set-icons): Function to be used in .emacs.
(custom-save-icons): New function.
* lisp/custom.el (custom-push-theme): Add icons.
* lisp/emacs-lisp/icons.el: New file.
* test/lisp/emacs-lisp/icons-tests.el: Add some tests.
Ensure that we don't call print-unreadable-function from " prin1"
* src/print.c (PRINTPREPARE): Bind the current buffer so that we
can retrieve it later.
(print_vectorlike): Use it (bug#56773).
(syms_of_print): New internal `print--unreadable-callback-buffer'
variable.
Po Lu [Thu, 28 Jul 2022 07:17:04 +0000 (07:17 +0000)]
Fix race conditions in mouse button handling on Haiku
* src/haiku_support.cc (class EmacsView): New field
`grabbed_buttons'. Remove `previous_buttons'.
(BasicMouseDown, BasicMouseUp): Accept new parameter `message'.
Use data from that message instead.
(MouseDown, MouseUp): Pass the current message to BasicMouseUp
and BasicMouseDown.
Paul Pogonyshev [Wed, 27 Jul 2022 19:20:55 +0000 (21:20 +0200)]
Release the desktop lock in 'kill-emacs-hook'
* lisp/desktop.el: Run 'desktop--on-kill' in 'kill-emacs-hook'.
(desktop--on-kill): New function, refactored from 'desktop-kill'.
(desktop-kill): Call 'desktop--on-kill'. (Bug#56800)
Stefan Kangas [Wed, 27 Jul 2022 22:25:33 +0000 (00:25 +0200)]
Drop support for obsolete "Lisp Code Directory" from ffap
Ref: https://flex.phys.tohoku.ac.jp/texi/faq/faq_146.html
Note also that the host "archive.cis.ohio-state.edu" is unknown.
* lisp/ffap.el (ffap-alist): Drop support for obsolete "Lisp Code
Directory".
(ffap-lcd): Make obsolete.
Stefan Kangas [Wed, 27 Jul 2022 21:33:03 +0000 (23:33 +0200)]
Drop support for XEmacs package EFS
EFS is a long defunct XEmacs-specific fork of Ange FTP that is
superseded by TRAMP.
* lisp/ffap.el (ffap-ftp-default-user)
(ffap-replace-file-component, ffap-host-to-filename):
* lisp/gnus/mml.el (mml-parse-file-name):
* lisp/gnus/nnheader.el (nnheader-re-read-dir):
* lisp/net/browse-url.el (browse-url-filename-alist):
* lisp/speedbar.el (speedbar-check-vc): Drop support for XEmacs
package EFS.
F. Jason Park [Wed, 6 Jul 2022 07:40:42 +0000 (00:40 -0700)]
Avoid mutating default value of erc-server-last-peers
* lisp/erc/erc-backend.el (erc-server-last-peers): Leave default as
nil instead of a quoted constant.
(erc-server-connect): Initialize `erc-server-last-peers' to a new
value local to a server buffer.
(erc-message): Operate on server's local `erc-server-last-peers' value
instead of the global default. Prefer replacing value instead of
mutating CDR to make for easier testing.
(erc-server-PRIVMSG): Create a new `erc-server-last-peers' for easier
testing. (Bug#56449)
F. Jason Park [Sun, 24 Jul 2022 12:14:24 +0000 (05:14 -0700)]
Ensure erc-dcc-chat-setup runs in the right buffer
* lisp/erc/erc-dcc.el (erc-dcc-chat-setup): Ensure initialization runs
in the intended buffer regardless of the value of `erc-join-buffer'.
(erc-dcc--send-final-turbo-ack, erc-dcc-get-filter): Rename internal
variable formerly known as `erc-dcc--X-send-final-turbo-ack'.
F. Jason Park [Sun, 24 Jul 2022 12:14:24 +0000 (05:14 -0700)]
Allow non-IRC line delimiters with ERC test server
* test/lisp/erc/resources/erc-d/erc-d.el (erc-d-server-fqdn,
erc-d--initialize-client, erc-d--log, erc-d--send, erc-d--filter,
erc-d-run): Add new variable and use it. Also optionally accept
keyword arguments in `erc-d-run'.
* test/lisp/erc/resources/erc-d/erc-d-tests.el
(erc-d-run-direct-foreign-protocol): Add test demoing newline-only
line-wise protocol.
* test/lisp/erc/resources/erc-d/resources/foreign.eld: New file.
* lisp/net/tramp-compat.el (tramp-compat-string-equal-ignore-case):
New defalias.
* lisp/net/tramp-gvfs.el (tramp-gvfs-handler-mounted-unmounted): Use it.
Po Lu [Wed, 27 Jul 2022 05:01:41 +0000 (13:01 +0800)]
Remove workaround for some input method problems
* src/xterm.c (handle_one_xevent): Remove modifier key
workaround for some input method problems, since they cause more
problems than they fix. (bug#56782)
Po Lu [Wed, 27 Jul 2022 03:21:34 +0000 (11:21 +0800)]
Fix NS stretch glyph display
* src/nsterm.m (ns_draw_window_cursor): Just draw hollow cursor.
There is no need to draw the phys cursor glyph.
(ns_dumpglyphs_stretch): Delete function.
(ns_draw_glyph_string): New function. Port code from X and use
it instead. (bug#56787)
Alan Mackenzie [Tue, 26 Jul 2022 19:43:13 +0000 (19:43 +0000)]
CC Mode: correct the calculation and handling of c-use-category.
This fixes bug #56629. The use of c-use-category was inconsistent, with the
result that it would be nil at compilation time, but t at run time. This
resulted in wrongly writing syntax-table text properties to <s and >s, yet
testing for category properties on them.
* lisp/progmodes/cc-defs.el (c-use-category): Move to after the definition of
c-<-as-paren-syntax and c->-as-paren-syntax so as correctly to be able to use
their values. Put an eval-when-compile around the calculation of its value,
to reduce the chances of future failure.
(c-mark-<-as-paren, c-mark->-as-paren, c-unmark-<->-as-paren, c-sc-scan-lists)
(c-sc-parse-partial-sexp): Wrap c-use-category in (eval-when-compile ...) as
an optimization, preventing the XEmacs code also being generated.
* lisp/minibuffer.el (minibuffer-local-must-match-map): Remove the
M-X binding here, because it's nonsensical outside
read-extended-command (bug#56741).
* lisp/simple.el (read-extended-command-mode-map)
(read-extended-command-mode): New minor mode to bind `M-X' in
read-extended-command.
(read-extended-command-1): Use it.
Like duplicate-line but duplicates the region instead if active.
Rectangular regions are duplicated on the right-hand side.
The region remains active afterwards, to facilitate further
duplication or other operations on the same text.
Po Lu [Tue, 26 Jul 2022 08:12:06 +0000 (16:12 +0800)]
Fix flicker when moving tooltips between frames during mouse drag-and-drop
* src/haikufns.c (Fx_show_tip):
* src/nsfns.m (Fx_show_tip): Allow sharing existing tooltip
frames between any two frames.
* src/xfns.c (Fx_show_tip): Allow that but only between frames
on the same X display.
Po Lu [Mon, 25 Jul 2022 02:07:30 +0000 (10:07 +0800)]
Fix mouse face handling with tooltips
* src/xterm.c (handle_one_xevent): Clear last_mouse_motion_frame
and last_mouse_glyph_frame on LeaveNotify. Otherwise, mouse
face will be restored by gui_redo_mouse_highlight and will not
be restored if an EnterNotify is later sent on top of the same
glyph.
Michael Albinus [Sun, 24 Jul 2022 14:02:10 +0000 (16:02 +0200)]
Refactor Tramp
* lisp/net/tramp-adb.el (tramp-adb-file-name-handler-alist):
Use `tramp-adb-handle-get-remote-gid' and
`tramp-adb-handle-get-remote-uid'.
(tramp-adb-handle-file-attributes): Use `tramp-convert-file-attributes'.
(tramp-do-parse-file-attributes-with-ls): Remove ID-FORMAT.
(tramp-adb-handle-directory-files-and-attributes):
Use `tramp-skeleton-directory-files-and-attributes'.
(tramp-adb-handle-file-local-copy): Use `tramp-skeleton-file-local-copy'.
(tramp-adb-handle-copy-file, tramp-adb-handle-rename-file):
Use `tramp-barf-if-file-missing'.
(tramp-adb-handle-get-remote-uid)
(tramp-adb-handle-get-remote-gid): New defuns.
* lisp/net/tramp-archive.el (tramp-archive-file-name-handler-alist):
Use `tramp-archive-handle-directory-files'.
(tramp-archive-handle-directory-files): New defun.
* lisp/net/tramp-cache.el (tramp-file-property-p): New defun.
* lisp/net/tramp-compat.el (tramp-compat-take): New defalias.
* lisp/net/tramp-crypt.el (tramp-crypt-do-copy-or-rename-file):
Use `tramp-barf-if-file-missing'.
(tramp-crypt-handle-directory-files):
Use `tramp-skeleton-directory-files'.
* lisp/net/tramp-fuse.el (tramp-fuse-handle-directory-files):
Use `tramp-skeleton-directory-files'.
* lisp/net/tramp-gvfs.el (tramp-gvfs-do-copy-or-rename-file):
Use `tramp-barf-if-file-missing'.
* lisp/net/tramp-rclone.el (tramp-rclone-do-copy-or-rename-file):
Use `tramp-barf-if-file-missing'.
* lisp/net/tramp-sh.el (tramp-readlink-file-truename)
(tramp-stat-file-attributes)
(tramp-stat-directory-files-and-attributes): New defconsts.
(tramp-perl-file-attributes)
(tramp-perl-directory-files-and-attributes): Adapt.
(tramp-sh-handle-make-symbolic-link): Flush TARGET file properties.
(tramp-sh-handle-file-truename): Use `tramp-readlink-file-truename'
(tramp-sh-handle-file-exists-p)
(tramp-sh-handle-file-executable-p)
(tramp-sh-handle-file-readable-p)
(tramp-sh-handle-file-directory-p)
(tramp-sh-handle-file-writable-p): Adapt check of file properties.
(tramp-sh-handle-file-attributes): Simplify.
(tramp-do-file-attributes-with-ls): Remove ID-FORMAT. Combine two
remote commands. Compute both versions of uid and gid together.
(tramp-do-file-attributes-with-perl)
(tramp-do-directory-files-and-attributes-with-perl):
Remove ID-FORMAT.
(tramp-do-file-attributes-with-stat): Remove ID-FORMAT. Use
`tramp-stat-file-attributes'.
(tramp-sh-handle-directory-files-and-attributes):
Use `tramp-skeleton-directory-files-and-attributes'.
(tramp-do-directory-files-and-attributes-with-stat):
Remove ID-FORMAT. Use `tramp-stat-directory-files-and-attributes'.
(tramp-sh-handle-copy-directory): Use `tramp-skeleton-copy-directory'.
(tramp-do-copy-or-rename-file): Use `tramp-barf-if-file-missing'.
(tramp-sh-handle-file-local-copy): Use `tramp-skeleton-file-local-copy'.
(tramp-sh-handle-write-region): Combine two remote commands.
(tramp-sh-gio-monitor-process-filter): Simplify `cond' call.
(tramp-expand-script): Extend for ls, readling and stat.
(tramp-open-connection-setup-interactive-shell): Do not set
`tramp-end-of-output'.
(tramp-open-connection-setup-interactive-shell): Do not send
prompt formatting command, it's superfluous.
(tramp-send-command-and-check): Rearrange in order to accept also
heredoc scripts.
(tramp-convert-file-attributes): Move function to tramp.el.
(tramp-get-remote-id): Set connection property.
(tramp-get-remote-uid-with-id): Use it.
(tramp-get-remote-python): Don't check for python2 anymore.
* lisp/net/tramp-smb.el (tramp-smb-file-name-handler-alist):
Use `tramp-handle-directory-files'.
(tramp-smb-handle-copy-directory): Use `tramp-skeleton-copy-directory'.
(tramp-smb-handle-directory-files): Remove.
(tramp-smb-handle-file-attributes): Use `tramp-convert-file-attributes'.
(tramp-smb-do-file-attributes-with-stat): Remove ID-FORMAT.
(tramp-smb-handle-file-local-copy): Use `tramp-skeleton-file-local-copy'.
* lisp/net/tramp-sudoedit.el (tramp-sudoedit-do-copy-or-rename-file):
Use `tramp-barf-if-file-missing'.
(tramp-sudoedit-file-attributes): New defconst.
(tramp-sudoedit-handle-file-attributes): Simplify code.
* lisp/net/tramp.el (tramp-setup-debug-buffer): Set debug buffer
as not modified.
(tramp-barf-if-file-missing, tramp-skeleton-copy-directory)
(tramp-skeleton-directory-files)
(tramp-skeleton-directory-files-and-attributes)
(tramp-skeleton-file-local-copy): New macros.
(tramp-handle-copy-directory): Use `tramp-skeleton-copy-directory'.
(tramp-handle-directory-files): Use `tramp-skeleton-directory-files'.
(tramp-handle-file-local-copy): Use `tramp-skeleton-file-local-copy'.
(tramp-handle-insert-file-contents): Use `tramp-barf-if-file-missing'.
(tramp-get-process-attributes, tramp-action-out-of-band):
Simplify `cond' call.
(tramp-check-cached-permissions): Simplify.
(tramp-make-tramp-temp-file): Reimplement.
Po Lu [Sun, 24 Jul 2022 13:32:42 +0000 (21:32 +0800)]
Throw errors in XDS handler directly
* lisp/x-dnd.el (x-dnd-xds-testing): New defvar.
(x-dnd-handle-direct-save): Signal errors directly if it is
true.
* test/lisp/x-dnd-tests.el (x-dnd-xds-testing): New defvar.
(x-dnd-tests-do-direct-save-internal): Bind it to t around
x-begin-drag. (bug#56712)
* lisp/vc/diff-mode.el (diff-whitespace-style): New user option.
(diff-setup-whitespace): Use it (Bug#56679).
(top level): require 'whitespace.
(whitespace-style, whitespace-trailing-regexp): Remove defvars.
Stefan Kangas [Sun, 24 Jul 2022 07:55:01 +0000 (09:55 +0200)]
Merge from origin/emacs-28
b4067394dc Set `default-directory' of Tramp archive connection buffer 2529e82002 ; * doc/lispref/functions.texi (Declare Form): Fix typo. 54c4ceb009 Update the documentation of 'declare' forms 7263631dca Fix bookmark support for Help functions in native-compilat...
* etc/NEWS: Mention how to suppress the warning.
* lisp/emacs-lisp/byte-run.el (with-suppressed-warnings): Amend doc string.
* lisp/subr.el: Use `macroexp-warn-and-return` to delay the warning
until codegen time (which makes it suppressible) and to prevent
repeated warnings.
* test/lisp/international/ccl-tests.el (shift):
* test/src/data-tests.el (data-tests-ash-lsh):
Suppress warning in tests of `lsh` itself.
For discussion, see:
https://lists.gnu.org/r/emacs-devel/2022-07/msg00761.html
* src/pdumper.c (dump_buffer): Dump new field
long_line_optimizations_p introduced in commit e7b5912b23 of
2022-07-16 "Improvements to long lines handling."
(dump_buffer) [CHECK_STRUCTS]: Update hash accordingly
for --enable-checking=structs.