aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorPaul Eggert2011-03-20 22:34:48 -0700
committerPaul Eggert2011-03-20 22:34:48 -0700
commit6e5fa6bfce1362c2ebf049fcfa1e6f2a4762ccef (patch)
treef7ff137da14c352412ee3dc3fbcaf1316428fd97 /lisp
parent81e56e612dab7d80485c640068531710a713d205 (diff)
parent77185bdf91d42fb19c02af0f51ce63280ce911a0 (diff)
downloademacs-6e5fa6bfce1362c2ebf049fcfa1e6f2a4762ccef.tar.gz
emacs-6e5fa6bfce1362c2ebf049fcfa1e6f2a4762ccef.zip
Merge from trunk and from gnulib stdio.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/ChangeLog70
-rw-r--r--lisp/avoid.el15
-rw-r--r--lisp/calc/calc-menu.el105
-rw-r--r--lisp/calendar/time-date.el8
-rw-r--r--lisp/dired-aux.el5
-rw-r--r--lisp/dired.el3
-rw-r--r--lisp/emacs-lisp/ert.el9
-rw-r--r--lisp/emacs-lisp/package.el47
-rw-r--r--lisp/facemenu.el37
-rw-r--r--lisp/gnus/ChangeLog30
-rw-r--r--lisp/gnus/gnus-art.el1
-rw-r--r--lisp/gnus/gnus-group.el28
-rw-r--r--lisp/gnus/gnus-util.el6
-rw-r--r--lisp/gnus/gravatar.el6
-rw-r--r--lisp/gnus/nnimap.el12
-rw-r--r--lisp/gnus/shr.el9
-rw-r--r--lisp/ido.el8
-rw-r--r--lisp/info.el10
-rw-r--r--lisp/startup.el15
-rw-r--r--lisp/vc/diff-mode.el21
-rw-r--r--lisp/vc/emerge.el23
21 files changed, 352 insertions, 116 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 5164207a5ce..b12445b466f 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,73 @@
12011-03-20 Jay Belanger <jay.p.belanger@gmail.com>
2
3 * calc/calc-menu.el (calc-units-menu): Add entries for logarithmic
4 units and musical notes.
5
62011-03-20 Leo <sdl.web@gmail.com>
7
8 * ido.el (ido-read-internal): Use completing-read-default.
9 (ido-completing-read): Fix compatibility with completing-read.
10
112011-03-20 Christian Ohler <ohler@gnu.org>
12
13 * emacs-lisp/ert.el (ert-run-tests-batch): Remove unused variable.
14 (ert-delete-all-tests): Use `called-interactively-p' rather than
15 `interactive-p'.
16 (ert--make-xrefs-region): Respect END.
17
182011-03-19 Chong Yidong <cyd@stupidchicken.com>
19
20 * dired-aux.el (dired-create-directory): Signal an error if the
21 directory already exists (Bug#8246).
22
23 * facemenu.el (list-colors-display): Call list-faces-display
24 inside with-help-window.
25 (list-colors-print): Use display property to align the final
26 column, instead of checking window-width.
27
282011-03-19 Eli Zaretskii <eliz@gnu.org>
29
30 * emerge.el (emerge-metachars): Separate value for ms-dos and
31 windows-nt systems.
32 (emerge-protect-metachars): Quote correctly for ms-dos and
33 windows-nt systems.
34
352011-03-19 Ralph Schleicher <rs@ralph-schleicher.de>
36
37 * info.el (info-initialize): Replace all uses of `:' with
38 path-separator for compatibility with non-Unix systems.
39 Cache quoting of path-separator. (Bug#8258)
40
412011-03-19 Juanma Barranquero <lekktu@gmail.com>
42
43 * avoid.el (mouse-avoidance-mode, mouse-avoidance-nudge-dist)
44 (mouse-avoidance-threshold, mouse-avoidance-banish-destination)
45 (mouse-avoidance-mode): Fix typos in docstrings.
46
472011-03-19 Chong Yidong <cyd@stupidchicken.com>
48
49 * startup.el (package-subdirectory-regexp): Move from package.el.
50 Omit \\` and \\', and let callers add them.
51
52 * emacs-lisp/package.el (package-strip-version)
53 (package-load-all-descriptors): Add \\` and \\' to
54 package-subdirectory-regexp before using it.
55 (package-untar-buffer): New arg DIR; ensure that file untars only
56 into this expected directory. Remove superfluous delete-region.
57 (package-unpack): Caller changed.
58 (package-tar-file-info): Use package-subdirectory-regexp.
59
602011-03-18 Stefan Monnier <monnier@iro.umontreal.ca>
61
62 * vc/diff-mode.el (diff-mode-map): Shadow problematic bindings from
63 diff-mode-shared-map (bug#8284).
64 (diff-mode-shared-map): Re-introduce some bindings that were problematic.
65
662011-03-17 Lars Magne Ingebrigtsen <larsi@gnus.org>
67
68 * calendar/time-date.el (format-seconds): Use assoc instead of
69 assoc-string, since assoc-string doesn't exist in XEmacs.
70
12011-03-17 Juanma Barranquero <lekktu@gmail.com> 712011-03-17 Juanma Barranquero <lekktu@gmail.com>
2 72
3 * custom.el (custom-known-themes): Reflow docstring. 73 * custom.el (custom-known-themes): Reflow docstring.
diff --git a/lisp/avoid.el b/lisp/avoid.el
index c864d48e9ce..038927105ec 100644
--- a/lisp/avoid.el
+++ b/lisp/avoid.el
@@ -76,7 +76,7 @@
76 76
77;;;###autoload 77;;;###autoload
78(defcustom mouse-avoidance-mode nil 78(defcustom mouse-avoidance-mode nil
79 "Activate mouse avoidance mode. 79 "Activate Mouse Avoidance mode.
80See function `mouse-avoidance-mode' for possible values. 80See function `mouse-avoidance-mode' for possible values.
81Setting this variable directly does not take effect; 81Setting this variable directly does not take effect;
82use either \\[customize] or the function `mouse-avoidance-mode'." 82use either \\[customize] or the function `mouse-avoidance-mode'."
@@ -85,8 +85,7 @@ use either \\[customize] or the function `mouse-avoidance-mode'."
85 (mouse-avoidance-mode (or value 'none))) 85 (mouse-avoidance-mode (or value 'none)))
86 :initialize 'custom-initialize-default 86 :initialize 'custom-initialize-default
87 :type '(choice (const :tag "none" nil) (const banish) (const jump) 87 :type '(choice (const :tag "none" nil) (const banish) (const jump)
88 (const animate) (const exile) (const proteus) 88 (const animate) (const exile) (const proteus))
89 )
90 :group 'avoid 89 :group 'avoid
91 :require 'avoid 90 :require 'avoid
92 :version "20.3") 91 :version "20.3")
@@ -94,7 +93,7 @@ use either \\[customize] or the function `mouse-avoidance-mode'."
94 93
95(defcustom mouse-avoidance-nudge-dist 15 94(defcustom mouse-avoidance-nudge-dist 15
96 "Average distance that mouse will be moved when approached by cursor. 95 "Average distance that mouse will be moved when approached by cursor.
97Only applies in Mouse-Avoidance mode `jump' and its derivatives. 96Only applies in Mouse Avoidance mode `jump' and its derivatives.
98For best results make this larger than `mouse-avoidance-threshold'." 97For best results make this larger than `mouse-avoidance-threshold'."
99 :type 'integer 98 :type 'integer
100 :group 'avoid) 99 :group 'avoid)
@@ -112,7 +111,7 @@ For best results make this larger than `mouse-avoidance-threshold'."
112(defcustom mouse-avoidance-threshold 5 111(defcustom mouse-avoidance-threshold 5
113 "Mouse-pointer's flight distance. 112 "Mouse-pointer's flight distance.
114If the cursor gets closer than this, the mouse pointer will move away. 113If the cursor gets closer than this, the mouse pointer will move away.
115Only applies in mouse-avoidance-modes `animate' and `jump'." 114Only applies in Mouse Avoidance modes `animate' and `jump'."
116 :type 'integer 115 :type 'integer
117 :group 'avoid) 116 :group 'avoid)
118 117
@@ -183,7 +182,7 @@ Acceptable distance is defined by `mouse-avoidance-threshold'."
183 mouse-avoidance-threshold)))))) 182 mouse-avoidance-threshold))))))
184 183
185(defun mouse-avoidance-banish-destination () 184(defun mouse-avoidance-banish-destination ()
186 "The position to which Mouse-Avoidance mode `banish' moves the mouse. 185 "The position to which Mouse Avoidance mode `banish' moves the mouse.
187You can redefine this if you want the mouse banished to a different corner." 186You can redefine this if you want the mouse banished to a different corner."
188 (let* ((pos (window-edges))) 187 (let* ((pos (window-edges)))
189 (cons (- (nth 2 pos) 2) 188 (cons (- (nth 2 pos) 2)
@@ -333,7 +332,7 @@ redefine this function to suit your own tastes."
333 332
334;;;###autoload 333;;;###autoload
335(defun mouse-avoidance-mode (&optional mode) 334(defun mouse-avoidance-mode (&optional mode)
336 "Set cursor avoidance mode to MODE. 335 "Set Mouse Avoidance mode to MODE.
337MODE should be one of the symbols `banish', `exile', `jump', `animate', 336MODE should be one of the symbols `banish', `exile', `jump', `animate',
338`cat-and-mouse', `proteus', or `none'. 337`cat-and-mouse', `proteus', or `none'.
339 338
@@ -353,7 +352,7 @@ Effects of the different modes:
353 352
354Whenever the mouse is moved, the frame is also raised. 353Whenever the mouse is moved, the frame is also raised.
355 354
356\(see `mouse-avoidance-threshold' for definition of \"too close\", 355\(See `mouse-avoidance-threshold' for definition of \"too close\",
357and `mouse-avoidance-nudge-dist' and `mouse-avoidance-nudge-var' for 356and `mouse-avoidance-nudge-dist' and `mouse-avoidance-nudge-var' for
358definition of \"random distance\".)" 357definition of \"random distance\".)"
359 (interactive 358 (interactive
diff --git a/lisp/calc/calc-menu.el b/lisp/calc/calc-menu.el
index aaddf3e486e..d8099b0aadc 100644
--- a/lisp/calc/calc-menu.el
+++ b/lisp/calc/calc-menu.el
@@ -960,6 +960,111 @@
960 (require 'calc-units) 960 (require 'calc-units)
961 (call-interactively 'calc-view-units-table)) 961 (call-interactively 'calc-view-units-table))
962 :keys "u V"] 962 :keys "u V"]
963 (list "Logarithmic Units"
964 ["Convert (1:) to dB (power)"
965 (progn
966 (require 'calc-units)
967 (call-interactively 'calc-db))
968 :keys "l d"
969 :active (>= (calc-stack-size) 1)]
970 ["Convert (2:) to dB (power) with reference level (1:)"
971 (progn
972 (require 'calc-units)
973 (let ((calc-option-flag t))
974 (call-interactively 'calc-db)))
975 :keys "O l d"
976 :active (>= (calc-stack-size) 2)]
977 ["Convert (1:) to Np (power)"
978 (progn
979 (require 'calc-units)
980 (call-interactively 'calc-np))
981 :keys "l n"
982 :active (>= (calc-stack-size) 1)]
983 ["Convert (2:) to Np (power) with reference level (1:)"
984 (progn
985 (require 'calc-units)
986 (let ((calc-option-flag t))
987 (call-interactively 'calc-np)))
988 :keys "O l n"
989 :active (>= (calc-stack-size) 2)]
990 ["Convert (1:) to power quantity"
991 (progn
992 (require 'calc-units)
993 (call-interactively 'calc-lu-quant))
994 :keys "l q"
995 :active (>= (calc-stack-size) 1)]
996 ["Convert (2:) to power quantity with reference level (1:)"
997 (progn
998 (require 'calc-units)
999 (let ((calc-option-flag t))
1000 (call-interactively 'calc-lu-quant)))
1001 :keys "O l q"
1002 :active (>= (calc-stack-size) 2)]
1003 "----"
1004 ["Convert (1:) to dB (field)"
1005 (progn
1006 (require 'calc-units)
1007 (let ((calc-hyperbolic-flag t))
1008 (call-interactively 'calc-db)))
1009 :keys "H l d"
1010 :active (>= (calc-stack-size) 1)]
1011 ["Convert (2:) to dB (field) with reference level (1:)"
1012 (progn
1013 (require 'calc-units)
1014 (let ((calc-option-flag t)
1015 (calc-hyperbolic-flag t))
1016 (call-interactively 'calc-db)))
1017 :keys "O H l d"
1018 :active (>= (calc-stack-size) 2)]
1019 ["Convert (1:) to Np (field)"
1020 (progn
1021 (require 'calc-units)
1022 (let ((calc-hyperbolic-flag t))
1023 (call-interactively 'calc-np)))
1024 :keys "H l n"
1025 :active (>= (calc-stack-size) 1)]
1026 ["Convert (2:) to Np (field) with reference level (1:)"
1027 (progn
1028 (require 'calc-units)
1029 (let ((calc-option-flag t)
1030 (calc-hyperbolic-flag t))
1031 (call-interactively 'calc-np)))
1032 :keys "O H l d"
1033 :active (>= (calc-stack-size) 2)]
1034 ["Convert (1:) to field quantity"
1035 (progn
1036 (require 'calc-units)
1037 (let ((calc-hyperbolic-flag t))
1038 (call-interactively 'calc-lu-quant)))
1039 :keys "H l q"
1040 :active (>= (calc-stack-size) 1)]
1041 ["Convert (2:) to field quantity with reference level (1:)"
1042 (progn
1043 (require 'calc-units)
1044 (let ((calc-option-flag t)
1045 (calc-hyperbolic-flag))
1046 (call-interactively 'calc-lu-quant)))
1047 :keys "O H l q"
1048 :active (>= (calc-stack-size) 2)])
1049 (list "Musical Notes"
1050 ["Convert (1:) to scientific pitch notation"
1051 (progn
1052 (require 'calc-units)
1053 (call-interactively 'calc-spn))
1054 :keys "l s"
1055 :active (>= (calc-stack-size) 1)]
1056 ["Convert (1:) to midi number"
1057 (progn
1058 (require 'calc-units)
1059 (call-interactively 'calc-midi))
1060 :keys "l m"
1061 :active (>= (calc-stack-size) 1)]
1062 ["Convert (1:) to frequency"
1063 (progn
1064 (require 'calc-units)
1065 (call-interactively 'calc-freq))
1066 :keys "l f"
1067 :active (>= (calc-stack-size) 1)])
963 "----" 1068 "----"
964 ["Help on Units" 1069 ["Help on Units"
965 (calc-info-goto-node "Units")]) 1070 (calc-info-goto-node "Units")])
diff --git a/lisp/calendar/time-date.el b/lisp/calendar/time-date.el
index a1bfad3a5f5..62203600612 100644
--- a/lisp/calendar/time-date.el
+++ b/lisp/calendar/time-date.el
@@ -308,13 +308,9 @@ This function does not work for SECONDS greater than `most-positive-fixnum'."
308 (setq start (match-end 0) 308 (setq start (match-end 0)
309 spec (match-string 1 string)) 309 spec (match-string 1 string))
310 (unless (string-equal spec "%") 310 (unless (string-equal spec "%")
311 ;; `assoc-string' is not available in XEmacs. So when compiling 311 (or (setq match (assoc (downcase spec) units))
312 ;; Gnus (`time-date.el' is part of Gnus) with XEmacs, we get
313 ;; a warning here. But `format-seconds' is not used anywhere in
314 ;; Gnus so it's not a real problem. --rsteib
315 (or (setq match (assoc-string spec units t))
316 (error "Bad format specifier: `%s'" spec)) 312 (error "Bad format specifier: `%s'" spec))
317 (if (assoc-string spec usedunits t) 313 (if (assoc (downcase spec) usedunits)
318 (error "Multiple instances of specifier: `%s'" spec)) 314 (error "Multiple instances of specifier: `%s'" spec))
319 (if (string-equal (car match) "z") 315 (if (string-equal (car match) "z")
320 (setq zeroflag t) 316 (setq zeroflag t)
diff --git a/lisp/dired-aux.el b/lisp/dired-aux.el
index c533c81be0e..9ab1fcb0e2b 100644
--- a/lisp/dired-aux.el
+++ b/lisp/dired-aux.el
@@ -1638,11 +1638,14 @@ Optional arg HOW-TO determiness how to treat the target.
1638 1638
1639;;;###autoload 1639;;;###autoload
1640(defun dired-create-directory (directory) 1640(defun dired-create-directory (directory)
1641 "Create a directory called DIRECTORY." 1641 "Create a directory called DIRECTORY.
1642If DIRECTORY already exists, signal an error."
1642 (interactive 1643 (interactive
1643 (list (read-file-name "Create directory: " (dired-current-directory)))) 1644 (list (read-file-name "Create directory: " (dired-current-directory))))
1644 (let* ((expanded (directory-file-name (expand-file-name directory))) 1645 (let* ((expanded (directory-file-name (expand-file-name directory)))
1645 (try expanded) new) 1646 (try expanded) new)
1647 (if (file-exists-p expanded)
1648 (error "Cannot create directory %s: file exists" expanded))
1646 ;; Find the topmost nonexistent parent dir (variable `new') 1649 ;; Find the topmost nonexistent parent dir (variable `new')
1647 (while (and try (not (file-exists-p try)) (not (equal new try))) 1650 (while (and try (not (file-exists-p try)) (not (equal new try)))
1648 (setq new try 1651 (setq new try
diff --git a/lisp/dired.el b/lisp/dired.el
index c4374503a6f..22470ea61e6 100644
--- a/lisp/dired.el
+++ b/lisp/dired.el
@@ -3627,7 +3627,7 @@ Ask means pop up a menu for the user to select one of copy, move or link."
3627;;;;;; dired-run-shell-command dired-do-shell-command dired-do-async-shell-command 3627;;;;;; dired-run-shell-command dired-do-shell-command dired-do-async-shell-command
3628;;;;;; dired-clean-directory dired-do-print dired-do-touch dired-do-chown 3628;;;;;; dired-clean-directory dired-do-print dired-do-touch dired-do-chown
3629;;;;;; dired-do-chgrp dired-do-chmod dired-compare-directories dired-backup-diff 3629;;;;;; dired-do-chgrp dired-do-chmod dired-compare-directories dired-backup-diff
3630;;;;;; dired-diff) "dired-aux" "dired-aux.el" "154cdfbf451aedec60c5012b625ff329") 3630;;;;;; dired-diff) "dired-aux" "dired-aux.el" "2d805d6766bd7970cd446413b4ed4ce0")
3631;;; Generated autoloads from dired-aux.el 3631;;; Generated autoloads from dired-aux.el
3632 3632
3633(autoload 'dired-diff "dired-aux" "\ 3633(autoload 'dired-diff "dired-aux" "\
@@ -3858,6 +3858,7 @@ Not documented
3858 3858
3859(autoload 'dired-create-directory "dired-aux" "\ 3859(autoload 'dired-create-directory "dired-aux" "\
3860Create a directory called DIRECTORY. 3860Create a directory called DIRECTORY.
3861If DIRECTORY already exists, signal an error.
3861 3862
3862\(fn DIRECTORY)" t nil) 3863\(fn DIRECTORY)" t nil)
3863 3864
diff --git a/lisp/emacs-lisp/ert.el b/lisp/emacs-lisp/ert.el
index 5bd8fd01b1e..b2e20843856 100644
--- a/lisp/emacs-lisp/ert.el
+++ b/lisp/emacs-lisp/ert.el
@@ -1482,9 +1482,8 @@ Returns the stats object."
1482 (let ((print-escape-newlines t) 1482 (let ((print-escape-newlines t)
1483 (print-level 5) 1483 (print-level 5)
1484 (print-length 10)) 1484 (print-length 10))
1485 (let ((begin (point))) 1485 (ert--pp-with-indentation-and-newline
1486 (ert--pp-with-indentation-and-newline 1486 (ert-test-result-with-condition-condition result)))
1487 (ert-test-result-with-condition-condition result))))
1488 (goto-char (1- (point-max))) 1487 (goto-char (1- (point-max)))
1489 (assert (looking-at "\n")) 1488 (assert (looking-at "\n"))
1490 (delete-char 1) 1489 (delete-char 1)
@@ -1603,7 +1602,7 @@ Nothing more than an interactive interface to `ert-make-test-unbound'."
1603(defun ert-delete-all-tests () 1602(defun ert-delete-all-tests ()
1604 "Make all symbols in `obarray' name no test." 1603 "Make all symbols in `obarray' name no test."
1605 (interactive) 1604 (interactive)
1606 (when (interactive-p) 1605 (when (called-interactively-p 'any)
1607 (unless (y-or-n-p "Delete all tests? ") 1606 (unless (y-or-n-p "Delete all tests? ")
1608 (error "Aborted"))) 1607 (error "Aborted")))
1609 ;; We can't use `ert-select-tests' here since that gives us only 1608 ;; We can't use `ert-select-tests' here since that gives us only
@@ -1793,7 +1792,7 @@ EWOC and STATS are arguments for `ert--results-update-stats-display'."
1793BEGIN and END specify a region in the current buffer." 1792BEGIN and END specify a region in the current buffer."
1794 (save-excursion 1793 (save-excursion
1795 (save-restriction 1794 (save-restriction
1796 (narrow-to-region begin (point)) 1795 (narrow-to-region begin end)
1797 ;; Inhibit optimization in `debugger-make-xrefs' that would 1796 ;; Inhibit optimization in `debugger-make-xrefs' that would
1798 ;; sometimes insert unrelated backtrace info into our buffer. 1797 ;; sometimes insert unrelated backtrace info into our buffer.
1799 (let ((debugger-previous-backtrace nil)) 1798 (let ((debugger-previous-backtrace nil))
diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el
index 399e0fb2e24..5dc2938fe08 100644
--- a/lisp/emacs-lisp/package.el
+++ b/lisp/emacs-lisp/package.el
@@ -319,12 +319,6 @@ Like `package-alist', but maps package name to a second alist.
319The inner alist is keyed by version.") 319The inner alist is keyed by version.")
320(put 'package-obsolete-alist 'risky-local-variable t) 320(put 'package-obsolete-alist 'risky-local-variable t)
321 321
322(defconst package-subdirectory-regexp
323 "\\`\\([^.].*?\\)-\\([0-9]+\\(?:[.][0-9]+\\|\\(?:pre\\|beta\\|alpha\\)[0-9]+\\)*\\)\\'"
324 "Regular expression matching the name of a package subdirectory.
325The first subexpression is the package name.
326The second subexpression is the version string.")
327
328(defun package-version-join (vlist) 322(defun package-version-join (vlist)
329 "Return the version string corresponding to the list VLIST. 323 "Return the version string corresponding to the list VLIST.
330This is, approximately, the inverse of `version-to-list'. 324This is, approximately, the inverse of `version-to-list'.
@@ -357,7 +351,7 @@ This is, approximately, the inverse of `version-to-list'.
357(defun package-strip-version (dirname) 351(defun package-strip-version (dirname)
358 "Strip the version from a combined package name and version. 352 "Strip the version from a combined package name and version.
359E.g., if given \"quux-23.0\", will return \"quux\"" 353E.g., if given \"quux-23.0\", will return \"quux\""
360 (if (string-match package-subdirectory-regexp dirname) 354 (if (string-match (concat "\\`" package-subdirectory-regexp "\\'") dirname)
361 (match-string 1 dirname))) 355 (match-string 1 dirname)))
362 356
363(defun package-load-descriptor (dir package) 357(defun package-load-descriptor (dir package)
@@ -382,12 +376,13 @@ In each valid package subdirectory, this function loads the
382description file containing a call to `define-package', which 376description file containing a call to `define-package', which
383updates `package-alist' and `package-obsolete-alist'." 377updates `package-alist' and `package-obsolete-alist'."
384 (let ((all (memq 'all package-load-list)) 378 (let ((all (memq 'all package-load-list))
379 (regexp (concat "\\`" package-subdirectory-regexp "\\'"))
385 name version force) 380 name version force)
386 (dolist (dir (cons package-user-dir package-directory-list)) 381 (dolist (dir (cons package-user-dir package-directory-list))
387 (when (file-directory-p dir) 382 (when (file-directory-p dir)
388 (dolist (subdir (directory-files dir)) 383 (dolist (subdir (directory-files dir))
389 (when (and (file-directory-p (expand-file-name subdir dir)) 384 (when (and (file-directory-p (expand-file-name subdir dir))
390 (string-match package-subdirectory-regexp subdir)) 385 (string-match regexp subdir))
391 (setq name (intern (match-string 1 subdir)) 386 (setq name (intern (match-string 1 subdir))
392 version (match-string 2 subdir) 387 version (match-string 2 subdir)
393 force (assq name package-load-list)) 388 force (assq name package-load-list))
@@ -579,30 +574,29 @@ EXTRA-PROPERTIES is currently unused."
579 (package-autoload-ensure-default-file generated-autoload-file)) 574 (package-autoload-ensure-default-file generated-autoload-file))
580 (update-directory-autoloads pkg-dir))) 575 (update-directory-autoloads pkg-dir)))
581 576
582(defun package-untar-buffer () 577(defvar tar-parse-info)
578(declare-function tar-untar-buffer "tar-mode" ())
579
580(defun package-untar-buffer (dir)
583 "Untar the current buffer. 581 "Untar the current buffer.
584This uses `tar-untar-buffer' if it is available. 582This uses `tar-untar-buffer' from Tar mode. All files should
585Otherwise it uses an external `tar' program. 583untar into a directory named DIR; otherwise, signal an error."
586`default-directory' should be set by the caller."
587 (require 'tar-mode) 584 (require 'tar-mode)
588 (if (fboundp 'tar-untar-buffer) 585 (tar-mode)
589 (progn 586 ;; Make sure everything extracts into DIR.
590 ;; tar-mode messes with narrowing, so we just let it have the 587 (let ((regexp (concat "\\`" (regexp-quote dir) "/")))
591 ;; whole buffer to play with. 588 (dolist (tar-data tar-parse-info)
592 (delete-region (point-min) (point)) 589 (unless (string-match regexp (aref tar-data 2))
593 (tar-mode) 590 (error "Package does not untar cleanly into directory %s/" dir))))
594 (tar-untar-buffer)) 591 (tar-untar-buffer))
595 ;; FIXME: check the result.
596 (call-process-region (point) (point-max) "tar" nil '(nil nil) nil
597 "xf" "-")))
598 592
599(defun package-unpack (name version) 593(defun package-unpack (name version)
600 (let ((pkg-dir (expand-file-name (concat (symbol-name name) "-" version) 594 (let* ((dirname (concat (symbol-name name) "-" version))
601 package-user-dir))) 595 (pkg-dir (expand-file-name dirname package-user-dir)))
602 (make-directory package-user-dir t) 596 (make-directory package-user-dir t)
603 ;; FIXME: should we delete PKG-DIR if it exists? 597 ;; FIXME: should we delete PKG-DIR if it exists?
604 (let* ((default-directory (file-name-as-directory package-user-dir))) 598 (let* ((default-directory (file-name-as-directory package-user-dir)))
605 (package-untar-buffer) 599 (package-untar-buffer dirname)
606 (package-generate-autoloads (symbol-name name) pkg-dir) 600 (package-generate-autoloads (symbol-name name) pkg-dir)
607 (let ((load-path (cons pkg-dir load-path))) 601 (let ((load-path (cons pkg-dir load-path)))
608 (byte-recompile-directory pkg-dir 0 t))))) 602 (byte-recompile-directory pkg-dir 0 t)))))
@@ -942,7 +936,8 @@ FILE is the name of the tar file to examine.
942The return result is a vector like `package-buffer-info'." 936The return result is a vector like `package-buffer-info'."
943 (let ((default-directory (file-name-directory file)) 937 (let ((default-directory (file-name-directory file))
944 (file (file-name-nondirectory file))) 938 (file (file-name-nondirectory file)))
945 (unless (string-match "^\\(.+\\)-\\([0-9.]+\\)\\.tar$" file) 939 (unless (string-match (concat "\\`" package-subdirectory-regexp "\\.tar\\'")
940 file)
946 (error "Invalid package name `%s'" file)) 941 (error "Invalid package name `%s'" file))
947 (let* ((pkg-name (match-string-no-properties 1 file)) 942 (let* ((pkg-name (match-string-no-properties 1 file))
948 (pkg-version (match-string-no-properties 2 file)) 943 (pkg-version (match-string-no-properties 2 file))
diff --git a/lisp/facemenu.el b/lisp/facemenu.el
index 97862afb678..fffe09a84a5 100644
--- a/lisp/facemenu.el
+++ b/lisp/facemenu.el
@@ -567,18 +567,12 @@ You can change the color sort order by customizing `list-colors-sort'."
567 (with-help-window buffer-name 567 (with-help-window buffer-name
568 (with-current-buffer standard-output 568 (with-current-buffer standard-output
569 (erase-buffer) 569 (erase-buffer)
570 (list-colors-print list callback)
571 (set-buffer-modified-p nil)
570 (setq truncate-lines t))) 572 (setq truncate-lines t)))
571 (let ((buf (get-buffer buffer-name)) 573 (when callback
572 (inhibit-read-only t)) 574 (pop-to-buffer buffer-name)
573 ;; Display buffer before generating content, to allow 575 (message "Click on a color to select it.")))
574 ;; `list-colors-print' to get the right window-width.
575 (with-selected-window (or (get-buffer-window buf t) (selected-window))
576 (with-current-buffer buf
577 (list-colors-print list callback)
578 (set-buffer-modified-p nil)))
579 (when callback
580 (pop-to-buffer buf)
581 (message "Click on a color to select it."))))
582 576
583(defun list-colors-print (list &optional callback) 577(defun list-colors-print (list &optional callback)
584 (let ((callback-fn 578 (let ((callback-fn
@@ -595,30 +589,19 @@ You can change the color sort order by customizing `list-colors-sort'."
595 (let* ((opoint (point)) 589 (let* ((opoint (point))
596 (color-values (color-values (car color))) 590 (color-values (color-values (car color)))
597 (light-p (>= (apply 'max color-values) 591 (light-p (>= (apply 'max color-values)
598 (* (car (color-values "white")) .5))) 592 (* (car (color-values "white")) .5))))
599 (max-len (max (- (window-width) 33) 20)))
600 (insert (car color)) 593 (insert (car color))
601 (indent-to 22) 594 (indent-to 22)
602 (put-text-property opoint (point) 'face `(:background ,(car color))) 595 (put-text-property opoint (point) 'face `(:background ,(car color)))
603 (put-text-property 596 (put-text-property
604 (prog1 (point) 597 (prog1 (point)
605 (insert " ") 598 (insert " ")
606 (if (cdr color) 599 ;; Insert all color names.
607 ;; Insert as many color names as possible, fitting max-len. 600 (insert (mapconcat 'identity color ",")))
608 (let ((names (list (car color)))
609 (others (cdr color))
610 (len (length (car color)))
611 newlen)
612 (while (and others
613 (< (setq newlen (+ len 2 (length (car others))))
614 max-len))
615 (setq len newlen)
616 (push (pop others) names))
617 (insert (mapconcat 'identity (nreverse names) ", ")))
618 (insert (car color))))
619 (point) 601 (point)
620 'face (list :foreground (car color))) 602 'face (list :foreground (car color)))
621 (indent-to (max (- (window-width) 8) 44)) 603 (insert (propertize " " 'display '(space :align-to (- right 9))))
604 (insert " ")
622 (insert (propertize 605 (insert (propertize
623 (apply 'format "#%02x%02x%02x" 606 (apply 'format "#%02x%02x%02x"
624 (mapcar (lambda (c) (lsh c -8)) 607 (mapcar (lambda (c) (lsh c -8))
diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog
index b22ed7397af..7eca03bd93b 100644
--- a/lisp/gnus/ChangeLog
+++ b/lisp/gnus/ChangeLog
@@ -1,3 +1,33 @@
12011-03-18 Julien Danjou <julien@danjou.info>
2
3 * gnus-util.el (gnus-buffer-live-p): Simplify gnus-buffer-live-p.
4 (gnus-buffer-live-p): Check that buffer is not nil.
5
62011-03-17 Lars Magne Ingebrigtsen <larsi@gnus.org>
7
8 * gnus-art.el: Require mouse, which the build bot seems to say is
9 needed.
10
11 * gravatar.el (gravatar-retrieve-synchronously): Use `url-retrieve' on
12 XEmacs, since it doesn't have url-retrieve-synchronously.
13
142011-03-17 Antoine Levitt <antoine.levitt@gmail.com>
15
16 * gnus-group.el (gnus-group-list-ticked): New function.
17 (gnus-group-make-menu-bar): Provide a menu entry for it.
18 (gnus-group-list-map): Provide a binding for it.
19
202011-03-17 Lars Magne Ingebrigtsen <larsi@gnus.org>
21
22 * shr.el (shr-visit-file): New command.
23
24 * nnimap.el (nnimap-fetch-inbox): Rewrite slightly last patch.
25
262011-03-17 Bjørn Mork <bjorn@mork.no>
27
28 * nnimap.el (nnimap-fetch-inbox): Don't download bodies on ver4-capable
29 servers.
30
12011-03-16 Julien Danjou <julien@danjou.info> 312011-03-16 Julien Danjou <julien@danjou.info>
2 32
3 * mm-uu.el (mm-uu-dissect-text-parts): Only dissect handle that are 33 * mm-uu.el (mm-uu-dissect-text-parts): Only dissect handle that are
diff --git a/lisp/gnus/gnus-art.el b/lisp/gnus/gnus-art.el
index b994a2839bc..7c7e0531926 100644
--- a/lisp/gnus/gnus-art.el
+++ b/lisp/gnus/gnus-art.el
@@ -44,6 +44,7 @@
44(require 'wid-edit) 44(require 'wid-edit)
45(require 'mm-uu) 45(require 'mm-uu)
46(require 'message) 46(require 'message)
47(require 'mouse)
47 48
48(autoload 'gnus-msg-mail "gnus-msg" nil t) 49(autoload 'gnus-msg-mail "gnus-msg" nil t)
49(autoload 'gnus-button-mailto "gnus-msg") 50(autoload 'gnus-button-mailto "gnus-msg")
diff --git a/lisp/gnus/gnus-group.el b/lisp/gnus/gnus-group.el
index e928811b558..c265538e19c 100644
--- a/lisp/gnus/gnus-group.el
+++ b/lisp/gnus/gnus-group.el
@@ -697,7 +697,8 @@ simple manner.")
697 "M" gnus-group-list-all-matching 697 "M" gnus-group-list-all-matching
698 "l" gnus-group-list-level 698 "l" gnus-group-list-level
699 "c" gnus-group-list-cached 699 "c" gnus-group-list-cached
700 "?" gnus-group-list-dormant) 700 "?" gnus-group-list-dormant
701 "!" gnus-group-list-ticked)
701 702
702(gnus-define-keys (gnus-group-list-limit-map "/" gnus-group-list-map) 703(gnus-define-keys (gnus-group-list-limit-map "/" gnus-group-list-map)
703 "k" gnus-group-list-limit 704 "k" gnus-group-list-limit
@@ -849,7 +850,8 @@ simple manner.")
849 ["List all groups matching..." gnus-group-list-all-matching t] 850 ["List all groups matching..." gnus-group-list-all-matching t]
850 ["List active file" gnus-group-list-active t] 851 ["List active file" gnus-group-list-active t]
851 ["List groups with cached" gnus-group-list-cached t] 852 ["List groups with cached" gnus-group-list-cached t]
852 ["List groups with dormant" gnus-group-list-dormant t]) 853 ["List groups with dormant" gnus-group-list-dormant t]
854 ["List groups with ticked" gnus-group-list-ticked t])
853 ("Sort" 855 ("Sort"
854 ["Default sort" gnus-group-sort-groups t] 856 ["Default sort" gnus-group-sort-groups t]
855 ["Sort by method" gnus-group-sort-groups-by-method t] 857 ["Sort by method" gnus-group-sort-groups-by-method t]
@@ -4536,6 +4538,28 @@ This command may read the active file."
4536 (goto-char (point-min)) 4538 (goto-char (point-min))
4537 (gnus-group-position-point)) 4539 (gnus-group-position-point))
4538 4540
4541(defun gnus-group-list-ticked (level &optional lowest)
4542 "List all groups with ticked articles.
4543If the prefix LEVEL is non-nil, it should be a number that says which
4544level to cut off listing groups.
4545If LOWEST, don't list groups with level lower than LOWEST.
4546
4547This command may read the active file."
4548 (interactive "P")
4549 (when level
4550 (setq level (prefix-numeric-value level)))
4551 (when (or (not level) (>= level gnus-level-zombie))
4552 (gnus-cache-open))
4553 (funcall gnus-group-prepare-function
4554 (or level gnus-level-subscribed)
4555 #'(lambda (info)
4556 (let ((marks (gnus-info-marks info)))
4557 (assq 'tick marks)))
4558 lowest
4559 'ignore)
4560 (goto-char (point-min))
4561 (gnus-group-position-point))
4562
4539(defun gnus-group-listed-groups () 4563(defun gnus-group-listed-groups ()
4540 "Return a list of listed groups." 4564 "Return a list of listed groups."
4541 (let (point groups) 4565 (let (point groups)
diff --git a/lisp/gnus/gnus-util.el b/lisp/gnus/gnus-util.el
index 42dbd5948cf..3f66b45aaab 100644
--- a/lisp/gnus/gnus-util.el
+++ b/lisp/gnus/gnus-util.el
@@ -672,11 +672,9 @@ If N, return the Nth ancestor instead."
672 (when (string-match "\\(<[^<]+>\\)[ \t]*\\'" references) 672 (when (string-match "\\(<[^<]+>\\)[ \t]*\\'" references)
673 (match-string 1 references)))))) 673 (match-string 1 references))))))
674 674
675(defun gnus-buffer-live-p (buffer) 675(defsubst gnus-buffer-live-p (buffer)
676 "Say whether BUFFER is alive or not." 676 "Say whether BUFFER is alive or not."
677 (and buffer 677 (and buffer (buffer-live-p (get-buffer buffer))))
678 (get-buffer buffer)
679 (buffer-name (get-buffer buffer))))
680 678
681(defun gnus-horizontal-recenter () 679(defun gnus-horizontal-recenter ()
682 "Recenter the current buffer horizontally." 680 "Recenter the current buffer horizontally."
diff --git a/lisp/gnus/gravatar.el b/lisp/gnus/gravatar.el
index 0c97080d847..4b0c9a16283 100644
--- a/lisp/gnus/gravatar.el
+++ b/lisp/gnus/gravatar.el
@@ -129,8 +129,10 @@ You can provide a list of argument to pass to CB in CBARGS."
129 "Retrieve MAIL-ADDRESS gravatar and returns it." 129 "Retrieve MAIL-ADDRESS gravatar and returns it."
130 (let ((url (gravatar-build-url mail-address))) 130 (let ((url (gravatar-build-url mail-address)))
131 (if (gravatar-cache-expired url) 131 (if (gravatar-cache-expired url)
132 (with-current-buffer (url-retrieve-synchronously url) 132 (with-current-buffer (if (featurep 'xemacs)
133 (when gravatar-automatic-caching 133 (url-retrieve url)
134 (url-retrieve-synchronously url))
135 (when gravatar-automatic-caching
134 (url-store-in-cache (current-buffer))) 136 (url-store-in-cache (current-buffer)))
135 (let ((data (gravatar-data->image))) 137 (let ((data (gravatar-data->image)))
136 (kill-buffer (current-buffer)) 138 (kill-buffer (current-buffer))
diff --git a/lisp/gnus/nnimap.el b/lisp/gnus/nnimap.el
index e0804f81e2e..bcbe7b678d5 100644
--- a/lisp/gnus/nnimap.el
+++ b/lisp/gnus/nnimap.el
@@ -1762,11 +1762,15 @@ textual parts.")
1762 (format "(UID %s%s)" 1762 (format "(UID %s%s)"
1763 (format 1763 (format
1764 (if (nnimap-ver4-p) 1764 (if (nnimap-ver4-p)
1765 "BODY.PEEK[HEADER] BODY.PEEK" 1765 "BODY.PEEK"
1766 "RFC822.PEEK")) 1766 "RFC822.PEEK"))
1767 (if nnimap-split-download-body-default 1767 (cond
1768 "[]" 1768 (nnimap-split-download-body-default
1769 "[1]"))) 1769 "[]")
1770 ((nnimap-ver4-p)
1771 "[HEADER]")
1772 (t
1773 "[1]"))))
1770 t)) 1774 t))
1771 1775
1772(defun nnimap-split-incoming-mail () 1776(defun nnimap-split-incoming-mail ()
diff --git a/lisp/gnus/shr.el b/lisp/gnus/shr.el
index c9c5bd5ff1c..113137a0046 100644
--- a/lisp/gnus/shr.el
+++ b/lisp/gnus/shr.el
@@ -113,6 +113,15 @@ cid: URL as the argument.")
113 113
114;; Public functions and commands. 114;; Public functions and commands.
115 115
116(defun shr-visit-file (file)
117 (interactive "fHTML file name: ")
118 (pop-to-buffer "*html*")
119 (erase-buffer)
120 (shr-insert-document
121 (with-temp-buffer
122 (insert-file-contents file)
123 (libxml-parse-html-region (point-min) (point-max)))))
124
116;;;###autoload 125;;;###autoload
117(defun shr-insert-document (dom) 126(defun shr-insert-document (dom)
118 (setq shr-content-cache nil) 127 (setq shr-content-cache nil)
diff --git a/lisp/ido.el b/lisp/ido.el
index 2e67e367a8f..2a5c7cf2f0e 100644
--- a/lisp/ido.el
+++ b/lisp/ido.el
@@ -1983,7 +1983,7 @@ If INITIAL is non-nil, it specifies the initial input string."
1983 (setq ido-exit nil) 1983 (setq ido-exit nil)
1984 (setq ido-final-text 1984 (setq ido-final-text
1985 (catch 'ido 1985 (catch 'ido
1986 (completing-read 1986 (completing-read-default
1987 (ido-make-prompt item prompt) 1987 (ido-make-prompt item prompt)
1988 '(("dummy" . 1)) nil nil ; table predicate require-match 1988 '(("dummy" . 1)) nil nil ; table predicate require-match
1989 (prog1 ido-text-init (setq ido-text-init nil)) ;initial-contents 1989 (prog1 ido-text-init (setq ido-text-init nil)) ;initial-contents
@@ -4740,13 +4740,13 @@ See `read-directory-name' for additional parameters."
4740 (concat ido-current-directory filename))))) 4740 (concat ido-current-directory filename)))))
4741 4741
4742;;;###autoload 4742;;;###autoload
4743(defun ido-completing-read (prompt choices &optional predicate require-match initial-input hist def) 4743(defun ido-completing-read (prompt choices &optional predicate require-match initial-input hist def inherit-input-method)
4744 "Ido replacement for the built-in `completing-read'. 4744 "Ido replacement for the built-in `completing-read'.
4745Read a string in the minibuffer with ido-style completion. 4745Read a string in the minibuffer with ido-style completion.
4746PROMPT is a string to prompt with; normally it ends in a colon and a space. 4746PROMPT is a string to prompt with; normally it ends in a colon and a space.
4747CHOICES is a list of strings which are the possible completions. 4747CHOICES is a list of strings which are the possible completions.
4748PREDICATE is currently ignored; it is included to be compatible 4748PREDICATE and INHERIT-INPUT-METHOD is currently ignored; it is included
4749 with `completing-read'. 4749 to be compatible with `completing-read'.
4750If REQUIRE-MATCH is non-nil, the user is not allowed to exit unless 4750If REQUIRE-MATCH is non-nil, the user is not allowed to exit unless
4751 the input is (or completes to) an element of CHOICES or is null. 4751 the input is (or completes to) an element of CHOICES or is null.
4752 If the input is null, `ido-completing-read' returns DEF, or an empty 4752 If the input is null, `ido-completing-read' returns DEF, or an empty
diff --git a/lisp/info.el b/lisp/info.el
index bc2062e72b2..fb753659737 100644
--- a/lisp/info.el
+++ b/lisp/info.el
@@ -594,15 +594,15 @@ in `Info-file-supports-index-cookies-list'."
594(defun info-initialize () 594(defun info-initialize ()
595 "Initialize `Info-directory-list', if that hasn't been done yet." 595 "Initialize `Info-directory-list', if that hasn't been done yet."
596 (unless Info-directory-list 596 (unless Info-directory-list
597 (let ((path (getenv "INFOPATH"))) 597 (let ((path (getenv "INFOPATH"))
598 (sep (regexp-quote path-separator)))
598 (setq Info-directory-list 599 (setq Info-directory-list
599 (prune-directory-list 600 (prune-directory-list
600 (if path 601 (if path
601 (if (string-match ":\\'" path) 602 (if (string-match-p (concat sep "\\'") path)
602 (append (split-string (substring path 0 -1) 603 (append (split-string (substring path 0 -1) sep)
603 (regexp-quote path-separator))
604 (Info-default-dirs)) 604 (Info-default-dirs))
605 (split-string path (regexp-quote path-separator))) 605 (split-string path sep))
606 (Info-default-dirs))))))) 606 (Info-default-dirs)))))))
607 607
608;;;###autoload 608;;;###autoload
diff --git a/lisp/startup.el b/lisp/startup.el
index 65b1a013c21..e8e85a41c77 100644
--- a/lisp/startup.el
+++ b/lisp/startup.el
@@ -392,6 +392,15 @@ Warning Warning!!! Pure space overflow !!!Warning Warning
392 :type 'directory 392 :type 'directory
393 :initialize 'custom-initialize-delay) 393 :initialize 'custom-initialize-delay)
394 394
395(defconst package-subdirectory-regexp
396 "\\([^.].*?\\)-\\([0-9]+\\(?:[.][0-9]+\\|\\(?:pre\\|beta\\|alpha\\)[0-9]+\\)*\\)"
397 "Regular expression matching the name of a package subdirectory.
398The first subexpression is the package name.
399The second subexpression is the version string.
400
401The regexp should not contain a starting \"\\`\" or a trailing
402 \"\\'\"; those are added automatically by callers.")
403
395(defun normal-top-level-add-subdirs-to-load-path () 404(defun normal-top-level-add-subdirs-to-load-path ()
396 "Add all subdirectories of current directory to `load-path'. 405 "Add all subdirectories of current directory to `load-path'.
397More precisely, this uses only the subdirectories whose names 406More precisely, this uses only the subdirectories whose names
@@ -1194,9 +1203,9 @@ the `--debug-init' option to view a complete error backtrace."
1194 (when (file-directory-p dir) 1203 (when (file-directory-p dir)
1195 (dolist (subdir (directory-files dir)) 1204 (dolist (subdir (directory-files dir))
1196 (when (and (file-directory-p (expand-file-name subdir dir)) 1205 (when (and (file-directory-p (expand-file-name subdir dir))
1197 ;; package-subdirectory-regexp from package.el 1206 (string-match
1198 (string-match "\\`\\([^.].*?\\)-\\([0-9]+\\(?:[.][0-9]+\\|\\(?:pre\\|beta\\|alpha\\)[0-9]+\\)*\\)\\'" 1207 (concat "\\`" package-subdirectory-regexp "\\'")
1199 subdir)) 1208 subdir))
1200 (throw 'package-dir-found t))))))) 1209 (throw 'package-dir-found t)))))))
1201 (package-initialize)) 1210 (package-initialize))
1202 1211
diff --git a/lisp/vc/diff-mode.el b/lisp/vc/diff-mode.el
index 9ccb37f3a55..72f415a9b94 100644
--- a/lisp/vc/diff-mode.el
+++ b/lisp/vc/diff-mode.el
@@ -122,8 +122,7 @@ when editing big diffs)."
122 ("\C-m" . diff-goto-source) 122 ("\C-m" . diff-goto-source)
123 ([mouse-2] . diff-goto-source) 123 ([mouse-2] . diff-goto-source)
124 ;; From XEmacs' diff-mode. 124 ;; From XEmacs' diff-mode.
125 ;; Standard M-w is useful, so don't change M-W. 125 ("W" . widen)
126 ;;("W" . widen)
127 ;;("." . diff-goto-source) ;display-buffer 126 ;;("." . diff-goto-source) ;display-buffer
128 ;;("f" . diff-goto-source) ;find-file 127 ;;("f" . diff-goto-source) ;find-file
129 ("o" . diff-goto-source) ;other-window 128 ("o" . diff-goto-source) ;other-window
@@ -135,17 +134,21 @@ when editing big diffs)."
135 ;; Not useful if you have to metafy them. 134 ;; Not useful if you have to metafy them.
136 ;;(" " . scroll-up) 135 ;;(" " . scroll-up)
137 ;;("\177" . scroll-down) 136 ;;("\177" . scroll-down)
138 ;; Standard M-a is useful, so don't change M-A. 137 ("A" . diff-ediff-patch)
139 ;;("A" . diff-ediff-patch) 138 ("r" . diff-restrict-view)
140 ;; Standard M-r is useful, so don't change M-r or M-R. 139 ("R" . diff-reverse-direction))
141 ;;("r" . diff-restrict-view)
142 ;;("R" . diff-reverse-direction)
143 )
144 "Basic keymap for `diff-mode', bound to various prefix keys." 140 "Basic keymap for `diff-mode', bound to various prefix keys."
145 :inherit special-mode-map) 141 :inherit special-mode-map)
146 142
147(easy-mmode-defmap diff-mode-map 143(easy-mmode-defmap diff-mode-map
148 `(("\e" . ,diff-mode-shared-map) 144 `(("\e" . ,(let ((map (make-sparse-keymap)))
145 ;; We want to inherit most bindings from diff-mode-shared-map,
146 ;; but not all since they may hide useful M-<foo> global
147 ;; bindings when editing.
148 (set-keymap-parent map diff-mode-shared-map)
149 (dolist (key '("A" "r" "R" "g" "q" "W"))
150 (define-key map key nil))
151 map))
149 ;; From compilation-minor-mode. 152 ;; From compilation-minor-mode.
150 ("\C-c\C-c" . diff-goto-source) 153 ("\C-c\C-c" . diff-goto-source)
151 ;; By analogy with the global C-x 4 a binding. 154 ;; By analogy with the global C-x 4 a binding.
diff --git a/lisp/vc/emerge.el b/lisp/vc/emerge.el
index 601b6b1e597..5435a840ac9 100644
--- a/lisp/vc/emerge.el
+++ b/lisp/vc/emerge.el
@@ -3176,21 +3176,26 @@ See also `auto-save-file-name-p'."
3176 3176
3177;; Metacharacters that have to be protected from the shell when executing 3177;; Metacharacters that have to be protected from the shell when executing
3178;; a diff/diff3 command. 3178;; a diff/diff3 command.
3179(defcustom emerge-metachars "[ \t\n!\"#$&'()*;<=>?[\\^`{|~]" 3179(defcustom emerge-metachars
3180 "Characters that must be quoted with \\ when used in a shell command line. 3180 (if (memq system-type '(ms-dos windows-nt))
3181 "[ \t\"<>|?*^&=]"
3182 "[ \t\n!\"#$&'()*;<=>?[\\^`{|~]")
3183 "Characters that must be quoted when used in a shell command line.
3181More precisely, a [...] regexp to match any one such character." 3184More precisely, a [...] regexp to match any one such character."
3182 :type 'regexp 3185 :type 'regexp
3183 :group 'emerge) 3186 :group 'emerge)
3184 3187
3185;; Quote metacharacters (using \) when executing a diff/diff3 command. 3188;; Quote metacharacters (using \) when executing a diff/diff3 command.
3186(defun emerge-protect-metachars (s) 3189(defun emerge-protect-metachars (s)
3187 (let ((limit 0)) 3190 (if (memq system-type '(ms-dos windows-nt))
3188 (while (string-match emerge-metachars s limit) 3191 (shell-quote-argument s)
3189 (setq s (concat (substring s 0 (match-beginning 0)) 3192 (let ((limit 0))
3190 "\\" 3193 (while (string-match emerge-metachars s limit)
3191 (substring s (match-beginning 0)))) 3194 (setq s (concat (substring s 0 (match-beginning 0))
3192 (setq limit (1+ (match-end 0))))) 3195 "\\"
3193 s) 3196 (substring s (match-beginning 0))))
3197 (setq limit (1+ (match-end 0)))))
3198 s))
3194 3199
3195(provide 'emerge) 3200(provide 'emerge)
3196 3201