summaryrefslogtreecommitdiff
path: root/lisp/dired.el
diff options
context:
space:
mode:
authorStefan Kangas <stefan@marxist.se>2022-07-02 15:41:43 +0200
committerStefan Kangas <stefan@marxist.se>2022-07-02 16:43:29 +0200
commit0bb6b2dd1eee72788bed6d16bc6e4502e52b4e1c (patch)
tree58bae19c24f2b677a69a6d9d9b732fd3fe50a172 /lisp/dired.el
parent25d80e4f8115bc297ebe99bc698e8257bb0d29b3 (diff)
downloademacs-0bb6b2dd1eee72788bed6d16bc6e4502e52b4e1c.tar.gz
Move dired-info and dired-man from dired-x to dired
* lisp/dired-x.el (dired-bind-man, dired-bind-info): Change into defvars and make obsolete. (dired-extra-startup): Doc fix. (dired-info, dired-man): Move from here... * lisp/dired.el (dired-do-info, dired-do-man): ...to here and rename. (Bug#21981) * lisp/dired.el (dired-mode-map): Bind 'I' and 'N' to 'dired-do-info' and 'dired-do-man'. * doc/misc/dired-x.texi (Miscellaneous Commands): Remove documentation of 'dired-info' and 'dired-man'. * doc/emacs/dired.texi (Dired Enter): Document 'dired-do-info' and 'dired-do-man'. * etc/NEWS: Announce the above changes.
Diffstat (limited to 'lisp/dired.el')
-rw-r--r--lisp/dired.el27
1 files changed, 27 insertions, 0 deletions
diff --git a/lisp/dired.el b/lisp/dired.el
index 55e150e9e04..dc7400d46e0 100644
--- a/lisp/dired.el
+++ b/lisp/dired.el
@@ -2079,8 +2079,10 @@ Do so according to the former subdir alist OLD-SUBDIR-ALIST."
"D" #'dired-do-delete
"G" #'dired-do-chgrp
"H" #'dired-do-hardlink
+ "I" #'dired-do-info
"L" #'dired-do-load
"M" #'dired-do-chmod
+ "N" #'dired-do-man
"O" #'dired-do-chown
"P" #'dired-do-print
"Q" #'dired-do-find-regexp-and-replace
@@ -4795,6 +4797,31 @@ Interactively with prefix argument, read FILE-NAME."
(read-file-name "Jump to Dired file: "))))
(dired-jump t file-name))
+
+;;; Miscellaneous commands
+
+(declare-function Man-getpage-in-background "man" (topic))
+(declare-function dired-guess-shell-command "dired-x" (prompt files))
+(defvar manual-program) ; from man.el
+
+(defun dired-do-man ()
+ "Run `man' on this file."
+ (interactive)
+ (require 'man)
+ ;; FIXME: Move `dired-guess-shell-command' to dired.el to remove the
+ ;; need for requiring `dired-x'.
+ (require 'dired-x)
+ (let* ((file (dired-get-filename))
+ (manual-program (string-replace "*" "%s"
+ (dired-guess-shell-command
+ "Man command: " (list file)))))
+ (Man-getpage-in-background file)))
+
+(defun dired-do-info ()
+ "Run `info' on this file."
+ (interactive)
+ (info (dired-get-filename)))
+
(provide 'dired)
(run-hooks 'dired-load-hook) ; for your customizations