aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorKaroly Lorentey2004-04-18 01:40:02 +0000
committerKaroly Lorentey2004-04-18 01:40:02 +0000
commitf2e45864d10657552bbc5cda8f10a5dcf1bfe511 (patch)
tree21af8d850cc6b15905949f6b2bc13733bfa7d184 /lisp
parent9002956fd888928dcca6ba30bbb90c739741377a (diff)
parent06e2fd488e846d50952025d07a5e12cc0cd4ff81 (diff)
downloademacs-f2e45864d10657552bbc5cda8f10a5dcf1bfe511.tar.gz
emacs-f2e45864d10657552bbc5cda8f10a5dcf1bfe511.zip
Merged in changes from CVS trunk.
Patches applied: * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-220 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-221 Restore deleted tagline in etc/TUTORIAL.ru * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-222 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-223 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-224 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-225 Update from CVS git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-144
Diffstat (limited to 'lisp')
-rw-r--r--lisp/ChangeLog103
-rw-r--r--lisp/allout.el55
-rw-r--r--lisp/diff-mode.el6
-rw-r--r--lisp/files.el25
-rw-r--r--lisp/iswitchb.el45
-rw-r--r--lisp/progmodes/compile.el197
-rw-r--r--lisp/progmodes/gdb-ui.el19
-rw-r--r--lisp/progmodes/python.el98
-rw-r--r--lisp/url/url-dav.el27
-rw-r--r--lisp/url/url-file.el12
-rw-r--r--lisp/url/url-handlers.el4
-rw-r--r--lisp/url/url-http.el9
-rw-r--r--lisp/url/url-https.el48
-rw-r--r--lisp/url/url-nfs.el60
-rw-r--r--lisp/url/url-util.el53
-rw-r--r--lisp/xml.el42
16 files changed, 484 insertions, 319 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index c4fd4341c89..16de868d006 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,91 @@
12004-04-18 Nick Roberts <nick@nick.uklinux.net>
2
3 * progmodes/gdb-ui.el (gdb-goto-info): Require 'info.
4 (gdb-info-breakpoints-custom): Revert previous change.
5 (gdb-view-assembler): Update assembler if necessary.
6 (gdb-frame-handler): Parse correctly for gdb-current-frame.
7 (gdb-display-source-buffer): Update properly when both source and
8 assembler are visible.
9
102004-04-17 John Wiegley <johnw@newartisans.com>
11
12 * iswitchb.el (iswitchb-max-to-show): Added a new config variable
13 which limits the number of names shown in the minibuffer. Off by
14 default.
15 (iswitchb-completions): Use `iswitchb-max-to-show'. This speeds
16 up iswitchb for users with a multitude of open buffers by showing
17 only the first and last N/2 buffers in the completion list (which
18 is enough to aid C-s/C-r, and to know that more characters are
19 needed to refine the completion list).
20
212004-04-17 Richard M. Stallman <rms@gnu.org>
22
23 * files.el (locate-file-completion): Handle nil in path-and-suffixes.
24 (file-truename): Expand all ~ constructs directly.
25 (insert-directory): Delete any error msg output by the
26 `insert-directory-program'.
27
28 * allout.el (allout-mode-exposure-menu, allout-mode-editing-menu):
29 (allout-mode-navigation-menu, allout-mode-misc-menu): New defvars.
30 (allout-prior-bindings, allout-added-bindings): Defvars deleted.
31 (allout-init): Use find-file-hook, not find-file-hooks.
32 (allout-mode): Eliminate Emacs 18 support.
33 Use write-contents-functions, not local-write-file-hooks.
34
352004-04-17 Daniel Pfeiffer <occitan@esperanto.org>
36
37 * progmodes/compile.el (compilation-error-properties): Fix for
38 adding messages when there are already markers for their file.
39 (compilation-fake-loc): New function.
40
412004-04-16 Dave Love <fx@gnu.org>
42
43 * progmodes/python.el (python-compilation-line-number): Fix braindamage.
44 (python-load-file): Fix python-orig-start setting.
45
46 * progmodes/compile.el: Doc fixes.
47 (compilation-error-regexp-alist-alist)
48 (compilation-mode-font-lock-keywords): Allow non-ASCII where possible.
49 (compilation-assq): Wrap in eval-when-compile.
50 (compilation-mode-font-lock-keywords): Don't use list*.
51 (compilation-start): Avoid warning.
52 (compilation-compat-error-properties)
53 (compilation-directory-properties): Add keymap property.
54 (compilation-parsing-end): Make it a marker for better compatibility.
55
56 * progmodes/python.el (python-after-info-look): Use with-no-warnings.
57
582004-04-16 Mark A. Hershberger <mah@everybody.org>
59
60 * xml.el: Doc fixes.
61 (xml-get-children): Only looks at sub-tags and ignore strings.
62
63 * xml.el (xml-parse-tag): Avoid overwriting node-name.
64
652004-04-16 Stefan Monnier <monnier@iro.umontreal.ca>
66
67 * url/url-util.el (url-debug): Use with-current-buffer.
68
69 * url/url-nfs.el (url-nfs-file-attributes): Add id-format parameter.
70 (url-nfs-create-wrapper): Use new backquote syntax.
71
72 * url/url-https.el (url-https-file-attributes): Add id-format param.
73
74 * url/url-http.el (url-http-head-file-attributes)
75 (url-http-file-attributes): Add id-format parameter.
76
77 * url/url-handlers.el: Use new find-file-hook.
78 (url-file-attributes): Add id-format parameter.
79
80 * url/url-file.el (url-file-create-wrapper): Use new backquote syntax.
81 (url-file-file-attributes): Add id-format parameter.
82
83 * url/url-dav.el: Use with-current-buffer.
84 (url-dav-process-response): Fix regexps and spurious quote.
85 (url-dav-file-attributes): Add id-format param.
86
87 * diff-mode.el (diff-end-of-hunk): Be more careful with unified hunks.
88
12004-04-16 Andre Spiegel <spiegel@gnu.org> 892004-04-16 Andre Spiegel <spiegel@gnu.org>
2 90
3 * vc-hooks.el (vc-default-workfile-unchanged-p): Quote signal. 91 * vc-hooks.el (vc-default-workfile-unchanged-p): Quote signal.
@@ -9,8 +97,7 @@
9 * simple.el (completion-setup-function): Set an initial value 97 * simple.el (completion-setup-function): Set an initial value
10 to `element-common-end' before entering loop. Set a value 98 to `element-common-end' before entering loop. Set a value
11 to `element-common-end' at the end of loop. 99 to `element-common-end' at the end of loop.
12 The bug is reported by Juri Linkov <juri@jurta.org> in emacs-devel 100 The bug is reported by Juri Linkov <juri@jurta.org> in emacs-devel list.
13 list.
14 (completions-common-part): Rename from completion-de-emphasis. 101 (completions-common-part): Rename from completion-de-emphasis.
15 (completions-first-difference): Rename from completion-emphasis. 102 (completions-first-difference): Rename from completion-emphasis.
16 Suggested by RMS. 103 Suggested by RMS.
@@ -20,6 +107,12 @@
20 * bookmark.el (bookmark-send-edited-annotation): Fix docstring. 107 * bookmark.el (bookmark-send-edited-annotation): Fix docstring.
21 (bookmark-edit-annotation-mode): Add mode name. 108 (bookmark-edit-annotation-mode): Add mode name.
22 109
1102004-04-15 Stefan Monnier <monnier@iro.umontreal.ca>
111
112 * smerge-mode.el (smerge-match-conflict): Try to do something sensible
113 for nested conflict markers.
114 (smerge-find-conflict): Better handle errors in smerge-match-conflict.
115
232004-04-15 Nick Roberts <nick@nick.uklinux.net> 1162004-04-15 Nick Roberts <nick@nick.uklinux.net>
24 117
25 * progmodes/gdb-ui.el (gdb-goto-info): New function. 118 * progmodes/gdb-ui.el (gdb-goto-info): New function.
@@ -119,7 +212,7 @@
119 in addition it also disables menu-bar, tool-bar, scroll-bars, 212 in addition it also disables menu-bar, tool-bar, scroll-bars,
120 tool-tips, and the blinking cursor. 213 tool-tips, and the blinking cursor.
121 (command-line-1): Skip startup screen if -Q. 214 (command-line-1): Skip startup screen if -Q.
122 (fancy-splash-head): Use :align-to center prop to center splash image. 215 (fancy-splash-head): Use ":align-to center" prop to center splash image.
123 216
124 * emulation/cua-base.el (cua-read-only-cursor-color) 217 * emulation/cua-base.el (cua-read-only-cursor-color)
125 (cua-overwrite-cursor-color, cua-global-mark-cursor-color): Doc fix. 218 (cua-overwrite-cursor-color, cua-global-mark-cursor-color): Doc fix.
@@ -154,6 +247,10 @@
154 * progmodes/python.el (run-python): Use compilation-shell-minor-mode. 247 * progmodes/python.el (run-python): Use compilation-shell-minor-mode.
155 Set compilation-error-regexp-alist earlier. 248 Set compilation-error-regexp-alist earlier.
156 249
250 * progmodes/compile.el (compilation-minor-mode-map)
251 (compilation-shell-minor-mode-map, compile-mouse-goto-error)
252 (compile-goto-error): Re-merge the mouse and non-mouse commands.
253
1572004-04-12 Stefan Monnier <monnier@iro.umontreal.ca> 2542004-04-12 Stefan Monnier <monnier@iro.umontreal.ca>
158 255
159 * progmodes/compile.el (compile-goto-error): Select the buffer/window 256 * progmodes/compile.el (compile-goto-error): Select the buffer/window
diff --git a/lisp/allout.el b/lisp/allout.el
index 04dcf88e91c..458db865535 100644
--- a/lisp/allout.el
+++ b/lisp/allout.el
@@ -83,7 +83,7 @@ dictated by `allout-layout' should be imposed on mode activation.
83 83
84With value t, auto-mode-activation and auto-layout are enabled. 84With value t, auto-mode-activation and auto-layout are enabled.
85\(This also depends on `allout-find-file-hook' being installed in 85\(This also depends on `allout-find-file-hook' being installed in
86`find-file-hooks', which is also done by `allout-init'.) 86`find-file-hook', which is also done by `allout-init'.)
87 87
88With value `ask', auto-mode-activation is enabled, and endorsement for 88With value `ask', auto-mode-activation is enabled, and endorsement for
89performing auto-layout is asked of the user each time. 89performing auto-layout is asked of the user each time.
@@ -726,17 +726,12 @@ See doc string for allout-keybindings-list for format of binding list."
726 (car (cdr cell))))))) 726 (car (cdr cell)))))))
727 keymap-list) 727 keymap-list)
728 map)) 728 map))
729;;;_ = allout-prior-bindings - being deprecated. 729
730(defvar allout-prior-bindings nil
731 "Variable for use in V18, with `allout-added-bindings', for
732resurrecting, on mode deactivation, bindings that existed before
733activation. Being deprecated.")
734;;;_ = allout-added-bindings - being deprecated
735(defvar allout-added-bindings nil
736 "Variable for use in V18, with `allout-prior-bindings', for
737resurrecting, on mode deactivation, bindings that existed before
738activation. Being deprecated.")
739;;;_ : Menu bar 730;;;_ : Menu bar
731(defvar allout-mode-exposure-menu)
732(defvar allout-mode-editing-menu)
733(defvar allout-mode-navigation-menu)
734(defvar allout-mode-misc-menu)
740(defun produce-allout-mode-menubar-entries () 735(defun produce-allout-mode-menubar-entries ()
741 (require 'easymenu) 736 (require 'easymenu)
742 (easy-menu-define allout-mode-exposure-menu 737 (easy-menu-define allout-mode-exposure-menu
@@ -909,7 +904,7 @@ mode from prop-line file-var activation. Used by `allout-mode' function
909to track repeats.") 904to track repeats.")
910;;;_ > allout-write-file-hook () 905;;;_ > allout-write-file-hook ()
911(defun allout-write-file-hook () 906(defun allout-write-file-hook ()
912 "In `allout-mode', run as a `local-write-file-hooks' activity. 907 "In `allout-mode', run as a `write-contents-functions' activity.
913 908
914Currently just sets `allout-during-write-cue', so outline change-protection 909Currently just sets `allout-during-write-cue', so outline change-protection
915knows to keep inactive during file write." 910knows to keep inactive during file write."
@@ -950,7 +945,7 @@ the `allout-layout' variable. (See `allout-layout' and
950`allout-expose-topic' docstrings for more details on auto layout). 945`allout-expose-topic' docstrings for more details on auto layout).
951 946
952`allout-init' works by setting up (or removing) 947`allout-init' works by setting up (or removing)
953`allout-find-file-hook' in `find-file-hooks', and giving 948`allout-find-file-hook' in `find-file-hook', and giving
954`allout-auto-activation' a suitable setting. 949`allout-auto-activation' a suitable setting.
955 950
956To prime your emacs session for full auto-outline operation, include 951To prime your emacs session for full auto-outline operation, include
@@ -979,16 +974,16 @@ the following two lines in your emacs init file:
979 (curr-mode 'allout-auto-activation)) 974 (curr-mode 'allout-auto-activation))
980 975
981 (cond ((not mode) 976 (cond ((not mode)
982 (setq find-file-hooks (delq hook find-file-hooks)) 977 (setq find-file-hook (delq hook find-file-hook))
983 (if (interactive-p) 978 (if (interactive-p)
984 (message "Allout outline mode auto-activation inhibited."))) 979 (message "Allout outline mode auto-activation inhibited.")))
985 ((eq mode 'report) 980 ((eq mode 'report)
986 (if (memq hook find-file-hooks) 981 (if (memq hook find-file-hook)
987 ;; Just punt and use the reports from each of the modes: 982 ;; Just punt and use the reports from each of the modes:
988 (allout-init (symbol-value curr-mode)) 983 (allout-init (symbol-value curr-mode))
989 (allout-init nil) 984 (allout-init nil)
990 (message "Allout outline mode auto-activation inhibited."))) 985 (message "Allout outline mode auto-activation inhibited.")))
991 (t (add-hook 'find-file-hooks hook) 986 (t (add-hook 'find-file-hook hook)
992 (set curr-mode ; `set', not `setq'! 987 (set curr-mode ; `set', not `setq'!
993 (cond ((eq mode 'activate) 988 (cond ((eq mode 'activate)
994 (message 989 (message
@@ -1252,19 +1247,6 @@ OPEN: A topic that is not closed, though its offspring or body may be."
1252 ; active state or *de*activation 1247 ; active state or *de*activation
1253 ; specifically requested: 1248 ; specifically requested:
1254 (setq allout-explicitly-deactivated t) 1249 (setq allout-explicitly-deactivated t)
1255 (if (string-match "^18\." emacs-version)
1256 ; Revoke those keys that remain
1257 ; as we set them:
1258 (let ((curr-loc (current-local-map)))
1259 (mapcar (function
1260 (lambda (cell)
1261 (if (eq (lookup-key curr-loc (car cell))
1262 (car (cdr cell)))
1263 (define-key curr-loc (car cell)
1264 (assq (car cell) allout-prior-bindings)))))
1265 allout-added-bindings)
1266 (allout-resumptions 'allout-added-bindings)
1267 (allout-resumptions 'allout-prior-bindings)))
1268 1250
1269 (if allout-old-style-prefixes 1251 (if allout-old-style-prefixes
1270 (progn 1252 (progn
@@ -1273,9 +1255,9 @@ OPEN: A topic that is not closed, though its offspring or body may be."
1273 (allout-resumptions 'selective-display) 1255 (allout-resumptions 'selective-display)
1274 (if (and (boundp 'before-change-functions) before-change-functions) 1256 (if (and (boundp 'before-change-functions) before-change-functions)
1275 (allout-resumptions 'before-change-functions)) 1257 (allout-resumptions 'before-change-functions))
1276 (setq local-write-file-hooks 1258 (setq write-contents-functions
1277 (delq 'allout-write-file-hook 1259 (delq 'allout-write-file-hook
1278 local-write-file-hooks)) 1260 write-contents-functions))
1279 (allout-resumptions 'paragraph-start) 1261 (allout-resumptions 'paragraph-start)
1280 (allout-resumptions 'paragraph-separate) 1262 (allout-resumptions 'paragraph-separate)
1281 (allout-resumptions (if (string-match "^18" emacs-version) 1263 (allout-resumptions (if (string-match "^18" emacs-version)
@@ -1315,13 +1297,6 @@ OPEN: A topic that is not closed, though its offspring or body may be."
1315 (cons '(allout-mode . allout-mode-map) 1297 (cons '(allout-mode . allout-mode-map)
1316 minor-mode-map-alist)))) 1298 minor-mode-map-alist))))
1317 1299
1318 ; V18 minor-mode key bindings:
1319 ; Stash record of added bindings
1320 ; for later revocation:
1321 (allout-resumptions 'allout-added-bindings
1322 (list allout-keybindings-list))
1323 (allout-resumptions 'allout-prior-bindings
1324 (list (current-local-map)))
1325 ; and add them: 1300 ; and add them:
1326 (use-local-map (produce-allout-mode-map allout-keybindings-list 1301 (use-local-map (produce-allout-mode-map allout-keybindings-list
1327 (current-local-map))) 1302 (current-local-map)))
@@ -1340,7 +1315,7 @@ OPEN: A topic that is not closed, though its offspring or body may be."
1340 ; Temporarily set by any outline 1315 ; Temporarily set by any outline
1341 ; functions that can be trusted to 1316 ; functions that can be trusted to
1342 ; deal properly with concealed text. 1317 ; deal properly with concealed text.
1343 (add-hook 'local-write-file-hooks 'allout-write-file-hook) 1318 (add-hook 'write-contents-functions 'allout-write-file-hook)
1344 ; Custom auto-fill func, to support 1319 ; Custom auto-fill func, to support
1345 ; respect for topic headline, 1320 ; respect for topic headline,
1346 ; hanging-indents, etc: 1321 ; hanging-indents, etc:
diff --git a/lisp/diff-mode.el b/lisp/diff-mode.el
index f6b2520a112..d41bfcad58a 100644
--- a/lisp/diff-mode.el
+++ b/lisp/diff-mode.el
@@ -305,7 +305,11 @@ when editing big diffs)."
305(defvar diff-narrowed-to nil) 305(defvar diff-narrowed-to nil)
306 306
307(defun diff-end-of-hunk (&optional style) 307(defun diff-end-of-hunk (&optional style)
308 (if (looking-at diff-hunk-header-re) (goto-char (match-end 0))) 308 (when (looking-at diff-hunk-header-re)
309 (unless style
310 ;; Especially important for unified (because headers are ambiguous).
311 (setq style (cdr (assq (char-after) '((?@ . unified) (?* . context))))))
312 (goto-char (match-end 0)))
309 (let ((end (and (re-search-forward (case style 313 (let ((end (and (re-search-forward (case style
310 ;; A `unified' header is ambiguous. 314 ;; A `unified' header is ambiguous.
311 (unified (concat "^[^-+# \\]\\|" 315 (unified (concat "^[^-+# \\]\\|"
diff --git a/lisp/files.el b/lisp/files.el
index be40a0b595e..6a406b6fbf0 100644
--- a/lisp/files.el
+++ b/lisp/files.el
@@ -616,6 +616,8 @@ PATH-AND-SUFFIXES is a pair of lists (DIRECTORIES . SUFFIXES)."
616 (suffix (concat (regexp-opt (cdr path-and-suffixes) t) "\\'")) 616 (suffix (concat (regexp-opt (cdr path-and-suffixes) t) "\\'"))
617 (string-dir (file-name-directory string))) 617 (string-dir (file-name-directory string)))
618 (dolist (dir (car path-and-suffixes)) 618 (dolist (dir (car path-and-suffixes))
619 (unless dir
620 (setq dir default-directory))
619 (if string-dir (setq dir (expand-file-name string-dir dir))) 621 (if string-dir (setq dir (expand-file-name string-dir dir)))
620 (when (file-directory-p dir) 622 (when (file-directory-p dir)
621 (dolist (file (file-name-all-completions 623 (dolist (file (file-name-all-completions
@@ -668,14 +670,17 @@ Do not specify them in other calls."
668 ;; PREV-DIRS can be a cons cell whose car is an alist 670 ;; PREV-DIRS can be a cons cell whose car is an alist
669 ;; of truenames we've just recently computed. 671 ;; of truenames we've just recently computed.
670 672
671 ;; The last test looks dubious, maybe `+' is meant here? --simon. 673 (cond ((or (string= filename "") (string= filename "~"))
672 (if (or (string= filename "") (string= filename "~") 674 (setq filename (expand-file-name filename))
673 (and (string= (substring filename 0 1) "~") 675 (if (string= filename "")
674 (string-match "~[^/]*" filename))) 676 (setq filename "/")))
675 (progn 677 ((and (string= (substring filename 0 1) "~")
676 (setq filename (expand-file-name filename)) 678 (string-match "~[^/]*/?" filename))
677 (if (string= filename "") 679 (let ((first-part
678 (setq filename "/")))) 680 (substring filename 0 (match-end 0)))
681 (rest (substring filename (match-end 0))))
682 (setq filename (concat (expand-file-name first-part) rest)))))
683
679 (or counter (setq counter (list 100))) 684 (or counter (setq counter (list 100)))
680 (let (done 685 (let (done
681 ;; For speed, remove the ange-ftp completion handler from the list. 686 ;; For speed, remove the ange-ftp completion handler from the list.
@@ -4230,7 +4235,7 @@ This works by running a directory listing program
4230whose name is in the variable `insert-directory-program'. 4235whose name is in the variable `insert-directory-program'.
4231If WILDCARD, it also runs the shell specified by `shell-file-name'. 4236If WILDCARD, it also runs the shell specified by `shell-file-name'.
4232 4237
4233When SWITCHES contains the long `--dired' option,this function 4238When SWITCHES contains the long `--dired' option, this function
4234treats it specially, for the sake of dired. However, the 4239treats it specially, for the sake of dired. However, the
4235normally equivalent short `-D' option is just passed on to 4240normally equivalent short `-D' option is just passed on to
4236`insert-directory-program', as any other option." 4241`insert-directory-program', as any other option."
@@ -4307,6 +4312,8 @@ normally equivalent short `-D' option is just passed on to
4307 4312
4308 ;; If `insert-directory-program' failed, signal an error. 4313 ;; If `insert-directory-program' failed, signal an error.
4309 (unless (eq 0 result) 4314 (unless (eq 0 result)
4315 ;; Delete the error message it may have output.
4316 (delete-region beg (point))
4310 ;; On non-Posix systems, we cannot open a directory, so 4317 ;; On non-Posix systems, we cannot open a directory, so
4311 ;; don't even try, because that will always result in 4318 ;; don't even try, because that will always result in
4312 ;; the ubiquitous "Access denied". Instead, show the 4319 ;; the ubiquitous "Access denied". Instead, show the
diff --git a/lisp/iswitchb.el b/lisp/iswitchb.el
index aab768387d0..0c43c270751 100644
--- a/lisp/iswitchb.el
+++ b/lisp/iswitchb.el
@@ -298,6 +298,13 @@ example functions that filter buffernames."
298 :type '(repeat (choice regexp function)) 298 :type '(repeat (choice regexp function))
299 :group 'iswitchb) 299 :group 'iswitchb)
300 300
301(defcustom iswitchb-max-to-show nil
302 "*If non-nil, limit the number of names shown in the minibuffer.
303This can greatly speed up iswitchb if you have a multitude of
304buffers open."
305 :type 'integer
306 :group 'iswitchb)
307
301(defcustom iswitchb-cannot-complete-hook 'iswitchb-completion-help 308(defcustom iswitchb-cannot-complete-hook 'iswitchb-completion-help
302 "*Hook run when `iswitchb-complete' can't complete any more. 309 "*Hook run when `iswitchb-complete' can't complete any more.
303The most useful values are `iswitchb-completion-help', which pops up a 310The most useful values are `iswitchb-completion-help', which pops up a
@@ -1185,6 +1192,15 @@ Copied from `icomplete-exhibit' with two changes:
1185 contents 1192 contents
1186 (not minibuffer-completion-confirm))))))) 1193 (not minibuffer-completion-confirm)))))))
1187 1194
1195(defun iswitchb-output-completion (com)
1196 (if (= (length com) most-len)
1197 ;; Most is one exact match,
1198 ;; note that and leave out
1199 ;; for later indication:
1200 (ignore
1201 (setq most-is-exact t))
1202 (substring com most-len)))
1203
1188(defun iswitchb-completions (name require-match) 1204(defun iswitchb-completions (name require-match)
1189 "Return the string that is displayed after the user's text. 1205 "Return the string that is displayed after the user's text.
1190Modified from `icomplete-completions'." 1206Modified from `icomplete-completions'."
@@ -1224,28 +1240,23 @@ Modified from `icomplete-completions'."
1224 "") 1240 "")
1225 (if (not iswitchb-use-fonts) " [Matched]"))) 1241 (if (not iswitchb-use-fonts) " [Matched]")))
1226 (t ;multiple matches 1242 (t ;multiple matches
1243 (if (and iswitchb-max-to-show
1244 (> (length comps) iswitchb-max-to-show))
1245 (setq comps
1246 (append
1247 (subseq comps 0 (/ iswitchb-max-to-show 2))
1248 (list "...")
1249 (subseq comps (- (length comps)
1250 (/ iswitchb-max-to-show 2))))))
1227 (let* ( 1251 (let* (
1228 ;;(most (try-completion name candidates predicate)) 1252 ;;(most (try-completion name candidates predicate))
1229 (most nil) 1253 (most nil)
1230 (most-len (length most)) 1254 (most-len (length most))
1231 most-is-exact 1255 most-is-exact
1232 (alternatives 1256 (alternatives (if most
1233 (apply 1257 (mapconcat 'iswitchb-output-completion
1234 (function concat) 1258 comps ",")
1235 (cdr (apply 1259 (mapconcat 'identity comps ","))))
1236 (function nconc)
1237 (mapcar '(lambda (com)
1238 (if (= (length com) most-len)
1239 ;; Most is one exact match,
1240 ;; note that and leave out
1241 ;; for later indication:
1242 (progn
1243 (setq most-is-exact t)
1244 ())
1245 (list ","
1246 (substring com
1247 most-len))))
1248 comps))))))
1249 1260
1250 (concat 1261 (concat
1251 1262
diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el
index ff4256192c4..71946dd02f5 100644
--- a/lisp/progmodes/compile.el
+++ b/lisp/progmodes/compile.el
@@ -100,7 +100,7 @@ in the compilation output, and should return a transformed file name.")
100;;;###autoload 100;;;###autoload
101(defvar compilation-process-setup-function nil 101(defvar compilation-process-setup-function nil
102 "*Function to call to customize the compilation process. 102 "*Function to call to customize the compilation process.
103This functions is called immediately before the compilation process is 103This function is called immediately before the compilation process is
104started. It can be used to set any variables or functions that are used 104started. It can be used to set any variables or functions that are used
105while processing the output of the compilation process. The function 105while processing the output of the compilation process. The function
106is called with variables `compilation-buffer' and `compilation-window' 106is called with variables `compilation-buffer' and `compilation-window'
@@ -187,8 +187,9 @@ of[ \t]+\"?\\([a-zA-Z]?:?[^\":\n]+\\)\"?:" 3 2 nil (1))
187 "^\\([^( \n\t]+\\)(\\([0-9]+\\):\\([0-9]+\\)) :\ 187 "^\\([^( \n\t]+\\)(\\([0-9]+\\):\\([0-9]+\\)) :\
188 \\(?:warnin\\(g\\)\\|informationa\\(l\\)\\)?" 1 2 3 (4 . 5)) 188 \\(?:warnin\\(g\\)\\|informationa\\(l\\)\\)?" 1 2 3 (4 . 5))
189 189
190 ;; fixme: should be `mips'
190 (irix 191 (irix
191 "^[a-z0-9/]+: \\(?:[eE]rror\\|[wW]arnin\\(g\\)\\|[iI]nf\\(o\\)\\)[0-9 ]*:\ 192 "^[-[:alnum:]_/]+: \\(?:[eE]rror\\|[wW]arnin\\(g\\)\\|[iI]nf\\(o\\)\\)[0-9 ]*:\
192 \\([^,\" \n\t]+\\)\\(?:, line\\|:\\) \\([0-9]+\\):" 3 4 nil (1 . 2)) 193 \\([^,\" \n\t]+\\)\\(?:, line\\|:\\) \\([0-9]+\\):" 3 4 nil (1 . 2))
193 194
194 (java 195 (java
@@ -206,7 +207,7 @@ of[ \t]+\"?\\([a-zA-Z]?:?[^\":\n]+\\)\"?:" 3 2 nil (1))
206\\(.+\\):\\([0-9]+\\)\\(?:\\(:\\)\\|\\(,\\)\\)?" 1 2 nil (3 . 4)) 207\\(.+\\):\\([0-9]+\\)\\(?:\\(:\\)\\|\\(,\\)\\)?" 1 2 nil (3 . 4))
207 208
208 (gnu 209 (gnu
209 "^\\(?:[a-zA-Z][-a-zA-Z0-9.]+: ?\\)?\ 210 "^\\(?:[[:alpha:]][-[:alnum:].]+: ?\\)?\
210\\([/.]*[a-zA-Z]:?[^ \t\n:]*\\): ?\ 211\\([/.]*[a-zA-Z]:?[^ \t\n:]*\\): ?\
211\\([0-9]+\\)\\([.:]?\\)\\([0-9]+\\)?\ 212\\([0-9]+\\)\\([.:]?\\)\\([0-9]+\\)?\
212\\(?:-\\(?:\\([0-9]+\\)\\3\\)?\\.?\\([0-9]+\\)?\\)?:\ 213\\(?:-\\(?:\\([0-9]+\\)\\3\\)?\\.?\\([0-9]+\\)?\\)?:\
@@ -228,6 +229,7 @@ of[ \t]+\"?\\([a-zA-Z]?:?[^\":\n]+\\)\"?:" 3 2 nil (1))
228 (1 (compilation-error-properties 2 3 nil nil nil 0 nil) 229 (1 (compilation-error-properties 2 3 nil nil nil 0 nil)
229 append))) 230 append)))
230 231
232 ;; Should be lint-1, lint-2 (SysV lint)
231 (mips-1 233 (mips-1
232 " (\\([0-9]+\\)) in \\([^ \n]+\\)" 2 1) 234 " (\\([0-9]+\\)) in \\([^ \n]+\\)" 2 1)
233 (mips-2 235 (mips-2
@@ -261,15 +263,16 @@ of[ \t]+\"?\\([a-zA-Z]?:?[^\":\n]+\\)\"?:" 3 2 nil (1))
261 nil 1 nil (3) nil (2 (compilation-face '(3)))) 263 nil 1 nil (3) nil (2 (compilation-face '(3))))
262 264
263 (sun 265 (sun
264 ": \\(?:ERROR\\|WARNIN\\(G\\)\\|REMAR\\(K\\)\\) \\(?:[a-zA-Z0-9 ]+, \\)?\ 266 ": \\(?:ERROR\\|WARNIN\\(G\\)\\|REMAR\\(K\\)\\) \\(?:[[:alnum:] ]+, \\)?\
265File = \\(.+\\), Line = \\([0-9]+\\)\\(?:, Column = \\([0-9]+\\)\\)?" 267File = \\(.+\\), Line = \\([0-9]+\\)\\(?:, Column = \\([0-9]+\\)\\)?"
266 3 4 5 (1 . 2)) 268 3 4 5 (1 . 2))
267 269
268 (sun-ada 270 (sun-ada
269 "^\\([^, \n\t]+\\), line \\([0-9]+\\), char \\([0-9]+\\)[:., \(-]" 1 2 3) 271 "^\\([^, \n\t]+\\), line \\([0-9]+\\), char \\([0-9]+\\)[:., \(-]" 1 2 3)
270 272
271 (ultrix 273 ;; Redundant with `mips'
272 "^\\(?:cfe\\|fort\\): \\(Warning\\)?[^:\n]*: \\([^ \n]*\\), line \\([0-9]+\\):" 2 3 nil (1)) 274;; (ultrix
275;; "^\\(?:cfe\\|fort\\): \\(Warning\\)?[^:\n]*: \\([^ \n]*\\), line \\([0-9]+\\):" 2 3 nil (1))
273 276
274 (4bsd 277 (4bsd
275 "\\(?:^\\|:: \\|\\S ( \\)\\(/[^ \n\t()]+\\)(\\([0-9]+\\))\ 278 "\\(?:^\\|:: \\|\\S ( \\)\\(/[^ \n\t()]+\\)(\\([0-9]+\\))\
@@ -279,14 +282,14 @@ File = \\(.+\\), Line = \\([0-9]+\\)\\(?:, Column = \\([0-9]+\\)\\)?"
279(defcustom compilation-error-regexp-alist 282(defcustom compilation-error-regexp-alist
280 (mapcar 'car compilation-error-regexp-alist-alist) 283 (mapcar 'car compilation-error-regexp-alist-alist)
281 "Alist that specifies how to match errors in compiler output. 284 "Alist that specifies how to match errors in compiler output.
282Note that on Unix exerything is a valid filename, so these 285Note that on Unix everything is a valid filename, so these
283matchers must make some common sense assumptions, which catch 286matchers must make some common sense assumptions, which catch
284normal cases. A shorter list will be lighter on resource usage. 287normal cases. A shorter list will be lighter on resource usage.
285 288
286Instead of an alist element, you can use a symbol, which is 289Instead of an alist element, you can use a symbol, which is
287looked up in `compilation-error-regexp-alist-alist'. You can see 290looked up in `compilation-error-regexp-alist-alist'. You can see
288the predefined symbols and their effects in the file 291the predefined symbols and their effects in the file
289`etc/compilation.txt' (linked below if your are customizing this). 292`etc/compilation.txt' (linked below if you are customizing this).
290 293
291Each elt has the form (REGEXP FILE [LINE COLUMN TYPE HYPERLINK 294Each elt has the form (REGEXP FILE [LINE COLUMN TYPE HYPERLINK
292HIGHLIGHT...]). If REGEXP matches, the FILE'th subexpression 295HIGHLIGHT...]). If REGEXP matches, the FILE'th subexpression
@@ -357,7 +360,7 @@ you may also want to change `compilation-page-delimiter'.")
357 (1 font-lock-variable-name-face) 360 (1 font-lock-variable-name-face)
358 (2 (compilation-face '(4 . 3)))) 361 (2 (compilation-face '(4 . 3))))
359 ;; Command output lines. Recognize `make[n]:' lines too. 362 ;; Command output lines. Recognize `make[n]:' lines too.
360 ("^\\([A-Za-z_0-9/.+-]+\\)\\(\\[\\([0-9]+\\)\\]\\)?[ \t]*:" 363 ("^\\([[:alnum:]_/.+-]+\\)\\(\\[\\([0-9]+\\)\\]\\)?[ \t]*:"
361 (1 font-lock-function-name-face) (3 compilation-line-face nil t)) 364 (1 font-lock-function-name-face) (3 compilation-line-face nil t))
362 (" --?o\\(?:utfile\\|utput\\)?[= ]?\\(\\S +\\)" . 1) 365 (" --?o\\(?:utfile\\|utput\\)?[= ]?\\(\\S +\\)" . 1)
363 ("^Compilation finished" . compilation-info-face) 366 ("^Compilation finished" . compilation-info-face)
@@ -427,7 +430,7 @@ You might also use mode hooks to specify it in certain modes, like this:
427(defvar compilation-locs ()) 430(defvar compilation-locs ())
428 431
429(defvar compilation-debug nil 432(defvar compilation-debug nil
430 "*Set this to `t' before creating a *compilation* buffer. 433 "*Set this to t before creating a *compilation* buffer.
431Then every error line will have a debug text property with the matcher that 434Then every error line will have a debug text property with the matcher that
432fit this line and the match data. Use `describe-text-properties'.") 435fit this line and the match data. Use `describe-text-properties'.")
433 436
@@ -494,7 +497,7 @@ Faces `compilation-error-face', `compilation-warning-face',
494 497
495 498
496;; Used for compatibility with the old compile.el. 499;; Used for compatibility with the old compile.el.
497(defvar compilation-parsing-end nil) 500(defvar compilation-parsing-end (make-marker))
498(defvar compilation-parse-errors-function nil) 501(defvar compilation-parse-errors-function nil)
499(defvar compilation-error-list nil) 502(defvar compilation-error-list nil)
500(defvar compilation-old-error-list nil) 503(defvar compilation-old-error-list nil)
@@ -518,6 +521,7 @@ Faces `compilation-error-face', `compilation-warning-face',
518 '(nil)) ; nil only isn't a property-change 521 '(nil)) ; nil only isn't a property-change
519 (cons (match-string-no-properties idx) dir)) 522 (cons (match-string-no-properties idx) dir))
520 mouse-face highlight 523 mouse-face highlight
524 keymap compilation-button-map
521 help-echo "mouse-2: visit current directory"))) 525 help-echo "mouse-2: visit current directory")))
522 526
523;; Data type `reverse-ordered-alist' retriever. This function retrieves the 527;; Data type `reverse-ordered-alist' retriever. This function retrieves the
@@ -528,6 +532,7 @@ Faces `compilation-error-face', `compilation-warning-face',
528;; may be nil. The other KEYs are ordered backwards so that growing line 532;; may be nil. The other KEYs are ordered backwards so that growing line
529;; numbers can be inserted in front and searching can abort after half the 533;; numbers can be inserted in front and searching can abort after half the
530;; list on average. 534;; list on average.
535(eval-when-compile ;Don't keep it at runtime if not needed.
531(defmacro compilation-assq (key alist) 536(defmacro compilation-assq (key alist)
532 `(let* ((l1 ,alist) 537 `(let* ((l1 ,alist)
533 (l2 (cdr l1))) 538 (l2 (cdr l1)))
@@ -538,7 +543,7 @@ Faces `compilation-error-face', `compilation-warning-face',
538 l2 (cdr l1))) 543 l2 (cdr l1)))
539 (if l2 (eq ,key (caar l2)))) 544 (if l2 (eq ,key (caar l2))))
540 l2 545 l2
541 (setcdr l1 (cons (list ,key) l2)))))) 546 (setcdr l1 (cons (list ,key) l2)))))))
542 547
543 548
544;; This function is the central driver, called when font-locking to gather 549;; This function is the central driver, called when font-locking to gather
@@ -564,7 +569,7 @@ Faces `compilation-error-face', `compilation-warning-face',
564 file (or (if file 569 file (or (if file
565 (nth 2 (car (or (get-text-property (1- file) 'message) 570 (nth 2 (car (or (get-text-property (1- file) 'message)
566 (get-text-property file 'message))))) 571 (get-text-property file 'message)))))
567 ;; no previous either -- let font-lock continue 572 ;; no previous either -- but don't let font-lock fail
568 (gethash (setq file '("*unknown*")) compilation-locs) 573 (gethash (setq file '("*unknown*")) compilation-locs)
569 (puthash file (list file fmt) compilation-locs)))) 574 (puthash file (list file fmt) compilation-locs))))
570 ;; All of these fields are optional, get them only if we have an index, and 575 ;; All of these fields are optional, get them only if we have an index, and
@@ -581,15 +586,54 @@ Faces `compilation-error-face', `compilation-warning-face',
581 (if (and end-col (setq end-col (match-string-no-properties end-col))) 586 (if (and end-col (setq end-col (match-string-no-properties end-col)))
582 (setq end-col (- (string-to-number end-col) compilation-first-column)) 587 (setq end-col (- (string-to-number end-col) compilation-first-column))
583 (if end-line (setq end-col -1))) 588 (if end-line (setq end-col -1)))
584 (if (consp type) ; not a preset type, check what it is. 589 (if (consp type) ; not a static type, check what it is.
585 (setq type (or (and (car type) (match-end (car type)) 1) 590 (setq type (or (and (car type) (match-end (car type)) 1)
586 (and (cdr type) (match-end (cdr type)) 0) 591 (and (cdr type) (match-end (cdr type)) 0)
587 2))) 592 2)))
588 ;; Get any (first) already existing marker (if any has one, all have one). 593 ;; Get first already existing marker (if any has one, all have one).
589 ;; Do this first, as the next assq`s may create new nodes. 594 ;; Do this first, as the compilation-assq`s may create new nodes.
590 (let ((marker (nth 3 (car (cdar (cddr file))))) 595 (let* ((marker-line (car (cddr file))) ; a line structure
591 (loc (compilation-assq line (cdr file))) 596 (marker (nth 3 (cadr marker-line))) ; its marker
592 end-loc) 597 (compilation-error-screen-columns compilation-error-screen-columns)
598 end-marker loc end-loc)
599 (if (not (and marker (marker-buffer marker)))
600 (setq marker) ; no valid marker for this file
601 (setq loc (or line 1) ; normalize no linenumber to line 1
602 marker-line)
603 (catch 'marker ; find nearest loc, at least one exists
604 (dolist (x (cddr file)) ; loop over lines
605 (if (> (or (car x) 1) loc) ; still bigger
606 (setq marker-line x)
607 (if (or (not marker-line) ; first in list
608 (> (- (or (car marker-line) 1) loc)
609 (- loc (or (car x) 1)))) ; current line is nearer
610 (setq marker-line x))
611 (throw 'marker t))))
612 (setq marker (nth 3 (cadr marker-line))
613 marker-line (car marker-line))
614 (with-current-buffer (marker-buffer marker)
615 (save-restriction
616 (widen)
617 (goto-char (marker-position marker))
618 (when (or end-col end-line)
619 (beginning-of-line (- (or end-line line) marker-line -1))
620 (if (< end-col 0)
621 (end-of-line)
622 (if compilation-error-screen-columns
623 (move-to-column end-col)
624 (forward-char end-col)))
625 (setq end-marker (list (point-marker))))
626 (beginning-of-line (if end-line
627 (- end-line line -1)
628 (- loc marker-line -1)))
629 (if col
630 (if compilation-error-screen-columns
631 (move-to-column col)
632 (forward-char col))
633 (forward-to-indentation 0))
634 (setq marker (list (point-marker))))))
635
636 (setq loc (compilation-assq line (cdr file)))
593 (if end-line 637 (if end-line
594 (setq end-loc (compilation-assq end-line (cdr file)) 638 (setq end-loc (compilation-assq end-line (cdr file))
595 end-loc (compilation-assq end-col end-loc)) 639 end-loc (compilation-assq end-col end-loc))
@@ -597,44 +641,10 @@ Faces `compilation-error-face', `compilation-warning-face',
597 (setq end-loc (compilation-assq end-col loc)))) 641 (setq end-loc (compilation-assq end-col loc))))
598 (setq loc (compilation-assq col loc)) 642 (setq loc (compilation-assq col loc))
599 ;; If they are new, make the loc(s) reference the file they point to. 643 ;; If they are new, make the loc(s) reference the file they point to.
600 (or (cdr loc) (setcdr loc (list line file))) 644 (or (cdr loc) (setcdr loc `(,line ,file ,@marker)))
601 (if end-loc 645 (if end-loc
602 (or (cdr end-loc) (setcdr end-loc (list (or end-line line) file)))) 646 (or (cdr end-loc) (setcdr end-loc `(,(or end-line line) ,file ,@end-marker))))
603 ;; If we'd found a marker, ensure that the new locs also get markers 647
604 (when (and marker
605 (not (or (cddr loc) (cddr end-loc))) ; maybe new node w/o marker
606 (marker-buffer marker)) ; other marker still valid
607 (or line (setq line 1)) ; normalize no linenumber to line 1
608 (catch 'marker ; find nearest loc, at least one exists
609 (dolist (x (cddr file))
610 (if (> (or (car x) 1) line)
611 (setq marker x)
612 (if (eq (or (car x) 1) line)
613 (if (cdr (cddr x)) ; at least one other column
614 (throw 'marker (setq marker x))
615 (if marker (throw 'marker t)))
616 (throw 'marker (or marker (setq marker x)))))))
617 (setq marker (if (eq (car (cddr marker)) col)
618 (nthcdr 3 marker)
619 (cddr marker))
620 file compilation-error-screen-columns)
621 (with-current-buffer (marker-buffer (cddr marker))
622 (save-restriction
623 (widen)
624 (goto-char (marker-position (cddr marker)))
625 (beginning-of-line (- line (car (cadr marker)) -1))
626 (if file ; original c.-error-screen-columns
627 (move-to-column (car loc))
628 (forward-char (car loc)))
629 (setcdr (cdr loc) (point-marker))
630 (when end-loc
631 (beginning-of-line (- end-line line -1))
632 (if (< end-col 0)
633 (end-of-line)
634 (if file ; original c.-error-screen-columns
635 (move-to-column (car end-loc))
636 (forward-char (car end-loc))))
637 (setcdr (cdr end-loc) (point-marker))))))
638 ;; Must start with face 648 ;; Must start with face
639 `(face ,compilation-message-face 649 `(face ,compilation-message-face
640 message (,loc ,type ,end-loc) 650 message (,loc ,type ,end-loc)
@@ -686,9 +696,9 @@ Faces `compilation-error-face', `compilation-warning-face',
686 ;; error location. Let's do our best. 696 ;; error location. Let's do our best.
687 `(,(car item) 697 `(,(car item)
688 (0 (compilation-compat-error-properties 698 (0 (compilation-compat-error-properties
689 (funcall ',line (list* (match-string ,file) 699 (funcall ',line (cons (match-string ,file)
690 default-directory 700 (cons default-directory
691 ',(nthcdr 4 item)) 701 ',(nthcdr 4 item)))
692 ,(if col `(match-string ,col))))) 702 ,(if col `(match-string ,col)))))
693 (,file compilation-error-face t)) 703 (,file compilation-error-face t))
694 704
@@ -729,7 +739,7 @@ Faces `compilation-error-face', `compilation-warning-face',
729Runs COMMAND, a shell command, in a separate process asynchronously 739Runs COMMAND, a shell command, in a separate process asynchronously
730with output going to the buffer `*compilation*'. 740with output going to the buffer `*compilation*'.
731 741
732If optional second arg COMINT is t the buffer will be in comint mode with 742If optional second arg COMINT is t the buffer will be in Comint mode with
733`compilation-shell-minor-mode'. 743`compilation-shell-minor-mode'.
734 744
735You can then use the command \\[next-error] to find the next error message 745You can then use the command \\[next-error] to find the next error message
@@ -762,8 +772,8 @@ to a function that generates a unique name."
762;; run compile with the default command line 772;; run compile with the default command line
763(defun recompile () 773(defun recompile ()
764 "Re-compile the program including the current buffer. 774 "Re-compile the program including the current buffer.
765If this is run in a compilation-mode buffer, re-use the arguments from the 775If this is run in a Compilation mode buffer, re-use the arguments from the
766original use. Otherwise, it recompiles using `compile-command'." 776original use. Otherwise, recompile using `compile-command'."
767 (interactive) 777 (interactive)
768 (save-some-buffers (not compilation-ask-about-save) nil) 778 (save-some-buffers (not compilation-ask-about-save) nil)
769 (let ((default-directory (or compilation-directory default-directory))) 779 (let ((default-directory (or compilation-directory default-directory)))
@@ -773,9 +783,9 @@ original use. Otherwise, it recompiles using `compile-command'."
773(defcustom compilation-scroll-output nil 783(defcustom compilation-scroll-output nil
774 "*Non-nil to scroll the *compilation* buffer window as output appears. 784 "*Non-nil to scroll the *compilation* buffer window as output appears.
775 785
776Setting it causes the compilation-mode commands to put point at the 786Setting it causes the Compilation mode commands to put point at the
777end of their output window so that the end of the output is always 787end of their output window so that the end of the output is always
778visible rather than the begining." 788visible rather than the beginning."
779 :type 'boolean 789 :type 'boolean
780 :version "20.3" 790 :version "20.3"
781 :group 'compilation) 791 :group 'compilation)
@@ -822,11 +832,11 @@ Otherwise, construct a buffer name from MODE-NAME."
822The rest of the arguments are optional; for them, nil means use the default. 832The rest of the arguments are optional; for them, nil means use the default.
823 833
824MODE is the major mode to set in the compilation buffer. Mode 834MODE is the major mode to set in the compilation buffer. Mode
825may also be `t' meaning `compilation-shell-minor-mode' under `comint-mode'. 835may also be t meaning use `compilation-shell-minor-mode' under `comint-mode'.
826NAME-FUNCTION is a function called to name the buffer. 836NAME-FUNCTION is a function called to name the buffer.
827 837
828If HIGHLIGHT-REGEXP is non-nil, `next-error' will temporarily highlight 838If HIGHLIGHT-REGEXP is non-nil, `next-error' will temporarily highlight
829matching section of the visited source line; the default is to use the 839the matching section of the visited source line; the default is to use the
830global value of `compilation-highlight-regexp'. 840global value of `compilation-highlight-regexp'.
831 841
832Returns the compilation buffer created." 842Returns the compilation buffer created."
@@ -838,8 +848,8 @@ Returns the compilation buffer created."
838 (process-environment 848 (process-environment
839 (append 849 (append
840 compilation-environment 850 compilation-environment
841 (if (and (boundp 'system-uses-terminfo) 851 (if (if (boundp 'system-uses-terminfo) ; `if' for compiler warning
842 system-uses-terminfo) 852 system-uses-terminfo)
843 (list "TERM=dumb" "TERMCAP=" 853 (list "TERM=dumb" "TERMCAP="
844 (format "COLUMNS=%d" (window-width))) 854 (format "COLUMNS=%d" (window-width)))
845 (list "TERM=emacs" 855 (list "TERM=emacs"
@@ -1136,7 +1146,9 @@ The global commands next/previous/first-error/goto-error use this.")
1136(defconst compilation-turn-on-font-lock 'turn-on-font-lock) 1146(defconst compilation-turn-on-font-lock 'turn-on-font-lock)
1137 1147
1138(defun compilation-setup (&optional minor) 1148(defun compilation-setup (&optional minor)
1139 "Prepare the buffer for the compilation parsing commands to work." 1149 "Prepare the buffer for the compilation parsing commands to work.
1150Optional argument MINOR indicates this is called from
1151`compilation-minor-mode'."
1140 (make-local-variable 'compilation-current-error) 1152 (make-local-variable 'compilation-current-error)
1141 (make-local-variable 'compilation-error-screen-columns) 1153 (make-local-variable 'compilation-error-screen-columns)
1142 (make-local-variable 'overlay-arrow-position) 1154 (make-local-variable 'overlay-arrow-position)
@@ -1145,7 +1157,7 @@ The global commands next/previous/first-error/goto-error use this.")
1145 '(directory message help-echo mouse-face debug)) 1157 '(directory message help-echo mouse-face debug))
1146 (set (make-local-variable 'compilation-locs) 1158 (set (make-local-variable 'compilation-locs)
1147 (make-hash-table :test 'equal :weakness 'value)) 1159 (make-hash-table :test 'equal :weakness 'value))
1148 ;; lazy-lock would never find the message unless it's scrolled to 1160 ;; lazy-lock would never find the message unless it's scrolled to.
1149 ;; jit-lock might fontify some things too late. 1161 ;; jit-lock might fontify some things too late.
1150 (set (make-local-variable 'font-lock-support-mode) nil) 1162 (set (make-local-variable 'font-lock-support-mode) nil)
1151 (set (make-local-variable 'font-lock-maximum-size) nil) 1163 (set (make-local-variable 'font-lock-maximum-size) nil)
@@ -1193,7 +1205,7 @@ Turning the mode on runs the normal hook `compilation-minor-mode-hook'."
1193 (font-lock-fontify-buffer))) 1205 (font-lock-fontify-buffer)))
1194 1206
1195(defun compilation-handle-exit (process-status exit-status msg) 1207(defun compilation-handle-exit (process-status exit-status msg)
1196 "Write msg in the current buffer and hack its mode-line-process." 1208 "Write MSG in the current buffer and hack its mode-line-process."
1197 (let ((buffer-read-only nil) 1209 (let ((buffer-read-only nil)
1198 (status (if compilation-exit-message-function 1210 (status (if compilation-exit-message-function
1199 (funcall compilation-exit-message-function 1211 (funcall compilation-exit-message-function
@@ -1338,7 +1350,7 @@ select the source buffer."
1338 (pop-to-buffer compilation-last-buffer)) 1350 (pop-to-buffer compilation-last-buffer))
1339 1351
1340(defun previous-error-no-select (n) 1352(defun previous-error-no-select (n)
1341 "Move point to the previous error in the compilation buffer and highlight match. 1353 "Move point to previous error in compilation buffer and highlight match.
1342Prefix arg N says how many error messages to move backwards (or 1354Prefix arg N says how many error messages to move backwards (or
1343forwards, if negative). 1355forwards, if negative).
1344Finds and highlights the source line like \\[previous-error], but does not 1356Finds and highlights the source line like \\[previous-error], but does not
@@ -1449,7 +1461,7 @@ See variable `compilation-error-regexp-alist' for customization ideas."
1449 ;; If loc contains no marker, no error in that file has been visited. If 1461 ;; If loc contains no marker, no error in that file has been visited. If
1450 ;; the marker is invalid the buffer has been killed. So, recalculate all 1462 ;; the marker is invalid the buffer has been killed. So, recalculate all
1451 ;; markers for that file. 1463 ;; markers for that file.
1452 (unless (and (nthcdr 3 loc) (marker-buffer (nth 3 loc))) 1464 (unless (and (nth 3 loc) (marker-buffer (nth 3 loc)))
1453 (with-current-buffer (compilation-find-file marker (caar (nth 2 loc)) 1465 (with-current-buffer (compilation-find-file marker (caar (nth 2 loc))
1454 (or (cdar (nth 2 loc)) 1466 (or (cdar (nth 2 loc))
1455 default-directory)) 1467 default-directory))
@@ -1472,7 +1484,7 @@ See variable `compilation-error-regexp-alist' for customization ideas."
1472 (forward-char (car col)))) 1484 (forward-char (car col))))
1473 (beginning-of-line) 1485 (beginning-of-line)
1474 (skip-chars-forward " \t")) 1486 (skip-chars-forward " \t"))
1475 (if (nthcdr 3 col) 1487 (if (nth 3 col)
1476 (set-marker (nth 3 col) (point)) 1488 (set-marker (nth 3 col) (point))
1477 (setcdr (nthcdr 2 col) `(,(point-marker))))))))) 1489 (setcdr (nthcdr 2 col) `(,(point-marker)))))))))
1478 (compilation-goto-locus marker (nth 3 loc) (nth 3 end-loc)) 1490 (compilation-goto-locus marker (nth 3 loc) (nth 3 end-loc))
@@ -1499,6 +1511,32 @@ This operates on the output from the \\[compile] command."
1499 (setq compilation-current-error nil) 1511 (setq compilation-current-error nil)
1500 (next-error n)) 1512 (next-error n))
1501 1513
1514(defun compilation-fake-loc (marker file &optional line col)
1515 "Preassociate MARKER with FILE.
1516This is useful when you compile temporary files, but want
1517automatic translation of the messages to the real buffer from
1518which the temporary file came. This only works if done before a
1519message about FILE appears!
1520
1521Optional args LINE and COL default to 1 and beginning of
1522indentation respectively. The marker is expected to reflect
1523this. In the simplest case the marker points to the first line
1524of the region that was saved to the temp file.
1525
1526If you concatenate several regions into the temp file (e.g. a
1527header with variable assignments and a code region), you must
1528call this several times, once each for the last line of one
1529region and the first line of the next region."
1530 (or (consp file) (setq file (list file)))
1531 (setq file (or (gethash file compilation-locs)
1532 (puthash file (list file nil) compilation-locs)))
1533 (let ((loc (compilation-assq (or line 1) (cdr file))))
1534 (setq loc (compilation-assq col loc))
1535 (if (cdr loc)
1536 (setcdr (cddr loc) (list marker))
1537 (setcdr loc (list (or line 1) file marker)))
1538 loc))
1539
1502(defcustom compilation-context-lines next-screen-context-lines 1540(defcustom compilation-context-lines next-screen-context-lines
1503 "*Display this many lines of leading context before message." 1541 "*Display this many lines of leading context before message."
1504 :type 'integer 1542 :type 'integer
@@ -1506,7 +1544,7 @@ This operates on the output from the \\[compile] command."
1506 :version "21.4") 1544 :version "21.4")
1507 1545
1508(defsubst compilation-set-window (w mk) 1546(defsubst compilation-set-window (w mk)
1509 ;; Align the compilation output window W with marker MK near top. 1547 "Align the compilation output window W with marker MK near top."
1510 (set-window-start w (save-excursion 1548 (set-window-start w (save-excursion
1511 (goto-char mk) 1549 (goto-char mk)
1512 (beginning-of-line (- 1 compilation-context-lines)) 1550 (beginning-of-line (- 1 compilation-context-lines))
@@ -1514,8 +1552,8 @@ This operates on the output from the \\[compile] command."
1514 (set-window-point w mk)) 1552 (set-window-point w mk))
1515 1553
1516(defun compilation-goto-locus (msg mk end-mk) 1554(defun compilation-goto-locus (msg mk end-mk)
1517 "Jump to an error MESSAGE and SOURCE. 1555 "Jump to an error corresponding to MSG at MK.
1518All arguments are markers. If SOURCE-END is non nil, mark is set there." 1556All arguments are markers. If END-MK is non nil, mark is set there."
1519 (if (eq (window-buffer (selected-window)) 1557 (if (eq (window-buffer (selected-window))
1520 (marker-buffer msg)) 1558 (marker-buffer msg))
1521 ;; If the compilation buffer window is selected, 1559 ;; If the compilation buffer window is selected,
@@ -1623,7 +1661,7 @@ Pop up the buffer containing MARKER and scroll to MARKER if we ask the user."
1623 buffer))) 1661 buffer)))
1624 1662
1625(defun compilation-normalize-filename (filename) 1663(defun compilation-normalize-filename (filename)
1626 "Convert a filename string found in an error message to make it usable." 1664 "Convert FILENAME string found in an error message to make it usable."
1627 1665
1628 ;; Check for a comint-file-name-prefix and prepend it if 1666 ;; Check for a comint-file-name-prefix and prepend it if
1629 ;; appropriate. (This is very useful for 1667 ;; appropriate. (This is very useful for
@@ -1691,7 +1729,7 @@ Pop up the buffer containing MARKER and scroll to MARKER if we ask the user."
1691(defun compile-buffer-substring (n) (if n (match-string n))) 1729(defun compile-buffer-substring (n) (if n (match-string n)))
1692 1730
1693(defun compilation-compat-error-properties (err) 1731(defun compilation-compat-error-properties (err)
1694 ;; Map old-style ERROR to new-style MESSAGE. 1732 "Map old-style error ERR to new-style message."
1695 (let* ((dst (cdr err)) 1733 (let* ((dst (cdr err))
1696 (loc (cond ((markerp dst) (list nil nil nil dst)) 1734 (loc (cond ((markerp dst) (list nil nil nil dst))
1697 ((consp dst) 1735 ((consp dst)
@@ -1701,6 +1739,7 @@ Pop up the buffer containing MARKER and scroll to MARKER if we ask the user."
1701 `(face nil 1739 `(face nil
1702 message ,(list loc 2) 1740 message ,(list loc 2)
1703 help-echo "mouse-2: visit the source location" 1741 help-echo "mouse-2: visit the source location"
1742 keymap compilation-button-map
1704 mouse-face highlight))) 1743 mouse-face highlight)))
1705 1744
1706(defun compilation-compat-parse-errors (limit) 1745(defun compilation-compat-parse-errors (limit)
diff --git a/lisp/progmodes/gdb-ui.el b/lisp/progmodes/gdb-ui.el
index 8446266b2f3..b33f8f3f239 100644
--- a/lisp/progmodes/gdb-ui.el
+++ b/lisp/progmodes/gdb-ui.el
@@ -222,6 +222,7 @@ speedbar."
222(defun gdb-goto-info () 222(defun gdb-goto-info ()
223 (interactive) 223 (interactive)
224 (select-frame (make-frame)) 224 (select-frame (make-frame))
225 (require 'info)
225 (Info-goto-node "(emacs)GDB Graphical Interface")) 226 (Info-goto-node "(emacs)GDB Graphical Interface"))
226 227
227(defconst gdb-var-create-regexp 228(defconst gdb-var-create-regexp
@@ -688,9 +689,9 @@ This filter may simply queue output for a later time."
688 (string-to-int (match-string 2 args)))) 689 (string-to-int (match-string 2 args))))
689 (setq gdb-current-address (match-string 3 args)) 690 (setq gdb-current-address (match-string 3 args))
690 (setq gdb-view-source t) 691 (setq gdb-view-source t)
691;; cover for auto-display output which comes *before* 692 ;; cover for auto-display output which comes *before*
692;; stopped annotation 693 ;; stopped annotation
693 (if (eq (gdb-get-output-sink) 'inferior) (gdb-set-output-sink 'user))) 694 (if (eq (gdb-get-output-sink) 'inferior) (gdb-set-output-sink 'user)))
694 695
695(defun gdb-send-item (item) 696(defun gdb-send-item (item)
696 (if gdb-enable-debug-log (push (cons 'send item) gdb-debug-log)) 697 (if gdb-enable-debug-log (push (cons 'send item) gdb-debug-log))
@@ -1112,7 +1113,8 @@ static char *magick[] = {
1112 (save-excursion 1113 (save-excursion
1113 (goto-line (string-to-number line)) 1114 (goto-line (string-to-number line))
1114 (gdb-put-breakpoint-icon (eq flag ?y))))))))) 1115 (gdb-put-breakpoint-icon (eq flag ?y)))))))))
1115 (end-of-line)))))) 1116 (end-of-line)))))
1117 (if (gdb-get-buffer 'gdb-assembler-buffer) (gdb-assembler-custom)))
1116 1118
1117(defun gdb-mouse-toggle-breakpoint (event) 1119(defun gdb-mouse-toggle-breakpoint (event)
1118 "Toggle breakpoint with mouse click in left margin." 1120 "Toggle breakpoint with mouse click in left margin."
@@ -1532,11 +1534,9 @@ the source buffer."
1532 1534
1533(defun gdb-display-source-buffer (buffer) 1535(defun gdb-display-source-buffer (buffer)
1534 (if (eq gdb-selected-view 'source) 1536 (if (eq gdb-selected-view 'source)
1535 (progn
1536 (gdb-display-buffer buffer) 1537 (gdb-display-buffer buffer)
1537 (get-buffer-window buffer)) 1538 (gdb-display-buffer (gdb-get-buffer 'gdb-assembler-buffer)))
1538 (gdb-display-buffer (gdb-get-buffer 'gdb-assembler-buffer)) 1539 (get-buffer-window buffer))
1539 nil))
1540 1540
1541 1541
1542;;; Shared keymap initialization: 1542;;; Shared keymap initialization:
@@ -1612,6 +1612,7 @@ the source buffer."
1612(defun gdb-view-assembler() 1612(defun gdb-view-assembler()
1613 (interactive) 1613 (interactive)
1614 (gdb-display-buffer (gdb-get-create-buffer 'gdb-assembler-buffer)) 1614 (gdb-display-buffer (gdb-get-create-buffer 'gdb-assembler-buffer))
1615 (gdb-invalidate-assembler)
1615 (setq gdb-selected-view 'assembler)) 1616 (setq gdb-selected-view 'assembler))
1616 1617
1617;(defun gdb-view-both() 1618;(defun gdb-view-both()
@@ -1964,7 +1965,7 @@ BUFFER nil or omitted means use the current buffer."
1964 (with-current-buffer (gdb-get-create-buffer 'gdb-partial-output-buffer) 1965 (with-current-buffer (gdb-get-create-buffer 'gdb-partial-output-buffer)
1965 (goto-char (point-min)) 1966 (goto-char (point-min))
1966 (forward-line) 1967 (forward-line)
1967 (if (looking-at ".*=\\s-+0x\\(\\S-*\\)\\s-+in\\s-+\\(\\S-*\\)") 1968 (if (looking-at ".*=\\s-+0x\\(\\S-*\\)\\s-+in\\s-+\\(\\S-*?\\);? ")
1968 (progn 1969 (progn
1969 (setq gdb-current-frame (match-string 2)) 1970 (setq gdb-current-frame (match-string 2))
1970 (let ((address (match-string 1))) 1971 (let ((address (match-string 1)))
diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el
index bfa507b851a..7a7e62d06ee 100644
--- a/lisp/progmodes/python.el
+++ b/lisp/progmodes/python.el
@@ -3,6 +3,7 @@
3;; Copyright (C) 2003, 04 Free Software Foundation, Inc. 3;; Copyright (C) 2003, 04 Free Software Foundation, Inc.
4 4
5;; Author: Dave Love <fx@gnu.org> 5;; Author: Dave Love <fx@gnu.org>
6;; Maintainer: FSF
6;; Created: Nov 2003 7;; Created: Nov 2003
7;; Keywords: languages 8;; Keywords: languages
8 9
@@ -66,10 +67,8 @@
66(require 'comint) 67(require 'comint)
67(eval-when-compile 68(eval-when-compile
68 (require 'compile) 69 (require 'compile)
69 (autoload 'Info-last "info")
70 (autoload 'Info-exit "info")
71 (autoload 'info-lookup-maybe-add-help "info-look")) 70 (autoload 'info-lookup-maybe-add-help "info-look"))
72(autoload 'compilation-start "compile") ; spurious compiler warning anyway 71(autoload 'compilation-start "compile")
73 72
74(defgroup python nil 73(defgroup python nil
75 "Silly walks in the Python language" 74 "Silly walks in the Python language"
@@ -829,7 +828,8 @@ move and return nil. Otherwise return t."
829Makes nested Imenu menus from nested `class' and `def' statements. 828Makes nested Imenu menus from nested `class' and `def' statements.
830The nested menus are headed by an item referencing the outer 829The nested menus are headed by an item referencing the outer
831definition; it has a space prepended to the name so that it sorts 830definition; it has a space prepended to the name so that it sorts
832first with `imenu--sort-by-name'." 831first with `imenu--sort-by-name' (though, unfortunately, sub-menus
832precede it)."
833 (unless (boundp 'python-recursing) ; dynamically bound below 833 (unless (boundp 'python-recursing) ; dynamically bound below
834 (goto-char (point-min))) ; normal call from Imenu 834 (goto-char (point-min))) ; normal call from Imenu
835 (let (index-alist ; accumulated value to return 835 (let (index-alist ; accumulated value to return
@@ -937,32 +937,37 @@ Additional arguments are added when the command is used by `run-python'
937et al.") 937et al.")
938 938
939(defvar python-buffer nil 939(defvar python-buffer nil
940 "*The current python process buffer. 940 "The current python process buffer."
941To run multiple Python processes, start the first with \\[run-python]. 941 ;; Fixme: a single process is currently assumed, so that this doc
942It will be in a buffer named *Python*. Rename that with 942 ;; is misleading.
943\\[rename-buffer]. Now start a new process with \\[run-python]. It 943
944will be in a new buffer, named *Python*. Switch between the different 944;; "*The current python process buffer.
945process buffers with \\[switch-to-buffer]. 945;; To run multiple Python processes, start the first with \\[run-python].
946 946;; It will be in a buffer named *Python*. Rename that with
947Commands that send text from source buffers to Python processes have 947;; \\[rename-buffer]. Now start a new process with \\[run-python]. It
948to choose a process to send to. This is determined by global variable 948;; will be in a new buffer, named *Python*. Switch between the different
949`python-buffer'. Suppose you have three inferior Pythons running: 949;; process buffers with \\[switch-to-buffer].
950 Buffer Process 950
951 foo python 951;; Commands that send text from source buffers to Python processes have
952 bar python<2> 952;; to choose a process to send to. This is determined by global variable
953 *Python* python<3> 953;; `python-buffer'. Suppose you have three inferior Pythons running:
954If you do a \\[python-send-region-and-go] command on some Python source 954;; Buffer Process
955code, what process does it go to? 955;; foo python
956 956;; bar python<2>
957- In a process buffer (foo, bar, or *Python*), send it to that process. 957;; *Python* python<3>
958- In some other buffer (e.g. a source file), send it to the process 958;; If you do a \\[python-send-region-and-go] command on some Python source
959 attached to `python-buffer'. 959;; code, what process does it go to?
960Process selection is done by function `python-proc'. 960
961 961;; - In a process buffer (foo, bar, or *Python*), send it to that process.
962Whenever \\[run-python] starts a new process, it resets `python-buffer' 962;; - In some other buffer (e.g. a source file), send it to the process
963to be the new process's buffer. If you only run one process, this will 963;; attached to `python-buffer'.
964do the right thing. If you run multiple processes, you can change 964;; Process selection is done by function `python-proc'.
965`python-buffer' to another process buffer with \\[set-variable].") 965
966;; Whenever \\[run-python] starts a new process, it resets `python-buffer'
967;; to be the new process's buffer. If you only run one process, this will
968;; do the right thing. If you run multiple processes, you can change
969;; `python-buffer' to another process buffer with \\[set-variable]."
970 )
966 971
967(defconst python-compilation-regexp-alist 972(defconst python-compilation-regexp-alist
968 `((,(rx (and line-start (1+ (any " \t")) "File \"" 973 `((,(rx (and line-start (1+ (any " \t")) "File \""
@@ -971,6 +976,9 @@ do the right thing. If you run multiple processes, you can change
971 1 python-compilation-line-number)) 976 1 python-compilation-line-number))
972 "`compilation-error-regexp-alist' for inferior Python.") 977 "`compilation-error-regexp-alist' for inferior Python.")
973 978
979;; Fixme: This should inherit some stuff from python-mode, but I'm not
980;; sure how much: at least some keybindings, like C-c C-f; syntax?;
981;; font-locking, e.g. for triple-quoted strings?
974(define-derived-mode inferior-python-mode comint-mode "Inferior Python" 982(define-derived-mode inferior-python-mode comint-mode "Inferior Python"
975 "Major mode for interacting with an inferior Python process. 983 "Major mode for interacting with an inferior Python process.
976A Python process can be started with \\[run-python]. 984A Python process can be started with \\[run-python].
@@ -997,7 +1005,8 @@ For running multiple processes in multiple buffers, see `python-buffer'.
997 (add-hook 'comint-input-filter-functions 'python-input-filter nil t) 1005 (add-hook 'comint-input-filter-functions 'python-input-filter nil t)
998 (add-hook 'comint-preoutput-filter-functions #'python-preoutput-filter 1006 (add-hook 'comint-preoutput-filter-functions #'python-preoutput-filter
999 nil t) 1007 nil t)
1000 ;; Still required by `comint-redirect-send-command', for instance: 1008 ;; Still required by `comint-redirect-send-command', for instance
1009 ;; (and we need to match things like `>>> ... >>> '):
1001 (set (make-local-variable 'comint-prompt-regexp) "^\\([>.]\\{3\\} \\)+") 1010 (set (make-local-variable 'comint-prompt-regexp) "^\\([>.]\\{3\\} \\)+")
1002 (set (make-local-variable 'compilation-error-regexp-alist) 1011 (set (make-local-variable 'compilation-error-regexp-alist)
1003 python-compilation-regexp-alist) 1012 python-compilation-regexp-alist)
@@ -1037,11 +1046,15 @@ Used as line-number hook function in `python-compilation-regexp-alist'."
1037 (cons (point-marker) 1046 (cons (point-marker)
1038 (if (and (markerp python-orig-start) 1047 (if (and (markerp python-orig-start)
1039 (marker-buffer python-orig-start)) 1048 (marker-buffer python-orig-start))
1040 (with-current-buffer (marker-buffer python-orig-start) 1049 (let ((start python-orig-start))
1041 (goto-char python-orig-start) 1050 (with-current-buffer (marker-buffer python-orig-start)
1042 (forward-line (1- line))) 1051 (goto-char start)
1043 (list (if (stringp python-orig-start) python-orig-start file) 1052 (forward-line (1- line))
1044 line nil))))) 1053 (point-marker)))
1054 (list (if (stringp python-orig-start)
1055 (list python-orig-start default-directory)
1056 file)
1057 line col)))))
1045 1058
1046(defvar python-preoutput-result nil 1059(defvar python-preoutput-result nil
1047 "Data from output line last `_emacs_out' line seen by the preoutput filter.") 1060 "Data from output line last `_emacs_out' line seen by the preoutput filter.")
@@ -1234,17 +1247,17 @@ module-qualified names."
1234 ;; (set (make-local-variable 'compilation-old-error-list) nil) 1247 ;; (set (make-local-variable 'compilation-old-error-list) nil)
1235 (let ((comint-input-filter-functions 1248 (let ((comint-input-filter-functions
1236 (delete 'python-input-filter comint-input-filter-functions))) 1249 (delete 'python-input-filter comint-input-filter-functions)))
1250 (set (make-local-variable 'python-orig-start) nil)
1251 ;; Fixme: I'm not convinced by this logic from python-mode.el.
1237 (python-send-string 1252 (python-send-string
1238 (if (string-match "\\.py\\'" file-name) 1253 (if (string-match "\\.py\\'" file-name)
1239 ;; Fixme: make sure the directory is in the path list 1254 ;; Fixme: make sure the directory is in the path list
1240 (let ((module (file-name-sans-extension 1255 (let ((module (file-name-sans-extension
1241 (file-name-nondirectory file-name)))) 1256 (file-name-nondirectory file-name))))
1242 (set (make-local-variable 'python-orig-start) nil)
1243 (format "\ 1257 (format "\
1244if globals().has_key(%S): reload(%s) 1258if globals().has_key(%S): reload(%s)
1245else: import %s 1259else: import %s
1246" module module module)) 1260" module module module))
1247 (set (make-local-variable 'python-orig-start) file-name)
1248 (format "execfile('%s')" file-name)))) 1261 (format "execfile('%s')" file-name))))
1249 (set-marker compilation-parsing-end end) 1262 (set-marker compilation-parsing-end end)
1250 (setq compilation-last-buffer (current-buffer)))))) 1263 (setq compilation-last-buffer (current-buffer))))))
@@ -1329,13 +1342,14 @@ Used with `eval-after-load'."
1329 (string-match "^Python \\([0-9]+\\.[0-9]+\\>\\)" s) 1342 (string-match "^Python \\([0-9]+\\.[0-9]+\\>\\)" s)
1330 (match-string 1 s))) 1343 (match-string 1 s)))
1331 ;; Whether info files have a Python version suffix, e.g. in Debian. 1344 ;; Whether info files have a Python version suffix, e.g. in Debian.
1332 (versioned 1345 (versioned
1333 (with-temp-buffer 1346 (with-temp-buffer
1334 (Info-mode) 1347 (with-no-warnings (Info-mode))
1335 (condition-case () 1348 (condition-case ()
1336 ;; Don't use `info' because it would pop-up a *info* buffer. 1349 ;; Don't use `info' because it would pop-up a *info* buffer.
1337 (Info-goto-node (format "(python%s-lib)Miscellaneous Index" 1350 (with-no-warnings
1338 version)) 1351 (Info-goto-node (format "(python%s-lib)Miscellaneous Index"
1352 version)))
1339 (error nil))))) 1353 (error nil)))))
1340 (info-lookup-maybe-add-help 1354 (info-lookup-maybe-add-help
1341 :mode 'python-mode 1355 :mode 'python-mode
diff --git a/lisp/url/url-dav.el b/lisp/url/url-dav.el
index b54d9f52c01..d6c5ffffa43 100644
--- a/lisp/url/url-dav.el
+++ b/lisp/url/url-dav.el
@@ -386,8 +386,7 @@ XML document."
386 (overall-status nil)) 386 (overall-status nil))
387 (when buffer 387 (when buffer
388 (unwind-protect 388 (unwind-protect
389 (save-excursion 389 (with-current-buffer buffer
390 (set-buffer buffer)
391 (goto-char url-http-end-of-headers) 390 (goto-char url-http-end-of-headers)
392 (setq overall-status url-http-response-status) 391 (setq overall-status url-http-response-status)
393 392
@@ -396,13 +395,13 @@ XML document."
396 ;; them. 395 ;; them.
397 (if (and 396 (if (and
398 url-http-content-type 397 url-http-content-type
399 (or (string-match "^text/xml" url-http-content-type) 398 (string-match "\\`\\(text\\|application\\)/xml"
400 (string-match "^application/xml" url-http-content-type))) 399 url-http-content-type))
401 (setq tree (xml-parse-region (point) (point-max))))) 400 (setq tree (xml-parse-region (point) (point-max)))))
402 ;; Clean up after ourselves. 401 ;; Clean up after ourselves.
403 '(kill-buffer buffer))) 402 (kill-buffer buffer)))
404 403
405 ;; We should now be 404 ;; We should now be
406 (if (eq (xml-node-name (car tree)) 'DAV:multistatus) 405 (if (eq (xml-node-name (car tree)) 'DAV:multistatus)
407 (url-dav-dispatch-node (car tree)) 406 (url-dav-dispatch-node (car tree))
408 (url-debug 'dav "Got back singleton response for URL(%S)" url) 407 (url-debug 'dav "Got back singleton response for URL(%S)" url)
@@ -577,8 +576,7 @@ Returns t iff the lock was successfully released."
577 (result nil)) 576 (result nil))
578 (when buffer 577 (when buffer
579 (unwind-protect 578 (unwind-protect
580 (save-excursion 579 (with-current-buffer buffer
581 (set-buffer buffer)
582 (setq result (url-dav-http-success-p url-http-response-status))) 580 (setq result (url-dav-http-success-p url-http-response-status)))
583 (kill-buffer buffer))) 581 (kill-buffer buffer)))
584 result)) 582 result))
@@ -627,7 +625,7 @@ Returns t iff the lock was successfully released."
627(autoload 'url-http-head-file-attributes "url-http") 625(autoload 'url-http-head-file-attributes "url-http")
628 626
629;;;###autoload 627;;;###autoload
630(defun url-dav-file-attributes (url) 628(defun url-dav-file-attributes (url &optional id-format)
631 (let ((properties (cdar (url-dav-get-properties url))) 629 (let ((properties (cdar (url-dav-get-properties url)))
632 (attributes nil)) 630 (attributes nil))
633 (if (and properties 631 (if (and properties
@@ -679,7 +677,7 @@ Returns t iff the lock was successfully released."
679 ;; device number - meaningless 677 ;; device number - meaningless
680 nil)) 678 nil))
681 ;; Fall back to just the normal http way of doing things. 679 ;; Fall back to just the normal http way of doing things.
682 (setq attributes (url-http-head-file-attributes url))) 680 (setq attributes (url-http-head-file-attributes url id-format)))
683 attributes)) 681 attributes))
684 682
685;;;###autoload 683;;;###autoload
@@ -695,8 +693,7 @@ OBJ may be a buffer or a string."
695 (url-request-data 693 (url-request-data
696 (cond 694 (cond
697 ((bufferp obj) 695 ((bufferp obj)
698 (save-excursion 696 (with-current-buffer obj
699 (set-buffer obj)
700 (buffer-string))) 697 (buffer-string)))
701 ((stringp obj) 698 ((stringp obj)
702 obj) 699 obj)
@@ -719,8 +716,7 @@ OBJ may be a buffer or a string."
719 ;; Sanity checking 716 ;; Sanity checking
720 (when buffer 717 (when buffer
721 (unwind-protect 718 (unwind-protect
722 (save-excursion 719 (with-current-buffer buffer
723 (set-buffer buffer)
724 (setq result (url-dav-http-success-p url-http-response-status))) 720 (setq result (url-dav-http-success-p url-http-response-status)))
725 (kill-buffer buffer))) 721 (kill-buffer buffer)))
726 result)) 722 result))
@@ -849,8 +845,7 @@ If NOSORT is non-nil, the list is not sorted--its order is unpredictable.
849 (result nil)) 845 (result nil))
850 (when buffer 846 (when buffer
851 (unwind-protect 847 (unwind-protect
852 (save-excursion 848 (with-current-buffer buffer
853 (set-buffer buffer)
854 (case url-http-response-status 849 (case url-http-response-status
855 (201 ; Collection created in its entirety 850 (201 ; Collection created in its entirety
856 (setq result t)) 851 (setq result t))
diff --git a/lisp/url/url-file.el b/lisp/url/url-file.el
index 4dfac46b651..77c2e74555f 100644
--- a/lisp/url/url-file.el
+++ b/lisp/url/url-file.el
@@ -220,14 +220,14 @@ to them."
220 buffer)) 220 buffer))
221 221
222(defmacro url-file-create-wrapper (method args) 222(defmacro url-file-create-wrapper (method args)
223 (` (defalias (quote (, (intern (format "url-ftp-%s" method)))) 223 `(defalias ',(intern (format "url-ftp-%s" method))
224 (defun (, (intern (format "url-file-%s" method))) (, args) 224 (defun ,(intern (format "url-file-%s" method)) ,args
225 (, (format "FTP/FILE URL wrapper around `%s' call." method)) 225 ,(format "FTP/FILE URL wrapper around `%s' call." method)
226 (setq url (url-file-build-filename url)) 226 (setq url (url-file-build-filename url))
227 (and url ((, method) (,@ (remove '&rest (remove '&optional args))))))))) 227 (and url (,method ,@(remove '&rest (remove '&optional args)))))))
228 228
229(url-file-create-wrapper file-exists-p (url)) 229(url-file-create-wrapper file-exists-p (url))
230(url-file-create-wrapper file-attributes (url)) 230(url-file-create-wrapper file-attributes (url &optional id-format))
231(url-file-create-wrapper file-symlink-p (url)) 231(url-file-create-wrapper file-symlink-p (url))
232(url-file-create-wrapper file-readable-p (url)) 232(url-file-create-wrapper file-readable-p (url))
233(url-file-create-wrapper file-writable-p (url)) 233(url-file-create-wrapper file-writable-p (url))
diff --git a/lisp/url/url-handlers.el b/lisp/url/url-handlers.el
index eb0bec9ae92..6c540e8d61b 100644
--- a/lisp/url/url-handlers.el
+++ b/lisp/url/url-handlers.el
@@ -225,7 +225,7 @@ accessible."
225 ,@(remove '&rest (remove '&optional args)))))) 225 ,@(remove '&rest (remove '&optional args))))))
226 226
227(url-handlers-create-wrapper file-exists-p (url)) 227(url-handlers-create-wrapper file-exists-p (url))
228(url-handlers-create-wrapper file-attributes (url)) 228(url-handlers-create-wrapper file-attributes (url &optional id-format))
229(url-handlers-create-wrapper file-symlink-p (url)) 229(url-handlers-create-wrapper file-symlink-p (url))
230(url-handlers-create-wrapper file-writable-p (url)) 230(url-handlers-create-wrapper file-writable-p (url))
231(url-handlers-create-wrapper file-directory-p (url)) 231(url-handlers-create-wrapper file-directory-p (url))
@@ -244,7 +244,7 @@ accessible."
244 (url-handlers-create-wrapper 244 (url-handlers-create-wrapper
245 file-truename (url &optional counter prev-dirs))) 245 file-truename (url &optional counter prev-dirs)))
246 246
247(add-hook 'find-file-hooks 'url-handlers-set-buffer-mode) 247(add-hook 'find-file-hook 'url-handlers-set-buffer-mode)
248 248
249(defun url-handlers-set-buffer-mode () 249(defun url-handlers-set-buffer-mode ()
250 "Set correct modes for the current buffer if visiting a remote file." 250 "Set correct modes for the current buffer if visiting a remote file."
diff --git a/lisp/url/url-http.el b/lisp/url/url-http.el
index b2f797d09c7..200025c3804 100644
--- a/lisp/url/url-http.el
+++ b/lisp/url/url-http.el
@@ -4,6 +4,7 @@
4 4
5;; Author: Bill Perry <wmperry@gnu.org> 5;; Author: Bill Perry <wmperry@gnu.org>
6;; Keywords: comm, data, processes 6;; Keywords: comm, data, processes
7
7;; This file is part of GNU Emacs. 8;; This file is part of GNU Emacs.
8;; 9;;
9;; GNU Emacs is free software; you can redistribute it and/or modify 10;; GNU Emacs is free software; you can redistribute it and/or modify
@@ -1120,7 +1121,7 @@ CBARGS as the arguments."
1120;;;###autoload 1121;;;###autoload
1121(defalias 'url-http-file-readable-p 'url-http-file-exists-p) 1122(defalias 'url-http-file-readable-p 'url-http-file-exists-p)
1122 1123
1123(defun url-http-head-file-attributes (url) 1124(defun url-http-head-file-attributes (url &optional id-format)
1124 (let ((buffer (url-http-head url)) 1125 (let ((buffer (url-http-head url))
1125 (attributes nil)) 1126 (attributes nil))
1126 (when buffer 1127 (when buffer
@@ -1136,10 +1137,10 @@ CBARGS as the arguments."
1136 attributes)) 1137 attributes))
1137 1138
1138;;;###autoload 1139;;;###autoload
1139(defun url-http-file-attributes (url) 1140(defun url-http-file-attributes (url &optional id-format)
1140 (if (url-dav-supported-p url) 1141 (if (url-dav-supported-p url)
1141 (url-dav-file-attributes url) 1142 (url-dav-file-attributes url id-format)
1142 (url-http-head-file-attributes url))) 1143 (url-http-head-file-attributes url id-format)))
1143 1144
1144;;;###autoload 1145;;;###autoload
1145(defun url-http-options (url) 1146(defun url-http-options (url)
diff --git a/lisp/url/url-https.el b/lisp/url/url-https.el
index 0ea11a45b79..11b2593ea80 100644
--- a/lisp/url/url-https.el
+++ b/lisp/url/url-https.el
@@ -1,26 +1,29 @@
1;;; url-https.el --- HTTP over SSL routines 1;;; url-https.el --- HTTP over SSL routines
2
3;; Copyright (c) 1999, 2004 Free Software Foundation, Inc.
4
2;; Keywords: comm, data, processes 5;; Keywords: comm, data, processes
3 6
4;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 7;; This file is part of GNU Emacs.
5;;; Copyright (c) 1999 Free Software Foundation, Inc. 8;;
6;;; 9;; GNU Emacs is free software; you can redistribute it and/or modify
7;;; This file is part of GNU Emacs. 10;; it under the terms of the GNU General Public License as published by
8;;; 11;; the Free Software Foundation; either version 2, or (at your option)
9;;; GNU Emacs is free software; you can redistribute it and/or modify 12;; any later version.
10;;; it under the terms of the GNU General Public License as published by 13;;
11;;; the Free Software Foundation; either version 2, or (at your option) 14;; GNU Emacs is distributed in the hope that it will be useful,
12;;; any later version. 15;; but WITHOUT ANY WARRANTY; without even the implied warranty of
13;;; 16;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14;;; GNU Emacs is distributed in the hope that it will be useful, 17;; GNU General Public License for more details.
15;;; but WITHOUT ANY WARRANTY; without even the implied warranty of 18;;
16;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 19;; You should have received a copy of the GNU General Public License
17;;; GNU General Public License for more details. 20;; along with GNU Emacs; see the file COPYING. If not, write to the
18;;; 21;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
19;;; You should have received a copy of the GNU General Public License 22;; Boston, MA 02111-1307, USA.
20;;; along with GNU Emacs; see the file COPYING. If not, write to the 23
21;;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, 24;;; Commentary:
22;;; Boston, MA 02111-1307, USA. 25
23;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 26;;; Code:
24 27
25(require 'url-gw) 28(require 'url-gw)
26(require 'url-util) 29(require 'url-util)
@@ -45,8 +48,9 @@
45(url-https-create-secure-wrapper nil (url callback cbargs)) 48(url-https-create-secure-wrapper nil (url callback cbargs))
46(url-https-create-secure-wrapper file-exists-p (url)) 49(url-https-create-secure-wrapper file-exists-p (url))
47(url-https-create-secure-wrapper file-readable-p (url)) 50(url-https-create-secure-wrapper file-readable-p (url))
48(url-https-create-secure-wrapper file-attributes (url)) 51(url-https-create-secure-wrapper file-attributes (url &optional id-format))
49 52
50(provide 'url-https) 53(provide 'url-https)
51 54
52;;; arch-tag: c3645ac5-c248-4d12-ad41-7c4b6f7b6d19 55;; arch-tag: c3645ac5-c248-4d12-ad41-7c4b6f7b6d19
56;;; url-https.el ends here
diff --git a/lisp/url/url-nfs.el b/lisp/url/url-nfs.el
index c0ac4f5cb45..d068341b1c2 100644
--- a/lisp/url/url-nfs.el
+++ b/lisp/url/url-nfs.el
@@ -1,27 +1,30 @@
1;;; url-nfs.el --- NFS URL interface 1;;; url-nfs.el --- NFS URL interface
2
3;; Copyright (c) 1996,97,98,1999,2004 Free Software Foundation, Inc.
4;; Copyright (c) 1996 by William M. Perry <wmperry@cs.indiana.edu>
5
2;; Keywords: comm, data, processes 6;; Keywords: comm, data, processes
3 7
4;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 8;; This file is part of GNU Emacs.
5;;; Copyright (c) 1996 by William M. Perry <wmperry@cs.indiana.edu> 9;;
6;;; Copyright (c) 1996 - 1999 Free Software Foundation, Inc. 10;; GNU Emacs is free software; you can redistribute it and/or modify
7;;; 11;; it under the terms of the GNU General Public License as published by
8;;; This file is part of GNU Emacs. 12;; the Free Software Foundation; either version 2, or (at your option)
9;;; 13;; any later version.
10;;; GNU Emacs is free software; you can redistribute it and/or modify 14;;
11;;; it under the terms of the GNU General Public License as published by 15;; GNU Emacs is distributed in the hope that it will be useful,
12;;; the Free Software Foundation; either version 2, or (at your option) 16;; but WITHOUT ANY WARRANTY; without even the implied warranty of
13;;; any later version. 17;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14;;; 18;; GNU General Public License for more details.
15;;; GNU Emacs is distributed in the hope that it will be useful, 19;;
16;;; but WITHOUT ANY WARRANTY; without even the implied warranty of 20;; You should have received a copy of the GNU General Public License
17;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21;; along with GNU Emacs; see the file COPYING. If not, write to the
18;;; GNU General Public License for more details. 22;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
19;;; 23;; Boston, MA 02111-1307, USA.
20;;; You should have received a copy of the GNU General Public License 24
21;;; along with GNU Emacs; see the file COPYING. If not, write to the 25;;; Commentary:
22;;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, 26
23;;; Boston, MA 02111-1307, USA. 27;;; Code:
24;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
25 28
26(eval-when-compile (require 'cl)) 29(eval-when-compile (require 'cl))
27(require 'url-parse) 30(require 'url-parse)
@@ -72,14 +75,14 @@ Each can be used any number of times.")
72 (url-file (url-nfs-build-filename url) callback cbargs)) 75 (url-file (url-nfs-build-filename url) callback cbargs))
73 76
74(defmacro url-nfs-create-wrapper (method args) 77(defmacro url-nfs-create-wrapper (method args)
75 (` (defun (, (intern (format "url-nfs-%s" method))) (, args) 78 `(defun ,(intern (format "url-nfs-%s" method)) ,args
76 (, (format "NFS URL wrapper around `%s' call." method)) 79 ,(format "NFS URL wrapper around `%s' call." method)
77 (setq url (url-nfs-build-filename url)) 80 (setq url (url-nfs-build-filename url))
78 (and url ((, (intern (format "url-file-%s" method))) 81 (and url (,(intern (format "url-file-%s" method))
79 (,@ (remove '&rest (remove '&optional args)))))))) 82 ,@(remove '&rest (remove '&optional args))))))
80 83
81(url-nfs-create-wrapper file-exists-p (url)) 84(url-nfs-create-wrapper file-exists-p (url))
82(url-nfs-create-wrapper file-attributes (url)) 85(url-nfs-create-wrapper file-attributes (url &optional id-format))
83(url-nfs-create-wrapper file-symlink-p (url)) 86(url-nfs-create-wrapper file-symlink-p (url))
84(url-nfs-create-wrapper file-readable-p (url)) 87(url-nfs-create-wrapper file-readable-p (url))
85(url-nfs-create-wrapper file-writable-p (url)) 88(url-nfs-create-wrapper file-writable-p (url))
@@ -93,4 +96,5 @@ Each can be used any number of times.")
93 96
94(provide 'url-nfs) 97(provide 'url-nfs)
95 98
96;;; arch-tag: cdf9c9ba-b7d2-4c29-8b48-7ae9bbc0d437 99;; arch-tag: cdf9c9ba-b7d2-4c29-8b48-7ae9bbc0d437
100;;; url-nfs.el ends here
diff --git a/lisp/url/url-util.el b/lisp/url/url-util.el
index 49e805086fb..d4a3733eab5 100644
--- a/lisp/url/url-util.el
+++ b/lisp/url/url-util.el
@@ -1,28 +1,31 @@
1;;; url-util.el --- Miscellaneous helper routines for URL library 1;;; url-util.el --- Miscellaneous helper routines for URL library
2
3;; Copyright (c) 1996,97,98,99,2001,2004 Free Software Foundation, Inc.
4;; Copyright (c) 1993 - 1996 by William M. Perry <wmperry@cs.indiana.edu>
5
2;; Author: Bill Perry <wmperry@gnu.org> 6;; Author: Bill Perry <wmperry@gnu.org>
3;; Keywords: comm, data, processes 7;; Keywords: comm, data, processes
4 8
5;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 9;; This file is part of GNU Emacs.
6;;; Copyright (c) 1993 - 1996 by William M. Perry <wmperry@cs.indiana.edu> 10;;
7;;; Copyright (c) 1996, 97, 98, 99, 2001 Free Software Foundation, Inc. 11;; GNU Emacs is free software; you can redistribute it and/or modify
8;;; 12;; it under the terms of the GNU General Public License as published by
9;;; This file is part of GNU Emacs. 13;; the Free Software Foundation; either version 2, or (at your option)
10;;; 14;; any later version.
11;;; GNU Emacs is free software; you can redistribute it and/or modify 15;;
12;;; it under the terms of the GNU General Public License as published by 16;; GNU Emacs is distributed in the hope that it will be useful,
13;;; the Free Software Foundation; either version 2, or (at your option) 17;; but WITHOUT ANY WARRANTY; without even the implied warranty of
14;;; any later version. 18;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15;;; 19;; GNU General Public License for more details.
16;;; GNU Emacs is distributed in the hope that it will be useful, 20;;
17;;; but WITHOUT ANY WARRANTY; without even the implied warranty of 21;; You should have received a copy of the GNU General Public License
18;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 22;; along with GNU Emacs; see the file COPYING. If not, write to the
19;;; GNU General Public License for more details. 23;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
20;;; 24;; Boston, MA 02111-1307, USA.
21;;; You should have received a copy of the GNU General Public License 25
22;;; along with GNU Emacs; see the file COPYING. If not, write to the 26;;; Commentary:
23;;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, 27
24;;; Boston, MA 02111-1307, USA. 28;;; Code:
25;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
26 29
27(require 'url-parse) 30(require 'url-parse)
28(autoload 'timezone-parse-date "timezone") 31(autoload 'timezone-parse-date "timezone")
@@ -63,8 +66,7 @@ If a list, it is a list of the types of messages to be logged."
63 (if (or (eq url-debug t) 66 (if (or (eq url-debug t)
64 (numberp url-debug) 67 (numberp url-debug)
65 (and (listp url-debug) (memq tag url-debug))) 68 (and (listp url-debug) (memq tag url-debug)))
66 (save-excursion 69 (with-current-buffer (get-buffer-create "*URL-DEBUG*")
67 (set-buffer (get-buffer-create "*URL-DEBUG*"))
68 (goto-char (point-max)) 70 (goto-char (point-max))
69 (insert (symbol-name tag) " -> " (apply 'format args) "\n") 71 (insert (symbol-name tag) " -> " (apply 'format args) "\n")
70 (if (numberp url-debug) 72 (if (numberp url-debug)
@@ -173,7 +175,7 @@ Strips out default port numbers, etc."
173;;;###autoload 175;;;###autoload
174(defun url-lazy-message (&rest args) 176(defun url-lazy-message (&rest args)
175 "Just like `message', but is a no-op if called more than once a second. 177 "Just like `message', but is a no-op if called more than once a second.
176Will not do anything if url-show-status is nil." 178Will not do anything if `url-show-status' is nil."
177 (if (or (null url-show-status) 179 (if (or (null url-show-status)
178 (active-minibuffer-window) 180 (active-minibuffer-window)
179 (= url-lazy-message-time 181 (= url-lazy-message-time
@@ -502,4 +504,5 @@ Has a preference for looking backward when not directly on a symbol."
502 504
503(provide 'url-util) 505(provide 'url-util)
504 506
505;;; arch-tag: 24352abc-5a5a-412e-90cd-313b26bed5c9 507;; arch-tag: 24352abc-5a5a-412e-90cd-313b26bed5c9
508;;; url-util.el ends here
diff --git a/lisp/xml.el b/lisp/xml.el
index 408c13ab39b..ab87125356d 100644
--- a/lisp/xml.el
+++ b/lisp/xml.el
@@ -27,13 +27,13 @@
27 27
28;; This file contains a somewhat incomplete non-validating XML parser. It 28;; This file contains a somewhat incomplete non-validating XML parser. It
29;; parses a file, and returns a list that can be used internally by 29;; parses a file, and returns a list that can be used internally by
30;; any other lisp libraries. 30;; any other Lisp libraries.
31 31
32;;; FILE FORMAT 32;;; FILE FORMAT
33 33
34;; The document type declaration may either be ignored or (optionally) 34;; The document type declaration may either be ignored or (optionally)
35;; parsed, but currently the parsing will only accept element 35;; parsed, but currently the parsing will only accept element
36;; declarations. The XML file is assumed to be well-formed. In case 36;; declarations. The XML file is assumed to be well-formed. In case
37;; of error, the parsing stops and the XML file is shown where the 37;; of error, the parsing stops and the XML file is shown where the
38;; parsing stopped. 38;; parsing stopped.
39;; 39;;
@@ -44,7 +44,7 @@
44;; <node2 attr3="name3" attr4="name4">value2</node2> 44;; <node2 attr3="name3" attr4="name4">value2</node2>
45;; <node3 attr5="name5" attr6="name6">value3</node3> 45;; <node3 attr5="name5" attr6="name6">value3</node3>
46;; </node1> 46;; </node1>
47;; Of course, the name of the nodes and attributes can be anything. There can 47;; Of course, the name of the nodes and attributes can be anything. There can
48;; be any number of attributes (or none), as well as any number of children 48;; be any number of attributes (or none), as well as any number of children
49;; below the nodes. 49;; below the nodes.
50;; 50;;
@@ -86,7 +86,18 @@
86 86
87(defsubst xml-node-name (node) 87(defsubst xml-node-name (node)
88 "Return the tag associated with NODE. 88 "Return the tag associated with NODE.
89The tag is a lower-case symbol." 89Without namespace-aware parsing, the tag is a symbol.
90
91With namespace-aware parsing, the tag is a cons of a string
92representing the uri of the namespace with the local name of the
93tag. For example,
94
95 <foo>
96
97would be represented by
98
99 '(\"\" . \"foo\")."
100
90 (car node)) 101 (car node))
91 102
92(defsubst xml-node-attributes (node) 103(defsubst xml-node-attributes (node)
@@ -101,17 +112,17 @@ This is a list of nodes, and it can be nil."
101 112
102(defun xml-get-children (node child-name) 113(defun xml-get-children (node child-name)
103 "Return the children of NODE whose tag is CHILD-NAME. 114 "Return the children of NODE whose tag is CHILD-NAME.
104CHILD-NAME should be a lower case symbol." 115CHILD-NAME should match the value returned by `xml-node-name'."
105 (let ((match ())) 116 (let ((match ()))
106 (dolist (child (xml-node-children node)) 117 (dolist (child (xml-node-children node))
107 (if child 118 (if (and (listp child)
108 (if (equal (xml-node-name child) child-name) 119 (equal (xml-node-name child) child-name))
109 (push child match)))) 120 (push child match)))
110 (nreverse match))) 121 (nreverse match)))
111 122
112(defun xml-get-attribute-or-nil (node attribute) 123(defun xml-get-attribute-or-nil (node attribute)
113 "Get from NODE the value of ATTRIBUTE. 124 "Get from NODE the value of ATTRIBUTE.
114Return `nil' if the attribute was not found. 125Return nil if the attribute was not found.
115 126
116See also `xml-get-attribute'." 127See also `xml-get-attribute'."
117 (cdr (assoc attribute (xml-node-attributes node)))) 128 (cdr (assoc attribute (xml-node-attributes node))))
@@ -236,7 +247,8 @@ If PARSE-NS is non-nil, then QNAMES are expanded."
236 (nreverse xml))))))) 247 (nreverse xml)))))))
237 248
238(defun xml-maybe-do-ns (name default xml-ns) 249(defun xml-maybe-do-ns (name default xml-ns)
239 "Perform any namespace expansion. NAME is the name to perform the expansion on. 250 "Perform any namespace expansion.
251NAME is the name to perform the expansion on.
240DEFAULT is the default namespace. XML-NS is a cons of namespace 252DEFAULT is the default namespace. XML-NS is a cons of namespace
241names to uris. When namespace-aware parsing is off, then XML-NS 253names to uris. When namespace-aware parsing is off, then XML-NS
242is nil. 254is nil.
@@ -325,10 +337,8 @@ Returns one of:
325 (push (cons (cdar attr) (intern (concat ":" (cdr attr)))) 337 (push (cons (cdar attr) (intern (concat ":" (cdr attr))))
326 xml-ns)))) 338 xml-ns))))
327 339
328 ;; expand element names 340 (setq children (list attrs (xml-maybe-do-ns node-name "" xml-ns)))
329 (setq node-name (list (xml-maybe-do-ns node-name "" xml-ns)))
330 341
331 (setq children (list attrs node-name))
332 ;; is this an empty element ? 342 ;; is this an empty element ?
333 (if (looking-at "/>") 343 (if (looking-at "/>")
334 (progn 344 (progn
@@ -383,8 +393,8 @@ Returns one of:
383 (error "XML: Invalid character"))))) 393 (error "XML: Invalid character")))))
384 394
385(defun xml-parse-attlist (&optional xml-ns) 395(defun xml-parse-attlist (&optional xml-ns)
386 "Return the attribute-list after point. Leave point at the 396 "Return the attribute-list after point.
387first non-blank character after the tag." 397Leave point at the first non-blank character after the tag."
388 (let ((attlist ()) 398 (let ((attlist ())
389 end-pos name) 399 end-pos name)
390 (skip-syntax-forward " ") 400 (skip-syntax-forward " ")
@@ -575,7 +585,7 @@ This follows the rule [28] in the XML specifications."
575 585
576;; Fixme: Take declared entities from the DTD when they're available. 586;; Fixme: Take declared entities from the DTD when they're available.
577(defun xml-substitute-entity (match) 587(defun xml-substitute-entity (match)
578 "Subroutine of xml-substitute-special." 588 "Subroutine of `xml-substitute-special'."
579 (save-match-data 589 (save-match-data
580 (let ((match1 (match-string 1 str))) 590 (let ((match1 (match-string 1 str)))
581 (cond ((string= match1 "lt") "<") 591 (cond ((string= match1 "lt") "<")