aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lisp/ChangeLog10
-rw-r--r--lisp/dired-x.el168
2 files changed, 57 insertions, 121 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index d60d81dc6d9..ced87bb69a1 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,13 @@
12011-02-14 Glenn Morris <rgm@gnu.org>
2
3 * dired-x.el: Don't require man when compiling.
4 (dired-omit-extensions, dired-local-variables-file)
5 (dired-x-hands-off-my-keys): Make them defcustoms.
6 (Man-support-local-filenames, Man-getpage-in-background): Declare.
7 (vm-visit-folder): Declare rather than defining.
8 (dired-x-help-address, dired-x-variable-list): Remove.
9 (dired-x-submit-report): Make it an obsolete alias.
10
12011-02-14 Juanma Barranquero <lekktu@gmail.com> 112011-02-14 Juanma Barranquero <lekktu@gmail.com>
2 12
3 * makefile.w32-in (TRAMP_SRC): Remove tramp-imap.el. 13 * makefile.w32-in (TRAMP_SRC): Remove tramp-imap.el.
diff --git a/lisp/dired-x.el b/lisp/dired-x.el
index e0caae059b4..8011b4d32a4 100644
--- a/lisp/dired-x.el
+++ b/lisp/dired-x.el
@@ -25,91 +25,47 @@
25 25
26;;; Commentary: 26;;; Commentary:
27 27
28;; This is Sebastian Kremer's excellent dired-x.el (Dired Extra), version 28;; This is based on Sebastian Kremer's excellent dired-x.el (Dired Extra),
29;; 1.191, hacked up for GNU Emacs. Redundant or conflicting material has 29;; version 1.191, adapted for GNU Emacs. See the `dired-x' info pages.
30;; been removed or renamed in order to work properly with dired of GNU
31;; Emacs. All suggestions or comments are most welcomed.
32 30
33;; 31;; USAGE: In your ~/.emacs,
34;; Please, PLEASE, *PLEASE* see the info pages.
35;;
36
37;; BUGS: Type M-x dired-x-submit-report and a report will be generated.
38
39;; INSTALLATION: In your ~/.emacs,
40;; 32;;
41;; (add-hook 'dired-load-hook 33;; (add-hook 'dired-load-hook
42;; (function (lambda () 34;; (lambda ()
43;; (load "dired-x") 35;; (require 'dired-x)
44;; ;; Set global variables here. For example: 36;; ;; Set global variables here. For example:
45;; ;; (setq dired-guess-shell-gnutar "gtar") 37;; ;; (setq dired-guess-shell-gnutar "gtar")
46;; ))) 38;; ))
47;; (add-hook 'dired-mode-hook 39;; (add-hook 'dired-mode-hook
48;; (function (lambda () 40;; (lambda ()
49;; ;; Set buffer-local variables here. For example: 41;; ;; Set buffer-local variables here. For example:
50;; ;; (dired-omit-mode 1) 42;; ;; (dired-omit-mode 1)
51;; ))) 43;; ))
52;; 44;;
53;; At load time dired-x.el will install itself, redefine some functions, and 45;; At load time dired-x.el will install itself, redefine some functions, and
54;; bind some dired keys. *Please* see the info pages for more details. 46;; bind some dired keys.
55 47
56;; *Please* see the info pages for more details. 48;; User customization: M-x customize-group RET dired-x RET.
57 49
58;; User defined variables: 50;; When loaded this code redefines the following functions of GNU Emacs:
59;; 51;; From dired.el: dired-clean-up-after-deletion, dired-find-buffer-nocreate,
60;; dired-bind-vm 52;; and dired-initial-position.
61;; dired-vm-read-only-folders 53;; From dired-aux.el: dired-add-entry and dired-read-shell-command.
62;; dired-bind-jump
63;; dired-bind-info
64;; dired-bind-man
65;; dired-x-hands-off-my-keys
66;; dired-find-subdir
67;; dired-enable-local-variables
68;; dired-local-variables-file
69;; dired-guess-shell-gnutar
70;; dired-guess-shell-gzip-quiet
71;; dired-guess-shell-znew-switches
72;; dired-guess-shell-alist-user
73;; dired-clean-up-buffers-too
74;; dired-omit-mode
75;; dired-omit-files
76;; dired-omit-extensions
77;; dired-omit-size-limit
78;;
79;; To find out more about these variables, load this file, put your cursor at
80;; the end of any of the variable names, and hit C-h v [RET]. *Please* see
81;; the info pages for more details.
82 54
83;; When loaded this code redefines the following functions of GNU Emacs 55;; *Please* see the `dired-x' info pages for more details.
84;;
85;; Function Found in this file of GNU Emacs
86;; -------- -------------------------------
87;; dired-clean-up-after-deletion ../lisp/dired.el
88;; dired-find-buffer-nocreate ../lisp/dired.el
89;; dired-initial-position ../lisp/dired.el
90;;
91;; dired-add-entry ../lisp/dired-aux.el
92;; dired-read-shell-command ../lisp/dired-aux.el
93 56
94 57
95;;; Code: 58;;; Code:
96 59
97;; LOAD. 60;; LOAD.
98 61
99;; This is a no-op if dired-x is being loaded via `dired-load-hook'. It is 62;; This is a no-op if dired-x is being loaded via `dired-load-hook',
100;; here in case the user has autoloaded dired-x via the dired-jump key binding 63;; but maybe not if a dired-x function is being autoloaded.
101;; (instead of autoloading to dired as is suggested in the info-pages).
102
103(require 'dired) 64(require 'dired)
104 65
105;; We will redefine some functions and also need some macros so we need to 66;; We will redefine some functions and also need some macros.
106;; load dired stuff of GNU Emacs.
107
108(require 'dired-aux) 67(require 'dired-aux)
109 68
110(defvar vm-folder-directory)
111(eval-when-compile (require 'man))
112
113;;; User-defined variables. 69;;; User-defined variables.
114 70
115(defgroup dired-x nil 71(defgroup dired-x nil
@@ -340,10 +296,9 @@ to nil: a pipe using `zcat' or `gunzip -c' will be used."
340 'dashes))) 296 'dashes)))
341 297
342;;; GLOBAL BINDING. 298;;; GLOBAL BINDING.
343(if dired-bind-jump 299(when dired-bind-jump
344 (progn 300 (define-key global-map "\C-x\C-j" 'dired-jump)
345 (define-key global-map "\C-x\C-j" 'dired-jump) 301 (define-key global-map "\C-x4\C-j" 'dired-jump-other-window))
346 (define-key global-map "\C-x4\C-j" 'dired-jump-other-window)))
347 302
348 303
349;; Install into appropriate hooks. 304;; Install into appropriate hooks.
@@ -589,7 +544,7 @@ Should never be used as marker by the user or other packages.")
589 (let ((dired-omit-mode nil)) (revert-buffer)) ;; Show omitted files 544 (let ((dired-omit-mode nil)) (revert-buffer)) ;; Show omitted files
590 (dired-mark-unmarked-files (dired-omit-regexp) nil nil dired-omit-localp)) 545 (dired-mark-unmarked-files (dired-omit-regexp) nil nil dired-omit-localp))
591 546
592(defvar dired-omit-extensions 547(defcustom dired-omit-extensions
593 (append completion-ignored-extensions 548 (append completion-ignored-extensions
594 dired-latex-unclean-extensions 549 dired-latex-unclean-extensions
595 dired-bibtex-unclean-extensions 550 dired-bibtex-unclean-extensions
@@ -600,7 +555,9 @@ Defaults to elements of `completion-ignored-extensions',
600`dired-texinfo-unclean-extensions'. 555`dired-texinfo-unclean-extensions'.
601 556
602See interactive function `dired-omit-mode' \(\\[dired-omit-mode]\) and 557See interactive function `dired-omit-mode' \(\\[dired-omit-mode]\) and
603variables `dired-omit-mode' and `dired-omit-files'.") 558variables `dired-omit-mode' and `dired-omit-files'."
559 :type '(repeat string)
560 :group 'dired-x)
604 561
605(defun dired-omit-expunge (&optional regexp) 562(defun dired-omit-expunge (&optional regexp)
606 "Erases all unmarked files matching REGEXP. 563 "Erases all unmarked files matching REGEXP.
@@ -896,12 +853,15 @@ Knows about the special cases in variable `default-directory-alist'."
896;;; `dired-enable-local-variables' and run `hack-local-variables' on the 853;;; `dired-enable-local-variables' and run `hack-local-variables' on the
897;;; Dired Buffer. 854;;; Dired Buffer.
898 855
899(defvar dired-local-variables-file (convert-standard-filename ".dired") 856;; FIXME do standard dir-locals obsolete this?
857(defcustom dired-local-variables-file (convert-standard-filename ".dired")
900 "Filename, as string, containing local dired buffer variables to be hacked. 858 "Filename, as string, containing local dired buffer variables to be hacked.
901If this file found in current directory, then it will be inserted into dired 859If this file found in current directory, then it will be inserted into dired
902buffer and `hack-local-variables' will be run. See Info node 860buffer and `hack-local-variables' will be run. See Info node
903`(emacs)File Variables' for more information on local variables. 861`(emacs)File Variables' for more information on local variables.
904See also `dired-enable-local-variables'.") 862See also `dired-enable-local-variables'."
863 :type 'file
864 :group 'dired)
905 865
906(defun dired-hack-local-variables () 866(defun dired-hack-local-variables ()
907 "Evaluate local variables in `dired-local-variables-file' for dired buffer." 867 "Evaluate local variables in `dired-local-variables-file' for dired buffer."
@@ -980,6 +940,8 @@ dired."
980;; NOTE: Use `gunzip -c' instead of `zcat' on `.gz' files. Some do not 940;; NOTE: Use `gunzip -c' instead of `zcat' on `.gz' files. Some do not
981;; install GNU zip's version of zcat. 941;; install GNU zip's version of zcat.
982 942
943(declare-function Man-support-local-filenames "man" ())
944
983(defvar dired-guess-shell-alist-default 945(defvar dired-guess-shell-alist-default
984 (list 946 (list
985 (list "\\.tar$" 947 (list "\\.tar$"
@@ -1429,6 +1391,8 @@ NOSELECT the files are merely found but not selected."
1429 1391
1430;; Run man on files. 1392;; Run man on files.
1431 1393
1394(declare-function Man-getpage-in-background "man" (topic))
1395
1432(defun dired-man () 1396(defun dired-man ()
1433 "Run man on this file. Display old buffer if buffer name matches filename. 1397 "Run man on this file. Display old buffer if buffer name matches filename.
1434Uses `man.el' of \\[manual-entry] fame." 1398Uses `man.el' of \\[manual-entry] fame."
@@ -1449,11 +1413,8 @@ Uses `man.el' of \\[manual-entry] fame."
1449 1413
1450;; Run mail on mail folders. 1414;; Run mail on mail folders.
1451 1415
1452;; Avoid compiler warning. 1416(declare-function vm-visit-folder "ext:vm" (folder &optional read-only))
1453(eval-when-compile 1417(defvar vm-folder-directory)
1454 (when (not (fboundp 'vm-visit-folder))
1455 (defun vm-visit-folder (file &optional arg)
1456 nil)))
1457 1418
1458(defun dired-vm (&optional read-only) 1419(defun dired-vm (&optional read-only)
1459 "Run VM on this file. 1420 "Run VM on this file.
@@ -1659,11 +1620,17 @@ to mark all zero length files."
1659 1620
1660;;; FIND FILE AT POINT. 1621;;; FIND FILE AT POINT.
1661 1622
1662(defvar dired-x-hands-off-my-keys t 1623(defcustom dired-x-hands-off-my-keys t
1663 "*Non-nil means don't bind `dired-x-find-file' over `find-file' on keyboard. 1624 "Non-nil means don't bind `dired-x-find-file' over `find-file' on keyboard.
1664Similarly for `dired-x-find-file-other-window' over `find-file-other-window'. 1625Similarly for `dired-x-find-file-other-window' over `find-file-other-window'.
1665If you change this variable after `dired-x.el' is loaded then do 1626If you change this variable without using \\[customize] after `dired-x.el'
1666\\[dired-x-bind-find-file].") 1627is loaded then call \\[dired-x-bind-find-file]."
1628 :type 'boolean
1629 :initialize 'custom-initialize-default
1630 :set (lambda (sym val)
1631 (set sym val)
1632 (dired-x-bind-find-file))
1633 :group 'dired-x)
1667 1634
1668;; Bind `dired-x-find-file{-other-window}' over wherever 1635;; Bind `dired-x-find-file{-other-window}' over wherever
1669;; `find-file{-other-window}' is bound? 1636;; `find-file{-other-window}' is bound?
@@ -1777,48 +1744,7 @@ If `current-prefix-arg' is non-nil, uses name at point as guess."
1777 1744
1778;;; BUG REPORTS 1745;;; BUG REPORTS
1779 1746
1780;; Fixme: get rid of this later. 1747(define-obsolete-function-alias 'dired-x-submit-report 'report-emacs-bug "24.1")
1781
1782;; This section is provided for reports. It uses Barry A. Warsaw's
1783;; reporter.el which is bundled with GNU Emacs v19.
1784
1785(defconst dired-x-help-address "bug-gnu-emacs@gnu.org"
1786 "Address(es) accepting submission of reports on dired-x.el.")
1787
1788(defconst dired-x-variable-list
1789 (list
1790 'dired-bind-vm
1791 'dired-vm-read-only-folders
1792 'dired-bind-jump
1793 'dired-bind-info
1794 'dired-bind-man
1795 'dired-find-subdir
1796 'dired-enable-local-variables
1797 'dired-local-variables-file
1798 'dired-guess-shell-gnutar
1799 'dired-guess-shell-gzip-quiet
1800 'dired-guess-shell-znew-switches
1801 'dired-guess-shell-alist-user
1802 'dired-clean-up-buffers-too
1803 'dired-omit-mode
1804 'dired-omit-files
1805 'dired-omit-extensions
1806 )
1807 "List of variables to be appended to reports sent by `dired-x-submit-report'.")
1808
1809(defun dired-x-submit-report ()
1810 "Submit via `reporter.el' a bug report on program.
1811Send report on `dired-x-file' version `dired-x-version', to
1812`dired-x-maintainer' at address `dired-x-help-address' listing
1813variables `dired-x-variable-list' in the message."
1814 (interactive)
1815
1816 (reporter-submit-bug-report
1817 dired-x-help-address ; address
1818 "dired-x" ; pkgname
1819 dired-x-variable-list ; varlist
1820 nil nil ; pre-/post-hooks
1821 ""))
1822 1748
1823 1749
1824;; As Barry Warsaw would say: "This might be useful..." 1750;; As Barry Warsaw would say: "This might be useful..."