Mercurial > emacs
comparison lisp/dired-x.el @ 7865:d3e50535e6da
(dired-man): Use internal function from man.el.
(dired-omit-files): Omit `.' and `..' by default, not all files
ending in `.'.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Mon, 13 Jun 1994 19:34:21 +0000 |
parents | eb9d06dba04b |
children | 1dd92ac02141 |
comparison
equal
deleted
inserted
replaced
7864:e520e9f9a8d9 | 7865:d3e50535e6da |
---|---|
1 ;;; dired-x.el --- Sebastian Kremer's Extra DIRED hacked up for GNU Emacs19 | 1 ;;; dired-x.el --- Sebastian Kremer's Extra DIRED hacked up for GNU Emacs19 |
2 | 2 |
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 |
11 | 11 |
12 ;; This file is part of GNU Emacs. | 12 ;; This file is part of GNU Emacs. |
135 "*If non-nil, \"uninteresting\" files are not listed (buffer-local). | 135 "*If non-nil, \"uninteresting\" files are not listed (buffer-local). |
136 Use \\[dired-omit-toggle] to toggle its value. | 136 Use \\[dired-omit-toggle] to toggle its value. |
137 Uninteresting files are those whose filenames match regexp `dired-omit-files', | 137 Uninteresting files are those whose filenames match regexp `dired-omit-files', |
138 plus those ending with extensions in `dired-omit-extensions'.") | 138 plus 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\). |
142 This only has effect when `dired-omit-files-p' is t. | 142 This only has effect when `dired-omit-files-p' is t. See interactive function |
143 See 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 | |
145 files.") | |
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 |
147 can be found (perhaps as subdir) in some existing Dired buffer. | 149 can be found (perhaps as subdir) in some existing Dired buffer. |
148 | 150 |
510 (or (assq 'dired-omit-files-p minor-mode-alist) | 512 (or (assq 'dired-omit-files-p minor-mode-alist) |
511 (setq minor-mode-alist | 513 (setq minor-mode-alist |
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'. |
516 With an arg, and if omitting was off, don't toggle and just mark the | 518 With 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. |
518 With an arg, and if omitting was on, turn it off but don't refresh the buffer." | 520 With an arg, and if omitting was on, turn it off but don't refresh the buffer." |
519 (interactive "P") | 521 (interactive "P") |
520 (if flag | 522 (if flag |
532 (defvar dired-omit-extensions | 534 (defvar dired-omit-extensions |
533 (append completion-ignored-extensions | 535 (append completion-ignored-extensions |
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. |
538 listings. Defaults to the elements of | 540 Defaults 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 | |
544 See interactive function `dired-omit-toggle' \(\\[dired-omit-toggle]\) and | |
545 variables `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. |
544 Does nothing if global variable `dired-omit-files-p' is nil. | 549 Does nothing if global variable `dired-omit-files-p' is nil. |
545 If REGEXP is nil or not specified, uses `dired-omit-files', and also omits | 550 If REGEXP is nil or not specified, uses `dired-omit-files', and also omits |
1270 | 1275 |
1271 ;;; Run man on files. | 1276 ;;; Run man on files. |
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. |
1275 Results displayed based on value of `Man-notify'. See that variable." | 1280 Uses ../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 |
1324 (defun dired-info () | 1289 (defun dired-info () |
1325 "Run info on this file." | 1290 "Run info on this file." |
1579 ;;;; BUG REPORTS | 1544 ;;;; BUG REPORTS |
1580 | 1545 |
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. |
1586 Type \\[dired-x-submit-report] to send a bug report. Available via anonymous | 1551 Type \\[dired-x-submit-report] to send a bug report. Available via anonymous |
1587 ftp in | 1552 ftp in |
1588 | 1553 |
1589 /roebling.poly.edu:/pub/packages/dired-x.tar.gz") | 1554 /roebling.poly.edu:/pub/packages/dired-x.tar.gz") |