aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lisp/ChangeLog15
-rw-r--r--lisp/rfn-eshadow.el66
2 files changed, 57 insertions, 24 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index d29abdfeb99..5788ca2c601 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,18 @@
12002-08-25 Miles Bader <miles@gnu.org>
2
3 * rfn-eshadow.el (file-name-shadow-properties-custom-type):
4 Renamed from `read-file-name-electric-shadow-properties-custom-type'.
5 Change name of face.
6 (file-name-shadow-properties): Renamed from
7 `read-file-name-electric-shadow-properties'.
8 (file-name-shadow-tty-properties): Renamed from
9 `read-file-name-electric-shadow-tty-properties'.
10 (file-name-shadow): Renamed from `read-file-name-electric-shadow'.
11 (rfn-eshadow-setup-minibuffer): Update references to renamed variables.
12 (file-name-shadow-mode): Renamed from
13 `read-file-name-electric-shadow-mode'. Update references to
14 renamed variables.
15
12002-08-24 Sam Steingold <sds@gnu.org> 162002-08-24 Sam Steingold <sds@gnu.org>
2 17
3 * subr.el (eval-after-load): Do not call 18 * subr.el (eval-after-load): Do not call
diff --git a/lisp/rfn-eshadow.el b/lisp/rfn-eshadow.el
index cf4d1ea042d..99519295133 100644
--- a/lisp/rfn-eshadow.el
+++ b/lisp/rfn-eshadow.el
@@ -3,7 +3,7 @@
3;; Copyright (C) 2000, 2001, 2002 Free Software Foundation, Inc. 3;; Copyright (C) 2000, 2001, 2002 Free Software Foundation, Inc.
4;; 4;;
5;; Author: Miles Bader <miles@gnu.org> 5;; Author: Miles Bader <miles@gnu.org>
6;; Keywords: convenience 6;; Keywords: convenience minibuffer
7 7
8;; This file is part of GNU Emacs. 8;; This file is part of GNU Emacs.
9 9
@@ -24,16 +24,16 @@
24 24
25;;; Commentary: 25;;; Commentary:
26;; 26;;
27;; Defines the mode `read-file-name-electric-shadow-mode'. 27;; Defines the mode `file-name-shadow-mode'.
28;; 28;;
29;; The `read-file-name' function passes its result through 29;; The `read-file-name' function passes its result through
30;; `substitute-in-file-name', so any part of the string preceding 30;; `substitute-in-file-name', so any part of the string preceding
31;; multiple slashes (or a drive indicator on MS-DOS/MS-Windows) is 31;; multiple slashes (or a drive indicator on MS-DOS/MS-Windows) is
32;; ignored. 32;; ignored.
33;; 33;;
34;; If `read-file-name-electric-shadow-mode' is active, any part of the 34;; If `file-name-shadow-mode' is active, any part of the
35;; minibuffer text that would be ignored because of this is given the 35;; minibuffer text that would be ignored because of this is given the
36;; properties in `read-file-name-electric-shadow-properties', which may 36;; properties in `file-name-shadow-properties', which may
37;; be used to make the ignored text invisible, dim, etc. 37;; be used to make the ignored text invisible, dim, etc.
38;; 38;;
39 39
@@ -42,7 +42,7 @@
42 42
43;;; Customization 43;;; Customization
44 44
45(defconst read-file-name-electric-shadow-properties-custom-type 45(defconst file-name-shadow-properties-custom-type
46 '(list 46 '(list
47 (checklist :inline t 47 (checklist :inline t
48 (const :tag "Invisible" 48 (const :tag "Invisible"
@@ -55,7 +55,7 @@
55 :tag "Face" 55 :tag "Face"
56 :doc "Display shadowed part of filename using a different face" 56 :doc "Display shadowed part of filename using a different face"
57 (const :format "" face) 57 (const :format "" face)
58 (face :value read-file-name-electric-shadow)) 58 (face :value file-name-shadow))
59 (list :inline t 59 (list :inline t
60 :format "%t: %v%h" 60 :format "%t: %v%h"
61 :tag "Brackets" 61 :tag "Brackets"
@@ -93,31 +93,41 @@
93 (sexp :tag "Value"))))) 93 (sexp :tag "Value")))))
94 94
95;;;###autoload 95;;;###autoload
96(defcustom read-file-name-electric-shadow-properties 96(defcustom file-name-shadow-properties
97 '(face read-file-name-electric-shadow field shadow) 97 '(face file-name-shadow field shadow)
98 "Properties given to the `shadowed' part of a filename in the minibuffer. 98 "Properties given to the `shadowed' part of a filename in the minibuffer.
99Only used when `read-file-name-electric-shadow-mode' is active. 99Only used when `file-name-shadow-mode' is active.
100If emacs is not running under a window system, 100If emacs is not running under a window system,
101`read-file-name-electric-shadow-tty-properties' is used instead." 101`file-name-shadow-tty-properties' is used instead."
102 :type read-file-name-electric-shadow-properties-custom-type 102 :type file-name-shadow-properties-custom-type
103 :group 'minibuffer) 103 :group 'minibuffer)
104;; backwards compatibility
105(make-obsolete-variable 'read-file-name-electric-shadow-properties
106 'file-name-shadow-properties "21.4")
107(defvaralias 'read-file-name-electric-shadow-properties
108 'file-name-shadow-properties)
104 109
105;;;###autoload 110;;;###autoload
106(defcustom read-file-name-electric-shadow-tty-properties 111(defcustom file-name-shadow-tty-properties
107 '(before-string "{" after-string "} " field shadow) 112 '(before-string "{" after-string "} " field shadow)
108 "Properties given to the `shadowed' part of a filename in the minibuffer. 113 "Properties given to the `shadowed' part of a filename in the minibuffer.
109Only used when `read-file-name-electric-shadow-mode' is active and emacs 114Only used when `file-name-shadow-mode' is active and emacs
110is not running under a window-system; if emacs is running under a window 115is not running under a window-system; if emacs is running under a window
111system, `read-file-name-electric-shadow-properties' is used instead." 116system, `file-name-shadow-properties' is used instead."
112 :type read-file-name-electric-shadow-properties-custom-type 117 :type file-name-shadow-properties-custom-type
113 :group 'minibuffer) 118 :group 'minibuffer)
119;; backwards compatibility
120(make-obsolete-variable 'read-file-name-electric-shadow-tty-properties
121 'file-name-shadow-tty-properties "21.4")
122(defvaralias 'read-file-name-electric-shadow-tty-properties
123 'file-name-shadow-tty-properties)
114 124
115(defface read-file-name-electric-shadow 125(defface file-name-shadow
116 '((((background dark)) 126 '((((background dark))
117 :foreground "grey50") 127 :foreground "grey50")
118 (t 128 (t
119 :foreground "grey70")) 129 :foreground "grey70"))
120 "Face used by `read-file-name-electric-shadow-mode' for the shadow." 130 "Face used by `file-name-shadow-mode' for the shadow."
121 :group 'minibuffer) 131 :group 'minibuffer)
122 132
123 133
@@ -150,7 +160,7 @@ is used as the end of the shadowed portion of the filename.")
150 160
151;; This function goes on minibuffer-setup-hook 161;; This function goes on minibuffer-setup-hook
152(defun rfn-eshadow-setup-minibuffer () 162(defun rfn-eshadow-setup-minibuffer ()
153 "Set up a minibuffer for `read-file-name-electric-shadow-mode'. 163 "Set up a minibuffer for `file-name-shadow-mode'.
154The prompt and initial input should already have been inserted." 164The prompt and initial input should already have been inserted."
155 (when minibuffer-completing-file-name 165 (when minibuffer-completing-file-name
156 (setq rfn-eshadow-overlay 166 (setq rfn-eshadow-overlay
@@ -158,8 +168,8 @@ The prompt and initial input should already have been inserted."
158 ;; Give rfn-eshadow-overlay the user's props. 168 ;; Give rfn-eshadow-overlay the user's props.
159 (let ((props 169 (let ((props
160 (if window-system 170 (if window-system
161 read-file-name-electric-shadow-properties 171 file-name-shadow-properties
162 read-file-name-electric-shadow-tty-properties))) 172 file-name-shadow-tty-properties)))
163 (while props 173 (while props
164 (overlay-put rfn-eshadow-overlay (pop props) (pop props)))) 174 (overlay-put rfn-eshadow-overlay (pop props) (pop props))))
165 ;; Turn on overlay evaporation so that we don't have to worry about 175 ;; Turn on overlay evaporation so that we don't have to worry about
@@ -174,7 +184,7 @@ The prompt and initial input should already have been inserted."
174(defun rfn-eshadow-update-overlay () 184(defun rfn-eshadow-update-overlay ()
175 "Update `rfn-eshadow-overlay' to cover shadowed part of minibuffer input. 185 "Update `rfn-eshadow-overlay' to cover shadowed part of minibuffer input.
176This is intended to be used as a minibuffer post-command-hook for 186This is intended to be used as a minibuffer post-command-hook for
177`read-file-name-electric-shadow-mode'; the minibuffer should have already 187`file-name-shadow-mode'; the minibuffer should have already
178been set up by `rfn-eshadow-setup-minibuffer'." 188been set up by `rfn-eshadow-setup-minibuffer'."
179 ;; This is not really a correct implementation; it won't always do the 189 ;; This is not really a correct implementation; it won't always do the
180 ;; right thing in the presence of environment variables that 190 ;; right thing in the presence of environment variables that
@@ -196,19 +206,19 @@ been set up by `rfn-eshadow-setup-minibuffer'."
196;;; associated variable is non-nil, which requires that all needed 206;;; associated variable is non-nil, which requires that all needed
197;;; functions be already defined. [This is arguably a bug in d-m-m] 207;;; functions be already defined. [This is arguably a bug in d-m-m]
198;;;###autoload 208;;;###autoload
199(define-minor-mode read-file-name-electric-shadow-mode 209(define-minor-mode file-name-shadow-mode
200 "Toggle Read-File-Name Electric Shadow mode. 210 "Toggle Read-File-Name Electric Shadow mode.
201When active, any part of the filename being read in the minibuffer 211When active, any part of the filename being read in the minibuffer
202that would be ignored because the result is passed through 212that would be ignored because the result is passed through
203`substitute-in-file-name' is given the properties in 213`substitute-in-file-name' is given the properties in
204`read-file-name-electric-shadow-properties', which can be used to make 214`file-name-shadow-properties', which can be used to make
205that portion dim, invisible, or otherwise less visually noticeable. 215that portion dim, invisible, or otherwise less visually noticeable.
206 216
207With prefix argument ARG, turn on if positive, otherwise off. 217With prefix argument ARG, turn on if positive, otherwise off.
208Returns non-nil if the new state is enabled." 218Returns non-nil if the new state is enabled."
209 :global t 219 :global t
210 :group 'minibuffer 220 :group 'minibuffer
211 (if read-file-name-electric-shadow-mode 221 (if file-name-shadow-mode
212 ;; Enable the mode 222 ;; Enable the mode
213 (add-hook 'minibuffer-setup-hook 'rfn-eshadow-setup-minibuffer) 223 (add-hook 'minibuffer-setup-hook 'rfn-eshadow-setup-minibuffer)
214 ;; Disable the mode 224 ;; Disable the mode
@@ -219,6 +229,14 @@ Returns non-nil if the new state is enabled."
219 (remove-hook 'post-command-hook #'rfn-eshadow-update-overlay t))) 229 (remove-hook 'post-command-hook #'rfn-eshadow-update-overlay t)))
220 (setq rfn-eshadow-frobbed-minibufs nil))) 230 (setq rfn-eshadow-frobbed-minibufs nil)))
221 231
232;; backwards compatibility
233(make-obsolete 'read-file-name-electric-shadow-mode 'file-name-shadow-mode
234 "21.4")
235(defalias 'read-file-name-electric-shadow-mode 'file-name-shadow-mode)
236(make-obsolete-variable 'read-file-name-electric-shadow-mode
237 'file-name-shadow-mode "21.4")
238(defvaralias 'read-file-name-electric-shadow-mode 'file-name-shadow-mode)
239
222 240
223(provide 'rfn-eshadow) 241(provide 'rfn-eshadow)
224 242