[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

`dired-man-locally' for XEmacs.



 If you put the following in your "~/.emacs" (or your
 "~/.xemacs/init.el if you prefer) you'll be able to put the cursor
 over a man page filename in `dired', and push `l' to display it in
 the emacs manual viewer.  This works for XEmacs.  Anyone know a way
 to make it work with GNU Emacs?  If so, please post it.

 I have two versions of `man.el' installed; one is the default,
 supplied with XEmacs, and the other is a modified version of the one
 that ships with GNU Emacs.  That is why I test the number of args
 that `manual-entry' takes.

 This is really helpful while you are writing a man page.

(defun dired-man-locally ()
  (interactive)
  (if (= 1 (function-max-args #'manual-entry))
      (manual-entry (concat (dired-get-filename) " -l"))
    (manual-entry (dired-get-filename) "-l")))

(add-hook 'dired-setup-keys-hook
	  #'(lambda ()
	      (define-key dired-mode-map [(?l)] #'dired-man-locally)))

-- 
Those who do not study Lisp are doomed to reimplement it - Poorly.
A few months in the laboratory often saves several hours at the library.

mailto:karlheg@debian.org (Karl M. Hegbloom)



Reply to: