Glenn Morris [Fri, 29 Oct 2021 16:20:05 +0000 (09:20 -0700)]
Merge from origin/emacs-28
08de838531 ; Improve commentary in the last change 3da9fa875b Make hieroglyphs display correctly with existing fonts 928e05f2d6 Clarify "default face attributes" in the ELisp manual 5dbb04e0eb Make `C-u RET' work again d72fefdeab Fix typos in the manual and in a comment
Glenn Morris [Fri, 29 Oct 2021 16:19:51 +0000 (09:19 -0700)]
Merge from origin/emacs-28
7e2b973d60 * lisp/textmodes/text-mode.el (text-mode-context-menu): Re... da6d889e90 ; * etc/NEWS: Use active voice for 'repeat-mode', etc. e3171e7e86 Allow automatic use of color fonts for emoji on macOS
Stefan Kangas [Fri, 29 Oct 2021 15:44:29 +0000 (17:44 +0200)]
Prefer giflib 5 macros to magic numbers
* src/image.c (DISPOSAL_UNSPECIFIED, DISPOSE_DO_NOT)
(DISPOSE_BACKGROUND, DISPOSE_PREVIOUS, NO_TRANSPARENT_COLOR)
[GIFLIB_MAJOR < 5]: Macro defined (for old versions of giflib).
(gif_load): Replace magic numbers with giflib 5 macros for disposal
and transparency_color_index.
* lisp/gnus/gnus-art.el (gnus-article-mode): Set
mm-inline-message-prepare-function buffer-locally so that it works
both when inlining rfc822 and hitting the MIME button (bug#51388).
(gnus-mime--inline-message): Factor out into own function.
(gnus-mime-display-single): From here.
Eli Zaretskii [Fri, 29 Oct 2021 07:10:01 +0000 (10:10 +0300)]
Clarify "default face attributes" in the ELisp manual
* doc/lispref/display.texi (Defining Faces): Add index entries for
face symbol properties.
(Attribute Functions): Clarify "default face attribute values" wrt
'face-all-attributes' and 'face-attribute'. (Bug#51465)
Stefan Kangas [Tue, 12 Oct 2021 22:04:23 +0000 (00:04 +0200)]
Be more allowing when looking for menu-bar items
* src/keymap.c (lookup_key_1): Factor out function from
Flookup_key.
(Flookup_key): Be case insensitive, and treat spaces as dashes,
when looking for Qmenu_bar items. (Bug#50752)
* test/src/keymap-tests.el
(keymap-lookup-key/mixed-case)
(keymap-lookup-key/mixed-case-multibyte)
(keymap-lookup-keymap/with-spaces)
(keymap-lookup-keymap/with-spaces-multibyte)
(keymap-lookup-keymap/with-spaces-multibyte-lang-env): New tests.
Eli Zaretskii [Thu, 28 Oct 2021 15:47:41 +0000 (18:47 +0300)]
Ignore more events in input-pending-p
* src/keyboard.c (readable_events)
(kbd_buffer_store_buffered_event): Use 'is_ignored_event' to
decide whether the input event is to be ignored.
(is_ignored_event): New function.
(syms_of_keyboard) <input-pending-p-filter-events>: New variable.
Patch from Aaron Jensen <aaronjensen@gmail.com>.
* lisp/image-dired.el (image-dired-thumbnail-mode-map)
(image-dired-display-image-mode-map, image-dired-minor-mode-map):
In Emacs 26.1 (commits b905454680c7 and bed0373855ea), the menus were
converted to use 'easy-menu-define', but they were reversed in the
process. Unreverse the menus. (Bug#51446)
Stefan Kangas [Thu, 28 Oct 2021 00:10:09 +0000 (02:10 +0200)]
Do interactive mode tagging in image-dired.el
* lisp/image-dired.el (image-dired-restore-window-configuration)
(image-dired-next-line, image-dired-previous-line)
(image-dired-mark-thumb-original-file)
(image-dired-unmark-thumb-original-file)
(image-dired-flag-thumb-original-file)
(image-dired-toggle-mark-thumb-original-file)
(image-dired-jump-original-dired-buffer)
(image-dired-delete-char, image-dired-refresh-thumb)
(image-dired-display-next-thumbnail-original)
(image-dired-display-previous-thumbnail-original): Do interactive
tagging; these will only work in 'image-dired-thumbnail-mode'.
Stefan Kangas [Wed, 27 Oct 2021 23:59:01 +0000 (01:59 +0200)]
image-dired: Make thumbnail rotation commands obsolete
* lisp/image-dired.el (image-dired-cmd-rotate-thumbnail-program)
(image-dired-cmd-rotate-thumbnail-options)
(image-dired-rotate-thumbnail)
(image-dired-rotate-thumbnail-left)
(image-dired-rotate-thumbnail-right): Make obsolete in favor of
'image-dired-refresh-thumb' and 'image-rotate'. It makes no sense to
have destructive thumbnail rotation commands now that Emacs can rotate
thumbnails in memory, and it is very fast to just generate a new one
reflecting the rotation of the original.
(image-dired-thumbnail-mode-map): Remove menu entries and key bindings
for above obsolete commands. The rotate right keybinding had already
been made ineffective by the local keymap added by 'insert-image'.
Stefan Kangas [Wed, 27 Oct 2021 18:39:10 +0000 (20:39 +0200)]
Increase image-dired-show-all-from-dir-max-files to 500
* lisp/image-dired.el (image-dired-show-all-from-dir-max-files):
Increase default to 500 to ask for confirmation much less frequently.
The old value was added before we had asynchronous generation of
thumbnails, when a large number of files would lock up Emacs. Asking
for confirmation could probably be disabled completely these days, but
let's be conservative and set it to some large number of files for
which some users might want to see a prompt. It can't hurt.
(image-dired-show-all-from-dir): Never warn if above variable is nil.
(image-dired-bookmark-jump): Let-bind above variable to nil instead of
'most-positive-fixnum'.
* doc/emacs/dired.texi (Image-Dired): Don't mention the above
variable, as it is no longer important enough to deserve the space.
* etc/NEWS: Announce the above change.
Glenn Morris [Wed, 27 Oct 2021 14:59:28 +0000 (07:59 -0700)]
Merge from origin/emacs-28
2bdd5732aa (origin/emacs-28) ; * etc/NEWS: Fix last change. 492b927909 Fix help commands for menu-bar menus 9589be772d ; * etc/NEWS: Fix typos. d353fc4a00 ; Explain why "kinds of atom" isn't a typo 47a3750162 ; * etc/NEWS: Improve wording of the Emoji entry. b814712796 ; Checkdoc fixes in image-dired.el e45b3fc521 Improve function documentation with text from XDG BDS spec 284c77eeb6 * lisp/transient.el: Update to package version 0.3.7. 40400e6977 ; Revert parts of "Use string-replace instead of replace-r... 214c2e268c ; Revert parts of "Use string-search instead of string-mat...
Jim Porter [Wed, 27 Oct 2021 13:54:42 +0000 (15:54 +0200)]
Be more efficient when checking for a matching client in server.el
lisp/server.el (server-handle-delete-frame): Use 'seq-some' to
determine if another frame for the current client exists.
(server-kill-emacs-query-function): Use 'seq-some' to determine if
another live client exists (bug#51420).
Miha Rihtaršič [Tue, 26 Oct 2021 08:54:54 +0000 (10:54 +0200)]
Allow matching non-.git gitlab and gitea URLs in bug-reference
* lisp/progmodes/bug-reference.el
(bug-reference--build-forge-setup-entry): Allow matching non-.git
gitlab and gitea URLs, with and without slashes (bug#51316).
* src/atimer.c (init_atimer): Always start the SIGALRM alarms,
even if we're using timerfd (bug#19776). See long, long
discussion in the bug report for why this is necessary.
Redisplay after changing to the hourglass mouse pointer
* src/xterm.c (x_show_hourglass): Do a redisplay after changing to
the hourglass pointer -- otherwise it won't be displayed until a
keyboard/mouse event arrives (bug#19776).
Stefan Kangas [Wed, 27 Oct 2021 05:51:35 +0000 (07:51 +0200)]
image-dired: Set line-spacing to match horizontal space
* lisp/image-dired.el (image-dired-thumbnail-mode): Set value of
'line-spacing' to approximately match horizontal space. This makes
the thumbnail view look better.
Stefan Kangas [Wed, 27 Oct 2021 02:34:25 +0000 (04:34 +0200)]
image-dired: Improve mouse behaviour
* lisp/image-dired.el (image-dired-thumbnail-mode-map): Improve mouse
behaviour: ignore dragging, as it currently doesn't do anything
useful, and make all clicks just select the thumbnail.
(image-dired-mouse-display-image)
(image-dired-mouse-select-thumbnail): Move point to closest image
after clicking in buffer.
Stefan Kangas [Wed, 27 Oct 2021 01:43:21 +0000 (03:43 +0200)]
image-dired: Don't ding at beginning or end of buffer
* lisp/image-dired.el
(image-dired--display-thumb-properties-fun): New defun.
(image-dired-forward-image, image-dired-backward-image): Don't ding
when moving past first or last image; instead show a message, wait a
second and then show image properties.
Stefan Kangas [Wed, 27 Oct 2021 01:23:49 +0000 (03:23 +0200)]
image-dired: Add new commands for beginning/end of buffer
* lisp/image-dired.el (image-dired-beginning-of-buffer)
(image-dired-end-of-buffer): New commands.
(image-dired-thumbnail-mode-map): Bind new beginning of buffer command
to '<' and 'M-<', and end of buffer command to '>' and 'M->'.
Stefan Kangas [Tue, 26 Oct 2021 23:32:58 +0000 (01:32 +0200)]
image-dired: Increase number of asynch thumbnail generation jobs
* lisp/image-dired.el (image-dired-queue-active-limit): Increase the
number of asynchronous thumbnail generation jobs to a maximum of 4 or
processor count divided by 2. This makes thumbnail generation around
30 % faster when benchmarking this on my machine (8 cores/4 jobs).
(image-dired-debug): New defvar.
(image-dired-debug-message): New defun.
(image-dired--generate-thumbs-start): New defvar.
(image-dired-create-thumb-1, image-dired-display-thumbs): Display time
spent on thumbnail generation if 'image-dired-debug' is non-nil.
Stefan Kangas [Tue, 26 Oct 2021 21:17:29 +0000 (23:17 +0200)]
Improve function documentation with text from XDG BDS spec
* lisp/xdg.el (xdg-config-home, xdg-cache-home, xdg-data-home)
(xdg-runtime-dir, xdg-config-dirs, xdg-data-dirs): Copy in the
text from the XDG Base Directory Specification to better explain
what these functions return.
Alan Mackenzie [Tue, 26 Oct 2021 20:13:18 +0000 (20:13 +0000)]
CC Mode: minor amendments more accurately to handle virtual semicolons, etc.
* lisp/progmodes/cc-engine.el (c-laomib-loop): Check for a virtual semicolon
as well as a ;.
(c-guess-basic-syntax): CASE 5D - Use c-crosses-statement-barrier-p to check
whether we've gone back past a virtual semicolon.
Eric Abrahamsen [Mon, 25 Oct 2021 16:39:52 +0000 (09:39 -0700)]
IMAP search should only use charset utf-8 with multibyte strings
Background: Exchange servers cannot accept "charset utf-8" search
strings. The code originally set that charset for any server with
literal+ capability, borking all searches on an Exchange server. This
code only sets utf-8 for multibyte search strings in particular, which
would be borken for Exchange anyway.
* lisp/gnus/gnus-search.el (gnus-search-imap-search-command): Ensure
we're only doing the literal+ dance for multibyte strings (multibyte
strings will have had newlines inserted in an earlier step).
Eli Zaretskii [Mon, 25 Oct 2021 16:11:06 +0000 (19:11 +0300)]
Revert "Fix a typo in emacs-lisp-intro.texi"
This reverts commit 98eb6d783a482cd7ebca7ec656b0775b82c68e57.
I've consulted with Richard Stallman about this, and he says
that the original wording, "kinds of atom", is both correct
and more elegant writing. So I'm restoring the original text.
* doc/lispintro/emacs-lisp-intro.texi (Lisp Atoms): Undo the
fix of a "typo" that wasn't a typo. (Bug#51271)
Martin Rudalics [Mon, 25 Oct 2021 08:42:17 +0000 (10:42 +0200)]
Allow 'display-buffer' to set up body size of chosen window (Bug#17065)
* doc/lispref/windows.texi (Buffer Display Action Alists):
Describe new possible values for 'window-height', 'window-width'
and 'window-size' action alist entries.
* lisp/window.el (window--display-buffer): Handle new values for
'window-height', 'window-width' and 'window-size' ALIST entries.
(display-buffer): Update doc-string for new values of some
action alist entries.
* etc/NEWS: Mention new values of some action alist entries.
Stefan Kangas [Mon, 25 Oct 2021 05:51:02 +0000 (07:51 +0200)]
New function xdg-state-home
* lisp/xdg.el (xdg-state-home): New function. This returns
$XDG_STATE_HOME according to the XDG Base Directory Specification
version 0.8 (08th May 2021).
Stefan Kangas [Mon, 25 Oct 2021 03:47:56 +0000 (05:47 +0200)]
Double value of image-dired-show-all-from-dir-max-files
* lisp/image-dired.el (image-dired-show-all-from-dir-max-files):
Double the amount of files in directory before prompting. This could
be even higher, as the thumbnails are generated asynchronously and are
small by default.
Stefan Kangas [Mon, 25 Oct 2021 01:50:04 +0000 (03:50 +0200)]
image-dired: Add support for GraphicsMagick
* lisp/image-dired.el (image-dired-cmd-create-thumbnail-program)
(image-dired-cmd-create-thumbnail-options)
(image-dired-cmd-create-temp-image-program)
(image-dired-cmd-create-temp-image-options)
(image-dired-cmd-rotate-thumbnail-program)
(image-dired-cmd-rotate-thumbnail-options): Add support for the
GraphicsMagick command line tool ("gm convert", "gm mogrify").
Stefan Kangas [Mon, 25 Oct 2021 00:12:48 +0000 (02:12 +0200)]
Support new Thumbnail Managing Standard sizes in image-dired
* lisp/image-dired.el
(image-dired--thumbnail-managing-standard-sizes): New defconst.
(image-dired-thumbnail-storage)
(image-dired-thumb-name, image-dired-insert-thumbnail)
(image-dired-thumb-size, image-dired-create-thumb-1): Support larger
thumbnail sizes mandated by new version of the Thumbnail Managing
Standard (December 2020, Version 0.9.0).