Improve image-mode-as-hex docstring

* lisp/image-mode.el: Fix typos.
(image-mode-as-hex): Doc fix; say that it uses 'hexl-mode' and reflow.
This commit is contained in:
Stefan Kangas 2022-08-18 20:13:34 +02:00
parent ef1e68f11d
commit e64d811b51

View file

@ -742,11 +742,12 @@ displays an image file as text."
(image-toggle-display-text)))) (image-toggle-display-text))))
(defun image-mode-as-hex () (defun image-mode-as-hex ()
"Set a non-image mode as major mode in combination with image minor mode. "Set `hexl-mode' as major mode in combination with image minor mode.
A non-mage major mode found from `auto-mode-alist' or fundamental mode A non-mage major mode found from `auto-mode-alist' or fundamental mode
displays an image file as hex. `image-minor-mode' provides the key displays an image file as hex. `image-minor-mode' provides the key
\\<image-mode-map>\\[image-toggle-hex-display] to switch back to `image-mode' \\<image-mode-map>\\[image-toggle-hex-display] to switch back to `image-mode' \
to display an image file as the actual image. to display an image file as
the actual image.
You can use `image-mode-as-hex' in `auto-mode-alist' when you want to You can use `image-mode-as-hex' in `auto-mode-alist' when you want to
display an image file as hex initially. display an image file as hex initially.
@ -1161,14 +1162,14 @@ tar mode buffers."
(when (buffer-live-p archive-superior-buffer) (when (buffer-live-p archive-superior-buffer)
(push (cons 'archive archive-superior-buffer) buffers))) (push (cons 'archive archive-superior-buffer) buffers)))
(t (t
;; Find a dired buffer. ;; Find a Dired buffer.
(dolist (buffer (buffer-list)) (dolist (buffer (buffer-list))
(with-current-buffer buffer (with-current-buffer buffer
(when (and (derived-mode-p 'dired-mode) (when (and (derived-mode-p 'dired-mode)
(equal (file-truename dir) (equal (file-truename dir)
(file-truename default-directory))) (file-truename default-directory)))
(push (cons 'dired (current-buffer)) buffers)))) (push (cons 'dired (current-buffer)) buffers))))
;; If we can't find any buffers to navigate in, we open a dired ;; If we can't find any buffers to navigate in, we open a Dired
;; buffer. ;; buffer.
(unless buffers (unless buffers
(push (cons 'dired (find-file-noselect dir)) buffers) (push (cons 'dired (find-file-noselect dir)) buffers)
@ -1180,14 +1181,14 @@ tar mode buffers."
(defun image-mode--next-file (file n) (defun image-mode--next-file (file n)
"Go to the next image file in the parent buffer of FILE. "Go to the next image file in the parent buffer of FILE.
This is typically a dired buffer, but may also be a tar/archive buffer. This is typically a Dired buffer, but may also be a tar/archive buffer.
Return the next image file from that buffer. Return the next image file from that buffer.
If N is negative, go to the previous file." If N is negative, go to the previous file."
(let ((regexp (image-file-name-regexp)) (let ((regexp (image-file-name-regexp))
(buffers (image-mode--directory-buffers file)) (buffers (image-mode--directory-buffers file))
next) next)
(dolist (buffer buffers) (dolist (buffer buffers)
;; We do this traversal for all the dired buffers open on this ;; We do this traversal for all the Dired buffers open on this
;; directory. There probably is just one, but we want to move ;; directory. There probably is just one, but we want to move
;; point in all of them. ;; point in all of them.
(save-window-excursion (save-window-excursion
@ -1236,8 +1237,8 @@ replacing the current Image mode buffer."
(message "Copied %s" buffer-file-name)) (message "Copied %s" buffer-file-name))
(defun image-mode-mark-file () (defun image-mode-mark-file ()
"Mark the current file in the appropriate dired buffer(s). "Mark the current file in the appropriate Dired buffer(s).
Any dired buffer that's opened to the current file's directory Any Dired buffer that's opened to the current file's directory
will have the line where the image appears (if any) marked. will have the line where the image appears (if any) marked.
If no such buffer exists, it will be opened." If no such buffer exists, it will be opened."
@ -1247,8 +1248,8 @@ If no such buffer exists, it will be opened."
(image-mode--mark-file buffer-file-name #'dired-mark "marked")) (image-mode--mark-file buffer-file-name #'dired-mark "marked"))
(defun image-mode-unmark-file () (defun image-mode-unmark-file ()
"Unmark the current file in the appropriate dired buffer(s). "Unmark the current file in the appropriate Dired buffer(s).
Any dired buffer that's opened to the current file's directory Any Dired buffer that's opened to the current file's directory
will remove the mark from the line where the image appears (if will remove the mark from the line where the image appears (if
any). any).