aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorKaroly Lorentey2005-11-23 01:35:21 +0000
committerKaroly Lorentey2005-11-23 01:35:21 +0000
commit950bed4bb96d2a580818bdaab64a164c7c9a1c1e (patch)
tree131973e52125af75637cd0417215ba3c5b7d1de4 /lisp
parent59e085e04d44b0331620b55a64eb94bf99cf81b1 (diff)
parent5fdd4cf709ffb9c92cb565a60117afbd6fc43aa5 (diff)
downloademacs-950bed4bb96d2a580818bdaab64a164c7c9a1c1e.tar.gz
emacs-950bed4bb96d2a580818bdaab64a164c7c9a1c1e.zip
Merged from miles@gnu.org--gnu-2005 (patch 656-658)
Patches applied: * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-656 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-657 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-658 Update from CVS git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-444
Diffstat (limited to 'lisp')
-rw-r--r--lisp/ChangeLog160
-rw-r--r--lisp/complete.el9
-rw-r--r--lisp/custom.el25
-rw-r--r--lisp/descr-text.el38
-rw-r--r--lisp/emacs-lisp/shadow.el7
-rw-r--r--lisp/faces.el16
-rw-r--r--lisp/ffap.el4
-rw-r--r--lisp/gnus/ChangeLog5
-rw-r--r--lisp/gnus/message.el177
-rw-r--r--lisp/international/mule-cmds.el4
-rw-r--r--lisp/longlines.el49
-rw-r--r--lisp/ls-lisp.el4
-rw-r--r--lisp/man.el41
-rw-r--r--lisp/menu-bar.el2
-rw-r--r--lisp/net/browse-url.el4
-rw-r--r--lisp/net/rcirc.el171
-rw-r--r--lisp/newcomment.el29
-rw-r--r--lisp/paren.el7
-rw-r--r--lisp/progmodes/gdb-ui.el37
-rw-r--r--lisp/progmodes/sh-script.el6
-rw-r--r--lisp/simple.el24
-rw-r--r--lisp/startup.el4
-rw-r--r--lisp/subr.el2
-rw-r--r--lisp/textmodes/org.el653
-rw-r--r--lisp/url/ChangeLog7
-rw-r--r--lisp/url/url-http.el52
-rw-r--r--lisp/widget.el2
27 files changed, 1023 insertions, 516 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 79a91eb29af..3a9e3f9c83d 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,151 @@
12005-11-21 Luc Teirlinck <teirllm@auburn.edu>
2
3 * startup.el (command-line): Make sure that loaddefs.el is handled
4 correctly in load-history.
5
62005-11-22 Nick Roberts <nickrob@snap.net.nz>
7
8 * progmodes/gdb-ui.el (gdb-locals-watch-keymap): New local map.
9 (gdb-struct-string, gdb-array-string): New constants.
10 (gdb-info-locals-handler): Use them.
11 (gdb-reset): Reset gdb-var-list to nil.
12
132005-11-21 Stefan Monnier <monnier@iro.umontreal.ca>
14
15 * progmodes/sh-script.el (sh-font-lock-paren): Handle continued lines
16 in patterns.
17
182005-11-21 Juri Linkov <juri@jurta.org>
19
20 * custom.el (defcustom): Update link types in docstring.
21
222005-11-20 Martin Rudalics <rudalics@gmx.at> (tiny change)
23
24 * custom.el (defgroup): Add doc-string-elt info.
25
26 * widget.el (define-widget): Don't use declare for the doc-string-elt.
27
282005-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
29
30 * newcomment.el (comment-enter-backward): Fix last fix.
31
32 * simple.el (blink-matching-open):
33 * paren.el (show-paren-function): Allow new paren-class info.
34
352005-11-20 Chong Yidong <cyd@stupidchicken.com>
36
37 * faces.el: Revert 2005-11-17 change. :ignore-defface is now
38 handled automagically.
39
402005-11-20 Juri Linkov <juri@jurta.org>
41
42 * simple.el (what-cursor-position):
43 * descr-text.el (describe-char): Use Lisp-readable syntax
44 for octal and hex. Reorder decimal, octal and hex values.
45 Remove excess whitespace in the output. Use `=' in `column='
46 like in `point=' and `Hscroll='.
47
48 * international/mule-cmds.el (encoded-string-description):
49 Use Lisp-readable syntax for hex.
50
512005-11-19 Stefan Monnier <monnier@iro.umontreal.ca>
52
53 * newcomment.el (comment-enter-backward): Handle the case where the
54 comment is closed by EOB.
55
562005-11-19 Chong Yidong <cyd@stupidchicken.com>
57
58 * longlines.el (longlines-before-revert-hook)
59 (longlines-after-revert-hook): New functions.
60 (longlines-mode): Turn off longlines temporarily when reverting.
61 Add a message-setup-hook.
62 (longlines-decode-buffer): New function.
63 (longlines-wrap-line): Preserve marker positions.
64
652005-11-19 Andreas Schwab <schwab@suse.de>
66
67 * emacs-lisp/shadow.el: Handle compressed files.
68
692005-11-19 Romain Francoise <romain@orebokech.com>
70
71 * net/browse-url.el (browse-url-default-browser): Signal an error
72 if no usable browser can be found, rather than try to load w3.
73
742005-11-16 Ryan Yeske <rcyeske@gmail.com>
75
76 * net/rcirc.el (rcirc-mangle-text): Add bold face property without
77 replacing existing properties.
78 (rcirc-my-nick, rcirc-other-nick, rcirc-server)
79 (rcirc-nick-in-message, rcirc-prompt): Use min-colors and remove
80 tty specs.
81 (rcirc-server-prefix, rcirc-server): New faces.
82 (rcirc-url-regexp): Generate with rx macro.
83 (rcirc-last-server-message-time): New variable.
84 (rcirc-filter): Record time of last message.
85 (rcirc-keepalive): Kill processes that did not send a message
86 since the last ping.
87 (rcirc-mode): Give rcirc-topic a local binding here.
88
892005-11-19 Michael Cadilhac <michael.cadilhac@lrde.org> (tiny change)
90
91 * subr.el (read-passwd): Fontify the prompt as we do with other
92 prompts.
93
942005-11-19 Ryan Yeske <rcyeske@gmail.com>
95
96 * ffap.el (ffap-menu-rescan): Use inhibit-read-only instead of
97 binding buffer-read-only to nil.
98
992005-11-19 Eli Zaretskii <eliz@gnu.org>
100
101 * complete.el (partial-completion-mode):
102 Mention completion-auto-help in the doc string.
103
104 * man.el (Man-highlight-references): Doc fix. Reformat code in a
105 more Lisp-ish way.
106
1072005-11-19 Slawomir Nowaczyk <slawomir.nowaczyk.847@student.lu.se> (tiny change)
108
109 * ls-lisp.el (ls-lisp-format-file-size): Format file size with 9
110 digits, not 8, to avoid misalignment for files larger than 100MB.
111
1122005-11-19 Eli Zaretskii <eliz@gnu.org>
113
114 * menu-bar.el (menu-bar-describe-menu) <list-keybindings>:
115 Mention "keyboard shortcuts" in the help text.
116
1172005-11-19 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
118
119 * startup.el (fancy-splash-default-action): Discard only
120 mouse-down and succeeding mouse-up events in the splash screen
121 window so that drag-n-drop event can be processed.
122
1232005-11-18 Chong Yidong <cyd@stupidchicken.com>
124
125 * longlines.el (longlines-mode): Add hacks for mail-mode and
126 message-mode.
127
1282005-11-18 Carsten Dominik <dominik@science.uva.nl>
129
130 * textmodes/org.el: (org-table-sort-lines): New command.
131 (org-tbl-menu): Add entry for `org-table-sort-lines'.
132 (org-add-file): Command removed, use `org-agenda-file-to-front'
133 instead.
134 (org-export-icalendar): Use `org-icalendar-combined-name'.
135 (org-cycle-agenda-files, org-agenda-file-to-end)
136 (org-agenda-file-to-front): New commands.
137 (org-table-tab-jumps-over-hlines,org-export-html-style): New
138 options.
139 (org-table-next-field): Use `org-table-tab-jumps-over-hlines'.
140 (org-at-table.el-p, org-set-autofill-regexps,org-html-protect):
141 New functions.
142 (org-fill-paragraph): Call `org-table-align' in tables.
143 (org-mode): Call `org-set-autofill-regexps'.
144 (org-export-as-html): Support for local handformatted lists.
145 Modified to produce valid HTML 4.0. Use `org-export-html-style'.
146 (org-export-local-list-max-depth): New option.
147 (org-html-expand): Use `org-html-protect'.
148
12005-11-18 Nick Roberts <nickrob@snap.net.nz> 1492005-11-18 Nick Roberts <nickrob@snap.net.nz>
2 150
3 * progmodes/gud.el (gud-install-speedbar-variables): Bind gud-pp 151 * progmodes/gud.el (gud-install-speedbar-variables): Bind gud-pp
@@ -7,7 +155,7 @@
7 * progmodes/gdb-ui.el (gdb-ann3): ...here. Make it work in the 155 * progmodes/gdb-ui.el (gdb-ann3): ...here. Make it work in the
8 speedbar. 156 speedbar.
9 (gdb-find-watch-expression): New function. 157 (gdb-find-watch-expression): New function.
10 158
112005-11-17 Chong Yidong <cyd@stupidchicken.com> 1592005-11-17 Chong Yidong <cyd@stupidchicken.com>
12 160
13 * faces.el (face-attribute, set-face-attribute): Mention existence 161 * faces.el (face-attribute, set-face-attribute): Mention existence
@@ -2033,14 +2181,6 @@
2033 2181
20342005-10-19 Stefan Monnier <monnier@iro.umontreal.ca> 21822005-10-19 Stefan Monnier <monnier@iro.umontreal.ca>
2035 2183
2036 * simple.el (eval-expression-print-format): Put the char-string
2037 inside the parenthesis, like the other alternative notations.
2038 (kill-new): Use push.
2039 (copy-to-buffer): Use with-current-buffer.
2040 (completion-setup-function): Simplify.
2041 (minibuffer-local-must-match-map): Don't add redundant bindings which
2042 are already present in its parent (minibuffer-local-completion-map).
2043
2044 * savehist.el (savehist-coding-system): Revert to checking XEmacs. 2184 * savehist.el (savehist-coding-system): Revert to checking XEmacs.
2045 2185
20462005-10-19 Jay Belanger <belanger@truman.edu> 21862005-10-19 Jay Belanger <belanger@truman.edu>
@@ -2448,7 +2588,7 @@
24482005-10-12 Kim F. Storm <storm@cua.dk> 25882005-10-12 Kim F. Storm <storm@cua.dk>
2449 2589
2450 * startup.el (fancy-splash-default-action): Discard mouse click in 2590 * startup.el (fancy-splash-default-action): Discard mouse click in
2451 the spash screen window, as it has no sensible meaning in the 2591 the splash screen window, as it has no sensible meaning in the
2452 next window to be selected. Fixes error reported by Jan D. 2592 next window to be selected. Fixes error reported by Jan D.
2453 2593
24542005-10-12 Reiner Steib <Reiner.Steib@gmx.de> 25942005-10-12 Reiner Steib <Reiner.Steib@gmx.de>
diff --git a/lisp/complete.el b/lisp/complete.el
index d3ff6c53988..4a2ce48f152 100644
--- a/lisp/complete.el
+++ b/lisp/complete.el
@@ -203,7 +203,14 @@ other file in that directory begin with that sequence of characters.
203Unless `PC-disable-includes' is non-nil, the `<...>' sequence is interpreted 203Unless `PC-disable-includes' is non-nil, the `<...>' sequence is interpreted
204specially in \\[find-file]. For example, 204specially in \\[find-file]. For example,
205\\[find-file] <sys/time.h> RET finds the file `/usr/include/sys/time.h'. 205\\[find-file] <sys/time.h> RET finds the file `/usr/include/sys/time.h'.
206See also the variable `PC-include-file-path'." 206See also the variable `PC-include-file-path'.
207
208Partial Completion mode extends the meaning of `completion-auto-help' (which
209see) so that if it is neither nil nor t, Emacs will show the *Completions*
210buffer only on the second attempt to complete. I.e. if TAB finds nothing
211to complete, the first TAB will just say \"Next char not unique\" without
212bringing up the *Completions* buffer, and the second TAB will then bring up
213the *Completions* buffer."
207 :global t :group 'partial-completion 214 :global t :group 'partial-completion
208 ;; Deal with key bindings... 215 ;; Deal with key bindings...
209 (PC-bindings partial-completion-mode) 216 (PC-bindings partial-completion-mode)
diff --git a/lisp/custom.el b/lisp/custom.el
index 9d74335a007..0c6085c714f 100644
--- a/lisp/custom.el
+++ b/lisp/custom.el
@@ -210,12 +210,11 @@ The following keywords are meaningful:
210 item. This is a sentence containing an active field which 210 item. This is a sentence containing an active field which
211 references some other documentation. 211 references some other documentation.
212 212
213 There are three alternatives you can use for LINK-DATA: 213 There are several alternatives you can use for LINK-DATA:
214 214
215 (custom-manual INFO-NODE) 215 (custom-manual INFO-NODE)
216 Link to an Info node; INFO-NODE is a string which specifies 216 Link to an Info node; INFO-NODE is a string which specifies
217 the node name, as in \"(emacs)Top\". The link appears as 217 the node name, as in \"(emacs)Top\".
218 `[manual]' in the customization buffer.
219 218
220 (info-link INFO-NODE) 219 (info-link INFO-NODE)
221 Like `custom-manual' except that the link appears in the 220 Like `custom-manual' except that the link appears in the
@@ -223,7 +222,24 @@ The following keywords are meaningful:
223 222
224 (url-link URL) 223 (url-link URL)
225 Link to a web page; URL is a string which specifies the URL. 224 Link to a web page; URL is a string which specifies the URL.
226 The link appears in the customization buffer as URL. 225
226 (emacs-commentary-link LIBRARY)
227 Link to the commentary section of LIBRARY.
228
229 (emacs-library-link LIBRARY)
230 Link to an Emacs Lisp LIBRARY file.
231
232 (file-link FILE)
233 Link to FILE.
234
235 (function-link FUNCTION)
236 Link to the documentation of FUNCTION.
237
238 (variable-link VARIABLE)
239 Link to the documentation of VARIABLE.
240
241 (custom-group-link GROUP)
242 Link to another customization GROUP.
227 243
228 You can specify the text to use in the customization buffer by 244 You can specify the text to use in the customization buffer by
229 adding `:tag NAME' after the first element of the LINK-DATA; for 245 adding `:tag NAME' after the first element of the LINK-DATA; for
@@ -420,6 +436,7 @@ The following KEYWORDs are defined:
420 436
421Read the section about customization in the Emacs Lisp manual for more 437Read the section about customization in the Emacs Lisp manual for more
422information." 438information."
439 (declare (doc-string 3))
423 ;; It is better not to use backquote in this file, 440 ;; It is better not to use backquote in this file,
424 ;; because that makes a bootstrapping problem 441 ;; because that makes a bootstrapping problem
425 ;; if you need to recompile all the Lisp files using interpreted code. 442 ;; if you need to recompile all the Lisp files using interpreted code.
diff --git a/lisp/descr-text.el b/lisp/descr-text.el
index 5f410da17a7..547970a585b 100644
--- a/lisp/descr-text.el
+++ b/lisp/descr-text.el
@@ -458,6 +458,12 @@ as well as widgets, buttons, overlays, and text properties."
458 (multibyte-p enable-multibyte-characters) 458 (multibyte-p enable-multibyte-characters)
459 (overlays (mapcar #'(lambda (o) (overlay-properties o)) 459 (overlays (mapcar #'(lambda (o) (overlay-properties o))
460 (overlays-at pos))) 460 (overlays-at pos)))
461 (char-description (if (not multibyte-p)
462 (single-key-description char)
463 (if (< char 128)
464 (single-key-description char)
465 (string-to-multibyte
466 (char-to-string char)))))
461 item-list max-width unicode) 467 item-list max-width unicode)
462 468
463 (if (or (< char 256) 469 (if (or (< char 256)
@@ -467,13 +473,8 @@ as well as widgets, buttons, overlays, and text properties."
467 (encode-char char 'ucs)))) 473 (encode-char char 'ucs))))
468 (setq item-list 474 (setq item-list
469 `(("character" 475 `(("character"
470 ,(format "%s (0%o, %d, 0x%x%s)" 476 ,(format "%s (%d, #o%o, #x%x%s)"
471 (apply 'propertize (if (not multibyte-p) 477 (apply 'propertize char-description
472 (single-key-description char)
473 (if (< char 128)
474 (single-key-description char)
475 (string-to-multibyte
476 (char-to-string char))))
477 (text-properties-at pos)) 478 (text-properties-at pos))
478 char char char 479 char char char
479 (if unicode 480 (if unicode
@@ -510,7 +511,7 @@ as well as widgets, buttons, overlays, and text properties."
510 ,@(let ((category-set (char-category-set char))) 511 ,@(let ((category-set (char-category-set char)))
511 (if (not category-set) 512 (if (not category-set)
512 '("-- none --") 513 '("-- none --")
513 (mapcar #'(lambda (x) (format "%c:%s " 514 (mapcar #'(lambda (x) (format "%c:%s"
514 x (category-docstring x))) 515 x (category-docstring x)))
515 (category-set-mnemonics category-set))))) 516 (category-set-mnemonics category-set)))))
516 ,@(let ((props (aref char-code-property-table char)) 517 ,@(let ((props (aref char-code-property-table char))
@@ -583,7 +584,7 @@ as well as widgets, buttons, overlays, and text properties."
583 (if display 584 (if display
584 (concat 585 (concat
585 "by this font (glyph code)\n" 586 "by this font (glyph code)\n"
586 (format " %s (0x%02X)" 587 (format " %s (#x%02X)"
587 (car display) (cdr display))) 588 (car display) (cdr display)))
588 "no font available") 589 "no font available")
589 (if display 590 (if display
@@ -639,13 +640,14 @@ as well as widgets, buttons, overlays, and text properties."
639 (goto-char (point-min)) 640 (goto-char (point-min))
640 (re-search-forward "character:[ \t\n]+") 641 (re-search-forward "character:[ \t\n]+")
641 (setq pos (point))) 642 (setq pos (point)))
642 (if overlays 643 (let ((end (+ pos (length char-description))))
643 (mapc #'(lambda (props) 644 (if overlays
644 (let ((o (make-overlay pos (1+ pos)))) 645 (mapc #'(lambda (props)
645 (while props 646 (let ((o (make-overlay pos end)))
646 (overlay-put o (car props) (nth 1 props)) 647 (while props
647 (setq props (cddr props))))) 648 (overlay-put o (car props) (nth 1 props))
648 overlays)) 649 (setq props (cddr props)))))
650 overlays)))
649 651
650 (when disp-vector 652 (when disp-vector
651 (insert 653 (insert
@@ -657,7 +659,7 @@ as well as widgets, buttons, overlays, and text properties."
657 (insert (logand (car (aref disp-vector i)) #x7ffff) ?: 659 (insert (logand (car (aref disp-vector i)) #x7ffff) ?:
658 (propertize " " 'display '(space :align-to 5)) 660 (propertize " " 'display '(space :align-to 5))
659 (if (cdr (aref disp-vector i)) 661 (if (cdr (aref disp-vector i))
660 (format "%s (0x%02X)" (cadr (aref disp-vector i)) 662 (format "%s (#x%02X)" (cadr (aref disp-vector i))
661 (cddr (aref disp-vector i))) 663 (cddr (aref disp-vector i)))
662 "-- no font --") 664 "-- no font --")
663 "\n") 665 "\n")
@@ -708,7 +710,7 @@ as well as widgets, buttons, overlays, and text properties."
708 (insert "\n " (car elt) ?: 710 (insert "\n " (car elt) ?:
709 (propertize " " 'display '(space :align-to 5)) 711 (propertize " " 'display '(space :align-to 5))
710 (if (cdr elt) 712 (if (cdr elt)
711 (format "%s (0x%02X)" (cadr elt) (cddr elt)) 713 (format "%s (#x%02X)" (cadr elt) (cddr elt))
712 "-- no font --")))) 714 "-- no font --"))))
713 (insert "these terminal codes:") 715 (insert "these terminal codes:")
714 (dolist (elt component-chars) 716 (dolist (elt component-chars)
diff --git a/lisp/emacs-lisp/shadow.el b/lisp/emacs-lisp/shadow.el
index 9cea82d7780..9e68fb08967 100644
--- a/lisp/emacs-lisp/shadow.el
+++ b/lisp/emacs-lisp/shadow.el
@@ -104,7 +104,7 @@ See the documentation for `list-load-path-shadows' for further information."
104 (setq true-names (append true-names (list dir))) 104 (setq true-names (append true-names (list dir)))
105 (setq dir (directory-file-name (or (car path) "."))) 105 (setq dir (directory-file-name (or (car path) ".")))
106 (setq curr-files (if (file-accessible-directory-p dir) 106 (setq curr-files (if (file-accessible-directory-p dir)
107 (directory-files dir nil ".\\.elc?$" t))) 107 (directory-files dir nil ".\\.elc?\\(\\.gz\\)?$" t)))
108 (and curr-files 108 (and curr-files
109 (not noninteractive) 109 (not noninteractive)
110 (message "Checking %d files in %s..." (length curr-files) dir)) 110 (message "Checking %d files in %s..." (length curr-files) dir))
@@ -114,6 +114,8 @@ See the documentation for `list-load-path-shadows' for further information."
114 (while curr-files 114 (while curr-files
115 115
116 (setq file (car curr-files)) 116 (setq file (car curr-files))
117 (if (string-match "\\.gz$" file)
118 (setq file (substring file 0 -3)))
117 (setq file (substring 119 (setq file (substring
118 file 0 (if (string= (substring file -1) "c") -4 -3))) 120 file 0 (if (string= (substring file -1) "c") -4 -3)))
119 121
@@ -209,7 +211,8 @@ buffer called `*Shadows*'. Shadowings are located by calling the
209 toplevs) 211 toplevs)
210 ;; If we can find simple.el in two places, 212 ;; If we can find simple.el in two places,
211 (while tem 213 (while tem
212 (if (file-exists-p (expand-file-name "simple.el" (car tem))) 214 (if (or (file-exists-p (expand-file-name "simple.el" (car tem)))
215 (file-exists-p (expand-file-name "simple.el.gz" (car tem))))
213 (setq toplevs (cons (car tem) toplevs))) 216 (setq toplevs (cons (car tem) toplevs)))
214 (setq tem (cdr tem))) 217 (setq tem (cdr tem)))
215 (if (> (length toplevs) 1) 218 (if (> (length toplevs) 1)
diff --git a/lisp/faces.el b/lisp/faces.el
index 2437cd8caf0..d0e4162b0ec 100644
--- a/lisp/faces.el
+++ b/lisp/faces.el
@@ -357,12 +357,11 @@ If the optional argument FRAME is given, report on face FACE in that frame.
357If FRAME is t, report on the defaults for face FACE (for new frames). 357If FRAME is t, report on the defaults for face FACE (for new frames).
358If FRAME is omitted or nil, use the selected frame. 358If FRAME is omitted or nil, use the selected frame.
359 359
360If INHERIT is nil, only attributes directly defined by FACE are 360If INHERIT is nil, only attributes directly defined by FACE are considered,
361 considered, so the return value may be `unspecified', 361 so the return value may be `unspecified', or a relative value.
362 `:ignore-defface', or a relative value.
363If INHERIT is non-nil, FACE's definition of ATTRIBUTE is merged with the 362If INHERIT is non-nil, FACE's definition of ATTRIBUTE is merged with the
364 faces specified by its `:inherit' attribute; however the return value 363 faces specified by its `:inherit' attribute; however the return value
365 may still be relative. 364 may still be `unspecified' or relative.
366If INHERIT is a face or a list of faces, then the result is further merged 365If INHERIT is a face or a list of faces, then the result is further merged
367 with that face (or faces), until it becomes specified and absolute. 366 with that face (or faces), until it becomes specified and absolute.
368 367
@@ -561,13 +560,8 @@ the default for new frames (this is done automatically each time an
561attribute is changed on all frames). 560attribute is changed on all frames).
562 561
563ARGS must come in pairs ATTRIBUTE VALUE. ATTRIBUTE must be a valid 562ARGS must come in pairs ATTRIBUTE VALUE. ATTRIBUTE must be a valid
564face attribute name. 563face attribute name. All attributes can be set to `unspecified';
565 564this fact is not further mentioned below.
566Unless you're certain you know what you're doing, don't set an
567attribute to `unspecified' . To make a face ignore the attribute
568given in the defface spec, assign it the value `:ignore-defface'.
569You can do this for any attribute; this fact is not further
570mentioned below.
571 565
572The following attributes are recognized: 566The following attributes are recognized:
573 567
diff --git a/lisp/ffap.el b/lisp/ffap.el
index 6eb598d434d..ff35ae0deac 100644
--- a/lisp/ffap.el
+++ b/lisp/ffap.el
@@ -1519,7 +1519,9 @@ Applies `ffap-menu-text-plist' text properties at all matches."
1519 (let ((ffap-next-regexp (or ffap-menu-regexp ffap-next-regexp)) 1519 (let ((ffap-next-regexp (or ffap-menu-regexp ffap-next-regexp))
1520 (range (- (point-max) (point-min))) 1520 (range (- (point-max) (point-min)))
1521 (mod (buffer-modified-p)) ; was buffer modified? 1521 (mod (buffer-modified-p)) ; was buffer modified?
1522 buffer-read-only ; to set text-properties 1522 ;; inhibit-read-only works on read-only text properties
1523 ;; as well as read-only buffers.
1524 (inhibit-read-only t) ; to set text-properties
1523 item 1525 item
1524 ;; Avoid repeated searches of the *mode-alist: 1526 ;; Avoid repeated searches of the *mode-alist:
1525 (major-mode (if (assq major-mode ffap-string-at-point-mode-alist) 1527 (major-mode (if (assq major-mode ffap-string-at-point-mode-alist)
diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog
index 10e5ba0dc88..b6d62bf9b83 100644
--- a/lisp/gnus/ChangeLog
+++ b/lisp/gnus/ChangeLog
@@ -1,3 +1,8 @@
12005-11-19 Chong Yidong <cyd@stupidchicken.com>
2
3 * message.el: Revert last changes.
4 (message-insert-citation-line): Use newlines.
5
12005-11-17 Chong Yidong <cyd@stupidchicken.com> 62005-11-17 Chong Yidong <cyd@stupidchicken.com>
2 7
3 * message.el (message-courtesy-message) 8 * message.el (message-courtesy-message)
diff --git a/lisp/gnus/message.el b/lisp/gnus/message.el
index 9a5f910290a..ec420ea4b2e 100644
--- a/lisp/gnus/message.el
+++ b/lisp/gnus/message.el
@@ -141,11 +141,7 @@ mailbox format."
141 :group 'message-sending) 141 :group 'message-sending)
142 142
143(defcustom message-courtesy-message 143(defcustom message-courtesy-message
144 (concat 144 "The following message is a courtesy copy of an article\nthat has been posted to %s as well.\n\n"
145 "The following message is a courtesy copy of an article"
146 hard-newline
147 "that has been posted to %s as well."
148 hard-newline hard-newline)
149 "*This is inserted at the start of a mailed copy of a posted message. 145 "*This is inserted at the start of a mailed copy of a posted message.
150If the string contains the format spec \"%s\", the Newsgroups 146If the string contains the format spec \"%s\", the Newsgroups
151the article has been posted to will be inserted there. 147the article has been posted to will be inserted there.
@@ -343,9 +339,7 @@ few false positives here."
343;;; marking inserted text 339;;; marking inserted text
344 340
345(defcustom message-mark-insert-begin 341(defcustom message-mark-insert-begin
346 (concat 342 "--8<---------------cut here---------------start------------->8---\n"
347 "--8<---------------cut here---------------start------------->8---"
348 hard-newline)
349 "How to mark the beginning of some inserted text." 343 "How to mark the beginning of some inserted text."
350 :version "22.1" 344 :version "22.1"
351 :type 'string 345 :type 'string
@@ -353,16 +347,14 @@ few false positives here."
353 :group 'message-various) 347 :group 'message-various)
354 348
355(defcustom message-mark-insert-end 349(defcustom message-mark-insert-end
356 (concat 350 "--8<---------------cut here---------------end--------------->8---\n"
357 "--8<---------------cut here---------------end--------------->8---"
358 hard-newline)
359 "How to mark the end of some inserted text." 351 "How to mark the end of some inserted text."
360 :version "22.1" 352 :version "22.1"
361 :type 'string 353 :type 'string
362 :link '(custom-manual "(message)Insertion Variables") 354 :link '(custom-manual "(message)Insertion Variables")
363 :group 'message-various) 355 :group 'message-various)
364 356
365(defcustom message-archive-header "X-No-Archive: Yes" 357(defcustom message-archive-header "X-No-Archive: Yes\n"
366 "Header to insert when you don't want your article to be archived. 358 "Header to insert when you don't want your article to be archived.
367Archives \(such as groups.google.com\) respect this header." 359Archives \(such as groups.google.com\) respect this header."
368 :version "22.1" 360 :version "22.1"
@@ -426,8 +418,7 @@ for `message-cross-post-insert-note'."
426 :link '(custom-manual "(message)Various Message Variables") 418 :link '(custom-manual "(message)Various Message Variables")
427 :group 'message-various) 419 :group 'message-various)
428 420
429(defcustom message-elide-ellipsis 421(defcustom message-elide-ellipsis "\n[...]\n\n"
430 (concat hard-newline "[...]" hard-newline hard-newline)
431 "*The string which is inserted for elided text." 422 "*The string which is inserted for elided text."
432 :type 'string 423 :type 'string
433 :link '(custom-manual "(message)Various Commands") 424 :link '(custom-manual "(message)Various Commands")
@@ -587,8 +578,7 @@ Done before generating the new subject of a forward."
587 :link '(custom-manual "(message)Insertion Variables") 578 :link '(custom-manual "(message)Insertion Variables")
588 :type 'regexp) 579 :type 'regexp)
589 580
590(defcustom message-cancel-message 581(defcustom message-cancel-message "I am canceling my own article.\n"
591 (concat "I am canceling my own article." hard-newline)
592 "Message to be inserted in the cancel message." 582 "Message to be inserted in the cancel message."
593 :group 'message-interface 583 :group 'message-interface
594 :link '(custom-manual "(message)Canceling News") 584 :link '(custom-manual "(message)Canceling News")
@@ -1744,7 +1734,7 @@ see `message-narrow-to-headers-or-head'."
1744 (goto-char (point-max)) 1734 (goto-char (point-max))
1745 (if (string-match "\n$" (car headers)) 1735 (if (string-match "\n$" (car headers))
1746 (insert (car headers)) 1736 (insert (car headers))
1747 (insert (car headers) hard-newline))))) 1737 (insert (car headers) ?\n)))))
1748 (setq headers (cdr headers)))) 1738 (setq headers (cdr headers))))
1749 1739
1750(defmacro message-with-reply-buffer (&rest forms) 1740(defmacro message-with-reply-buffer (&rest forms)
@@ -1851,7 +1841,7 @@ Leading \"Re: \" is not stripped by this function. Use the function
1851 (insert (concat "Subject: " 1841 (insert (concat "Subject: "
1852 new-subject 1842 new-subject
1853 " (was: " 1843 " (was: "
1854 old-subject ")" hard-newline))))))))) 1844 old-subject ")\n")))))))))
1855 1845
1856(defun message-mark-inserted-region (beg end) 1846(defun message-mark-inserted-region (beg end)
1857 "Mark some region in the current article with enclosing tags. 1847 "Mark some region in the current article with enclosing tags.
@@ -1935,7 +1925,7 @@ With prefix-argument just set Follow-Up, don't cross-post."
1935 target-group 1925 target-group
1936 "[ \t]*$") 1926 "[ \t]*$")
1937 (message-fetch-field "Newsgroups"))) 1927 (message-fetch-field "Newsgroups")))
1938 (insert (concat hard-newline "Followup-To: " target-group))) 1928 (insert (concat "\nFollowup-To: " target-group)))
1939 (setq message-cross-post-old-target target-group)) 1929 (setq message-cross-post-old-target target-group))
1940 1930
1941(defun message-cross-post-insert-note (target-group cross-post in-old 1931(defun message-cross-post-insert-note (target-group cross-post in-old
@@ -1967,8 +1957,8 @@ been made to before the user asked for a Crosspost."
1967 (if (or in-old 1957 (if (or in-old
1968 (not cross-post) 1958 (not cross-post)
1969 (string-match "^[ \t]*poster[ \t]*$" target-group)) 1959 (string-match "^[ \t]*poster[ \t]*$" target-group))
1970 (insert message-followup-to-note target-group hard-newline) 1960 (insert (concat message-followup-to-note target-group "\n"))
1971 (insert message-cross-post-note target-group hard-newline)))) 1961 (insert (concat message-cross-post-note target-group "\n")))))
1972 1962
1973(defun message-cross-post-followup-to (target-group) 1963(defun message-cross-post-followup-to (target-group)
1974 "Crossposts message and set Followup-To to TARGET-GROUP. 1964 "Crossposts message and set Followup-To to TARGET-GROUP.
@@ -2028,7 +2018,7 @@ With prefix-argument just set Follow-Up, don't cross-post."
2028 (save-excursion 2018 (save-excursion
2029 (message-goto-to) 2019 (message-goto-to)
2030 (message-delete-line) 2020 (message-delete-line)
2031 (insert (concat "To: " cc-content hard-newline)) 2021 (insert (concat "To: " cc-content "\n"))
2032 (save-restriction 2022 (save-restriction
2033 (message-narrow-to-headers) 2023 (message-narrow-to-headers)
2034 (message-remove-header (if bcc 2024 (message-remove-header (if bcc
@@ -2793,7 +2783,7 @@ or in the synonym headers, defined by `message-header-synonyms'."
2793 (message-remove-header (symbol-name (car elem))) 2783 (message-remove-header (symbol-name (car elem)))
2794 (goto-char (point-min)) 2784 (goto-char (point-min))
2795 (insert (symbol-name (car elem)) ": " 2785 (insert (symbol-name (car elem)) ": "
2796 (cdr elem) hard-newline)))))) 2786 (cdr elem) "\n"))))))
2797 2787
2798(defun message-insert-newsgroups () 2788(defun message-insert-newsgroups ()
2799 "Insert the Newsgroups header from the article being replied to." 2789 "Insert the Newsgroups header from the article being replied to."
@@ -2823,7 +2813,7 @@ or in the synonym headers, defined by `message-header-synonyms'."
2823 (point) 2813 (point)
2824 (forward-line -2) 2814 (forward-line -2)
2825 (point))) 2815 (point)))
2826 (insert hard-newline) 2816 (insert "\n")
2827 (goto-char beg) 2817 (goto-char beg)
2828 (delete-region beg (progn (message-goto-body) 2818 (delete-region beg (progn (message-goto-body)
2829 (forward-line 2) 2819 (forward-line 2)
@@ -2842,7 +2832,7 @@ or in the synonym headers, defined by `message-header-synonyms'."
2842 (end-of-line -1)) 2832 (end-of-line -1))
2843 (kill-region point (point)) 2833 (kill-region point (point))
2844 (unless (bolp) 2834 (unless (bolp)
2845 (insert hard-newline)))) 2835 (insert "\n"))))
2846 2836
2847(defun message-newline-and-reformat (&optional arg not-break) 2837(defun message-newline-and-reformat (&optional arg not-break)
2848 "Insert four newlines, and then reformat if inside quoted text. 2838 "Insert four newlines, and then reformat if inside quoted text.
@@ -2984,15 +2974,15 @@ Prefix arg means justify as well."
2984 (goto-char (point-max)) 2974 (goto-char (point-max))
2985 ;; Insert the signature. 2975 ;; Insert the signature.
2986 (unless (bolp) 2976 (unless (bolp)
2987 (insert hard-newline)) 2977 (insert "\n"))
2988 (when message-signature-insert-empty-line 2978 (when message-signature-insert-empty-line
2989 (insert hard-newline)) 2979 (insert "\n"))
2990 (insert "-- " hard-newline) 2980 (insert "-- \n")
2991 (if (eq signature t) 2981 (if (eq signature t)
2992 (insert-file-contents message-signature-file) 2982 (insert-file-contents message-signature-file)
2993 (insert signature)) 2983 (insert signature))
2994 (goto-char (point-max)) 2984 (goto-char (point-max))
2995 (or (bolp) (insert hard-newline))))) 2985 (or (bolp) (insert "\n")))))
2996 2986
2997(defun message-insert-importance-high () 2987(defun message-insert-importance-high ()
2998 "Insert header to mark message as important." 2988 "Insert header to mark message as important."
@@ -3002,7 +2992,7 @@ Prefix arg means justify as well."
3002 (message-narrow-to-headers) 2992 (message-narrow-to-headers)
3003 (message-remove-header "Importance")) 2993 (message-remove-header "Importance"))
3004 (message-goto-eoh) 2994 (message-goto-eoh)
3005 (insert "Importance: high" hard-newline))) 2995 (insert "Importance: high\n")))
3006 2996
3007(defun message-insert-importance-low () 2997(defun message-insert-importance-low ()
3008 "Insert header to mark message as unimportant." 2998 "Insert header to mark message as unimportant."
@@ -3012,7 +3002,7 @@ Prefix arg means justify as well."
3012 (message-narrow-to-headers) 3002 (message-narrow-to-headers)
3013 (message-remove-header "Importance")) 3003 (message-remove-header "Importance"))
3014 (message-goto-eoh) 3004 (message-goto-eoh)
3015 (insert "Importance: low" hard-newline))) 3005 (insert "Importance: low\n")))
3016 3006
3017(defun message-insert-or-toggle-importance () 3007(defun message-insert-or-toggle-importance ()
3018 "Insert a \"Importance: high\" header, or cycle through the header values. 3008 "Insert a \"Importance: high\" header, or cycle through the header values.
@@ -3034,7 +3024,7 @@ and `low'."
3034 (t 3024 (t
3035 "high"))))) 3025 "high")))))
3036 (message-goto-eoh) 3026 (message-goto-eoh)
3037 (insert (format "Importance: %s" new) hard-newline)))) 3027 (insert (format "Importance: %s\n" new)))))
3038 3028
3039(defun message-insert-disposition-notification-to () 3029(defun message-insert-disposition-notification-to ()
3040 "Request a disposition notification (return receipt) to this message. 3030 "Request a disposition notification (return receipt) to this message.
@@ -3045,11 +3035,10 @@ Note that this should not be used in newsgroups."
3045 (message-narrow-to-headers) 3035 (message-narrow-to-headers)
3046 (message-remove-header "Disposition-Notification-To")) 3036 (message-remove-header "Disposition-Notification-To"))
3047 (message-goto-eoh) 3037 (message-goto-eoh)
3048 (insert (format "Disposition-Notification-To: %s" 3038 (insert (format "Disposition-Notification-To: %s\n"
3049 (or (message-field-value "Reply-to") 3039 (or (message-field-value "Reply-to")
3050 (message-field-value "From") 3040 (message-field-value "From")
3051 (message-make-from))) 3041 (message-make-from))))))
3052 hard-newline)))
3053 3042
3054(defun message-elide-region (b e) 3043(defun message-elide-region (b e)
3055 "Elide the text in the region. 3044 "Elide the text in the region.
@@ -3184,7 +3173,7 @@ However, if `message-yank-prefix' is non-nil, insert that prefix on each line."
3184 ;; Delete blank lines at the end of the buffer. 3173 ;; Delete blank lines at the end of the buffer.
3185 (goto-char (point-max)) 3174 (goto-char (point-max))
3186 (unless (eolp) 3175 (unless (eolp)
3187 (insert hard-newline)) 3176 (insert "\n"))
3188 (while (and (zerop (forward-line -1)) 3177 (while (and (zerop (forward-line -1))
3189 (looking-at "$")) 3178 (looking-at "$"))
3190 (message-delete-line)) 3179 (message-delete-line))
@@ -3222,7 +3211,7 @@ prefix, and don't delete any headers."
3222 (funcall message-cite-function)) 3211 (funcall message-cite-function))
3223 (message-exchange-point-and-mark) 3212 (message-exchange-point-and-mark)
3224 (unless (bolp) 3213 (unless (bolp)
3225 (insert hard-newline)) 3214 (insert ?\n))
3226 (unless modified 3215 (unless modified
3227 (setq message-checksum (message-checksum)))))) 3216 (setq message-checksum (message-checksum))))))
3228 3217
@@ -3280,13 +3269,13 @@ prefix, and don't delete any headers."
3280 (delete-region (point) end) 3269 (delete-region (point) end)
3281 (unless (search-backward "\n\n" start t) 3270 (unless (search-backward "\n\n" start t)
3282 ;; Insert a blank line if it is peeled off. 3271 ;; Insert a blank line if it is peeled off.
3283 (insert hard-newline))) 3272 (insert "\n")))
3284 (goto-char start) 3273 (goto-char start)
3285 (while functions 3274 (while functions
3286 (funcall (pop functions))) 3275 (funcall (pop functions)))
3287 (when message-citation-line-function 3276 (when message-citation-line-function
3288 (unless (bolp) 3277 (unless (bolp)
3289 (insert hard-newline)) 3278 (insert "\n"))
3290 (funcall message-citation-line-function)))) 3279 (funcall message-citation-line-function))))
3291 3280
3292(eval-when-compile (defvar mail-citation-hook)) ;Compiler directive 3281(eval-when-compile (defvar mail-citation-hook)) ;Compiler directive
@@ -3322,14 +3311,15 @@ prefix, and don't delete any headers."
3322 (funcall (pop functions))) 3311 (funcall (pop functions)))
3323 (when message-citation-line-function 3312 (when message-citation-line-function
3324 (unless (bolp) 3313 (unless (bolp)
3325 (insert hard-newline)) 3314 (insert "\n"))
3326 (funcall message-citation-line-function))))) 3315 (funcall message-citation-line-function)))))
3327 3316
3328(defun message-insert-citation-line () 3317(defun message-insert-citation-line ()
3329 "Insert a simple citation line." 3318 "Insert a simple citation line."
3330 (when message-reply-headers 3319 (when message-reply-headers
3331 (insert (mail-header-from message-reply-headers) 3320 (insert (mail-header-from message-reply-headers) " writes:")
3332 " writes:" hard-newline hard-newline))) 3321 (newline)
3322 (newline)))
3333 3323
3334(defun message-position-on-field (header &rest afters) 3324(defun message-position-on-field (header &rest afters)
3335 (let ((case-fold-search t)) 3325 (let ((case-fold-search t))
@@ -3355,7 +3345,7 @@ prefix, and don't delete any headers."
3355 (when afters 3345 (when afters
3356 (re-search-forward "^[^ \t]" nil 'move) 3346 (re-search-forward "^[^ \t]" nil 'move)
3357 (beginning-of-line)) 3347 (beginning-of-line))
3358 (insert header ": " hard-newline) 3348 (insert header ": \n")
3359 (forward-char -1) 3349 (forward-char -1)
3360 nil)))) 3350 nil))))
3361 3351
@@ -3551,7 +3541,7 @@ It should typically alter the sending method in some way or other."
3551 ;; Make sure there's a newline at the end of the message. 3541 ;; Make sure there's a newline at the end of the message.
3552 (goto-char (point-max)) 3542 (goto-char (point-max))
3553 (unless (bolp) 3543 (unless (bolp)
3554 (insert hard-newline)) 3544 (insert "\n"))
3555 ;; Make the hidden headers visible. 3545 ;; Make the hidden headers visible.
3556 (let ((points (message-text-with-property 'message-hidden))) 3546 (let ((points (message-text-with-property 'message-hidden)))
3557 (when points 3547 (when points
@@ -3656,7 +3646,7 @@ It should typically alter the sending method in some way or other."
3656 (goto-char (point-min)) 3646 (goto-char (point-min))
3657 (re-search-forward 3647 (re-search-forward
3658 (concat "^" (regexp-quote mail-header-separator) "\n")) 3648 (concat "^" (regexp-quote mail-header-separator) "\n"))
3659 (replace-match hard-newline) 3649 (replace-match "\n")
3660 (run-hooks 'message-send-mail-hook) 3650 (run-hooks 'message-send-mail-hook)
3661 (let ((p (goto-char (point-min))) 3651 (let ((p (goto-char (point-min)))
3662 (tembuf (message-generate-new-buffer-clone-locals " message temp")) 3652 (tembuf (message-generate-new-buffer-clone-locals " message temp"))
@@ -3698,18 +3688,17 @@ It should typically alter the sending method in some way or other."
3698 (message-remove-header "Message-ID") 3688 (message-remove-header "Message-ID")
3699 (message-remove-header "Lines") 3689 (message-remove-header "Lines")
3700 (goto-char (point-max)) 3690 (goto-char (point-max))
3701 (insert "Mime-Version: 1.0" hard-newline) 3691 (insert "Mime-Version: 1.0\n")
3702 (setq header (buffer-string))) 3692 (setq header (buffer-string)))
3703 (goto-char (point-max)) 3693 (goto-char (point-max))
3704 (insert (format "Content-Type: message/partial; id=\"%s\"; number=%d; total=%d" 3694 (insert (format "Content-Type: message/partial; id=\"%s\"; number=%d; total=%d\n\n"
3705 id n total) 3695 id n total))
3706 hard-newline hard-newline)
3707 (forward-char -1) 3696 (forward-char -1)
3708 (let ((mail-header-separator "")) 3697 (let ((mail-header-separator ""))
3709 (when (memq 'Message-ID message-required-mail-headers) 3698 (when (memq 'Message-ID message-required-mail-headers)
3710 (insert "Message-ID: " (message-make-message-id) hard-newline)) 3699 (insert "Message-ID: " (message-make-message-id) "\n"))
3711 (when (memq 'Lines message-required-mail-headers) 3700 (when (memq 'Lines message-required-mail-headers)
3712 (insert "Lines: " (message-make-lines) hard-newline)) 3701 (insert "Lines: " (message-make-lines) "\n"))
3713 (message-goto-subject) 3702 (message-goto-subject)
3714 (end-of-line) 3703 (end-of-line)
3715 (insert (format " (%d/%d)" n total)) 3704 (insert (format " (%d/%d)" n total))
@@ -3774,7 +3763,7 @@ It should typically alter the sending method in some way or other."
3774 (goto-char (point-max)) 3763 (goto-char (point-max))
3775 ;; require one newline at the end. 3764 ;; require one newline at the end.
3776 (or (= (preceding-char) ?\n) 3765 (or (= (preceding-char) ?\n)
3777 (insert hard-newline)) 3766 (insert ?\n))
3778 (message-cleanup-headers) 3767 (message-cleanup-headers)
3779 ;; FIXME: we're inserting the courtesy copy after encoding. 3768 ;; FIXME: we're inserting the courtesy copy after encoding.
3780 ;; This is wrong if the courtesy copy string contains 3769 ;; This is wrong if the courtesy copy string contains
@@ -3850,7 +3839,7 @@ If you always want Gnus to send messages in one piece, set
3850 (goto-char (point-min)) 3839 (goto-char (point-min))
3851 (re-search-forward 3840 (re-search-forward
3852 (concat "^" (regexp-quote mail-header-separator) "\n")) 3841 (concat "^" (regexp-quote mail-header-separator) "\n"))
3853 (replace-match hard-newline) 3842 (replace-match "\n")
3854 (backward-char 1) 3843 (backward-char 1)
3855 (setq delimline (point-marker)) 3844 (setq delimline (point-marker))
3856 (run-hooks 'message-send-mail-hook) 3845 (run-hooks 'message-send-mail-hook)
@@ -3912,7 +3901,7 @@ to find out how to use this."
3912 (goto-char (point-min)) 3901 (goto-char (point-min))
3913 (re-search-forward 3902 (re-search-forward
3914 (concat "^" (regexp-quote mail-header-separator) "\n")) 3903 (concat "^" (regexp-quote mail-header-separator) "\n"))
3915 (replace-match hard-newline) 3904 (replace-match "\n")
3916 (run-hooks 'message-send-mail-hook) 3905 (run-hooks 'message-send-mail-hook)
3917 ;; send the message 3906 ;; send the message
3918 (case 3907 (case
@@ -4080,13 +4069,13 @@ Otherwise, generate and save a value for `canlock-password' first."
4080 (goto-char (point-max)) 4069 (goto-char (point-max))
4081 ;; require one newline at the end. 4070 ;; require one newline at the end.
4082 (or (= (preceding-char) ?\n) 4071 (or (= (preceding-char) ?\n)
4083 (insert hard-newline)) 4072 (insert ?\n))
4084 (let ((case-fold-search t)) 4073 (let ((case-fold-search t))
4085 ;; Remove the delimiter. 4074 ;; Remove the delimiter.
4086 (goto-char (point-min)) 4075 (goto-char (point-min))
4087 (re-search-forward 4076 (re-search-forward
4088 (concat "^" (regexp-quote mail-header-separator) "\n")) 4077 (concat "^" (regexp-quote mail-header-separator) "\n"))
4089 (replace-match hard-newline) 4078 (replace-match "\n")
4090 (backward-char 1)) 4079 (backward-char 1))
4091 (run-hooks 'message-send-news-hook) 4080 (run-hooks 'message-send-news-hook)
4092 (gnus-open-server method) 4081 (gnus-open-server method)
@@ -4213,7 +4202,7 @@ Otherwise, generate and save a value for `canlock-password' first."
4213 (message-tokenize-header 4202 (message-tokenize-header
4214 newsgroups))))))))) 4203 newsgroups)))))))))
4215 (goto-char (point-min)) 4204 (goto-char (point-min))
4216 (insert "Followup-To: " to hard-newline)) 4205 (insert "Followup-To: " to "\n"))
4217 t)) 4206 t))
4218 ;; Check "Shoot me". 4207 ;; Check "Shoot me".
4219 (message-check 'shoot 4208 (message-check 'shoot
@@ -5112,7 +5101,7 @@ Headers already prepared in the buffer are not modified."
5112 ;; We check whether the value was ended by a 5101 ;; We check whether the value was ended by a
5113 ;; newline. If now, we insert one. 5102 ;; newline. If now, we insert one.
5114 (unless (bolp) 5103 (unless (bolp)
5115 (insert hard-newline)) 5104 (insert "\n"))
5116 (forward-line -1))) 5105 (forward-line -1)))
5117 ;; The value of this header was empty, so we clear 5106 ;; The value of this header was empty, so we clear
5118 ;; totally and insert the new value. 5107 ;; totally and insert the new value.
@@ -5152,7 +5141,7 @@ Headers already prepared in the buffer are not modified."
5152 (beginning-of-line)) 5141 (beginning-of-line))
5153 (when (or (message-news-p) 5142 (when (or (message-news-p)
5154 (string-match "@.+\\.." secure-sender)) 5143 (string-match "@.+\\.." secure-sender))
5155 (insert "Sender: " secure-sender hard-newline)))) 5144 (insert "Sender: " secure-sender "\n"))))
5156 ;; Check for IDNA 5145 ;; Check for IDNA
5157 (message-idna-to-ascii-rhs)))) 5146 (message-idna-to-ascii-rhs))))
5158 5147
@@ -5164,7 +5153,7 @@ Headers already prepared in the buffer are not modified."
5164 (message-narrow-to-headers) 5153 (message-narrow-to-headers)
5165 (when (setq newsgroups (message-fetch-field "newsgroups")) 5154 (when (setq newsgroups (message-fetch-field "newsgroups"))
5166 (goto-char (point-max)) 5155 (goto-char (point-max))
5167 (insert "Posted-To: " newsgroups hard-newline))) 5156 (insert "Posted-To: " newsgroups "\n")))
5168 (forward-line 1) 5157 (forward-line 1)
5169 (when message-courtesy-message 5158 (when message-courtesy-message
5170 (cond 5159 (cond
@@ -5183,7 +5172,7 @@ Headers already prepared in the buffer are not modified."
5183 (insert (capitalize (symbol-name header)) 5172 (insert (capitalize (symbol-name header))
5184 ": " 5173 ": "
5185 (if (consp value) (car value) value) 5174 (if (consp value) (car value) value)
5186 hard-newline) 5175 "\n")
5187 (narrow-to-region (point-min) (1- (point-max))) 5176 (narrow-to-region (point-min) (1- (point-max)))
5188 (let (quoted last) 5177 (let (quoted last)
5189 (goto-char (point-min)) 5178 (goto-char (point-min))
@@ -5197,7 +5186,7 @@ Headers already prepared in the buffer are not modified."
5197 (progn 5186 (progn
5198 (save-excursion 5187 (save-excursion
5199 (goto-char last) 5188 (goto-char last)
5200 (insert hard-newline "\t")) 5189 (insert "\n\t"))
5201 (setq last (1+ (point)))) 5190 (setq last (1+ (point))))
5202 (setq last (1+ (point))))) 5191 (setq last (1+ (point)))))
5203 (setq quoted (not quoted))) 5192 (setq quoted (not quoted)))
@@ -5223,7 +5212,7 @@ If the current line has `message-yank-prefix', insert it on the new line."
5223 (insert (capitalize (symbol-name header)) 5212 (insert (capitalize (symbol-name header))
5224 ": " 5213 ": "
5225 (if (consp value) (car value) value) 5214 (if (consp value) (car value) value)
5226 hard-newline) 5215 "\n")
5227 (save-restriction 5216 (save-restriction
5228 (narrow-to-region begin (point)) 5217 (narrow-to-region begin (point))
5229 (fill-region-as-paragraph begin (point)) 5218 (fill-region-as-paragraph begin (point))
@@ -5292,7 +5281,7 @@ than 988 characters long, and if they are not, trim them until they are."
5292 (let ((refstring (mapconcat #'identity refs " "))) 5281 (let ((refstring (mapconcat #'identity refs " ")))
5293 (if (and message-this-is-news message-cater-to-broken-inn) 5282 (if (and message-this-is-news message-cater-to-broken-inn)
5294 (insert (capitalize (symbol-name header)) ": " 5283 (insert (capitalize (symbol-name header)) ": "
5295 refstring hard-newline) 5284 refstring "\n")
5296 (message-fill-header header refstring))))) 5285 (message-fill-header header refstring)))))
5297 5286
5298(defun message-position-point () 5287(defun message-position-point ()
@@ -5521,18 +5510,18 @@ are not included."
5521 (delete-region (point) (progn (forward-line -1) (point))) 5510 (delete-region (point) (progn (forward-line -1) (point)))
5522 (when message-default-headers 5511 (when message-default-headers
5523 (insert message-default-headers) 5512 (insert message-default-headers)
5524 (or (bolp) (insert hard-newline))) 5513 (or (bolp) (insert ?\n)))
5525 (put-text-property 5514 (put-text-property
5526 (point) 5515 (point)
5527 (progn 5516 (progn
5528 (insert mail-header-separator hard-newline) 5517 (insert mail-header-separator "\n")
5529 (1- (point))) 5518 (1- (point)))
5530 'read-only nil) 5519 'read-only nil)
5531 (forward-line -1) 5520 (forward-line -1)
5532 (when (message-news-p) 5521 (when (message-news-p)
5533 (when message-default-news-headers 5522 (when message-default-news-headers
5534 (insert message-default-news-headers) 5523 (insert message-default-news-headers)
5535 (or (bolp) (insert hard-newline))) 5524 (or (bolp) (insert ?\n)))
5536 (when message-generate-headers-first 5525 (when message-generate-headers-first
5537 (message-generate-headers 5526 (message-generate-headers
5538 (message-headers-to-generate 5527 (message-headers-to-generate
@@ -5543,7 +5532,7 @@ are not included."
5543 (when (message-mail-p) 5532 (when (message-mail-p)
5544 (when message-default-mail-headers 5533 (when message-default-mail-headers
5545 (insert message-default-mail-headers) 5534 (insert message-default-mail-headers)
5546 (or (bolp) (insert hard-newline))) 5535 (or (bolp) (insert ?\n)))
5547 (save-restriction 5536 (save-restriction
5548 (message-narrow-to-headers) 5537 (message-narrow-to-headers)
5549 (if message-alternative-emails 5538 (if message-alternative-emails
@@ -6025,14 +6014,14 @@ If ARG, allow editing of the cancellation message."
6025 (message-news) 6014 (message-news)
6026 (setq buf (set-buffer (get-buffer-create " *message cancel*")))) 6015 (setq buf (set-buffer (get-buffer-create " *message cancel*"))))
6027 (erase-buffer) 6016 (erase-buffer)
6028 (insert "Newsgroups: " newsgroups hard-newline 6017 (insert "Newsgroups: " newsgroups "\n"
6029 "From: " from hard-newline 6018 "From: " from "\n"
6030 "Subject: cmsg cancel " message-id hard-newline 6019 "Subject: cmsg cancel " message-id "\n"
6031 "Control: cancel " message-id hard-newline 6020 "Control: cancel " message-id "\n"
6032 (if distribution 6021 (if distribution
6033 (concat "Distribution: " distribution hard-newline) 6022 (concat "Distribution: " distribution "\n")
6034 "") 6023 "")
6035 mail-header-separator hard-newline 6024 mail-header-separator "\n"
6036 message-cancel-message) 6025 message-cancel-message)
6037 (run-hooks 'message-cancel-hook) 6026 (run-hooks 'message-cancel-hook)
6038 (unless arg 6027 (unless arg
@@ -6221,9 +6210,7 @@ Optional DIGEST will use digest to forward."
6221 6210
6222(defun message-forward-make-body-plain (forward-buffer) 6211(defun message-forward-make-body-plain (forward-buffer)
6223 (insert 6212 (insert
6224 hard-newline 6213 "\n-------------------- Start of forwarded message --------------------\n")
6225 "-------------------- Start of forwarded message --------------------"
6226 hard-newline)
6227 (let ((b (point)) e) 6214 (let ((b (point)) e)
6228 (insert 6215 (insert
6229 (with-temp-buffer 6216 (with-temp-buffer
@@ -6239,9 +6226,7 @@ Optional DIGEST will use digest to forward."
6239 (buffer-string))) 6226 (buffer-string)))
6240 (setq e (point)) 6227 (setq e (point))
6241 (insert 6228 (insert
6242 hard-newline 6229 "\n-------------------- End of forwarded message --------------------\n")
6243 "-------------------- End of forwarded message --------------------"
6244 hard-newline)
6245 (when message-forward-ignored-headers 6230 (when message-forward-ignored-headers
6246 (save-restriction 6231 (save-restriction
6247 (narrow-to-region b e) 6232 (narrow-to-region b e)
@@ -6251,10 +6236,7 @@ Optional DIGEST will use digest to forward."
6251 (message-remove-header message-forward-ignored-headers t))))) 6236 (message-remove-header message-forward-ignored-headers t)))))
6252 6237
6253(defun message-forward-make-body-mime (forward-buffer) 6238(defun message-forward-make-body-mime (forward-buffer)
6254 (insert 6239 (insert "\n\n<#part type=message/rfc822 disposition=inline raw=t>\n")
6255 hard-newline hard-newline
6256 "<#part type=message/rfc822 disposition=inline raw=t>"
6257 hard-newline)
6258 (let ((b (point)) e) 6240 (let ((b (point)) e)
6259 (save-restriction 6241 (save-restriction
6260 (narrow-to-region (point) (point)) 6242 (narrow-to-region (point) (point))
@@ -6264,13 +6246,10 @@ Optional DIGEST will use digest to forward."
6264 (replace-match "X-From-Line: ")) 6246 (replace-match "X-From-Line: "))
6265 (goto-char (point-max))) 6247 (goto-char (point-max)))
6266 (setq e (point)) 6248 (setq e (point))
6267 (insert "<#/part>" hard-newline))) 6249 (insert "<#/part>\n")))
6268 6250
6269(defun message-forward-make-body-mml (forward-buffer) 6251(defun message-forward-make-body-mml (forward-buffer)
6270 (insert 6252 (insert "\n\n<#mml type=message/rfc822 disposition=inline>\n")
6271 hard-newline hard-newline
6272 "<#mml type=message/rfc822 disposition=inline>"
6273 hard-newline)
6274 (let ((b (point)) e) 6253 (let ((b (point)) e)
6275 (if (not message-forward-decoded-p) 6254 (if (not message-forward-decoded-p)
6276 (insert 6255 (insert
@@ -6293,7 +6272,7 @@ Optional DIGEST will use digest to forward."
6293 (replace-match "X-From-Line: ")) 6272 (replace-match "X-From-Line: "))
6294 (goto-char (point-max)))) 6273 (goto-char (point-max))))
6295 (setq e (point)) 6274 (setq e (point))
6296 (insert "<#/mml>" hard-newline) 6275 (insert "<#/mml>\n")
6297 (when (and (not message-forward-decoded-p) 6276 (when (and (not message-forward-decoded-p)
6298 message-forward-ignored-headers) 6277 message-forward-ignored-headers)
6299 (save-restriction 6278 (save-restriction
@@ -6305,23 +6284,19 @@ Optional DIGEST will use digest to forward."
6305 6284
6306(defun message-forward-make-body-digest-plain (forward-buffer) 6285(defun message-forward-make-body-digest-plain (forward-buffer)
6307 (insert 6286 (insert
6308 hard-newline 6287 "\n-------------------- Start of forwarded message --------------------\n")
6309 "-------------------- Start of forwarded message --------------------"
6310 hard-newline)
6311 (let ((b (point)) e) 6288 (let ((b (point)) e)
6312 (mml-insert-buffer forward-buffer) 6289 (mml-insert-buffer forward-buffer)
6313 (setq e (point)) 6290 (setq e (point))
6314 (insert 6291 (insert
6315 hard-newline 6292 "\n-------------------- End of forwarded message --------------------\n")))
6316 "-------------------- End of forwarded message --------------------"
6317 hard-newline)))
6318 6293
6319(defun message-forward-make-body-digest-mime (forward-buffer) 6294(defun message-forward-make-body-digest-mime (forward-buffer)
6320 (insert hard-newline "<#multipart type=digest>" hard-newline) 6295 (insert "\n<#multipart type=digest>\n")
6321 (let ((b (point)) e) 6296 (let ((b (point)) e)
6322 (insert-buffer-substring forward-buffer) 6297 (insert-buffer-substring forward-buffer)
6323 (setq e (point)) 6298 (setq e (point))
6324 (insert "<#/multipart>" hard-newline) 6299 (insert "<#/multipart>\n")
6325 (save-restriction 6300 (save-restriction
6326 (narrow-to-region b e) 6301 (narrow-to-region b e)
6327 (goto-char b) 6302 (goto-char b)
@@ -6826,7 +6801,7 @@ regexp VARSTR."
6826 (message-narrow-to-headers-or-head) 6801 (message-narrow-to-headers-or-head)
6827 (message-remove-header "Mime-Version") 6802 (message-remove-header "Mime-Version")
6828 (goto-char (point-max)) 6803 (goto-char (point-max))
6829 (insert "MIME-Version: 1.0" hard-newline) 6804 (insert "MIME-Version: 1.0\n")
6830 (when lines 6805 (when lines
6831 (insert lines)) 6806 (insert lines))
6832 (setq content-type-p 6807 (setq content-type-p
@@ -6846,7 +6821,7 @@ regexp VARSTR."
6846 ;; For unknown reason, MIME-Version doesn't exist. 6821 ;; For unknown reason, MIME-Version doesn't exist.
6847 (when (re-search-forward "^MIME-Version:" nil t) 6822 (when (re-search-forward "^MIME-Version:" nil t)
6848 (forward-line 1) 6823 (forward-line 1)
6849 (insert "Content-Type: text/plain; charset=us-ascii" hard-newline)))))) 6824 (insert "Content-Type: text/plain; charset=us-ascii\n"))))))
6850 6825
6851(defun message-read-from-minibuffer (prompt &optional initial-contents) 6826(defun message-read-from-minibuffer (prompt &optional initial-contents)
6852 "Read from the minibuffer while providing abbrev expansion." 6827 "Read from the minibuffer while providing abbrev expansion."
@@ -6875,7 +6850,7 @@ regexp VARSTR."
6875 (pop emails)) 6850 (pop emails))
6876 (unless (or (not email) (equal email user-mail-address)) 6851 (unless (or (not email) (equal email user-mail-address))
6877 (goto-char (point-max)) 6852 (goto-char (point-max))
6878 (insert "From: " email hard-newline)))) 6853 (insert "From: " email "\n"))))
6879 6854
6880(defun message-options-get (symbol) 6855(defun message-options-get (symbol)
6881 (cdr (assq symbol message-options))) 6856 (cdr (assq symbol message-options)))
diff --git a/lisp/international/mule-cmds.el b/lisp/international/mule-cmds.el
index 0de1777f6cb..712728fcd2a 100644
--- a/lisp/international/mule-cmds.el
+++ b/lisp/international/mule-cmds.el
@@ -2659,8 +2659,8 @@ It can be retrieved with `(get-char-code-property CHAR PROPNAME)'."
2659 (if (and coding-system (eq (coding-system-type coding-system) 2)) 2659 (if (and coding-system (eq (coding-system-type coding-system) 2))
2660 ;; Try to get a pretty description for ISO 2022 escape sequences. 2660 ;; Try to get a pretty description for ISO 2022 escape sequences.
2661 (function (lambda (x) (or (cdr (assq x iso-2022-control-alist)) 2661 (function (lambda (x) (or (cdr (assq x iso-2022-control-alist))
2662 (format "0x%02X" x)))) 2662 (format "#x%02X" x))))
2663 (function (lambda (x) (format "0x%02X" x)))) 2663 (function (lambda (x) (format "#x%02X" x))))
2664 str " ")) 2664 str " "))
2665 2665
2666(defun encode-coding-char (char coding-system) 2666(defun encode-coding-char (char coding-system)
diff --git a/lisp/longlines.el b/lisp/longlines.el
index 4ee85d646e5..93f3daa4ee8 100644
--- a/lisp/longlines.el
+++ b/lisp/longlines.el
@@ -108,6 +108,7 @@ are indicated with a symbol."
108 (set (make-local-variable 'require-final-newline) nil) 108 (set (make-local-variable 'require-final-newline) nil)
109 (add-to-list 'buffer-file-format 'longlines) 109 (add-to-list 'buffer-file-format 'longlines)
110 (add-hook 'change-major-mode-hook 'longlines-mode-off nil t) 110 (add-hook 'change-major-mode-hook 'longlines-mode-off nil t)
111 (add-hook 'before-revert-hook 'longlines-before-revert-hook nil t)
111 (make-local-variable 'buffer-substring-filters) 112 (make-local-variable 'buffer-substring-filters)
112 (set (make-local-variable 'isearch-search-fun-function) 113 (set (make-local-variable 'isearch-search-fun-function)
113 'longlinges-search-function) 114 'longlinges-search-function)
@@ -126,12 +127,27 @@ are indicated with a symbol."
126 ;; longlines-wrap-lines that we'll never encounter from here 127 ;; longlines-wrap-lines that we'll never encounter from here
127 (save-restriction 128 (save-restriction
128 (widen) 129 (widen)
129 (longlines-decode-region (point-min) (point-max))) 130 (longlines-decode-buffer))
130 (longlines-wrap-region (point-min) (point-max)) 131 (longlines-wrap-region (point-min) (point-max))
131 (set-buffer-modified-p mod)) 132 (set-buffer-modified-p mod))
132 (when (and longlines-show-hard-newlines 133 (when (and longlines-show-hard-newlines
133 (not longlines-showing)) 134 (not longlines-showing))
134 (longlines-show-hard-newlines)) 135 (longlines-show-hard-newlines))
136
137 ;; Hacks to make longlines play nice with various modes.
138 (cond ((eq major-mode 'mail-mode)
139 (or mail-citation-hook
140 (add-hook 'mail-citation-hook 'mail-indent-citation nil t))
141 (add-hook 'mail-citation-hook 'longlines-decode-region nil t))
142 ((eq major-mode 'message-mode)
143 (add-hook 'message-setup-hook 'longlines-decode-buffer nil t)
144 (make-local-variable 'message-indent-citation-function)
145 (if (not (listp message-indent-citation-function))
146 (setq message-indent-citation-function
147 (list message-indent-citation-function)))
148 (add-to-list 'message-indent-citation-function
149 'longlines-decode-region t)))
150
135 (when longlines-auto-wrap 151 (when longlines-auto-wrap
136 (auto-fill-mode 0) 152 (auto-fill-mode 0)
137 (add-hook 'after-change-functions 153 (add-hook 'after-change-functions
@@ -152,6 +168,7 @@ are indicated with a symbol."
152 (remove-hook 'before-kill-functions 'longlines-encode-region t) 168 (remove-hook 'before-kill-functions 'longlines-encode-region t)
153 (remove-hook 'after-change-functions 'longlines-after-change-function t) 169 (remove-hook 'after-change-functions 'longlines-after-change-function t)
154 (remove-hook 'post-command-hook 'longlines-post-command-function t) 170 (remove-hook 'post-command-hook 'longlines-post-command-function t)
171 (remove-hook 'before-revert-hook 'longlines-before-revert-hook t)
155 (remove-hook 'window-configuration-change-hook 172 (remove-hook 'window-configuration-change-hook
156 'longlines-window-change-function t) 173 'longlines-window-change-function t)
157 (when longlines-wrap-follows-window-size 174 (when longlines-wrap-follows-window-size
@@ -222,9 +239,10 @@ end of the buffer."
222If wrapping is performed, point remains on the line. If the line does 239If wrapping is performed, point remains on the line. If the line does
223not need to be wrapped, move point to the next line and return t." 240not need to be wrapped, move point to the next line and return t."
224 (if (longlines-set-breakpoint) 241 (if (longlines-set-breakpoint)
225 (progn (backward-char 1) 242 (progn (insert-before-markers ?\n)
226 (delete-char 1) 243 (backward-char 1)
227 (insert-char ?\n 1) 244 (delete-char -1)
245 (forward-char 1)
228 nil) 246 nil)
229 (if (longlines-merge-lines-p) 247 (if (longlines-merge-lines-p)
230 (progn (end-of-line) 248 (progn (end-of-line)
@@ -298,14 +316,21 @@ Otherwise, return nil. Text cannot be moved across hard newlines."
298 (1+ (current-column))) 316 (1+ (current-column)))
299 space)))))) 317 space))))))
300 318
301(defun longlines-decode-region (beg end) 319(defun longlines-decode-region (&optional beg end)
302 "Turn all newlines between BEG and END into hard newlines." 320 "Turn all newlines between BEG and END into hard newlines.
321If BEG and END are nil, the point and mark are used."
322 (if (null beg) (setq beg (point)))
323 (if (null end) (setq end (mark t)))
303 (save-excursion 324 (save-excursion
304 (goto-char (min beg end)) 325 (goto-char (min beg end))
305 (while (search-forward "\n" (max beg end) t) 326 (while (search-forward "\n" (max beg end) t)
306 (set-hard-newline-properties 327 (set-hard-newline-properties
307 (match-beginning 0) (match-end 0))))) 328 (match-beginning 0) (match-end 0)))))
308 329
330(defun longlines-decode-buffer ()
331 "Turn all newlines in the buffer into hard newlines."
332 (longlines-decode-region (point-min) (point-max)))
333
309(defun longlines-encode-region (beg end &optional buffer) 334(defun longlines-encode-region (beg end &optional buffer)
310 "Replace each soft newline between BEG and END with exactly one space. 335 "Replace each soft newline between BEG and END with exactly one space.
311Hard newlines are left intact. The optional argument BUFFER exists for 336Hard newlines are left intact. The optional argument BUFFER exists for
@@ -413,10 +438,18 @@ This is called by `window-size-change-functions'."
413 438
414;; Loading and saving 439;; Loading and saving
415 440
441(defun longlines-before-revert-hook ()
442 (add-hook 'after-revert-hook 'longlines-after-revert-hook nil t)
443 (longlines-mode 0))
444
445(defun longlines-after-revert-hook ()
446 (remove-hook 'after-revert-hook 'longlines-after-revert-hook t)
447 (longlines-mode 1))
448
416(add-to-list 449(add-to-list
417 'format-alist 450 'format-alist
418 (list 'longlines "Automatically wrap long lines." nil 451 (list 'longlines "Automatically wrap long lines." nil nil
419 'longlines-decode-region 'longlines-encode-region t nil)) 452 'longlines-encode-region t nil))
420 453
421(provide 'longlines) 454(provide 'longlines)
422 455
diff --git a/lisp/ls-lisp.el b/lisp/ls-lisp.el
index feadbb5e2be..5f5a53b0df0 100644
--- a/lisp/ls-lisp.el
+++ b/lisp/ls-lisp.el
@@ -588,11 +588,11 @@ All ls time options, namely c, t and u, are handled."
588(defun ls-lisp-format-file-size (file-size human-readable) 588(defun ls-lisp-format-file-size (file-size human-readable)
589 (if (or (not human-readable) 589 (if (or (not human-readable)
590 (< file-size 1024)) 590 (< file-size 1024))
591 (format (if (floatp file-size) " %8.0f" " %8d") file-size) 591 (format (if (floatp file-size) " %9.0f" " %9d") file-size)
592 (do ((file-size (/ file-size 1024.0) (/ file-size 1024.0)) 592 (do ((file-size (/ file-size 1024.0) (/ file-size 1024.0))
593 ;; kilo, mega, giga, tera, peta, exa 593 ;; kilo, mega, giga, tera, peta, exa
594 (post-fixes (list "k" "M" "G" "T" "P" "E") (cdr post-fixes))) 594 (post-fixes (list "k" "M" "G" "T" "P" "E") (cdr post-fixes)))
595 ((< file-size 1024) (format " %7.0f%s" file-size (car post-fixes)))))) 595 ((< file-size 1024) (format " %8.0f%s" file-size (car post-fixes))))))
596 596
597(provide 'ls-lisp) 597(provide 'ls-lisp)
598 598
diff --git a/lisp/man.el b/lisp/man.el
index 5b5096f157d..52645db16f5 100644
--- a/lisp/man.el
+++ b/lisp/man.el
@@ -919,35 +919,30 @@ Same for the ANSI bold and normal escape sequences."
919(defun Man-highlight-references (&optional xref-man-type) 919(defun Man-highlight-references (&optional xref-man-type)
920 "Highlight the references on mouse-over. 920 "Highlight the references on mouse-over.
921References include items in the SEE ALSO section, 921References include items in the SEE ALSO section,
922header file (#include <foo.h>) and files in FILES. 922header file (#include <foo.h>), and files in FILES.
923If XREF-MAN-TYPE is used as the button type for items 923If optional argument XREF-MAN-TYPE is non-nil, it used as the
924in SEE ALSO section. If it is nil, default type, 924button type for items in SEE ALSO section. If it is nil, the
925`Man-xref-man-page' is used." 925default type, `Man-xref-man-page' is used for the buttons."
926 ;; `Man-highlight-references' is used from woman.el, too. 926 ;; `Man-highlight-references' is used from woman.el, too.
927 ;; woman.el doesn't set `Man-arguments'. 927 ;; woman.el doesn't set `Man-arguments'.
928 (unless Man-arguments 928 (unless Man-arguments
929 (setq Man-arguments "")) 929 (setq Man-arguments ""))
930 (if (string-match "-k " Man-arguments) 930 (if (string-match "-k " Man-arguments)
931 (progn 931 (progn
932 (Man-highlight-references0 932 (Man-highlight-references0 nil Man-reference-regexp 1 nil
933 nil Man-reference-regexp 1 nil 933 (or xref-man-type 'Man-xref-man-page))
934 (or xref-man-type 'Man-xref-man-page)) 934 (Man-highlight-references0 nil Man-apropos-regexp 1
935 (Man-highlight-references0 935 (lambda ()
936 nil Man-apropos-regexp 1 (lambda () 936 (format "%s(%s)"
937 (format "%s(%s)" 937 (match-string 1)
938 (match-string 1) 938 (match-string 2)))
939 (match-string 2))) 939 (or xref-man-type 'Man-xref-man-page)))
940 (or xref-man-type 'Man-xref-man-page)) 940 (Man-highlight-references0 Man-see-also-regexp Man-reference-regexp 1 nil
941 ) 941 (or xref-man-type 'Man-xref-man-page))
942 (Man-highlight-references0 942 (Man-highlight-references0 Man-synopsis-regexp Man-header-regexp 0 2
943 Man-see-also-regexp Man-reference-regexp 1 nil 943 'Man-xref-header-file)
944 (or xref-man-type 'Man-xref-man-page)) 944 (Man-highlight-references0 Man-files-regexp Man-normal-file-regexp 0 0
945 (Man-highlight-references0 945 'Man-xref-normal-file)))
946 Man-synopsis-regexp Man-header-regexp 0 2
947 'Man-xref-header-file)
948 (Man-highlight-references0
949 Man-files-regexp Man-normal-file-regexp 0 0
950 'Man-xref-normal-file)))
951 946
952(defun Man-highlight-references0 (start-section regexp button-pos target type) 947(defun Man-highlight-references0 (start-section regexp button-pos target type)
953 ;; Based on `Man-build-references-alist' 948 ;; Based on `Man-build-references-alist'
diff --git a/lisp/menu-bar.el b/lisp/menu-bar.el
index 007fd4190fe..64dad08988c 100644
--- a/lisp/menu-bar.el
+++ b/lisp/menu-bar.el
@@ -1239,7 +1239,7 @@ mail status in mode line"))
1239 1239
1240(define-key menu-bar-describe-menu [list-keybindings] 1240(define-key menu-bar-describe-menu [list-keybindings]
1241 '(menu-item "List Key Bindings" describe-bindings 1241 '(menu-item "List Key Bindings" describe-bindings
1242 :help "Display a list of all current keybindings")) 1242 :help "Display all current keybindings (keyboard shortcuts)"))
1243(define-key menu-bar-describe-menu [describe-current-display-table] 1243(define-key menu-bar-describe-menu [describe-current-display-table]
1244 '(menu-item "Describe Display Table" describe-current-display-table 1244 '(menu-item "Describe Display Table" describe-current-display-table
1245 :help "Describe the current display table")) 1245 :help "Describe the current display table"))
diff --git a/lisp/net/browse-url.el b/lisp/net/browse-url.el
index 54fddf9261c..8d57bb30c11 100644
--- a/lisp/net/browse-url.el
+++ b/lisp/net/browse-url.el
@@ -864,7 +864,9 @@ xterm, MMM, and then W3."
864 ((executable-find "tellw3b") 'browse-url-iximosaic) 864 ((executable-find "tellw3b") 'browse-url-iximosaic)
865 ((executable-find browse-url-xterm-program) 'browse-url-lynx-xterm) 865 ((executable-find browse-url-xterm-program) 'browse-url-lynx-xterm)
866 ((executable-find "mmm") 'browse-url-mmm) 866 ((executable-find "mmm") 'browse-url-mmm)
867 (t 'browse-url-w3)) 867 ((locate-library "w3") 'browse-url-w3)
868 (t
869 (lambda (&ignore args) (error "No usable browser found"))))
868 url args)) 870 url args))
869 871
870;;;###autoload 872;;;###autoload
diff --git a/lisp/net/rcirc.el b/lisp/net/rcirc.el
index 7df8e5a5603..93476a0997e 100644
--- a/lisp/net/rcirc.el
+++ b/lisp/net/rcirc.el
@@ -257,7 +257,7 @@ respectively."
257(defvar rcirc-process-output nil) 257(defvar rcirc-process-output nil)
258(defvar rcirc-topic nil) 258(defvar rcirc-topic nil)
259(defvar rcirc-keepalive-timer nil) 259(defvar rcirc-keepalive-timer nil)
260(make-variable-buffer-local 'rcirc-topic) 260(defvar rcirc-last-server-message-time nil)
261(defun rcirc-connect (server port nick user-name full-name startup-channels) 261(defun rcirc-connect (server port nick user-name full-name startup-channels)
262 "Return a connection to SERVER on PORT. 262 "Return a connection to SERVER on PORT.
263 263
@@ -290,6 +290,8 @@ STARTUP-CHANNELS will automatically be joined on startup."
290 (setq rcirc-process-output nil) 290 (setq rcirc-process-output nil)
291 (make-local-variable 'rcirc-startup-channels) 291 (make-local-variable 'rcirc-startup-channels)
292 (setq rcirc-startup-channels startup-channels) 292 (setq rcirc-startup-channels startup-channels)
293 (make-local-variable 'rcirc-last-server-message-time)
294 (setq rcirc-last-server-message-time (current-time))
293 295
294 ;; identify 296 ;; identify
295 (rcirc-send-string process (concat "NICK " nick)) 297 (rcirc-send-string process (concat "NICK " nick))
@@ -313,11 +315,16 @@ STARTUP-CHANNELS will automatically be joined on startup."
313 ,@body)) 315 ,@body))
314 316
315(defun rcirc-keepalive () 317(defun rcirc-keepalive ()
316 "Send keep alive pings to active rcirc processes." 318 "Send keep alive pings to active rcirc processes.
319Kill processes that have not received a server message since the
320last ping."
317 (if (rcirc-process-list) 321 (if (rcirc-process-list)
318 (mapc (lambda (process) 322 (mapc (lambda (process)
319 (with-rcirc-process-buffer process 323 (with-rcirc-process-buffer process
320 (rcirc-send-string process (concat "PING " rcirc-server)))) 324 (if (> (cadr (time-since rcirc-last-server-message-time))
325 rcirc-keepalive-seconds)
326 (kill-process process)
327 (rcirc-send-string process (concat "PING " rcirc-server)))))
321 (rcirc-process-list)) 328 (rcirc-process-list))
322 (cancel-timer rcirc-keepalive-timer) 329 (cancel-timer rcirc-keepalive-timer)
323 (setq rcirc-keepalive-timer nil))) 330 (setq rcirc-keepalive-timer nil)))
@@ -380,6 +387,7 @@ Function is called with PROCESS COMMAND SENDER ARGS and LINE.")
380 "Called when PROCESS receives OUTPUT." 387 "Called when PROCESS receives OUTPUT."
381 (rcirc-debug process output) 388 (rcirc-debug process output)
382 (with-rcirc-process-buffer process 389 (with-rcirc-process-buffer process
390 (setq rcirc-last-server-message-time (current-time))
383 (setq rcirc-process-output (concat rcirc-process-output output)) 391 (setq rcirc-process-output (concat rcirc-process-output output))
384 (when (= (aref rcirc-process-output 392 (when (= (aref rcirc-process-output
385 (1- (length rcirc-process-output))) ?\n) 393 (1- (length rcirc-process-output))) ?\n)
@@ -582,6 +590,8 @@ If buffer is nil, return the target of the current buffer."
582 (setq rcirc-process process) 590 (setq rcirc-process process)
583 (make-local-variable 'rcirc-target) 591 (make-local-variable 'rcirc-target)
584 (setq rcirc-target target) 592 (setq rcirc-target target)
593 (make-local-variable 'rcirc-topic)
594 (setq rcirc-topic nil)
585 595
586 (make-local-variable 'rcirc-short-buffer-name) 596 (make-local-variable 'rcirc-short-buffer-name)
587 (setq rcirc-short-buffer-name nil) 597 (setq rcirc-short-buffer-name nil)
@@ -850,8 +860,8 @@ Create the buffer if it doesn't exist."
850 (process-buffer process)))) 860 (process-buffer process))))
851 861
852(defun rcirc-format-response-string (process sender response target text) 862(defun rcirc-format-response-string (process sender response target text)
853 (concat (when rcirc-time-format 863 (concat (rcirc-facify (format-time-string rcirc-time-format (current-time))
854 (format-time-string rcirc-time-format (current-time))) 864 'rcirc-timestamp)
855 (cond ((or (string= response "PRIVMSG") 865 (cond ((or (string= response "PRIVMSG")
856 (string= response "NOTICE") 866 (string= response "NOTICE")
857 (string= response "ACTION")) 867 (string= response "ACTION"))
@@ -880,14 +890,15 @@ Create the buffer if it doesn't exist."
880 (t 890 (t
881 (rcirc-mangle-text 891 (rcirc-mangle-text
882 process 892 process
883 (rcirc-facify 893 (concat (rcirc-facify "*** " 'rcirc-server-prefix)
884 (concat "*** " 894 (rcirc-facify
885 (when (not (string= sender (rcirc-server process))) 895 (concat
886 (concat (rcirc-user-nick sender) " ")) 896 (when (not (string= sender (rcirc-server process)))
887 (when (zerop (string-to-number response)) 897 (concat (rcirc-user-nick sender) " "))
888 (concat response " ")) 898 (when (zerop (string-to-number response))
889 text) 899 (concat response " "))
890 'rcirc-server)))))) 900 text)
901 'rcirc-server)))))))
891 902
892(defvar rcirc-activity-type nil) 903(defvar rcirc-activity-type nil)
893(make-variable-buffer-local 'rcirc-activity-type) 904(make-variable-buffer-local 'rcirc-activity-type)
@@ -1446,11 +1457,16 @@ With a prefix arg, prompt for new topic."
1446 "Return a copy of STRING with FACE property added." 1457 "Return a copy of STRING with FACE property added."
1447 (propertize (or string "") 'face face 'rear-nonsticky t)) 1458 (propertize (or string "") 'face face 'rear-nonsticky t))
1448 1459
1449;; shy grouping must be used within this regexp
1450(defvar rcirc-url-regexp 1460(defvar rcirc-url-regexp
1451 "\\b\\(?:\\(?:www\\.\\|\\(?:s?https?\\|ftp\\|file\\|gopher\\|news\\|telnet\ 1461 (rx word-boundary
1452\\|wais\\|mailto\\):\\)\\(?://[-a-zA-Z0-9_.]+:[0-9]*\\)?\\(?:[-a-zA-Z0-9_=!?#$\ 1462 (or "www."
1453@~`%&*+|\\/:;.,]\\|\\w\\)+\\(?:[-a-zA-Z0-9_=#$@~`%&*+|\\/]\\|\\w\\)\\)" 1463 (and (or "http" "https" "ftp" "file" "gopher" "news" "telnet" "wais"
1464 "mailto")
1465 "://"
1466 (1+ (char "a-zA-Z0-9_."))
1467 (optional ":" (1+ (char "0-9")))))
1468 (1+ (char "-a-zA-Z0-9_=!?#$\@~`%&*+|\\/:;.,"))
1469 (char "-a-zA-Z0-9_=!?#$\@~`%&*+|\\/:;"))
1454 "Regexp matching URL's. Set to nil to disable URL features in rcirc.") 1470 "Regexp matching URL's. Set to nil to disable URL features in rcirc.")
1455 1471
1456(defun rcirc-browse-url (&optional arg) 1472(defun rcirc-browse-url (&optional arg)
@@ -1498,14 +1514,21 @@ FUNCTION takes 3 arguments, MATCH-START, MATCH-END, and STRING."
1498 "Return TEXT with properties added based on various patterns." 1514 "Return TEXT with properties added based on various patterns."
1499 ;; ^B 1515 ;; ^B
1500 (setq text 1516 (setq text
1501 (rcirc-map-regexp (lambda (start end string) 1517 (rcirc-map-regexp
1502 (add-text-properties 1518 (lambda (start end string)
1503 start end 1519 (let ((orig-face (get-text-property start 'face string)))
1504 (list 'face 'bold 'rear-nonsticky t) 1520 (add-text-properties
1505 string)) 1521 start end
1506 ".*?" 1522 (list 'face (if (listp orig-face)
1507 text)) 1523 (append orig-face
1508 (while (string-match "\\(.*\\)[]\\(.*\\)" text) ; deal with  1524 (list 'bold))
1525 (list orig-face 'bold))
1526 'rear-nonsticky t)
1527 string)))
1528 ".*?"
1529 text))
1530 ;; TODO: deal with ^_ and ^C colors sequences
1531 (while (string-match "\\(.*\\)[]\\(.*\\)" text)
1509 (setq text (concat (match-string 1 text) 1532 (setq text (concat (match-string 1 text)
1510 (match-string 2 text)))) 1533 (match-string 2 text))))
1511 ;; my nick 1534 ;; my nick
@@ -1527,7 +1550,10 @@ FUNCTION takes 3 arguments, MATCH-START, MATCH-END, and STRING."
1527 (lambda (start end string) 1550 (lambda (start end string)
1528 (let ((orig-face (get-text-property start 'face string))) 1551 (let ((orig-face (get-text-property start 'face string)))
1529 (add-text-properties start end 1552 (add-text-properties start end
1530 (list 'face (list orig-face 'bold) 1553 (list 'face (if (listp orig-face)
1554 (append orig-face
1555 (list 'bold))
1556 (list orig-face 'bold))
1531 'rear-nonsticky t 1557 'rear-nonsticky t
1532 'mouse-face 'highlight 1558 'mouse-face 'highlight
1533 'keymap rcirc-browse-url-map) 1559 'keymap rcirc-browse-url-map)
@@ -1836,51 +1862,82 @@ Passwords are read from `rcirc-authinfo-file-name' (which see)."
1836 :group 'rcirc 1862 :group 'rcirc
1837 :group 'faces) 1863 :group 'faces)
1838 1864
1839(defface rcirc-my-nick 1865(defface rcirc-my-nick ; font-lock-function-name-face
1840 '((((type tty) (class color)) (:foreground "blue" :weight bold)) 1866 '((((class color) (min-colors 88) (background light)) (:foreground "Blue1"))
1841 (((class color) (background light)) (:foreground "Blue")) 1867 (((class color) (min-colors 88) (background dark)) (:foreground "LightSkyBlue"))
1842 (((class color) (background dark)) (:foreground "LightSkyBlue")) 1868 (((class color) (min-colors 16) (background light)) (:foreground "Blue"))
1843 (t (:inverse-video t :bold t))) 1869 (((class color) (min-colors 16) (background dark)) (:foreground "LightSkyBlue"))
1870 (((class color) (min-colors 8)) (:foreground "blue" :weight bold))
1871 (t (:inverse-video t :weight bold)))
1844 "The face used to highlight my messages." 1872 "The face used to highlight my messages."
1845 :group 'rcirc-faces) 1873 :group 'rcirc-faces)
1846 1874
1847(defface rcirc-other-nick 1875(defface rcirc-other-nick ; font-lock-variable-name-face
1848 '((((type tty) (class color)) (:foreground "yellow" :weight light)) 1876 '((((class grayscale) (background light))
1849 (((class grayscale) (background light)) 1877 (:foreground "Gray90" :weight bold :slant italic))
1850 (:foreground "Gray90" :bold t :italic t))
1851 (((class grayscale) (background dark)) 1878 (((class grayscale) (background dark))
1852 (:foreground "DimGray" :bold t :italic t)) 1879 (:foreground "DimGray" :weight bold :slant italic))
1853 (((class color) (background light)) (:foreground "DarkGoldenrod")) 1880 (((class color) (min-colors 88) (background light)) (:foreground "DarkGoldenrod"))
1854 (((class color) (background dark)) (:foreground "LightGoldenrod")) 1881 (((class color) (min-colors 88) (background dark)) (:foreground "LightGoldenrod"))
1855 (t (:bold t :italic t))) 1882 (((class color) (min-colors 16) (background light)) (:foreground "DarkGoldenrod"))
1883 (((class color) (min-colors 16) (background dark)) (:foreground "LightGoldenrod"))
1884 (((class color) (min-colors 8)) (:foreground "yellow" :weight light))
1885 (t (:weight bold :slant italic)))
1856 "The face used to highlight other messages." 1886 "The face used to highlight other messages."
1857 :group 'rcirc-faces) 1887 :group 'rcirc-faces)
1858 1888
1859(defface rcirc-server 1889(defface rcirc-server ; font-lock-comment-face
1860 '((((type tty pc) (class color) (background light)) (:foreground "red")) 1890 '((((class grayscale) (background light))
1861 (((type tty pc) (class color) (background dark)) (:foreground "red1")) 1891 (:foreground "DimGray" :weight bold :slant italic))
1862 (((class grayscale) (background light))
1863 (:foreground "DimGray" :bold t :italic t))
1864 (((class grayscale) (background dark)) 1892 (((class grayscale) (background dark))
1865 (:foreground "LightGray" :bold t :italic t)) 1893 (:foreground "LightGray" :weight bold :slant italic))
1866 (((class color) (background light)) (:foreground "gray40")) 1894 (((class color) (min-colors 88) (background light))
1867 (((class color) (background dark)) (:foreground "chocolate1")) 1895 (:foreground "Firebrick"))
1868 (t (:bold t :italic t))) 1896 (((class color) (min-colors 88) (background dark))
1897 (:foreground "chocolate1"))
1898 (((class color) (min-colors 16) (background light))
1899 (:foreground "red"))
1900 (((class color) (min-colors 16) (background dark))
1901 (:foreground "red1"))
1902 (((class color) (min-colors 8) (background light))
1903 )
1904 (((class color) (min-colors 8) (background dark))
1905 )
1906 (t (:weight bold :slant italic)))
1869 "The face used to highlight server messages." 1907 "The face used to highlight server messages."
1870 :group 'rcirc-faces) 1908 :group 'rcirc-faces)
1871 1909
1872(defface rcirc-nick-in-message 1910(defface rcirc-server-prefix ; font-lock-comment-delimiter-face
1873 '((((type tty) (class color)) (:foreground "cyan" :weight bold)) 1911 '((default :inherit font-lock-comment-face)
1874 (((class grayscale) (background light)) (:foreground "LightGray" :bold t)) 1912 (((class grayscale)))
1875 (((class grayscale) (background dark)) (:foreground "DimGray" :bold t)) 1913 (((class color) (min-colors 16)))
1876 (((class color) (background light)) (:foreground "Purple")) 1914 (((class color) (min-colors 8) (background light))
1877 (((class color) (background dark)) (:foreground "Cyan")) 1915 :foreground "red")
1878 (t (:bold t))) 1916 (((class color) (min-colors 8) (background dark))
1917 :foreground "red1"))
1918 "The face used to highlight server prefixes."
1919 :group 'rcirc-faces)
1920
1921(defface rcirc-timestamp
1922 '((t (:inherit default)))
1923 "The face used to highlight timestamps."
1924 :group 'rcirc-faces)
1925
1926(defface rcirc-nick-in-message ; font-lock-keyword-face
1927 '((((class grayscale) (background light)) (:foreground "LightGray" :weight bold))
1928 (((class grayscale) (background dark)) (:foreground "DimGray" :weight bold))
1929 (((class color) (min-colors 88) (background light)) (:foreground "Purple"))
1930 (((class color) (min-colors 88) (background dark)) (:foreground "Cyan1"))
1931 (((class color) (min-colors 16) (background light)) (:foreground "Purple"))
1932 (((class color) (min-colors 16) (background dark)) (:foreground "Cyan"))
1933 (((class color) (min-colors 8)) (:foreground "cyan" :weight bold))
1934 (t (:weight bold)))
1879 "The face used to highlight instances of nick within messages." 1935 "The face used to highlight instances of nick within messages."
1880 :group 'rcirc-faces) 1936 :group 'rcirc-faces)
1881 1937
1882(defface rcirc-prompt 1938(defface rcirc-prompt ; comint-highlight-prompt
1883 '((((background dark)) (:foreground "cyan")) 1939 '((((min-colors 88) (background dark)) (:foreground "cyan1"))
1940 (((background dark)) (:foreground "cyan"))
1884 (t (:foreground "dark blue"))) 1941 (t (:foreground "dark blue")))
1885 "The face to use to highlight prompts." 1942 "The face to use to highlight prompts."
1886 :group 'rcirc-faces) 1943 :group 'rcirc-faces)
diff --git a/lisp/newcomment.el b/lisp/newcomment.el
index 938cd5fe141..9995b4b9156 100644
--- a/lisp/newcomment.el
+++ b/lisp/newcomment.el
@@ -478,19 +478,22 @@ Point is assumed to be just at the end of a comment."
478 (if (bolp) 478 (if (bolp)
479 ;; comment-end = "" 479 ;; comment-end = ""
480 (progn (backward-char) (skip-syntax-backward " ")) 480 (progn (backward-char) (skip-syntax-backward " "))
481 (let ((end (point))) 481 (cond
482 (beginning-of-line) 482 ((save-restriction
483 (save-restriction 483 (narrow-to-region (line-beginning-position) (point))
484 (narrow-to-region (point) end) 484 (goto-char (point-min))
485 (if (re-search-forward (concat comment-end-skip "\\'") nil t) 485 (re-search-forward (concat comment-end-skip "\\'") nil t))
486 (goto-char (match-beginning 0)) 486 (goto-char (match-beginning 0)))
487 ;; comment-end-skip not found probably because it was not set right. 487 ;; comment-end-skip not found. Maybe we're at EOB which implicitly
488 ;; Since \\s> should catch the single-char case, we'll blindly 488 ;; closes the comment.
489 ;; assume we're at the end of a two-char comment-end. 489 ((eobp) (skip-syntax-backward " "))
490 (goto-char (point-max)) 490 (t
491 (backward-char 2) 491 ;; else comment-end-skip was not found probably because it was not
492 (skip-chars-backward (string (char-after))) 492 ;; set right. Since \\s> should catch the single-char case, we'll
493 (skip-syntax-backward " ")))))) 493 ;; blindly assume we're at the end of a two-char comment-end.
494 (backward-char 2)
495 (skip-chars-backward (string (char-after)))
496 (skip-syntax-backward " ")))))
494 497
495;;;; 498;;;;
496;;;; Commands 499;;;; Commands
diff --git a/lisp/paren.el b/lisp/paren.el
index a1cc12712f7..ece3ed3c606 100644
--- a/lisp/paren.el
+++ b/lisp/paren.el
@@ -181,7 +181,12 @@ in `show-paren-style' after `show-paren-delay' seconds of Emacs idle time."
181 (cdr (syntax-after beg))) 181 (cdr (syntax-after beg)))
182 (eq (char-after beg) 182 (eq (char-after beg)
183 ;; This can give nil. 183 ;; This can give nil.
184 (cdr (syntax-after (1- end))))))))))))) 184 (cdr (syntax-after (1- end))))
185 ;; The cdr might hold a new paren-class
186 ;; info rather than a matching-char info,
187 ;; in which case the two CDRs should match.
188 (eq (cdr (syntax-after (1- end)))
189 (cdr (syntax-after beg))))))))))))
185 ;; 190 ;;
186 ;; Highlight the other end of the sexp, or unhighlight if none. 191 ;; Highlight the other end of the sexp, or unhighlight if none.
187 (if (not pos) 192 (if (not pos)
diff --git a/lisp/progmodes/gdb-ui.el b/lisp/progmodes/gdb-ui.el
index 92265dd46da..961ee0747ff 100644
--- a/lisp/progmodes/gdb-ui.el
+++ b/lisp/progmodes/gdb-ui.el
@@ -75,9 +75,11 @@
75;; of 'info registers'. 75;; of 'info registers'.
76;; 3) Use tree-widget.el instead of the speedbar for watch-expressions? 76;; 3) Use tree-widget.el instead of the speedbar for watch-expressions?
77;; 4) Mark breakpoint locations on scroll-bar of source buffer? 77;; 4) Mark breakpoint locations on scroll-bar of source buffer?
78;; 5) After release of 22.1 use '-var-list-children --all-values' 78;; 5) After release of 22.1, use "-var-list-children --all-values"
79;; and '-stack-list-locals 2' which need GDB 6.1 onwards. 79;; and "-stack-list-locals --simple-values" which need GDB 6.1 onwards.
80;; 6) With gud-print and gud-pstar, print the variable name in the GUD 80;; 6) After release of 22.1, use "-var-update --all-values" which needs
81;; GDB 6.4 onwards.
82;; 7) With gud-print and gud-pstar, print the variable name in the GUD
81;; buffer instead of the value's history number. 83;; buffer instead of the value's history number.
82 84
83;;; Code: 85;;; Code:
@@ -2230,6 +2232,30 @@ corresponding to the mode line clicked."
2230 "server info locals\n" 2232 "server info locals\n"
2231 gdb-info-locals-handler) 2233 gdb-info-locals-handler)
2232 2234
2235(defvar gdb-locals-watch-keymap
2236 (let ((map (make-sparse-keymap)))
2237 (define-key map "\r" '(lambda () (interactive)
2238 (beginning-of-line)
2239 (gud-watch)))
2240 (define-key map [mouse-2] '(lambda (event) (interactive "e")
2241 (mouse-set-point event)
2242 (beginning-of-line)
2243 (gud-watch)))
2244 map)
2245 "Keymap to create watch expression of a complex data type local variable.")
2246
2247(defconst gdb-struct-string
2248 (concat (propertize "[struct/union];"
2249 'mouse-face 'highlight
2250 'help-echo "mouse-2: create watch expression"
2251 'local-map gdb-locals-watch-keymap) "\n"))
2252
2253(defconst gdb-array-string
2254 (concat " " (propertize "[array];"
2255 'mouse-face 'highlight
2256 'help-echo "mouse-2: create watch expression"
2257 'local-map gdb-locals-watch-keymap) "\n"))
2258
2233;; Abbreviate for arrays and structures. 2259;; Abbreviate for arrays and structures.
2234;; These can be expanded using gud-display. 2260;; These can be expanded using gud-display.
2235(defun gdb-info-locals-handler () 2261(defun gdb-info-locals-handler ()
@@ -2242,10 +2268,10 @@ corresponding to the mode line clicked."
2242 (replace-match "" nil nil)) 2268 (replace-match "" nil nil))
2243 (goto-char (point-min)) 2269 (goto-char (point-min))
2244 (while (re-search-forward "{\\(.*=.*\n\\|\n\\)" nil t) 2270 (while (re-search-forward "{\\(.*=.*\n\\|\n\\)" nil t)
2245 (replace-match "(structure);\n" nil nil)) 2271 (replace-match gdb-struct-string nil nil))
2246 (goto-char (point-min)) 2272 (goto-char (point-min))
2247 (while (re-search-forward "\\s-*{.*\n" nil t) 2273 (while (re-search-forward "\\s-*{.*\n" nil t)
2248 (replace-match " (array);\n" nil nil)))) 2274 (replace-match gdb-array-string nil nil))))
2249 (let ((buf (gdb-get-buffer 'gdb-locals-buffer))) 2275 (let ((buf (gdb-get-buffer 'gdb-locals-buffer)))
2250 (and buf 2276 (and buf
2251 (with-current-buffer buf 2277 (with-current-buffer buf
@@ -2504,6 +2530,7 @@ Kills the gdb buffers and resets the source buffers."
2504 (delq 'gdb-overlay-arrow-position overlay-arrow-variable-list)) 2530 (delq 'gdb-overlay-arrow-position overlay-arrow-variable-list))
2505 (setq gud-running nil) 2531 (setq gud-running nil)
2506 (setq gdb-active-process nil) 2532 (setq gdb-active-process nil)
2533 (setq gdb-var-list nil)
2507 (remove-hook 'after-save-hook 'gdb-create-define-alist t)) 2534 (remove-hook 'after-save-hook 'gdb-create-define-alist t))
2508 2535
2509(defun gdb-source-info () 2536(defun gdb-source-info ()
diff --git a/lisp/progmodes/sh-script.el b/lisp/progmodes/sh-script.el
index bc4ca59f96a..f6928a72554 100644
--- a/lisp/progmodes/sh-script.el
+++ b/lisp/progmodes/sh-script.el
@@ -986,7 +986,11 @@ Point is at the beginning of the next line."
986 (when (memq (char-before) '(?\" ?\')) 986 (when (memq (char-before) '(?\" ?\'))
987 (condition-case nil (progn (backward-sexp 1) t) 987 (condition-case nil (progn (backward-sexp 1) t)
988 (error nil))))) 988 (error nil)))))
989 (forward-comment (- (point-max))) 989 (while (progn
990 (forward-comment (- (point-max)))
991 ;; Maybe we've bumped into an escaped newline.
992 (sh-is-quoted-p (point)))
993 (backward-char 1))
990 (when (eq (char-before) ?|) 994 (when (eq (char-before) ?|)
991 (backward-char 1) t))) 995 (backward-char 1) t)))
992 (when (save-excursion (backward-char 2) (looking-at ";;\\|in")) 996 (when (save-excursion (backward-char 2) (looking-at ";;\\|in"))
diff --git a/lisp/simple.el b/lisp/simple.el
index 35a42965ef7..a1be91f5abf 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -893,9 +893,9 @@ in *Help* buffer. See also the command `describe-char'."
893 (col (current-column))) 893 (col (current-column)))
894 (if (= pos end) 894 (if (= pos end)
895 (if (or (/= beg 1) (/= end (1+ total))) 895 (if (or (/= beg 1) (/= end (1+ total)))
896 (message "point=%d of %d (%d%%) <%d - %d> column %d %s" 896 (message "point=%d of %d (%d%%) <%d-%d> column=%d%s"
897 pos total percent beg end col hscroll) 897 pos total percent beg end col hscroll)
898 (message "point=%d of %d (EOB) column %d %s" 898 (message "point=%d of %d (EOB) column=%d%s"
899 pos total col hscroll)) 899 pos total col hscroll))
900 (let ((coding buffer-file-coding-system) 900 (let ((coding buffer-file-coding-system)
901 encoded encoding-msg display-prop under-display) 901 encoded encoding-msg display-prop under-display)
@@ -904,7 +904,7 @@ in *Help* buffer. See also the command `describe-char'."
904 (setq coding default-buffer-file-coding-system)) 904 (setq coding default-buffer-file-coding-system))
905 (if (not (char-valid-p char)) 905 (if (not (char-valid-p char))
906 (setq encoding-msg 906 (setq encoding-msg
907 (format "(0%o, %d, 0x%x, invalid)" char char char)) 907 (format "(%d, #o%o, #x%x, invalid)" char char char))
908 ;; Check if the character is displayed with some `display' 908 ;; Check if the character is displayed with some `display'
909 ;; text property. In that case, set under-display to the 909 ;; text property. In that case, set under-display to the
910 ;; buffer substring covered by that property. 910 ;; buffer substring covered by that property.
@@ -923,27 +923,27 @@ in *Help* buffer. See also the command `describe-char'."
923 (setq encoding-msg 923 (setq encoding-msg
924 (if display-prop 924 (if display-prop
925 (if (not (stringp display-prop)) 925 (if (not (stringp display-prop))
926 (format "(0%o, %d, 0x%x, part of display \"%s\")" 926 (format "(%d, #o%o, #x%x, part of display \"%s\")"
927 char char char under-display) 927 char char char under-display)
928 (format "(0%o, %d, 0x%x, part of display \"%s\"->\"%s\")" 928 (format "(%d, #o%o, #x%x, part of display \"%s\"->\"%s\")"
929 char char char under-display display-prop)) 929 char char char under-display display-prop))
930 (if encoded 930 (if encoded
931 (format "(0%o, %d, 0x%x, file %s)" 931 (format "(%d, #o%o, #x%x, file %s)"
932 char char char 932 char char char
933 (if (> (length encoded) 1) 933 (if (> (length encoded) 1)
934 "..." 934 "..."
935 (encoded-string-description encoded coding))) 935 (encoded-string-description encoded coding)))
936 (format "(0%o, %d, 0x%x)" char char char))))) 936 (format "(%d, #o%o, #x%x)" char char char)))))
937 (if detail 937 (if detail
938 ;; We show the detailed information about CHAR. 938 ;; We show the detailed information about CHAR.
939 (describe-char (point))) 939 (describe-char (point)))
940 (if (or (/= beg 1) (/= end (1+ total))) 940 (if (or (/= beg 1) (/= end (1+ total)))
941 (message "Char: %s %s point=%d of %d (%d%%) <%d - %d> column %d %s" 941 (message "Char: %s %s point=%d of %d (%d%%) <%d-%d> column=%d%s"
942 (if (< char 256) 942 (if (< char 256)
943 (single-key-description char) 943 (single-key-description char)
944 (buffer-substring-no-properties (point) (1+ (point)))) 944 (buffer-substring-no-properties (point) (1+ (point))))
945 encoding-msg pos total percent beg end col hscroll) 945 encoding-msg pos total percent beg end col hscroll)
946 (message "Char: %s %s point=%d of %d (%d%%) column %d %s" 946 (message "Char: %s %s point=%d of %d (%d%%) column=%d%s"
947 (if enable-multibyte-characters 947 (if enable-multibyte-characters
948 (if (< char 128) 948 (if (< char 128)
949 (single-key-description char) 949 (single-key-description char)
@@ -4320,7 +4320,11 @@ If nil, search stops at the beginning of the accessible portion of the buffer."
4320 (eq (syntax-class syntax) 4) 4320 (eq (syntax-class syntax) 4)
4321 (cdr syntax))))) 4321 (cdr syntax)))))
4322 (cond 4322 (cond
4323 ((not (eq matching-paren (char-before oldpos))) 4323 ((not (or (eq matching-paren (char-before oldpos))
4324 ;; The cdr might hold a new paren-class info rather than
4325 ;; a matching-char info, in which case the two CDRs
4326 ;; should match.
4327 (eq matching-paren (cdr (syntax-after oldpos)))))
4324 (message "Mismatched parentheses")) 4328 (message "Mismatched parentheses"))
4325 ((not blinkpos) 4329 ((not blinkpos)
4326 (if (not blink-matching-paren-distance) 4330 (if (not blink-matching-paren-distance)
diff --git a/lisp/startup.el b/lisp/startup.el
index b56aa331e71..863c621de6c 100644
--- a/lisp/startup.el
+++ b/lisp/startup.el
@@ -653,7 +653,7 @@ opening the first frame (e.g. open a connection to an X server).")
653 (if (and (stringp (car elt)) 653 (if (and (stringp (car elt))
654 (not (file-name-absolute-p (car elt)))) 654 (not (file-name-absolute-p (car elt))))
655 (cons (locate-file (car elt) load-path 655 (cons (locate-file (car elt) load-path
656 load-suffixes) 656 (append load-suffixes '("")))
657 (cdr elt)) 657 (cdr elt))
658 elt)) 658 elt))
659 load-history)) 659 load-history))
@@ -1285,7 +1285,7 @@ This is an internal function used to turn off the splash screen after
1285the user caused an input event by hitting a key or clicking with the 1285the user caused an input event by hitting a key or clicking with the
1286mouse." 1286mouse."
1287 (interactive) 1287 (interactive)
1288 (if (and (consp last-command-event) 1288 (if (and (memq 'down (event-modifiers last-command-event))
1289 (eq (posn-window (event-start last-command-event)) 1289 (eq (posn-window (event-start last-command-event))
1290 (selected-window))) 1290 (selected-window)))
1291 ;; This is a mouse-down event in the spash screen window. 1291 ;; This is a mouse-down event in the spash screen window.
diff --git a/lisp/subr.el b/lisp/subr.el
index 561394038c5..b6063c18638 100644
--- a/lisp/subr.el
+++ b/lisp/subr.el
@@ -1541,6 +1541,8 @@ by doing (clear-string STRING)."
1541 (c 0) 1541 (c 0)
1542 (echo-keystrokes 0) 1542 (echo-keystrokes 0)
1543 (cursor-in-echo-area t)) 1543 (cursor-in-echo-area t))
1544 (add-text-properties 0 (length prompt)
1545 minibuffer-prompt-properties prompt)
1544 (while (progn (message "%s%s" 1546 (while (progn (message "%s%s"
1545 prompt 1547 prompt
1546 (make-string (length pass) ?.)) 1548 (make-string (length pass) ?.))
diff --git a/lisp/textmodes/org.el b/lisp/textmodes/org.el
index ef1c66bf166..0dcde3d69d5 100644
--- a/lisp/textmodes/org.el
+++ b/lisp/textmodes/org.el
@@ -1,11 +1,11 @@
1;;; org.el --- Outline-based notes management and organizer 1;;; org.el --- Outline-based notes management and organize
2;; Carstens outline-mode for keeping track of everything. 2;; Carstens outline-mode for keeping track of everything.
3;; Copyright (c) 2004, 2005 Free Software Foundation 3;; Copyright (c) 2004, 2005 Free Software Foundation
4;; 4;;
5;; Author: Carsten Dominik <dominik at science dot uva dot nl> 5;; Author: Carsten Dominik <dominik at science dot uva dot nl>
6;; Keywords: outlines, hypermedia, calendar 6;; Keywords: outlines, hypermedia, calendar
7;; Homepage: http://www.astro.uva.nl/~dominik/Tools/org/ 7;; Homepage: http://www.astro.uva.nl/~dominik/Tools/org/
8;; Version: 3.19 8;; Version: 3.20
9;; 9;;
10;; This file is part of GNU Emacs. 10;; This file is part of GNU Emacs.
11;; 11;;
@@ -80,6 +80,20 @@
80;; 80;;
81;; Changes: 81;; Changes:
82;; ------- 82;; -------
83;; Version 3.20
84;; - There is finally an option to make TAB jump over horizontal lines
85;; in tables instead of creating a new line before that line.
86;; The option is `org-table-tab-jumps-over-hlines', default nil.
87;; - New command for sorting tables, on `C-c ^'.
88;; - Changes to the HTML exporter
89;; - hand-formatted lists are exported correctly, similar to
90;; markdown lists. Nested lists are possible. See the docstring
91;; of the variable `org-export-local-list-max-depth'.
92;; - cleaned up to produce valid HTML 4.0 (transitional).
93;; - support for cascading style sheets.
94;; - New command to cycle through all agenda files, on C-,
95;; - C-c [ can now also be used to change the sequence of agenda files.
96;;
83;; Version 3.19 97;; Version 3.19
84;; - Bug fixes 98;; - Bug fixes
85;; 99;;
@@ -220,7 +234,7 @@
220 234
221;;; Customization variables 235;;; Customization variables
222 236
223(defvar org-version "3.19" 237(defvar org-version "3.20"
224 "The version number of the file org.el.") 238 "The version number of the file org.el.")
225(defun org-version () 239(defun org-version ()
226 (interactive) 240 (interactive)
@@ -530,7 +544,7 @@ moved to the new date."
530 544
531(defcustom org-agenda-files nil 545(defcustom org-agenda-files nil
532 "A list of org files for agenda/diary display. 546 "A list of org files for agenda/diary display.
533Entries are added to this list with \\[org-add-file] and removed with 547Entries are added to this list with \\[org-agenda-file-to-front] and removed with
534\\[org-remove-file]. You can also use customize to edit the list." 548\\[org-remove-file]. You can also use customize to edit the list."
535 :group 'org-agenda 549 :group 'org-agenda
536 :type '(repeat file)) 550 :type '(repeat file))
@@ -1128,6 +1142,17 @@ See also the variable `org-table-auto-blank-field'."
1128 (const :tag "on" t) 1142 (const :tag "on" t)
1129 (const :tag "on, optimized" optimized))) 1143 (const :tag "on, optimized" optimized)))
1130 1144
1145;; FIXME: We could have a third option which makes it jump onle over the first
1146;; hline in a table.
1147(defcustom org-table-tab-jumps-over-hlines t
1148 "Non-nil means, tab in the last column of a table with jump over a hline.
1149If a horizontal separator line is following the current line,
1150`org-table-next-field' can either create a new row before that line, or jump
1151over the line. When this option is nil, a new line will be created before
1152this line."
1153 :group 'org-table
1154 :type 'boolean)
1155
1131(defcustom org-table-auto-blank-field t 1156(defcustom org-table-auto-blank-field t
1132 "Non-nil means, automatically blank table field when starting to type into it. 1157 "Non-nil means, automatically blank table field when starting to type into it.
1133This only happens when typing immediately after a field motion 1158This only happens when typing immediately after a field motion
@@ -1313,7 +1338,28 @@ or use the +OPTION lines for a per-file setting."
1313 1338
1314(defcustom org-export-default-language "en" 1339(defcustom org-export-default-language "en"
1315 "The default language of HTML export, as a string. 1340 "The default language of HTML export, as a string.
1316This should have an association in `org-export-language-setup'" 1341This should have an association in `org-export-language-setup'."
1342 :group 'org-export
1343 :type 'string)
1344
1345(defcustom org-export-html-style ""
1346 "The default style specification for exported HTML files.
1347Since there are different ways of setting style information, this variable
1348needs to contain the full HTML structure to provide a style, including the
1349surrounding HTML tags. For example, legal values would be
1350
1351 <style type=\"text/css\">
1352 p {font-weight: normal; color: gray; }
1353 h1 {color: black; }
1354 </style>
1355
1356or
1357
1358 <link rel=\"stylesheet\" type=\"text/css\" href=\"mystyles.css\">
1359
1360As the value of this option simply gets inserted into the HTML <head> header,
1361you can \"misuse\" it to add arbitrary text to the header.
1362"
1317 :group 'org-export 1363 :group 'org-export
1318 :type 'string) 1364 :type 'string)
1319 1365
@@ -1347,6 +1393,30 @@ This option can also be set with the +OPTIONS line, e.g. \"toc:nil\"."
1347 :group 'org-export 1393 :group 'org-export
1348 :type 'boolean) 1394 :type 'boolean)
1349 1395
1396(defcustom org-export-local-list-max-depth 1
1397 "Maximum depth of hand-formatted lists in HTML export.
1398Org-mode parses hand-formatted enumeration and bullet lists and
1399transforms them to HTML open export. Different indentation of the bullet
1400or number indicates different list nesting levels. To avoid confusion,
1401only a single level is allowed by default. This means that a list is started
1402with an item, and that all further items are consitered as long as the
1403indentation is larger or equal to the indentation of the first item. When this
1404is larger than 1, deeper indentation leads to deeper list nesting.
1405If you are careful with hand formatting, you can increase this limit and
1406get lists of arbitrary depth. For example, by setting this option to 3, the
1407following list would look correct in HTML:
1408
1409 * Fruit
1410 - Apple
1411 - Banana
1412 1. from Africa
1413 2. from South America
1414 - Pineapple
1415 * Bread
1416 * Dairy products"
1417 :group 'org-export
1418 :type 'integer)
1419
1350(defcustom org-export-preserve-breaks nil 1420(defcustom org-export-preserve-breaks nil
1351 "Non-nil means, preserve all line breaks when exporting. 1421 "Non-nil means, preserve all line breaks when exporting.
1352Normally, in HTML output paragraphs will be reformatted. In ASCII 1422Normally, in HTML output paragraphs will be reformatted. In ASCII
@@ -1874,19 +1944,8 @@ The following commands are available:
1874 (make-local-hook 'before-change-functions) ;; needed for XEmacs 1944 (make-local-hook 'before-change-functions) ;; needed for XEmacs
1875 (add-hook 'before-change-functions 'org-before-change-function nil 1945 (add-hook 'before-change-functions 'org-before-change-function nil
1876 'local) 1946 'local)
1877 ;; Paragraph regular expressions 1947 ;; Paragraphs and auto-filling
1878 (set (make-local-variable 'paragraph-separate) "\f\\|[ ]*$\\|\\([*\f]+\\)") 1948 (org-set-autofill-regexps)
1879 (set (make-local-variable 'paragraph-start) "\f\\|[ ]*$\\|\\([*\f]+\\)")
1880 ;; Inhibit auto-fill for headers, tables and fixed-width lines.
1881 (set (make-local-variable 'auto-fill-inhibit-regexp)
1882 (concat "\\*\\|#"
1883 (if (or org-enable-table-editor org-enable-fixed-width-editor)
1884 (concat
1885 "\\|[ \t]*["
1886 (if org-enable-table-editor "|" "")
1887 (if org-enable-fixed-width-editor ":" "")
1888 "]"))))
1889 (set (make-local-variable 'fill-paragraph-function) 'org-fill-paragraph)
1890 ;; Settings for Calc embedded mode 1949 ;; Settings for Calc embedded mode
1891 (set (make-local-variable 'calc-embedded-open-formula) "|\\|\n") 1950 (set (make-local-variable 'calc-embedded-open-formula) "|\\|\n")
1892 (set (make-local-variable 'calc-embedded-close-formula) "|\\|\n") 1951 (set (make-local-variable 'calc-embedded-close-formula) "|\\|\n")
@@ -1918,12 +1977,6 @@ The following commands are available:
1918 (let ((this-command 'org-cycle) (last-command 'org-cycle)) 1977 (let ((this-command 'org-cycle) (last-command 'org-cycle))
1919 (org-cycle '(4)) (org-cycle '(4)))))))) 1978 (org-cycle '(4)) (org-cycle '(4))))))))
1920 1979
1921(defun org-fill-paragraph (&optional justify)
1922 "Re-align a table, pass through to fill-paragraph if no table."
1923 (save-excursion
1924 (beginning-of-line 1)
1925 (looking-at "\\s-*\\(|\\|\\+-+\\)")))
1926
1927(defsubst org-current-line (&optional pos) 1980(defsubst org-current-line (&optional pos)
1928 (+ (if (bolp) 1 0) (count-lines (point-min) (or pos (point))))) 1981 (+ (if (bolp) 1 0) (count-lines (point-min) (or pos (point)))))
1929 1982
@@ -4230,34 +4283,53 @@ Needed to avoid empty dates which mess up holiday display."
4230 (error 4283 (error
4231 (add-to-diary-list original-date "Org-mode dummy" "" nil))))) 4284 (add-to-diary-list original-date "Org-mode dummy" "" nil)))))
4232 4285
4233(defun org-add-file (&optional file) 4286(defun org-cycle-agenda-files ()
4234 "Add current file to the list of files in variable `org-agenda-files'. 4287 "Cycle through the files in `org-agenda-files'.
4235These are the files which are being checked for agenda entries. 4288If the current buffer visits an agenda file, find the next one in the list.
4236Optional argument FILE means, use this file instead of the current. 4289If the current buffer does not, find the first agenda file."
4237It is possible (but not recommended) to add this function to the
4238`org-mode-hook'."
4239 (interactive) 4290 (interactive)
4240 (catch 'exit 4291 (let ((files (append org-agenda-files (list (car org-agenda-files))))
4241 (let* ((file (or file (buffer-file-name) 4292 (tcf (if (buffer-file-name) (file-truename (buffer-file-name))))
4242 (if (interactive-p) 4293 file)
4243 (error "Buffer is not visiting a file") 4294 (unless files (error "No agenda files"))
4244 (throw 'exit nil)))) 4295 (catch 'exit
4245 (true-file (file-truename file)) 4296 (while (setq file (pop files))
4246 (afile (abbreviate-file-name file)) 4297 (if (equal (file-truename file) tcf)
4247 (present (delq nil (mapcar 4298 (when (car files)
4248 (lambda (x) 4299 (find-file (car files))
4249 (equal true-file (file-truename x))) 4300 (throw 'exit t))))
4250 org-agenda-files)))) 4301 (find-file (car org-agenda-files)))))
4251 (if (not present) 4302
4252 (progn 4303(defun org-agenda-file-to-end (&optional file)
4253 (setq org-agenda-files 4304 "Move/add the current file to the end of the agenda fiole list.
4254 (cons afile org-agenda-files)) 4305I the file is not present in the list, it is appended ot the list. If it is
4255 ;; Make sure custom.el does not end up with Org-mode 4306present, it is moved there."
4256 (let ((org-mode-hook nil) (default-major-mode 'fundamental-mode)) 4307 (interactive)
4257 (customize-save-variable 'org-agenda-files org-agenda-files)) 4308 (org-agenda-file-to-front 'to-end file))
4258 (org-install-agenda-files-menu) 4309
4259 (message "Added file: %s" afile)) 4310(defun org-agenda-file-to-front (&optional to-end file)
4260 (message "File was already in list: %s" afile))))) 4311 "Move/add the current file to the top of the agenda file list.
4312If the file is not present in the list, it is added to the front. If it is
4313present, it is moved there. With optional argument TO-END, add/move to the
4314end of the list."
4315 (interactive "P")
4316 (let ((file-alist (mapcar (lambda (x)
4317 (cons (file-truename x) x))
4318 org-agenda-files))
4319 (ctf (file-truename (buffer-file-name)))
4320 x had)
4321 (setq x (assoc ctf file-alist) had x)
4322
4323 (if (not x) (setq x (cons ctf (abbreviate-file-name (buffer-file-name)))))
4324 (if to-end
4325 (setq file-alist (append (delq x file-alist) (list x)))
4326 (setq file-alist (cons x (delq x file-alist))))
4327 (setq org-agenda-files (mapcar 'cdr file-alist))
4328 (let ((org-mode-hook nil) (default-major-mode 'fundamental-mode))
4329 (customize-save-variable 'org-agenda-files org-agenda-files))
4330 (org-install-agenda-files-menu)
4331 (message "File %s to %s of agenda file list"
4332 (if had "moved" "added") (if to-end "end" "front"))))
4261 4333
4262(defun org-remove-file (&optional file) 4334(defun org-remove-file (&optional file)
4263 "Remove current file from the list of files in variable `org-agenda-files'. 4335 "Remove current file from the list of files in variable `org-agenda-files'.
@@ -6300,7 +6372,7 @@ Optional argument NEW may specify text to replace the current field content."
6300 (goto-char pos)))))) 6372 (goto-char pos))))))
6301 6373
6302(defun org-table-next-field () 6374(defun org-table-next-field ()
6303 "Go to the next field in the current table. 6375 "Go to the next field in the current table, creating new lines as needed.
6304Before doing so, re-align the table if necessary." 6376Before doing so, re-align the table if necessary."
6305 (interactive) 6377 (interactive)
6306 (org-table-maybe-eval-formula) 6378 (org-table-maybe-eval-formula)
@@ -6308,20 +6380,25 @@ Before doing so, re-align the table if necessary."
6308 (if (and org-table-automatic-realign 6380 (if (and org-table-automatic-realign
6309 org-table-may-need-update) 6381 org-table-may-need-update)
6310 (org-table-align)) 6382 (org-table-align))
6311 (if (org-at-table-hline-p) 6383 (let ((end (org-table-end)))
6312 (end-of-line 1)) 6384 (if (org-at-table-hline-p)
6313 (condition-case nil 6385 (end-of-line 1))
6314 (progn 6386 (condition-case nil
6315 (re-search-forward "|" (org-table-end)) 6387 (progn
6316 (if (looking-at "[ \t]*$") 6388 (re-search-forward "|" end)
6317 (re-search-forward "|" (org-table-end))) 6389 (if (looking-at "[ \t]*$")
6318 (if (looking-at "-") 6390 (re-search-forward "|" end))
6319 (progn 6391 (if (and (looking-at "-")
6320 (beginning-of-line 0) 6392 org-table-tab-jumps-over-hlines
6321 (org-table-insert-row 'below)) 6393 (re-search-forward "^[ \t]*|\\([^-]\\)" end t))
6322 (if (looking-at " ") (forward-char 1)))) 6394 (goto-char (match-beginning 1)))
6323 (error 6395 (if (looking-at "-")
6324 (org-table-insert-row 'below)))) 6396 (progn
6397 (beginning-of-line 0)
6398 (org-table-insert-row 'below))
6399 (if (looking-at " ") (forward-char 1))))
6400 (error
6401 (org-table-insert-row 'below)))))
6325 6402
6326(defun org-table-previous-field () 6403(defun org-table-previous-field ()
6327 "Go to the previous field in the table. 6404 "Go to the previous field in the table.
@@ -6472,6 +6549,7 @@ With optional argument ON-DELIM, stop with point before the left delimiter
6472of the field. 6549of the field.
6473If there are less than N fields, just go to after the last delimiter. 6550If there are less than N fields, just go to after the last delimiter.
6474However, when FORCE is non-nil, create new columns if necessary." 6551However, when FORCE is non-nil, create new columns if necessary."
6552 (interactive "p")
6475 (let ((pos (point-at-eol))) 6553 (let ((pos (point-at-eol)))
6476 (beginning-of-line 1) 6554 (beginning-of-line 1)
6477 (when (> n 0) 6555 (when (> n 0)
@@ -6490,7 +6568,7 @@ However, when FORCE is non-nil, create new columns if necessary."
6490 6568
6491(defun org-at-table-p (&optional table-type) 6569(defun org-at-table-p (&optional table-type)
6492 "Return t if the cursor is inside an org-type table. 6570 "Return t if the cursor is inside an org-type table.
6493If TABLE-TYPE is non-nil, also chack for table.el-type tables." 6571If TABLE-TYPE is non-nil, also check for table.el-type tables."
6494 (if org-enable-table-editor 6572 (if org-enable-table-editor
6495 (save-excursion 6573 (save-excursion
6496 (beginning-of-line 1) 6574 (beginning-of-line 1)
@@ -6498,6 +6576,13 @@ If TABLE-TYPE is non-nil, also chack for table.el-type tables."
6498 org-table-line-regexp))) 6576 org-table-line-regexp)))
6499 nil)) 6577 nil))
6500 6578
6579(defun org-at-table.el-p ()
6580 "Return t if and only if we are at a table.el table."
6581 (and (org-at-table-p 'any)
6582 (save-excursion
6583 (goto-char (org-table-begin 'any))
6584 (looking-at org-table1-hline-regexp))))
6585
6501(defun org-table-recognize-table.el () 6586(defun org-table-recognize-table.el ()
6502 "If there is a table.el table nearby, recognize it and move into it." 6587 "If there is a table.el table nearby, recognize it and move into it."
6503 (if org-table-tab-recognizes-table.el 6588 (if org-table-tab-recognizes-table.el
@@ -6524,15 +6609,6 @@ If TABLE-TYPE is non-nil, also chack for table.el-type tables."
6524 nil) 6609 nil)
6525 nil)) 6610 nil))
6526 6611
6527(defun org-at-table.el-p ()
6528 "Return t if the cursor is inside a table.el-type table."
6529 (save-excursion
6530 (if (org-at-table-p 'any)
6531 (progn
6532 (goto-char (org-table-begin 'any))
6533 (looking-at org-table1-hline-regexp))
6534 nil)))
6535
6536(defun org-at-table-hline-p () 6612(defun org-at-table-hline-p ()
6537 "Return t if the cursor is inside a hline in a table." 6613 "Return t if the cursor is inside a hline in a table."
6538 (if org-enable-table-editor 6614 (if org-enable-table-editor
@@ -6745,6 +6821,49 @@ With prefix ARG, insert above the current line."
6745 (if (not (org-at-table-p)) (beginning-of-line 0)) 6821 (if (not (org-at-table-p)) (beginning-of-line 0))
6746 (move-to-column col))) 6822 (move-to-column col)))
6747 6823
6824(defun org-table-sort-lines (beg end numericp)
6825 "Sort table lines in region.
6826Point and mark define the first and last line to include. Both point and
6827mark should be in the column that is used for sorting. For example, to
6828sort according to column 3, put the mark in the first line to sort, in
6829table column 3. Put point into the last line to be included in the sorting,
6830also in table column 3. The command will prompt for the sorting method (n for
6831numerical, a for alphanumeric)."
6832 (interactive "r\nsSorting method: [n]=numeric [a]=alpha: ")
6833 (setq numericp (string-match "[nN]" numericp))
6834 (org-table-align) ;; Just to be safe
6835 (let* (bcol ecol cmp column lns)
6836 (goto-char beg)
6837 (org-table-check-inside-data-field)
6838 (setq column (org-table-current-column)
6839 beg (move-marker (make-marker) (point-at-bol)))
6840 (goto-char end)
6841 (org-table-check-inside-data-field)
6842 (setq end (move-marker (make-marker) (1+ (point-at-eol))))
6843 (untabify beg end)
6844 (goto-char beg)
6845 (org-table-goto-column column)
6846 (skip-chars-backward "^|")
6847 (setq bcol (current-column))
6848 (org-table-goto-column (1+ column))
6849 (skip-chars-backward "^|")
6850 (setq ecol (1- (current-column)))
6851 (setq cmp (if numericp
6852 (lambda (a b) (< (car a) (car b)))
6853 (lambda (a b) (string< (car a) (car b)))))
6854 (setq lns (mapcar (lambda(x) (cons (org-trim (substring x bcol ecol)) x))
6855 (split-string (buffer-substring beg end) "\n")))
6856 (if numericp
6857 (setq lns (mapcar (lambda(x)
6858 (cons (string-to-number (car x)) (cdr x)))
6859 lns)))
6860 (delete-region beg end)
6861 (move-marker beg nil)
6862 (move-marker end nil)
6863 (insert (mapconcat 'cdr (setq lns (sort lns cmp)) "\n") "\n")
6864 (message "%d lines sorted %s based on column %d"
6865 (length lns)
6866 (if numericp "numerically" "alphabetically") column)))
6748 6867
6749(defun org-table-cut-region (beg end) 6868(defun org-table-cut-region (beg end)
6750 "Copy region in table to the clipboard and blank all relevant fields." 6869 "Copy region in table to the clipboard and blank all relevant fields."
@@ -8013,6 +8132,7 @@ to execute outside of tables."
8013 '("\C-c=" org-table-eval-formula) 8132 '("\C-c=" org-table-eval-formula)
8014 '("\C-c'" org-table-edit-formulas) 8133 '("\C-c'" org-table-edit-formulas)
8015 '("\C-c*" org-table-recalculate) 8134 '("\C-c*" org-table-recalculate)
8135 '("\C-c^" org-table-sort-lines)
8016 '([(control ?#)] org-table-rotate-recalc-marks))) 8136 '([(control ?#)] org-table-rotate-recalc-marks)))
8017 elt key fun cmd) 8137 elt key fun cmd)
8018 (while (setq elt (pop bindings)) 8138 (while (setq elt (pop bindings))
@@ -8063,6 +8183,7 @@ to execute outside of tables."
8063 ["Move Row Down" org-metadown :active (org-at-table-p) :keys "M-<down>"] 8183 ["Move Row Down" org-metadown :active (org-at-table-p) :keys "M-<down>"]
8064 ["Delete Row" org-shiftmetaup :active (org-at-table-p) :keys "M-S-<up>"] 8184 ["Delete Row" org-shiftmetaup :active (org-at-table-p) :keys "M-S-<up>"]
8065 ["Insert Row" org-shiftmetadown :active (org-at-table-p) :keys "M-S-<down>"] 8185 ["Insert Row" org-shiftmetadown :active (org-at-table-p) :keys "M-S-<down>"]
8186 ["Sort lines in region" org-table-sort-lines (org-at-table-p) :keys "C-c ^"]
8066 "--" 8187 "--"
8067 ["Insert Hline" org-table-insert-hline :active (org-at-table-p) :keys "C-c -"]) 8188 ["Insert Hline" org-table-insert-hline :active (org-at-table-p) :keys "C-c -"])
8068 ("Rectangle" 8189 ("Rectangle"
@@ -8838,7 +8959,8 @@ headlines. The default is 3. Lower levels will become bulleted lists."
8838 (setq-default org-todo-line-regexp org-todo-line-regexp) 8959 (setq-default org-todo-line-regexp org-todo-line-regexp)
8839 (setq-default org-deadline-line-regexp org-deadline-line-regexp) 8960 (setq-default org-deadline-line-regexp org-deadline-line-regexp)
8840 (setq-default org-done-string org-done-string) 8961 (setq-default org-done-string org-done-string)
8841 (let* ((region-p (org-region-active-p)) 8962 (let* ((style org-export-html-style)
8963 (region-p (org-region-active-p))
8842 (region 8964 (region
8843 (buffer-substring 8965 (buffer-substring
8844 (if region-p (region-beginning) (point-min)) 8966 (if region-p (region-beginning) (point-min))
@@ -8859,6 +8981,10 @@ headlines. The default is 3. Lower levels will become bulleted lists."
8859 (options nil) 8981 (options nil)
8860 (quote-re (concat "^\\*+[ \t]*" org-quote-string "\\>")) 8982 (quote-re (concat "^\\*+[ \t]*" org-quote-string "\\>"))
8861 (inquote nil) 8983 (inquote nil)
8984 (infixed nil)
8985 (in-local-list nil)
8986 (local-list-num nil)
8987 (local-list-indent nil)
8862 (email user-mail-address) 8988 (email user-mail-address)
8863 (language org-export-default-language) 8989 (language org-export-default-language)
8864 (text nil) 8990 (text nil)
@@ -8875,6 +9001,7 @@ headlines. The default is 3. Lower levels will become bulleted lists."
8875 (coding-system-get coding-system 'mime-charset))) 9001 (coding-system-get coding-system 'mime-charset)))
8876 table-open type 9002 table-open type
8877 table-buffer table-orig-buffer 9003 table-buffer table-orig-buffer
9004 ind start-is-num starter
8878 ) 9005 )
8879 (message "Exporting...") 9006 (message "Exporting...")
8880 9007
@@ -8899,16 +9026,19 @@ headlines. The default is 3. Lower levels will become bulleted lists."
8899 9026
8900 ;; File header 9027 ;; File header
8901 (insert (format 9028 (insert (format
8902 "<html lang=\"%s\"><head> 9029 "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\"
9030 \"http://www.w3.org/TR/REC-html40/loose.dtd\">
9031<html lang=\"%s\"><head>
8903<title>%s</title> 9032<title>%s</title>
8904<meta http-equiv=\"Content-Type\" content=\"text/html;charset=%s\"> 9033<meta http-equiv=\"Content-Type\" content=\"text/html;charset=%s\">
8905<meta name=generator content=\"Org-mode\"> 9034<meta name=generator content=\"Org-mode\">
8906<meta name=generated content=\"%s %s\"> 9035<meta name=generated content=\"%s %s\">
8907<meta name=author content=\"%s\"> 9036<meta name=author content=\"%s\">
9037%s
8908</head><body> 9038</head><body>
8909" 9039"
8910 language (org-html-expand title) (or charset "iso-8859-1") 9040 language (org-html-expand title) (or charset "iso-8859-1")
8911 date time author)) 9041 date time author style))
8912 (if title (insert (concat "<H1 align=\"center\">" 9042 (if title (insert (concat "<H1 align=\"center\">"
8913 (org-html-expand title) "</H1>\n"))) 9043 (org-html-expand title) "</H1>\n")))
8914 (if author (insert (concat (nth 1 lang-words) ": " author "\n"))) 9044 (if author (insert (concat (nth 1 lang-words) ": " author "\n")))
@@ -8959,8 +9089,8 @@ headlines. The default is 3. Lower levels will become bulleted lists."
8959 (insert 9089 (insert
8960 (format 9090 (format
8961 (if todo 9091 (if todo
8962 "<li><a href=\"#sec-%d\"><span style='color:red'>%s</span></a></li>\n" 9092 "<li><a href=\"#sec-%d\"><span style='color:red'>%s</span></a>\n"
8963 "<li><a href=\"#sec-%d\">%s</a></li>\n") 9093 "<li><a href=\"#sec-%d\">%s</a>\n")
8964 head-count txt)) 9094 head-count txt))
8965 (setq org-last-level level)) 9095 (setq org-last-level level))
8966 )))) 9096 ))))
@@ -8973,15 +9103,30 @@ headlines. The default is 3. Lower levels will become bulleted lists."
8973 (org-init-section-numbers) 9103 (org-init-section-numbers)
8974 9104
8975 (while (setq line (pop lines) origline line) 9105 (while (setq line (pop lines) origline line)
8976 ;; end of quote? 9106 (catch 'nextline
8977 (when (and inquote (string-match "^\\*+" line)) 9107
8978 (insert "</pre>\n") 9108 ;; end of quote section?
8979 (setq inquote nil)) 9109 (when (and inquote (string-match "^\\*+" line))
8980 ;; inquote 9110 (insert "</pre>\n")
8981 (if inquote 9111 (setq inquote nil))
8982 (progn 9112 ;; inside a quote section?
8983 (insert line "\n") 9113 (when inquote
8984 (setq line (org-html-expand line))) ;;????? FIXME: not needed? 9114 (insert (org-html-protect line) "\n")
9115 (throw 'nextline nil))
9116
9117 ;; verbatim lines
9118 (when (and org-export-with-fixed-width
9119 (string-match "^[ \t]*:\\(.*\\)" line))
9120 (when (not infixed)
9121 (setq infixed t)
9122 (insert "<pre>\n"))
9123 (insert (org-html-protect (match-string 1 line)) "\n")
9124 (when (and lines
9125 (not (string-match "^[ \t]+\\(:.*\\)"
9126 (car lines))))
9127 (setq infixed nil)
9128 (insert "</pre>\n"))
9129 (throw 'nextline nil))
8985 9130
8986 ;; Protect the links 9131 ;; Protect the links
8987 (setq start 0) 9132 (setq start 0)
@@ -8991,121 +9136,145 @@ headlines. The default is 3. Lower levels will become bulleted lists."
8991 (concat "\000" (match-string 1 line) "\000") 9136 (concat "\000" (match-string 1 line) "\000")
8992 t t line))) 9137 t t line)))
8993 9138
8994 ;; replace "<" and ">" by "&lt;" and "&gt;" 9139 ;; replace "&" by "&amp;", "<" and ">" by "&lt;" and "&gt;"
8995 ;; handle @<..> HTML tags (replace "@&gt;..&lt;" by "<..>") 9140 ;; handle @<..> HTML tags (replace "@&gt;..&lt;" by "<..>")
8996 (setq line (org-html-expand line)) 9141 (setq line (org-html-expand line))
8997 9142
8998 ;; Verbatim lines 9143 ;; Format the links
8999 (if (and org-export-with-fixed-width 9144 (setq start 0)
9000 (string-match "^[ \t]*:\\(.*\\)" line)) 9145 (while (string-match org-protected-link-regexp line start)
9001 (progn 9146 (setq start (- (match-end 0) 2))
9002 (let ((l (match-string 1 line))) 9147 (setq type (match-string 1 line))
9003 (while (string-match " " l) 9148 (cond
9004 (setq l (replace-match "&nbsp;" t t l))) 9149 ((member type '("http" "https" "ftp" "mailto" "news"))
9005 (insert "\n<span style='font-family:Courier'>" 9150 ;; standard URL
9006 l "</span>" 9151 (setq line (replace-match
9007 (if (and lines
9008 (not (string-match "^[ \t]+\\(:.*\\)"
9009 (car lines))))
9010 "<br>\n" "\n"))))
9011
9012 (setq start 0)
9013 (while (string-match org-protected-link-regexp line start)
9014 (setq start (- (match-end 0) 2))
9015 (setq type (match-string 1 line))
9016 (cond
9017 ((member type '("http" "https" "ftp" "mailto" "news"))
9018 ;; standard URL
9019 (setq line (replace-match
9020 ; "<a href=\"\\1:\\2\">&lt;\\1:\\2&gt;</a>" 9152 ; "<a href=\"\\1:\\2\">&lt;\\1:\\2&gt;</a>"
9021 "<a href=\"\\1:\\2\">\\1:\\2</a>" 9153 "<a href=\"\\1:\\2\">\\1:\\2</a>"
9022 nil nil line))) 9154 nil nil line)))
9023 ((string= type "file") 9155 ((string= type "file")
9024 ;; FILE link 9156 ;; FILE link
9025 (let* ((filename (match-string 2 line)) 9157 (let* ((filename (match-string 2 line))
9026 (abs-p (file-name-absolute-p filename)) 9158 (abs-p (file-name-absolute-p filename))
9027 (thefile (if abs-p (expand-file-name filename) filename)) 9159 (thefile (if abs-p (expand-file-name filename) filename))
9028 (thefile (save-match-data 9160 (thefile (save-match-data
9029 (if (string-match ":[0-9]+$" thefile) 9161 (if (string-match ":[0-9]+$" thefile)
9030 (replace-match "" t t thefile) 9162 (replace-match "" t t thefile)
9031 thefile))) 9163 thefile)))
9032 (file-is-image-p 9164 (file-is-image-p
9033 (save-match-data 9165 (save-match-data
9034 (string-match (org-image-file-name-regexp) thefile)))) 9166 (string-match (org-image-file-name-regexp) thefile))))
9167 (setq line (replace-match
9168 (if (and org-export-html-inline-images
9169 file-is-image-p)
9170 (concat "<img src=\"" thefile "\"/>")
9171 (concat "<a href=\"" thefile "\">\\1:\\2</a>"))
9172 nil nil line))))
9173
9174 ((member type '("bbdb" "vm" "wl" "rmail" "gnus" "shell"))
9175 (setq line (replace-match
9176 "<i>&lt;\\1:\\2&gt;</i>" nil nil line)))))
9177
9178 ;; TODO items
9179 (if (and (string-match org-todo-line-regexp line)
9180 (match-beginning 2))
9181 (if (equal (match-string 2 line) org-done-string)
9035 (setq line (replace-match 9182 (setq line (replace-match
9036 (if (and org-export-html-inline-images 9183 "<span style='color:green'>\\2</span>"
9037 file-is-image-p) 9184 nil nil line 2))
9038 (concat "<img src=\"" thefile "\"/>") 9185 (setq line (replace-match "<span style='color:red'>\\2</span>"
9039 (concat "<a href=\"" thefile "\">\\1:\\2</a>")) 9186 nil nil line 2))))
9040 nil nil line))))
9041 9187
9042 ((member type '("bbdb" "vm" "wl" "rmail" "gnus" "shell")) 9188 ;; DEADLINES
9043 (setq line (replace-match 9189 (if (string-match org-deadline-line-regexp line)
9044 "<i>&lt;\\1:\\2&gt;</i>" nil nil line))))) 9190 (progn
9045 9191 (if (save-match-data
9046 ;; TODO items 9192 (string-match "<a href"
9047 (if (and (string-match org-todo-line-regexp line) 9193 (substring line 0 (match-beginning 0))))
9048 (match-beginning 2)) 9194 nil ; Don't do the replacement - it is inside a link
9049 (if (equal (match-string 2 line) org-done-string) 9195 (setq line (replace-match "<span style='color:red'>\\&</span>"
9050 (setq line (replace-match 9196 nil nil line 1)))))
9051 "<span style='color:green'>\\2</span>"
9052 nil nil line 2))
9053 (setq line (replace-match "<span style='color:red'>\\2</span>"
9054 nil nil line 2))))
9055
9056 ;; DEADLINES
9057 (if (string-match org-deadline-line-regexp line)
9058 (progn
9059 (if (save-match-data
9060 (string-match "<a href"
9061 (substring line 0 (match-beginning 0))))
9062 nil ; Don't do the replacement - it is inside a link
9063 (setq line (replace-match "<span style='color:red'>\\&</span>"
9064 nil nil line 1)))))
9065 9197
9198 (cond
9199 ((string-match "^\\(\\*+\\)[ \t]*\\(.*\\)" line)
9200 ;; This is a headline
9201 (setq level (- (match-end 1) (match-beginning 1))
9202 txt (match-string 2 line))
9203 (if (<= level umax) (setq head-count (+ head-count 1)))
9204 (when in-local-list
9205 ;; Close any local lists before inserting a new header line
9206 (while local-list-num
9207 (insert (if (car local-list-num) "</ol>\n" "</ul>"))
9208 (pop local-list-num))
9209 (setq local-list-indent nil
9210 in-local-list nil))
9211 (org-html-level-start level txt umax
9212 (and org-export-with-toc (<= level umax))
9213 head-count)
9214 ;; QUOTES
9215 (when (string-match quote-re line)
9216 (insert "<pre>")
9217 (setq inquote t)))
9218
9219 ((and org-export-with-tables
9220 (string-match "^\\([ \t]*\\)\\(|\\|\\+-+\\+\\)" line))
9221 (if (not table-open)
9222 ;; New table starts
9223 (setq table-open t table-buffer nil table-orig-buffer nil))
9224 ;; Accumulate lines
9225 (setq table-buffer (cons line table-buffer)
9226 table-orig-buffer (cons origline table-orig-buffer))
9227 (when (or (not lines)
9228 (not (string-match "^\\([ \t]*\\)\\(|\\|\\+-+\\+\\)"
9229 (car lines))))
9230 (setq table-open nil
9231 table-buffer (nreverse table-buffer)
9232 table-orig-buffer (nreverse table-orig-buffer))
9233 (insert (org-format-table-html table-buffer table-orig-buffer))))
9234 (t
9235 ;; Normal lines
9236 (when (and (> org-export-local-list-max-depth 0)
9237 (string-match
9238 "^\\( *\\)\\(\\([-+*]\\)\\|\\([0-9]+\\.\\)\\)? *\\([^ \t\n\r]\\)"
9239 line))
9240 (setq ind (- (match-end 1) (match-beginning 1))
9241 start-is-num (match-beginning 4)
9242 starter (if (match-beginning 2) (match-string 2 line)))
9243 (while (and in-local-list
9244 (or (and (= ind (car local-list-indent))
9245 (not starter))
9246 (< ind (car local-list-indent))))
9247 (insert (if (car local-list-num) "</ol>\n" "</ul>"))
9248 (pop local-list-num) (pop local-list-indent)
9249 (setq in-local-list local-list-indent))
9066 9250
9067 (cond 9251 (cond
9068 ((string-match "^\\(\\*+\\)[ \t]*\\(.*\\)" line) 9252 ((and starter
9069 ;; This is a headline 9253 (or (not in-local-list)
9070 (setq level (- (match-end 1) (match-beginning 1)) 9254 (> ind (car local-list-indent)))
9071 txt (match-string 2 line)) 9255 (< (length local-list-indent)
9072 (if (<= level umax) (setq head-count (+ head-count 1))) 9256 org-export-local-list-max-depth))
9073 (org-html-level-start level txt umax 9257 ;; Start new (level of ) list
9074 (and org-export-with-toc (<= level umax)) 9258 (insert (if start-is-num "<ol>\n<li>\n" "<ul>\n<li>\n"))
9075 head-count) 9259 (push start-is-num local-list-num)
9076 ;; QUOTES 9260 (push ind local-list-indent)
9077 (when (string-match quote-re line) 9261 (setq in-local-list t))
9078 (insert "<pre>") 9262 (starter
9079 (setq inquote t))) 9263 ;; continue current list
9080 9264 (insert "<li>\n")))
9081 ((and org-export-with-tables 9265 (setq line (substring line (match-beginning 5))))
9082 (string-match "^\\([ \t]*\\)\\(|\\|\\+-+\\+\\)" line)) 9266 ;; Empty lines start a new paragraph. If hand-formatted lists
9083 (if (not table-open) 9267 ;; are not fully interpreted, lines starting with "-", "+", "*"
9084 ;; New table starts 9268 ;; also start a new paragraph.
9085 (setq table-open t table-buffer nil table-orig-buffer nil)) 9269 (if (string-match "^ [-+*]-\\|^[ \t]*$" line) (insert "<p>"))
9086 ;; Accumulate lines 9270 (insert line (if org-export-preserve-breaks "<br>\n" "\n"))))
9087 (setq table-buffer (cons line table-buffer) 9271 ))
9088 table-orig-buffer (cons origline table-orig-buffer)) 9272 (if org-export-html-with-timestamp
9089 (when (or (not lines) 9273 (insert org-export-html-html-helper-timestamp))
9090 (not (string-match "^\\([ \t]*\\)\\(|\\|\\+-+\\+\\)" 9274 (insert "</body>\n</html>\n")
9091 (car lines)))) 9275 (normal-mode)
9092 (setq table-open nil 9276 (save-buffer)
9093 table-buffer (nreverse table-buffer) 9277 (goto-char (point-min)))))
9094 table-orig-buffer (nreverse table-orig-buffer))
9095 (insert (org-format-table-html table-buffer table-orig-buffer))))
9096 (t
9097 ;; Normal lines
9098 ;; Lines starting with "-", and empty lines make new paragraph.
9099 ;; FIXME: Should we add + and *?
9100 (if (string-match "^ *-\\|^[ \t]*$" line) (insert "<p>"))
9101 (insert line (if org-export-preserve-breaks "<br>\n" "\n"))))
9102 )))
9103 (if org-export-html-with-timestamp
9104 (insert org-export-html-html-helper-timestamp))
9105 (insert "</body>\n</html>\n")
9106 (normal-mode)
9107 (save-buffer)
9108 (goto-char (point-min)))))
9109 9278
9110(defun org-format-table-html (lines olines) 9279(defun org-format-table-html (lines olines)
9111 "Find out which HTML converter to use and return the HTML code." 9280 "Find out which HTML converter to use and return the HTML code."
@@ -9235,18 +9404,28 @@ But it has the disadvantage, that Org-mode's HTML conversions cannot be used."
9235 (set-buffer " org-tmp2 ") 9404 (set-buffer " org-tmp2 ")
9236 (buffer-substring (point-min) (point-max)))) 9405 (buffer-substring (point-min) (point-max))))
9237 9406
9407(defun org-html-protect (s)
9408 ;; convert & to &amp;, < to &lt; and > to &gt;
9409 (let ((start 0))
9410 (while (string-match "&" s start)
9411 (setq s (replace-match "&amp;" t t s)
9412 start (1+ (match-beginning 0))))
9413 (while (string-match "<" s)
9414 (setq s (replace-match "&lt;" t t s)))
9415 (while (string-match ">" s)
9416 (setq s (replace-match "&gt;" t t s))))
9417 s)
9418
9238(defun org-html-expand (string) 9419(defun org-html-expand (string)
9239 "Prepare STRING for HTML export. Applies all active conversions." 9420 "Prepare STRING for HTML export. Applies all active conversions."
9240 ;; First check if there is a link in the line - if yes, apply conversions 9421 ;; First check if there is a link in the line - if yes, apply conversions
9241 ;; only before the start of the link. 9422 ;; only before the start of the link.
9423 ;; FIXME: This is no longer correct, because links now have an end.
9242 (let* ((m (string-match org-link-regexp string)) 9424 (let* ((m (string-match org-link-regexp string))
9243 (s (if m (substring string 0 m) string)) 9425 (s (if m (substring string 0 m) string))
9244 (r (if m (substring string m) ""))) 9426 (r (if m (substring string m) "")))
9245 ;; convert < to &lt; and > to &gt; 9427 ;; convert & to &amp;, < to &lt; and > to &gt;
9246 (while (string-match "<" s) 9428 (setq s (org-html-protect s))
9247 (setq s (replace-match "&lt;" t t s)))
9248 (while (string-match ">" s)
9249 (setq s (replace-match "&gt;" t t s)))
9250 (if org-export-html-expand 9429 (if org-export-html-expand
9251 (while (string-match "@&lt;\\([^&]*\\)&gt;" s) 9430 (while (string-match "@&lt;\\([^&]*\\)&gt;" s)
9252 (setq s (replace-match "<\\1>" nil nil s)))) 9431 (setq s (replace-match "<\\1>" nil nil s))))
@@ -9446,9 +9625,6 @@ When LEVEL is non-nil, increase section numbers on that level."
9446 string)) 9625 string))
9447 9626
9448 9627
9449
9450
9451
9452(defun org-export-icalendar-this-file () 9628(defun org-export-icalendar-this-file ()
9453 "Export current file as an iCalendar file. 9629 "Export current file as an iCalendar file.
9454The iCalendar file will be located in the same directory as the Org-mode 9630The iCalendar file will be located in the same directory as the Org-mode
@@ -9496,7 +9672,7 @@ file and store it under the name `org-combined-agenda-icalendar-file'."
9496 (let ((standard-output ical-buffer)) 9672 (let ((standard-output ical-buffer))
9497 (if combine 9673 (if combine
9498 (and (not started) (setq started t) 9674 (and (not started) (setq started t)
9499 (org-start-icalendar-file "OrgMode")) 9675 (org-start-icalendar-file org-icalendar-combined-name))
9500 (org-start-icalendar-file category)) 9676 (org-start-icalendar-file category))
9501 (org-print-icalendar-entries combine category) 9677 (org-print-icalendar-entries combine category)
9502 (when (or (and combine (not files)) (not combine)) 9678 (when (or (and combine (not files)) (not combine))
@@ -9540,7 +9716,7 @@ When COMBINE is non nil, add the category to each line."
9540 donep (org-entry-is-done-p))) 9716 donep (org-entry-is-done-p)))
9541 (if (or (string-match org-tr-regexp hd) 9717 (if (or (string-match org-tr-regexp hd)
9542 (string-match org-ts-regexp hd)) 9718 (string-match org-ts-regexp hd))
9543 (setq hd (replace-match "" t t hd))) 9719 (setq hd (replace-match "" t t hd)))
9544 (if combine 9720 (if combine
9545 (setq hd (concat hd " (category " category ")"))) 9721 (setq hd (concat hd " (category " category ")")))
9546 (if deadlinep (setq hd (concat "DL: " hd " This is a deadline"))) 9722 (if deadlinep (setq hd (concat "DL: " hd " This is a deadline")))
@@ -9693,10 +9869,12 @@ a time), or the day by one (if it does not contain a time)."
9693(define-key org-mode-map "\C-c\C-y" 'org-evaluate-time-range) 9869(define-key org-mode-map "\C-c\C-y" 'org-evaluate-time-range)
9694(define-key org-mode-map "\C-c>" 'org-goto-calendar) 9870(define-key org-mode-map "\C-c>" 'org-goto-calendar)
9695(define-key org-mode-map "\C-c<" 'org-date-from-calendar) 9871(define-key org-mode-map "\C-c<" 'org-date-from-calendar)
9696(define-key org-mode-map "\C-c[" 'org-add-file) 9872(define-key org-mode-map [(control ?,)] 'org-cycle-agenda-files)
9873(define-key org-mode-map "\C-c[" 'org-agenda-file-to-front)
9697(define-key org-mode-map "\C-c]" 'org-remove-file) 9874(define-key org-mode-map "\C-c]" 'org-remove-file)
9698(define-key org-mode-map "\C-c\C-r" 'org-timeline) 9875(define-key org-mode-map "\C-c\C-r" 'org-timeline)
9699(define-key org-mode-map "\C-c-" 'org-table-insert-hline) 9876(define-key org-mode-map "\C-c-" 'org-table-insert-hline)
9877(define-key org-mode-map "\C-c^" 'org-table-sort-lines)
9700(define-key org-mode-map "\C-c\C-c" 'org-ctrl-c-ctrl-c) 9878(define-key org-mode-map "\C-c\C-c" 'org-ctrl-c-ctrl-c)
9701(define-key org-mode-map "\C-m" 'org-return) 9879(define-key org-mode-map "\C-m" 'org-return)
9702(define-key org-mode-map "\C-c?" 'org-table-current-column) 9880(define-key org-mode-map "\C-c?" 'org-table-current-column)
@@ -9807,7 +9985,7 @@ COMMANDS is a list of alternating OLDDEF NEWDEF command names."
9807 (if (fboundp 'command-remapping) 9985 (if (fboundp 'command-remapping)
9808 (define-key map (vector 'remap old) new) 9986 (define-key map (vector 'remap old) new)
9809 (substitute-key-definition old new map global-map))))) 9987 (substitute-key-definition old new map global-map)))))
9810 9988
9811(when (eq org-enable-table-editor 'optimized) 9989(when (eq org-enable-table-editor 'optimized)
9812 ;; If the user wants maximum table support, we need to hijack 9990 ;; If the user wants maximum table support, we need to hijack
9813 ;; some standard editing functions 9991 ;; some standard editing functions
@@ -10044,6 +10222,7 @@ See the individual commands for more information."
10044 ["Move Row Down" org-metadown (org-at-table-p)] 10222 ["Move Row Down" org-metadown (org-at-table-p)]
10045 ["Delete Row" org-shiftmetaup (org-at-table-p)] 10223 ["Delete Row" org-shiftmetaup (org-at-table-p)]
10046 ["Insert Row" org-shiftmetadown (org-at-table-p)] 10224 ["Insert Row" org-shiftmetadown (org-at-table-p)]
10225 ["Sort lines in region" org-table-sort-lines (org-at-table-p)]
10047 "--" 10226 "--"
10048 ["Insert Hline" org-table-insert-hline (org-at-table-p)]) 10227 ["Insert Hline" org-table-insert-hline (org-at-table-p)])
10049 ("Rectangle" 10228 ("Rectangle"
@@ -10185,8 +10364,9 @@ With optional NODE, go directly to that node."
10185 (append 10364 (append
10186 (list 10365 (list
10187 ["Edit File List" (customize-variable 'org-agenda-files) t] 10366 ["Edit File List" (customize-variable 'org-agenda-files) t]
10188 ["Add Current File to List" org-add-file t] 10367 ["Add/Move Current File to Front of List" org-agenda-file-to-front t]
10189 ["Remove Current File from List" org-remove-file t] 10368 ["Remove Current File from List" org-remove-file t]
10369 ["Cycle through agenda files" org-cycle-agenda-files t]
10190 "--") 10370 "--")
10191 (mapcar 'org-file-menu-entry org-agenda-files)))) 10371 (mapcar 'org-file-menu-entry org-agenda-files))))
10192 10372
@@ -10243,6 +10423,58 @@ With optional NODE, go directly to that node."
10243 (goto-char pos) 10423 (goto-char pos)
10244 (move-to-column col))) 10424 (move-to-column col)))
10245 10425
10426;; Paragraph filling stuff.
10427;; We want this to be just right, so use the full arsenal.
10428;; FIXME: This very likely does not work correctly for XEmacs, because the
10429;; filladapt package works slightly differently.
10430
10431(defun org-set-autofill-regexps ()
10432 (interactive)
10433 ;; In the paragraph separator we include headlines, because filling
10434 ;; text in a line directly attached to a headline would otherwise
10435 ;; fill the headline as well.
10436 (set (make-local-variable 'paragraph-separate) "\f\\|\\*\\|[ ]*$\\|[ \t]*[:|]")
10437 ;; The paragraph starter includes hand-formatted lists.
10438 (set (make-local-variable 'paragraph-start)
10439 "\f\\|[ ]*$\\|\\([*\f]+\\)\\|[ \t]*\\([-+*]\\|[0-9]+\\.[ \t]+\\)\\|[ \t]*[:|]")
10440 ;; Inhibit auto-fill for headers, tables and fixed-width lines.
10441 ;; But only if the user has not turned off tables or fixed-width regions
10442 (set (make-local-variable 'auto-fill-inhibit-regexp)
10443 (concat "\\*\\|#"
10444 (if (or org-enable-table-editor org-enable-fixed-width-editor)
10445 (concat
10446 "\\|[ \t]*["
10447 (if org-enable-table-editor "|" "")
10448 (if org-enable-fixed-width-editor ":" "")
10449 "]"))))
10450 ;; We use our own fill-paragraph function, to make sure that tables
10451 ;; and fixed-width regions are not wrapped. That function will pass
10452 ;; through to `fill-paragraph' when appropriate.
10453 (set (make-local-variable 'fill-paragraph-function) 'org-fill-paragraph)
10454 ;; Adaptive filling: To get full control, first make sure that
10455 ;; `adaptive-fill-regexp' never matches. Then install our won matcher.
10456 (setq adaptive-fill-regexp "\000")
10457 (setq adaptive-fill-function 'org-adaptive-fill-function))
10458
10459(defun org-fill-paragraph (&optional justify)
10460 "Re-align a table, pass through to fill-paragraph if no table."
10461 (let ((table-p (org-at-table-p))
10462 (table.el-p (org-at-table.el-p)))
10463 (cond ((equal (char-after (point-at-bol)) ?*) t) ; skip headlines
10464 (table.el-p t) ; skip table.el tables
10465 (table-p (org-table-align) t) ; align org-mode tables
10466 (t nil)))) ; call paragraph-fill
10467
10468;; For reference, this is the default value of adaptive-fill-regexp
10469;; "[ \t]*\\([-|#;>*]+[ \t]*\\|(?[0-9]+[.)][ \t]*\\)*"
10470
10471(defun org-adaptive-fill-function ()
10472 "Return a fill prefix for org-mode files.
10473In particular, this makes sure hanging paragraphs for hand-formatted lists
10474work correctly."
10475 (if (looking-at " *\\([-*+] \\|[0-9]+\\. \\)?")
10476 (make-string (- (match-end 0) (match-beginning 0)) ?\ )))
10477
10246;; Functions needed for Emacs/XEmacs region compatibility 10478;; Functions needed for Emacs/XEmacs region compatibility
10247 10479
10248(defun org-region-active-p () 10480(defun org-region-active-p ()
@@ -10474,3 +10706,4 @@ Show the heading too, if it is currently invisible."
10474 10706
10475;; arch-tag: e77da1a7-acc7-4336-b19e-efa25af3f9fd 10707;; arch-tag: e77da1a7-acc7-4336-b19e-efa25af3f9fd
10476;;; org.el ends here 10708;;; org.el ends here
10709
diff --git a/lisp/url/ChangeLog b/lisp/url/ChangeLog
index e0a68349ce1..9a8c8955fc5 100644
--- a/lisp/url/ChangeLog
+++ b/lisp/url/ChangeLog
@@ -1,3 +1,10 @@
12005-11-18 Stefan Monnier <monnier@iro.umontreal.ca>
2
3 * url-http.el: Use with-current-buffer.
4 (url-http-target-url): Rename from url-http-cookies-sources.
5 (url-http-parse-headers): Use it.
6 (url-http-handle-authentication): Use subst-char-in-string.
7
12005-11-16 Juergen Hoetzel <emacs@hoetzel.info> (tiny change) 82005-11-16 Juergen Hoetzel <emacs@hoetzel.info> (tiny change)
2 9
3 * url-handlers.el (url-insert-file-contents): Use the charset info 10 * url-handlers.el (url-insert-file-contents): Use the charset info
diff --git a/lisp/url/url-http.el b/lisp/url/url-http.el
index 39db321c080..725f4bc1c8a 100644
--- a/lisp/url/url-http.el
+++ b/lisp/url/url-http.el
@@ -26,10 +26,9 @@
26 26
27;;; Code: 27;;; Code:
28 28
29(eval-when-compile 29(eval-when-compile (require 'cl))
30 (require 'cl) 30(defvar url-http-extra-headers)
31 (defvar url-http-extra-headers) 31(defvar url-http-target-url)
32 (defvar url-http-cookies-sources))
33(require 'url-gw) 32(require 'url-gw)
34(require 'url-util) 33(require 'url-util)
35(require 'url-parse) 34(require 'url-parse)
@@ -320,16 +319,9 @@ This allows us to use `mail-fetch-field', etc."
320 " authentication. If you'd like to write it," 319 " authentication. If you'd like to write it,"
321 " send it to " url-bug-address ".<hr>") 320 " send it to " url-bug-address ".<hr>")
322 (setq status t)) 321 (setq status t))
323 (let* ((args auth) 322 (let* ((args (url-parse-args (subst-char-in-string ?, ?\; auth)))
324 (ctr (1- (length args))) 323 (auth (url-get-authentication url (cdr-safe (assoc "realm" args))
325 auth) 324 type t args)))
326 (while (/= 0 ctr)
327 (if (char-equal ?, (aref args ctr))
328 (aset args ctr ?\;))
329 (setq ctr (1- ctr)))
330 (setq args (url-parse-args args)
331 auth (url-get-authentication url (cdr-safe (assoc "realm" args))
332 type t args))
333 (if (not auth) 325 (if (not auth)
334 (setq success t) 326 (setq success t)
335 (push (cons (if proxy "Proxy-Authorization" "Authorization") auth) 327 (push (cons (if proxy "Proxy-Authorization" "Authorization") auth)
@@ -358,7 +350,7 @@ The buffer must already be narrowed to the headers, so mail-fetch-field will
358work correctly." 350work correctly."
359 (let ((cookies (mail-fetch-field "Set-Cookie" nil nil t)) 351 (let ((cookies (mail-fetch-field "Set-Cookie" nil nil t))
360 (cookies2 (mail-fetch-field "Set-Cookie2" nil nil t)) 352 (cookies2 (mail-fetch-field "Set-Cookie2" nil nil t))
361 (url-current-object url-http-cookies-sources)) 353 (url-current-object url-http-target-url))
362 (and cookies (url-http-debug "Found %d Set-Cookie headers" (length cookies))) 354 (and cookies (url-http-debug "Found %d Set-Cookie headers" (length cookies)))
363 (and cookies2 (url-http-debug "Found %d Set-Cookie2 headers" (length cookies2))) 355 (and cookies2 (url-http-debug "Found %d Set-Cookie2 headers" (length cookies2)))
364 (while cookies 356 (while cookies
@@ -510,8 +502,11 @@ should be shown to the user."
510 ;; non-fully-qualified URL (ie: /), which royally confuses 502 ;; non-fully-qualified URL (ie: /), which royally confuses
511 ;; the URL library. 503 ;; the URL library.
512 (if (not (string-match url-nonrelative-link redirect-uri)) 504 (if (not (string-match url-nonrelative-link redirect-uri))
513 (setq redirect-uri (url-expand-file-name redirect-uri))) 505 ;; Be careful to use the real target URL, otherwise we may
514 (let ((url-request-method url-http-method) 506 ;; compute the redirection relative to the URL of the proxy.
507 (setq redirect-uri
508 (url-expand-file-name redirect-uri url-http-target-url)))
509 (let ((url-request-method url-http-method)
515 (url-request-data url-http-data) 510 (url-request-data url-http-data)
516 (url-request-extra-headers url-http-extra-headers)) 511 (url-request-extra-headers url-http-extra-headers))
517 (url-retrieve redirect-uri url-callback-function 512 (url-retrieve redirect-uri url-callback-function
@@ -727,8 +722,7 @@ should be shown to the user."
727 (url-http-debug "url-http-end-of-document-sentinel in buffer (%s)" 722 (url-http-debug "url-http-end-of-document-sentinel in buffer (%s)"
728 (process-buffer proc)) 723 (process-buffer proc))
729 (url-http-idle-sentinel proc why) 724 (url-http-idle-sentinel proc why)
730 (save-excursion 725 (with-current-buffer (process-buffer proc)
731 (set-buffer (process-buffer proc))
732 (goto-char (point-min)) 726 (goto-char (point-min))
733 (if (not (looking-at "HTTP/")) 727 (if (not (looking-at "HTTP/"))
734 ;; HTTP/0.9 just gets passed back no matter what 728 ;; HTTP/0.9 just gets passed back no matter what
@@ -1039,8 +1033,7 @@ CBARGS as the arguments."
1039 (setq buffer nil) 1033 (setq buffer nil)
1040 (error "Could not create connection to %s:%d" (url-host url) 1034 (error "Could not create connection to %s:%d" (url-host url)
1041 (url-port url))) 1035 (url-port url)))
1042 (save-excursion 1036 (with-current-buffer buffer
1043 (set-buffer buffer)
1044 (mm-disable-multibyte) 1037 (mm-disable-multibyte)
1045 (setq url-current-object url 1038 (setq url-current-object url
1046 mode-line-format "%b [%s]") 1039 mode-line-format "%b [%s]")
@@ -1060,7 +1053,7 @@ CBARGS as the arguments."
1060 url-http-method 1053 url-http-method
1061 url-http-extra-headers 1054 url-http-extra-headers
1062 url-http-data 1055 url-http-data
1063 url-http-cookies-sources)) 1056 url-http-target-url))
1064 (set (make-local-variable var) nil)) 1057 (set (make-local-variable var) nil))
1065 1058
1066 (setq url-http-method (or url-request-method "GET") 1059 (setq url-http-method (or url-request-method "GET")
@@ -1073,9 +1066,9 @@ CBARGS as the arguments."
1073 url-callback-function callback 1066 url-callback-function callback
1074 url-callback-arguments cbargs 1067 url-callback-arguments cbargs
1075 url-http-after-change-function 'url-http-wait-for-headers-change-function 1068 url-http-after-change-function 'url-http-wait-for-headers-change-function
1076 url-http-cookies-sources (if (boundp 'proxy-object) 1069 url-http-target-url (if (boundp 'proxy-object)
1077 proxy-object 1070 proxy-object
1078 url-current-object)) 1071 url-current-object))
1079 1072
1080 (set-process-buffer connection buffer) 1073 (set-process-buffer connection buffer)
1081 (set-process-sentinel connection 'url-http-end-of-document-sentinel) 1074 (set-process-sentinel connection 'url-http-end-of-document-sentinel)
@@ -1096,8 +1089,7 @@ CBARGS as the arguments."
1096 (declare (special url-http-after-change-function)) 1089 (declare (special url-http-after-change-function))
1097 (and (process-buffer proc) 1090 (and (process-buffer proc)
1098 (/= (length data) 0) 1091 (/= (length data) 0)
1099 (save-excursion 1092 (with-current-buffer (process-buffer proc)
1100 (set-buffer (process-buffer proc))
1101 (url-http-debug "Calling after change function `%s' for `%S'" url-http-after-change-function proc) 1093 (url-http-debug "Calling after change function `%s' for `%S'" url-http-after-change-function proc)
1102 (funcall url-http-after-change-function 1094 (funcall url-http-after-change-function
1103 (point-max) 1095 (point-max)
@@ -1114,8 +1106,7 @@ CBARGS as the arguments."
1114 (defun url-http-symbol-value-in-buffer (symbol buffer 1106 (defun url-http-symbol-value-in-buffer (symbol buffer
1115 &optional unbound-value) 1107 &optional unbound-value)
1116 "Return the value of SYMBOL in BUFFER, or UNBOUND-VALUE if it is unbound." 1108 "Return the value of SYMBOL in BUFFER, or UNBOUND-VALUE if it is unbound."
1117 (save-excursion 1109 (with-current-buffer buffer
1118 (set-buffer buffer)
1119 (if (not (boundp symbol)) 1110 (if (not (boundp symbol))
1120 unbound-value 1111 unbound-value
1121 (symbol-value symbol)))) 1112 (symbol-value symbol))))
@@ -1198,10 +1189,9 @@ p3p
1198 (when (and buffer (= 2 (/ (url-http-symbol-value-in-buffer 1189 (when (and buffer (= 2 (/ (url-http-symbol-value-in-buffer
1199 'url-http-response-status buffer 0) 100))) 1190 'url-http-response-status buffer 0) 100)))
1200 ;; Only parse the options if we got a 2xx response code! 1191 ;; Only parse the options if we got a 2xx response code!
1201 (save-excursion 1192 (with-current-buffer buffer
1202 (save-restriction 1193 (save-restriction
1203 (save-match-data 1194 (save-match-data
1204 (set-buffer buffer)
1205 (mail-narrow-to-head) 1195 (mail-narrow-to-head)
1206 1196
1207 ;; Figure out what methods are supported. 1197 ;; Figure out what methods are supported.
diff --git a/lisp/widget.el b/lisp/widget.el
index 1985efb7cd6..f99429b5910 100644
--- a/lisp/widget.el
+++ b/lisp/widget.el
@@ -71,6 +71,7 @@
71;; :button-face-get :button-face :value-face :keymap :entry-from 71;; :button-face-get :button-face :value-face :keymap :entry-from
72;; :entry-to :help-echo :documentation-property :tab-order) 72;; :entry-to :help-echo :documentation-property :tab-order)
73 73
74(put 'define-widget 'doc-string-elt 3) ;`declare' doesn't work in functions.
74(defun define-widget (name class doc &rest args) 75(defun define-widget (name class doc &rest args)
75 "Define a new widget type named NAME from CLASS. 76 "Define a new widget type named NAME from CLASS.
76 77
@@ -85,7 +86,6 @@ create identical widgets:
85* (apply 'widget-create CLASS ARGS) 86* (apply 'widget-create CLASS ARGS)
86 87
87The third argument DOC is a documentation string for the widget." 88The third argument DOC is a documentation string for the widget."
88 (declare (doc-string 3))
89 (put name 'widget-type (cons class args)) 89 (put name 'widget-type (cons class args))
90 (put name 'widget-documentation doc) 90 (put name 'widget-documentation doc)
91 name) 91 name)