aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorKenichi Handa2010-10-04 10:53:48 +0900
committerKenichi Handa2010-10-04 10:53:48 +0900
commitff06de4f50becfe9d5fc16699531ce9802ee0b7f (patch)
tree7bb9e0d3b33d9469ea9018a16f9ca288fa399db6 /lisp
parent5886ec9c0c7a250d987ac6180577b4574ea00f21 (diff)
parent397ae2261860609d3f320b9c4255ca8f92353c50 (diff)
downloademacs-ff06de4f50becfe9d5fc16699531ce9802ee0b7f.tar.gz
emacs-ff06de4f50becfe9d5fc16699531ce9802ee0b7f.zip
merge emacs-23
Diffstat (limited to 'lisp')
-rw-r--r--lisp/ChangeLog18
-rw-r--r--lisp/dnd.el9
-rw-r--r--lisp/minibuffer.el112
-rw-r--r--lisp/vc-svn.el2
4 files changed, 83 insertions, 58 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 696941f93cd..85d108356cc 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,21 @@
12010-10-03 Chong Yidong <cyd@stupidchicken.com>
2
3 * minibuffer.el (completion--some, completion--do-completion)
4 (minibuffer-complete-and-exit, minibuffer-completion-help)
5 (completion-basic-try-completion)
6 (completion-basic-all-completions)
7 (completion-pcm--find-all-completions): Use lexical-let to
8 avoid some false matches in variable completion (Bug#7056)
9
102010-10-03 Olof Ohlsson Sax <olof.ohlsson.sax@gmail.com> (tiny change)
11
12 * vc-svn.el (vc-svn-merge-news): Use --non-interactive. (Bug#7152)
13
142010-10-03 Leo <sdl.web@gmail.com>
15
16 * dnd.el (dnd-get-local-file-name): If MUST-EXIST is non-nil, only
17 return non-nil if the file exists (Bug#7090).
18
12010-09-30 Stefan Monnier <monnier@iro.umontreal.ca> 192010-09-30 Stefan Monnier <monnier@iro.umontreal.ca>
2 20
3 * minibuffer.el (completion--replace): 21 * minibuffer.el (completion--replace):
diff --git a/lisp/dnd.el b/lisp/dnd.el
index d7cbb641bab..aadfad6d7ac 100644
--- a/lisp/dnd.el
+++ b/lisp/dnd.el
@@ -154,10 +154,11 @@ Return nil if URI is not a local file."
154 (let* ((decoded-f (decode-coding-string 154 (let* ((decoded-f (decode-coding-string
155 f 155 f
156 (or file-name-coding-system 156 (or file-name-coding-system
157 default-file-name-coding-system))) 157 default-file-name-coding-system))))
158 (try-f (if (file-readable-p decoded-f) decoded-f f))) 158 (setq f (cond ((file-readable-p decoded-f) decoded-f)
159 (when (file-readable-p try-f) try-f))))) 159 ((file-readable-p f) f)
160 160 (t nil)))))
161 f))
161 162
162(defun dnd-open-local-file (uri action) 163(defun dnd-open-local-file (uri action)
163 "Open a local file. 164 "Open a local file.
diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el
index 9a477020421..a4ab5261f7c 100644
--- a/lisp/minibuffer.el
+++ b/lisp/minibuffer.el
@@ -129,8 +129,8 @@ the closest directory separators."
129 "Apply FUN to each element of XS in turn. 129 "Apply FUN to each element of XS in turn.
130Return the first non-nil returned value. 130Return the first non-nil returned value.
131Like CL's `some'." 131Like CL's `some'."
132 (let ((firsterror nil) 132 (lexical-let ((firsterror nil)
133 res) 133 res)
134 (while (and (not res) xs) 134 (while (and (not res) xs)
135 (condition-case err 135 (condition-case err
136 (setq res (funcall fun (pop xs))) 136 (setq res (funcall fun (pop xs)))
@@ -518,15 +518,16 @@ E = after completion we now have an Exact match.
518 101 5 ??? impossible 518 101 5 ??? impossible
519 110 6 some completion happened 519 110 6 some completion happened
520 111 7 completed to an exact completion" 520 111 7 completed to an exact completion"
521 (let* ((beg (field-beginning)) 521 (lexical-let*
522 (end (field-end)) 522 ((beg (field-beginning))
523 (string (buffer-substring beg end)) 523 (end (field-end))
524 (comp (funcall (or try-completion-function 524 (string (buffer-substring beg end))
525 'completion-try-completion) 525 (comp (funcall (or try-completion-function
526 string 526 'completion-try-completion)
527 minibuffer-completion-table 527 string
528 minibuffer-completion-predicate 528 minibuffer-completion-table
529 (- (point) beg)))) 529 minibuffer-completion-predicate
530 (- (point) beg))))
530 (cond 531 (cond
531 ((null comp) 532 ((null comp)
532 (minibuffer-hide-completions) 533 (minibuffer-hide-completions)
@@ -539,14 +540,15 @@ E = after completion we now have an Exact match.
539 ;; `completed' should be t if some completion was done, which doesn't 540 ;; `completed' should be t if some completion was done, which doesn't
540 ;; include simply changing the case of the entered string. However, 541 ;; include simply changing the case of the entered string. However,
541 ;; for appearance, the string is rewritten if the case changes. 542 ;; for appearance, the string is rewritten if the case changes.
542 (let* ((comp-pos (cdr comp)) 543 (lexical-let*
543 (completion (car comp)) 544 ((comp-pos (cdr comp))
544 (completed (not (eq t (compare-strings completion nil nil 545 (completion (car comp))
545 string nil nil t)))) 546 (completed (not (eq t (compare-strings completion nil nil
546 (unchanged (eq t (compare-strings completion nil nil 547 string nil nil t))))
547 string nil nil nil)))) 548 (unchanged (eq t (compare-strings completion nil nil
549 string nil nil nil))))
548 (if unchanged 550 (if unchanged
549 (goto-char end) 551 (goto-char end)
550 ;; Insert in minibuffer the chars we got. 552 ;; Insert in minibuffer the chars we got.
551 (completion--replace beg end completion)) 553 (completion--replace beg end completion))
552 ;; Move point to its completion-mandated destination. 554 ;; Move point to its completion-mandated destination.
@@ -693,8 +695,8 @@ If `minibuffer-completion-confirm' is `confirm-after-completion',
693 `minibuffer-confirm-exit-commands', and accept the input 695 `minibuffer-confirm-exit-commands', and accept the input
694 otherwise." 696 otherwise."
695 (interactive) 697 (interactive)
696 (let ((beg (field-beginning)) 698 (lexical-let ((beg (field-beginning))
697 (end (field-end))) 699 (end (field-end)))
698 (cond 700 (cond
699 ;; Allow user to specify null string 701 ;; Allow user to specify null string
700 ((= beg end) (exit-minibuffer)) 702 ((= beg end) (exit-minibuffer))
@@ -1071,13 +1073,13 @@ variables.")
1071 "Display a list of possible completions of the current minibuffer contents." 1073 "Display a list of possible completions of the current minibuffer contents."
1072 (interactive) 1074 (interactive)
1073 (message "Making completion list...") 1075 (message "Making completion list...")
1074 (let* ((start (field-beginning)) 1076 (lexical-let* ((start (field-beginning))
1075 (string (field-string)) 1077 (string (field-string))
1076 (completions (completion-all-completions 1078 (completions (completion-all-completions
1077 string 1079 string
1078 minibuffer-completion-table 1080 minibuffer-completion-table
1079 minibuffer-completion-predicate 1081 minibuffer-completion-predicate
1080 (- (point) (field-beginning))))) 1082 (- (point) (field-beginning)))))
1081 (message nil) 1083 (message nil)
1082 (if (and completions 1084 (if (and completions
1083 (or (consp (cdr completions)) 1085 (or (consp (cdr completions))
@@ -1707,9 +1709,10 @@ Return the new suffix."
1707 suffix)) 1709 suffix))
1708 1710
1709(defun completion-basic-try-completion (string table pred point) 1711(defun completion-basic-try-completion (string table pred point)
1710 (let* ((beforepoint (substring string 0 point)) 1712 (lexical-let*
1711 (afterpoint (substring string point)) 1713 ((beforepoint (substring string 0 point))
1712 (bounds (completion-boundaries beforepoint table pred afterpoint))) 1714 (afterpoint (substring string point))
1715 (bounds (completion-boundaries beforepoint table pred afterpoint)))
1713 (if (zerop (cdr bounds)) 1716 (if (zerop (cdr bounds))
1714 ;; `try-completion' may return a subtly different result 1717 ;; `try-completion' may return a subtly different result
1715 ;; than `all+merge', so try to use it whenever possible. 1718 ;; than `all+merge', so try to use it whenever possible.
@@ -1720,28 +1723,30 @@ Return the new suffix."
1720 (concat completion 1723 (concat completion
1721 (completion--merge-suffix completion point afterpoint)) 1724 (completion--merge-suffix completion point afterpoint))
1722 (length completion)))) 1725 (length completion))))
1723 (let* ((suffix (substring afterpoint (cdr bounds))) 1726 (lexical-let*
1724 (prefix (substring beforepoint 0 (car bounds))) 1727 ((suffix (substring afterpoint (cdr bounds)))
1725 (pattern (delete 1728 (prefix (substring beforepoint 0 (car bounds)))
1726 "" (list (substring beforepoint (car bounds)) 1729 (pattern (delete
1727 'point 1730 "" (list (substring beforepoint (car bounds))
1728 (substring afterpoint 0 (cdr bounds))))) 1731 'point
1729 (all (completion-pcm--all-completions prefix pattern table pred))) 1732 (substring afterpoint 0 (cdr bounds)))))
1733 (all (completion-pcm--all-completions prefix pattern table pred)))
1730 (if minibuffer-completing-file-name 1734 (if minibuffer-completing-file-name
1731 (setq all (completion-pcm--filename-try-filter all))) 1735 (setq all (completion-pcm--filename-try-filter all)))
1732 (completion-pcm--merge-try pattern all prefix suffix))))) 1736 (completion-pcm--merge-try pattern all prefix suffix)))))
1733 1737
1734(defun completion-basic-all-completions (string table pred point) 1738(defun completion-basic-all-completions (string table pred point)
1735 (let* ((beforepoint (substring string 0 point)) 1739 (lexical-let*
1736 (afterpoint (substring string point)) 1740 ((beforepoint (substring string 0 point))
1737 (bounds (completion-boundaries beforepoint table pred afterpoint)) 1741 (afterpoint (substring string point))
1738 (suffix (substring afterpoint (cdr bounds))) 1742 (bounds (completion-boundaries beforepoint table pred afterpoint))
1739 (prefix (substring beforepoint 0 (car bounds))) 1743 (suffix (substring afterpoint (cdr bounds)))
1740 (pattern (delete 1744 (prefix (substring beforepoint 0 (car bounds)))
1741 "" (list (substring beforepoint (car bounds)) 1745 (pattern (delete
1742 'point 1746 "" (list (substring beforepoint (car bounds))
1743 (substring afterpoint 0 (cdr bounds))))) 1747 'point
1744 (all (completion-pcm--all-completions prefix pattern table pred))) 1748 (substring afterpoint 0 (cdr bounds)))))
1749 (all (completion-pcm--all-completions prefix pattern table pred)))
1745 (completion-hilit-commonality all point (car bounds)))) 1750 (completion-hilit-commonality all point (car bounds))))
1746 1751
1747;;; Partial-completion-mode style completion. 1752;;; Partial-completion-mode style completion.
@@ -1896,12 +1901,13 @@ POINT is a position inside STRING.
1896FILTER is a function applied to the return value, that can be used, e.g. to 1901FILTER is a function applied to the return value, that can be used, e.g. to
1897filter out additional entries (because TABLE migth not obey PRED)." 1902filter out additional entries (because TABLE migth not obey PRED)."
1898 (unless filter (setq filter 'identity)) 1903 (unless filter (setq filter 'identity))
1899 (let* ((beforepoint (substring string 0 point)) 1904 (lexical-let*
1900 (afterpoint (substring string point)) 1905 ((beforepoint (substring string 0 point))
1901 (bounds (completion-boundaries beforepoint table pred afterpoint)) 1906 (afterpoint (substring string point))
1902 (prefix (substring beforepoint 0 (car bounds))) 1907 (bounds (completion-boundaries beforepoint table pred afterpoint))
1903 (suffix (substring afterpoint (cdr bounds))) 1908 (prefix (substring beforepoint 0 (car bounds)))
1904 firsterror) 1909 (suffix (substring afterpoint (cdr bounds)))
1910 firsterror)
1905 (setq string (substring string (car bounds) (+ point (cdr bounds)))) 1911 (setq string (substring string (car bounds) (+ point (cdr bounds))))
1906 (let* ((relpoint (- point (car bounds))) 1912 (let* ((relpoint (- point (car bounds)))
1907 (pattern (completion-pcm--string->pattern string relpoint)) 1913 (pattern (completion-pcm--string->pattern string relpoint))
diff --git a/lisp/vc-svn.el b/lisp/vc-svn.el
index 34ebc3bb949..7b95c2a214d 100644
--- a/lisp/vc-svn.el
+++ b/lisp/vc-svn.el
@@ -373,7 +373,7 @@ The changes are between FIRST-VERSION and SECOND-VERSION."
373 (message "Merging changes into %s..." file) 373 (message "Merging changes into %s..." file)
374 ;; (vc-file-setprop file 'vc-working-revision nil) 374 ;; (vc-file-setprop file 'vc-working-revision nil)
375 (vc-file-setprop file 'vc-checkout-time 0) 375 (vc-file-setprop file 'vc-checkout-time 0)
376 (vc-svn-command nil 0 file "update") 376 (vc-svn-command nil 0 file "--non-interactive" "update") ; see bug#7152
377 ;; Analyze the merge result reported by SVN, and set 377 ;; Analyze the merge result reported by SVN, and set
378 ;; file properties accordingly. 378 ;; file properties accordingly.
379 (with-current-buffer (get-buffer "*vc*") 379 (with-current-buffer (get-buffer "*vc*")