aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman1994-06-13 19:34:21 +0000
committerRichard M. Stallman1994-06-13 19:34:21 +0000
commit685ff9f8e6fd8cc43bb4771f8cdb5b8e93668e2d (patch)
tree0c690e5329bc32863c8f6bb7ad30cad1ea561f19
parentc9da80160967cbcb376d9592d073c82377b5d864 (diff)
downloademacs-685ff9f8e6fd8cc43bb4771f8cdb5b8e93668e2d.tar.gz
emacs-685ff9f8e6fd8cc43bb4771f8cdb5b8e93668e2d.zip
(dired-man): Use internal function from man.el.
(dired-omit-files): Omit `.' and `..' by default, not all files ending in `.'.
-rw-r--r--lisp/dired-x.el79
1 files changed, 22 insertions, 57 deletions
diff --git a/lisp/dired-x.el b/lisp/dired-x.el
index c89e109f839..d800bbb9aa8 100644
--- a/lisp/dired-x.el
+++ b/lisp/dired-x.el
@@ -3,8 +3,8 @@
3;; Author: Sebastian Kremer <sk@thp.uni-koeln.de> 3;; Author: Sebastian Kremer <sk@thp.uni-koeln.de>
4;; Lawrence R. Dodd <dodd@roebling.poly.edu> 4;; Lawrence R. Dodd <dodd@roebling.poly.edu>
5;; Maintainer: Lawrence R. Dodd <dodd@roebling.poly.edu> 5;; Maintainer: Lawrence R. Dodd <dodd@roebling.poly.edu>
6;; Version: 2.27 6;; Version: 2.31
7;; Date: 1994/04/05 12:45:30 7;; Date: 1994/06/09 21:31:53
8;; Keywords: dired extensions 8;; Keywords: dired extensions
9 9
10;; Copyright (C) 1993, 1994 Free Software Foundation 10;; Copyright (C) 1993, 1994 Free Software Foundation
@@ -137,10 +137,12 @@ Use \\[dired-omit-toggle] to toggle its value.
137Uninteresting files are those whose filenames match regexp `dired-omit-files', 137Uninteresting files are those whose filenames match regexp `dired-omit-files',
138plus those ending with extensions in `dired-omit-extensions'.") 138plus those ending with extensions in `dired-omit-extensions'.")
139 139
140(defvar dired-omit-files "^#\\|\\.$" 140(defvar dired-omit-files "^#\\|^\\.$\\|^\\.\\.$"
141 "*Filenames matching this regexp will not be displayed (buffer-local). 141 "*Filenames matching this regexp will not be displayed \(buffer-local\).
142This only has effect when `dired-omit-files-p' is t. 142This only has effect when `dired-omit-files-p' is t. See interactive function
143See also `dired-omit-extensions'.") 143`dired-omit-toggle' \(\\[dired-omit-toggle]\) and variable
144`dired-omit-extensions'. The default is to omit `.', `..', and auto-save
145files.")
144 146
145(defvar dired-find-subdir nil ; t is pretty near to DWIM... 147(defvar dired-find-subdir nil ; t is pretty near to DWIM...
146 "*If non-nil, Dired does not make a new buffer for a directory if it 148 "*If non-nil, Dired does not make a new buffer for a directory if it
@@ -512,7 +514,7 @@ Should never be used as marker by the user or other packages.")
512 (append '((dired-omit-files-p " Omit")) minor-mode-alist)))) 514 (append '((dired-omit-files-p " Omit")) minor-mode-alist))))
513 515
514(defun dired-omit-toggle (&optional flag) 516(defun dired-omit-toggle (&optional flag)
515 "Toggle between displaying and omitting files matching `dired-omit-files'. 517 "Toggle omitting files matching `dired-omit-files' and `dired-omit-extensions'.
516With an arg, and if omitting was off, don't toggle and just mark the 518With an arg, and if omitting was off, don't toggle and just mark the
517 files but don't actually omit them. 519 files but don't actually omit them.
518With an arg, and if omitting was on, turn it off but don't refresh the buffer." 520With an arg, and if omitting was on, turn it off but don't refresh the buffer."
@@ -534,10 +536,13 @@ With an arg, and if omitting was on, turn it off but don't refresh the buffer."
534 dired-latex-unclean-extensions 536 dired-latex-unclean-extensions
535 dired-bibtex-unclean-extensions 537 dired-bibtex-unclean-extensions
536 dired-texinfo-unclean-extensions) 538 dired-texinfo-unclean-extensions)
537 "If non-nil, a list of extensions (strings) to omit from Dired 539 "If non-nil, a list of extensions \(strings\) to omit from Dired listings.
538listings. Defaults to the elements of 540Defaults to elements of `completion-ignored-extensions',
539`completion-ignored-extensions', `dired-latex-unclean-extensions', 541`dired-latex-unclean-extensions', `dired-bibtex-unclean-extensions', and
540`dired-bibtex-unclean-extensions' and `dired-texinfo-unclean-extensions'.") 542`dired-texinfo-unclean-extensions'.
543
544See interactive function `dired-omit-toggle' \(\\[dired-omit-toggle]\) and
545variables `dired-omit-files-p' and `dired-omit-files'.")
541 546
542(defun dired-omit-expunge (&optional regexp) 547(defun dired-omit-expunge (&optional regexp)
543 "Erases all unmarked files matching REGEXP. 548 "Erases all unmarked files matching REGEXP.
@@ -1272,52 +1277,12 @@ To display just marked files, type \\[delete-other-windows] first."
1272 1277
1273(defun dired-man () 1278(defun dired-man ()
1274 "Run man on this file. Display old buffer if buffer name matches filename. 1279 "Run man on this file. Display old buffer if buffer name matches filename.
1275Results displayed based on value of `Man-notify'. See that variable." 1280Uses ../lisp/man.el of \\[manual-entry] fame."
1276 (interactive) 1281 (interactive)
1277 (let* ((file (dired-get-filename)) 1282 (require 'man)
1278 (string (format "*man %s*" (file-name-nondirectory file))) 1283 (let ((file (dired-get-filename))
1279 (Man-buffer (get-buffer string)) 1284 (manual-program "nroff -man -h"))
1280 (msg "Expanding manual page...cleaning...done")) 1285 (Man-getpage-in-background file)))
1281
1282 ;; If Man-buffer already exists and has not been modified, display it.
1283 ;; Otherwise, create a fresh one.
1284 (if (and Man-buffer
1285 (save-excursion
1286 (set-buffer Man-buffer)
1287 (not (buffer-modified-p))
1288 buffer-read-only))
1289
1290 (setq msg "Displaying pre-existing manual page.")
1291
1292 ;; Create Man-buffer.
1293 (save-excursion
1294
1295 ;; Prepare buffer.
1296 (setq Man-buffer (get-buffer-create string))
1297 (set-buffer Man-buffer)
1298 (setq buffer-read-only nil)
1299 (erase-buffer)
1300
1301 ;; Expand and clean man page.
1302 (message "Expanding manual page...")
1303 (call-process shell-file-name nil t nil "-c"
1304 (concat " nroff -man -h " file))
1305 (message "Expanding manual page...cleaning...")
1306 (call-process-region (point-min) (point-max)
1307 shell-file-name t t nil "-c" " col -b")
1308 (goto-char (point-min))
1309
1310 ;; Reset buffer.
1311 (setq buffer-read-only t)
1312 (buffer-disable-undo (current-buffer))
1313 (set-buffer-modified-p nil)))
1314
1315 ;; Display results. Use display function of ../lisp/man.el whose behavior
1316 ;; is determined by user-defined variable Man-notify.
1317 (require 'man)
1318 (Man-notify-when-ready Man-buffer)
1319 ;; Overrides any message issued by above function.
1320 (message msg)))
1321 1286
1322;;; Run Info on files. 1287;;; Run Info on files.
1323 1288
@@ -1581,7 +1546,7 @@ test if that file exists. Use minibuffer after snatching the filename."
1581;;; This section is provided for reports. It uses Barry A. Warsaw's 1546;;; This section is provided for reports. It uses Barry A. Warsaw's
1582;;; reporter.el which is bundled with GNU Emacs v19. 1547;;; reporter.el which is bundled with GNU Emacs v19.
1583 1548
1584(defconst dired-x-version "2.27" 1549(defconst dired-x-version "2.31"
1585 "Revision number of dired-x.el -- dired extra for GNU Emacs v19. 1550 "Revision number of dired-x.el -- dired extra for GNU Emacs v19.
1586Type \\[dired-x-submit-report] to send a bug report. Available via anonymous 1551Type \\[dired-x-submit-report] to send a bug report. Available via anonymous
1587ftp in 1552ftp in