When viewing a large image full size and scrolling, for instance, to
the lower right corner, then selecting a much smaller image in the
thumbnail buffer, the window stays scrolled so the new image is out of
the window. One must scroll back to the "origin" to view the new
displayed image, or just kill the image-dired-display-image buffer and
try again. This fixes the issue.
* lisp/image-dired.el (image-dired-display-window-width):
(image-dired-display-window-height): Operate on a window as argument.
(image-dired-display-image): Bind (image-dired-display-window) and use
it. Set window vscroll and hscroll to zero when refreshing the
buffer's contents.
* lisp/image-dired.el (image-dired-file-name-at-point): New function.
(image-dired-thumbnail-mode, image-dired-display-image-mode): Disable
undo list. Add image-dired-file-name-at-point to
file-name-at-point-functions to facilitate find-file and friends.
(image-dired-thumbnail-display-external):
(image-dired-dired-display-external): Use start-process instead, to
avoid needlessly blocking and using a shell.
* lisp/image-dired.el: Fix commentary to refer to correct Emacs manual
node.
(image-dired--with-db-file): Add declare forms.
(image-dired-hidden-p): Rewrite with cl-loop. It's not necessary to
run through the whole list.
This breaks window layout, especially when quitting a
image-dired-display-image-mode buffer.
* lisp/image-dired.el (image-dired-thumbnail-mode-map):
(image-dired-display-image-mode-map): Replace in keymap and menu items
bindings to image-dired-kill-buffer-and-window with quit-window.
(image-dired-kill-buffer-and-window): Remove.
* lisp/image-dired.el (image-dired-thumbnail-mode): Fix docstring to
remove mention of nonexistent image-dired-dired and to refer to the
new minor mode.
(image-dired-minor-mode-map): New keymap assimilated from
image-dired-setup-dired-keybindings. In the future, the keymap parent
should be removed, and perhaps also the duplicate bindings that
already exist in dired-mode-map.
(image-dired-setup-dired-keybindings): Remove. Replace with an
obsolete function alias.
(image-dired-minor-mode): New minor mode, assuming the role of
image-dired-setup-dired-keybindings.
* lisp/image-dired.el: Remove TODO comment. This appears to have been
implemented in 5d7433a "image-dired: Signal an error before calling a
missing executable".
(image-dired-cmd-create-standard-thumbnail-command): Use %p specifier.
Add :version.
(image-dired-display-thumbs, image-dired-create-thumbs): Use dolist and
when. Remove superfluous call to image-dired-thumb-name. Move single nil
binding and setq into dolist form.
A function to populate these maps is not necessary, just define the maps
once and for all.
* lisp/image-dired.el (image-dired-show-all-from-dir): Make prompt
clearer and in the spirit of dired's.
(image-dired-define-display-image-mode-keymap):
(image-dired-define-thumbnail-mode-keymap): Remove.
(image-dired-thumbnail-mode-map):
(image-dired-thumbnail-mode-line-up-map):
(image-dired-thumbnail-mode-tag-map): Assimilate all define-key and mode
menu code from the aforementioned removed functions. Reorder so that
the definitions are inherited properly.
(image-dired-display-current-image-sized): Fix erroneous message.
(image-dired-thumbnail-mode):
(image-dired-display-image-mode): Remove defunct call.
Both instances here are just emulating cl-find-if.
* lisp/image-dired.el: Use cl-lib at compile time.
(image-dired-dired-toggle-marked-thumbs): Don't need let* at the top.
Replace the cl-foo instances with equivalent cl-loops.
* lisp/image-dired.el (image-dired-display-thumbs): Display the buffer
before calling image-dired-line-up and friends, which in turn calculate
the window width. Otherwise, the thumbnail layout will be wrong in
a side-by-side split.
Reverts commit ca473907
Add a defun to check if an executable exists, and call it
on each function using an external program: when the executable
is not available signal an error.
See discussion on:
https://lists.gnu.org/archive/html/emacs-devel/2016-09/msg00135.html
* lisp/image-dired.el (image-dired--check-executable-exists): New defun.
Throw and error when the executable arg is missing.
(image-dired-display-image, image-dired-rotate-thumbnail)
(image-dired-rotate-original, image-dired-set-exif-data)
(image-dired-get-exif-data):
Use it.
See discussion on:
https://lists.gnu.org/archive/html/emacs-devel/2016-08/msg00552.html
* lisp/image-dired.el (image-dired-cmd-rotate-original-program)
(image-dired-cmd-create-thumbnail-program)
(image-dired-cmd-create-temp-image-program)
(image-dired-cmd-rotate-thumbnail-program)
(image-dired-cmd-write-exif-data-program)
(image-dired-cmd-read-exif-data-program):
Use executable-find to set the defaut value of this option.
(image-dired-cmd-rotate-original-program): Idem.
Search for program 'convert' if 'jpegtran' is not available.
(image-dired-cmd-rotate-original-options):
Set the default value consistent with the executable in
image-dired-cmd-rotate-original-program.
(image-dired-create-thumb, image-dired-display-image)
(image-dired-rotate-thumbnail, image-dired-rotate-original)
(image-dired-set-exif-data, image-dired-get-exif-data):
Throw and error when the executable used in the function is missing.
(image-dired-next-line, image-dired-previous-line):
Use 'forward-line'.
Fix Bug#24317
* lisp/image.el (image-type-from-file-name): Bind case-fold-search
to a non-nil value to force a case insensitive match.
* lisp/image-dired.el (image-dired-rotate-original):
Use image-type (Bug#24317).
(image-dired-get-exif-file-name): Idem.
Set 'no-exif-data-found' and 'data' in same setq call.
Use file-attribute-modification-time.
Problem reported by Artur Malabarba in:
http://lists.gnu.org/archive/html/emacs-devel/2015-11/msg01513.html
Most of these fixes are to documentation; many involve fixing
longstanding quoting glitches that are independent of the
recent substitute-command-keys changes. The changes to code are:
* lisp/cedet/mode-local.el (mode-local-augment-function-help)
(describe-mode-local-overload):
Substitute docstrings before displaying them.
* lisp/emacs-lisp/cl-macs.el (cl--transform-lambda):
Quote the generated docstring for later substitution.
* lisp/image-dired.el (image-dired-track-original-file):
Use with-current-buffer.
(image-dired-track-thumbnail): Use with-current-buffer.
Avoid changing point of wrong window.
* lisp/autoinsert.el, lisp/cus-dep.el, lisp/doc-view.el, lisp/image-dired.el,
* lisp/woman.el, lisp/eshell/esh-cmd.el, lisp/progmodes/ada-xref.el,
* lisp/progmodes/cc-defs.el, lisp/progmodes/cperl-mode.el,
* lisp/progmodes/flymake.el, lisp/progmodes/gud.el, lisp/progmodes/idlwave.el,
* lisp/textmodes/ispell.el, lisp/textmodes/reftex-ref.el,
* lisp/textmodes/tex-mode.el: Use it.
Did not touch cedet and org because they are maintained elsewhere.
(image-dired--with-db-file): New macro.
(image-dired-write-tags, image-dired-remove-tag)
(image-dired-create-gallery-lists, image-dired-write-comments)
(image-dired-get-comment, image-dired-mark-tagged-files)
(image-dired-list-tags, image-dired-gallery-generate): Use it.
(image-dired-gallery-generate): Use insert-file-contents.
Fixes: debbugs:7895
`image-dired-dired-insert-marked-thumbs' to
`image-dired-dired-toggle-marked-thumbs'.
* image-dired.el: Require cl when compiling.
(image-dired-dired-toggle-marked-thumbs): Rename from
`image-dired-dired-insert-marked-thumbs'. Add ARG. Doc fix.
Use interactive spec "P". Set LOCALP arg of `dired-get-filename'
to 'no-dir. Skip files whose names don't match
`image-file-name-regexp'. When file has a thumbnail overlay,
delete it. (Bug#5270)