aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorMiles Bader2007-08-27 04:00:19 +0000
committerMiles Bader2007-08-27 04:00:19 +0000
commit7f22a76506a3f3db2eb4bce1cfc49105bd8d0824 (patch)
tree02ffae400506ae46fcf03eacaa5210aac7fe57de /lisp
parentd53a60a6f76043ba9fb395eece2aaccc67a0d1b2 (diff)
parent619fb9ee822da1d92d8b7974b827dac6a918967f (diff)
downloademacs-7f22a76506a3f3db2eb4bce1cfc49105bd8d0824.tar.gz
emacs-7f22a76506a3f3db2eb4bce1cfc49105bd8d0824.zip
Merge from emacs--rel--22
Patches applied: * emacs--rel--22 (patch 97-100) - Update from CVS - Merge from gnus--rel--5.10 * gnus--rel--5.10 (patch 246-247) - Update from CVS Revision: emacs@sv.gnu.org/emacs--devo--0--patch-860
Diffstat (limited to 'lisp')
-rw-r--r--lisp/ChangeLog53
-rw-r--r--lisp/dframe.el180
-rw-r--r--lisp/emacs-lisp/backquote.el9
-rw-r--r--lisp/emacs-lisp/byte-opt.el6
-rw-r--r--lisp/emacs-lisp/bytecomp.el21
-rw-r--r--lisp/emacs-lisp/edebug.el8
-rw-r--r--lisp/gnus/ChangeLog22
-rw-r--r--lisp/gnus/gnus-salt.el35
-rw-r--r--lisp/gnus/hex-util.el28
-rw-r--r--lisp/gnus/mml.el9
-rw-r--r--lisp/gnus/sha1.el153
-rw-r--r--lisp/net/browse-url.el134
-rw-r--r--lisp/net/socks.el21
-rw-r--r--lisp/pcvs.el2
-rw-r--r--lisp/progmodes/ada-mode.el234
-rw-r--r--lisp/progmodes/cperl-mode.el80
-rw-r--r--lisp/simple.el25
-rw-r--r--lisp/textmodes/texinfmt.el2
-rw-r--r--lisp/uniquify.el8
-rw-r--r--lisp/vc.el2
20 files changed, 537 insertions, 495 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index acf122a9606..a944c9698ea 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,56 @@
12007-08-25 Stefan Monnier <monnier@iro.umontreal.ca>
2
3 * uniquify.el (uniquify-rationalize-file-buffer-names): Check liveness
4 of buffers in uniquify-managed.
5
6 * simple.el (invisible-p): Rename from text-invisible-p.
7 Update callers.
8
92007-08-23 Stefan Monnier <monnier@iro.umontreal.ca>
10
11 * progmodes/cperl-mode.el (defcustom, x-color-defined-p, cperl-is-face)
12 (cperl-is-face, cperl-force-face, cperl-etags-snarf-tag, cperl-mode)
13 (cperl-etags-snarf-tag, cperl-etags-goto-tag-location, cperl-init-faces)
14 (cperl-etags-goto-tag-location): Use new style backquotes.
15
16 * net/browse-url.el: Remove spurious * in custom docstrings.
17 (browse-url-filename-alist): Use new-style backquote.
18
19 * emacs-lisp/backquote.el (backquote-unquote-symbol)
20 (backquote-splice-symbol): Clarify they're not new-style unquotes.
21
22 * emacs-lisp/edebug.el (edebug-list-form, edebug-match-symbol, \,)
23 (\,@): Backslash the , and ,@ which are not new-style unquotes.
24
25 * textmodes/texinfmt.el (\,): Clarify it's not a new-style unquote.
26
27 * net/socks.el (socks-username/password-auth-filter):
28 Remove unused vars `state' and `desired-len'.
29 (socks-parse-services, socks-nslookup-host): Use with-current-buffer.
30 (socks-wait-for-state-change): Use new-style backquotes.
31
32 * pcvs.el (cvs-mode-status): Fix long-standing typo.
33
34 * emacs-lisp/bytecomp.el (byte-compile-from-buffer): Check old-style
35 backquotes after each `read' rather than once per buffer.
36
37 * dframe.el: Remove spurious * in custom docstrings.
38 (dframe-xemacsp): Remove, use (featurep 'xemacs) instead.
39 (dframe-xemacs20p): Remove, inline at the sole use point.
40 (defface): Don't defvar the face, don't use old-style backquote.
41 (defcustom): Don't use old-style backquote.
42 (dframe-frame-parameter, dframe-mouse-event-p):
43 Make it obvious that it's always defined.
44 (dframe-popup-kludge): New function to replace
45 dframe-xemacs-popup-kludge and dframe-xemacs-popup-kludge.
46 (dframe-frame-mode, dframe-set-timer-internal)
47 (dframe-mouse-set-point): Remove use of with-no-warnings from
48 XEmacs-specific code.
49 (dframe-set-timer-internal): Fix very old bug with
50 post-command-idle-hook.
51
52 * emacs-lisp/byte-opt.el (byte-optimize-featurep): Handle `sxemacs'.
53
12007-08-27 Thien-Thi Nguyen <ttn@gnuvola.org> 542007-08-27 Thien-Thi Nguyen <ttn@gnuvola.org>
2 55
3 * emacs-lisp/avl-tree.el: New file. 56 * emacs-lisp/avl-tree.el: New file.
diff --git a/lisp/dframe.el b/lisp/dframe.el
index 6d811a6a500..53a07ff3811 100644
--- a/lisp/dframe.el
+++ b/lisp/dframe.el
@@ -114,10 +114,6 @@
114(defvar x-pointer-top-left-arrow) 114(defvar x-pointer-top-left-arrow)
115 115
116;;; Code: 116;;; Code:
117(defvar dframe-xemacsp (string-match "XEmacs" emacs-version)
118 "Non-nil if we are running in the XEmacs environment.")
119(defvar dframe-xemacs20p (and dframe-xemacsp
120 (>= emacs-major-version 20)))
121 117
122;; From custom web page for compatibility between versions of custom 118;; From custom web page for compatibility between versions of custom
123;; with help from ptype@dera.gov.uk (Proto Type) 119;; with help from ptype@dera.gov.uk (Proto Type)
@@ -138,25 +134,23 @@
138 (if (boundp 'defface) 134 (if (boundp 'defface)
139 nil 135 nil
140 (defmacro defface (var values doc &rest args) 136 (defmacro defface (var values doc &rest args)
141 (` (progn 137 ;; To make colors for your faces you need to set your .Xdefaults
142 (defvar (, var) (quote (, var))) 138 ;; or set them up ahead of time in your .emacs file.
143 ;; To make colors for your faces you need to set your .Xdefaults 139 `(make-face ,var)
144 ;; or set them up ahead of time in your .emacs file. 140 ))
145 (make-face (, var))
146 ))))
147 (if (boundp 'defcustom) 141 (if (boundp 'defcustom)
148 nil 142 nil
149 (defmacro defcustom (var value doc &rest args) 143 (defmacro defcustom (var value doc &rest args)
150 (` (defvar (, var) (, value) (, doc))))))) 144 `(defvar ,var ,value ,doc)))))
151 145
152 146
153;;; Compatibility functions 147;;; Compatibility functions
154;; 148;;
155(defun dframe-frame-parameter (frame parameter) 149(defalias 'dframe-frame-parameter
156 "Return FRAME's PARAMETER value." 150 (if (fboundp 'frame-parameter) 'frame-parameter
157 (if (fboundp 'frame-parameter) 151 (lambda (frame parameter)
158 (frame-parameter frame parameter) 152 "Return FRAME's PARAMETER value."
159 (cdr (assoc parameter (frame-parameters frame))))) ; XEmacs 153 (cdr (assoc parameter (frame-parameters frame))))))
160 154
161 155
162;;; Variables 156;;; Variables
@@ -176,26 +170,26 @@
176 "Non-nil means that timers are available for this Emacs.") 170 "Non-nil means that timers are available for this Emacs.")
177 171
178(defcustom dframe-update-speed 172(defcustom dframe-update-speed
179 (if dframe-xemacsp 173 (if (featurep 'xemacs)
180 (if dframe-xemacs20p 174 (if (>= emacs-major-version 20)
181 2 ; 1 is too obrusive in XEmacs 175 2 ; 1 is too obrusive in XEmacs
182 5) ; when no idleness, need long delay 176 5) ; when no idleness, need long delay
183 1) 177 1)
184 "*Idle time in seconds needed before dframe will update itself. 178 "Idle time in seconds needed before dframe will update itself.
185Updates occur to allow dframe to display directory information 179Updates occur to allow dframe to display directory information
186relevant to the buffer you are currently editing." 180relevant to the buffer you are currently editing."
187 :group 'dframe 181 :group 'dframe
188 :type 'integer) 182 :type 'integer)
189 183
190(defcustom dframe-activity-change-focus-flag nil 184(defcustom dframe-activity-change-focus-flag nil
191 "*Non-nil means the selected frame will change based on activity. 185 "Non-nil means the selected frame will change based on activity.
192Thus, if a file is selected for edit, the buffer will appear in the 186Thus, if a file is selected for edit, the buffer will appear in the
193selected frame and the focus will change to that frame." 187selected frame and the focus will change to that frame."
194 :group 'dframe 188 :group 'dframe
195 :type 'boolean) 189 :type 'boolean)
196 190
197(defcustom dframe-after-select-attached-frame-hook nil 191(defcustom dframe-after-select-attached-frame-hook nil
198 "*Hook run after dframe has selected the attached frame." 192 "Hook run after dframe has selected the attached frame."
199 :group 'dframe 193 :group 'dframe
200 :type 'hook) 194 :type 'hook)
201 195
@@ -247,7 +241,7 @@ Local to those buffers, as a function called that created it.")
247 'dframe-switch-buffer-attached-frame 241 'dframe-switch-buffer-attached-frame
248 map global-map) 242 map global-map)
249 243
250 (if dframe-xemacsp 244 (if (featurep 'xemacs)
251 (progn 245 (progn
252 ;; mouse bindings so we can manipulate the items on each line 246 ;; mouse bindings so we can manipulate the items on each line
253 (define-key map 'button2 'dframe-click) 247 (define-key map 'button2 'dframe-click)
@@ -255,7 +249,7 @@ Local to those buffers, as a function called that created it.")
255 ;; Info doc fix from Bob Weiner 249 ;; Info doc fix from Bob Weiner
256 (if (featurep 'infodoc) 250 (if (featurep 'infodoc)
257 nil 251 nil
258 (define-key map 'button3 'dframe-xemacs-popup-kludge)) 252 (define-key map 'button3 'dframe-popup-kludge))
259 ) 253 )
260 254
261 ;; mouse bindings so we can manipulate the items on each line 255 ;; mouse bindings so we can manipulate the items on each line
@@ -267,13 +261,13 @@ Local to those buffers, as a function called that created it.")
267 ;; This adds a small unecessary visual effect 261 ;; This adds a small unecessary visual effect
268 ;;(define-key map [down-mouse-2] 'dframe-quick-mouse) 262 ;;(define-key map [down-mouse-2] 'dframe-quick-mouse)
269 263
270 (define-key map [down-mouse-3] 'dframe-emacs-popup-kludge) 264 (define-key map [down-mouse-3] 'dframe-popup-kludge)
271 265
272 ;; This lets the user scroll as if we had a scrollbar... well maybe not 266 ;; This lets the user scroll as if we had a scrollbar... well maybe not
273 (define-key map [mode-line mouse-2] 'dframe-mouse-hscroll) 267 (define-key map [mode-line mouse-2] 'dframe-mouse-hscroll)
274 ;; another handy place users might click to get our menu. 268 ;; another handy place users might click to get our menu.
275 (define-key map [mode-line down-mouse-1] 269 (define-key map [mode-line down-mouse-1]
276 'dframe-emacs-popup-kludge) 270 'dframe-popup-kludge)
277 271
278 ;; We can't switch buffers with the buffer mouse menu. Lets hack it. 272 ;; We can't switch buffers with the buffer mouse menu. Lets hack it.
279 (define-key map [C-down-mouse-1] 'dframe-hack-buffer-menu) 273 (define-key map [C-down-mouse-1] 'dframe-hack-buffer-menu)
@@ -325,14 +319,12 @@ CREATE-HOOK are hooks to run after creating a frame."
325 (run-hooks 'popup-hook) 319 (run-hooks 'popup-hook)
326 ;; Updated the buffer passed in to contain all the hacks needed 320 ;; Updated the buffer passed in to contain all the hacks needed
327 ;; to make it work well in a dedicated window. 321 ;; to make it work well in a dedicated window.
328 (save-excursion 322 (with-current-buffer (symbol-value buffer-var)
329 (set-buffer (symbol-value buffer-var))
330 ;; Declare this buffer a dedicated frame 323 ;; Declare this buffer a dedicated frame
331 (setq dframe-controlled local-mode-fn) 324 (setq dframe-controlled local-mode-fn)
332 325
333 (if dframe-xemacsp 326 (if (featurep 'xemacs)
334 ;; Hack the XEmacs mouse-motion handler 327 (progn
335 (with-no-warnings
336 ;; Hack the XEmacs mouse-motion handler 328 ;; Hack the XEmacs mouse-motion handler
337 (set (make-local-variable 'mouse-motion-handler) 329 (set (make-local-variable 'mouse-motion-handler)
338 'dframe-track-mouse-xemacs) 330 'dframe-track-mouse-xemacs)
@@ -353,7 +345,7 @@ CREATE-HOOK are hooks to run after creating a frame."
353 ;; Enable mouse tracking in emacs 345 ;; Enable mouse tracking in emacs
354 (if dframe-track-mouse-function 346 (if dframe-track-mouse-function
355 (set (make-local-variable 'track-mouse) t))) ;this could be messy. 347 (set (make-local-variable 'track-mouse) t))) ;this could be messy.
356;;;; DISABLED: This causes problems for users with multiple frames. 348;;;; DISABLED: This causes problems for users with multiple frames.
357;;;; ;; Set this up special just for the passed in buffer 349;;;; ;; Set this up special just for the passed in buffer
358;;;; ;; Terminal minibuffer stuff does not require this. 350;;;; ;; Terminal minibuffer stuff does not require this.
359;;;; (if (and (or (assoc 'minibuffer parameters) 351;;;; (if (and (or (assoc 'minibuffer parameters)
@@ -402,7 +394,7 @@ CREATE-HOOK are hooks to run after creating a frame."
402 (if (frame-live-p (symbol-value frame-var)) 394 (if (frame-live-p (symbol-value frame-var))
403 (raise-frame (symbol-value frame-var)) 395 (raise-frame (symbol-value frame-var))
404 (set frame-var 396 (set frame-var
405 (if dframe-xemacsp 397 (if (featurep 'xemacs)
406 ;; Only guess height if it is not specified. 398 ;; Only guess height if it is not specified.
407 (if (member 'height parameters) 399 (if (member 'height parameters)
408 (make-frame parameters) 400 (make-frame parameters)
@@ -458,7 +450,7 @@ CREATE-HOOK are hooks to run after creating a frame."
458(defun dframe-reposition-frame (new-frame parent-frame location) 450(defun dframe-reposition-frame (new-frame parent-frame location)
459 "Move NEW-FRAME to be relative to PARENT-FRAME. 451 "Move NEW-FRAME to be relative to PARENT-FRAME.
460LOCATION can be one of 'random, 'left, 'right, 'left-right, or 'top-bottom." 452LOCATION can be one of 'random, 'left, 'right, 'left-right, or 'top-bottom."
461 (if dframe-xemacsp 453 (if (featurep 'xemacs)
462 (dframe-reposition-frame-xemacs new-frame parent-frame location) 454 (dframe-reposition-frame-xemacs new-frame parent-frame location)
463 (dframe-reposition-frame-emacs new-frame parent-frame location))) 455 (dframe-reposition-frame-emacs new-frame parent-frame location)))
464 456
@@ -568,13 +560,13 @@ LOCATION can be one of 'random, 'left-right, or 'top-bottom."
568(defun dframe-detach (frame-var cache-var buffer-var) 560(defun dframe-detach (frame-var cache-var buffer-var)
569 "Detatch the frame in symbol FRAME-VAR. 561 "Detatch the frame in symbol FRAME-VAR.
570CACHE-VAR and BUFFER-VAR are symbols as in `dframe-frame-mode'" 562CACHE-VAR and BUFFER-VAR are symbols as in `dframe-frame-mode'"
571 (save-excursion 563 (with-current-buffer (symbol-value buffer-var)
572 (set-buffer (symbol-value buffer-var))
573 (rename-buffer (buffer-name) t) 564 (rename-buffer (buffer-name) t)
574 (let ((oldframe (symbol-value frame-var))) 565 (let ((oldframe (symbol-value frame-var)))
575 (set buffer-var nil) 566 (set buffer-var nil)
576 (set frame-var nil) 567 (set frame-var nil)
577 (set cache-var nil) 568 (set cache-var nil)
569 ;; FIXME: Looks very suspicious. Luckily this function is unused.
578 (make-variable-buffer-local frame-var) 570 (make-variable-buffer-local frame-var)
579 (set frame-var oldframe) 571 (set frame-var oldframe)
580 ))) 572 )))
@@ -785,18 +777,16 @@ If NULL-ON-ERROR is a symbol, set it to nil if we cannot create a timer."
785If NULL-ON-ERROR is a symbol, set it to nil if we cannot create a timer." 777If NULL-ON-ERROR is a symbol, set it to nil if we cannot create a timer."
786 (cond 778 (cond
787 ;; XEmacs 779 ;; XEmacs
788 (dframe-xemacsp 780 ((featurep 'xemacs)
789 (with-no-warnings
790 (if dframe-timer 781 (if dframe-timer
791 (progn (delete-itimer dframe-timer) 782 (progn (delete-itimer dframe-timer)
792 (setq dframe-timer nil))) 783 (setq dframe-timer nil)))
793 (if timeout 784 (if timeout
794 (if (and dframe-xemacsp 785 (if (or (>= emacs-major-version 21)
795 (or (>= emacs-major-version 21) 786 (and (= emacs-major-version 20)
796 (and (= emacs-major-version 20) 787 (> emacs-minor-version 0))
797 (> emacs-minor-version 0)) 788 (and (= emacs-major-version 19)
798 (and (= emacs-major-version 19) 789 (>= emacs-minor-version 15)))
799 (>= emacs-minor-version 15))))
800 (setq dframe-timer (start-itimer "dframe" 790 (setq dframe-timer (start-itimer "dframe"
801 'dframe-timer-fn 791 'dframe-timer-fn
802 timeout 792 timeout
@@ -805,7 +795,7 @@ If NULL-ON-ERROR is a symbol, set it to nil if we cannot create a timer."
805 (setq dframe-timer (start-itimer "dframe" 795 (setq dframe-timer (start-itimer "dframe"
806 'dframe-timer-fn 796 'dframe-timer-fn
807 timeout 797 timeout
808 nil)))))) 798 nil)))))
809 ;; Post 19.31 Emacs 799 ;; Post 19.31 Emacs
810 ((fboundp 'run-with-idle-timer) 800 ((fboundp 'run-with-idle-timer)
811 (if dframe-timer 801 (if dframe-timer
@@ -815,7 +805,7 @@ If NULL-ON-ERROR is a symbol, set it to nil if we cannot create a timer."
815 (setq dframe-timer 805 (setq dframe-timer
816 (run-with-idle-timer timeout t 'dframe-timer-fn)))) 806 (run-with-idle-timer timeout t 'dframe-timer-fn))))
817 ;; Emacs 19.30 (Thanks twice: ptype@dra.hmg.gb) 807 ;; Emacs 19.30 (Thanks twice: ptype@dra.hmg.gb)
818 ((fboundp 'post-command-idle-hook) 808 ((boundp 'post-command-idle-hook)
819 (if timeout 809 (if timeout
820 (add-hook 'post-command-idle-hook 'dframe-timer-fn) 810 (add-hook 'post-command-idle-hook 'dframe-timer-fn)
821 (remove-hook 'post-command-idle-hook 'dframe-timer-fn))) 811 (remove-hook 'post-command-idle-hook 'dframe-timer-fn)))
@@ -849,57 +839,58 @@ Evaluates all cached timer functions in sequence."
849;; opposed to where the point happens to be.) We attain this by 839;; opposed to where the point happens to be.) We attain this by
850;; temporarily moving the point to that place. 840;; temporarily moving the point to that place.
851;; Hrvoje Niksic <hniksic@srce.hr> 841;; Hrvoje Niksic <hniksic@srce.hr>
852(with-no-warnings 842(defalias 'dframe-popup-kludge
853(defun dframe-xemacs-popup-kludge (event) 843 (if (featurep 'xemacs)
854 "Pop up a menu related to the clicked on item. 844 (lambda (event) ; XEmacs.
845 "Pop up a menu related to the clicked on item.
855Must be bound to EVENT." 846Must be bound to EVENT."
856 (interactive "e") 847 (interactive "e")
857 (save-excursion 848 (save-excursion
858 (if dframe-pass-event-to-popup-mode-menu 849 (if dframe-pass-event-to-popup-mode-menu
859 (popup-mode-menu event) 850 (popup-mode-menu event)
860 (goto-char (event-closest-point event)) 851 (goto-char (event-closest-point event))
861 (beginning-of-line) 852 (beginning-of-line)
862 (forward-char (min 5 (- (save-excursion (end-of-line) (point)) 853 (forward-char (min 5 (- (save-excursion (end-of-line) (point))
863 (save-excursion (beginning-of-line) (point))))) 854 (save-excursion (beginning-of-line) (point)))))
864 (popup-mode-menu)) 855 (popup-mode-menu))
865 ;; Wait for menu to bail out. `popup-mode-menu' (and other popup 856 ;; Wait for menu to bail out. `popup-mode-menu' (and other popup
866 ;; menu functions) return immediately. 857 ;; menu functions) return immediately.
867 (let (new) 858 (let (new)
868 (while (not (misc-user-event-p (setq new (next-event)))) 859 (while (not (misc-user-event-p (setq new (next-event))))
869 (dispatch-event new)) 860 (dispatch-event new))
870 (dispatch-event new)))) 861 (dispatch-event new))))
871);with-no-warnings 862
872 863 (lambda (e) ; Emacs.
873(defun dframe-emacs-popup-kludge (e) 864 "Pop up a menu related to the clicked on item.
874 "Pop up a menu related to the clicked on item.
875Must be bound to event E." 865Must be bound to event E."
876 (interactive "e") 866 (interactive "e")
877 (save-excursion 867 (save-excursion
878 (mouse-set-point e) 868 (mouse-set-point e)
879 ;; This gets the cursor where the user can see it. 869 ;; This gets the cursor where the user can see it.
880 (if (not (bolp)) (forward-char -1)) 870 (if (not (bolp)) (forward-char -1))
881 (sit-for 0) 871 (sit-for 0)
882 (if (< emacs-major-version 20) 872 (if (< emacs-major-version 20)
883 (mouse-major-mode-menu e) 873 (mouse-major-mode-menu e)
884 (mouse-major-mode-menu e nil)))) 874 (mouse-major-mode-menu e nil))))))
885 875
886;;; Interactive user functions for the mouse 876;;; Interactive user functions for the mouse
887;; 877;;
888(defun dframe-mouse-event-p (event) 878(defalias 'dframe-mouse-event-p
889 "Return t if the event is a mouse related event." 879 (if (featurep 'xemacs)
890 (if (fboundp 'button-press-event-p) 880 'button-press-event-p
891 (button-press-event-p event) ; XEmacs 881 (lambda (event)
892 (if (and (listp event) 882 "Return t if the event is a mouse related event."
893 (member (event-basic-type event) 883 (if (and (listp event)
894 '(mouse-1 mouse-2 mouse-3))) 884 (member (event-basic-type event)
895 t 885 '(mouse-1 mouse-2 mouse-3)))
896 nil))) 886 t
887 nil))))
897 888
898(defun dframe-track-mouse (event) 889(defun dframe-track-mouse (event)
899 "For motion EVENT, display info about the current line." 890 "For motion EVENT, display info about the current line."
900 (interactive "e") 891 (interactive "e")
901 (when (and dframe-track-mouse-function 892 (when (and dframe-track-mouse-function
902 (or dframe-xemacsp ;; XEmacs always safe? 893 (or (featurep 'xemacs) ;; XEmacs always safe?
903 (windowp (posn-window (event-end event))) ; Sometimes 894 (windowp (posn-window (event-end event))) ; Sometimes
904 ; there is no window to jump into. 895 ; there is no window to jump into.
905 )) 896 ))
@@ -929,19 +920,18 @@ BUFFER and POSITION are optional because XEmacs doesn't use them."
929(defun dframe-mouse-set-point (e) 920(defun dframe-mouse-set-point (e)
930 "Set POINT based on event E. 921 "Set POINT based on event E.
931Handles clicking on images in XEmacs." 922Handles clicking on images in XEmacs."
932 (if (save-excursion 923 (if (and (featurep 'xemacs)
933 (save-window-excursion 924 (save-excursion
934 (mouse-set-point e) 925 (save-window-excursion
935 (and (fboundp 'event-over-glyph-p) (event-over-glyph-p e)))) 926 (mouse-set-point e)
927 (event-over-glyph-p e))))
936 ;; We are in XEmacs, and clicked on a picture 928 ;; We are in XEmacs, and clicked on a picture
937 (with-no-warnings
938 (let ((ext (event-glyph-extent e))) 929 (let ((ext (event-glyph-extent e)))
939 ;; This position is back inside the extent where the 930 ;; This position is back inside the extent where the
940 ;; junk we pushed into the property list lives. 931 ;; junk we pushed into the property list lives.
941 (if (extent-end-position ext) 932 (if (extent-end-position ext)
942 (goto-char (1- (extent-end-position ext))) 933 (goto-char (1- (extent-end-position ext)))
943 (mouse-set-point e))) 934 (mouse-set-point e)))
944 );with-no-warnings
945 ;; We are not in XEmacs, OR we didn't click on a picture. 935 ;; We are not in XEmacs, OR we didn't click on a picture.
946 (mouse-set-point e))) 936 (mouse-set-point e)))
947 937
@@ -1000,7 +990,7 @@ redirected into a window on the attached frame."
1000 (pop-to-buffer buffer nil) 990 (pop-to-buffer buffer nil)
1001 (other-window -1) 991 (other-window -1)
1002 ;; Fix for using this hook on some platforms: Bob Weiner 992 ;; Fix for using this hook on some platforms: Bob Weiner
1003 (cond ((not dframe-xemacsp) 993 (cond ((not (featurep 'xemacs))
1004 (run-hooks 'temp-buffer-show-hook)) 994 (run-hooks 'temp-buffer-show-hook))
1005 ((fboundp 'run-hook-with-args) 995 ((fboundp 'run-hook-with-args)
1006 (run-hook-with-args 'temp-buffer-show-hook buffer)) 996 (run-hook-with-args 'temp-buffer-show-hook buffer))
@@ -1015,8 +1005,8 @@ This hack overrides it so that the right thing happens in the main
1015Emacs frame, not in the dedicated frame. 1005Emacs frame, not in the dedicated frame.
1016Argument E is the event causing this activity." 1006Argument E is the event causing this activity."
1017 (interactive "e") 1007 (interactive "e")
1018 (let ((fn (lookup-key global-map (if dframe-xemacsp 1008 (let ((fn (lookup-key global-map (if (featurep 'xemacs)
1019 '(control button1) 1009 '(control button1)
1020 [C-down-mouse-1]))) 1010 [C-down-mouse-1])))
1021 (oldbuff (current-buffer)) 1011 (oldbuff (current-buffer))
1022 (newbuff nil)) 1012 (newbuff nil))
diff --git a/lisp/emacs-lisp/backquote.el b/lisp/emacs-lisp/backquote.el
index 6daaf001433..a2a929d9601 100644
--- a/lisp/emacs-lisp/backquote.el
+++ b/lisp/emacs-lisp/backquote.el
@@ -85,10 +85,10 @@ For example (backquote-list* 'a 'b 'c) => (a b . c)"
85(defconst backquote-backquote-symbol '\` 85(defconst backquote-backquote-symbol '\`
86 "Symbol used to represent a backquote or nested backquote.") 86 "Symbol used to represent a backquote or nested backquote.")
87 87
88(defconst backquote-unquote-symbol ', 88(defconst backquote-unquote-symbol '\,
89 "Symbol used to represent an unquote inside a backquote.") 89 "Symbol used to represent an unquote inside a backquote.")
90 90
91(defconst backquote-splice-symbol ',@ 91(defconst backquote-splice-symbol '\,@
92 "Symbol used to represent a splice inside a backquote.") 92 "Symbol used to represent a splice inside a backquote.")
93 93
94;;;###autoload 94;;;###autoload
@@ -121,9 +121,8 @@ Vectors work just like lists. Nested backquotes are permitted."
121(defun backquote-delay-process (s level) 121(defun backquote-delay-process (s level)
122 "Process a (un|back|splice)quote inside a backquote. 122 "Process a (un|back|splice)quote inside a backquote.
123This simply recurses through the body." 123This simply recurses through the body."
124 (let ((exp (backquote-listify (list (backquote-process (nth 1 s) level) 124 (let ((exp (backquote-listify (list (cons 0 (list 'quote (car s))))
125 (cons 0 (list 'quote (car s)))) 125 (backquote-process (cdr s) level))))
126 '(0))))
127 (if (eq (car-safe exp) 'quote) 126 (if (eq (car-safe exp) 'quote)
128 (cons 0 (list 'quote s)) 127 (cons 0 (list 'quote s))
129 (cons 1 exp)))) 128 (cons 1 exp))))
diff --git a/lisp/emacs-lisp/byte-opt.el b/lisp/emacs-lisp/byte-opt.el
index 80a6ad595b2..fdeab460c79 100644
--- a/lisp/emacs-lisp/byte-opt.el
+++ b/lisp/emacs-lisp/byte-opt.el
@@ -1146,9 +1146,9 @@
1146 1146
1147(put 'featurep 'byte-optimizer 'byte-optimize-featurep) 1147(put 'featurep 'byte-optimizer 'byte-optimize-featurep)
1148(defun byte-optimize-featurep (form) 1148(defun byte-optimize-featurep (form)
1149 ;; Emacs-21's byte-code doesn't run under XEmacs anyway, so we can 1149 ;; Emacs-21's byte-code doesn't run under XEmacs or SXEmacs anyway, so we
1150 ;; safely optimize away this test. 1150 ;; can safely optimize away this test.
1151 (if (equal '((quote xemacs)) (cdr-safe form)) 1151 (if (member (cdr-safe form) '((quote xemacs) (quote sxemacs)))
1152 nil 1152 nil
1153 form)) 1153 form))
1154 1154
diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el
index 39ff0d8668e..bfc21820b5c 100644
--- a/lisp/emacs-lisp/bytecomp.el
+++ b/lisp/emacs-lisp/bytecomp.el
@@ -1010,8 +1010,7 @@ Each function's symbol gets added to `byte-compile-noruntime-functions'."
1010(defun byte-compile-log-file () 1010(defun byte-compile-log-file ()
1011 (and (not (equal byte-compile-current-file byte-compile-last-logged-file)) 1011 (and (not (equal byte-compile-current-file byte-compile-last-logged-file))
1012 (not noninteractive) 1012 (not noninteractive)
1013 (save-excursion 1013 (with-current-buffer (get-buffer-create "*Compile-Log*")
1014 (set-buffer (get-buffer-create "*Compile-Log*"))
1015 (goto-char (point-max)) 1014 (goto-char (point-max))
1016 (let* ((inhibit-read-only t) 1015 (let* ((inhibit-read-only t)
1017 (dir (and byte-compile-current-file 1016 (dir (and byte-compile-current-file
@@ -1548,8 +1547,7 @@ recompile every `.el' file that already has a `.elc' file."
1548 nil 1547 nil
1549 (save-some-buffers) 1548 (save-some-buffers)
1550 (force-mode-line-update)) 1549 (force-mode-line-update))
1551 (save-current-buffer 1550 (with-current-buffer (get-buffer-create "*Compile-Log*")
1552 (set-buffer (get-buffer-create "*Compile-Log*"))
1553 (setq default-directory (expand-file-name directory)) 1551 (setq default-directory (expand-file-name directory))
1554 ;; compilation-mode copies value of default-directory. 1552 ;; compilation-mode copies value of default-directory.
1555 (unless (eq major-mode 'compilation-mode) 1553 (unless (eq major-mode 'compilation-mode)
@@ -1651,7 +1649,7 @@ The value is non-nil if there were no errors, nil if errors."
1651 (let ((b (get-file-buffer (expand-file-name filename)))) 1649 (let ((b (get-file-buffer (expand-file-name filename))))
1652 (if (and b (buffer-modified-p b) 1650 (if (and b (buffer-modified-p b)
1653 (y-or-n-p (format "Save buffer %s first? " (buffer-name b)))) 1651 (y-or-n-p (format "Save buffer %s first? " (buffer-name b))))
1654 (save-excursion (set-buffer b) (save-buffer))))) 1652 (with-current-buffer b (save-buffer)))))
1655 1653
1656 ;; Force logging of the file name for each file compiled. 1654 ;; Force logging of the file name for each file compiled.
1657 (setq byte-compile-last-logged-file nil) 1655 (setq byte-compile-last-logged-file nil)
@@ -1661,9 +1659,8 @@ The value is non-nil if there were no errors, nil if errors."
1661 byte-compile-dest-file) 1659 byte-compile-dest-file)
1662 (setq target-file (byte-compile-dest-file filename)) 1660 (setq target-file (byte-compile-dest-file filename))
1663 (setq byte-compile-dest-file target-file) 1661 (setq byte-compile-dest-file target-file)
1664 (save-excursion 1662 (with-current-buffer
1665 (setq input-buffer (get-buffer-create " *Compiler Input*")) 1663 (setq input-buffer (get-buffer-create " *Compiler Input*"))
1666 (set-buffer input-buffer)
1667 (erase-buffer) 1664 (erase-buffer)
1668 (setq buffer-file-coding-system nil) 1665 (setq buffer-file-coding-system nil)
1669 ;; Always compile an Emacs Lisp file as multibyte 1666 ;; Always compile an Emacs Lisp file as multibyte
@@ -1864,7 +1861,13 @@ With argument, insert value in current buffer after the form."
1864 (not (eobp))) 1861 (not (eobp)))
1865 (setq byte-compile-read-position (point) 1862 (setq byte-compile-read-position (point)
1866 byte-compile-last-position byte-compile-read-position) 1863 byte-compile-last-position byte-compile-read-position)
1867 (let ((form (read inbuffer))) 1864 (let* ((old-style-backquotes nil)
1865 (form (read inbuffer)))
1866 ;; Warn about the use of old-style backquotes.
1867 (when old-style-backquotes
1868 (byte-compile-warn "!! The file uses old-style backquotes !!
1869This functionality has been obsolete for more than 10 years already
1870and will be removed soon. See (elisp)Backquote in the manual."))
1868 (byte-compile-file-form form))) 1871 (byte-compile-file-form form)))
1869 ;; Compile pending forms at end of file. 1872 ;; Compile pending forms at end of file.
1870 (byte-compile-flush-pending) 1873 (byte-compile-flush-pending)
diff --git a/lisp/emacs-lisp/edebug.el b/lisp/emacs-lisp/edebug.el
index 5a526126c25..964688894af 100644
--- a/lisp/emacs-lisp/edebug.el
+++ b/lisp/emacs-lisp/edebug.el
@@ -1507,7 +1507,7 @@ expressions; a `progn' form will be returned enclosing these forms."
1507 head (edebug-move-cursor cursor)))))) 1507 head (edebug-move-cursor cursor))))))
1508 1508
1509 ((consp head) 1509 ((consp head)
1510 (if (eq (car head) ',) 1510 (if (eq (car head) '\,)
1511 ;; The head of a form should normally be a symbol or a lambda 1511 ;; The head of a form should normally be a symbol or a lambda
1512 ;; expression but it can also be an unquote form to be filled 1512 ;; expression but it can also be an unquote form to be filled
1513 ;; before evaluation. We evaluate the arguments anyway, on the 1513 ;; before evaluation. We evaluate the arguments anyway, on the
@@ -1664,7 +1664,7 @@ expressions; a `progn' form will be returned enclosing these forms."
1664 ((fboundp symbol) ; is it a predicate? 1664 ((fboundp symbol) ; is it a predicate?
1665 (let ((sexp (edebug-top-element-required cursor "Expected" symbol))) 1665 (let ((sexp (edebug-top-element-required cursor "Expected" symbol)))
1666 ;; Special case for edebug-`. 1666 ;; Special case for edebug-`.
1667 (if (and (listp sexp) (eq (car sexp) ',)) 1667 (if (and (listp sexp) (eq (car sexp) '\,))
1668 (edebug-match cursor '(("," def-form))) 1668 (edebug-match cursor '(("," def-form)))
1669 (if (not (funcall symbol sexp)) 1669 (if (not (funcall symbol sexp))
1670 (edebug-no-match cursor symbol "failed")) 1670 (edebug-no-match cursor symbol "failed"))
@@ -2102,8 +2102,8 @@ expressions; a `progn' form will be returned enclosing these forms."
2102(def-edebug-spec edebug-\` (def-form)) 2102(def-edebug-spec edebug-\` (def-form))
2103 2103
2104;; Assume immediate quote in unquotes mean backquote at next higher level. 2104;; Assume immediate quote in unquotes mean backquote at next higher level.
2105(def-edebug-spec , (&or ("quote" edebug-\`) def-form)) 2105(def-edebug-spec \, (&or ("quote" edebug-\`) def-form))
2106(def-edebug-spec ,@ (&define ;; so (,@ form) is never wrapped. 2106(def-edebug-spec \,@ (&define ;; so (,@ form) is never wrapped.
2107 &or ("quote" edebug-\`) def-form)) 2107 &or ("quote" edebug-\`) def-form))
2108 2108
2109;; New byte compiler. 2109;; New byte compiler.
diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog
index 201b7fefdcb..0cf879fd264 100644
--- a/lisp/gnus/ChangeLog
+++ b/lisp/gnus/ChangeLog
@@ -1,3 +1,21 @@
12007-08-23 Katsumi Yamaoka <yamaoka@jpl.org>
2
3 * mml.el (mml-generate-mime): Make sure it uses multibyte temp buffer.
4 (mml-generate-mime-1): Don't encode body if it is specified to be in
5 raw form; don't make buffer be unibyte when inserting multibyte string.
6
72007-08-23 Stefan Monnier <monnier@iro.umontreal.ca>
8
9 * sha1.el: Fix up comment style.
10 (sha1-F0, sha1-F1, sha1-F2, sha1-F3, sha1-S1, sha1-S5, sha1-S30)
11 (sha1-OP, sha1-add-to-H): Use new-style backquotes.
12
13 * hex-util.el: Fix up comment style.
14 (hex-char-to-num, num-to-hex-char): Use new-style backquotes.
15
16 * gnus-salt.el: Use with-current-buffer.
17 (gnus-pick-setup-message): Fix long-standing typo.
18
12007-08-17 Katsumi Yamaoka <yamaoka@jpl.org> 192007-08-17 Katsumi Yamaoka <yamaoka@jpl.org>
2 20
3 * gnus-art.el (gnus-article-summary-command-nosave) 21 * gnus-art.el (gnus-article-summary-command-nosave)
@@ -11,8 +29,8 @@
11 according to gnus-maximum-newsgroup. 29 according to gnus-maximum-newsgroup.
12 30
13 * gnus-sum.el (gnus-articles-to-read, gnus-list-of-unread-articles) 31 * gnus-sum.el (gnus-articles-to-read, gnus-list-of-unread-articles)
14 (gnus-list-of-read-articles, gnus-sequence-of-unread-articles): Limit 32 (gnus-list-of-read-articles, gnus-sequence-of-unread-articles):
15 the range of articles according to gnus-maximum-newsgroup. 33 Limit the range of articles according to gnus-maximum-newsgroup.
16 34
172007-08-10 Katsumi Yamaoka <yamaoka@jpl.org> 352007-08-10 Katsumi Yamaoka <yamaoka@jpl.org>
18 36
diff --git a/lisp/gnus/gnus-salt.el b/lisp/gnus/gnus-salt.el
index 298b6dc4739..e8d3e332ba3 100644
--- a/lisp/gnus/gnus-salt.el
+++ b/lisp/gnus/gnus-salt.el
@@ -134,11 +134,10 @@ It accepts the same format specs that `gnus-summary-line-format' does."
134(defun gnus-pick-setup-message () 134(defun gnus-pick-setup-message ()
135 "Make Message do the right thing on exit." 135 "Make Message do the right thing on exit."
136 (when (and (gnus-buffer-live-p gnus-summary-buffer) 136 (when (and (gnus-buffer-live-p gnus-summary-buffer)
137 (save-excursion 137 (with-current-buffer gnus-summary-buffer
138 (set-buffer gnus-summary-buffer)
139 gnus-pick-mode)) 138 gnus-pick-mode))
140 (message-add-action 139 (message-add-action
141 '(gnus-configure-windows ,gnus-current-window-configuration t) 140 `(gnus-configure-windows ,gnus-current-window-configuration t)
142 'send 'exit 'postpone 'kill))) 141 'send 'exit 'postpone 'kill)))
143 142
144(defvar gnus-pick-line-number 1) 143(defvar gnus-pick-line-number 1)
@@ -524,8 +523,7 @@ Two predefined functions are available:
524 (interactive (list (gnus-tree-article-number))) 523 (interactive (list (gnus-tree-article-number)))
525 (let ((buf (current-buffer))) 524 (let ((buf (current-buffer)))
526 (when article 525 (when article
527 (save-excursion 526 (with-current-buffer gnus-summary-buffer
528 (set-buffer gnus-summary-buffer)
529 (gnus-summary-goto-article article)) 527 (gnus-summary-goto-article article))
530 (select-window (get-buffer-window buf))))) 528 (select-window (get-buffer-window buf)))))
531 529
@@ -576,8 +574,7 @@ Two predefined functions are available:
576 574
577(defun gnus-get-tree-buffer () 575(defun gnus-get-tree-buffer ()
578 "Return the tree buffer properly initialized." 576 "Return the tree buffer properly initialized."
579 (save-excursion 577 (with-current-buffer (gnus-get-buffer-create gnus-tree-buffer)
580 (set-buffer (gnus-get-buffer-create gnus-tree-buffer))
581 (unless (eq major-mode 'gnus-tree-mode) 578 (unless (eq major-mode 'gnus-tree-mode)
582 (gnus-tree-mode)) 579 (gnus-tree-mode))
583 (current-buffer))) 580 (current-buffer)))
@@ -662,8 +659,7 @@ Two predefined functions are available:
662 "Highlight current line according to `gnus-summary-highlight'." 659 "Highlight current line according to `gnus-summary-highlight'."
663 (let ((list gnus-summary-highlight) 660 (let ((list gnus-summary-highlight)
664 face) 661 face)
665 (save-excursion 662 (with-current-buffer gnus-summary-buffer
666 (set-buffer gnus-summary-buffer)
667 (let* ((score (or (cdr (assq article gnus-newsgroup-scored)) 663 (let* ((score (or (cdr (assq article gnus-newsgroup-scored))
668 gnus-summary-default-score 0)) 664 gnus-summary-default-score 0))
669 (default gnus-summary-default-score) 665 (default gnus-summary-default-score)
@@ -690,8 +686,7 @@ Two predefined functions are available:
690 686
691(defun gnus-generate-tree (thread) 687(defun gnus-generate-tree (thread)
692 "Generate a thread tree for THREAD." 688 "Generate a thread tree for THREAD."
693 (save-excursion 689 (with-current-buffer (gnus-get-tree-buffer)
694 (set-buffer (gnus-get-tree-buffer))
695 (let ((buffer-read-only nil) 690 (let ((buffer-read-only nil)
696 (gnus-tmp-indent 0)) 691 (gnus-tmp-indent 0))
697 (erase-buffer) 692 (erase-buffer)
@@ -814,14 +809,12 @@ Two predefined functions are available:
814 809
815(defun gnus-possibly-generate-tree (article &optional force) 810(defun gnus-possibly-generate-tree (article &optional force)
816 "Generate the thread tree for ARTICLE if it isn't displayed already." 811 "Generate the thread tree for ARTICLE if it isn't displayed already."
817 (when (save-excursion 812 (when (with-current-buffer gnus-summary-buffer
818 (set-buffer gnus-summary-buffer)
819 (and gnus-use-trees 813 (and gnus-use-trees
820 gnus-show-threads 814 gnus-show-threads
821 (vectorp (gnus-summary-article-header article)))) 815 (vectorp (gnus-summary-article-header article))))
822 (save-excursion 816 (save-excursion
823 (let ((top (save-excursion 817 (let ((top (with-current-buffer gnus-summary-buffer
824 (set-buffer gnus-summary-buffer)
825 (gnus-cut-thread 818 (gnus-cut-thread
826 (gnus-remove-thread 819 (gnus-remove-thread
827 (mail-header-id 820 (mail-header-id
@@ -843,8 +836,7 @@ Two predefined functions are available:
843(defun gnus-tree-perhaps-minimize () 836(defun gnus-tree-perhaps-minimize ()
844 (when (and gnus-tree-minimize-window 837 (when (and gnus-tree-minimize-window
845 (get-buffer gnus-tree-buffer)) 838 (get-buffer gnus-tree-buffer))
846 (save-excursion 839 (with-current-buffer gnus-tree-buffer
847 (set-buffer gnus-tree-buffer)
848 (gnus-tree-minimize)))) 840 (gnus-tree-minimize))))
849 841
850(defun gnus-highlight-selected-tree (article) 842(defun gnus-highlight-selected-tree (article)
@@ -871,14 +863,12 @@ Two predefined functions are available:
871 (gnus-horizontal-recenter) 863 (gnus-horizontal-recenter)
872 (select-window selected)))) 864 (select-window selected))))
873;; If we remove this save-excursion, it updates the wrong mode lines?!? 865;; If we remove this save-excursion, it updates the wrong mode lines?!?
874 (save-excursion 866 (with-current-buffer gnus-tree-buffer
875 (set-buffer gnus-tree-buffer)
876 (gnus-set-mode-line 'tree)) 867 (gnus-set-mode-line 'tree))
877 (set-buffer buf))) 868 (set-buffer buf)))
878 869
879(defun gnus-tree-highlight-article (article face) 870(defun gnus-tree-highlight-article (article face)
880 (save-excursion 871 (with-current-buffer (gnus-get-tree-buffer)
881 (set-buffer (gnus-get-tree-buffer))
882 (let (region) 872 (let (region)
883 (when (setq region (gnus-tree-article-region article)) 873 (when (setq region (gnus-tree-article-region article))
884 (gnus-put-text-property (car region) (cdr region) 'face face) 874 (gnus-put-text-property (car region) (cdr region) 'face face)
@@ -1013,8 +1003,7 @@ The following commands are available:
1013 (let ((buffer (symbol-value (intern (format "gnus-carpal-%s-buffer" type))))) 1003 (let ((buffer (symbol-value (intern (format "gnus-carpal-%s-buffer" type)))))
1014 (if (get-buffer buffer) 1004 (if (get-buffer buffer)
1015 () 1005 ()
1016 (save-excursion 1006 (with-current-buffer (gnus-get-buffer-create buffer)
1017 (set-buffer (gnus-get-buffer-create buffer))
1018 (gnus-carpal-mode) 1007 (gnus-carpal-mode)
1019 (setq gnus-carpal-attached-buffer 1008 (setq gnus-carpal-attached-buffer
1020 (intern (format "gnus-%s-buffer" type))) 1009 (intern (format "gnus-%s-buffer" type)))
diff --git a/lisp/gnus/hex-util.el b/lisp/gnus/hex-util.el
index 6a10e3d2449..981516e4b2a 100644
--- a/lisp/gnus/hex-util.el
+++ b/lisp/gnus/hex-util.el
@@ -29,14 +29,14 @@
29 29
30(eval-when-compile 30(eval-when-compile
31 (defmacro hex-char-to-num (chr) 31 (defmacro hex-char-to-num (chr)
32 (` (let ((chr (, chr))) 32 `(let ((chr ,chr))
33 (cond 33 (cond
34 ((and (<= ?a chr)(<= chr ?f)) (+ (- chr ?a) 10)) 34 ((and (<= ?a chr)(<= chr ?f)) (+ (- chr ?a) 10))
35 ((and (<= ?A chr)(<= chr ?F)) (+ (- chr ?A) 10)) 35 ((and (<= ?A chr)(<= chr ?F)) (+ (- chr ?A) 10))
36 ((and (<= ?0 chr)(<= chr ?9)) (- chr ?0)) 36 ((and (<= ?0 chr)(<= chr ?9)) (- chr ?0))
37 (t (error "Invalid hexadecimal digit `%c'" chr)))))) 37 (t (error "Invalid hexadecimal digit `%c'" chr)))))
38 (defmacro num-to-hex-char (num) 38 (defmacro num-to-hex-char (num)
39 (` (aref "0123456789abcdef" (, num))))) 39 `(aref "0123456789abcdef" ,num)))
40 40
41(defun decode-hex-string (string) 41(defun decode-hex-string (string)
42 "Decode hexadecimal STRING to octet string." 42 "Decode hexadecimal STRING to octet string."
@@ -44,9 +44,9 @@
44 (dst (make-string (/ len 2) 0)) 44 (dst (make-string (/ len 2) 0))
45 (idx 0)(pos 0)) 45 (idx 0)(pos 0))
46 (while (< pos len) 46 (while (< pos len)
47;;; logior and lsh are not byte-coded. 47 ;; logior and lsh are not byte-coded.
48;;; (aset dst idx (logior (lsh (hex-char-to-num (aref string pos)) 4) 48 ;; (aset dst idx (logior (lsh (hex-char-to-num (aref string pos)) 4)
49;;; (hex-char-to-num (aref string (1+ pos))))) 49 ;; (hex-char-to-num (aref string (1+ pos)))))
50 (aset dst idx (+ (* (hex-char-to-num (aref string pos)) 16) 50 (aset dst idx (+ (* (hex-char-to-num (aref string pos)) 16)
51 (hex-char-to-num (aref string (1+ pos))))) 51 (hex-char-to-num (aref string (1+ pos)))))
52 (setq idx (1+ idx) 52 (setq idx (1+ idx)
@@ -59,11 +59,11 @@
59 (dst (make-string (* len 2) 0)) 59 (dst (make-string (* len 2) 0))
60 (idx 0)(pos 0)) 60 (idx 0)(pos 0))
61 (while (< pos len) 61 (while (< pos len)
62;;; logand and lsh are not byte-coded. 62 ;; logand and lsh are not byte-coded.
63;;; (aset dst idx (num-to-hex-char (logand (lsh (aref string pos) -4) 15))) 63 ;; (aset dst idx (num-to-hex-char (logand (lsh (aref string pos) -4) 15)))
64 (aset dst idx (num-to-hex-char (/ (aref string pos) 16))) 64 (aset dst idx (num-to-hex-char (/ (aref string pos) 16)))
65 (setq idx (1+ idx)) 65 (setq idx (1+ idx))
66;;; (aset dst idx (num-to-hex-char (logand (aref string pos) 15))) 66 ;; (aset dst idx (num-to-hex-char (logand (aref string pos) 15)))
67 (aset dst idx (num-to-hex-char (% (aref string pos) 16))) 67 (aset dst idx (num-to-hex-char (% (aref string pos) 16)))
68 (setq idx (1+ idx) 68 (setq idx (1+ idx)
69 pos (1+ pos))) 69 pos (1+ pos)))
@@ -71,5 +71,5 @@
71 71
72(provide 'hex-util) 72(provide 'hex-util)
73 73
74;;; arch-tag: fe8aaa79-6c86-400e-813f-5a8cc4cb3859 74;; arch-tag: fe8aaa79-6c86-400e-813f-5a8cc4cb3859
75;;; hex-util.el ends here 75;;; hex-util.el ends here
diff --git a/lisp/gnus/mml.el b/lisp/gnus/mml.el
index dae746fa082..0c60bed409f 100644
--- a/lisp/gnus/mml.el
+++ b/lisp/gnus/mml.el
@@ -404,7 +404,7 @@ If MML is non-nil, return the buffer up till the correspondent mml tag."
404 (mml-multipart-number mml-multipart-number)) 404 (mml-multipart-number mml-multipart-number))
405 (if (not cont) 405 (if (not cont)
406 nil 406 nil
407 (with-temp-buffer 407 (mm-with-multibyte-buffer
408 (if (and (consp (car cont)) 408 (if (and (consp (car cont))
409 (= (length cont) 1)) 409 (= (length cont) 1))
410 (mml-generate-mime-1 (car cont)) 410 (mml-generate-mime-1 (car cont))
@@ -516,14 +516,13 @@ If MML is non-nil, return the buffer up till the correspondent mml tag."
516 (progn 516 (progn
517 (mm-enable-multibyte) 517 (mm-enable-multibyte)
518 (insert contents) 518 (insert contents)
519 (setq charset (mm-encode-body))) 519 (unless raw
520 (setq charset (mm-encode-body))))
520 (insert contents))))) 521 (insert contents)))))
521 (setq encoding (mm-encode-buffer type) 522 (setq encoding (mm-encode-buffer type)
522 coded (mm-string-as-multibyte (buffer-string)))) 523 coded (mm-string-as-multibyte (buffer-string))))
523 (mml-insert-mime-headers cont type charset encoding nil) 524 (mml-insert-mime-headers cont type charset encoding nil)
524 (insert "\n") 525 (insert "\n" coded))))
525 (mm-with-unibyte-current-buffer
526 (insert coded)))))
527 ((eq (car cont) 'external) 526 ((eq (car cont) 'external)
528 (insert "Content-Type: message/external-body") 527 (insert "Content-Type: message/external-body")
529 (let ((parameters (mml-parameter-string 528 (let ((parameters (mml-parameter-string
diff --git a/lisp/gnus/sha1.el b/lisp/gnus/sha1.el
index 0411a983bad..146aa6374a0 100644
--- a/lisp/gnus/sha1.el
+++ b/lisp/gnus/sha1.el
@@ -123,93 +123,93 @@ If this variable is set to nil, use internal function only."
123 (defconst sha1-K3-high 51810) ; (string-to-number "CA62" 16) 123 (defconst sha1-K3-high 51810) ; (string-to-number "CA62" 16)
124 (defconst sha1-K3-low 49622) ; (string-to-number "C1D6" 16) 124 (defconst sha1-K3-low 49622) ; (string-to-number "C1D6" 16)
125 125
126;;; original definition of sha1-F0. 126 ;; original definition of sha1-F0.
127;;; (defmacro sha1-F0 (B C D) 127 ;; (defmacro sha1-F0 (B C D)
128;;; (` (logior (logand (, B) (, C)) 128 ;; (` (logior (logand (, B) (, C))
129;;; (logand (lognot (, B)) (, D))))) 129 ;; (logand (lognot (, B)) (, D)))))
130;;; a little optimization from GnuPG/cipher/sha1.c. 130 ;; a little optimization from GnuPG/cipher/sha1.c.
131 (defmacro sha1-F0 (B C D) 131 (defmacro sha1-F0 (B C D)
132 (` (logxor (, D) (logand (, B) (logxor (, C) (, D)))))) 132 `(logxor ,D (logand ,B (logxor ,C ,D))))
133 (defmacro sha1-F1 (B C D) 133 (defmacro sha1-F1 (B C D)
134 (` (logxor (, B) (, C) (, D)))) 134 `(logxor ,B ,C ,D))
135;;; original definition of sha1-F2. 135 ;; original definition of sha1-F2.
136;;; (defmacro sha1-F2 (B C D) 136 ;; (defmacro sha1-F2 (B C D)
137;;; (` (logior (logand (, B) (, C)) 137 ;; (` (logior (logand (, B) (, C))
138;;; (logand (, B) (, D)) 138 ;; (logand (, B) (, D))
139;;; (logand (, C) (, D))))) 139 ;; (logand (, C) (, D)))))
140;;; a little optimization from GnuPG/cipher/sha1.c. 140 ;; a little optimization from GnuPG/cipher/sha1.c.
141 (defmacro sha1-F2 (B C D) 141 (defmacro sha1-F2 (B C D)
142 (` (logior (logand (, B) (, C)) 142 `(logior (logand ,B ,C)
143 (logand (, D) (logior (, B) (, C)))))) 143 (logand ,D (logior ,B ,C))))
144 (defmacro sha1-F3 (B C D) 144 (defmacro sha1-F3 (B C D)
145 (` (logxor (, B) (, C) (, D)))) 145 `(logxor ,B ,C ,D))
146 146
147 (defmacro sha1-S1 (W-high W-low) 147 (defmacro sha1-S1 (W-high W-low)
148 (` (let ((W-high (, W-high)) 148 `(let ((W-high ,W-high)
149 (W-low (, W-low))) 149 (W-low ,W-low))
150 (setq S1W-high (+ (% (* W-high 2) 65536) 150 (setq S1W-high (+ (% (* W-high 2) 65536)
151 (/ W-low (, (/ 65536 2))))) 151 (/ W-low ,(/ 65536 2))))
152 (setq S1W-low (+ (/ W-high (, (/ 65536 2))) 152 (setq S1W-low (+ (/ W-high ,(/ 65536 2))
153 (% (* W-low 2) 65536)))))) 153 (% (* W-low 2) 65536)))))
154 (defmacro sha1-S5 (A-high A-low) 154 (defmacro sha1-S5 (A-high A-low)
155 (` (progn 155 `(progn
156 (setq S5A-high (+ (% (* (, A-high) 32) 65536) 156 (setq S5A-high (+ (% (* ,A-high 32) 65536)
157 (/ (, A-low) (, (/ 65536 32))))) 157 (/ ,A-low ,(/ 65536 32))))
158 (setq S5A-low (+ (/ (, A-high) (, (/ 65536 32))) 158 (setq S5A-low (+ (/ ,A-high ,(/ 65536 32))
159 (% (* (, A-low) 32) 65536)))))) 159 (% (* ,A-low 32) 65536)))))
160 (defmacro sha1-S30 (B-high B-low) 160 (defmacro sha1-S30 (B-high B-low)
161 (` (progn 161 `(progn
162 (setq S30B-high (+ (/ (, B-high) 4) 162 (setq S30B-high (+ (/ ,B-high 4)
163 (* (% (, B-low) 4) (, (/ 65536 4))))) 163 (* (% ,B-low 4) ,(/ 65536 4))))
164 (setq S30B-low (+ (/ (, B-low) 4) 164 (setq S30B-low (+ (/ ,B-low 4)
165 (* (% (, B-high) 4) (, (/ 65536 4)))))))) 165 (* (% ,B-high 4) ,(/ 65536 4))))))
166 166
167 (defmacro sha1-OP (round) 167 (defmacro sha1-OP (round)
168 (` (progn 168 `(progn
169 (sha1-S5 sha1-A-high sha1-A-low) 169 (sha1-S5 sha1-A-high sha1-A-low)
170 (sha1-S30 sha1-B-high sha1-B-low) 170 (sha1-S30 sha1-B-high sha1-B-low)
171 (setq sha1-A-low (+ ((, (intern (format "sha1-F%d" round))) 171 (setq sha1-A-low (+ (,(intern (format "sha1-F%d" round))
172 sha1-B-low sha1-C-low sha1-D-low) 172 sha1-B-low sha1-C-low sha1-D-low)
173 sha1-E-low 173 sha1-E-low
174 (, (symbol-value 174 ,(symbol-value
175 (intern (format "sha1-K%d-low" round)))) 175 (intern (format "sha1-K%d-low" round)))
176 (aref block-low idx) 176 (aref block-low idx)
177 (progn 177 (progn
178 (setq sha1-E-low sha1-D-low) 178 (setq sha1-E-low sha1-D-low)
179 (setq sha1-D-low sha1-C-low) 179 (setq sha1-D-low sha1-C-low)
180 (setq sha1-C-low S30B-low) 180 (setq sha1-C-low S30B-low)
181 (setq sha1-B-low sha1-A-low) 181 (setq sha1-B-low sha1-A-low)
182 S5A-low))) 182 S5A-low)))
183 (setq carry (/ sha1-A-low 65536)) 183 (setq carry (/ sha1-A-low 65536))
184 (setq sha1-A-low (% sha1-A-low 65536)) 184 (setq sha1-A-low (% sha1-A-low 65536))
185 (setq sha1-A-high (% (+ ((, (intern (format "sha1-F%d" round))) 185 (setq sha1-A-high (% (+ (,(intern (format "sha1-F%d" round))
186 sha1-B-high sha1-C-high sha1-D-high) 186 sha1-B-high sha1-C-high sha1-D-high)
187 sha1-E-high 187 sha1-E-high
188 (, (symbol-value 188 ,(symbol-value
189 (intern (format "sha1-K%d-high" round)))) 189 (intern (format "sha1-K%d-high" round)))
190 (aref block-high idx) 190 (aref block-high idx)
191 (progn 191 (progn
192 (setq sha1-E-high sha1-D-high) 192 (setq sha1-E-high sha1-D-high)
193 (setq sha1-D-high sha1-C-high) 193 (setq sha1-D-high sha1-C-high)
194 (setq sha1-C-high S30B-high) 194 (setq sha1-C-high S30B-high)
195 (setq sha1-B-high sha1-A-high) 195 (setq sha1-B-high sha1-A-high)
196 S5A-high) 196 S5A-high)
197 carry) 197 carry)
198 65536))))) 198 65536))))
199 199
200 (defmacro sha1-add-to-H (H X) 200 (defmacro sha1-add-to-H (H X)
201 (` (progn 201 `(progn
202 (setq (, (intern (format "sha1-%s-low" H))) 202 (setq ,(intern (format "sha1-%s-low" H))
203 (+ (, (intern (format "sha1-%s-low" H))) 203 (+ ,(intern (format "sha1-%s-low" H))
204 (, (intern (format "sha1-%s-low" X))))) 204 ,(intern (format "sha1-%s-low" X))))
205 (setq carry (/ (, (intern (format "sha1-%s-low" H))) 65536)) 205 (setq carry (/ ,(intern (format "sha1-%s-low" H)) 65536))
206 (setq (, (intern (format "sha1-%s-low" H))) 206 (setq ,(intern (format "sha1-%s-low" H))
207 (% (, (intern (format "sha1-%s-low" H))) 65536)) 207 (% ,(intern (format "sha1-%s-low" H)) 65536))
208 (setq (, (intern (format "sha1-%s-high" H))) 208 (setq ,(intern (format "sha1-%s-high" H))
209 (% (+ (, (intern (format "sha1-%s-high" H))) 209 (% (+ ,(intern (format "sha1-%s-high" H))
210 (, (intern (format "sha1-%s-high" X))) 210 ,(intern (format "sha1-%s-high" X))
211 carry) 211 carry)
212 65536))))) 212 65536))))
213 ) 213 )
214 214
215;;; buffers (H0 H1 H2 H3 H4). 215;;; buffers (H0 H1 H2 H3 H4).
@@ -433,11 +433,10 @@ hash of a portion of OBJECT.
433If BINARY is non-nil, return a string in binary form." 433If BINARY is non-nil, return a string in binary form."
434 (if (stringp object) 434 (if (stringp object)
435 (sha1-string object binary) 435 (sha1-string object binary)
436 (save-excursion 436 (with-current-buffer object
437 (set-buffer object)
438 (sha1-region (or beg (point-min)) (or end (point-max)) binary)))) 437 (sha1-region (or beg (point-min)) (or end (point-max)) binary))))
439 438
440(provide 'sha1) 439(provide 'sha1)
441 440
442;;; arch-tag: c0f9abd0-ffc1-4557-aac6-ece7f2d4c901 441;; arch-tag: c0f9abd0-ffc1-4557-aac6-ece7f2d4c901
443;;; sha1.el ends here 442;;; sha1.el ends here
diff --git a/lisp/net/browse-url.el b/lisp/net/browse-url.el
index 208e1fc178a..04f83ed465a 100644
--- a/lisp/net/browse-url.el
+++ b/lisp/net/browse-url.el
@@ -235,7 +235,7 @@
235 'browse-url-default-windows-browser) 235 'browse-url-default-windows-browser)
236 ((memq system-type '(darwin)) 'browse-url-default-macosx-browser) 236 ((memq system-type '(darwin)) 'browse-url-default-macosx-browser)
237 (t 'browse-url-default-browser)) 237 (t 'browse-url-default-browser))
238 "*Function to display the current buffer in a WWW browser. 238 "Function to display the current buffer in a WWW browser.
239This is used by the `browse-url-at-point', `browse-url-at-mouse', and 239This is used by the `browse-url-at-point', `browse-url-at-mouse', and
240`browse-url-of-file' commands. 240`browse-url-of-file' commands.
241 241
@@ -281,7 +281,7 @@ regexp should probably be \".\" to specify a default browser."
281 281
282(defcustom browse-url-netscape-program "netscape" 282(defcustom browse-url-netscape-program "netscape"
283 ;; Info about netscape-remote from Karl Berry. 283 ;; Info about netscape-remote from Karl Berry.
284 "*The name by which to invoke Netscape. 284 "The name by which to invoke Netscape.
285 285
286The free program `netscape-remote' from 286The free program `netscape-remote' from
287<URL:http://home.netscape.com/newsref/std/remote.c> is said to start 287<URL:http://home.netscape.com/newsref/std/remote.c> is said to start
@@ -292,34 +292,34 @@ system, given vroot.h from the same directory, with cc flags
292 :group 'browse-url) 292 :group 'browse-url)
293 293
294(defcustom browse-url-netscape-arguments nil 294(defcustom browse-url-netscape-arguments nil
295 "*A list of strings to pass to Netscape as arguments." 295 "A list of strings to pass to Netscape as arguments."
296 :type '(repeat (string :tag "Argument")) 296 :type '(repeat (string :tag "Argument"))
297 :group 'browse-url) 297 :group 'browse-url)
298 298
299(defcustom browse-url-netscape-startup-arguments browse-url-netscape-arguments 299(defcustom browse-url-netscape-startup-arguments browse-url-netscape-arguments
300 "*A list of strings to pass to Netscape when it starts up. 300 "A list of strings to pass to Netscape when it starts up.
301Defaults to the value of `browse-url-netscape-arguments' at the time 301Defaults to the value of `browse-url-netscape-arguments' at the time
302`browse-url' is loaded." 302`browse-url' is loaded."
303 :type '(repeat (string :tag "Argument")) 303 :type '(repeat (string :tag "Argument"))
304 :group 'browse-url) 304 :group 'browse-url)
305 305
306(defcustom browse-url-browser-display nil 306(defcustom browse-url-browser-display nil
307 "*The X display for running the browser, if not same as Emacs'." 307 "The X display for running the browser, if not same as Emacs'."
308 :type '(choice string (const :tag "Default" nil)) 308 :type '(choice string (const :tag "Default" nil))
309 :group 'browse-url) 309 :group 'browse-url)
310 310
311(defcustom browse-url-mozilla-program "mozilla" 311(defcustom browse-url-mozilla-program "mozilla"
312 "*The name by which to invoke Mozilla." 312 "The name by which to invoke Mozilla."
313 :type 'string 313 :type 'string
314 :group 'browse-url) 314 :group 'browse-url)
315 315
316(defcustom browse-url-mozilla-arguments nil 316(defcustom browse-url-mozilla-arguments nil
317 "*A list of strings to pass to Mozilla as arguments." 317 "A list of strings to pass to Mozilla as arguments."
318 :type '(repeat (string :tag "Argument")) 318 :type '(repeat (string :tag "Argument"))
319 :group 'browse-url) 319 :group 'browse-url)
320 320
321(defcustom browse-url-mozilla-startup-arguments browse-url-mozilla-arguments 321(defcustom browse-url-mozilla-startup-arguments browse-url-mozilla-arguments
322 "*A list of strings to pass to Mozilla when it starts up. 322 "A list of strings to pass to Mozilla when it starts up.
323Defaults to the value of `browse-url-mozilla-arguments' at the time 323Defaults to the value of `browse-url-mozilla-arguments' at the time
324`browse-url' is loaded." 324`browse-url' is loaded."
325 :type '(repeat (string :tag "Argument")) 325 :type '(repeat (string :tag "Argument"))
@@ -327,17 +327,17 @@ Defaults to the value of `browse-url-mozilla-arguments' at the time
327 327
328;;;###autoload 328;;;###autoload
329(defcustom browse-url-firefox-program "firefox" 329(defcustom browse-url-firefox-program "firefox"
330 "*The name by which to invoke Firefox." 330 "The name by which to invoke Firefox."
331 :type 'string 331 :type 'string
332 :group 'browse-url) 332 :group 'browse-url)
333 333
334(defcustom browse-url-firefox-arguments nil 334(defcustom browse-url-firefox-arguments nil
335 "*A list of strings to pass to Firefox as arguments." 335 "A list of strings to pass to Firefox as arguments."
336 :type '(repeat (string :tag "Argument")) 336 :type '(repeat (string :tag "Argument"))
337 :group 'browse-url) 337 :group 'browse-url)
338 338
339(defcustom browse-url-firefox-startup-arguments browse-url-firefox-arguments 339(defcustom browse-url-firefox-startup-arguments browse-url-firefox-arguments
340 "*A list of strings to pass to Firefox when it starts up. 340 "A list of strings to pass to Firefox when it starts up.
341Defaults to the value of `browse-url-firefox-arguments' at the time 341Defaults to the value of `browse-url-firefox-arguments' at the time
342`browse-url' is loaded." 342`browse-url' is loaded."
343 :type '(repeat (string :tag "Argument")) 343 :type '(repeat (string :tag "Argument"))
@@ -345,34 +345,34 @@ Defaults to the value of `browse-url-firefox-arguments' at the time
345 345
346;;;###autoload 346;;;###autoload
347(defcustom browse-url-galeon-program "galeon" 347(defcustom browse-url-galeon-program "galeon"
348 "*The name by which to invoke Galeon." 348 "The name by which to invoke Galeon."
349 :type 'string 349 :type 'string
350 :group 'browse-url) 350 :group 'browse-url)
351 351
352(defcustom browse-url-galeon-arguments nil 352(defcustom browse-url-galeon-arguments nil
353 "*A list of strings to pass to Galeon as arguments." 353 "A list of strings to pass to Galeon as arguments."
354 :type '(repeat (string :tag "Argument")) 354 :type '(repeat (string :tag "Argument"))
355 :group 'browse-url) 355 :group 'browse-url)
356 356
357(defcustom browse-url-galeon-startup-arguments browse-url-galeon-arguments 357(defcustom browse-url-galeon-startup-arguments browse-url-galeon-arguments
358 "*A list of strings to pass to Galeon when it starts up. 358 "A list of strings to pass to Galeon when it starts up.
359Defaults to the value of `browse-url-galeon-arguments' at the time 359Defaults to the value of `browse-url-galeon-arguments' at the time
360`browse-url' is loaded." 360`browse-url' is loaded."
361 :type '(repeat (string :tag "Argument")) 361 :type '(repeat (string :tag "Argument"))
362 :group 'browse-url) 362 :group 'browse-url)
363 363
364(defcustom browse-url-epiphany-program "epiphany" 364(defcustom browse-url-epiphany-program "epiphany"
365 "*The name by which to invoke Epiphany." 365 "The name by which to invoke Epiphany."
366 :type 'string 366 :type 'string
367 :group 'browse-url) 367 :group 'browse-url)
368 368
369(defcustom browse-url-epiphany-arguments nil 369(defcustom browse-url-epiphany-arguments nil
370 "*A list of strings to pass to Epiphany as arguments." 370 "A list of strings to pass to Epiphany as arguments."
371 :type '(repeat (string :tag "Argument")) 371 :type '(repeat (string :tag "Argument"))
372 :group 'browse-url) 372 :group 'browse-url)
373 373
374(defcustom browse-url-epiphany-startup-arguments browse-url-epiphany-arguments 374(defcustom browse-url-epiphany-startup-arguments browse-url-epiphany-arguments
375 "*A list of strings to pass to Epiphany when it starts up. 375 "A list of strings to pass to Epiphany when it starts up.
376Defaults to the value of `browse-url-epiphany-arguments' at the time 376Defaults to the value of `browse-url-epiphany-arguments' at the time
377`browse-url' is loaded." 377`browse-url' is loaded."
378 :type '(repeat (string :tag "Argument")) 378 :type '(repeat (string :tag "Argument"))
@@ -382,20 +382,20 @@ Defaults to the value of `browse-url-epiphany-arguments' at the time
382(defvar browse-url-gnome-moz-program "gnome-moz-remote") 382(defvar browse-url-gnome-moz-program "gnome-moz-remote")
383 383
384(defcustom browse-url-gnome-moz-arguments '() 384(defcustom browse-url-gnome-moz-arguments '()
385 "*A list of strings passed to the GNOME mozilla viewer as arguments." 385 "A list of strings passed to the GNOME mozilla viewer as arguments."
386 :version "21.1" 386 :version "21.1"
387 :type '(repeat (string :tag "Argument")) 387 :type '(repeat (string :tag "Argument"))
388 :group 'browse-url) 388 :group 'browse-url)
389 389
390(defcustom browse-url-mozilla-new-window-is-tab nil 390(defcustom browse-url-mozilla-new-window-is-tab nil
391 "*Whether to open up new windows in a tab or a new window. 391 "Whether to open up new windows in a tab or a new window.
392If non-nil, then open the URL in a new tab rather than a new window if 392If non-nil, then open the URL in a new tab rather than a new window if
393`browse-url-mozilla' is asked to open it in a new window." 393`browse-url-mozilla' is asked to open it in a new window."
394 :type 'boolean 394 :type 'boolean
395 :group 'browse-url) 395 :group 'browse-url)
396 396
397(defcustom browse-url-firefox-new-window-is-tab nil 397(defcustom browse-url-firefox-new-window-is-tab nil
398 "*Whether to open up new windows in a tab or a new window. 398 "Whether to open up new windows in a tab or a new window.
399If non-nil, then open the URL in a new tab rather than a new window if 399If non-nil, then open the URL in a new tab rather than a new window if
400`browse-url-firefox' is asked to open it in a new window. 400`browse-url-firefox' is asked to open it in a new window.
401 401
@@ -405,21 +405,21 @@ functionality is not available there."
405 :group 'browse-url) 405 :group 'browse-url)
406 406
407(defcustom browse-url-galeon-new-window-is-tab nil 407(defcustom browse-url-galeon-new-window-is-tab nil
408 "*Whether to open up new windows in a tab or a new window. 408 "Whether to open up new windows in a tab or a new window.
409If non-nil, then open the URL in a new tab rather than a new window if 409If non-nil, then open the URL in a new tab rather than a new window if
410`browse-url-galeon' is asked to open it in a new window." 410`browse-url-galeon' is asked to open it in a new window."
411 :type 'boolean 411 :type 'boolean
412 :group 'browse-url) 412 :group 'browse-url)
413 413
414(defcustom browse-url-epiphany-new-window-is-tab nil 414(defcustom browse-url-epiphany-new-window-is-tab nil
415 "*Whether to open up new windows in a tab or a new window. 415 "Whether to open up new windows in a tab or a new window.
416If non-nil, then open the URL in a new tab rather than a new window if 416If non-nil, then open the URL in a new tab rather than a new window if
417`browse-url-epiphany' is asked to open it in a new window." 417`browse-url-epiphany' is asked to open it in a new window."
418 :type 'boolean 418 :type 'boolean
419 :group 'browse-url) 419 :group 'browse-url)
420 420
421(defcustom browse-url-netscape-new-window-is-tab nil 421(defcustom browse-url-netscape-new-window-is-tab nil
422 "*Whether to open up new windows in a tab or a new window. 422 "Whether to open up new windows in a tab or a new window.
423If non-nil, then open the URL in a new tab rather than a new 423If non-nil, then open the URL in a new tab rather than a new
424window if `browse-url-netscape' is asked to open it in a new 424window if `browse-url-netscape' is asked to open it in a new
425window." 425window."
@@ -427,7 +427,7 @@ window."
427 :group 'browse-url) 427 :group 'browse-url)
428 428
429(defcustom browse-url-new-window-flag nil 429(defcustom browse-url-new-window-flag nil
430 "*If non-nil, always open a new browser window with appropriate browsers. 430 "If non-nil, always open a new browser window with appropriate browsers.
431Passing an interactive argument to \\[browse-url], or specific browser 431Passing an interactive argument to \\[browse-url], or specific browser
432commands reverses the effect of this variable. Requires Netscape version 432commands reverses the effect of this variable. Requires Netscape version
4331.1N or later or XMosaic version 2.5 or later if using those browsers." 4331.1N or later or XMosaic version 2.5 or later if using those browsers."
@@ -435,33 +435,32 @@ commands reverses the effect of this variable. Requires Netscape version
435 :group 'browse-url) 435 :group 'browse-url)
436 436
437(defcustom browse-url-mosaic-program "xmosaic" 437(defcustom browse-url-mosaic-program "xmosaic"
438 "*The name by which to invoke Mosaic (or mMosaic)." 438 "The name by which to invoke Mosaic (or mMosaic)."
439 :type 'string 439 :type 'string
440 :version "20.3" 440 :version "20.3"
441 :group 'browse-url) 441 :group 'browse-url)
442 442
443(defcustom browse-url-mosaic-arguments nil 443(defcustom browse-url-mosaic-arguments nil
444 "*A list of strings to pass to Mosaic as arguments." 444 "A list of strings to pass to Mosaic as arguments."
445 :type '(repeat (string :tag "Argument")) 445 :type '(repeat (string :tag "Argument"))
446 :group 'browse-url) 446 :group 'browse-url)
447 447
448(defcustom browse-url-mosaic-pidfile "~/.mosaicpid" 448(defcustom browse-url-mosaic-pidfile "~/.mosaicpid"
449 "*The name of the pidfile created by Mosaic." 449 "The name of the pidfile created by Mosaic."
450 :type 'string 450 :type 'string
451 :group 'browse-url) 451 :group 'browse-url)
452 452
453(defcustom browse-url-filename-alist 453(defcustom browse-url-filename-alist
454 (\` ; Backquote syntax won't work. 454 `(("^/\\(ftp@\\|anonymous@\\)?\\([^:]+\\):/*" . "ftp://\\2/")
455 (("^/\\(ftp@\\|anonymous@\\)?\\([^:]+\\):/*" . "ftp://\\2/")
456 ;; The above loses the username to avoid the browser prompting for 455 ;; The above loses the username to avoid the browser prompting for
457 ;; it in anonymous cases. If it's not anonymous the next regexp 456 ;; it in anonymous cases. If it's not anonymous the next regexp
458 ;; applies. 457 ;; applies.
459 ("^/\\([^:@]+@\\)?\\([^:]+\\):/*" . "ftp://\\1\\2/") 458 ("^/\\([^:@]+@\\)?\\([^:]+\\):/*" . "ftp://\\1\\2/")
460 (,@ (if (memq system-type '(windows-nt ms-dos cygwin)) 459 ,@(if (memq system-type '(windows-nt ms-dos cygwin))
461 '(("^\\([a-zA-Z]:\\)[\\/]" . "file:\\1/") 460 '(("^\\([a-zA-Z]:\\)[\\/]" . "file:\\1/")
462 ("^[\\/][\\/]+" . "file://")))) 461 ("^[\\/][\\/]+" . "file://")))
463 ("^/+" . "file:/"))) 462 ("^/+" . "file:/"))
464 "*An alist of (REGEXP . STRING) pairs used by `browse-url-of-file'. 463 "An alist of (REGEXP . STRING) pairs used by `browse-url-of-file'.
465Any substring of a filename matching one of the REGEXPs is replaced by 464Any substring of a filename matching one of the REGEXPs is replaced by
466the corresponding STRING using `replace-match', not treating STRING 465the corresponding STRING using `replace-match', not treating STRING
467literally. All pairs are applied in the order given. The default 466literally. All pairs are applied in the order given. The default
@@ -476,8 +475,7 @@ address to an HTTP URL:
476 \"http://www.acme.co.uk/\") 475 \"http://www.acme.co.uk/\")
477 (\"^/\\(ftp@\\|anonymous@\\)?\\([^:]+\\):/*\" . \"ftp://\\2/\") 476 (\"^/\\(ftp@\\|anonymous@\\)?\\([^:]+\\):/*\" . \"ftp://\\2/\")
478 (\"^/\\([^:@]+@\\)?\\([^:]+\\):/*\" . \"ftp://\\1\\2/\") 477 (\"^/\\([^:@]+@\\)?\\([^:]+\\):/*\" . \"ftp://\\1\\2/\")
479 (\"^/+\" . \"file:/\"))) 478 (\"^/+\" . \"file:/\")))"
480"
481 :type '(repeat (cons :format "%v" 479 :type '(repeat (cons :format "%v"
482 (regexp :tag "Regexp") 480 (regexp :tag "Regexp")
483 (string :tag "Replacement"))) 481 (string :tag "Replacement")))
@@ -485,13 +483,13 @@ address to an HTTP URL:
485 :group 'browse-url) 483 :group 'browse-url)
486 484
487(defcustom browse-url-save-file nil 485(defcustom browse-url-save-file nil
488 "*If non-nil, save the buffer before displaying its file. 486 "If non-nil, save the buffer before displaying its file.
489Used by the `browse-url-of-file' command." 487Used by the `browse-url-of-file' command."
490 :type 'boolean 488 :type 'boolean
491 :group 'browse-url) 489 :group 'browse-url)
492 490
493(defcustom browse-url-of-file-hook nil 491(defcustom browse-url-of-file-hook nil
494 "*Run after `browse-url-of-file' has asked a browser to load a file. 492 "Run after `browse-url-of-file' has asked a browser to load a file.
495 493
496Set this to `browse-url-netscape-reload' to force Netscape to load the 494Set this to `browse-url-netscape-reload' to force Netscape to load the
497file rather than displaying a cached copy." 495file rather than displaying a cached copy."
@@ -500,14 +498,14 @@ file rather than displaying a cached copy."
500 :group 'browse-url) 498 :group 'browse-url)
501 499
502(defcustom browse-url-CCI-port 3003 500(defcustom browse-url-CCI-port 3003
503 "*Port to access XMosaic via CCI. 501 "Port to access XMosaic via CCI.
504This can be any number between 1024 and 65535 but must correspond to 502This can be any number between 1024 and 65535 but must correspond to
505the value set in the browser." 503the value set in the browser."
506 :type 'integer 504 :type 'integer
507 :group 'browse-url) 505 :group 'browse-url)
508 506
509(defcustom browse-url-CCI-host "localhost" 507(defcustom browse-url-CCI-host "localhost"
510 "*Host to access XMosaic via CCI. 508 "Host to access XMosaic via CCI.
511This should be the host name of the machine running XMosaic with CCI 509This should be the host name of the machine running XMosaic with CCI
512enabled. The port number should be set in `browse-url-CCI-port'." 510enabled. The port number should be set in `browse-url-CCI-port'."
513 :type 'string 511 :type 'string
@@ -517,20 +515,20 @@ enabled. The port number should be set in `browse-url-CCI-port'."
517(make-variable-buffer-local 'browse-url-temp-file-name) 515(make-variable-buffer-local 'browse-url-temp-file-name)
518 516
519(defcustom browse-url-xterm-program "xterm" 517(defcustom browse-url-xterm-program "xterm"
520 "*The name of the terminal emulator used by `browse-url-lynx-xterm'. 518 "The name of the terminal emulator used by `browse-url-lynx-xterm'.
521This might, for instance, be a separate color version of xterm." 519This might, for instance, be a separate color version of xterm."
522 :type 'string 520 :type 'string
523 :group 'browse-url) 521 :group 'browse-url)
524 522
525(defcustom browse-url-xterm-args nil 523(defcustom browse-url-xterm-args nil
526 "*A list of strings defining options for `browse-url-xterm-program'. 524 "A list of strings defining options for `browse-url-xterm-program'.
527These might set its size, for instance." 525These might set its size, for instance."
528 :type '(repeat (string :tag "Argument")) 526 :type '(repeat (string :tag "Argument"))
529 :group 'browse-url) 527 :group 'browse-url)
530 528
531(defcustom browse-url-lynx-emacs-args (and (not window-system) 529(defcustom browse-url-lynx-emacs-args (and (not window-system)
532 '("-show_cursor")) 530 '("-show_cursor"))
533 "*A list of strings defining options for Lynx in an Emacs buffer. 531 "A list of strings defining options for Lynx in an Emacs buffer.
534 532
535The default is none in a window system, otherwise `-show_cursor' to 533The default is none in a window system, otherwise `-show_cursor' to
536indicate the position of the current link in the absence of 534indicate the position of the current link in the absence of
@@ -540,44 +538,43 @@ highlighting, assuming the normal default for showing the cursor."
540 :group 'browse-url) 538 :group 'browse-url)
541 539
542(defcustom browse-url-gnudoit-program "gnudoit" 540(defcustom browse-url-gnudoit-program "gnudoit"
543 "*The name of the `gnudoit' program used by `browse-url-w3-gnudoit'." 541 "The name of the `gnudoit' program used by `browse-url-w3-gnudoit'."
544 :type 'string 542 :type 'string
545 :group 'browse-url) 543 :group 'browse-url)
546 544
547(defcustom browse-url-gnudoit-args '("-q") 545(defcustom browse-url-gnudoit-args '("-q")
548 "*A list of strings defining options for `browse-url-gnudoit-program'. 546 "A list of strings defining options for `browse-url-gnudoit-program'.
549These might set the port, for instance." 547These might set the port, for instance."
550 :type '(repeat (string :tag "Argument")) 548 :type '(repeat (string :tag "Argument"))
551 :group 'browse-url) 549 :group 'browse-url)
552 550
553(defcustom browse-url-generic-program nil 551(defcustom browse-url-generic-program nil
554 "*The name of the browser program used by `browse-url-generic'." 552 "The name of the browser program used by `browse-url-generic'."
555 :type '(choice string (const :tag "None" nil)) 553 :type '(choice string (const :tag "None" nil))
556 :group 'browse-url) 554 :group 'browse-url)
557 555
558(defcustom browse-url-generic-args nil 556(defcustom browse-url-generic-args nil
559 "*A list of strings defining options for `browse-url-generic-program'." 557 "A list of strings defining options for `browse-url-generic-program'."
560 :type '(repeat (string :tag "Argument")) 558 :type '(repeat (string :tag "Argument"))
561 :group 'browse-url) 559 :group 'browse-url)
562 560
563(defcustom browse-url-temp-dir temporary-file-directory 561(defcustom browse-url-temp-dir temporary-file-directory
564 "*The name of a directory for browse-url's temporary files. 562 "The name of a directory for browse-url's temporary files.
565Such files are generated by functions like `browse-url-of-region'. 563Such files are generated by functions like `browse-url-of-region'.
566You might want to set this to somewhere with restricted read permissions 564You might want to set this to somewhere with restricted read permissions
567for privacy's sake." 565for privacy's sake."
568 :type 'string 566 :type 'string
569 :group 'browse-url) 567 :group 'browse-url)
570 568
571(defcustom browse-url-netscape-version 569(defcustom browse-url-netscape-version 3
572 3 570 "The version of Netscape you are using.
573 "*The version of Netscape you are using.
574This affects how URL reloading is done; the mechanism changed 571This affects how URL reloading is done; the mechanism changed
575incompatibly at version 4." 572incompatibly at version 4."
576 :type 'number 573 :type 'number
577 :group 'browse-url) 574 :group 'browse-url)
578 575
579(defcustom browse-url-lynx-input-field 'avoid 576(defcustom browse-url-lynx-input-field 'avoid
580 "*Action on selecting an existing Lynx buffer at an input field. 577 "Action on selecting an existing Lynx buffer at an input field.
581What to do when sending a new URL to an existing Lynx buffer in Emacs 578What to do when sending a new URL to an existing Lynx buffer in Emacs
582if the Lynx cursor is on an input field (in which case the `g' command 579if the Lynx cursor is on an input field (in which case the `g' command
583would be entered as data). Such fields are recognized by the 580would be entered as data). Such fields are recognized by the
@@ -591,23 +588,23 @@ down (this *won't* always work)."
591 :group 'browse-url) 588 :group 'browse-url)
592 589
593(defcustom browse-url-lynx-input-attempts 10 590(defcustom browse-url-lynx-input-attempts 10
594 "*How many times to try to move down from a series of lynx input fields." 591 "How many times to try to move down from a series of lynx input fields."
595 :type 'integer 592 :type 'integer
596 :group 'browse-url) 593 :group 'browse-url)
597 594
598(defcustom browse-url-lynx-input-delay 0.2 595(defcustom browse-url-lynx-input-delay 0.2
599 "*How many seconds to wait for lynx between moves down from an input field." 596 "How many seconds to wait for lynx between moves down from an input field."
600 :type 'number 597 :type 'number
601 :group 'browse-url) 598 :group 'browse-url)
602 599
603(defcustom browse-url-kde-program "kfmclient" 600(defcustom browse-url-kde-program "kfmclient"
604 "*The name by which to invoke the KDE web browser." 601 "The name by which to invoke the KDE web browser."
605 :type 'string 602 :type 'string
606 :version "21.1" 603 :version "21.1"
607 :group 'browse-url) 604 :group 'browse-url)
608 605
609(defcustom browse-url-kde-args '("openURL") 606(defcustom browse-url-kde-args '("openURL")
610 "*A list of strings defining options for `browse-url-kde-program'." 607 "A list of strings defining options for `browse-url-kde-program'."
611 :type '(repeat (string :tag "Argument")) 608 :type '(repeat (string :tag "Argument"))
612 :group 'browse-url) 609 :group 'browse-url)
613 610
@@ -669,8 +666,7 @@ interactively. Turn the filename into a URL with function
669 (error "Current buffer has no file")) 666 (error "Current buffer has no file"))
670 (let ((buf (get-file-buffer file))) 667 (let ((buf (get-file-buffer file)))
671 (if buf 668 (if buf
672 (save-excursion 669 (with-current-buffer buf
673 (set-buffer buf)
674 (cond ((not (buffer-modified-p))) 670 (cond ((not (buffer-modified-p)))
675 (browse-url-save-file (save-buffer)) 671 (browse-url-save-file (save-buffer))
676 (t (message "%s modified since last save" file)))))) 672 (t (message "%s modified since last save" file))))))
@@ -1171,6 +1167,20 @@ used instead of `browse-url-new-window-flag'."
1171 (append browse-url-epiphany-startup-arguments (list url)))))) 1167 (append browse-url-epiphany-startup-arguments (list url))))))
1172 1168
1173;;;###autoload 1169;;;###autoload
1170(defun browse-url-emacs (url &optional new-window)
1171 "Ask Emacs to load URL into a buffer and show it in another window."
1172 (interactive (browse-url-interactive-arg "URL: "))
1173 (require 'url-handlers)
1174 (let ((file-name-handler-alist
1175 (cons (cons url-handler-regexp 'url-file-handler)
1176 file-name-handler-alist)))
1177 ;; Ignore `new-window': with all other browsers the URL is always shown
1178 ;; in another window than the current Emacs one since it's shown in
1179 ;; another application's window.
1180 ;; (if new-window (find-file-other-window url) (find-file url))
1181 (find-file-other-window url)))
1182
1183;;;###autoload
1174(defun browse-url-gnome-moz (url &optional new-window) 1184(defun browse-url-gnome-moz (url &optional new-window)
1175 "Ask Mozilla/Netscape to load URL via the GNOME program `gnome-moz-remote'. 1185 "Ask Mozilla/Netscape to load URL via the GNOME program `gnome-moz-remote'.
1176Default to the URL around or before point. The strings in variable 1186Default to the URL around or before point. The strings in variable
@@ -1257,8 +1267,7 @@ Default to the URL around or before point. Runs the program in the
1257variable `browse-url-grail'." 1267variable `browse-url-grail'."
1258 (interactive (browse-url-interactive-arg "Grail URL: ")) 1268 (interactive (browse-url-interactive-arg "Grail URL: "))
1259 (message "Sending URL to Grail...") 1269 (message "Sending URL to Grail...")
1260 (save-excursion 1270 (with-current-buffer (get-buffer-create " *Shell Command Output*")
1261 (set-buffer (get-buffer-create " *Shell Command Output*"))
1262 (erase-buffer) 1271 (erase-buffer)
1263 ;; don't worry about this failing. 1272 ;; don't worry about this failing.
1264 (if (browse-url-maybe-new-window new-window) 1273 (if (browse-url-maybe-new-window new-window)
@@ -1428,8 +1437,7 @@ used instead of `browse-url-new-window-flag'."
1428Default to the URL around or before point." 1437Default to the URL around or before point."
1429 (interactive (browse-url-interactive-arg "MMM URL: ")) 1438 (interactive (browse-url-interactive-arg "MMM URL: "))
1430 (message "Sending URL to MMM...") 1439 (message "Sending URL to MMM...")
1431 (save-excursion 1440 (with-current-buffer (get-buffer-create " *Shell Command Output*")
1432 (set-buffer (get-buffer-create " *Shell Command Output*"))
1433 (erase-buffer) 1441 (erase-buffer)
1434 ;; mmm_remote just SEGVs if the file isn't there... 1442 ;; mmm_remote just SEGVs if the file isn't there...
1435 (if (or (file-exists-p (expand-file-name "~/.mmm_remote")) 1443 (if (or (file-exists-p (expand-file-name "~/.mmm_remote"))
@@ -1507,5 +1515,5 @@ Default to the URL around or before point."
1507 1515
1508(provide 'browse-url) 1516(provide 'browse-url)
1509 1517
1510;;; arch-tag: d2079573-5c06-4097-9598-f550fba19430 1518;; arch-tag: d2079573-5c06-4097-9598-f550fba19430
1511;;; browse-url.el ends here 1519;;; browse-url.el ends here
diff --git a/lisp/net/socks.el b/lisp/net/socks.el
index 72f6b03570b..5a2364c652c 100644
--- a/lisp/net/socks.el
+++ b/lisp/net/socks.el
@@ -263,10 +263,9 @@ If PATTERN is omitted, it defaults to \"[ \\f\\t\\n\\r\\v]+\"."
263(defconst socks-state-connected 4) 263(defconst socks-state-connected 4)
264 264
265(defmacro socks-wait-for-state-change (proc htable cur-state) 265(defmacro socks-wait-for-state-change (proc htable cur-state)
266 (` 266 `(while (and (= (gethash 'state ,htable) ,cur-state)
267 (while (and (= (gethash 'state (, htable)) (, cur-state)) 267 (memq (process-status ,proc) '(run open)))
268 (memq (process-status (, proc)) '(run open))) 268 (accept-process-output ,proc socks-timeout)))
269 (accept-process-output (, proc) socks-timeout))))
270 269
271(defun socks-filter (proc string) 270(defun socks-filter (proc string)
272 (let ((info (gethash proc socks-connections)) 271 (let ((info (gethash proc socks-connections))
@@ -493,10 +492,9 @@ version.")
493 (if (not (and (file-exists-p socks-services-file) 492 (if (not (and (file-exists-p socks-services-file)
494 (file-readable-p socks-services-file))) 493 (file-readable-p socks-services-file)))
495 (error "Could not find services file: %s" socks-services-file)) 494 (error "Could not find services file: %s" socks-services-file))
496 (save-excursion 495 (clrhash socks-tcp-services)
497 (clrhash socks-tcp-services) 496 (clrhash socks-udp-services)
498 (clrhash socks-udp-services) 497 (with-current-buffer (get-buffer-create " *socks-tmp*")
499 (set-buffer (get-buffer-create " *socks-tmp*"))
500 (erase-buffer) 498 (erase-buffer)
501 (insert-file-contents socks-services-file) 499 (insert-file-contents socks-services-file)
502 ;; Nuke comments 500 ;; Nuke comments
@@ -566,10 +564,8 @@ version.")
566(defconst socks-username/password-auth-version 1) 564(defconst socks-username/password-auth-version 1)
567 565
568(defun socks-username/password-auth-filter (proc str) 566(defun socks-username/password-auth-filter (proc str)
569 (let ((info (gethash proc socks-connections)) 567 (let ((info (gethash proc socks-connections)))
570 state desired-len)
571 (or info (error "socks-filter called on non-SOCKS connection %S" proc)) 568 (or info (error "socks-filter called on non-SOCKS connection %S" proc))
572 (setq state (gethash 'state info))
573 (puthash 'scratch (concat (gethash 'scratch info) str) info) 569 (puthash 'scratch (concat (gethash 'scratch info) str) info)
574 (if (< (length (gethash 'scratch info)) 2) 570 (if (< (length (gethash 'scratch info)) 2)
575 nil 571 nil
@@ -629,8 +625,7 @@ version.")
629 socks-nslookup-program host)) 625 socks-nslookup-program host))
630 (res host)) 626 (res host))
631 (set-process-query-on-exit-flag proc nil) 627 (set-process-query-on-exit-flag proc nil)
632 (save-excursion 628 (with-current-buffer (process-buffer proc)
633 (set-buffer (process-buffer proc))
634 (while (progn 629 (while (progn
635 (accept-process-output proc) 630 (accept-process-output proc)
636 (memq (process-status proc) '(run open)))) 631 (memq (process-status proc) '(run open))))
diff --git a/lisp/pcvs.el b/lisp/pcvs.el
index aeaea995583..6f205772249 100644
--- a/lisp/pcvs.el
+++ b/lisp/pcvs.el
@@ -1904,7 +1904,7 @@ With prefix argument, prompt for cvs flags."
1904 (interactive (list (cvs-flags-query 'cvs-status-flags "cvs status flags"))) 1904 (interactive (list (cvs-flags-query 'cvs-status-flags "cvs status flags")))
1905 (cvs-mode-do "status" flags nil :dont-change-disc t :show t 1905 (cvs-mode-do "status" flags nil :dont-change-disc t :show t
1906 :postproc (when (eq cvs-auto-remove-handled 'status) 1906 :postproc (when (eq cvs-auto-remove-handled 'status)
1907 '((with-current-buffer ,(current-buffer) 1907 `((with-current-buffer ,(current-buffer)
1908 (cvs-mode-remove-handled)))))) 1908 (cvs-mode-remove-handled))))))
1909 1909
1910(defun-cvs-mode (cvs-mode-tree . SIMPLE) (flags) 1910(defun-cvs-mode (cvs-mode-tree . SIMPLE) (flags)
diff --git a/lisp/progmodes/ada-mode.el b/lisp/progmodes/ada-mode.el
index aa3aea0d71b..478a07bc3b6 100644
--- a/lisp/progmodes/ada-mode.el
+++ b/lisp/progmodes/ada-mode.el
@@ -27,103 +27,103 @@
27;; Boston, MA 02110-1301, USA. 27;; Boston, MA 02110-1301, USA.
28 28
29;;; Commentary: 29;;; Commentary:
30;;; This mode is a major mode for editing Ada code. This is a major 30;; This mode is a major mode for editing Ada code. This is a major
31;;; rewrite of the file packaged with Emacs-20. The Ada mode is 31;; rewrite of the file packaged with Emacs-20. The Ada mode is
32;;; composed of four Lisp files: ada-mode.el, ada-xref.el, ada-prj.el 32;; composed of four Lisp files: ada-mode.el, ada-xref.el, ada-prj.el
33;;; and ada-stmt.el. Only this file (ada-mode.el) is completely 33;; and ada-stmt.el. Only this file (ada-mode.el) is completely
34;;; independent from the GNU Ada compiler GNAT, distributed by Ada 34;; independent from the GNU Ada compiler GNAT, distributed by Ada
35;;; Core Technologies. All the other files rely heavily on features 35;; Core Technologies. All the other files rely heavily on features
36;;; provided only by GNAT. 36;; provided only by GNAT.
37;;; 37;;
38;;; Note: this mode will not work with Emacs 19. If you are on a VMS 38;; Note: this mode will not work with Emacs 19. If you are on a VMS
39;;; system, where the latest version of Emacs is 19.28, you will need 39;; system, where the latest version of Emacs is 19.28, you will need
40;;; another file, called ada-vms.el, that provides some required 40;; another file, called ada-vms.el, that provides some required
41;;; functions. 41;; functions.
42 42
43;;; Usage: 43;;; Usage:
44;;; Emacs should enter Ada mode automatically when you load an Ada file. 44;; Emacs should enter Ada mode automatically when you load an Ada file.
45;;; By default, the valid extensions for Ada files are .ads, .adb or .ada 45;; By default, the valid extensions for Ada files are .ads, .adb or .ada
46;;; If the ada-mode does not start automatically, then simply type the 46;; If the ada-mode does not start automatically, then simply type the
47;;; following command : 47;; following command :
48;;; M-x ada-mode 48;; M-x ada-mode
49;;; 49;;
50;;; By default, ada-mode is configured to take full advantage of the GNAT 50;; By default, ada-mode is configured to take full advantage of the GNAT
51;;; compiler (the menus will include the cross-referencing features,...). 51;; compiler (the menus will include the cross-referencing features,...).
52;;; If you are using another compiler, you might want to set the following 52;; If you are using another compiler, you might want to set the following
53;;; variable in your .emacs (Note: do not set this in the ada-mode-hook, it 53;; variable in your .emacs (Note: do not set this in the ada-mode-hook, it
54;;; won't work) : 54;; won't work) :
55;;; (setq ada-which-compiler 'generic) 55;; (setq ada-which-compiler 'generic)
56;;; 56;;
57;;; This mode requires find-file.el to be present on your system. 57;; This mode requires find-file.el to be present on your system.
58 58
59;;; History: 59;;; History:
60;;; The first Ada mode for GNU Emacs was written by V. Broman in 60;; The first Ada mode for GNU Emacs was written by V. Broman in
61;;; 1985. He based his work on the already existing Modula-2 mode. 61;; 1985. He based his work on the already existing Modula-2 mode.
62;;; This was distributed as ada.el in versions of Emacs prior to 19.29. 62;; This was distributed as ada.el in versions of Emacs prior to 19.29.
63;;; 63;;
64;;; Lynn Slater wrote an extensive Ada mode in 1989. It consisted of 64;; Lynn Slater wrote an extensive Ada mode in 1989. It consisted of
65;;; several files with support for dired commands and other nice 65;; several files with support for dired commands and other nice
66;;; things. It is currently available from the PAL 66;; things. It is currently available from the PAL
67;;; (wuarchive.wustl.edu:/languages/ada) as ada-mode-1.06a.tar.Z. 67;; (wuarchive.wustl.edu:/languages/ada) as ada-mode-1.06a.tar.Z.
68;;; 68;;
69;;; The probably very first Ada mode (called electric-ada.el) was 69;; The probably very first Ada mode (called electric-ada.el) was
70;;; written by Steven D. Litvintchouk and Steven M. Rosen for the 70;; written by Steven D. Litvintchouk and Steven M. Rosen for the
71;;; Gosling Emacs. L. Slater based his development on ada.el and 71;; Gosling Emacs. L. Slater based his development on ada.el and
72;;; electric-ada.el. 72;; electric-ada.el.
73;;; 73;;
74;;; A complete rewrite by M. Heritsch and R. Ebert has been done. 74;; A complete rewrite by M. Heritsch and R. Ebert has been done.
75;;; Some ideas from the Ada mode mailing list have been 75;; Some ideas from the Ada mode mailing list have been
76;;; added. Some of the functionality of L. Slater's mode has not 76;; added. Some of the functionality of L. Slater's mode has not
77;;; (yet) been recoded in this new mode. Perhaps you prefer sticking 77;; (yet) been recoded in this new mode. Perhaps you prefer sticking
78;;; to his version. 78;; to his version.
79;;; 79;;
80;;; A complete rewrite for Emacs-20 / GNAT-3.11 has been done by Ada Core 80;; A complete rewrite for Emacs-20 / GNAT-3.11 has been done by Ada Core
81;;; Technologies. 81;; Technologies.
82 82
83;;; Credits: 83;;; Credits:
84;;; Many thanks to John McCabe <john@assen.demon.co.uk> for sending so 84;; Many thanks to John McCabe <john@assen.demon.co.uk> for sending so
85;;; many patches included in this package. 85;; many patches included in this package.
86;;; Christian Egli <Christian.Egli@hcsd.hac.com>: 86;; Christian Egli <Christian.Egli@hcsd.hac.com>:
87;;; ada-imenu-generic-expression 87;; ada-imenu-generic-expression
88;;; Many thanks also to the following persons that have contributed 88;; Many thanks also to the following persons that have contributed
89;;; to the ada-mode 89;; to the ada-mode
90;;; Philippe Waroquiers (PW) <philippe@cfmu.eurocontrol.be> in particular, 90;; Philippe Waroquiers (PW) <philippe@cfmu.eurocontrol.be> in particular,
91;;; woodruff@stc.llnl.gov (John Woodruff) 91;; woodruff@stc.llnl.gov (John Woodruff)
92;;; jj@ddci.dk (Jesper Joergensen) 92;; jj@ddci.dk (Jesper Joergensen)
93;;; gse@ocsystems.com (Scott Evans) 93;; gse@ocsystems.com (Scott Evans)
94;;; comar@gnat.com (Cyrille Comar) 94;; comar@gnat.com (Cyrille Comar)
95;;; stephen.leake@gsfc.nasa.gov (Stephen Leake) 95;; stephen.leake@gsfc.nasa.gov (Stephen Leake)
96;;; robin-reply@reagans.org 96;; robin-reply@reagans.org
97;;; and others for their valuable hints. 97;; and others for their valuable hints.
98 98
99;;; Code: 99;;; Code:
100;;; Note: Every function in this package is compiler-independent. 100;; Note: Every function in this package is compiler-independent.
101;;; The names start with ada- 101;; The names start with ada-
102;;; The variables that the user can edit can all be modified through 102;; The variables that the user can edit can all be modified through
103;;; the customize mode. They are sorted in alphabetical order in this 103;; the customize mode. They are sorted in alphabetical order in this
104;;; file. 104;; file.
105 105
106;;; Supported packages. 106;; Supported packages.
107;;; This package supports a number of other Emacs modes. These other modes 107;; This package supports a number of other Emacs modes. These other modes
108;;; should be loaded before the ada-mode, which will then setup some variables 108;; should be loaded before the ada-mode, which will then setup some variables
109;;; to improve the support for Ada code. 109;; to improve the support for Ada code.
110;;; Here is the list of these modes: 110;; Here is the list of these modes:
111;;; `which-function-mode': Display the name of the subprogram the cursor is 111;; `which-function-mode': Display the name of the subprogram the cursor is
112;;; in in the mode line. 112;; in in the mode line.
113;;; `outline-mode': Provides the capability to collapse or expand the code 113;; `outline-mode': Provides the capability to collapse or expand the code
114;;; for specific language constructs, for instance if you want to hide the 114;; for specific language constructs, for instance if you want to hide the
115;;; code corresponding to a subprogram 115;; code corresponding to a subprogram
116;;; `align': This mode is now provided with Emacs 21, but can also be 116;; `align': This mode is now provided with Emacs 21, but can also be
117;;; installed manually for older versions of Emacs. It provides the 117;; installed manually for older versions of Emacs. It provides the
118;;; capability to automatically realign the selected region (for instance 118;; capability to automatically realign the selected region (for instance
119;;; all ':=', ':' and '--' will be aligned on top of each other. 119;; all ':=', ':' and '--' will be aligned on top of each other.
120;;; `imenu': Provides a menu with the list of entities defined in the current 120;; `imenu': Provides a menu with the list of entities defined in the current
121;;; buffer, and an easy way to jump to any of them 121;; buffer, and an easy way to jump to any of them
122;;; `speedbar': Provides a separate file browser, and the capability for each 122;; `speedbar': Provides a separate file browser, and the capability for each
123;;; file to see the list of entities defined in it and to jump to them 123;; file to see the list of entities defined in it and to jump to them
124;;; easily 124;; easily
125;;; `abbrev-mode': Provides the capability to define abbreviations, which 125;; `abbrev-mode': Provides the capability to define abbreviations, which
126;;; are automatically expanded when you type them. See the Emacs manual. 126;; are automatically expanded when you type them. See the Emacs manual.
127 127
128(require 'find-file nil t) 128(require 'find-file nil t)
129(require 'align nil t) 129(require 'align nil t)
@@ -134,18 +134,6 @@
134(defvar ispell-check-comments) 134(defvar ispell-check-comments)
135(defvar skeleton-further-elements) 135(defvar skeleton-further-elements)
136 136
137(eval-and-compile
138 (defun ada-check-emacs-version (major minor &optional is-xemacs)
139 "Return t if Emacs's version is greater or equal to MAJOR.MINOR.
140If IS-XEMACS is non-nil, check for XEmacs instead of Emacs."
141 (let ((xemacs-running (or (string-match "Lucid" emacs-version)
142 (string-match "XEmacs" emacs-version))))
143 (and (or (and is-xemacs xemacs-running)
144 (not (or is-xemacs xemacs-running)))
145 (or (> emacs-major-version major)
146 (and (= emacs-major-version major)
147 (>= emacs-minor-version minor)))))))
148
149(defun ada-mode-version () 137(defun ada-mode-version ()
150 "Return Ada mode version." 138 "Return Ada mode version."
151 (interactive) 139 (interactive)
@@ -612,7 +600,7 @@ This variable defines several rules to use to align different lines.")
612 "\\(\\(\\sw\\|[_.]\\)+\\)" 600 "\\(\\(\\sw\\|[_.]\\)+\\)"
613 "\\)") 601 "\\)")
614 "Regexp matching Ada subprogram start. 602 "Regexp matching Ada subprogram start.
615The actual start is at (match-beginning 4). The name is in (match-string 5).") 603The actual start is at (match-beginning 4). The name is in (match-string 5).")
616 604
617(defconst ada-name-regexp 605(defconst ada-name-regexp
618 "\\([a-zA-Z][a-zA-Z0-9_.']*[a-zA-Z0-9]\\)" 606 "\\([a-zA-Z][a-zA-Z0-9_.']*[a-zA-Z0-9]\\)"
@@ -1192,13 +1180,9 @@ If you use ada-xref.el:
1192 ;; the comment and the text. We do not want any, this is already 1180 ;; the comment and the text. We do not want any, this is already
1193 ;; included in comment-start 1181 ;; included in comment-start
1194 (unless (featurep 'xemacs) 1182 (unless (featurep 'xemacs)
1195 (progn 1183 (set (make-local-variable 'parse-sexp-ignore-comments) t)
1196 (if (ada-check-emacs-version 20 3) 1184 (set (make-local-variable 'comment-padding) 0)
1197 (progn 1185 (set (make-local-variable 'parse-sexp-lookup-properties) t))
1198 (set (make-local-variable 'parse-sexp-ignore-comments) t)
1199 (set (make-local-variable 'comment-padding) 0)))
1200 (set (make-local-variable 'parse-sexp-lookup-properties) t)
1201 ))
1202 1186
1203 (set 'case-fold-search t) 1187 (set 'case-fold-search t)
1204 (if (boundp 'imenu-case-fold-search) 1188 (if (boundp 'imenu-case-fold-search)
@@ -1227,6 +1211,7 @@ If you use ada-xref.el:
1227 ;; We need to set some properties for XEmacs, and define some variables 1211 ;; We need to set some properties for XEmacs, and define some variables
1228 ;; for Emacs 1212 ;; for Emacs
1229 1213
1214 ;; FIXME: The Emacs code should work just fine under XEmacs AFAIK. --Stef
1230 (if (featurep 'xemacs) 1215 (if (featurep 'xemacs)
1231 ;; XEmacs 1216 ;; XEmacs
1232 (put 'ada-mode 'font-lock-defaults 1217 (put 'ada-mode 'font-lock-defaults
@@ -1414,10 +1399,9 @@ If you use ada-xref.el:
1414;; transient-mark-mode and mark-active are not defined in XEmacs 1399;; transient-mark-mode and mark-active are not defined in XEmacs
1415(defun ada-region-selected () 1400(defun ada-region-selected ()
1416 "Return t if a region has been selected by the user and is still active." 1401 "Return t if a region has been selected by the user and is still active."
1417 (or (and (featurep 'xemacs) (funcall (symbol-function 'region-active-p))) 1402 (if (featurep 'xemacs)
1418 (and (not (featurep 'xemacs)) 1403 (region-active-p)
1419 (symbol-value 'transient-mark-mode) 1404 (and transient-mark-mode mark-active)))
1420 (symbol-value 'mark-active))))
1421 1405
1422 1406
1423;;----------------------------------------------------------------- 1407;;-----------------------------------------------------------------
@@ -4041,7 +4025,7 @@ Returns a cons cell of begin and end of match data or nil, if not found.
4041If BACKWARD is non-nil, search backward; search forward otherwise. 4025If BACKWARD is non-nil, search backward; search forward otherwise.
4042The search stops at pos LIMIT. 4026The search stops at pos LIMIT.
4043If PARAMLISTS is nil, ignore parameter lists. 4027If PARAMLISTS is nil, ignore parameter lists.
4044The search is done using SEARCH-FUNC. SEARCH-FUNC can be optimized 4028The search is done using SEARCH-FUNC. SEARCH-FUNC can be optimized
4045in case we are searching for a constant string. 4029in case we are searching for a constant string.
4046Point is moved at the beginning of the SEARCH-RE." 4030Point is moved at the beginning of the SEARCH-RE."
4047 (let (found 4031 (let (found
@@ -4562,9 +4546,7 @@ Moves to 'begin' if in a declarative part."
4562 (define-key ada-mode-map "\t" 'ada-tab) 4546 (define-key ada-mode-map "\t" 'ada-tab)
4563 (define-key ada-mode-map "\C-c\t" 'ada-justified-indent-current) 4547 (define-key ada-mode-map "\C-c\t" 'ada-justified-indent-current)
4564 (define-key ada-mode-map "\C-c\C-l" 'ada-indent-region) 4548 (define-key ada-mode-map "\C-c\C-l" 'ada-indent-region)
4565 (if (featurep 'xemacs) 4549 (define-key ada-mode-map [(shift tab)] 'ada-untab)
4566 (define-key ada-mode-map '(shift tab) 'ada-untab)
4567 (define-key ada-mode-map [(shift tab)] 'ada-untab))
4568 (define-key ada-mode-map "\C-c\C-f" 'ada-format-paramlist) 4550 (define-key ada-mode-map "\C-c\C-f" 'ada-format-paramlist)
4569 ;; We don't want to make meta-characters case-specific. 4551 ;; We don't want to make meta-characters case-specific.
4570 4552
@@ -4587,9 +4569,9 @@ Moves to 'begin' if in a declarative part."
4587 ;; On XEmacs, you can easily specify whether DEL should deletes 4569 ;; On XEmacs, you can easily specify whether DEL should deletes
4588 ;; one character forward or one character backward. Take this into 4570 ;; one character forward or one character backward. Take this into
4589 ;; account 4571 ;; account
4590 (if (boundp 'delete-key-deletes-forward) 4572 (define-key ada-mode-map
4591 (define-key ada-mode-map [backspace] 'backward-delete-char-untabify) 4573 (if (boundp 'delete-key-deletes-forward) [backspace] "\177")
4592 (define-key ada-mode-map "\177" 'backward-delete-char-untabify)) 4574 'backward-delete-char-untabify)
4593 4575
4594 ;; Make body 4576 ;; Make body
4595 (define-key ada-mode-map "\C-c\C-n" 'ada-make-subprogram-body) 4577 (define-key ada-mode-map "\C-c\C-n" 'ada-make-subprogram-body)
@@ -4601,12 +4583,10 @@ Moves to 'begin' if in a declarative part."
4601 ;; The following keys are bound to functions defined in ada-xref.el or 4583 ;; The following keys are bound to functions defined in ada-xref.el or
4602 ;; ada-prj,el., However, RMS rightly thinks that the code should be shared, 4584 ;; ada-prj,el., However, RMS rightly thinks that the code should be shared,
4603 ;; and activated only if the right compiler is used 4585 ;; and activated only if the right compiler is used
4604 (if (featurep 'xemacs) 4586
4605 (progn 4587 (define-key ada-mode-map (if (featurep 'xemacs) '(shift button3) [S-mouse-3])
4606 (define-key ada-mode-map '(shift button3) 'ada-point-and-xref) 4588 'ada-point-and-xref)
4607 (define-key ada-mode-map '(control tab) 'ada-complete-identifier)) 4589 (define-key ada-mode-map [(control tab)] 'ada-complete-identifier)
4608 (define-key ada-mode-map [C-tab] 'ada-complete-identifier)
4609 (define-key ada-mode-map [S-mouse-3] 'ada-point-and-xref))
4610 4590
4611 (define-key ada-mode-map "\C-co" 'ff-find-other-file) 4591 (define-key ada-mode-map "\C-co" 'ff-find-other-file)
4612 (define-key ada-mode-map "\C-c5\C-d" 'ada-goto-declaration-other-frame) 4592 (define-key ada-mode-map "\C-c5\C-d" 'ada-goto-declaration-other-frame)
@@ -5570,5 +5550,5 @@ This function typically is to be hooked into `ff-file-created-hook'."
5570;;; provide ourselves 5550;;; provide ourselves
5571(provide 'ada-mode) 5551(provide 'ada-mode)
5572 5552
5573;;; arch-tag: 1b7d45ec-1698-43b5-8d4a-e479ea023270 5553;; arch-tag: 1b7d45ec-1698-43b5-8d4a-e479ea023270
5574;;; ada-mode.el ends here 5554;;; ada-mode.el ends here
diff --git a/lisp/progmodes/cperl-mode.el b/lisp/progmodes/cperl-mode.el
index 60c2a926cb2..cdfb8870138 100644
--- a/lisp/progmodes/cperl-mode.el
+++ b/lisp/progmodes/cperl-mode.el
@@ -96,7 +96,7 @@
96 nil)) 96 nil))
97 (or (fboundp 'custom-declare-variable) 97 (or (fboundp 'custom-declare-variable)
98 (defmacro defcustom (name val doc &rest arr) 98 (defmacro defcustom (name val doc &rest arr)
99 (` (defvar (, name) (, val) (, doc))))) 99 `(defvar ,name ,val ,doc)))
100 (or (and (fboundp 'custom-declare-variable) 100 (or (and (fboundp 'custom-declare-variable)
101 (string< "19.31" emacs-version)) ; Checked with 19.30: defface does not work 101 (string< "19.31" emacs-version)) ; Checked with 19.30: defface does not work
102 (defmacro defface (&rest arr) 102 (defmacro defface (&rest arr)
@@ -104,52 +104,52 @@
104 ;; Avoid warning (tmp definitions) 104 ;; Avoid warning (tmp definitions)
105 (or (fboundp 'x-color-defined-p) 105 (or (fboundp 'x-color-defined-p)
106 (defmacro x-color-defined-p (col) 106 (defmacro x-color-defined-p (col)
107 (cond ((fboundp 'color-defined-p) (` (color-defined-p (, col)))) 107 (cond ((fboundp 'color-defined-p) `(color-defined-p ,col))
108 ;; XEmacs >= 19.12 108 ;; XEmacs >= 19.12
109 ((fboundp 'valid-color-name-p) (` (valid-color-name-p (, col)))) 109 ((fboundp 'valid-color-name-p) `(valid-color-name-p ,col))
110 ;; XEmacs 19.11 110 ;; XEmacs 19.11
111 ((fboundp 'x-valid-color-name-p) (` (x-valid-color-name-p (, col)))) 111 ((fboundp 'x-valid-color-name-p) `(x-valid-color-name-p ,col))
112 (t '(error "Cannot implement color-defined-p"))))) 112 (t '(error "Cannot implement color-defined-p")))))
113 (defmacro cperl-is-face (arg) ; Takes quoted arg 113 (defmacro cperl-is-face (arg) ; Takes quoted arg
114 (cond ((fboundp 'find-face) 114 (cond ((fboundp 'find-face)
115 (` (find-face (, arg)))) 115 `(find-face ,arg))
116 (;;(and (fboundp 'face-list) 116 (;;(and (fboundp 'face-list)
117 ;; (face-list)) 117 ;; (face-list))
118 (fboundp 'face-list) 118 (fboundp 'face-list)
119 (` (member (, arg) (and (fboundp 'face-list) 119 `(member ,arg (and (fboundp 'face-list)
120 (face-list))))) 120 (face-list))))
121 (t 121 (t
122 (` (boundp (, arg)))))) 122 `(boundp ,arg))))
123 (defmacro cperl-make-face (arg descr) ; Takes unquoted arg 123 (defmacro cperl-make-face (arg descr) ; Takes unquoted arg
124 (cond ((fboundp 'make-face) 124 (cond ((fboundp 'make-face)
125 (` (make-face (quote (, arg))))) 125 `(make-face (quote ,arg)))
126 (t 126 (t
127 (` (defvar (, arg) (quote (, arg)) (, descr)))))) 127 `(defvar ,arg (quote ,arg) ,descr))))
128 (defmacro cperl-force-face (arg descr) ; Takes unquoted arg 128 (defmacro cperl-force-face (arg descr) ; Takes unquoted arg
129 (` (progn 129 `(progn
130 (or (cperl-is-face (quote (, arg))) 130 (or (cperl-is-face (quote ,arg))
131 (cperl-make-face (, arg) (, descr))) 131 (cperl-make-face ,arg ,descr))
132 (or (boundp (quote (, arg))) ; We use unquoted variants too 132 (or (boundp (quote ,arg)) ; We use unquoted variants too
133 (defvar (, arg) (quote (, arg)) (, descr)))))) 133 (defvar ,arg (quote ,arg) ,descr))))
134 (if cperl-xemacs-p 134 (if cperl-xemacs-p
135 (defmacro cperl-etags-snarf-tag (file line) 135 (defmacro cperl-etags-snarf-tag (file line)
136 (` (progn 136 `(progn
137 (beginning-of-line 2) 137 (beginning-of-line 2)
138 (list (, file) (, line))))) 138 (list ,file ,line)))
139 (defmacro cperl-etags-snarf-tag (file line) 139 (defmacro cperl-etags-snarf-tag (file line)
140 (` (etags-snarf-tag)))) 140 `(etags-snarf-tag)))
141 (if cperl-xemacs-p 141 (if cperl-xemacs-p
142 (defmacro cperl-etags-goto-tag-location (elt) 142 (defmacro cperl-etags-goto-tag-location (elt)
143 (`;;(progn 143 ;;(progn
144 ;; (switch-to-buffer (get-file-buffer (elt (, elt) 0))) 144 ;; (switch-to-buffer (get-file-buffer (elt ,elt 0)))
145 ;; (set-buffer (get-file-buffer (elt (, elt) 0))) 145 ;; (set-buffer (get-file-buffer (elt ,elt 0)))
146 ;; Probably will not work due to some save-excursion??? 146 ;; Probably will not work due to some save-excursion???
147 ;; Or save-file-position? 147 ;; Or save-file-position?
148 ;; (message "Did I get to line %s?" (elt (, elt) 1)) 148 ;; (message "Did I get to line %s?" (elt ,elt 1))
149 (goto-line (string-to-int (elt (, elt) 1))))) 149 `(goto-line (string-to-int (elt ,elt 1))))
150 ;;) 150 ;;)
151 (defmacro cperl-etags-goto-tag-location (elt) 151 (defmacro cperl-etags-goto-tag-location (elt)
152 (` (etags-goto-tag-location (, elt)))))) 152 `(etags-goto-tag-location ,elt))))
153 153
154(defconst cperl-xemacs-p (string-match "XEmacs\\|Lucid" emacs-version)) 154(defconst cperl-xemacs-p (string-match "XEmacs\\|Lucid" emacs-version))
155 155
@@ -1794,8 +1794,8 @@ or as help on variables `cperl-tips', `cperl-problems',
1794 ;; This one is obsolete... 1794 ;; This one is obsolete...
1795 (make-local-variable 'vc-header-alist) 1795 (make-local-variable 'vc-header-alist)
1796 (set 'vc-header-alist (or cperl-vc-header-alist ; Avoid warning 1796 (set 'vc-header-alist (or cperl-vc-header-alist ; Avoid warning
1797 (` ((SCCS (, (car cperl-vc-sccs-header))) 1797 `((SCCS ,(car cperl-vc-sccs-header))
1798 (RCS (, (car cperl-vc-rcs-header))))))) 1798 (RCS ,(car cperl-vc-rcs-header)))))
1799 (cond ((boundp 'compilation-error-regexp-alist-alist);; xemacs 20.x 1799 (cond ((boundp 'compilation-error-regexp-alist-alist);; xemacs 20.x
1800 (make-local-variable 'compilation-error-regexp-alist-alist) 1800 (make-local-variable 'compilation-error-regexp-alist-alist)
1801 (set 'compilation-error-regexp-alist-alist 1801 (set 'compilation-error-regexp-alist-alist
@@ -5957,25 +5957,25 @@ indentation and initial hashes. Behaves usually outside of comment."
5957 nil t))) ; local variables, multiple 5957 nil t))) ; local variables, multiple
5958 (font-lock-anchored 5958 (font-lock-anchored
5959 ;; 1=my_etc, 2=white? 3=(+white? 4=white? 5=var 5959 ;; 1=my_etc, 2=white? 3=(+white? 4=white? 5=var
5960 (` ((, (concat "\\<\\(my\\|local\\|our\\)" 5960 `(,(concat "\\<\\(my\\|local\\|our\\)"
5961 cperl-maybe-white-and-comment-rex 5961 cperl-maybe-white-and-comment-rex
5962 "\\((" 5962 "\\(("
5963 cperl-maybe-white-and-comment-rex 5963 cperl-maybe-white-and-comment-rex
5964 "\\)?\\([$@%*]\\([a-zA-Z0-9_:]+\\|[^a-zA-Z0-9_]\\)\\)")) 5964 "\\)?\\([$@%*]\\([a-zA-Z0-9_:]+\\|[^a-zA-Z0-9_]\\)\\)")
5965 (5 (, (if cperl-font-lock-multiline 5965 (5 ,(if cperl-font-lock-multiline
5966 'font-lock-variable-name-face 5966 'font-lock-variable-name-face
5967 '(progn (setq cperl-font-lock-multiline-start 5967 '(progn (setq cperl-font-lock-multiline-start
5968 (match-beginning 0)) 5968 (match-beginning 0))
5969 'font-lock-variable-name-face)))) 5969 'font-lock-variable-name-face)))
5970 ((, (concat "\\=" 5970 (,(concat "\\="
5971 cperl-maybe-white-and-comment-rex 5971 cperl-maybe-white-and-comment-rex
5972 "," 5972 ","
5973 cperl-maybe-white-and-comment-rex 5973 cperl-maybe-white-and-comment-rex
5974 "\\([$@%*]\\([a-zA-Z0-9_:]+\\|[^a-zA-Z0-9_]\\)\\)")) 5974 "\\([$@%*]\\([a-zA-Z0-9_:]+\\|[^a-zA-Z0-9_]\\)\\)")
5975 ;; Bug in font-lock: limit is used not only to limit 5975 ;; Bug in font-lock: limit is used not only to limit
5976 ;; searches, but to set the "extend window for 5976 ;; searches, but to set the "extend window for
5977 ;; facification" property. Thus we need to minimize. 5977 ;; facification" property. Thus we need to minimize.
5978 (, (if cperl-font-lock-multiline 5978 ,(if cperl-font-lock-multiline
5979 '(if (match-beginning 3) 5979 '(if (match-beginning 3)
5980 (save-excursion 5980 (save-excursion
5981 (goto-char (match-beginning 3)) 5981 (goto-char (match-beginning 3))
@@ -5989,8 +5989,8 @@ indentation and initial hashes. Behaves usually outside of comment."
5989 (forward-char -2)) ; disable continued expr 5989 (forward-char -2)) ; disable continued expr
5990 '(if (match-beginning 3) 5990 '(if (match-beginning 3)
5991 (point-max) ; No limit for continuation 5991 (point-max) ; No limit for continuation
5992 (forward-char -2)))) ; disable continued expr 5992 (forward-char -2))) ; disable continued expr
5993 (, (if cperl-font-lock-multiline 5993 ,(if cperl-font-lock-multiline
5994 nil 5994 nil
5995 '(progn ; Do at end 5995 '(progn ; Do at end
5996 ;; "my" may be already fontified (POD), 5996 ;; "my" may be already fontified (POD),
@@ -6003,8 +6003,8 @@ indentation and initial hashes. Behaves usually outside of comment."
6003 (put-text-property 6003 (put-text-property
6004 (1+ cperl-font-lock-multiline-start) (point) 6004 (1+ cperl-font-lock-multiline-start) (point)
6005 'syntax-type 'multiline)) 6005 'syntax-type 'multiline))
6006 (setq cperl-font-lock-multiline-start nil)))) 6006 (setq cperl-font-lock-multiline-start nil)))
6007 (3 font-lock-variable-name-face))))) 6007 (3 font-lock-variable-name-face))))
6008 (t '("^[ \t{}]*\\(my\\|local\\|our\\)[ \t]*\\(([ \t]*\\)?\\([$@%*][a-zA-Z0-9_:]+\\)" 6008 (t '("^[ \t{}]*\\(my\\|local\\|our\\)[ \t]*\\(([ \t]*\\)?\\([$@%*][a-zA-Z0-9_:]+\\)"
6009 3 font-lock-variable-name-face))) 6009 3 font-lock-variable-name-face)))
6010 '("\\<for\\(each\\)?\\([ \t]+\\(my\\|local\\|our\\)\\)?[ \t]*\\(\\$[a-zA-Z_][a-zA-Z_0-9]*\\)[ \t]*(" 6010 '("\\<for\\(each\\)?\\([ \t]+\\(my\\|local\\|our\\)\\)?[ \t]*\\(\\$[a-zA-Z_][a-zA-Z_0-9]*\\)[ \t]*("
diff --git a/lisp/simple.el b/lisp/simple.el
index b5c0dbe93fa..3caade5da85 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -3639,7 +3639,7 @@ Outline mode sets this."
3639 :type 'boolean 3639 :type 'boolean
3640 :group 'editing-basics) 3640 :group 'editing-basics)
3641 3641
3642(defun line-move-invisible-p (pos) 3642(defun invisible-p (pos)
3643 "Return non-nil if the character after POS is currently invisible." 3643 "Return non-nil if the character after POS is currently invisible."
3644 (let ((prop 3644 (let ((prop
3645 (get-char-property pos 'invisible))) 3645 (get-char-property pos 'invisible)))
@@ -3647,6 +3647,7 @@ Outline mode sets this."
3647 prop 3647 prop
3648 (or (memq prop buffer-invisibility-spec) 3648 (or (memq prop buffer-invisibility-spec)
3649 (assq prop buffer-invisibility-spec))))) 3649 (assq prop buffer-invisibility-spec)))))
3650(define-obsolete-function-alias 'line-move-invisible-p 'invisible-p)
3650 3651
3651;; Returns non-nil if partial move was done. 3652;; Returns non-nil if partial move was done.
3652(defun line-move-partial (arg noerror to-end) 3653(defun line-move-partial (arg noerror to-end)
@@ -3767,7 +3768,7 @@ Outline mode sets this."
3767 (while (and (> arg 0) (not done)) 3768 (while (and (> arg 0) (not done))
3768 ;; If the following character is currently invisible, 3769 ;; If the following character is currently invisible,
3769 ;; skip all characters with that same `invisible' property value. 3770 ;; skip all characters with that same `invisible' property value.
3770 (while (and (not (eobp)) (line-move-invisible-p (point))) 3771 (while (and (not (eobp)) (invisible-p (point)))
3771 (goto-char (next-char-property-change (point)))) 3772 (goto-char (next-char-property-change (point))))
3772 ;; Move a line. 3773 ;; Move a line.
3773 ;; We don't use `end-of-line', since we want to escape 3774 ;; We don't use `end-of-line', since we want to escape
@@ -3785,7 +3786,7 @@ Outline mode sets this."
3785 (setq done t))) 3786 (setq done t)))
3786 ((and (> arg 1) ;; Use vertical-motion for last move 3787 ((and (> arg 1) ;; Use vertical-motion for last move
3787 (not (integerp selective-display)) 3788 (not (integerp selective-display))
3788 (not (line-move-invisible-p (point)))) 3789 (not (invisible-p (point))))
3789 ;; We avoid vertical-motion when possible 3790 ;; We avoid vertical-motion when possible
3790 ;; because that has to fontify. 3791 ;; because that has to fontify.
3791 (forward-line 1)) 3792 (forward-line 1))
@@ -3814,7 +3815,7 @@ Outline mode sets this."
3814 (setq done t))) 3815 (setq done t)))
3815 ((and (< arg -1) ;; Use vertical-motion for last move 3816 ((and (< arg -1) ;; Use vertical-motion for last move
3816 (not (integerp selective-display)) 3817 (not (integerp selective-display))
3817 (not (line-move-invisible-p (1- (point))))) 3818 (not (invisible-p (1- (point)))))
3818 (forward-line -1)) 3819 (forward-line -1))
3819 ((zerop (vertical-motion -1)) 3820 ((zerop (vertical-motion -1))
3820 (if (not noerror) 3821 (if (not noerror)
@@ -3826,7 +3827,7 @@ Outline mode sets this."
3826 ;; if our target is the middle of this line. 3827 ;; if our target is the middle of this line.
3827 (or (zerop (or goal-column temporary-goal-column)) 3828 (or (zerop (or goal-column temporary-goal-column))
3828 (< arg 0)) 3829 (< arg 0))
3829 (not (bobp)) (line-move-invisible-p (1- (point)))) 3830 (not (bobp)) (invisible-p (1- (point))))
3830 (goto-char (previous-char-property-change (point)))))))) 3831 (goto-char (previous-char-property-change (point))))))))
3831 ;; This is the value the function returns. 3832 ;; This is the value the function returns.
3832 (= arg 0)) 3833 (= arg 0))
@@ -3858,7 +3859,7 @@ Outline mode sets this."
3858 (save-excursion 3859 (save-excursion
3859 ;; Like end-of-line but ignores fields. 3860 ;; Like end-of-line but ignores fields.
3860 (skip-chars-forward "^\n") 3861 (skip-chars-forward "^\n")
3861 (while (and (not (eobp)) (line-move-invisible-p (point))) 3862 (while (and (not (eobp)) (invisible-p (point)))
3862 (goto-char (next-char-property-change (point))) 3863 (goto-char (next-char-property-change (point)))
3863 (skip-chars-forward "^\n")) 3864 (skip-chars-forward "^\n"))
3864 (point)))) 3865 (point))))
@@ -3941,13 +3942,13 @@ and `current-column' to be able to ignore invisible text."
3941 (move-to-column col)) 3942 (move-to-column col))
3942 3943
3943 (when (and line-move-ignore-invisible 3944 (when (and line-move-ignore-invisible
3944 (not (bolp)) (line-move-invisible-p (1- (point)))) 3945 (not (bolp)) (invisible-p (1- (point))))
3945 (let ((normal-location (point)) 3946 (let ((normal-location (point))
3946 (normal-column (current-column))) 3947 (normal-column (current-column)))
3947 ;; If the following character is currently invisible, 3948 ;; If the following character is currently invisible,
3948 ;; skip all characters with that same `invisible' property value. 3949 ;; skip all characters with that same `invisible' property value.
3949 (while (and (not (eobp)) 3950 (while (and (not (eobp))
3950 (line-move-invisible-p (point))) 3951 (invisible-p (point)))
3951 (goto-char (next-char-property-change (point)))) 3952 (goto-char (next-char-property-change (point))))
3952 ;; Have we advanced to a larger column position? 3953 ;; Have we advanced to a larger column position?
3953 (if (> (current-column) normal-column) 3954 (if (> (current-column) normal-column)
@@ -3960,7 +3961,7 @@ and `current-column' to be able to ignore invisible text."
3960 ;; but with a more reasonable buffer position. 3961 ;; but with a more reasonable buffer position.
3961 (goto-char normal-location) 3962 (goto-char normal-location)
3962 (let ((line-beg (save-excursion (beginning-of-line) (point)))) 3963 (let ((line-beg (save-excursion (beginning-of-line) (point))))
3963 (while (and (not (bolp)) (line-move-invisible-p (1- (point)))) 3964 (while (and (not (bolp)) (invisible-p (1- (point))))
3964 (goto-char (previous-char-property-change (point) line-beg)))))))) 3965 (goto-char (previous-char-property-change (point) line-beg))))))))
3965 3966
3966(defun move-end-of-line (arg) 3967(defun move-end-of-line (arg)
@@ -3981,7 +3982,7 @@ To ignore intangibility, bind `inhibit-point-motion-hooks' to t."
3981 (and (line-move arg t) 3982 (and (line-move arg t)
3982 (not (bobp)) 3983 (not (bobp))
3983 (progn 3984 (progn
3984 (while (and (not (bobp)) (line-move-invisible-p (1- (point)))) 3985 (while (and (not (bobp)) (invisible-p (1- (point))))
3985 (goto-char (previous-char-property-change (point)))) 3986 (goto-char (previous-char-property-change (point))))
3986 (backward-char 1))) 3987 (backward-char 1)))
3987 (point))))) 3988 (point)))))
@@ -4017,13 +4018,13 @@ To ignore intangibility, bind `inhibit-point-motion-hooks' to t."
4017 4018
4018 ;; Move to beginning-of-line, ignoring fields and invisibles. 4019 ;; Move to beginning-of-line, ignoring fields and invisibles.
4019 (skip-chars-backward "^\n") 4020 (skip-chars-backward "^\n")
4020 (while (and (not (bobp)) (line-move-invisible-p (1- (point)))) 4021 (while (and (not (bobp)) (invisible-p (1- (point))))
4021 (goto-char (previous-char-property-change (point))) 4022 (goto-char (previous-char-property-change (point)))
4022 (skip-chars-backward "^\n")) 4023 (skip-chars-backward "^\n"))
4023 (setq start (point)) 4024 (setq start (point))
4024 4025
4025 ;; Now find first visible char in the line 4026 ;; Now find first visible char in the line
4026 (while (and (not (eobp)) (line-move-invisible-p (point))) 4027 (while (and (not (eobp)) (invisible-p (point)))
4027 (goto-char (next-char-property-change (point)))) 4028 (goto-char (next-char-property-change (point))))
4028 (setq first-vis (point)) 4029 (setq first-vis (point))
4029 4030
diff --git a/lisp/textmodes/texinfmt.el b/lisp/textmodes/texinfmt.el
index 07b7ba6e39d..73b6ec3920e 100644
--- a/lisp/textmodes/texinfmt.el
+++ b/lisp/textmodes/texinfmt.el
@@ -3250,7 +3250,7 @@ Default is to leave paragraph indentation as is."
3250;; Take arguments 3250;; Take arguments
3251 3251
3252;; @,{c} ==> c, cedilla accent 3252;; @,{c} ==> c, cedilla accent
3253(put ', 'texinfo-format 'texinfo-format-cedilla-accent) 3253(put '\, 'texinfo-format 'texinfo-format-cedilla-accent)
3254(defun texinfo-format-cedilla-accent () 3254(defun texinfo-format-cedilla-accent ()
3255 (insert (texinfo-parse-arg-discard) ",") 3255 (insert (texinfo-parse-arg-discard) ",")
3256 (goto-char texinfo-command-start)) 3256 (goto-char texinfo-command-start))
diff --git a/lisp/uniquify.el b/lisp/uniquify.el
index 1f5e6409a76..8226c65cbb9 100644
--- a/lisp/uniquify.el
+++ b/lisp/uniquify.el
@@ -235,6 +235,14 @@ this rationalization."
235 (with-current-buffer (uniquify-item-buffer (car items)) 235 (with-current-buffer (uniquify-item-buffer (car items))
236 (setq uniquify-managed nil)) 236 (setq uniquify-managed nil))
237 (setq items nil))) 237 (setq items nil)))
238 ;; In case we missed some calls to kill-buffer, there may be dead
239 ;; buffers in uniquify-managed, so filter them out.
240 (setq items
241 (delq nil (mapcar
242 (lambda (item)
243 (if (buffer-live-p (uniquify-item-buffer item))
244 item))
245 items)))
238 (setq fix-list (append fix-list items)))) 246 (setq fix-list (append fix-list items))))
239 ;; selects buffers whose names may need changing, and others that 247 ;; selects buffers whose names may need changing, and others that
240 ;; may conflict, then bring conflicting names together 248 ;; may conflict, then bring conflicting names together
diff --git a/lisp/vc.el b/lisp/vc.el
index e65cd5b85a8..7d8c78c24a8 100644
--- a/lisp/vc.el
+++ b/lisp/vc.el
@@ -3411,7 +3411,7 @@ revision."
3411 vc-annotate-parent-display-mode 3411 vc-annotate-parent-display-mode
3412 buf) 3412 buf)
3413 (goto-line (min oldline (progn (goto-char (point-max)) 3413 (goto-line (min oldline (progn (goto-char (point-max))
3414 (previous-line) 3414 (forward-line -1)
3415 (line-number-at-pos))) buf))))) 3415 (line-number-at-pos))) buf)))))
3416 3416
3417(defun vc-annotate-compcar (threshold a-list) 3417(defun vc-annotate-compcar (threshold a-list)