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.
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).
Stefan Kangas [Mon, 25 Oct 2021 00:12:34 +0000 (02:12 +0200)]
Clarify two image-dired docstrings
* lisp/image-dired.el (image-dired-dir): Doc fix; clarify that
thumbnails will be saved in "$XDG_CACHE_HOME/thumbnails", as per the
Thumbnail Managing Standard.
(image-dired-thumb-size): Doc fix; clarify that this option will be
ignored when using the Thumbnail Managing Standard.
Stefan Kangas [Sun, 24 Oct 2021 21:25:07 +0000 (23:25 +0200)]
Use SHA1 when creating thumbnail file name
* lisp/image-dired.el (image-dired-thumb-name): Improve docstring.
Use SHA1 for hashing when creating file name. SHA1 is slightly faster
than MD5, and has a few more bits.
* doc/lispref/display.texi (Progress): Document it.
* lisp/subr.el (with-delayed-message): New macro.
* src/eval.c (with_delayed_message_display)
(with_delayed_message_cancel): Helper functions.
(Ffuncall_with_delayed_message): New function (bug#19776).
Alan Mackenzie [Sun, 24 Oct 2021 19:59:18 +0000 (19:59 +0000)]
CC Mode: Fontify "found types" which are recognized after being first scanned
This aims to fix the scenario where on jit-lock's first scan of a type, it is
not recognized as such, and only later does this happen. The fontification of
such found types is now done by background scanning in short time slices
immediately after initialising the mode.
* lisp/progmodes/cc-engine.el (c-add-type-1): New function.
(c-add-type): Extract c-add-type-1 from it, and reformulate the mechanism for
protecting c-found-types from excessive partial identifiers.
* lisp/progmodes/cc-fonts.el (c-font-lock-complex-decl-prepare): Remove the
code which cleared c-found-types on fontification at BOB.
(c-find-types-background): New function, based on c-font-lock-declarations).
(c-type-finder-timer-func): New function.
(c-re-redisplay-timer): New variable.
(c-force-redisplay, c-fontify-new-found-type): New functions.
* lisp/progmodes/cc-mode.el (c-type-finder-timer, c-inhibit-type-finder): New
variables.
(c-leave-cc-mode-mode): Nullify c-post-command-hook, c-post-gc-hook, and
c-type-finder-timer when the last CC Mode buffer of a session is killed.
(c-type-finder-pos): New variable.
(c-basic-common-init): Initialize/Install c-post-command, c-c-type-finder-pos,
c-type-finder-timer, and c-post-gc-hook.
(c-new-id-start, c-new-id-end, c-new-id-is-type): New variables.
(c-update-new-id): New function.
(c-post-command): New post command hook function, used for checking moving
away from partially typed identifiers, and making them full identifiers.
(c-post-gc-hook): New hook to prevent CC Mode activity immediately following
GC, thus allowing keyboard/mouse input to be registered.
(c-before-change): Add code to clear c-found-types on a buffer change at BOB.
(c-after-change): Call c-update-new-id to keep track of partially typed
identifiers.
* doc/misc/cc-mode.texi (Found Types): New @section in the @Chapter Font
Locking.
* lisp/progmodes/cc-vars.el (c-type-finder-time-slot)
(c-type-finder-repeat-time, c-type-finder-chunk-size): New customizable
options.
Stefan Kangas [Sun, 24 Oct 2021 19:20:16 +0000 (21:20 +0200)]
Use restrictive umask when creating image-dired data
* lisp/image-dired.el (image-dired-dir)
(image-dired-sane-db-file): Create thumbnail directory and
.image-dired_db with umask 077. This avoids creating world readable
copies of private data, and is in fact mandated by the Thumbnail
Managing Standard that we aim to support.
Jonas Bernoulli [Sun, 24 Oct 2021 13:35:05 +0000 (15:35 +0200)]
; lisp/transient.el: Revert some misguided stylistic fixes.
These aren't actual modes. Set checkdoc-symbol-words to avoid
false-positives. The first line of doc-strings of methods do
not need to end with period.
Don't unhide first thread if entering without selecting article
* lisp/gnus/gnus-sum.el (gnus-summary-first-unread-subject)
(gnus-summary-first-unseen-subject)
(gnus-summary-first-unseen-or-unread-subject): Use it.
(gnus-summary--goto-and-possibly-unhide): New function -- don't
unhide the first thread unless necessary (bug#51344).
Stefan Kangas [Sun, 24 Oct 2021 16:36:09 +0000 (18:36 +0200)]
Improve documentation of image-dired thumbnails
* lisp/image-dired.el: Fix documentation on thumbnail file format to
correctly say that it can be either PNG or JPEG; not just JPEG. Also
fix inconsistent formatting in comments.
* lisp/image-dired.el (image-dired-thumbnail-storage): Improve
docstring.
Stefan Kangas [Sun, 24 Oct 2021 16:28:20 +0000 (18:28 +0200)]
Add support for pngquant to image-dired
* lisp/image-dired.el (image-dired-cmd-pngnq-program)
(image-dired-cmd-pngnq-options): Add support for pngquant.
Prefer, in this order: pngquant, pngnq-s9, pngnq-s for reasons of
speed and how actively maintained the projects seem to be.
Eli Zaretskii [Sun, 24 Oct 2021 17:19:47 +0000 (20:19 +0300)]
Fix compilation errors with MinGW64 GCC 11
* lib-src/ntlib.c (_GL_ATTRIBUTE_MALLOC)
(_GL_ATTRIBUTE_DEALLOC_FREE): Define to avoid compilation errors
with MinGW64 GCC 11. Suggested by Andy Moreton
<andrewjmoreton@gmail.com>. Do not merge to master.
Stefan Kangas [Sun, 24 Oct 2021 14:47:22 +0000 (16:47 +0200)]
Add new option help-link-key-to-documentation
* lisp/help.el (help-link-key-to-documentation): New user option.
(substitute-command-keys): Add a link from keys to the command they
are bound to, if the above new option is non-nil. (Bug#8951)
* etc/NEWS: Announce the new option.
Stefan Kangas [Sun, 24 Oct 2021 06:34:52 +0000 (08:34 +0200)]
Make dired-x-guess-file-name-at-point obsolete
* lisp/dired-x.el (dired-x-guess-file-name-at-point): Make
obsolete in favour of 'thing-at-point'.
(dired-x-read-filename-at-point): Use 'thing-at-point' instead of
above obsolete function.
Stefan Kangas [Sat, 23 Oct 2021 17:20:31 +0000 (19:20 +0200)]
Improve documentation of cl-reduce
* doc/misc/cl.texi (Mapping over Sequences): Change the
explanation of 'cl-reduce' so you don't need to have a major in
mathematics to understand it. (Bug#24014)
Stefan Kangas [Sat, 23 Oct 2021 16:42:14 +0000 (18:42 +0200)]
Improve documentation of apply-partially
* doc/lispref/functions.texi (Calling Functions): Improve
documentation of 'apply-partially' to be slightly more clear with
regards to function arity. (Bug#17623)
Stefan Kangas [Sat, 23 Oct 2021 04:49:09 +0000 (06:49 +0200)]
Partially remove exiftool dependency from image-dired.el
* lisp/image-dired.el (exif): Require.
(image-dired-cmd-read-exif-data-program)
(image-dired-cmd-read-exif-data-options)
(image-dired-get-exif-data): Make obsolete in favour of using
exif.el. This removes a dependency on external exiftool for some
operations.
(image-dired-get-exif-file-name)
(image-dired-thumbnail-set-image-description): Use exif.el
functions instead of exiftool.
* lisp/image/exif.el (exif-tag-alist): Add description and
copyright fields.
* test/lisp/image-dired-tests.el: New file.
Stefan Kangas [Sat, 23 Oct 2021 04:12:35 +0000 (06:12 +0200)]
Add new function exif-field
* test/lisp/image/exif-tests.el (exif-elem): Move function from here...
* lisp/image/exif.el (exif-field): ...to here, and rename.
(exif-orientation):
* test/lisp/image/exif-tests.el (test-exif-parse)
(test-exif-parse-short): Use above new function.
Stefan Kangas [Sat, 23 Oct 2021 03:25:37 +0000 (05:25 +0200)]
Add links to commentary reached with finder-list-keywords
* lisp/finder.el (finder-goto-xref): Move from here...
* lisp/emacs-lisp/package.el (package--finder-goto-xref): ...to
here. Make the old name into an obsolete function alias.
(package--finder-xref): New button type.
(package--describe-add-library-links): Factor out new function...
* lisp/finder.el (finder-commentary): ...from here.
(describe-package-1): Call above new function. This fixes an
issue where commentaries reached via 'finder-list-keywords' did
not have links. (Bug#10814)
Alan Mackenzie [Fri, 22 Oct 2021 19:55:01 +0000 (19:55 +0000)]
CC Mode: Fontify "found types" which are recognized after being first scanned
This aims to fix the scenario where on jit-lock's first scan of a type, it is
not recognized as such, and only later does this happen. The fontification of
such found types is now done by background scanning in short time slices
immediately after initialising the mode.
* lisp/progmodes/cc-engine.el (c-add-type-1): New function.
(c-add-type): Extract c-add-type-1 from it, and reformulate the mechanism for
protecting c-found-types from excessive partial identifiers.
* lisp/progmodes/cc-fonts.el (c-font-lock-complex-decl-prepare): Remove the
code which cleared c-found-types on fontification at BOB.
(c-find-types-background): New function, based on c-font-lock-declarations).
(c-types-finder-timer-func): New function.
(c-re-redisplay-timer): New variable.
(c-force-redisplay, c-fontify-new-found-type): New functions.
* lisp/progmodes/cc-mode.el (c-type-finder-timer): New variable.
(c-leave-cc-mode-mode): Nullify c-post-command-hook and c-type-finder-timer
when the last CC Mode buffer of a session is killed.
(c-type-finder-pos): New variable.
(c-basic-common-init): Initialize c-type-finder-pos and c-type-finder-timer.
(c-new-id-start, c-new-id-end, c-new-id-is-type): New variables.
(c-update-new-id): New function.
(c-post-command): New post command hook function, used for checking moving
away from partially typed identifiers, and making them full identifiers.
(c-before-change): Add code to clear c-found-types on a buffer change at BOB.
(c-after-change): Call c-update-new-id to keep track of partially typed
identifiers.
* doc/misc/cc-mode.texi (Found Types): New @section in the @Chapter Font
Locking.
* lisp/progmodes/cc-vars.el (c-type-finder-time-slot)
(c-type-finder-repeat-time, c-type-finder-chunk-size): New customizable
options.