aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorEli Zaretskii2010-03-06 05:16:27 -0500
committerEli Zaretskii2010-03-06 05:16:27 -0500
commit9dbadf5f1a700c5790837738410c06b481cd2222 (patch)
treee1458f8f2aef541b98c7df4ea2d780c5011d9fe9 /lisp
parentd23cd5eeb2993e55943d250ea8c2015da5b06a24 (diff)
parent4c83ed3d48c69e12c91a2ada2d00f4f74be2a42d (diff)
downloademacs-9dbadf5f1a700c5790837738410c06b481cd2222.tar.gz
emacs-9dbadf5f1a700c5790837738410c06b481cd2222.zip
Merge from mainline.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/ChangeLog111
-rw-r--r--lisp/calc/calcalg2.el4
-rw-r--r--lisp/calendar/cal-hebrew.el4
-rw-r--r--lisp/calendar/icalendar.el3
-rw-r--r--lisp/cedet/ede/make.el3
-rw-r--r--lisp/cedet/semantic/db-find.el5
-rw-r--r--lisp/cedet/semantic/grammar.el12
-rw-r--r--lisp/emacs-lisp/elint.el3
-rw-r--r--lisp/files.el3
-rw-r--r--lisp/info.el4
-rw-r--r--lisp/international/characters.el4
-rw-r--r--lisp/international/fontset.el8
-rw-r--r--lisp/language/burmese.el4
-rw-r--r--lisp/macros.el3
-rw-r--r--lisp/man.el3
-rw-r--r--lisp/menu-bar.el2
-rw-r--r--lisp/minibuffer.el26
-rw-r--r--lisp/net/dbus.el14
-rw-r--r--lisp/net/tramp-compat.el23
-rw-r--r--lisp/net/tramp.el27
-rw-r--r--lisp/progmodes/cc-engine.el6
-rw-r--r--lisp/progmodes/sh-script.el2
-rw-r--r--lisp/scroll-bar.el15
-rw-r--r--lisp/subr.el6
-rw-r--r--lisp/textmodes/reftex-toc.el3
-rw-r--r--lisp/vc-git.el174
26 files changed, 318 insertions, 154 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 1eb01818750..512e83999ab 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,7 +1,114 @@
12010-03-06 Stefan Monnier <monnier@iro.umontreal.ca>
2
3 * vc-git.el: Re-flow to fit into 80 columns.
4 (vc-git-after-dir-status-stage, vc-git-dir-status-goto-stage):
5 Remove spurious `quote' element in each case alternative.
6 (vc-git-show-log-entry): Use prog1.
7 (vc-git-after-dir-status-stage): Remove unused var `remaining'.
8
92010-03-06 Glenn Morris <rgm@gnu.org>
10
11 * cedet/semantic/grammar.el (semantic-grammar-header-template):
12 Update template copyright to GPLv3+.
13
142010-03-05 Stefan Monnier <monnier@iro.umontreal.ca>
15
16 * man.el (Man-files-regexp): Tighten up the regexp (bug#5686).
17
182010-03-03 Chong Yidong <cyd@stupidchicken.com>
19
20 * macros.el (insert-kbd-macro): Look up keyboard macro using the
21 definition, not the name (Bug#5481).
22
232010-03-03 Štěpán Němec <stepnem@gmail.com> (tiny change)
24
25 * subr.el (momentary-string-display): Don't overwrite the MESSAGE
26 argument with a local variable. (Bug#5670)
27
282010-03-02 Juri Linkov <juri@jurta.org>
29
30 * info.el (Info-index-next): Decrement line number by 2. (Bug#5652)
31
322010-03-02 Michael Albinus <michael.albinus@gmx.de>
33
34 * net/tramp.el (tramp-do-copy-or-rename-file-out-of-band): Fix an
35 error when FILENAME and NEWNAME are existing remote directories.
36
37 * net/tramp-compat.el (tramp-compat-make-temp-file): Add optional
38 parameter DIR-FLAG.
39
402010-03-02 Glenn Morris <rgm@gnu.org>
41
42 * calendar/cal-hebrew.el (holiday-hebrew-passover): Fix date
43 of Yom HaAtzma'ut when it falls on a Monday (rule changed in 2004).
44
452010-03-01 Alan Mackenzie <acm@muc.de>
46
47 * progmodes/cc-engine.el (c-remove-stale-state-cache):
48 Correct previous patch.
49
502010-03-01 Kenichi Handa <handa@m17n.org>
51
52 * language/burmese.el (burmese-composable-pattern): Rename from
53 myanmar-composable-pattern.
54
55 * international/characters.el (script-list):
56 * international/fontset.el (script-representative-chars):
57 Change myanmar to burmese.
58 (otf-script-alist): Likewise.
59 (setup-default-fontset): Likewise. Re-fix :otf spec.
60
612010-03-01 Alan Mackenzie <bug-cc-mode@gnu.org>
62
63 * cc-engine.el (c-remove-stale-state-cache): Take account of when
64 `good-pos' is in the same macro as `here'. Fixes bug 5649.
65
662010-02-28 Katsumi Yamaoka <yamaoka@jpl.org>
67
68 * menu-bar.el (menu-bar-manuals-menu): Fix typo.
69
702010-02-28 Jan Djärv <jan.h.d@swipnet.se>
71
72 * scroll-bar.el (scroll-bar-drag-1): Add save-excursion, bug #5654.
73
742010-02-28 Michael Albinus <michael.albinus@gmx.de>
75
76 * net/tramp.el (tramp-handle-write-region): START can be a string.
77 Take care in the checks. Reported by Dan Davison
78 <davison@stats.ox.ac.uk>.
79
802010-02-28 Michael Albinus <michael.albinus@gmx.de>
81
82 * net/dbus.el (dbus-introspect, dbus-get-property)
83 (dbus-set-property, dbus-get-all-properties): Use
84 `dbus-call-method' when noninteractive. (Bug#5645)
85
862010-02-28 Chong Yidong <cyd@stupidchicken.com>
87
88 * textmodes/reftex-toc.el (reftex-toc-promote-prepare):
89 * emacs-lisp/elint.el (elint-add-required-env):
90 * cedet/semantic/db-find.el
91 (semanticdb-find-translate-path-brutish-default):
92 * cedet/ede/make.el (ede-make-check-version):
93 * calendar/icalendar.el (icalendar--add-diary-entry):
94 * calc/calcalg2.el (math-tracing-integral):
95 * files.el (recover-session-finish): Use with-current-buffer
96 instead of save-excursion.
97
982010-02-27 Stefan Monnier <monnier@iro.umontreal.ca>
99
100 Fix in-buffer completion when after-change-functions modify the buffer.
101 * minibuffer.el (completion--replace): New function.
102 (completion--do-completion): Use it and use relative movement.
103
1042010-02-27 Chong Yidong <cyd@stupidchicken.com>
105
106 * international/fontset.el (setup-default-fontset): Fix :otf spec.
107
12010-02-27 Jeremy Whitlock <jcscoobyrs@gmail.com> (tiny change) 1082010-02-27 Jeremy Whitlock <jcscoobyrs@gmail.com> (tiny change)
2 109
3 * progmodes/python.el (python-pdbtrack-stack-entry-regexp): Allow 110 * progmodes/python.el (python-pdbtrack-stack-entry-regexp):
4 the characters _<> in the stack entry (Bug#5653). 111 Allow the characters _<> in the stack entry (Bug#5653).
5 112
62010-02-26 Kenichi Handa <handa@m17n.org> 1132010-02-26 Kenichi Handa <handa@m17n.org>
7 114
diff --git a/lisp/calc/calcalg2.el b/lisp/calc/calcalg2.el
index 3d90de3f0b3..2b45ce1b2f0 100644
--- a/lisp/calc/calcalg2.el
+++ b/lisp/calc/calcalg2.el
@@ -670,8 +670,8 @@
670(defmacro math-tracing-integral (&rest parts) 670(defmacro math-tracing-integral (&rest parts)
671 (list 'and 671 (list 'and
672 'trace-buffer 672 'trace-buffer
673 (list 'save-excursion 673 (list 'with-current-buffer
674 '(set-buffer trace-buffer) 674 'trace-buffer
675 '(goto-char (point-max)) 675 '(goto-char (point-max))
676 (list 'and 676 (list 'and
677 '(bolp) 677 '(bolp)
diff --git a/lisp/calendar/cal-hebrew.el b/lisp/calendar/cal-hebrew.el
index 330d3c22cb5..2a7556ff322 100644
--- a/lisp/calendar/cal-hebrew.el
+++ b/lisp/calendar/cal-hebrew.el
@@ -505,7 +505,9 @@ or ALL is non-nil."
505 (+ abs-p 18) 505 (+ abs-p 18)
506 (if (= (% abs-p 7) 6) 506 (if (= (% abs-p 7) 6)
507 (+ abs-p 19) 507 (+ abs-p 19)
508 (+ abs-p 20)))) 508 (if (= (% abs-p 7) 2)
509 (+ abs-p 21)
510 (+ abs-p 20)))))
509 "Yom HaAtzma'ut") 511 "Yom HaAtzma'ut")
510 (list (calendar-gregorian-from-absolute (+ abs-p 33)) 512 (list (calendar-gregorian-from-absolute (+ abs-p 33))
511 "Lag BaOmer") 513 "Lag BaOmer")
diff --git a/lisp/calendar/icalendar.el b/lisp/calendar/icalendar.el
index 535956be140..a07402aa031 100644
--- a/lisp/calendar/icalendar.el
+++ b/lisp/calendar/icalendar.el
@@ -2246,8 +2246,7 @@ the entry."
2246 'make-diary-entry) 2246 'make-diary-entry)
2247 string non-marking diary-file))) 2247 string non-marking diary-file)))
2248 ;; Würgaround to remove the trailing blank char 2248 ;; Würgaround to remove the trailing blank char
2249 (save-excursion 2249 (with-current-buffer (find-file diary-file)
2250 (set-buffer (find-file diary-file))
2251 (goto-char (point-max)) 2250 (goto-char (point-max))
2252 (if (= (char-before) ? ) 2251 (if (= (char-before) ? )
2253 (delete-char -1))) 2252 (delete-char -1)))
diff --git a/lisp/cedet/ede/make.el b/lisp/cedet/ede/make.el
index e9bc4b3b8e0..6b59f510bed 100644
--- a/lisp/cedet/ede/make.el
+++ b/lisp/cedet/ede/make.el
@@ -76,9 +76,8 @@ If NOERROR is nil, then throw an error on failure. Return t otherwise."
76 (rev nil) 76 (rev nil)
77 (ans nil) 77 (ans nil)
78 ) 78 )
79 (save-excursion 79 (with-current-buffer b
80 ;; Setup, and execute make. 80 ;; Setup, and execute make.
81 (set-buffer b)
82 (setq default-directory cd) 81 (setq default-directory cd)
83 (erase-buffer) 82 (erase-buffer)
84 (call-process ede-make-command nil b nil 83 (call-process ede-make-command nil b nil
diff --git a/lisp/cedet/semantic/db-find.el b/lisp/cedet/semantic/db-find.el
index eba04a7ee02..754ba231c37 100644
--- a/lisp/cedet/semantic/db-find.el
+++ b/lisp/cedet/semantic/db-find.el
@@ -326,9 +326,8 @@ Default action as described in `semanticdb-find-translate-path'."
326 (cond ((null path) semanticdb-current-database) 326 (cond ((null path) semanticdb-current-database)
327 ((semanticdb-table-p path) (oref path parent-db)) 327 ((semanticdb-table-p path) (oref path parent-db))
328 (t (let ((tt (semantic-something-to-tag-table path))) 328 (t (let ((tt (semantic-something-to-tag-table path)))
329 (save-excursion 329 ;; @todo - What does this DO ??!?!
330 ;; @todo - What does this DO ??!?! 330 (with-current-buffer (semantic-tag-buffer (car tt))
331 (set-buffer (semantic-tag-buffer (car tt)))
332 semanticdb-current-database)))))) 331 semanticdb-current-database))))))
333 (apply 332 (apply
334 #'nconc 333 #'nconc
diff --git a/lisp/cedet/semantic/grammar.el b/lisp/cedet/semantic/grammar.el
index 2538026a1e3..8f5d1cd3e14 100644
--- a/lisp/cedet/semantic/grammar.el
+++ b/lisp/cedet/semantic/grammar.el
@@ -573,21 +573,19 @@ Typically a DEFINE expression should look like this:
573;; X-RCS: " vcid " 573;; X-RCS: " vcid "
574 574
575;; This file is not part of GNU Emacs. 575;; This file is not part of GNU Emacs.
576;; 576
577;; This program is free software; you can redistribute it and/or 577;; This program is free software; you can redistribute it and/or
578;; modify it under the terms of the GNU General Public License as 578;; modify it under the terms of the GNU General Public License as
579;; published by the Free Software Foundation; either version 2, or (at 579;; published by the Free Software Foundation, either version 3 of
580;; your option) any later version. 580;; the License, or (at your option) any later version.
581;; 581
582;; This software is distributed in the hope that it will be useful, 582;; This software is distributed in the hope that it will be useful,
583;; but WITHOUT ANY WARRANTY; without even the implied warranty of 583;; but WITHOUT ANY WARRANTY; without even the implied warranty of
584;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 584;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
585;; General Public License for more details. 585;; General Public License for more details.
586;; 586;;
587;; You should have received a copy of the GNU General Public License 587;; You should have received a copy of the GNU General Public License
588;; along with GNU Emacs; see the file COPYING. If not, write to the 588;; along with this program. If not, see <http://www.gnu.org/licenses/>.
589;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
590;; Boston, MA 02110-1301, USA.
591 589
592;;; Commentary: 590;;; Commentary:
593;; 591;;
diff --git a/lisp/emacs-lisp/elint.el b/lisp/emacs-lisp/elint.el
index 6e0758680d5..b9aa29decd0 100644
--- a/lisp/emacs-lisp/elint.el
+++ b/lisp/emacs-lisp/elint.el
@@ -505,11 +505,10 @@ Return nil if there are no more forms, t otherwise."
505 ;; (Messes up the "Initializing elint..." message.) 505 ;; (Messes up the "Initializing elint..." message.)
506;;; (message nil) 506;;; (message nil)
507 (if lib 507 (if lib
508 (save-excursion 508 (with-current-buffer (find-file-noselect lib)
509 ;; FIXME this doesn't use a temp buffer, because it 509 ;; FIXME this doesn't use a temp buffer, because it
510 ;; stores the result in buffer-local variables so that 510 ;; stores the result in buffer-local variables so that
511 ;; it can be reused. 511 ;; it can be reused.
512 (set-buffer (find-file-noselect lib))
513 (elint-update-env) 512 (elint-update-env)
514 (setq env (elint-env-add-env env elint-buffer-env))) 513 (setq env (elint-env-add-env env elint-buffer-env)))
515 ;;; (with-temp-buffer 514 ;;; (with-temp-buffer
diff --git a/lisp/files.el b/lisp/files.el
index d6783f82fbb..f0a8d72d3f0 100644
--- a/lisp/files.el
+++ b/lisp/files.el
@@ -5034,9 +5034,8 @@ This command is used in the special Dired buffer created by
5034 (dired-unmark 1) 5034 (dired-unmark 1)
5035 (dired-do-flagged-delete t) 5035 (dired-do-flagged-delete t)
5036 (unwind-protect 5036 (unwind-protect
5037 (save-excursion 5037 (with-current-buffer buffer
5038 ;; Read in the auto-save-list file. 5038 ;; Read in the auto-save-list file.
5039 (set-buffer buffer)
5040 (erase-buffer) 5039 (erase-buffer)
5041 (insert-file-contents file) 5040 (insert-file-contents file)
5042 ;; Loop thru the text of that file 5041 ;; Loop thru the text of that file
diff --git a/lisp/info.el b/lisp/info.el
index 93001496b5c..a1ce05d6292 100644
--- a/lisp/info.el
+++ b/lisp/info.el
@@ -3062,7 +3062,9 @@ Give an empty topic name to go to the Index node itself."
3062 num (1- num))) 3062 num (1- num)))
3063 (Info-goto-node (nth 1 (car Info-index-alternatives))) 3063 (Info-goto-node (nth 1 (car Info-index-alternatives)))
3064 (if (> (nth 3 (car Info-index-alternatives)) 0) 3064 (if (> (nth 3 (car Info-index-alternatives)) 0)
3065 (forward-line (1- (nth 3 (car Info-index-alternatives)))) 3065 ;; Forward 2 lines less because `Info-find-node-2' initially
3066 ;; puts point to the 2nd line.
3067 (forward-line (- (nth 3 (car Info-index-alternatives)) 2))
3066 (forward-line 3) ; don't search in headers 3068 (forward-line 3) ; don't search in headers
3067 (let ((name (car (car Info-index-alternatives)))) 3069 (let ((name (car (car Info-index-alternatives))))
3068 (Info-find-index-name name))) 3070 (Info-find-index-name name)))
diff --git a/lisp/international/characters.el b/lisp/international/characters.el
index fb7c573ceac..cf43bb1e6ca 100644
--- a/lisp/international/characters.el
+++ b/lisp/international/characters.el
@@ -1124,7 +1124,7 @@ Setup char-width-table appropriate for non-CJK language environment."
1124 (#x0E00 #x0E5F thai) 1124 (#x0E00 #x0E5F thai)
1125 (#x0E80 #x0EDF lao) 1125 (#x0E80 #x0EDF lao)
1126 (#x0F00 #x0FFF tibetan) 1126 (#x0F00 #x0FFF tibetan)
1127 (#x1000 #x109F myanmar) 1127 (#x1000 #x109F burmese)
1128 (#x10A0 #x10FF georgian) 1128 (#x10A0 #x10FF georgian)
1129 (#x1100 #x11FF hangul) 1129 (#x1100 #x11FF hangul)
1130 (#x1200 #x139F ethiopic) 1130 (#x1200 #x139F ethiopic)
@@ -1151,7 +1151,7 @@ Setup char-width-table appropriate for non-CJK language environment."
1151 (#x3400 #x9FAF han) 1151 (#x3400 #x9FAF han)
1152 (#xA000 #xA4CF yi) 1152 (#xA000 #xA4CF yi)
1153 (#xAA00 #xAA5F cham) 1153 (#xAA00 #xAA5F cham)
1154 (#xAA60 #xAA7B myanmar) 1154 (#xAA60 #xAA7B burmese)
1155 (#xAA80 #xAADF tai-viet) 1155 (#xAA80 #xAADF tai-viet)
1156 (#xAC00 #xD7AF hangul) 1156 (#xAC00 #xD7AF hangul)
1157 (#xF900 #xFAFF han) 1157 (#xF900 #xFAFF han)
diff --git a/lisp/international/fontset.el b/lisp/international/fontset.el
index 767cff850f6..ecb2088de89 100644
--- a/lisp/international/fontset.el
+++ b/lisp/international/fontset.el
@@ -169,7 +169,7 @@
169 (thai #xE17) 169 (thai #xE17)
170 (lao #xEA5) 170 (lao #xEA5)
171 (tibetan #xF40) 171 (tibetan #xF40)
172 (myanmar #x1000) 172 (burmese #x1000)
173 (georgian #x10D3) 173 (georgian #x10D3)
174 (ethiopic #x1208) 174 (ethiopic #x1208)
175 (cherokee #x13B6) 175 (cherokee #x13B6)
@@ -260,7 +260,7 @@
260 (math . mathematical) 260 (math . mathematical)
261 (mong . mongolian) 261 (mong . mongolian)
262 (musc . musical-symbol) 262 (musc . musical-symbol)
263 (mymr . myanmar) 263 (mymr . burmese)
264 (nko\ . nko) 264 (nko\ . nko)
265 (ogam . ogham) 265 (ogam . ogham)
266 (ital . old_italic) 266 (ital . old_italic)
@@ -415,8 +415,8 @@
415 (sinhala ,(font-spec :registry "iso10646-1" :otf '(sinh nil (akhn)))) 415 (sinhala ,(font-spec :registry "iso10646-1" :otf '(sinh nil (akhn))))
416 (malayalam ,(font-spec :registry "iso10646-1" :otf '(mlym nil (akhn)))) 416 (malayalam ,(font-spec :registry "iso10646-1" :otf '(mlym nil (akhn))))
417 417
418 (myanmar ,(font-spec :registry "iso10646-1" :otf '(mymr)) 418 (burmese ,(font-spec :registry "iso10646-1" :otf '(mymr nil nil))
419 ,(font-spec :registry "iso10646-1" :script 'myanmar)) 419 ,(font-spec :registry "iso10646-1" :script 'burmese))
420 420
421 (lao ,(font-spec :registry "iso10646-1" :otf '(lao\ nil nil (mark))) 421 (lao ,(font-spec :registry "iso10646-1" :otf '(lao\ nil nil (mark)))
422 ,(font-spec :registry "iso10646-1" :script 'lao) 422 ,(font-spec :registry "iso10646-1" :script 'lao)
diff --git a/lisp/language/burmese.el b/lisp/language/burmese.el
index 554cd7a482c..a53320b5430 100644
--- a/lisp/language/burmese.el
+++ b/lisp/language/burmese.el
@@ -36,7 +36,7 @@
36 (sample-text . "Burmese (မ္ရန္‌မာ) မင္‍ဂလာပာ") 36 (sample-text . "Burmese (မ္ရန္‌မာ) မင္‍ဂလာပာ")
37 (documentation . t))) 37 (documentation . t)))
38 38
39(defvar myanmar-composable-pattern 39(defvar burmese-composable-pattern
40 (let ((table 40 (let ((table
41 '(("K" . "[\u1004\u105A]\u103A\u1039") ; KINZI sequence 41 '(("K" . "[\u1004\u105A]\u103A\u1039") ; KINZI sequence
42 ("C" . "[\u1000-\u102A\u103F\u1041-\u1049\u104E\u105A-\u105D\u1061\u1065-\u1066\u106E\u1071\u1075\u1081\u108E\uAA60-\uAA6F\uAA71-\uAA76]") ; consonant and vowel letter 42 ("C" . "[\u1000-\u102A\u103F\u1041-\u1049\u104E\u105A-\u105D\u1061\u1065-\u1066\u106E\u1071\u1075\u1081\u108E\uAA60-\uAA6F\uAA71-\uAA76]") ; consonant and vowel letter
@@ -52,7 +52,7 @@
52 regexp t t)))) 52 regexp t t))))
53 regexp)) 53 regexp))
54 54
55(let ((elt (list (vector myanmar-composable-pattern 0 'font-shape-gstring) 55(let ((elt (list (vector burmese-composable-pattern 0 'font-shape-gstring)
56 (vector "." 0 'font-shape-gstring)))) 56 (vector "." 0 'font-shape-gstring))))
57 (set-char-table-range composition-function-table '(#x1000 . #x107F) elt) 57 (set-char-table-range composition-function-table '(#x1000 . #x107F) elt)
58 (set-char-table-range composition-function-table '(#xAA60 . #xAA7B) elt)) 58 (set-char-table-range composition-function-table '(#xAA60 . #xAA7B) elt))
diff --git a/lisp/macros.el b/lisp/macros.el
index 4188a432fe5..fa45d8c6108 100644
--- a/lisp/macros.el
+++ b/lisp/macros.el
@@ -138,7 +138,8 @@ use this command, and then save the file."
138 (prin1 definition (current-buffer)))) 138 (prin1 definition (current-buffer))))
139 (insert ")\n") 139 (insert ")\n")
140 (if keys 140 (if keys
141 (let ((keys (where-is-internal macroname '(keymap)))) 141 (let ((keys (where-is-internal (symbol-function macroname)
142 '(keymap))))
142 (while keys 143 (while keys
143 (insert "(global-set-key ") 144 (insert "(global-set-key ")
144 (prin1 (car keys) (current-buffer)) 145 (prin1 (car keys) (current-buffer))
diff --git a/lisp/man.el b/lisp/man.el
index d64846a2d4d..8eb5f73e245 100644
--- a/lisp/man.el
+++ b/lisp/man.el
@@ -283,7 +283,8 @@ This regular expression should start with a `^' character.")
283 "Regular expression for SYNOPSIS heading (or your equivalent). 283 "Regular expression for SYNOPSIS heading (or your equivalent).
284This regexp should not start with a `^' character.") 284This regexp should not start with a `^' character.")
285 285
286(defvar Man-files-regexp "FILES" 286(defvar Man-files-regexp "FILES\\>"
287 ;; Add \> so as not to match mount(8)'s FILESYSTEM INDEPENDENT MOUNT OPTIONS.
287 "Regular expression for FILES heading (or your equivalent). 288 "Regular expression for FILES heading (or your equivalent).
288This regexp should not start with a `^' character.") 289This regexp should not start with a `^' character.")
289 290
diff --git a/lisp/menu-bar.el b/lisp/menu-bar.el
index d740cfce90f..d831744f311 100644
--- a/lisp/menu-bar.el
+++ b/lisp/menu-bar.el
@@ -1500,7 +1500,7 @@ key, a click, or a menu-item")))
1500(define-key menu-bar-manuals-menu [emacs-lisp-reference] 1500(define-key menu-bar-manuals-menu [emacs-lisp-reference]
1501 `(menu-item ,(purecopy "Emacs Lisp Reference") menu-bar-read-lispref 1501 `(menu-item ,(purecopy "Emacs Lisp Reference") menu-bar-read-lispref
1502 :help ,(purecopy "Read the Emacs Lisp Reference manual"))) 1502 :help ,(purecopy "Read the Emacs Lisp Reference manual")))
1503(define-key menu-bar-manuals-menu [emac-lisp-intro] 1503(define-key menu-bar-manuals-menu [emacs-lisp-intro]
1504 `(menu-item ,(purecopy "Introduction to Emacs Lisp") menu-bar-read-lispintro 1504 `(menu-item ,(purecopy "Introduction to Emacs Lisp") menu-bar-read-lispintro
1505 :help ,(purecopy "Read the Introduction to Emacs Lisp Programming"))) 1505 :help ,(purecopy "Read the Introduction to Emacs Lisp Programming")))
1506 1506
diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el
index d905b9df870..54d155cd510 100644
--- a/lisp/minibuffer.el
+++ b/lisp/minibuffer.el
@@ -59,6 +59,8 @@
59 59
60;; - extend `boundaries' to provide various other meta-data about the 60;; - extend `boundaries' to provide various other meta-data about the
61;; output of `all-completions': 61;; output of `all-completions':
62;; - preferred sorting order when displayed in *Completions*.
63;; - annotations/text-properties to add when displayed in *Completions*.
62;; - quoting/unquoting (so we can complete files names with envvars 64;; - quoting/unquoting (so we can complete files names with envvars
63;; and backslashes, and all-completion can list names without 65;; and backslashes, and all-completion can list names without
64;; quoting backslashes and dollars). 66;; quoting backslashes and dollars).
@@ -444,6 +446,17 @@ in the last `cdr'."
444 (if completions 2 0) 446 (if completions 2 0)
445 (if exact 1 0))) 447 (if exact 1 0)))
446 448
449(defun completion--replace (beg end newtext)
450 "Replace the buffer text between BEG and END with NEWTEXT.
451Moves point to the end of the new text."
452 ;; This should be in subr.el.
453 ;; You'd think this is trivial to do, but details matter if you want
454 ;; to keep markers "at the right place" and be robust in the face of
455 ;; after-change-functions that may themselves modify the buffer.
456 (goto-char beg)
457 (insert newtext)
458 (delete-region (point) (+ (point) (- end beg))))
459
447(defun completion--do-completion (&optional try-completion-function) 460(defun completion--do-completion (&optional try-completion-function)
448 "Do the completion and return a summary of what happened. 461 "Do the completion and return a summary of what happened.
449M = completion was performed, the text was Modified. 462M = completion was performed, the text was Modified.
@@ -486,14 +499,12 @@ E = after completion we now have an Exact match.
486 string nil nil t)))) 499 string nil nil t))))
487 (unchanged (eq t (compare-strings completion nil nil 500 (unchanged (eq t (compare-strings completion nil nil
488 string nil nil nil)))) 501 string nil nil nil))))
489 (unless unchanged 502 (if unchanged
490
491 ;; Insert in minibuffer the chars we got.
492 (goto-char end) 503 (goto-char end)
493 (insert completion) 504 ;; Insert in minibuffer the chars we got.
494 (delete-region beg end)) 505 (completion--replace beg end completion))
495 ;; Move point. 506 ;; Move point to its completion-mandated destination.
496 (goto-char (+ beg comp-pos)) 507 (forward-char (- comp-pos (length completion)))
497 508
498 (if (not (or unchanged completed)) 509 (if (not (or unchanged completed))
499 ;; The case of the string changed, but that's all. We're not sure 510 ;; The case of the string changed, but that's all. We're not sure
@@ -1813,7 +1824,6 @@ PATTERN is as returned by `completion-pcm--string->pattern'."
1813 (when completions 1824 (when completions
1814 (let* ((re (completion-pcm--pattern->regex pattern '(point))) 1825 (let* ((re (completion-pcm--pattern->regex pattern '(point)))
1815 (case-fold-search completion-ignore-case)) 1826 (case-fold-search completion-ignore-case))
1816 ;; Remove base-size during mapcar, and add it back later.
1817 (mapcar 1827 (mapcar
1818 (lambda (str) 1828 (lambda (str)
1819 ;; Don't modify the string itself. 1829 ;; Don't modify the string itself.
diff --git a/lisp/net/dbus.el b/lisp/net/dbus.el
index 146cff0544e..5635640cd4c 100644
--- a/lisp/net/dbus.el
+++ b/lisp/net/dbus.el
@@ -573,7 +573,8 @@ the introspection data, is a string in XML format."
573 ;; is used, because the handler can be registered in our Emacs 573 ;; is used, because the handler can be registered in our Emacs
574 ;; instance; caller an callee would block each other. 574 ;; instance; caller an callee would block each other.
575 (dbus-ignore-errors 575 (dbus-ignore-errors
576 (dbus-call-method-non-blocking 576 (funcall
577 (if noninteractive 'dbus-call-method 'dbus-call-method-non-blocking)
577 bus service path dbus-interface-introspectable "Introspect"))) 578 bus service path dbus-interface-introspectable "Introspect")))
578 579
579(defun dbus-introspect-xml (bus service path) 580(defun dbus-introspect-xml (bus service path)
@@ -831,7 +832,8 @@ valid D-Bus value, or `nil' if there is no PROPERTY."
831 (dbus-ignore-errors 832 (dbus-ignore-errors
832 ;; "Get" returns a variant, so we must use the `car'. 833 ;; "Get" returns a variant, so we must use the `car'.
833 (car 834 (car
834 (dbus-call-method-non-blocking 835 (funcall
836 (if noninteractive 'dbus-call-method 'dbus-call-method-non-blocking)
835 bus service path dbus-interface-properties 837 bus service path dbus-interface-properties
836 "Get" :timeout 500 interface property)))) 838 "Get" :timeout 500 interface property))))
837 839
@@ -842,7 +844,8 @@ been set successful, the result is VALUE. Otherwise, `nil' is
842returned." 844returned."
843 (dbus-ignore-errors 845 (dbus-ignore-errors
844 ;; "Set" requires a variant. 846 ;; "Set" requires a variant.
845 (dbus-call-method-non-blocking 847 (funcall
848 (if noninteractive 'dbus-call-method 'dbus-call-method-non-blocking)
846 bus service path dbus-interface-properties 849 bus service path dbus-interface-properties
847 "Set" :timeout 500 interface property (list :variant value)) 850 "Set" :timeout 500 interface property (list :variant value))
848 ;; Return VALUE. 851 ;; Return VALUE.
@@ -857,7 +860,10 @@ name of the property, and its value. If there are no properties,
857 ;; "GetAll" returns "a{sv}". 860 ;; "GetAll" returns "a{sv}".
858 (let (result) 861 (let (result)
859 (dolist (dict 862 (dolist (dict
860 (dbus-call-method-non-blocking 863 (funcall
864 (if noninteractive
865 'dbus-call-method
866 'dbus-call-method-non-blocking)
861 bus service path dbus-interface-properties 867 bus service path dbus-interface-properties
862 "GetAll" :timeout 500 interface) 868 "GetAll" :timeout 500 interface)
863 result) 869 result)
diff --git a/lisp/net/tramp-compat.el b/lisp/net/tramp-compat.el
index 4f930d58cdc..9bcbe21116d 100644
--- a/lisp/net/tramp-compat.el
+++ b/lisp/net/tramp-compat.el
@@ -215,7 +215,7 @@ this is the function `temp-directory'."
215;; has been introduced with Emacs 22. We try it, if it fails, we fall 215;; has been introduced with Emacs 22. We try it, if it fails, we fall
216;; back to `make-temp-name', creating the temporary file immediately 216;; back to `make-temp-name', creating the temporary file immediately
217;; in order to avoid a security hole. 217;; in order to avoid a security hole.
218(defsubst tramp-compat-make-temp-file (filename) 218(defsubst tramp-compat-make-temp-file (filename &optional dir-flag)
219 "Create a temporary file (compat function). 219 "Create a temporary file (compat function).
220Add the extension of FILENAME, if existing." 220Add the extension of FILENAME, if existing."
221 (let* (file-name-handler-alist 221 (let* (file-name-handler-alist
@@ -226,21 +226,24 @@ Add the extension of FILENAME, if existing."
226 result) 226 result)
227 (condition-case nil 227 (condition-case nil
228 (setq result 228 (setq result
229 (funcall (symbol-function 'make-temp-file) prefix nil extension)) 229 (funcall
230 (symbol-function 'make-temp-file) prefix dir-flag extension))
230 (error 231 (error
231 ;; We use our own implementation, taken from files.el. 232 ;; We use our own implementation, taken from files.el.
232 (while 233 (while
233 (condition-case () 234 (condition-case ()
234 (progn 235 (progn
235 (setq result (concat (make-temp-name prefix) extension)) 236 (setq result (concat (make-temp-name prefix) extension))
236 (write-region 237 (if dir-flag
237 "" nil result nil 'silent nil 238 (make-directory result)
238 ;; 7th parameter is MUSTBENEW in Emacs, and 239 (write-region
239 ;; CODING-SYSTEM in XEmacs. It is not a security 240 "" nil result nil 'silent nil
240 ;; hole in XEmacs if we cannot use this parameter, 241 ;; 7th parameter is MUSTBENEW in Emacs, and
241 ;; because XEmacs uses a user-specific subdirectory 242 ;; CODING-SYSTEM in XEmacs. It is not a security
242 ;; with 0700 permissions. 243 ;; hole in XEmacs if we cannot use this parameter,
243 (when (not (featurep 'xemacs)) 'excl)) 244 ;; because XEmacs uses a user-specific
245 ;; subdirectory with 0700 permissions.
246 (when (not (featurep 'xemacs)) 'excl)))
244 nil) 247 nil)
245 (file-already-exists t)) 248 (file-already-exists t))
246 ;; The file was somehow created by someone else between 249 ;; The file was somehow created by someone else between
diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el
index 102117f82e9..c029f073724 100644
--- a/lisp/net/tramp.el
+++ b/lisp/net/tramp.el
@@ -3798,13 +3798,12 @@ The method used must be an out-of-band method."
3798 3798
3799 ;; Both are Tramp files. We shall optimize it, when the 3799 ;; Both are Tramp files. We shall optimize it, when the
3800 ;; methods for filename and newname are the same. 3800 ;; methods for filename and newname are the same.
3801 (let ((tmpfile 3801 (let* ((dir-flag (file-directory-p filename))
3802 (if (file-regular-p filename) 3802 (tmpfile (tramp-compat-make-temp-file localname dir-flag)))
3803 (tramp-compat-make-temp-file localname) 3803 (if dir-flag
3804 (make-temp-name 3804 (setq tmpfile
3805 (expand-file-name 3805 (expand-file-name
3806 tramp-temp-name-prefix 3806 (file-name-nondirectory newname) tmpfile)))
3807 (tramp-compat-temporary-file-directory))))))
3808 (unwind-protect 3807 (unwind-protect
3809 (progn 3808 (progn
3810 (tramp-do-copy-or-rename-file-out-of-band 3809 (tramp-do-copy-or-rename-file-out-of-band
@@ -3813,9 +3812,10 @@ The method used must be an out-of-band method."
3813 'rename tmpfile newname keep-date)) 3812 'rename tmpfile newname keep-date))
3814 ;; Save exit. 3813 ;; Save exit.
3815 (condition-case nil 3814 (condition-case nil
3816 (if (file-regular-p tmpfile) 3815 (if dir-flag
3817 (delete-file tmpfile) 3816 (delete-directory
3818 (delete-directory tmpfile 'recursive)) 3817 (expand-file-name ".." tmpfile) 'recursive)
3818 (delete-file tmpfile))
3819 (error)))) 3819 (error))))
3820 3820
3821 ;; Expand hops. Might be necessary for gateway methods. 3821 ;; Expand hops. Might be necessary for gateway methods.
@@ -5045,11 +5045,12 @@ Returns a file name in `tramp-auto-save-directory' for autosaving this file."
5045 ;; encoding function, then that is used for encoding the 5045 ;; encoding function, then that is used for encoding the
5046 ;; contents of the tmp file. 5046 ;; contents of the tmp file.
5047 (cond 5047 (cond
5048 ;; `rename-file' handles direct copy and out-of-band methods. 5048 ;; `copy-file' handles direct copy and out-of-band methods.
5049 ((or (tramp-local-host-p v) 5049 ((or (tramp-local-host-p v)
5050 (tramp-method-out-of-band-p 5050 (tramp-method-out-of-band-p
5051 v (- (or end (point-max)) (or start (point-min))))) 5051 v (nth 7 (file-attributes tmpfile))))
5052 (if (and (= (or end (point-max)) (point-max)) 5052 (if (and (not (stringp start))
5053 (= (or end (point-max)) (point-max))
5053 (= (or start (point-min)) (point-min)) 5054 (= (or start (point-min)) (point-min))
5054 (tramp-get-method-parameter 5055 (tramp-get-method-parameter
5055 method 'tramp-copy-keep-tmpfile)) 5056 method 'tramp-copy-keep-tmpfile))
diff --git a/lisp/progmodes/cc-engine.el b/lisp/progmodes/cc-engine.el
index 336e2c39262..f4a8c0bf46f 100644
--- a/lisp/progmodes/cc-engine.el
+++ b/lisp/progmodes/cc-engine.el
@@ -2591,7 +2591,7 @@ comment at the start of cc-engine.el for more info."
2591 (save-restriction 2591 (save-restriction
2592 (narrow-to-region 1 (point-max)) 2592 (narrow-to-region 1 (point-max))
2593 (save-excursion 2593 (save-excursion
2594 (let* ((in-macro-start ; point-max or beginning of macro containing it 2594 (let* ((in-macro-start ; start of macro containing (point-max) or nil.
2595 (save-excursion 2595 (save-excursion
2596 (goto-char (point-max)) 2596 (goto-char (point-max))
2597 (and (c-beginning-of-macro) 2597 (and (c-beginning-of-macro)
@@ -2641,7 +2641,9 @@ comment at the start of cc-engine.el for more info."
2641 ;; (car c-state-cache). There can be no open parens/braces/brackets 2641 ;; (car c-state-cache). There can be no open parens/braces/brackets
2642 ;; between `good-pos'/`good-pos-actual-macro-start' and (point-max), 2642 ;; between `good-pos'/`good-pos-actual-macro-start' and (point-max),
2643 ;; due to the interface spec to this function. 2643 ;; due to the interface spec to this function.
2644 (setq pos (if good-pos-actual-macro-end 2644 (setq pos (if (and good-pos-actual-macro-end
2645 (not (eq good-pos-actual-macro-start
2646 in-macro-start)))
2645 (1+ good-pos-actual-macro-end) ; get outside the macro as 2647 (1+ good-pos-actual-macro-end) ; get outside the macro as
2646 ; marked by a `category' text property. 2648 ; marked by a `category' text property.
2647 good-pos)) 2649 good-pos))
diff --git a/lisp/progmodes/sh-script.el b/lisp/progmodes/sh-script.el
index ca0971bf675..610fa14489a 100644
--- a/lisp/progmodes/sh-script.el
+++ b/lisp/progmodes/sh-script.el
@@ -1186,7 +1186,7 @@ subshells can nest."
1186 "Variables controlling indentation in shell scripts. 1186 "Variables controlling indentation in shell scripts.
1187 1187
1188Note: customizing these variables will not affect existing buffers if 1188Note: customizing these variables will not affect existing buffers if
1189`sh-make-vars-local' is no-nil. See the documentation for 1189`sh-make-vars-local' is non-nil. See the documentation for
1190variable `sh-make-vars-local', command `sh-make-vars-local' 1190variable `sh-make-vars-local', command `sh-make-vars-local'
1191and command `sh-reset-indent-vars-to-global-values'." 1191and command `sh-reset-indent-vars-to-global-values'."
1192 :group 'sh-script) 1192 :group 'sh-script)
diff --git a/lisp/scroll-bar.el b/lisp/scroll-bar.el
index c28a417a8f3..3f763fc59da 100644
--- a/lisp/scroll-bar.el
+++ b/lisp/scroll-bar.el
@@ -210,13 +210,14 @@ EVENT should be a scroll bar click or drag event."
210 (let* ((start-position (event-start event)) 210 (let* ((start-position (event-start event))
211 (window (nth 0 start-position)) 211 (window (nth 0 start-position))
212 (portion-whole (nth 2 start-position))) 212 (portion-whole (nth 2 start-position)))
213 (with-current-buffer (window-buffer window) 213 (save-excursion
214 ;; Calculate position relative to the accessible part of the buffer. 214 (with-current-buffer (window-buffer window)
215 (goto-char (+ (point-min) 215 ;; Calculate position relative to the accessible part of the buffer.
216 (scroll-bar-scale portion-whole 216 (goto-char (+ (point-min)
217 (- (point-max) (point-min))))) 217 (scroll-bar-scale portion-whole
218 (vertical-motion 0 window) 218 (- (point-max) (point-min)))))
219 (set-window-start window (point))))) 219 (vertical-motion 0 window)
220 (set-window-start window (point))))))
220 221
221(defun scroll-bar-drag (event) 222(defun scroll-bar-drag (event)
222 "Scroll the window by dragging the scroll bar slider. 223 "Scroll the window by dragging the scroll bar slider.
diff --git a/lisp/subr.el b/lisp/subr.el
index 977d5a53f35..be06a558e5a 100644
--- a/lisp/subr.el
+++ b/lisp/subr.el
@@ -2196,15 +2196,15 @@ Display MESSAGE (optional fourth arg) in the echo area.
2196If MESSAGE is nil, instructions to type EXIT-CHAR are displayed there." 2196If MESSAGE is nil, instructions to type EXIT-CHAR are displayed there."
2197 (or exit-char (setq exit-char ?\s)) 2197 (or exit-char (setq exit-char ?\s))
2198 (let ((ol (make-overlay pos pos)) 2198 (let ((ol (make-overlay pos pos))
2199 (message (copy-sequence string))) 2199 (str (copy-sequence string)))
2200 (unwind-protect 2200 (unwind-protect
2201 (progn 2201 (progn
2202 (save-excursion 2202 (save-excursion
2203 (overlay-put ol 'after-string message) 2203 (overlay-put ol 'after-string str)
2204 (goto-char pos) 2204 (goto-char pos)
2205 ;; To avoid trouble with out-of-bounds position 2205 ;; To avoid trouble with out-of-bounds position
2206 (setq pos (point)) 2206 (setq pos (point))
2207 ;; If the message end is off screen, recenter now. 2207 ;; If the string end is off screen, recenter now.
2208 (if (<= (window-end nil t) pos) 2208 (if (<= (window-end nil t) pos)
2209 (recenter (/ (window-height) 2)))) 2209 (recenter (/ (window-height) 2))))
2210 (message (or message "Type %s to continue editing.") 2210 (message (or message "Type %s to continue editing.")
diff --git a/lisp/textmodes/reftex-toc.el b/lisp/textmodes/reftex-toc.el
index 1066066462d..ae1690416b9 100644
--- a/lisp/textmodes/reftex-toc.el
+++ b/lisp/textmodes/reftex-toc.el
@@ -665,9 +665,8 @@ promotion/demotion later."
665 (if (and (markerp marker) (marker-buffer marker)) 665 (if (and (markerp marker) (marker-buffer marker))
666 ;; Buffer is still live and we have the marker. 666 ;; Buffer is still live and we have the marker.
667 (progn 667 (progn
668 (save-excursion 668 (with-current-buffer (marker-buffer marker)
669 ;; Goto the buffer and check of section is unchanged 669 ;; Goto the buffer and check of section is unchanged
670 (set-buffer (marker-buffer marker))
671 (goto-char (marker-position marker)) 670 (goto-char (marker-position marker))
672 (if (looking-at (regexp-quote literal)) 671 (if (looking-at (regexp-quote literal))
673 ;; OK, get the makro name 672 ;; OK, get the makro name
diff --git a/lisp/vc-git.el b/lisp/vc-git.el
index 0d8e6307d6e..d645a4c05ba 100644
--- a/lisp/vc-git.el
+++ b/lisp/vc-git.el
@@ -69,8 +69,8 @@
69;; * revert (file &optional contents-done) OK 69;; * revert (file &optional contents-done) OK
70;; - rollback (files) COULD BE SUPPORTED 70;; - rollback (files) COULD BE SUPPORTED
71;; - merge (file rev1 rev2) It would be possible to merge 71;; - merge (file rev1 rev2) It would be possible to merge
72;; changes into a single file, but when 72;; changes into a single file, but
73;; committing they wouldn't 73;; when committing they wouldn't
74;; be identified as a merge 74;; be identified as a merge
75;; by git, so it's probably 75;; by git, so it's probably
76;; not a good idea. 76;; not a good idea.
@@ -130,7 +130,7 @@ If nil, use the value of `vc-diff-switches'. If t, use no switches."
130 130
131;;;###autoload (defun vc-git-registered (file) 131;;;###autoload (defun vc-git-registered (file)
132;;;###autoload "Return non-nil if FILE is registered with git." 132;;;###autoload "Return non-nil if FILE is registered with git."
133;;;###autoload (if (vc-find-root file ".git") ; short cut 133;;;###autoload (if (vc-find-root file ".git") ; Short cut.
134;;;###autoload (progn 134;;;###autoload (progn
135;;;###autoload (load "vc-git") 135;;;###autoload (load "vc-git")
136;;;###autoload (vc-git-registered file)))) 136;;;###autoload (vc-git-registered file))))
@@ -149,9 +149,11 @@ If nil, use the value of `vc-diff-switches'. If t, use no switches."
149 (str (ignore-errors 149 (str (ignore-errors
150 (cd dir) 150 (cd dir)
151 (vc-git--out-ok "ls-files" "-c" "-z" "--" name) 151 (vc-git--out-ok "ls-files" "-c" "-z" "--" name)
152 ;; if result is empty, use ls-tree to check for deleted file 152 ;; If result is empty, use ls-tree to check for deleted
153 ;; file.
153 (when (eq (point-min) (point-max)) 154 (when (eq (point-min) (point-max))
154 (vc-git--out-ok "ls-tree" "--name-only" "-z" "HEAD" "--" name)) 155 (vc-git--out-ok "ls-tree" "--name-only" "-z" "HEAD"
156 "--" name))
155 (buffer-string)))) 157 (buffer-string))))
156 (and str 158 (and str
157 (> (length str) (length name)) 159 (> (length str) (length name))
@@ -173,7 +175,8 @@ If nil, use the value of `vc-diff-switches'. If t, use no switches."
173 (if (not (vc-git-registered file)) 175 (if (not (vc-git-registered file))
174 'unregistered 176 'unregistered
175 (vc-git--call nil "add" "--refresh" "--" (file-relative-name file)) 177 (vc-git--call nil "add" "--refresh" "--" (file-relative-name file))
176 (let ((diff (vc-git--run-command-string file "diff-index" "-z" "HEAD" "--"))) 178 (let ((diff (vc-git--run-command-string
179 file "diff-index" "-z" "HEAD" "--")))
177 (if (and diff (string-match ":[0-7]\\{6\\} [0-7]\\{6\\} [0-9a-f]\\{40\\} [0-9a-f]\\{40\\} \\([ADMUT]\\)\0[^\0]+\0" 180 (if (and diff (string-match ":[0-7]\\{6\\} [0-7]\\{6\\} [0-9a-f]\\{40\\} [0-9a-f]\\{40\\} \\([ADMUT]\\)\0[^\0]+\0"
178 diff)) 181 diff))
179 (vc-git--state-code (match-string 1 diff)) 182 (vc-git--state-code (match-string 1 diff))
@@ -206,11 +209,12 @@ If nil, use the value of `vc-diff-switches'. If t, use no switches."
206 209
207(defstruct (vc-git-extra-fileinfo 210(defstruct (vc-git-extra-fileinfo
208 (:copier nil) 211 (:copier nil)
209 (:constructor vc-git-create-extra-fileinfo (old-perm new-perm &optional rename-state orig-name)) 212 (:constructor vc-git-create-extra-fileinfo
213 (old-perm new-perm &optional rename-state orig-name))
210 (:conc-name vc-git-extra-fileinfo->)) 214 (:conc-name vc-git-extra-fileinfo->))
211 old-perm new-perm ;; permission flags 215 old-perm new-perm ;; Permission flags.
212 rename-state ;; rename or copy state 216 rename-state ;; Rename or copy state.
213 orig-name) ;; original name for renames or copies 217 orig-name) ;; Original name for renames or copies.
214 218
215(defun vc-git-escape-file-name (name) 219(defun vc-git-escape-file-name (name)
216 "Escape a file name if necessary." 220 "Escape a file name if necessary."
@@ -232,23 +236,23 @@ If nil, use the value of `vc-diff-switches'. If t, use no switches."
232 (let* ((old-type (lsh (or old-perm 0) -9)) 236 (let* ((old-type (lsh (or old-perm 0) -9))
233 (new-type (lsh (or new-perm 0) -9)) 237 (new-type (lsh (or new-perm 0) -9))
234 (str (case new-type 238 (str (case new-type
235 (?\100 ;; file 239 (?\100 ;; File.
236 (case old-type 240 (case old-type
237 (?\100 nil) 241 (?\100 nil)
238 (?\120 " (type change symlink -> file)") 242 (?\120 " (type change symlink -> file)")
239 (?\160 " (type change subproject -> file)"))) 243 (?\160 " (type change subproject -> file)")))
240 (?\120 ;; symlink 244 (?\120 ;; Symlink.
241 (case old-type 245 (case old-type
242 (?\100 " (type change file -> symlink)") 246 (?\100 " (type change file -> symlink)")
243 (?\160 " (type change subproject -> symlink)") 247 (?\160 " (type change subproject -> symlink)")
244 (t " (symlink)"))) 248 (t " (symlink)")))
245 (?\160 ;; subproject 249 (?\160 ;; Subproject.
246 (case old-type 250 (case old-type
247 (?\100 " (type change file -> subproject)") 251 (?\100 " (type change file -> subproject)")
248 (?\120 " (type change symlink -> subproject)") 252 (?\120 " (type change symlink -> subproject)")
249 (t " (subproject)"))) 253 (t " (subproject)")))
250 (?\110 nil) ;; directory (internal, not a real git state) 254 (?\110 nil) ;; Directory (internal, not a real git state).
251 (?\000 ;; deleted or unknown 255 (?\000 ;; Deleted or unknown.
252 (case old-type 256 (case old-type
253 (?\120 " (symlink)") 257 (?\120 " (symlink)")
254 (?\160 " (subproject)"))) 258 (?\160 " (subproject)")))
@@ -258,7 +262,8 @@ If nil, use the value of `vc-diff-switches'. If t, use no switches."
258 (t "")))) 262 (t ""))))
259 263
260(defun vc-git-rename-as-string (state extra) 264(defun vc-git-rename-as-string (state extra)
261 "Return a string describing the copy or rename associated with INFO, or an empty string if none." 265 "Return a string describing the copy or rename associated with INFO,
266or an empty string if none."
262 (let ((rename-state (when extra 267 (let ((rename-state (when extra
263 (vc-git-extra-fileinfo->rename-state extra)))) 268 (vc-git-extra-fileinfo->rename-state extra))))
264 (if rename-state 269 (if rename-state
@@ -267,8 +272,10 @@ If nil, use the value of `vc-diff-switches'. If t, use no switches."
267 (if (eq rename-state 'copy) "copied from " 272 (if (eq rename-state 'copy) "copied from "
268 (if (eq state 'added) "renamed from " 273 (if (eq state 'added) "renamed from "
269 "renamed to ")) 274 "renamed to "))
270 (vc-git-escape-file-name (vc-git-extra-fileinfo->orig-name extra)) 275 (vc-git-escape-file-name
271 ")") 'face 'font-lock-comment-face) 276 (vc-git-extra-fileinfo->orig-name extra))
277 ")")
278 'face 'font-lock-comment-face)
272 ""))) 279 "")))
273 280
274(defun vc-git-permissions-as-string (old-perm new-perm) 281(defun vc-git-permissions-as-string (old-perm new-perm)
@@ -302,7 +309,8 @@ If nil, use the value of `vc-diff-switches'. If t, use no switches."
302 " " (vc-git-permissions-as-string old-perm new-perm) 309 " " (vc-git-permissions-as-string old-perm new-perm)
303 " " 310 " "
304 (propertize (vc-git-escape-file-name (vc-dir-fileinfo->name info)) 311 (propertize (vc-git-escape-file-name (vc-dir-fileinfo->name info))
305 'face (if isdir 'font-lock-comment-delimiter-face 'font-lock-function-name-face) 312 'face (if isdir 'font-lock-comment-delimiter-face
313 'font-lock-function-name-face)
306 'help-echo 314 'help-echo
307 (if isdir 315 (if isdir
308 "Directory\nVC operations can be applied to it\nmouse-3: Pop-up menu" 316 "Directory\nVC operations can be applied to it\nmouse-3: Pop-up menu"
@@ -314,32 +322,39 @@ If nil, use the value of `vc-diff-switches'. If t, use no switches."
314 322
315(defun vc-git-after-dir-status-stage (stage files update-function) 323(defun vc-git-after-dir-status-stage (stage files update-function)
316 "Process sentinel for the various dir-status stages." 324 "Process sentinel for the various dir-status stages."
317 (let (remaining next-stage result) 325 (let (next-stage result)
318 (goto-char (point-min)) 326 (goto-char (point-min))
319 (case stage 327 (case stage
320 ('update-index 328 (update-index
321 (setq next-stage (if (vc-git--empty-db-p) 'ls-files-added 329 (setq next-stage (if (vc-git--empty-db-p) 'ls-files-added
322 (if files 'ls-files-up-to-date 'diff-index)))) 330 (if files 'ls-files-up-to-date 'diff-index))))
323 ('ls-files-added 331 (ls-files-added
324 (setq next-stage 'ls-files-unknown) 332 (setq next-stage 'ls-files-unknown)
325 (while (re-search-forward "\\([0-7]\\{6\\}\\) [0-9a-f]\\{40\\} 0\t\\([^\0]+\\)\0" nil t) 333 (while (re-search-forward "\\([0-7]\\{6\\}\\) [0-9a-f]\\{40\\} 0\t\\([^\0]+\\)\0" nil t)
326 (let ((new-perm (string-to-number (match-string 1) 8)) 334 (let ((new-perm (string-to-number (match-string 1) 8))
327 (name (match-string 2))) 335 (name (match-string 2)))
328 (push (list name 'added (vc-git-create-extra-fileinfo 0 new-perm)) result)))) 336 (push (list name 'added (vc-git-create-extra-fileinfo 0 new-perm))
329 ('ls-files-up-to-date 337 result))))
338 (ls-files-up-to-date
330 (setq next-stage 'diff-index) 339 (setq next-stage 'diff-index)
331 (while (re-search-forward "\\([0-7]\\{6\\}\\) [0-9a-f]\\{40\\} 0\t\\([^\0]+\\)\0" nil t) 340 (while (re-search-forward "\\([0-7]\\{6\\}\\) [0-9a-f]\\{40\\} 0\t\\([^\0]+\\)\0" nil t)
332 (let ((perm (string-to-number (match-string 1) 8)) 341 (let ((perm (string-to-number (match-string 1) 8))
333 (name (match-string 2))) 342 (name (match-string 2)))
334 (push (list name 'up-to-date (vc-git-create-extra-fileinfo perm perm)) result)))) 343 (push (list name 'up-to-date
335 ('ls-files-unknown 344 (vc-git-create-extra-fileinfo perm perm))
345 result))))
346 (ls-files-unknown
336 (when files (setq next-stage 'ls-files-ignored)) 347 (when files (setq next-stage 'ls-files-ignored))
337 (while (re-search-forward "\\([^\0]*?\\)\0" nil t 1) 348 (while (re-search-forward "\\([^\0]*?\\)\0" nil t 1)
338 (push (list (match-string 1) 'unregistered (vc-git-create-extra-fileinfo 0 0)) result))) 349 (push (list (match-string 1) 'unregistered
339 ('ls-files-ignored 350 (vc-git-create-extra-fileinfo 0 0))
351 result)))
352 (ls-files-ignored
340 (while (re-search-forward "\\([^\0]*?\\)\0" nil t 1) 353 (while (re-search-forward "\\([^\0]*?\\)\0" nil t 1)
341 (push (list (match-string 1) 'ignored (vc-git-create-extra-fileinfo 0 0)) result))) 354 (push (list (match-string 1) 'ignored
342 ('diff-index 355 (vc-git-create-extra-fileinfo 0 0))
356 result)))
357 (diff-index
343 (setq next-stage 'ls-files-unknown) 358 (setq next-stage 'ls-files-unknown)
344 (while (re-search-forward 359 (while (re-search-forward
345 ":\\([0-7]\\{6\\}\\) \\([0-7]\\{6\\}\\) [0-9a-f]\\{40\\} [0-9a-f]\\{40\\} \\(\\([ADMUT]\\)\0\\([^\0]+\\)\\|\\([CR]\\)[0-9]*\0\\([^\0]+\\)\0\\([^\0]+\\)\\)\0" 360 ":\\([0-7]\\{6\\}\\) \\([0-7]\\{6\\}\\) [0-9a-f]\\{40\\} [0-9a-f]\\{40\\} \\(\\([ADMUT]\\)\0\\([^\0]+\\)\\|\\([CR]\\)[0-9]*\0\\([^\0]+\\)\0\\([^\0]+\\)\\)\0"
@@ -349,41 +364,60 @@ If nil, use the value of `vc-diff-switches'. If t, use no switches."
349 (state (or (match-string 4) (match-string 6))) 364 (state (or (match-string 4) (match-string 6)))
350 (name (or (match-string 5) (match-string 7))) 365 (name (or (match-string 5) (match-string 7)))
351 (new-name (match-string 8))) 366 (new-name (match-string 8)))
352 (if new-name ; copy or rename 367 (if new-name ; Copy or rename.
353 (if (eq ?C (string-to-char state)) 368 (if (eq ?C (string-to-char state))
354 (push (list new-name 'added (vc-git-create-extra-fileinfo old-perm new-perm 'copy name)) result) 369 (push (list new-name 'added
355 (push (list name 'removed (vc-git-create-extra-fileinfo 0 0 'rename new-name)) result) 370 (vc-git-create-extra-fileinfo old-perm new-perm
356 (push (list new-name 'added (vc-git-create-extra-fileinfo old-perm new-perm 'rename name)) result)) 371 'copy name))
357 (push (list name (vc-git--state-code state) (vc-git-create-extra-fileinfo old-perm new-perm)) result)))))) 372 result)
373 (push (list name 'removed
374 (vc-git-create-extra-fileinfo 0 0
375 'rename new-name))
376 result)
377 (push (list new-name 'added
378 (vc-git-create-extra-fileinfo old-perm new-perm
379 'rename name))
380 result))
381 (push (list name (vc-git--state-code state)
382 (vc-git-create-extra-fileinfo old-perm new-perm))
383 result))))))
358 (when result 384 (when result
359 (setq result (nreverse result)) 385 (setq result (nreverse result))
360 (when files 386 (when files
361 (dolist (entry result) (setq files (delete (car entry) files))) 387 (dolist (entry result) (setq files (delete (car entry) files)))
362 (unless files (setq next-stage nil)))) 388 (unless files (setq next-stage nil))))
363 (when (or result (not next-stage)) (funcall update-function result next-stage)) 389 (when (or result (not next-stage))
364 (when next-stage (vc-git-dir-status-goto-stage next-stage files update-function)))) 390 (funcall update-function result next-stage))
391 (when next-stage
392 (vc-git-dir-status-goto-stage next-stage files update-function))))
365 393
366(defun vc-git-dir-status-goto-stage (stage files update-function) 394(defun vc-git-dir-status-goto-stage (stage files update-function)
367 (erase-buffer) 395 (erase-buffer)
368 (case stage 396 (case stage
369 ('update-index 397 (update-index
370 (if files 398 (if files
371 (vc-git-command (current-buffer) 'async files "add" "--refresh" "--") 399 (vc-git-command (current-buffer) 'async files "add" "--refresh" "--")
372 (vc-git-command (current-buffer) 'async nil "update-index" "--refresh"))) 400 (vc-git-command (current-buffer) 'async nil
373 ('ls-files-added 401 "update-index" "--refresh")))
374 (vc-git-command (current-buffer) 'async files "ls-files" "-z" "-c" "-s" "--")) 402 (ls-files-added
375 ('ls-files-up-to-date 403 (vc-git-command (current-buffer) 'async files
376 (vc-git-command (current-buffer) 'async files "ls-files" "-z" "-c" "-s" "--")) 404 "ls-files" "-z" "-c" "-s" "--"))
377 ('ls-files-unknown 405 (ls-files-up-to-date
378 (vc-git-command (current-buffer) 'async files "ls-files" "-z" "-o" 406 (vc-git-command (current-buffer) 'async files
379 "--directory" "--no-empty-directory" "--exclude-standard" "--")) 407 "ls-files" "-z" "-c" "-s" "--"))
380 ('ls-files-ignored 408 (ls-files-unknown
381 (vc-git-command (current-buffer) 'async files "ls-files" "-z" "-o" "-i" 409 (vc-git-command (current-buffer) 'async files
382 "--directory" "--no-empty-directory" "--exclude-standard" "--")) 410 "ls-files" "-z" "-o" "--directory"
383 ('diff-index 411 "--no-empty-directory" "--exclude-standard" "--"))
384 (vc-git-command (current-buffer) 'async files "diff-index" "--relative" "-z" "-M" "HEAD" "--"))) 412 (ls-files-ignored
413 (vc-git-command (current-buffer) 'async files
414 "ls-files" "-z" "-o" "-i" "--directory"
415 "--no-empty-directory" "--exclude-standard" "--"))
416 (diff-index
417 (vc-git-command (current-buffer) 'async files
418 "diff-index" "--relative" "-z" "-M" "HEAD" "--")))
385 (vc-exec-after 419 (vc-exec-after
386 `(vc-git-after-dir-status-stage (quote ,stage) (quote ,files) (quote ,update-function)))) 420 `(vc-git-after-dir-status-stage ',stage ',files ',update-function)))
387 421
388(defun vc-git-dir-status (dir update-function) 422(defun vc-git-dir-status (dir update-function)
389 "Return a list of (FILE STATE EXTRA) entries for DIR." 423 "Return a list of (FILE STATE EXTRA) entries for DIR."
@@ -439,14 +473,16 @@ If nil, use the value of `vc-diff-switches'. If t, use no switches."
439 (setq remote 473 (setq remote
440 (with-output-to-string 474 (with-output-to-string
441 (with-current-buffer standard-output 475 (with-current-buffer standard-output
442 (vc-git--out-ok "config" (concat "branch." branch ".remote"))))) 476 (vc-git--out-ok "config"
477 (concat "branch." branch ".remote")))))
443 (when (string-match "\\([^\n]+\\)" remote) 478 (when (string-match "\\([^\n]+\\)" remote)
444 (setq remote (match-string 1 remote))) 479 (setq remote (match-string 1 remote)))
445 (when remote 480 (when remote
446 (setq remote-url 481 (setq remote-url
447 (with-output-to-string 482 (with-output-to-string
448 (with-current-buffer standard-output 483 (with-current-buffer standard-output
449 (vc-git--out-ok "config" (concat "remote." remote ".url")))))) 484 (vc-git--out-ok "config"
485 (concat "remote." remote ".url"))))))
450 (when (string-match "\\([^\n]+\\)" remote-url) 486 (when (string-match "\\([^\n]+\\)" remote-url)
451 (setq remote-url (match-string 1 remote-url)))) 487 (setq remote-url (match-string 1 remote-url))))
452 (setq branch "not (detached HEAD)")) 488 (setq branch "not (detached HEAD)"))
@@ -550,8 +586,8 @@ If nil, use the value of `vc-diff-switches'. If t, use no switches."
550 (append 586 (append
551 '("log" "--no-color") 587 '("log" "--no-color")
552 (when shortlog 588 (when shortlog
553 '("--graph" "--decorate" 589 '("--graph" "--decorate" "--date=short"
554 "--date=short" "--pretty=format:%d%h %ad %s" "--abbrev-commit")) 590 "--pretty=format:%d%h %ad %s" "--abbrev-commit"))
555 (when limit (list "-n" (format "%s" limit))) 591 (when limit (list "-n" (format "%s" limit)))
556 (when start-revision (list start-revision)) 592 (when start-revision (list start-revision))
557 '("--"))))))) 593 '("--")))))))
@@ -565,7 +601,7 @@ If nil, use the value of `vc-diff-switches'. If t, use no switches."
565(defvar vc-short-log) 601(defvar vc-short-log)
566 602
567(define-derived-mode vc-git-log-view-mode log-view-mode "Git-Log-View" 603(define-derived-mode vc-git-log-view-mode log-view-mode "Git-Log-View"
568 (require 'add-log) ;; we need the faces add-log 604 (require 'add-log) ;; We need the faces add-log.
569 ;; Don't have file markers, so use impossible regexp. 605 ;; Don't have file markers, so use impossible regexp.
570 (set (make-local-variable 'log-view-file-re) "\\`a\\`") 606 (set (make-local-variable 'log-view-file-re) "\\`a\\`")
571 (set (make-local-variable 'log-view-per-file-logs) nil) 607 (set (make-local-variable 'log-view-per-file-logs) nil)
@@ -610,17 +646,16 @@ If nil, use the value of `vc-diff-switches'. If t, use no switches."
610REVISION may have the form BRANCH, BRANCH~N, 646REVISION may have the form BRANCH, BRANCH~N,
611or BRANCH^ (where \"^\" can be repeated)." 647or BRANCH^ (where \"^\" can be repeated)."
612 (goto-char (point-min)) 648 (goto-char (point-min))
613 (let (found) 649 (prog1
614 (when revision 650 (when revision
615 (setq found 651 (search-forward
616 (search-forward (format "\ncommit %s" revision) nil t 652 (format "\ncommit %s" revision) nil t
617 (cond ((string-match "~\\([0-9]\\)$" revision) 653 (cond ((string-match "~\\([0-9]\\)\\'" revision)
618 (1+ (string-to-number (match-string 1 revision)))) 654 (1+ (string-to-number (match-string 1 revision))))
619 ((string-match "\\^+$" revision) 655 ((string-match "\\^+\\'" revision)
620 (1+ (length (match-string 0 revision)))) 656 (1+ (length (match-string 0 revision))))
621 (t nil))))) 657 (t nil))))
622 (beginning-of-line) 658 (beginning-of-line)))
623 found))
624 659
625(defun vc-git-diff (files &optional rev1 rev2 buffer) 660(defun vc-git-diff (files &optional rev1 rev2 buffer)
626 "Get a difference report using Git between two revisions of FILES." 661 "Get a difference report using Git between two revisions of FILES."
@@ -948,7 +983,8 @@ Returns nil if not possible."
948 (goto-char (point-min)) 983 (goto-char (point-min))
949 (= (forward-line 2) 1) 984 (= (forward-line 2) 1)
950 (bolp) 985 (bolp)
951 (buffer-substring-no-properties (point-min) (1- (point-max))))))) 986 (buffer-substring-no-properties (point-min)
987 (1- (point-max)))))))
952 (and name (not (string= name "undefined")) name)))) 988 (and name (not (string= name "undefined")) name))))
953 989
954(provide 'vc-git) 990(provide 'vc-git)