aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMiles Bader2005-06-15 23:37:29 +0000
committerMiles Bader2005-06-15 23:37:29 +0000
commit82cf95134905ffe09000888e86e88c9a400a4468 (patch)
tree2004ce196df86e7551abcabd958d27e150195356
parent2092fd2b3339ac097e1b27643b70211dcb0b4e95 (diff)
parent51cd2a8c642a6ade362424bc123f46f5cf6fe338 (diff)
downloademacs-82cf95134905ffe09000888e86e88c9a400a4468.tar.gz
emacs-82cf95134905ffe09000888e86e88c9a400a4468.zip
Revision: miles@gnu.org--gnu-2005/emacs--unicode--0--patch-64
Merge from emacs--cvs-trunk--0 Patches applied: * emacs--cvs-trunk--0 (patch 424) - Update from CVS
-rw-r--r--lisp/ChangeLog15
-rw-r--r--lisp/ido.el82
-rw-r--r--lispref/ChangeLog9
-rw-r--r--lispref/functions.texi20
-rw-r--r--lispref/variables.texi37
5 files changed, 108 insertions, 55 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index bf16d16fde8..036dcfaca8c 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,14 @@
12005-06-15 Matt Hodges <MPHodges@member.fsf.org>
2
3 * ido.el (ido-incomplete-regexp): New variable.
4 (ido-set-matches-1): Handle invalid-regexp error and set
5 ido-incomplete-regexp.
6 (ido-incomplete-regexp): New face.
7 (ido-completions): Use it.
8 (ido-complete, ido-exit-minibuffer, ido-completions): Handle
9 incomplete regexps.
10 (ido-completions): Add check for complete match when entering a regexp.
11
12005-06-15 Stefan Monnier <monnier@iro.umontreal.ca> 122005-06-15 Stefan Monnier <monnier@iro.umontreal.ca>
2 13
3 * subr.el (add-to-ordered-list): Use a weak hash-table to avoid leaks. 14 * subr.el (add-to-ordered-list): Use a weak hash-table to avoid leaks.
@@ -28,7 +39,7 @@
28 39
29 * progmodes/ld-script.el (ld-script-location-counter): 40 * progmodes/ld-script.el (ld-script-location-counter):
30 Remove "-face" suffix from face name. 41 Remove "-face" suffix from face name.
31 (ld-script-location-counter-face): 42 (ld-script-location-counter-face):
32 New backward-compatibility alias for renamed face. 43 New backward-compatibility alias for renamed face.
33 (ld-script-location-counter-face): Use renamed face. 44 (ld-script-location-counter-face): Use renamed face.
34 45
@@ -103,7 +114,7 @@
103 (ebrowse-tree-mark-face, ebrowse-root-class-face) 114 (ebrowse-tree-mark-face, ebrowse-root-class-face)
104 (ebrowse-file-name-face, ebrowse-default-face) 115 (ebrowse-file-name-face, ebrowse-default-face)
105 (ebrowse-member-attribute-face, ebrowse-member-class-face) 116 (ebrowse-member-attribute-face, ebrowse-member-class-face)
106 (ebrowse-progress-face): 117 (ebrowse-progress-face):
107 New backward-compatibility aliases for renamed faces. 118 New backward-compatibility aliases for renamed faces.
108 (ebrowse-show-progress, ebrowse-show-file-name-at-point) 119 (ebrowse-show-progress, ebrowse-show-file-name-at-point)
109 (ebrowse-set-mark-props, ebrowse-draw-tree-fn) 120 (ebrowse-set-mark-props, ebrowse-draw-tree-fn)
diff --git a/lisp/ido.el b/lisp/ido.el
index 2d9313bb0ea..f5941bf4ef2 100644
--- a/lisp/ido.el
+++ b/lisp/ido.el
@@ -770,6 +770,12 @@ subdirs in the alternatives."
770 "*Font used by ido for highlighting its indicators." 770 "*Font used by ido for highlighting its indicators."
771 :group 'ido) 771 :group 'ido)
772 772
773(defface ido-incomplete-regexp
774 '((t
775 (:inherit font-lock-warning-face)))
776 "Ido face for indicating incomplete regexps."
777 :group 'ido)
778
773(defcustom ido-make-file-list-hook nil 779(defcustom ido-make-file-list-hook nil
774 "*List of functions to run when the list of matching files is created. 780 "*List of functions to run when the list of matching files is created.
775Each function on the list may modify the dynamically bound variable 781Each function on the list may modify the dynamically bound variable
@@ -959,6 +965,8 @@ selected.")
959Is set by ido functions to the current minibuffer-depth, so that 965Is set by ido functions to the current minibuffer-depth, so that
960it doesn't interfere with other minibuffer usage.") 966it doesn't interfere with other minibuffer usage.")
961 967
968(defvar ido-incomplete-regexp nil
969 "Non-nil if an incomplete regexp is entered.")
962 970
963;;; Variables with dynamic bindings. 971;;; Variables with dynamic bindings.
964;;; Declared here to keep the byte compiler quiet. 972;;; Declared here to keep the byte compiler quiet.
@@ -2170,6 +2178,9 @@ If INITIAL is non-nil, it specifies the initial input string."
2170 (interactive) 2178 (interactive)
2171 (let (res) 2179 (let (res)
2172 (cond 2180 (cond
2181 (ido-incomplete-regexp
2182 ;; Do nothing
2183 )
2173 ((and (memq ido-cur-item '(file dir)) 2184 ((and (memq ido-cur-item '(file dir))
2174 (string-match "[$]" ido-text)) 2185 (string-match "[$]" ido-text))
2175 (let ((evar (substitute-in-file-name (concat ido-current-directory ido-text)))) 2186 (let ((evar (substitute-in-file-name (concat ido-current-directory ido-text))))
@@ -2394,8 +2405,9 @@ timestamp has not changed (e.g. with ftp or on Windows)."
2394(defun ido-exit-minibuffer () 2405(defun ido-exit-minibuffer ()
2395 "Exit minibuffer, but make sure we have a match if one is needed." 2406 "Exit minibuffer, but make sure we have a match if one is needed."
2396 (interactive) 2407 (interactive)
2397 (if (or (not ido-require-match) 2408 (if (and (or (not ido-require-match)
2398 (ido-existing-item-p)) 2409 (ido-existing-item-p))
2410 (not ido-incomplete-regexp))
2399 (exit-minibuffer))) 2411 (exit-minibuffer)))
2400 2412
2401(defun ido-select-text () 2413(defun ido-select-text ()
@@ -3275,22 +3287,30 @@ for first matching file."
3275 full-matches 3287 full-matches
3276 prefix-matches 3288 prefix-matches
3277 matches) 3289 matches)
3278 (mapcar 3290 (setq ido-incomplete-regexp nil)
3279 (lambda (item) 3291 (condition-case error
3280 (let ((name (ido-name item))) 3292 (mapcar
3281 (if (and (or non-prefix-dot 3293 (lambda (item)
3282 (if (= (aref ido-text 0) ?.) 3294 (let ((name (ido-name item)))
3283 (= (aref name 0) ?.) 3295 (if (and (or non-prefix-dot
3284 (/= (aref name 0) ?.))) 3296 (if (= (aref ido-text 0) ?.)
3285 (string-match re name)) 3297 (= (aref name 0) ?.)
3286 (cond 3298 (/= (aref name 0) ?.)))
3287 ((and full-re (string-match full-re name)) 3299 (string-match re name))
3288 (setq full-matches (cons item full-matches))) 3300 (cond
3289 ((and prefix-re (string-match prefix-re name)) 3301 ((and full-re (string-match full-re name))
3290 (setq prefix-matches (cons item prefix-matches))) 3302 (setq full-matches (cons item full-matches)))
3291 (t (setq matches (cons item matches)))))) 3303 ((and prefix-re (string-match prefix-re name))
3292 t) 3304 (setq prefix-matches (cons item prefix-matches)))
3293 items) 3305 (t (setq matches (cons item matches))))))
3306 t)
3307 items)
3308 (invalid-regexp
3309 (setq ido-incomplete-regexp t
3310 ;; Consider the invalid regexp message internally as a
3311 ;; special-case single match, and handle appropriately
3312 ;; elsewhere.
3313 matches (cdr error))))
3294 (if prefix-matches 3314 (if prefix-matches
3295 (setq matches (nconc prefix-matches matches))) 3315 (setq matches (nconc prefix-matches matches)))
3296 (if full-matches 3316 (if full-matches
@@ -4048,7 +4068,9 @@ For details of keybindings, do `\\[describe-function] ido-find-file'."
4048 (setq first (format "%s" fn)) 4068 (setq first (format "%s" fn))
4049 (put-text-property 0 ln 'face 4069 (put-text-property 0 ln 'face
4050 (if (= (length comps) 1) 4070 (if (= (length comps) 1)
4051 'ido-only-match 4071 (if ido-incomplete-regexp
4072 'ido-incomplete-regexp
4073 'ido-only-match)
4052 'ido-first-match) 4074 'ido-first-match)
4053 first) 4075 first)
4054 (if ind (setq first (concat first ind))) 4076 (if ind (setq first (concat first ind)))
@@ -4063,14 +4085,22 @@ For details of keybindings, do `\\[describe-function] ido-find-file'."
4063 (ido-report-no-match 4085 (ido-report-no-match
4064 (nth 6 ido-decorations)) ;; [No match] 4086 (nth 6 ido-decorations)) ;; [No match]
4065 (t ""))) 4087 (t "")))
4066 4088 (ido-incomplete-regexp
4089 (concat " " (car comps)))
4067 ((null (cdr comps)) ;one match 4090 ((null (cdr comps)) ;one match
4068 (concat (if (> (length (ido-name (car comps))) (length name)) 4091 (concat (if (if (not ido-enable-regexp)
4069 ;; when there is one match, show the matching file name in full 4092 (= (length (ido-name (car comps))) (length name))
4070 (concat (nth 4 ido-decorations) ;; [ ... ] 4093 ;; We can't rely on the length of the input
4071 (ido-name (car comps)) 4094 ;; for regexps, so explicitly check for a
4072 (nth 5 ido-decorations)) 4095 ;; complete match
4073 "") 4096 (string-match name (ido-name (car comps)))
4097 (string-equal (match-string 0 (ido-name (car comps)))
4098 (ido-name (car comps))))
4099 ""
4100 ;; when there is one match, show the matching file name in full
4101 (concat (nth 4 ido-decorations) ;; [ ... ]
4102 (ido-name (car comps))
4103 (nth 5 ido-decorations)))
4074 (if (not ido-use-faces) (nth 7 ido-decorations)))) ;; [Matched] 4104 (if (not ido-use-faces) (nth 7 ido-decorations)))) ;; [Matched]
4075 (t ;multiple matches 4105 (t ;multiple matches
4076 (let* ((items (if (> ido-max-prospects 0) (1+ ido-max-prospects) 999)) 4106 (let* ((items (if (> ido-max-prospects 0) (1+ ido-max-prospects) 999))
diff --git a/lispref/ChangeLog b/lispref/ChangeLog
index d1df2e17667..112d6e81ae5 100644
--- a/lispref/ChangeLog
+++ b/lispref/ChangeLog
@@ -1,3 +1,12 @@
12005-06-16 Juanma Barranquero <lekktu@gmail.com>
2
3 * functions.texi (Obsolete Functions): Update argument names of
4 `make-obsolete' and `define-obsolete-function-alias'.
5
6 * variables.texi (Variable Aliases): Update argument names of
7 `defvaralias', `make-obsolete-variable' and
8 `define-obsolete-variable-alias'.
9
12005-06-15 Kim F. Storm <storm@cua.dk> 102005-06-15 Kim F. Storm <storm@cua.dk>
2 11
3 * searching.texi (Entire Match Data): Rephrase warnings about 12 * searching.texi (Entire Match Data): Rephrase warnings about
diff --git a/lispref/functions.texi b/lispref/functions.texi
index bcdfc95cc1c..409f0125ad8 100644
--- a/lispref/functions.texi
+++ b/lispref/functions.texi
@@ -1157,13 +1157,14 @@ a function defined by another package, it is cleaner to use
1157You can use @code{make-obsolete} to declare a function obsolete. This 1157You can use @code{make-obsolete} to declare a function obsolete. This
1158indicates that the function may be removed at some stage in the future. 1158indicates that the function may be removed at some stage in the future.
1159 1159
1160@defun make-obsolete function new &optional when 1160@defun make-obsolete obsolete-name current-name &optional when
1161This function makes the byte compiler warn that the function 1161This function makes the byte compiler warn that the function
1162@var{function} is obsolete. If @var{new} is a symbol, the warning 1162@var{obsolete-name} is obsolete. If @var{current-name} is a symbol, the
1163message says to use @var{new} instead of @var{function}. @var{new} 1163warning message says to use @var{current-name} instead of
1164does not need to be an alias for @var{function}; it can be a different 1164@var{obsolete-name}. @var{current-name} does not need to be an alias for
1165function with similar functionality. If @var{new} is a string, it is 1165@var{obsolete-name}; it can be a different function with similar
1166the warning message. 1166functionality. If @var{current-name} is a string, it is the warning
1167message.
1167 1168
1168If provided, @var{when} should be a string indicating when the function 1169If provided, @var{when} should be a string indicating when the function
1169was first made obsolete---for example, a date or a release number. 1170was first made obsolete---for example, a date or a release number.
@@ -1172,9 +1173,10 @@ was first made obsolete---for example, a date or a release number.
1172You can define a function as an alias and declare it obsolete at the 1173You can define a function as an alias and declare it obsolete at the
1173same time using the macro @code{define-obsolete-function-alias}. 1174same time using the macro @code{define-obsolete-function-alias}.
1174 1175
1175@defmac define-obsolete-function-alias function new &optional when docstring 1176@defmac define-obsolete-function-alias obsolete-name current-name &optional when docstring
1176This macro marks the function @var{function} obsolete and also defines 1177This macro marks the function @var{obsolete-name} obsolete and also defines
1177it as an alias for the function @var{new}. A typical call has the form: 1178it as an alias for the function @var{current-name}. A typical call has the
1179form:
1178 1180
1179@example 1181@example
1180(define-obsolete-function-alias 'old-fun 'new-fun "22.1" "Doc.") 1182(define-obsolete-function-alias 'old-fun 'new-fun "22.1" "Doc.")
diff --git a/lispref/variables.texi b/lispref/variables.texi
index 27f0f4a7029..0f546af67b9 100644
--- a/lispref/variables.texi
+++ b/lispref/variables.texi
@@ -1785,19 +1785,19 @@ chosen, or because its meaning has partly changed---it can be useful
1785to keep the old name as an @emph{alias} of the new one for 1785to keep the old name as an @emph{alias} of the new one for
1786compatibility. You can do this with @code{defvaralias}. 1786compatibility. You can do this with @code{defvaralias}.
1787 1787
1788@defun defvaralias alias-var base-var &optional docstring 1788@defun defvaralias new-alias base-variable &optional docstring
1789This function defines the symbol @var{alias-var} as a variable alias 1789This function defines the symbol @var{new-alias} as a variable alias
1790for symbol @var{base-var}. This means that retrieving the value of 1790for symbol @var{base-variable}. This means that retrieving the value of
1791@var{alias-var} returns the value of @var{base-var}, and changing the 1791@var{new-alias} returns the value of @var{base-variable}, and changing the
1792value of @var{alias-var} changes the value of @var{base-var}. 1792value of @var{new-alias} changes the value of @var{base-variable}.
1793 1793
1794If the @var{docstring} argument is non-@code{nil}, it specifies the 1794If the @var{docstring} argument is non-@code{nil}, it specifies the
1795documentation for @var{alias-var}; otherwise, the alias gets the same 1795documentation for @var{new-alias}; otherwise, the alias gets the same
1796documentation as @var{base-var} has, if any, unless @var{base-var} is 1796documentation as @var{base-variable} has, if any, unless
1797itself an alias, in which case @var{alias-var} gets the documentation 1797@var{base-variable} is itself an alias, in which case @var{new-alias} gets
1798of the variable at the end of the chain of aliases. 1798the documentation of the variable at the end of the chain of aliases.
1799 1799
1800This function returns @var{base-var}. 1800This function returns @var{base-variable}.
1801@end defun 1801@end defun
1802 1802
1803 Variable aliases are convenient for replacing an old name for a 1803 Variable aliases are convenient for replacing an old name for a
@@ -1805,12 +1805,12 @@ variable with a new name. @code{make-obsolete-variable} declares that
1805the old name is obsolete and therefore that it may be removed at some 1805the old name is obsolete and therefore that it may be removed at some
1806stage in the future. 1806stage in the future.
1807 1807
1808@defun make-obsolete-variable variable new &optional when 1808@defun make-obsolete-variable obsolete-name current-name &optional when
1809This function makes the byte-compiler warn that the variable 1809This function makes the byte-compiler warn that the variable
1810@var{variable} is obsolete. If @var{new} is a symbol, it is the 1810@var{obsolete-name} is obsolete. If @var{current-name} is a symbol, it is
1811variable's new name; then the warning message says to use @var{new} 1811the variable's new name; then the warning message says to use
1812instead of @var{variable}. If @var{new} is a string, this is the 1812@var{current-name} instead of @var{obsolete-name}. If @var{current-name}
1813message and there is no replacement variable. 1813is a string, this is the message and there is no replacement variable.
1814 1814
1815If provided, @var{when} should be a string indicating when the 1815If provided, @var{when} should be a string indicating when the
1816variable was first made obsolete---for example, a date or a release 1816variable was first made obsolete---for example, a date or a release
@@ -1820,9 +1820,10 @@ number.
1820 You can make two variables synonyms and declare one obsolete at the 1820 You can make two variables synonyms and declare one obsolete at the
1821same time using the macro @code{define-obsolete-variable-alias}. 1821same time using the macro @code{define-obsolete-variable-alias}.
1822 1822
1823@defmac define-obsolete-variable-alias variable new &optional when docstring 1823@defmac define-obsolete-variable-alias obsolete-name current-name &optional when docstring
1824This macro marks the variable @var{variable} as obsolete and also 1824This macro marks the variable @var{obsolete-name} as obsolete and also
1825makes it an alias for the variable @var{new}. A typical call has the form: 1825makes it an alias for the variable @var{current-name}. A typical call has
1826the form:
1826 1827
1827@example 1828@example
1828(define-obsolete-variable-alias 'old-var 'new-var "22.1" "Doc.") 1829(define-obsolete-variable-alias 'old-var 'new-var "22.1" "Doc.")