aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorKenichi Handa2012-03-19 13:17:50 +0900
committerKenichi Handa2012-03-19 13:17:50 +0900
commit4ebb358f29e64094871ad6d35fb365d77c17047d (patch)
treecfc5c5055207bd4e5995a12ca292d16939a9efdb /lisp
parent4827f94e1725c34d4b19d79f4c74f16a0dc3b0cb (diff)
parente50a24a249e1bfd69af7e48ea5076cac78bf7224 (diff)
downloademacs-4ebb358f29e64094871ad6d35fb365d77c17047d.tar.gz
emacs-4ebb358f29e64094871ad6d35fb365d77c17047d.zip
merge trunk
Diffstat (limited to 'lisp')
-rw-r--r--lisp/ChangeLog156
-rw-r--r--lisp/calendar/calendar.el28
-rw-r--r--lisp/calendar/icalendar.el4
-rw-r--r--lisp/cedet/ChangeLog7
-rw-r--r--lisp/cedet/semantic/db-find.el6
-rw-r--r--lisp/comint.el49
-rw-r--r--lisp/dabbrev.el156
-rw-r--r--lisp/emacs-lisp/copyright.el2
-rw-r--r--lisp/emacs-lisp/ring.el33
-rw-r--r--lisp/emulation/ws-mode.el2
-rw-r--r--lisp/faces.el7
-rw-r--r--lisp/font-lock.el2
-rw-r--r--lisp/gnus/ChangeLog24
-rw-r--r--lisp/gnus/gnus-int.el2
-rw-r--r--lisp/gnus/gnus-msg.el1
-rw-r--r--lisp/gnus/gnus-sum.el4
-rw-r--r--lisp/gnus/shr.el48
-rw-r--r--lisp/htmlfontify.el159
-rw-r--r--lisp/imenu.el18
-rw-r--r--lisp/mail/sendmail.el7
-rw-r--r--lisp/net/mairix.el2
-rw-r--r--lisp/net/rcirc.el18
-rw-r--r--lisp/progmodes/cc-engine.el61
-rw-r--r--lisp/progmodes/cc-mode.el4
-rw-r--r--lisp/progmodes/gdb-mi.el16
-rw-r--r--lisp/progmodes/perl-mode.el6
-rw-r--r--lisp/simple.el12
-rw-r--r--lisp/sort.el2
-rw-r--r--lisp/subr.el20
-rw-r--r--lisp/tar-mode.el3
-rw-r--r--lisp/textmodes/ispell.el90
-rw-r--r--lisp/url/ChangeLog5
-rw-r--r--lisp/url/url-queue.el17
-rw-r--r--lisp/vc/vc-hg.el47
-rw-r--r--lisp/view.el18
35 files changed, 707 insertions, 329 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index f9e7eac9123..a6f5a5fd525 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,159 @@
12012-03-18 Chong Yidong <cyd@gnu.org>
2
3 * faces.el (face-spec-reset-face): Don't call display-graphic-p if
4 it is not yet defined (for temacs).
5
62012-03-18 Leo Liu <sdl.web@gmail.com>
7
8 * net/rcirc.el (rcirc-cmd-quit): Allow quiting all servers with
9 prefix.
10
112012-03-17 Eli Zaretskii <eliz@gnu.org>
12
13 * textmodes/ispell.el (ispell-skip-tib, ispell-keep-choices-win)
14 (ispell-choices-win-default-height, ispell-silently-savep)
15 (ispell-dictionary-alist, ispell-encoding8-command)
16 (ispell-check-version, ispell-aspell-find-dictionary)
17 (ispell-valid-dictionary-list, ispell-words-keyword)
18 (ispell-get-word, ispell-internal-change-dictionary)
19 (ispell-region, ispell-skip-region-list)
20 (ispell-begin-skip-region-regexp, ispell-ignore-fcc)
21 (ispell-process-line, ispell-minor-mode, ispell-minor-check)
22 (ispell-message-text-end, ispell-message)
23 (ispell-buffer-local-parsing): Doc fix.
24
252012-03-13 Jambunathan K <kjambunathan@gmail.com>
26
27 * htmlfontify.el: Add support for code block fontification for ODT
28 export (Bug #9914).
29 (hfy-optimisations): Define new option
30 `body-text-only'
31 (hfy-fontify-buffer): Honor above setting.
32 (hfy-begin-span, hfy-end-span): New routines factored out form
33 `hfy-fontify-buffer'.
34 (hfy-begin-span-handler, hfy-end-span-handler): New variables
35 that permit insertion of custom tags.
36 (hfy-fontify-buffer): Use above handlers.
37 (hfy-face-to-css-default): Same as the earlier `hfy-face-to-css'.
38 (hfy-face-to-css): Re-defined to be a variable.
39 (hfy-compile-stylesheet): Modified. Allow stylesheet to be built
40 over multiple runs. This is made possible by having the caller let
41 bind a special variable `hfy-user-sheet-assoc'.
42 (htmlfontify-string): New defun.
43 (hfy-compile-face-map): Make sure that the last char in the
44 buffer is correctly fontified.
45 (hfy-face-resolve-face): Whitespace only change.
46
472012-03-17 Eli Zaretskii <eliz@gnu.org>
48
49 * textmodes/ispell.el (ispell-get-decoded-string): Make the error
50 message more clear.
51
522012-03-16 Leo Liu <sdl.web@gmail.com>
53
54 * emacs-lisp/copyright.el (copyright-year-ranges): Fix typo.
55
562012-03-16 Alan Mackenzie <acm@muc.de>
57
58 Further optimise the handling of large macros.
59
60 * progmodes/cc-engine.el (c-crosses-statement-barrier-p): Use a
61 limit to a call of `c-literal-limits'.
62 (c-determine-+ve-limit): New function.
63 (c-at-macro-vsemi-p): Move `c-in-literal' to the bottom of an
64 `and'.
65 (c-guess-basic-syntax): In macros, restrict a search limit to
66 2000.
67 In CASE 5B, restrict a search limit to 500.
68 (c-just-after-func-arglist-p): Obviouly wrong `or' -> `and'.
69
70 * progmodes/cc-mode.el (c-neutralize-syntax-in-and-mark-CPP):
71 Restrict macro bounds to +-500 from after-change's BEG END.
72
732012-03-16 Leo Liu <sdl.web@gmail.com>
74
75 * font-lock.el (lisp-font-lock-keywords-2): Add letrec.
76
772012-03-16 Aaron S. Hawley <Aaron.S.Hawley@gmail.com>
78
79 * tar-mode.el (tar-mode): Fix saving by conditionally undoing
80 `special-mode' setting of `buffer-read-only'. (Bug#11010)
81
822012-03-16 Glenn Morris <rgm@gnu.org>
83
84 * view.el (view-buffer, view-buffer-other-window)
85 (view-buffer-other-frame): Doc fixes re special mode-class.
86
87 * subr.el (eval-after-load): If named feature is provided not from
88 a file, run after-load forms. (Bug#10946)
89
90 * calendar/calendar.el (calendar-insert-at-column):
91 Handle non-unit-width characters a bit better. (Bug#10978)
92
932012-03-15 Chong Yidong <cyd@gnu.org>
94
95 * emacs-lisp/ring.el (ring-extend): New function.
96 (ring-insert+extend): Extend the ring correctly (Bug#11019).
97
98 * comint.el (comint-read-input-ring)
99 (comint-add-to-input-history): Grow comint-input-ring lazily.
100
1012012-03-15 Stefan Monnier <monnier@iro.umontreal.ca>
102
103 * progmodes/perl-mode.el (perl-syntax-propertize-special-constructs):
104 Fix up parsing of multiline twoarg non-paired elements (bug#11014).
105
106 * imenu.el: Fix multiple inheritance breakage (bug#9199).
107 (imenu-add-to-menubar): Don't add a redundant index.
108 (imenu-update-menubar): Handle a dynamically composed keymap.
109
1102012-03-13 Katsumi Yamaoka <yamaoka@jpl.org>
111
112 * mail/sendmail.el (mail-encode-header):
113 Bind rfc2047-encode-encoded-words to nil.
114
1152012-03-13 Glenn Morris <rgm@gnu.org>
116
117 * calendar/calendar.el (calendar-string-spread):
118 Handle non-unit-width characters a bit better. (Bug#10978)
119
1202012-03-13 Leo Liu <sdl.web@gmail.com>
121
122 * vc/vc-hg.el (vc-hg-working-revision): Rework to work with both
123 directory and file as argument (Bug#10822).
124
1252012-03-13 Kaushik Srenevasan <ksrenevasan@gmail.com> (tiny change)
126
127 * progmodes/gdb-mi.el (gdb-invalidate-disassembly):
128 For dynamically generated code, follow $PC.
129 (gdb-disassembly-handler-custom): Handle no function name case.
130
1312012-03-13 Tim Landscheidt <tim@tim-landscheidt.de> (tiny change)
132
133 * calendar/icalendar.el (icalendar-export-file, icalendar-import-file):
134 * emulation/ws-mode.el (ws-query-replace):
135 * sort.el (sort-regexp-fields):
136 Fix missing trailing whitespace in interactive prompts. (Bug#11002)
137
1382012-03-12 Stefan Monnier <monnier@iro.umontreal.ca>
139
140 * dabbrev.el: Fix cycle completion order (bug#10963).
141 (dabbrev--last-obarray, dabbrev--last-completion-buffer): Remove.
142 (dabbrev-completion): Don't use an obarray; provide
143 a cycle-sort-function.
144
1452012-03-12 Leo Liu <sdl.web@gmail.com>
146
147 * simple.el (kill-new): Use equal-including-properties for
148 comparison.
149 (kill-do-not-save-duplicates): Doc fix.
150
1512012-03-12 Stefan Monnier <monnier@iro.umontreal.ca>
152
153 * dabbrev.el: Fix cycle completion (bug#10963).
154 Use lexical binding and wrap to 80 columns.
155 (dabbrev-completion): Delay computing the list of completions.
156
12012-03-12 Kenichi Handa <handa@m17n.org> 1572012-03-12 Kenichi Handa <handa@m17n.org>
2 158
3 * international/quail.el (quail-insert-kbd-layout): Surround each 159 * international/quail.el (quail-insert-kbd-layout): Surround each
diff --git a/lisp/calendar/calendar.el b/lisp/calendar/calendar.el
index 0c351c6072f..d9ec27b4f88 100644
--- a/lisp/calendar/calendar.el
+++ b/lisp/calendar/calendar.el
@@ -1424,16 +1424,24 @@ Optional integers MON and YR are used instead of today's date."
1424 "Move to column INDENT, adding spaces as needed. 1424 "Move to column INDENT, adding spaces as needed.
1425Inserts STRING so that it ends at INDENT. STRING is either a 1425Inserts STRING so that it ends at INDENT. STRING is either a
1426literal string, or a sexp to evaluate to return such. Truncates 1426literal string, or a sexp to evaluate to return such. Truncates
1427STRING to length TRUNCATE, ensure a trailing space." 1427STRING to length TRUNCATE, and ensures a trailing space."
1428 (if (not (ignore-errors (stringp (setq string (eval string))))) 1428 (if (not (ignore-errors (stringp (setq string (eval string)))))
1429 (calendar-move-to-column indent) 1429 (calendar-move-to-column indent)
1430 (if (> (length string) truncate) 1430 (if (> (string-width string) truncate)
1431 (setq string (substring string 0 truncate))) 1431 (setq string (truncate-string-to-width string truncate)))
1432 (or (string-match " $" string) 1432 (or (string-match " $" string)
1433 (if (= (length string) truncate) 1433 (setq string (concat (if (= (string-width string) truncate)
1434 (aset string (1- truncate) ?\s) 1434 (substring string 0 -1)
1435 (setq string (concat string " ")))) 1435 string)
1436 (calendar-move-to-column (- indent (length string))) 1436 ;; Avoid inserting text properties unless
1437 ;; we have to (ie, non-unit-width chars).
1438 ;; This is by no means essential.
1439 (if (= (string-width string) (length string))
1440 " "
1441 ;; Cribbed from buff-menu.el.
1442 (propertize
1443 " " 'display `(space :align-to ,indent))))))
1444 (calendar-move-to-column (- indent (string-width string)))
1437 (insert string))) 1445 (insert string)))
1438 1446
1439(defun calendar-generate-month (month year indent) 1447(defun calendar-generate-month (month year indent)
@@ -1756,8 +1764,8 @@ the STRINGS are just concatenated and the result truncated."
1756 (if (< (length strings) 2) 1764 (if (< (length strings) 2)
1757 (append (list "") strings (list "")) 1765 (append (list "") strings (list ""))
1758 strings))) 1766 strings)))
1759 (n (- length (length (apply 'concat strings)))) 1767 (n (- length (string-width (apply 'concat strings))))
1760 (m (1- (length strings))) 1768 (m (* (1- (length strings)) (char-width char)))
1761 (s (car strings)) 1769 (s (car strings))
1762 (strings (cdr strings)) 1770 (strings (cdr strings))
1763 (i 0)) 1771 (i 0))
@@ -1766,7 +1774,7 @@ the STRINGS are just concatenated and the result truncated."
1766 (make-string (max 0 (/ (+ n i) m)) char) 1774 (make-string (max 0 (/ (+ n i) m)) char)
1767 string) 1775 string)
1768 i (1+ i))) 1776 i (1+ i)))
1769 (substring s 0 length))) 1777 (truncate-string-to-width s length)))
1770 1778
1771(defun calendar-update-mode-line () 1779(defun calendar-update-mode-line ()
1772 "Update the calendar mode line with the current date and date style." 1780 "Update the calendar mode line with the current date and date style."
diff --git a/lisp/calendar/icalendar.el b/lisp/calendar/icalendar.el
index 83bda94fefe..f1549ec20b1 100644
--- a/lisp/calendar/icalendar.el
+++ b/lisp/calendar/icalendar.el
@@ -915,7 +915,7 @@ would be \"pm\"."
915 "Export diary file to iCalendar format. 915 "Export diary file to iCalendar format.
916All diary entries in the file DIARY-FILENAME are converted to iCalendar 916All diary entries in the file DIARY-FILENAME are converted to iCalendar
917format. The result is appended to the file ICAL-FILENAME." 917format. The result is appended to the file ICAL-FILENAME."
918 (interactive "FExport diary data from file: 918 (interactive "FExport diary data from file: \n\
919Finto iCalendar file: ") 919Finto iCalendar file: ")
920 (save-current-buffer 920 (save-current-buffer
921 (set-buffer (find-file diary-filename)) 921 (set-buffer (find-file diary-filename))
@@ -1794,7 +1794,7 @@ Argument ICAL-FILENAME output iCalendar file.
1794Argument DIARY-FILENAME input `diary-file'. 1794Argument DIARY-FILENAME input `diary-file'.
1795Optional argument NON-MARKING determines whether events are created as 1795Optional argument NON-MARKING determines whether events are created as
1796non-marking or not." 1796non-marking or not."
1797 (interactive "fImport iCalendar data from file: 1797 (interactive "fImport iCalendar data from file: \n\
1798Finto diary file: 1798Finto diary file:
1799p") 1799p")
1800 ;; clean up the diary file 1800 ;; clean up the diary file
diff --git a/lisp/cedet/ChangeLog b/lisp/cedet/ChangeLog
index ec7fdcecca0..f185c457ee2 100644
--- a/lisp/cedet/ChangeLog
+++ b/lisp/cedet/ChangeLog
@@ -1,3 +1,10 @@
12012-03-12 David Engster <deng@randomsample.de>
2
3 * semantic/db-find.el
4 (semanticdb-find-translate-path-brutish-default): If we don't yet
5 have a proper table for PATH, use `semanticdb-current-database'
6 instead (bug #10343).
7
12012-03-11 David Engster <deng@randomsample.de> 82012-03-11 David Engster <deng@randomsample.de>
2 9
3 * semantic/wisent/javascript.el (js-mode): Define `js-mode' as 10 * semantic/wisent/javascript.el (js-mode): Define `js-mode' as
diff --git a/lisp/cedet/semantic/db-find.el b/lisp/cedet/semantic/db-find.el
index ca6a8fbf5ca..15ef3b09238 100644
--- a/lisp/cedet/semantic/db-find.el
+++ b/lisp/cedet/semantic/db-find.el
@@ -325,8 +325,10 @@ Default action as described in `semanticdb-find-translate-path'."
325 (cond ((null path) semanticdb-current-database) 325 (cond ((null path) semanticdb-current-database)
326 ((semanticdb-table-p path) (oref path parent-db)) 326 ((semanticdb-table-p path) (oref path parent-db))
327 (t (let ((tt (semantic-something-to-tag-table path))) 327 (t (let ((tt (semantic-something-to-tag-table path)))
328 ;; @todo - What does this DO ??!?! 328 (if tt
329 (with-current-buffer (semantic-tag-buffer (car tt)) 329 ;; @todo - What does this DO ??!?!
330 (with-current-buffer (semantic-tag-buffer (car tt))
331 semanticdb-current-database)
330 semanticdb-current-database)))))) 332 semanticdb-current-database))))))
331 (apply 333 (apply
332 #'nconc 334 #'nconc
diff --git a/lisp/comint.el b/lisp/comint.el
index 4c2229f2f83..9306bf8dbb2 100644
--- a/lisp/comint.el
+++ b/lisp/comint.el
@@ -922,15 +922,18 @@ See also `comint-input-ignoredups' and `comint-write-input-ring'."
922 (t 922 (t
923 (let* ((file comint-input-ring-file-name) 923 (let* ((file comint-input-ring-file-name)
924 (count 0) 924 (count 0)
925 (size comint-input-ring-size) 925 ;; Some users set HISTSIZE or `comint-input-ring-size'
926 (ring (make-ring size))) 926 ;; to huge numbers. Don't allocate a huge ring right
927 ;; away; there might not be that much history.
928 (ring-size (min 1500 comint-input-ring-size))
929 (ring (make-ring ring-size)))
927 (with-temp-buffer 930 (with-temp-buffer
928 (insert-file-contents file) 931 (insert-file-contents file)
929 ;; Save restriction in case file is already visited... 932 ;; Save restriction in case file is already visited...
930 ;; Watch for those date stamps in history files! 933 ;; Watch for those date stamps in history files!
931 (goto-char (point-max)) 934 (goto-char (point-max))
932 (let (start end history) 935 (let (start end history)
933 (while (and (< count size) 936 (while (and (< count comint-input-ring-size)
934 (re-search-backward comint-input-ring-separator 937 (re-search-backward comint-input-ring-separator
935 nil t) 938 nil t)
936 (setq end (match-beginning 0))) 939 (setq end (match-beginning 0)))
@@ -941,15 +944,18 @@ See also `comint-input-ignoredups' and `comint-write-input-ring'."
941 (point-min))) 944 (point-min)))
942 (setq history (buffer-substring start end)) 945 (setq history (buffer-substring start end))
943 (goto-char start) 946 (goto-char start)
944 (if (and (not (string-match comint-input-history-ignore 947 (when (and (not (string-match comint-input-history-ignore
945 history)) 948 history))
946 (or (null comint-input-ignoredups) 949 (or (null comint-input-ignoredups)
947 (ring-empty-p ring) 950 (ring-empty-p ring)
948 (not (string-equal (ring-ref ring 0) 951 (not (string-equal (ring-ref ring 0)
949 history)))) 952 history))))
950 (progn 953 (when (= count ring-size)
951 (ring-insert-at-beginning ring history) 954 (ring-extend ring (min (- comint-input-ring-size ring-size)
952 (setq count (1+ count))))))) 955 ring-size))
956 (setq ring-size (ring-size ring)))
957 (ring-insert-at-beginning ring history)
958 (setq count (1+ count))))))
953 (setq comint-input-ring ring 959 (setq comint-input-ring ring
954 comint-input-ring-index nil))))) 960 comint-input-ring-index nil)))))
955 961
@@ -1691,13 +1697,18 @@ Argument 0 is the command name."
1691(defun comint-add-to-input-history (cmd) 1697(defun comint-add-to-input-history (cmd)
1692 "Add CMD to the input history. 1698 "Add CMD to the input history.
1693Ignore duplicates if `comint-input-ignoredups' is non-nil." 1699Ignore duplicates if `comint-input-ignoredups' is non-nil."
1694 (if (and (funcall comint-input-filter cmd) 1700 (when (and (funcall comint-input-filter cmd)
1695 (or (null comint-input-ignoredups) 1701 (or (null comint-input-ignoredups)
1696 (not (ring-p comint-input-ring)) 1702 (not (ring-p comint-input-ring))
1697 (ring-empty-p comint-input-ring) 1703 (ring-empty-p comint-input-ring)
1698 (not (string-equal (ring-ref comint-input-ring 0) 1704 (not (string-equal (ring-ref comint-input-ring 0) cmd))))
1699 cmd)))) 1705 ;; If `comint-input-ring' is full, maybe grow it.
1700 (ring-insert comint-input-ring cmd))) 1706 (let ((size (ring-size comint-input-ring)))
1707 (and (= size (ring-length comint-input-ring))
1708 (< size comint-input-ring-size)
1709 (ring-extend comint-input-ring
1710 (min size (- comint-input-ring-size size)))))
1711 (ring-insert comint-input-ring cmd)))
1701 1712
1702(defun comint-send-input (&optional no-newline artificial) 1713(defun comint-send-input (&optional no-newline artificial)
1703 "Send input to process. 1714 "Send input to process.
diff --git a/lisp/dabbrev.el b/lisp/dabbrev.el
index aad3c83c32b..c5b370bfa61 100644
--- a/lisp/dabbrev.el
+++ b/lisp/dabbrev.el
@@ -1,4 +1,4 @@
1;;; dabbrev.el --- dynamic abbreviation package 1;;; dabbrev.el --- dynamic abbreviation package -*- lexical-binding: t -*-
2 2
3;; Copyright (C) 1985-1986, 1992, 1994, 1996-1997, 2000-2012 3;; Copyright (C) 1985-1986, 1992, 1994, 1996-1997, 2000-2012
4;; Free Software Foundation, Inc. 4;; Free Software Foundation, Inc.
@@ -291,9 +291,6 @@ this list."
291;; Internal variables 291;; Internal variables
292;;---------------------------------------------------------------- 292;;----------------------------------------------------------------
293 293
294;; Last obarray of completions in `dabbrev-completion'
295(defvar dabbrev--last-obarray nil)
296
297;; Table of expansions seen so far 294;; Table of expansions seen so far
298(defvar dabbrev--last-table nil) 295(defvar dabbrev--last-table nil)
299 296
@@ -321,9 +318,6 @@ this list."
321;; The buffer we found the expansion last time. 318;; The buffer we found the expansion last time.
322(defvar dabbrev--last-buffer-found nil) 319(defvar dabbrev--last-buffer-found nil)
323 320
324;; The buffer we last did a completion in.
325(defvar dabbrev--last-completion-buffer nil)
326
327;; If non-nil, a function to use when copying successive words. 321;; If non-nil, a function to use when copying successive words.
328;; It should be `upcase' or `downcase'. 322;; It should be `upcase' or `downcase'.
329(defvar dabbrev--last-case-pattern nil) 323(defvar dabbrev--last-case-pattern nil)
@@ -387,49 +381,46 @@ then it searches *all* buffers."
387 (abbrev (dabbrev--abbrev-at-point)) 381 (abbrev (dabbrev--abbrev-at-point))
388 (beg (progn (search-backward abbrev) (point))) 382 (beg (progn (search-backward abbrev) (point)))
389 (end (progn (search-forward abbrev) (point))) 383 (end (progn (search-forward abbrev) (point)))
390 (ignore-case-p (and (if (eq dabbrev-case-fold-search 'case-fold-search) 384 (ignore-case-p
391 case-fold-search 385 (and (if (eq dabbrev-case-fold-search 'case-fold-search)
392 dabbrev-case-fold-search) 386 case-fold-search
393 (or (not dabbrev-upcase-means-case-search) 387 dabbrev-case-fold-search)
394 (string= abbrev (downcase abbrev))))) 388 (or (not dabbrev-upcase-means-case-search)
395 (my-obarray dabbrev--last-obarray)) 389 (string= abbrev (downcase abbrev)))))
396 (save-excursion 390 (list 'uninitialized)
397 ;;-------------------------------- 391 (table
398 ;; New abbreviation to expand. 392 (lambda (s p a)
399 ;;-------------------------------- 393 (if (eq a 'metadata)
400 (setq dabbrev--last-abbreviation abbrev) 394 `(metadata (cycle-sort-function . ,#'identity)
401 ;; Find all expansion 395 (category . dabbrev))
402 (let ((completion-list 396 (when (eq list 'uninitialized)
403 (dabbrev--find-all-expansions abbrev ignore-case-p)) 397 (save-excursion
404 (completion-ignore-case ignore-case-p)) 398 ;;--------------------------------
405 ;; Make an obarray with all expansions 399 ;; New abbreviation to expand.
406 (setq my-obarray (make-vector (length completion-list) 0)) 400 ;;--------------------------------
407 (or (> (length my-obarray) 0) 401 (setq dabbrev--last-abbreviation abbrev)
408 (error "No dynamic expansion for \"%s\" found%s" 402 ;; Find all expansion
409 abbrev 403 (let ((completion-list
410 (if dabbrev--check-other-buffers "" " in this-buffer"))) 404 (dabbrev--find-all-expansions abbrev ignore-case-p))
411 (cond 405 (completion-ignore-case ignore-case-p))
412 ((or (not ignore-case-p) 406 (or (consp completion-list)
413 (not dabbrev-case-replace)) 407 (error "No dynamic expansion for \"%s\" found%s"
414 (mapc (function (lambda (string) 408 abbrev
415 (intern string my-obarray))) 409 (if dabbrev--check-other-buffers
416 completion-list)) 410 "" " in this-buffer")))
417 ((string= abbrev (upcase abbrev)) 411 (setq list
418 (mapc (function (lambda (string) 412 (cond
419 (intern (upcase string) my-obarray))) 413 ((not (and ignore-case-p dabbrev-case-replace))
420 completion-list)) 414 completion-list)
421 ((string= (substring abbrev 0 1) 415 ((string= abbrev (upcase abbrev))
422 (upcase (substring abbrev 0 1))) 416 (mapcar #'upcase completion-list))
423 (mapc (function (lambda (string) 417 ((string= (substring abbrev 0 1)
424 (intern (capitalize string) my-obarray))) 418 (upcase (substring abbrev 0 1)))
425 completion-list)) 419 (mapcar #'capitalize completion-list))
426 (t 420 (t
427 (mapc (function (lambda (string) 421 (mapcar #'downcase completion-list)))))))
428 (intern (downcase string) my-obarray))) 422 (complete-with-action a list s p)))))
429 completion-list))) 423 (completion-in-region beg end table)))
430 (setq dabbrev--last-obarray my-obarray)
431 (setq dabbrev--last-completion-buffer (current-buffer))))
432 (completion-in-region beg end my-obarray)))
433 424
434;;;###autoload 425;;;###autoload
435(defun dabbrev-expand (arg) 426(defun dabbrev-expand (arg)
@@ -521,12 +512,13 @@ See also `dabbrev-abbrev-char-regexp' and \\[dabbrev-completion]."
521 ;;-------------------------------- 512 ;;--------------------------------
522 (or expansion 513 (or expansion
523 (setq expansion 514 (setq expansion
524 (dabbrev--find-expansion abbrev direction 515 (dabbrev--find-expansion
525 (and (if (eq dabbrev-case-fold-search 'case-fold-search) 516 abbrev direction
526 case-fold-search 517 (and (if (eq dabbrev-case-fold-search 'case-fold-search)
527 dabbrev-case-fold-search) 518 case-fold-search
528 (or (not dabbrev-upcase-means-case-search) 519 dabbrev-case-fold-search)
529 (string= abbrev (downcase abbrev)))))))) 520 (or (not dabbrev-upcase-means-case-search)
521 (string= abbrev (downcase abbrev))))))))
530 (cond 522 (cond
531 ((not expansion) 523 ((not expansion)
532 (dabbrev--reset-global-variables) 524 (dabbrev--reset-global-variables)
@@ -621,8 +613,6 @@ all skip characters."
621 613
622(defun dabbrev--reset-global-variables () 614(defun dabbrev--reset-global-variables ()
623 "Initialize all global variables." 615 "Initialize all global variables."
624 ;; dabbrev--last-obarray and dabbrev--last-completion-buffer
625 ;; must not be reset here.
626 (setq dabbrev--last-table nil 616 (setq dabbrev--last-table nil
627 dabbrev--last-abbreviation nil 617 dabbrev--last-abbreviation nil
628 dabbrev--last-abbrev-location nil 618 dabbrev--last-abbrev-location nil
@@ -667,13 +657,13 @@ of the expansion in `dabbrev--last-expansion-location'."
667 (let ((case-fold-search ignore-case) 657 (let ((case-fold-search ignore-case)
668 (count n)) 658 (count n))
669 (while (and (> count 0) 659 (while (and (> count 0)
670 (setq expansion (dabbrev--search abbrev 660 (setq expansion (dabbrev--search
671 reverse 661 abbrev reverse
672 (and ignore-case 662 (and ignore-case
673 (if (eq dabbrev-case-distinction 'case-replace) 663 (if (eq dabbrev-case-distinction
674 case-replace 664 'case-replace)
675 dabbrev-case-distinction)) 665 case-replace
676 ))) 666 dabbrev-case-distinction)))))
677 (setq count (1- count)))) 667 (setq count (1- count))))
678 (and expansion 668 (and expansion
679 (setq dabbrev--last-expansion-location (point))) 669 (setq dabbrev--last-expansion-location (point)))
@@ -829,14 +819,15 @@ EXPANSION is the expansion substring to be used this time.
829RECORD-CASE-PATTERN, if non-nil, means set `dabbrev--last-case-pattern' 819RECORD-CASE-PATTERN, if non-nil, means set `dabbrev--last-case-pattern'
830to record whether we upcased the expansion, downcased it, or did neither." 820to record whether we upcased the expansion, downcased it, or did neither."
831 ;;(undo-boundary) 821 ;;(undo-boundary)
832 (let ((use-case-replace (and (if (eq dabbrev-case-fold-search 'case-fold-search) 822 (let ((use-case-replace
833 case-fold-search 823 (and (if (eq dabbrev-case-fold-search 'case-fold-search)
834 dabbrev-case-fold-search) 824 case-fold-search
835 (or (not dabbrev-upcase-means-case-search) 825 dabbrev-case-fold-search)
836 (string= abbrev (downcase abbrev))) 826 (or (not dabbrev-upcase-means-case-search)
837 (if (eq dabbrev-case-replace 'case-replace) 827 (string= abbrev (downcase abbrev)))
838 case-replace 828 (if (eq dabbrev-case-replace 'case-replace)
839 dabbrev-case-replace)))) 829 case-replace
830 dabbrev-case-replace))))
840 831
841 ;; If we upcased or downcased the original expansion, 832 ;; If we upcased or downcased the original expansion,
842 ;; do likewise for the subsequent words when we copy them. 833 ;; do likewise for the subsequent words when we copy them.
@@ -862,12 +853,13 @@ to record whether we upcased the expansion, downcased it, or did neither."
862 (let ((expansion-rest (substring expansion 1)) 853 (let ((expansion-rest (substring expansion 1))
863 (first-letter-position (string-match "[[:alpha:]]" abbrev))) 854 (first-letter-position (string-match "[[:alpha:]]" abbrev)))
864 (if (or (null first-letter-position) 855 (if (or (null first-letter-position)
865 (and (not (and (or (string= expansion-rest (downcase expansion-rest)) 856 (and (not
866 (string= expansion-rest (upcase expansion-rest))) 857 (and (or (string= expansion-rest (downcase expansion-rest))
867 (or (string= abbrev (downcase abbrev)) 858 (string= expansion-rest (upcase expansion-rest)))
868 (and (string= abbrev (upcase abbrev)) 859 (or (string= abbrev (downcase abbrev))
869 (> (- (length abbrev) first-letter-position) 860 (and (string= abbrev (upcase abbrev))
870 1))))) 861 (> (- (length abbrev) first-letter-position)
862 1)))))
871 (string= abbrev 863 (string= abbrev
872 (substring expansion 0 (length abbrev))))) 864 (substring expansion 0 (length abbrev)))))
873 (setq use-case-replace nil))) 865 (setq use-case-replace nil)))
@@ -951,9 +943,9 @@ Leaves point at the location of the start of the expansion."
951 ;; Limited search. 943 ;; Limited search.
952 (save-restriction 944 (save-restriction
953 (and dabbrev-limit 945 (and dabbrev-limit
954 (narrow-to-region dabbrev--last-expansion-location 946 (narrow-to-region
955 (+ (point) 947 dabbrev--last-expansion-location
956 (if reverse (- dabbrev-limit) dabbrev-limit)))) 948 (+ (point) (if reverse (- dabbrev-limit) dabbrev-limit))))
957 ;;-------------------------------- 949 ;;--------------------------------
958 ;; Look for a distinct expansion, using dabbrev--last-table. 950 ;; Look for a distinct expansion, using dabbrev--last-table.
959 ;;-------------------------------- 951 ;;--------------------------------
diff --git a/lisp/emacs-lisp/copyright.el b/lisp/emacs-lisp/copyright.el
index a77998aa6d9..09b456b54ba 100644
--- a/lisp/emacs-lisp/copyright.el
+++ b/lisp/emacs-lisp/copyright.el
@@ -85,7 +85,7 @@ The second \\( \\) construct must match the years."
85 "Non-nil if individual consecutive years should be replaced with a range. 85 "Non-nil if individual consecutive years should be replaced with a range.
86For example: 2005, 2006, 2007, 2008 might be replaced with 2005-2008. 86For example: 2005, 2006, 2007, 2008 might be replaced with 2005-2008.
87If you use ranges, you should add an explanatory note in a README file. 87If you use ranges, you should add an explanatory note in a README file.
88The function `copyright-fix-year' respects this variable." 88The function `copyright-fix-years' respects this variable."
89 :group 'copyright 89 :group 'copyright
90 :type 'boolean 90 :type 'boolean
91 :version "24.1") 91 :version "24.1")
diff --git a/lisp/emacs-lisp/ring.el b/lisp/emacs-lisp/ring.el
index 4b07de523c3..cee6a43df86 100644
--- a/lisp/emacs-lisp/ring.el
+++ b/lisp/emacs-lisp/ring.el
@@ -185,26 +185,31 @@ Raise error if ITEM is not in the RING."
185 (unless curr-index (error "Item is not in the ring: `%s'" item)) 185 (unless curr-index (error "Item is not in the ring: `%s'" item))
186 (ring-ref ring (ring-minus1 curr-index (ring-length ring))))) 186 (ring-ref ring (ring-minus1 curr-index (ring-length ring)))))
187 187
188(defun ring-extend (ring x)
189 "Increase the size of RING by X."
190 (when (and (integerp x) (> x 0))
191 (let* ((hd (car ring))
192 (length (ring-length ring))
193 (size (ring-size ring))
194 (old-vec (cddr ring))
195 (new-vec (make-vector (+ size x) nil)))
196 (setcdr ring (cons length new-vec))
197 ;; If the ring is wrapped, the existing elements must be written
198 ;; out in the right order.
199 (dotimes (j length)
200 (aset new-vec j (aref old-vec (mod (+ hd j) size))))
201 (setcar ring 0))))
202
188(defun ring-insert+extend (ring item &optional grow-p) 203(defun ring-insert+extend (ring item &optional grow-p)
189 "Like `ring-insert', but if GROW-P is non-nil, then enlarge ring. 204 "Like `ring-insert', but if GROW-P is non-nil, then enlarge ring.
190Insert onto ring RING the item ITEM, as the newest (last) item. 205Insert onto ring RING the item ITEM, as the newest (last) item.
191If the ring is full, behavior depends on GROW-P: 206If the ring is full, behavior depends on GROW-P:
192 If GROW-P is non-nil, enlarge the ring to accommodate the new item. 207 If GROW-P is non-nil, enlarge the ring to accommodate the new item.
193 If GROW-P is nil, dump the oldest item to make room for the new." 208 If GROW-P is nil, dump the oldest item to make room for the new."
194 (let* ((vec (cddr ring)) 209 (and grow-p
195 (veclen (length vec)) 210 (= (ring-length ring) (ring-size ring))
196 (hd (car ring)) 211 (ring-extend ring 1))
197 (ringlen (ring-length ring))) 212 (ring-insert ring item))
198 (prog1
199 (cond ((and grow-p (= ringlen veclen)) ; Full ring. Enlarge it.
200 (setq veclen (1+ veclen))
201 (setcdr ring (cons (setq ringlen (1+ ringlen))
202 (setq vec (vconcat vec (vector item)))))
203 (setcar ring hd))
204 (t (aset vec (mod (+ hd ringlen) veclen) item)))
205 (if (= ringlen veclen)
206 (setcar ring (ring-plus1 hd veclen))
207 (setcar (cdr ring) (1+ ringlen))))))
208 213
209(defun ring-remove+insert+extend (ring item &optional grow-p) 214(defun ring-remove+insert+extend (ring item &optional grow-p)
210 "`ring-remove' ITEM from RING, then `ring-insert+extend' it. 215 "`ring-remove' ITEM from RING, then `ring-insert+extend' it.
diff --git a/lisp/emulation/ws-mode.el b/lisp/emulation/ws-mode.el
index aa8d647ec11..0c7be145751 100644
--- a/lisp/emulation/ws-mode.el
+++ b/lisp/emulation/ws-mode.el
@@ -716,7 +716,7 @@ This will only work for errors raised by WordStar mode functions."
716 716
717(defun ws-query-replace (from to) 717(defun ws-query-replace (from to)
718 "In WordStar mode: Search string, remember string for repetition." 718 "In WordStar mode: Search string, remember string for repetition."
719 (interactive "sReplace: 719 (interactive "sReplace: \n\
720sWith: " ) 720sWith: " )
721 (setq ws-search-string from) 721 (setq ws-search-string from)
722 (setq ws-search-direction t) 722 (setq ws-search-direction t)
diff --git a/lisp/faces.el b/lisp/faces.el
index 0011e0357a1..34fad66ce27 100644
--- a/lisp/faces.el
+++ b/lisp/faces.el
@@ -1516,12 +1516,15 @@ If SPEC is nil, return nil."
1516 (apply 'set-face-attribute face frame 1516 (apply 'set-face-attribute face frame
1517 (if (eq face 'default) 1517 (if (eq face 'default)
1518 ;; For the default face, avoid making any attribute 1518 ;; For the default face, avoid making any attribute
1519 ;; unspecifed. Instead, set attributes to default values 1519 ;; unspecified. Instead, set attributes to default values
1520 ;; (see also realize_default_face in xfaces.c). 1520 ;; (see also realize_default_face in xfaces.c).
1521 (append 1521 (append
1522 '(:underline nil :overline nil :strike-through nil 1522 '(:underline nil :overline nil :strike-through nil
1523 :box nil :inverse-video nil :stipple nil :inherit nil) 1523 :box nil :inverse-video nil :stipple nil :inherit nil)
1524 (unless (display-graphic-p frame) 1524 ;; `display-graphic-p' is unavailable when running
1525 ;; temacs, prior to loading frame.el.
1526 (unless (and (fboundp 'display-graphic-p)
1527 (display-graphic-p frame))
1525 '(:family "default" :foundry "default" :width normal 1528 '(:family "default" :foundry "default" :width normal
1526 :height 1 :weight normal :slant normal 1529 :height 1 :weight normal :slant normal
1527 :foreground "unspecified-fg" 1530 :foreground "unspecified-fg"
diff --git a/lisp/font-lock.el b/lisp/font-lock.el
index 4222791705b..b65828ca1d7 100644
--- a/lisp/font-lock.el
+++ b/lisp/font-lock.el
@@ -2284,7 +2284,7 @@ in which C preprocessor directives are used. e.g. `asm-mode' and
2284 `(;; Control structures. Emacs Lisp forms. 2284 `(;; Control structures. Emacs Lisp forms.
2285 (,(concat 2285 (,(concat
2286 "(" (regexp-opt 2286 "(" (regexp-opt
2287 '("cond" "if" "while" "while-no-input" "let" "let*" 2287 '("cond" "if" "while" "while-no-input" "let" "let*" "letrec"
2288 "prog" "progn" "progv" "prog1" "prog2" "prog*" 2288 "prog" "progn" "progv" "prog1" "prog2" "prog*"
2289 "inline" "lambda" "save-restriction" "save-excursion" 2289 "inline" "lambda" "save-restriction" "save-excursion"
2290 "save-selected-window" "save-window-excursion" 2290 "save-selected-window" "save-window-excursion"
diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog
index 092f42cd2ed..d0d35407367 100644
--- a/lisp/gnus/ChangeLog
+++ b/lisp/gnus/ChangeLog
@@ -1,3 +1,27 @@
12012-03-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
2
3 * gnus-sum.el (gnus-update-marks): Don't propagate marks unless
4 requested (bug#10961).
5
6 * shr.el (shr-table-widths): Divide the extra width more fairly over
7 the TDs (bug#10973).
8 (shr-render-td): Don't delete too much padding.
9 (shr-natural-width): Compute the natural width more correctly.
10 (shr-insert): Allow the natural width to be computed for tables again.
11 (shr-tag-table-1): Rework how the natural widths are computed by
12 rendering the table a third time.
13 (shr-natural-width): Removed.
14 (shr-buffer-width): New function.
15 (shr-expand-newlines): Use it.
16
17 * gnus-msg.el (gnus-bug): Don't delete the other windows. We may be
18 using a `gnus-use-full-window' setup (bug#11013).
19
202012-03-12 Lars Magne Ingebrigtsen <larsi@gnus.org>
21
22 * gnus-int.el (gnus-backend-trace): Flip default to nil before Emacs
23 24.1 release.
24
12012-03-10 David Edmondson <dme@dme.org> 252012-03-10 David Edmondson <dme@dme.org>
2 26
3 * mm-uu.el (mm-uu-forward-extract): Allow for blank lines between the 27 * mm-uu.el (mm-uu-forward-extract): Allow for blank lines between the
diff --git a/lisp/gnus/gnus-int.el b/lisp/gnus/gnus-int.el
index 8dc691ffe42..1190d79f778 100644
--- a/lisp/gnus/gnus-int.el
+++ b/lisp/gnus/gnus-int.el
@@ -247,7 +247,7 @@ If it is down, start it up (again)."
247 (eq (nth 1 (assoc method gnus-opened-servers)) 247 (eq (nth 1 (assoc method gnus-opened-servers))
248 'denied)) 248 'denied))
249 249
250(defvar gnus-backend-trace t) 250(defvar gnus-backend-trace nil)
251 251
252(defun gnus-open-server (gnus-command-method) 252(defun gnus-open-server (gnus-command-method)
253 "Open a connection to GNUS-COMMAND-METHOD." 253 "Open a connection to GNUS-COMMAND-METHOD."
diff --git a/lisp/gnus/gnus-msg.el b/lisp/gnus/gnus-msg.el
index 7c8d194f26b..500ace9e8ff 100644
--- a/lisp/gnus/gnus-msg.el
+++ b/lisp/gnus/gnus-msg.el
@@ -1453,7 +1453,6 @@ If YANK is non-nil, include the original article."
1453 (error "Gnus has been shut down")) 1453 (error "Gnus has been shut down"))
1454 (gnus-setup-message (if (message-mail-user-agent) 'message 'bug) 1454 (gnus-setup-message (if (message-mail-user-agent) 'message 'bug)
1455 (unless (message-mail-user-agent) 1455 (unless (message-mail-user-agent)
1456 (delete-other-windows)
1457 (when gnus-bug-create-help-buffer 1456 (when gnus-bug-create-help-buffer
1458 (switch-to-buffer "*Gnus Help Bug*") 1457 (switch-to-buffer "*Gnus Help Bug*")
1459 (erase-buffer) 1458 (erase-buffer)
diff --git a/lisp/gnus/gnus-sum.el b/lisp/gnus/gnus-sum.el
index 9770b8f9982..7f095e15496 100644
--- a/lisp/gnus/gnus-sum.el
+++ b/lisp/gnus/gnus-sum.el
@@ -6074,6 +6074,10 @@ If SELECT-ARTICLES, only select those articles from GROUP."
6074 6074
6075 (when (and (gnus-check-backend-function 6075 (when (and (gnus-check-backend-function
6076 'request-set-mark gnus-newsgroup-name) 6076 'request-set-mark gnus-newsgroup-name)
6077 (or gnus-propagate-marks
6078 (gnus-method-option-p
6079 (gnus-find-method-for-group gnus-newsgroup-name)
6080 'server-marks))
6077 (not (gnus-article-unpropagatable-p (cdr type)))) 6081 (not (gnus-article-unpropagatable-p (cdr type))))
6078 (let* ((old (cdr (assq (cdr type) (gnus-info-marks info)))) 6082 (let* ((old (cdr (assq (cdr type) (gnus-info-marks info))))
6079 ;; Don't do anything about marks for articles we 6083 ;; Don't do anything about marks for articles we
diff --git a/lisp/gnus/shr.el b/lisp/gnus/shr.el
index 41f12243971..53c0063de2e 100644
--- a/lisp/gnus/shr.el
+++ b/lisp/gnus/shr.el
@@ -341,7 +341,6 @@ the URL of the image to the kill buffer instead."
341 (delete-char -1)) 341 (delete-char -1))
342 (insert "\n") 342 (insert "\n")
343 (unless found 343 (unless found
344 (put-text-property (1- (point)) (point) 'shr-break t)
345 ;; No space is needed at the beginning of a line. 344 ;; No space is needed at the beginning of a line.
346 (when (eq (following-char) ? ) 345 (when (eq (following-char) ? )
347 (delete-char 1))) 346 (delete-char 1)))
@@ -711,7 +710,7 @@ ones, in case fg and bg are nil."
711 (forward-line 1) 710 (forward-line 1)
712 (setq end (point)) 711 (setq end (point))
713 (narrow-to-region start end) 712 (narrow-to-region start end)
714 (let ((width (shr-natural-width)) 713 (let ((width (shr-buffer-width))
715 column) 714 column)
716 (goto-char (point-min)) 715 (goto-char (point-min))
717 (while (not (eobp)) 716 (while (not (eobp))
@@ -1048,7 +1047,10 @@ ones, in case fg and bg are nil."
1048 ;; be smaller (if there's little text) or bigger (if there's 1047 ;; be smaller (if there's little text) or bigger (if there's
1049 ;; unbreakable text). 1048 ;; unbreakable text).
1050 (sketch (shr-make-table cont suggested-widths)) 1049 (sketch (shr-make-table cont suggested-widths))
1051 (sketch-widths (shr-table-widths sketch suggested-widths))) 1050 ;; Compute the "natural" width by setting each column to 500
1051 ;; characters and see how wide they really render.
1052 (natural (shr-make-table cont (make-vector (length columns) 500)))
1053 (sketch-widths (shr-table-widths sketch natural suggested-widths)))
1052 ;; This probably won't work very well. 1054 ;; This probably won't work very well.
1053 (when (> (+ (loop for width across sketch-widths 1055 (when (> (+ (loop for width across sketch-widths
1054 summing (1+ width)) 1056 summing (1+ width))
@@ -1186,31 +1188,35 @@ ones, in case fg and bg are nil."
1186 shr-table-corner)) 1188 shr-table-corner))
1187 (insert "\n")) 1189 (insert "\n"))
1188 1190
1189(defun shr-table-widths (table suggested-widths) 1191(defun shr-table-widths (table natural-table suggested-widths)
1190 (let* ((length (length suggested-widths)) 1192 (let* ((length (length suggested-widths))
1191 (widths (make-vector length 0)) 1193 (widths (make-vector length 0))
1192 (natural-widths (make-vector length 0))) 1194 (natural-widths (make-vector length 0)))
1193 (dolist (row table) 1195 (dolist (row table)
1194 (let ((i 0)) 1196 (let ((i 0))
1195 (dolist (column row) 1197 (dolist (column row)
1196 (aset widths i (max (aref widths i) 1198 (aset widths i (max (aref widths i) column))
1197 (car column))) 1199 (setq i (1+ i)))))
1198 (aset natural-widths i (max (aref natural-widths i) 1200 (dolist (row natural-table)
1199 (cadr column))) 1201 (let ((i 0))
1202 (dolist (column row)
1203 (aset natural-widths i (max (aref natural-widths i) column))
1200 (setq i (1+ i))))) 1204 (setq i (1+ i)))))
1201 (let ((extra (- (apply '+ (append suggested-widths nil)) 1205 (let ((extra (- (apply '+ (append suggested-widths nil))
1202 (apply '+ (append widths nil)))) 1206 (apply '+ (append widths nil))))
1203 (expanded-columns 0)) 1207 (expanded-columns 0))
1208 ;; We have extra, unused space, so divide this space amongst the
1209 ;; columns.
1204 (when (> extra 0) 1210 (when (> extra 0)
1211 ;; If the natural width is wider than the rendered width, we
1212 ;; want to allow the column to expand.
1205 (dotimes (i length) 1213 (dotimes (i length)
1206 ;; If the natural width is wider than the rendered width, we
1207 ;; want to allow the column to expand.
1208 (when (> (aref natural-widths i) (aref widths i)) 1214 (when (> (aref natural-widths i) (aref widths i))
1209 (setq expanded-columns (1+ expanded-columns)))) 1215 (setq expanded-columns (1+ expanded-columns))))
1210 (dotimes (i length) 1216 (dotimes (i length)
1211 (when (> (aref natural-widths i) (aref widths i)) 1217 (when (> (aref natural-widths i) (aref widths i))
1212 (aset widths i (min 1218 (aset widths i (min
1213 (1+ (aref natural-widths i)) 1219 (aref natural-widths i)
1214 (+ (/ extra expanded-columns) 1220 (+ (/ extra expanded-columns)
1215 (aref widths i)))))))) 1221 (aref widths i))))))))
1216 widths)) 1222 widths))
@@ -1265,10 +1271,13 @@ ones, in case fg and bg are nil."
1265 (let ((shr-width width) 1271 (let ((shr-width width)
1266 (shr-indentation 0)) 1272 (shr-indentation 0))
1267 (shr-descend (cons 'td cont))) 1273 (shr-descend (cons 'td cont)))
1274 ;; Delete padding at the bottom of the TDs.
1268 (delete-region 1275 (delete-region
1269 (point) 1276 (point)
1270 (+ (point) 1277 (progn
1271 (skip-chars-backward " \t\n"))) 1278 (skip-chars-backward " \t\n")
1279 (end-of-line)
1280 (point)))
1272 (push (list (cons width cont) (buffer-string) 1281 (push (list (cons width cont) (buffer-string)
1273 (shr-overlays-in-region (point-min) (point-max))) 1282 (shr-overlays-in-region (point-min) (point-max)))
1274 shr-content-cache))) 1283 shr-content-cache)))
@@ -1302,19 +1311,14 @@ ones, in case fg and bg are nil."
1302 (split-string (buffer-string) "\n") 1311 (split-string (buffer-string) "\n")
1303 (shr-collect-overlays) 1312 (shr-collect-overlays)
1304 (car actual-colors)) 1313 (car actual-colors))
1305 (list max 1314 max)))))
1306 (shr-natural-width)))))))
1307 1315
1308(defun shr-natural-width () 1316(defun shr-buffer-width ()
1309 (goto-char (point-min)) 1317 (goto-char (point-min))
1310 (let ((current 0) 1318 (let ((max 0))
1311 (max 0))
1312 (while (not (eobp)) 1319 (while (not (eobp))
1313 (end-of-line) 1320 (end-of-line)
1314 (setq current (+ current (current-column))) 1321 (setq max (max max (current-column)))
1315 (unless (get-text-property (point) 'shr-break)
1316 (setq max (max max current)
1317 current 0))
1318 (forward-line 1)) 1322 (forward-line 1))
1319 max)) 1323 max))
1320 1324
diff --git a/lisp/htmlfontify.el b/lisp/htmlfontify.el
index b94d4293fa7..fbf7a672ff6 100644
--- a/lisp/htmlfontify.el
+++ b/lisp/htmlfontify.el
@@ -450,6 +450,12 @@ and so on."
450 keep-overlays : More of a bell (or possibly whistle) than an 450 keep-overlays : More of a bell (or possibly whistle) than an
451 optimization - If on, preserve overlay highlighting 451 optimization - If on, preserve overlay highlighting
452 (cf ediff or goo-font-lock) as well as basic faces.\n 452 (cf ediff or goo-font-lock) as well as basic faces.\n
453 body-text-only : Emit only body-text. In concrete terms,
454 1. Suppress calls to `hfy-page-header'and
455 `hfy-page-footer'
456 2. Pretend that `div-wrapper' option above is
457 turned off
458 3. Don't enclose output in <pre> </pre> tags
453 And the following are planned but not yet available:\n 459 And the following are planned but not yet available:\n
454 kill-context-leak : Suppress hyperlinking between files highlighted by 460 kill-context-leak : Suppress hyperlinking between files highlighted by
455 different modes.\n 461 different modes.\n
@@ -463,7 +469,8 @@ which can never slow you down, but may result in incomplete fontification."
463 (const :tag "skip-refontification" skip-refontification) 469 (const :tag "skip-refontification" skip-refontification)
464 (const :tag "kill-context-leak" kill-context-leak ) 470 (const :tag "kill-context-leak" kill-context-leak )
465 (const :tag "div-wrapper" div-wrapper ) 471 (const :tag "div-wrapper" div-wrapper )
466 (const :tag "keep-overlays" keep-overlays )) 472 (const :tag "keep-overlays" keep-overlays )
473 (const :tag "body-text-only" body-text-only ))
467 :group 'htmlfontify 474 :group 'htmlfontify
468 :tag "optimizations") 475 :tag "optimizations")
469 476
@@ -1044,7 +1051,7 @@ haven't encountered them yet. Returns a `hfy-style-assoc'."
1044 ((facep fn) 1051 ((facep fn)
1045 (hfy-face-attr-for-class fn hfy-display-class)) 1052 (hfy-face-attr-for-class fn hfy-display-class))
1046 ((and (symbolp fn) 1053 ((and (symbolp fn)
1047 (facep (symbol-value fn))) 1054 (facep (symbol-value fn)))
1048 ;; Obsolete faces like `font-lock-reference-face' are defined as 1055 ;; Obsolete faces like `font-lock-reference-face' are defined as
1049 ;; aliases for another face. 1056 ;; aliases for another face.
1050 (hfy-face-attr-for-class (symbol-value fn) hfy-display-class)) 1057 (hfy-face-attr-for-class (symbol-value fn) hfy-display-class))
@@ -1108,10 +1115,9 @@ See also `hfy-face-to-style-i', `hfy-flatten-style'."
1108 1115
1109;; construct an assoc of (stripped-name . "{ css-stuff-here }") pairs 1116;; construct an assoc of (stripped-name . "{ css-stuff-here }") pairs
1110;; from a face: 1117;; from a face:
1111(defun hfy-face-to-css (fn) 1118(defun hfy-face-to-css-default (fn)
1112 "Take FN, a font or `defface' specification (cf `face-attr-construct') 1119 "Default handler for mapping faces to styles.
1113and return a CSS style specification.\n 1120See also `hfy-face-to-css'."
1114See also `hfy-face-to-style'."
1115 ;;(message "hfy-face-to-css");;DBUG 1121 ;;(message "hfy-face-to-css");;DBUG
1116 (let* ((css-list (hfy-face-to-style fn)) 1122 (let* ((css-list (hfy-face-to-style fn))
1117 (seen nil) 1123 (seen nil)
@@ -1125,6 +1131,17 @@ See also `hfy-face-to-style'."
1125 css-list))) 1131 css-list)))
1126 (cons (hfy-css-name fn) (format "{%s}" (apply 'concat css-text)))) ) 1132 (cons (hfy-css-name fn) (format "{%s}" (apply 'concat css-text)))) )
1127 1133
1134(defvar hfy-face-to-css 'hfy-face-to-css-default
1135 "Handler for mapping faces to styles.
1136The signature of the handler is of the form \(lambda (FN) ...\).
1137FN is a font or `defface' specification (cf
1138`face-attr-construct'). The handler should return a cons cell of
1139the form (STYLE-NAME . STYLE-SPEC).
1140
1141The default handler is `hfy-face-to-css-default'.
1142
1143See also `hfy-face-to-style'.")
1144
1128(defalias 'hfy-prop-invisible-p 1145(defalias 'hfy-prop-invisible-p
1129 (if (fboundp 'invisible-p) #'invisible-p 1146 (if (fboundp 'invisible-p) #'invisible-p
1130 (lambda (prop) 1147 (lambda (prop)
@@ -1311,20 +1328,27 @@ The plists are returned in descending priority order."
1311 1328
1312;; construct an assoc of (face-name . (css-name . "{ css-style }")) elements: 1329;; construct an assoc of (face-name . (css-name . "{ css-style }")) elements:
1313(defun hfy-compile-stylesheet () 1330(defun hfy-compile-stylesheet ()
1314 "Trawl the current buffer, construct and return a `hfy-sheet-assoc'." 1331 "Trawl the current buffer, construct and return a `hfy-sheet-assoc'.
1332If `hfy-user-sheet-assoc' is currently bound then use it to
1333collect new styles discovered during this run. Otherwise create
1334a new assoc."
1315 ;;(message "hfy-compile-stylesheet");;DBUG 1335 ;;(message "hfy-compile-stylesheet");;DBUG
1316 (let ((pt (point-min)) 1336 (let ((pt (point-min))
1317 ;; Make the font stack stay: 1337 ;; Make the font stack stay:
1318 ;;(hfy-tmpfont-stack nil) 1338 ;;(hfy-tmpfont-stack nil)
1319 (fn nil) 1339 (fn nil)
1320 (style nil)) 1340 (style (and (boundp 'hfy-user-sheet-assoc) hfy-user-sheet-assoc)))
1321 (save-excursion 1341 (save-excursion
1322 (goto-char pt) 1342 (goto-char pt)
1323 (while (< pt (point-max)) 1343 (while (< pt (point-max))
1324 (if (and (setq fn (hfy-face-at pt)) (not (assoc fn style))) 1344 (if (and (setq fn (hfy-face-at pt)) (not (assoc fn style)))
1325 (push (cons fn (hfy-face-to-css fn)) style)) 1345 (push (cons fn (funcall hfy-face-to-css fn)) style))
1326 (setq pt (next-char-property-change pt))) ) 1346 (setq pt (next-char-property-change pt))))
1327 (push (cons 'default (hfy-face-to-css 'default)) style))) 1347 (unless (assoc 'default style)
1348 (push (cons 'default (funcall hfy-face-to-css 'default)) style))
1349 (when (boundp 'hfy-user-sheet-assoc)
1350 (setq hfy-user-sheet-assoc style))
1351 style))
1328 1352
1329(defun hfy-fontified-p () 1353(defun hfy-fontified-p ()
1330 "`font-lock' doesn't like to say it's been fontified when in batch 1354 "`font-lock' doesn't like to say it's been fontified when in batch
@@ -1425,7 +1449,7 @@ Returns a modified copy of FACE-MAP."
1425 (setq pt (next-char-property-change pt)) 1449 (setq pt (next-char-property-change pt))
1426 (setq pt-narrow (+ offset pt))) 1450 (setq pt-narrow (+ offset pt)))
1427 (if (and map (not (eq 'end (cdar map)))) 1451 (if (and map (not (eq 'end (cdar map))))
1428 (push (cons (- (point-max) (point-min)) 'end) map))) 1452 (push (cons (1+ (- (point-max) (point-min))) 'end) map)))
1429 (if (hfy-opt 'merge-adjacent-tags) (hfy-merge-adjacent-spans map) map))) 1453 (if (hfy-opt 'merge-adjacent-tags) (hfy-merge-adjacent-spans map) map)))
1430 1454
1431(defun hfy-buffer () 1455(defun hfy-buffer ()
@@ -1547,6 +1571,61 @@ Do not record undo information during evaluation of BODY."
1547 (remove-text-properties (point-min) (point-max) 1571 (remove-text-properties (point-min) (point-max)
1548 '(hfy-show-trailing-whitespace))))) 1572 '(hfy-show-trailing-whitespace)))))
1549 1573
1574(defun hfy-begin-span (style text-block text-id text-begins-block-p)
1575 "Default handler to begin a span of text.
1576Insert \"<span class=\"STYLE\" ...>\". See
1577`hfy-begin-span-handler' for more information."
1578 (when text-begins-block-p
1579 (insert
1580 (format "<span onclick=\"toggle_invis('%s');\">…</span>" text-block)))
1581
1582 (insert
1583 (if text-block
1584 (format "<span class=\"%s\" id=\"%s-%d\">" style text-block text-id)
1585 (format "<span class=\"%s\">" style))))
1586
1587(defun hfy-end-span ()
1588 "Default handler to end a span of text.
1589Insert \"</span>\". See `hfy-end-span-handler' for more
1590information."
1591 (insert "</span>"))
1592
1593(defvar hfy-begin-span-handler 'hfy-begin-span
1594 "Handler to begin a span of text.
1595The signature of the handler is \(lambda (STYLE TEXT-BLOCK
1596TEXT-ID TEXT-BEGINS-BLOCK-P) ...\). The handler must insert
1597appropriate tags to begin a span of text.
1598
1599STYLE is the name of the style that begins at point. It is
1600derived from the face attributes as part of `hfy-face-to-css'
1601callback. The other arguments TEXT-BLOCK, TEXT-ID,
1602TEXT-BEGINS-BLOCK-P are non-nil only if the buffer contains
1603invisible text.
1604
1605TEXT-BLOCK is a string that identifies a single chunk of visible
1606or invisible text of which the current position is a part. For
1607visible portions, it's value is \"nil\". For invisible portions,
1608it's value is computed as part of `hfy-invisible-name'.
1609
1610TEXT-ID marks a unique position within a block. It is set to
1611value of `point' at the current buffer position.
1612
1613TEXT-BEGINS-BLOCK-P is a boolean and is non-nil if the current
1614span also begins a invisible portion of text.
1615
1616An implementation can use TEXT-BLOCK, TEXT-ID,
1617TEXT-BEGINS-BLOCK-P to implement fold/unfold-on-mouse-click like
1618behaviour.
1619
1620The default handler is `hfy-begin-span'.")
1621
1622(defvar hfy-end-span-handler 'hfy-end-span
1623 "Handler to end a span of text.
1624The signature of the handler is \(lambda () ...\). The handler
1625must insert appropriate tags to end a span of text.
1626
1627The default handler is `hfy-end-span'.")
1628
1550(defun hfy-fontify-buffer (&optional srcdir file) 1629(defun hfy-fontify-buffer (&optional srcdir file)
1551 "Implement the guts of `htmlfontify-buffer'. 1630 "Implement the guts of `htmlfontify-buffer'.
1552SRCDIR, if set, is the directory being htmlfontified. 1631SRCDIR, if set, is the directory being htmlfontified.
@@ -1634,23 +1713,19 @@ FILE, if set, is the file name."
1634 (or (get-text-property pt 'hfy-linkp) 1713 (or (get-text-property pt 'hfy-linkp)
1635 (get-text-property pt 'hfy-endl ))) 1714 (get-text-property pt 'hfy-endl )))
1636 (if (eq 'end fn) 1715 (if (eq 'end fn)
1637 (insert "</span>") 1716 (funcall hfy-end-span-handler)
1638 (if (not (and srcdir file)) 1717 (if (not (and srcdir file))
1639 nil 1718 nil
1640 (when move-link 1719 (when move-link
1641 (remove-text-properties (point) (1+ (point)) '(hfy-endl nil)) 1720 (remove-text-properties (point) (1+ (point)) '(hfy-endl nil))
1642 (put-text-property pt (1+ pt) 'hfy-endl t) )) 1721 (put-text-property pt (1+ pt) 'hfy-endl t) ))
1643 ;; if we have invisible blocks, we need to do some extra magic: 1722 ;; if we have invisible blocks, we need to do some extra magic:
1644 (if invis-ranges 1723 (funcall hfy-begin-span-handler
1645 (let ((iname (hfy-invisible-name pt invis-ranges)) 1724 (hfy-lookup fn css-sheet)
1646 (fname (hfy-lookup fn css-sheet ))) 1725 (and invis-ranges
1647 (when (assq pt invis-ranges) 1726 (format "%s" (hfy-invisible-name pt invis-ranges)))
1648 (insert 1727 (and invis-ranges pt)
1649 (format "<span onclick=\"toggle_invis('%s');\">" iname)) 1728 (and invis-ranges (assq pt invis-ranges)))
1650 (insert "…</span>"))
1651 (insert
1652 (format "<span class=\"%s\" id=\"%s-%d\">" fname iname pt)))
1653 (insert (format "<span class=\"%s\">" (hfy-lookup fn css-sheet))))
1654 (if (not move-link) nil 1729 (if (not move-link) nil
1655 ;;(message "removing prop2 @ %d" (point)) 1730 ;;(message "removing prop2 @ %d" (point))
1656 (if (remove-text-properties (point) (1+ (point)) '(hfy-endl nil)) 1731 (if (remove-text-properties (point) (1+ (point)) '(hfy-endl nil))
@@ -1698,23 +1773,39 @@ FILE, if set, is the file name."
1698 ;; so we have to do this after we use said properties: 1773 ;; so we have to do this after we use said properties:
1699 ;; (message "munging dangerous characters") 1774 ;; (message "munging dangerous characters")
1700 (hfy-html-dekludge-buffer) 1775 (hfy-html-dekludge-buffer)
1701 ;; insert the stylesheet at the top: 1776 (unless (hfy-opt 'body-text-only)
1702 (goto-char (point-min)) 1777 ;; insert the stylesheet at the top:
1703 ;;(message "inserting stylesheet") 1778 (goto-char (point-min))
1704 (insert (hfy-sprintf-stylesheet css-sheet file)) 1779
1705 (if (hfy-opt 'div-wrapper) (insert "<div class=\"default\">")) 1780 ;;(message "inserting stylesheet")
1706 (insert "\n<pre>") 1781 (insert (hfy-sprintf-stylesheet css-sheet file))
1707 (goto-char (point-max)) 1782
1708 (insert "</pre>\n") 1783 (if (hfy-opt 'div-wrapper) (insert "<div class=\"default\">"))
1709 (if (hfy-opt 'div-wrapper) (insert "</div>")) 1784 (insert "\n<pre>")
1710 ;;(message "inserting footer") 1785 (goto-char (point-max))
1711 (insert (funcall hfy-page-footer file)) 1786 (insert "</pre>\n")
1787 (if (hfy-opt 'div-wrapper) (insert "</div>"))
1788 ;;(message "inserting footer")
1789 (insert (funcall hfy-page-footer file)))
1712 ;; call any post html-generation hooks: 1790 ;; call any post html-generation hooks:
1713 (run-hooks 'hfy-post-html-hooks) 1791 (run-hooks 'hfy-post-html-hooks)
1714 ;; return the html buffer 1792 ;; return the html buffer
1715 (set-buffer-modified-p nil) 1793 (set-buffer-modified-p nil)
1716 html-buffer)) 1794 html-buffer))
1717 1795
1796(defun htmlfontify-string (string)
1797 "Take a STRING and return a fontified version of it.
1798It is assumed that STRING has text properties that allow it to be
1799fontified. This is a simple convenience wrapper around
1800`htmlfontify-buffer'."
1801 (let* ((hfy-optimisations-1 (copy-sequence hfy-optimisations))
1802 (hfy-optimisations (add-to-list 'hfy-optimisations-1
1803 'skip-refontification)))
1804 (with-temp-buffer
1805 (insert string)
1806 (htmlfontify-buffer)
1807 (buffer-string))))
1808
1718(defun hfy-force-fontification () 1809(defun hfy-force-fontification ()
1719 "Try to force font-locking even when it is optimized away." 1810 "Try to force font-locking even when it is optimized away."
1720 (run-hooks 'hfy-init-kludge-hook) 1811 (run-hooks 'hfy-init-kludge-hook)
diff --git a/lisp/imenu.el b/lisp/imenu.el
index 9a847f32e89..8363956355b 100644
--- a/lisp/imenu.el
+++ b/lisp/imenu.el
@@ -963,13 +963,14 @@ See the command `imenu' for more information."
963 imenu-generic-expression 963 imenu-generic-expression
964 (not (eq imenu-create-index-function 964 (not (eq imenu-create-index-function
965 'imenu-default-create-index-function))) 965 'imenu-default-create-index-function)))
966 (let ((newmap (make-sparse-keymap))) 966 (unless (keymapp (lookup-key (current-local-map) [menu-bar index]))
967 (set-keymap-parent newmap (current-local-map)) 967 (let ((newmap (make-sparse-keymap)))
968 (setq imenu--last-menubar-index-alist nil) 968 (set-keymap-parent newmap (current-local-map))
969 (define-key newmap [menu-bar index] 969 (setq imenu--last-menubar-index-alist nil)
970 `(menu-item ,name ,(make-sparse-keymap "Imenu"))) 970 (define-key newmap [menu-bar index]
971 (use-local-map newmap) 971 `(menu-item ,name ,(make-sparse-keymap "Imenu")))
972 (add-hook 'menu-bar-update-hook 'imenu-update-menubar)) 972 (use-local-map newmap)
973 (add-hook 'menu-bar-update-hook 'imenu-update-menubar)))
973 (error "The mode `%s' does not support Imenu" 974 (error "The mode `%s' does not support Imenu"
974 (format-mode-line mode-name)))) 975 (format-mode-line mode-name))))
975 976
@@ -1008,6 +1009,9 @@ to `imenu-update-menubar'.")
1008 (car (cdr menu)))) 1009 (car (cdr menu))))
1009 'imenu--menubar-select)) 1010 'imenu--menubar-select))
1010 (setq old (lookup-key (current-local-map) [menu-bar index])) 1011 (setq old (lookup-key (current-local-map) [menu-bar index]))
1012 ;; This should never happen, but in some odd cases, potentially,
1013 ;; lookup-key may return a dynamically composed keymap.
1014 (if (keymapp (cadr old)) (setq old (cadr old)))
1011 (setcdr old (cdr menu1))))))) 1015 (setcdr old (cdr menu1)))))))
1012 1016
1013(defun imenu--menubar-select (item) 1017(defun imenu--menubar-select (item)
diff --git a/lisp/mail/sendmail.el b/lisp/mail/sendmail.el
index f4dfcfcf647..4e2d827fc29 100644
--- a/lisp/mail/sendmail.el
+++ b/lisp/mail/sendmail.el
@@ -1085,9 +1085,10 @@ Return non-nil if and only if some part of the header is encoded."
1085 (cons selected mm-coding-system-priorities) 1085 (cons selected mm-coding-system-priorities)
1086 mm-coding-system-priorities)) 1086 mm-coding-system-priorities))
1087 (tick (buffer-chars-modified-tick)) 1087 (tick (buffer-chars-modified-tick))
1088 ;; rms: this proved necessary, but I don't recall why. 1088 ;; Many mailers, including Gnus, passes a message of which
1089 ;; Can anyone determine why, and state it here? 1089 ;; the header is already encoded, so this is necessary to
1090 (rfc2047-encode-encoded-words t)) 1090 ;; prevent it from being encoded again.
1091 (rfc2047-encode-encoded-words nil))
1091 (rfc2047-encode-message-header) 1092 (rfc2047-encode-message-header)
1092 (= tick (buffer-chars-modified-tick))))) 1093 (= tick (buffer-chars-modified-tick)))))
1093 1094
diff --git a/lisp/net/mairix.el b/lisp/net/mairix.el
index 360b2286b7b..a8e969a18c5 100644
--- a/lisp/net/mairix.el
+++ b/lisp/net/mairix.el
@@ -659,7 +659,7 @@ Fill in VALUES if based on an article."
659 " containing the word)\n" 659 " containing the word)\n"
660 " substring= to match words containing the substring\n" 660 " substring= to match words containing the substring\n"
661 " substring=N to match words containing the substring, allowing\n" 661 " substring=N to match words containing the substring, allowing\n"
662 " up to N errors(mising/extra/different letters)\n" 662 " up to N errors(missing/extra/different letters)\n"
663 " ^substring= to match the substring at the beginning of a word.\n")) 663 " ^substring= to match the substring at the beginning of a word.\n"))
664 (widget-insert 664 (widget-insert
665 "Whitespace will be converted to ',' (i.e. AND). Use '/' for OR.\n\n") 665 "Whitespace will be converted to ',' (i.e. AND). Use '/' for OR.\n\n")
diff --git a/lisp/net/rcirc.el b/lisp/net/rcirc.el
index 1c74e6190dc..d09b6aa831f 100644
--- a/lisp/net/rcirc.el
+++ b/lisp/net/rcirc.el
@@ -2165,13 +2165,17 @@ CHANNELS is a comma- or space-separated string of channel names."
2165 (let ((channel (if (> (length channel) 0) channel target))) 2165 (let ((channel (if (> (length channel) 0) channel target)))
2166 (rcirc-send-string process (concat "PART " channel " :" rcirc-id-string)))) 2166 (rcirc-send-string process (concat "PART " channel " :" rcirc-id-string))))
2167 2167
2168(defun-rcirc-command quit (reason) 2168(defun-rcirc-command quit (reason all)
2169 "Send a quit message to server with REASON." 2169 "Send a quit message to server with REASON.
2170 (interactive "sQuit reason: ") 2170When called with prefix, quit all servers."
2171 (rcirc-send-string process (concat "QUIT :" 2171 (interactive "sQuit reason: \nP")
2172 (if (not (zerop (length reason))) 2172 (dolist (p (if all
2173 reason 2173 (rcirc-process-list)
2174 rcirc-id-string)))) 2174 (list process)))
2175 (rcirc-send-string p (concat "QUIT :"
2176 (if (not (zerop (length reason)))
2177 reason
2178 rcirc-id-string)))))
2175 2179
2176(defun-rcirc-command nick (nick) 2180(defun-rcirc-command nick (nick)
2177 "Change nick to NICK." 2181 "Change nick to NICK."
diff --git a/lisp/progmodes/cc-engine.el b/lisp/progmodes/cc-engine.el
index 3b33ac894f2..cf38001c123 100644
--- a/lisp/progmodes/cc-engine.el
+++ b/lisp/progmodes/cc-engine.el
@@ -236,7 +236,7 @@
236 236
237(defun c-invalidate-macro-cache (beg end) 237(defun c-invalidate-macro-cache (beg end)
238 ;; Called from a before-change function. If the change region is before or 238 ;; Called from a before-change function. If the change region is before or
239 ;; in the macro characterised by `c-macro-cache' etc., nullify it 239 ;; in the macro characterized by `c-macro-cache' etc., nullify it
240 ;; appropriately. BEG and END are the standard before-change-functions 240 ;; appropriately. BEG and END are the standard before-change-functions
241 ;; parameters. END isn't used. 241 ;; parameters. END isn't used.
242 (cond 242 (cond
@@ -1246,7 +1246,7 @@ comment at the start of cc-engine.el for more info."
1246 (c-at-vsemi-p)))) 1246 (c-at-vsemi-p))))
1247 (throw 'done vsemi-pos)) 1247 (throw 'done vsemi-pos))
1248 ;; In a string/comment? 1248 ;; In a string/comment?
1249 ((setq lit-range (c-literal-limits)) 1249 ((setq lit-range (c-literal-limits from))
1250 (goto-char (cdr lit-range))) 1250 (goto-char (cdr lit-range)))
1251 ((eq (char-after) ?:) 1251 ((eq (char-after) ?:)
1252 (forward-char) 1252 (forward-char)
@@ -2163,7 +2163,7 @@ comment at the start of cc-engine.el for more info."
2163(make-variable-buffer-local 'c-state-semi-nonlit-pos-cache-limit) 2163(make-variable-buffer-local 'c-state-semi-nonlit-pos-cache-limit)
2164;; An upper limit on valid entries in `c-state-semi-nonlit-pos-cache'. This is 2164;; An upper limit on valid entries in `c-state-semi-nonlit-pos-cache'. This is
2165;; reduced by buffer changes, and increased by invocations of 2165;; reduced by buffer changes, and increased by invocations of
2166;; `c-state-literal-at'. FIMXE!!! 2166;; `c-state-literal-at'. FIXME!!!
2167 2167
2168(defsubst c-state-pp-to-literal (from to) 2168(defsubst c-state-pp-to-literal (from to)
2169 ;; Do a parse-partial-sexp from FROM to TO, returning either 2169 ;; Do a parse-partial-sexp from FROM to TO, returning either
@@ -3250,8 +3250,7 @@ comment at the start of cc-engine.el for more info."
3250 (if scan-forward-p 3250 (if scan-forward-p
3251 (progn (narrow-to-region (point-min) here) 3251 (progn (narrow-to-region (point-min) here)
3252 (c-append-to-state-cache good-pos)) 3252 (c-append-to-state-cache good-pos))
3253 3253 good-pos)))
3254 (c-get-cache-scan-pos good-pos))))
3255 3254
3256 (t ; (eq strategy 'IN-LIT) 3255 (t ; (eq strategy 'IN-LIT)
3257 (setq c-state-cache nil 3256 (setq c-state-cache nil
@@ -4563,6 +4562,38 @@ comment at the start of cc-engine.el for more info."
4563 (point-min)) 4562 (point-min))
4564 (t 4563 (t
4565 (c-determine-limit (- how-far-back count) base try-size)))))) 4564 (c-determine-limit (- how-far-back count) base try-size))))))
4565
4566(defun c-determine-+ve-limit (how-far &optional start-pos)
4567 ;; Return a buffer position about HOW-FAR non-literal characters forward
4568 ;; from START-POS (default point), which must not be inside a literal.
4569 (save-excursion
4570 (let ((pos (or start-pos (point)))
4571 (count how-far)
4572 (s (parse-partial-sexp (point) (point)))) ; null state
4573 (while (and (not (eobp))
4574 (> count 0))
4575 ;; Scan over counted characters.
4576 (setq s (parse-partial-sexp
4577 pos
4578 (min (+ pos count) (point-max))
4579 nil ; target-depth
4580 nil ; stop-before
4581 s ; state
4582 'syntax-table)) ; stop-comment
4583 (setq count (- count (- (point) pos) 1)
4584 pos (point))
4585 ;; Scan over literal characters.
4586 (if (nth 8 s)
4587 (setq s (parse-partial-sexp
4588 pos
4589 (point-max)
4590 nil ; target-depth
4591 nil ; stop-before
4592 s ; state
4593 'syntax-table) ; stop-comment
4594 pos (point))))
4595 (point))))
4596
4566 4597
4567;; `c-find-decl-spots' and accompanying stuff. 4598;; `c-find-decl-spots' and accompanying stuff.
4568 4599
@@ -7670,8 +7701,8 @@ comment at the start of cc-engine.el for more info."
7670 (and 7701 (and
7671 (eq (c-beginning-of-statement-1 lim) 'same) 7702 (eq (c-beginning-of-statement-1 lim) 'same)
7672 7703
7673 (not (or (c-major-mode-is 'objc-mode) 7704 (not (and (c-major-mode-is 'objc-mode)
7674 (c-forward-objc-directive))) 7705 (c-forward-objc-directive)))
7675 7706
7676 (setq id-start 7707 (setq id-start
7677 (car-safe (c-forward-decl-or-cast-1 (c-point 'bosws) nil nil))) 7708 (car-safe (c-forward-decl-or-cast-1 (c-point 'bosws) nil nil)))
@@ -8635,7 +8666,6 @@ comment at the start of cc-engine.el for more info."
8635 (setq pos (point))) 8666 (setq pos (point)))
8636 (and 8667 (and
8637 c-macro-with-semi-re 8668 c-macro-with-semi-re
8638 (not (c-in-literal))
8639 (eq (skip-chars-backward " \t") 0) 8669 (eq (skip-chars-backward " \t") 0)
8640 8670
8641 ;; Check we've got nothing after this except comments and empty lines 8671 ;; Check we've got nothing after this except comments and empty lines
@@ -8666,7 +8696,9 @@ comment at the start of cc-engine.el for more info."
8666 (c-backward-syntactic-ws) 8696 (c-backward-syntactic-ws)
8667 t)) 8697 t))
8668 (c-simple-skip-symbol-backward) 8698 (c-simple-skip-symbol-backward)
8669 (looking-at c-macro-with-semi-re))))) 8699 (looking-at c-macro-with-semi-re)
8700 (goto-char pos)
8701 (not (c-in-literal)))))) ; The most expensive check last.
8670 8702
8671(defun c-macro-vsemi-status-unknown-p () t) ; See cc-defs.el. 8703(defun c-macro-vsemi-status-unknown-p () t) ; See cc-defs.el.
8672 8704
@@ -9207,6 +9239,10 @@ comment at the start of cc-engine.el for more info."
9207 containing-sexp nil))) 9239 containing-sexp nil)))
9208 (setq lim (1+ containing-sexp)))) 9240 (setq lim (1+ containing-sexp))))
9209 (setq lim (point-min))) 9241 (setq lim (point-min)))
9242 (when (c-beginning-of-macro)
9243 (goto-char indent-point)
9244 (let ((lim1 (c-determine-limit 2000)))
9245 (setq lim (max lim lim1))))
9210 9246
9211 ;; If we're in a parenthesis list then ',' delimits the 9247 ;; If we're in a parenthesis list then ',' delimits the
9212 ;; "statements" rather than being an operator (with the 9248 ;; "statements" rather than being an operator (with the
@@ -9571,7 +9607,8 @@ comment at the start of cc-engine.el for more info."
9571 ;; CASE 5B: After a function header but before the body (or 9607 ;; CASE 5B: After a function header but before the body (or
9572 ;; the ending semicolon if there's no body). 9608 ;; the ending semicolon if there's no body).
9573 ((save-excursion 9609 ((save-excursion
9574 (when (setq placeholder (c-just-after-func-arglist-p lim)) 9610 (when (setq placeholder (c-just-after-func-arglist-p
9611 (max lim (c-determine-limit 500))))
9575 (setq tmp-pos (point)))) 9612 (setq tmp-pos (point))))
9576 (cond 9613 (cond
9577 9614
@@ -9779,7 +9816,7 @@ comment at the start of cc-engine.el for more info."
9779 ;; top level construct. Or, perhaps, an unrecognized construct. 9816 ;; top level construct. Or, perhaps, an unrecognized construct.
9780 (t 9817 (t
9781 (while (and (setq placeholder (point)) 9818 (while (and (setq placeholder (point))
9782 (eq (car (c-beginning-of-decl-1 containing-sexp)) 9819 (eq (car (c-beginning-of-decl-1 containing-sexp)) ; Can't use `lim' here.
9783 'same) 9820 'same)
9784 (save-excursion 9821 (save-excursion
9785 (c-backward-syntactic-ws) 9822 (c-backward-syntactic-ws)
@@ -9882,7 +9919,7 @@ comment at the start of cc-engine.el for more info."
9882 (eq (cdar c-state-cache) (point))) 9919 (eq (cdar c-state-cache) (point)))
9883 ;; Speed up the backward search a bit. 9920 ;; Speed up the backward search a bit.
9884 (goto-char (caar c-state-cache))) 9921 (goto-char (caar c-state-cache)))
9885 (c-beginning-of-decl-1 containing-sexp) 9922 (c-beginning-of-decl-1 containing-sexp) ; Can't use `lim' here.
9886 (setq placeholder (point)) 9923 (setq placeholder (point))
9887 (if (= start (point)) 9924 (if (= start (point))
9888 ;; The '}' is unbalanced. 9925 ;; The '}' is unbalanced.
diff --git a/lisp/progmodes/cc-mode.el b/lisp/progmodes/cc-mode.el
index 985214db1dc..7c018feefbb 100644
--- a/lisp/progmodes/cc-mode.el
+++ b/lisp/progmodes/cc-mode.el
@@ -925,8 +925,8 @@ Note that the style variables are always made local to the buffer."
925 ;; inside a string, comment, or macro. 925 ;; inside a string, comment, or macro.
926 (setq new-bounds (c-extend-font-lock-region-for-macros 926 (setq new-bounds (c-extend-font-lock-region-for-macros
927 c-new-BEG c-new-END old-len)) 927 c-new-BEG c-new-END old-len))
928 (setq c-new-BEG (car new-bounds) 928 (setq c-new-BEG (max (car new-bounds) (c-determine-limit 500 begg))
929 c-new-END (cdr new-bounds)) 929 c-new-END (min (cdr new-bounds) (c-determine-+ve-limit 500 endd)))
930 ;; Clear all old relevant properties. 930 ;; Clear all old relevant properties.
931 (c-clear-char-property-with-value c-new-BEG c-new-END 'syntax-table '(1)) 931 (c-clear-char-property-with-value c-new-BEG c-new-END 'syntax-table '(1))
932 (c-clear-char-property-with-value c-new-BEG c-new-END 'category 'c-cpp-delimiter) 932 (c-clear-char-property-with-value c-new-BEG c-new-END 'category 'c-cpp-delimiter)
diff --git a/lisp/progmodes/gdb-mi.el b/lisp/progmodes/gdb-mi.el
index 8ea255e49dd..89450cd2276 100644
--- a/lisp/progmodes/gdb-mi.el
+++ b/lisp/progmodes/gdb-mi.el
@@ -3269,8 +3269,12 @@ DOC is an optional documentation string."
3269 (let* ((frame (gdb-current-buffer-frame)) 3269 (let* ((frame (gdb-current-buffer-frame))
3270 (file (bindat-get-field frame 'fullname)) 3270 (file (bindat-get-field frame 'fullname))
3271 (line (bindat-get-field frame 'line))) 3271 (line (bindat-get-field frame 'line)))
3272 (when file 3272 (if file
3273 (format "-data-disassemble -f %s -l %s -n -1 -- 0" file line))) 3273 (format "-data-disassemble -f %s -l %s -n -1 -- 0" file line)
3274 ;; If we're unable to get a file name / line for $PC, simply
3275 ;; follow $PC, disassembling the next 10 (x ~15 (on IA) ==
3276 ;; 150 bytes) instructions.
3277 "-data-disassemble -s $pc -e \"$pc + 150\" -- 0"))
3274 gdb-disassembly-handler 3278 gdb-disassembly-handler
3275 ;; We update disassembly only after we have actual frame information 3279 ;; We update disassembly only after we have actual frame information
3276 ;; about all threads, so no there's `update' signal in this list 3280 ;; about all threads, so no there's `update' signal in this list
@@ -3329,8 +3333,12 @@ DOC is an optional documentation string."
3329 (gdb-table-add-row table 3333 (gdb-table-add-row table
3330 (list 3334 (list
3331 (bindat-get-field instr 'address) 3335 (bindat-get-field instr 'address)
3332 (apply #'format "<%s+%s>:" 3336 (let
3333 (gdb-get-many-fields instr 'func-name 'offset)) 3337 ((func-name (bindat-get-field instr 'func-name))
3338 (offset (bindat-get-field instr 'offset)))
3339 (if func-name
3340 (format "<%s+%s>:" func-name offset)
3341 ""))
3334 (bindat-get-field instr 'inst))) 3342 (bindat-get-field instr 'inst)))
3335 (when (string-equal (bindat-get-field instr 'address) 3343 (when (string-equal (bindat-get-field instr 'address)
3336 address) 3344 address)
diff --git a/lisp/progmodes/perl-mode.el b/lisp/progmodes/perl-mode.el
index e7afd0e0e67..de728da236d 100644
--- a/lisp/progmodes/perl-mode.el
+++ b/lisp/progmodes/perl-mode.el
@@ -388,7 +388,11 @@ The expansion is entirely correct because it uses the C preprocessor."
388 ;; In case of error, make sure we don't move backward. 388 ;; In case of error, make sure we don't move backward.
389 (scan-error (goto-char startpos) nil)) 389 (scan-error (goto-char startpos) nil))
390 (not (or (nth 8 (parse-partial-sexp 390 (not (or (nth 8 (parse-partial-sexp
391 (point) limit nil nil state 'syntax-table)) 391 ;; Since we don't know if point is within
392 ;; the first or the scond arg, we have to
393 ;; start from the beginning.
394 (if twoargs (1+ (nth 8 state)) (point))
395 limit nil nil state 'syntax-table))
392 ;; If we have a self-paired opener and a twoargs 396 ;; If we have a self-paired opener and a twoargs
393 ;; command, the form is s/../../ so we have to skip 397 ;; command, the form is s/../../ so we have to skip
394 ;; a second time. 398 ;; a second time.
diff --git a/lisp/simple.el b/lisp/simple.el
index f42ea3e7a50..936037f5caa 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -3069,7 +3069,8 @@ before the Emacs kill and one can still paste it using \\[yank] \\[yank-pop]."
3069 :version "23.2") 3069 :version "23.2")
3070 3070
3071(defcustom kill-do-not-save-duplicates nil 3071(defcustom kill-do-not-save-duplicates nil
3072 "Do not add a new string to `kill-ring' when it is the same as the last one." 3072 "Do not add a new string to `kill-ring' if it duplicates the last one.
3073The comparison is done using `equal-including-properties'."
3073 :type 'boolean 3074 :type 'boolean
3074 :group 'killing 3075 :group 'killing
3075 :version "23.2") 3076 :version "23.2")
@@ -3097,7 +3098,10 @@ argument should still be a \"useful\" string for such uses."
3097 (signal 'args-out-of-range 3098 (signal 'args-out-of-range
3098 (list string "yank-handler specified for empty string")))) 3099 (list string "yank-handler specified for empty string"))))
3099 (unless (and kill-do-not-save-duplicates 3100 (unless (and kill-do-not-save-duplicates
3100 (equal string (car kill-ring))) 3101 ;; Due to text properties such as 'yank-handler that
3102 ;; can alter the contents to yank, comparison using
3103 ;; `equal' is unsafe.
3104 (equal-including-properties string (car kill-ring)))
3101 (if (fboundp 'menu-bar-update-yank-menu) 3105 (if (fboundp 'menu-bar-update-yank-menu)
3102 (menu-bar-update-yank-menu string (and replace (car kill-ring))))) 3106 (menu-bar-update-yank-menu string (and replace (car kill-ring)))))
3103 (when save-interprogram-paste-before-kill 3107 (when save-interprogram-paste-before-kill
@@ -3108,10 +3112,10 @@ argument should still be a \"useful\" string for such uses."
3108 (nreverse interprogram-paste) 3112 (nreverse interprogram-paste)
3109 (list interprogram-paste))) 3113 (list interprogram-paste)))
3110 (unless (and kill-do-not-save-duplicates 3114 (unless (and kill-do-not-save-duplicates
3111 (equal s (car kill-ring))) 3115 (equal-including-properties s (car kill-ring)))
3112 (push s kill-ring)))))) 3116 (push s kill-ring))))))
3113 (unless (and kill-do-not-save-duplicates 3117 (unless (and kill-do-not-save-duplicates
3114 (equal string (car kill-ring))) 3118 (equal-including-properties string (car kill-ring)))
3115 (if (and replace kill-ring) 3119 (if (and replace kill-ring)
3116 (setcar kill-ring string) 3120 (setcar kill-ring string)
3117 (push string kill-ring) 3121 (push string kill-ring)
diff --git a/lisp/sort.el b/lisp/sort.el
index d38e475fd39..8cfe69f9458 100644
--- a/lisp/sort.el
+++ b/lisp/sort.el
@@ -423,7 +423,7 @@ For example: to sort lines in the region by the first word on each line
423 ;; using negative prefix arg to mean "reverse" is now inconsistent with 423 ;; using negative prefix arg to mean "reverse" is now inconsistent with
424 ;; other sort-.*fields functions but then again this was before, since it 424 ;; other sort-.*fields functions but then again this was before, since it
425 ;; didn't use the magnitude of the arg to specify anything. 425 ;; didn't use the magnitude of the arg to specify anything.
426 (interactive "P\nsRegexp specifying records to sort: 426 (interactive "P\nsRegexp specifying records to sort: \n\
427sRegexp specifying key within record: \nr") 427sRegexp specifying key within record: \nr")
428 (cond ((or (equal key-regexp "") (equal key-regexp "\\&")) 428 (cond ((or (equal key-regexp "") (equal key-regexp "\\&"))
429 (setq key-regexp 0)) 429 (setq key-regexp 0))
diff --git a/lisp/subr.el b/lisp/subr.el
index e0b099dd16b..514827f9615 100644
--- a/lisp/subr.el
+++ b/lisp/subr.el
@@ -1785,6 +1785,8 @@ this name matching.
1785 1785
1786Alternatively, FILE can be a feature (i.e. a symbol), in which case FORM 1786Alternatively, FILE can be a feature (i.e. a symbol), in which case FORM
1787is evaluated at the end of any file that `provide's this feature. 1787is evaluated at the end of any file that `provide's this feature.
1788If the feature is provided when evaluating code not associated with a
1789file, FORM is evaluated immediately after the provide statement.
1788 1790
1789Usually FILE is just a library name like \"font-lock\" or a feature name 1791Usually FILE is just a library name like \"font-lock\" or a feature name
1790like 'font-lock. 1792like 'font-lock.
@@ -1814,14 +1816,16 @@ This function makes or adds to an entry on `after-load-alist'."
1814 ;; make sure that `form' is really run "after-load" in case the provide 1816 ;; make sure that `form' is really run "after-load" in case the provide
1815 ;; call happens early. 1817 ;; call happens early.
1816 (setq form 1818 (setq form
1817 `(when load-file-name 1819 `(if load-file-name
1818 (let ((fun (make-symbol "eval-after-load-helper"))) 1820 (let ((fun (make-symbol "eval-after-load-helper")))
1819 (fset fun `(lambda (file) 1821 (fset fun `(lambda (file)
1820 (if (not (equal file ',load-file-name)) 1822 (if (not (equal file ',load-file-name))
1821 nil 1823 nil
1822 (remove-hook 'after-load-functions ',fun) 1824 (remove-hook 'after-load-functions ',fun)
1823 ,',form))) 1825 ,',form)))
1824 (add-hook 'after-load-functions fun))))) 1826 (add-hook 'after-load-functions fun))
1827 ;; Not being provided from a file, run form right now.
1828 ,form)))
1825 ;; Add FORM to the element unless it's already there. 1829 ;; Add FORM to the element unless it's already there.
1826 (unless (member form (cdr elt)) 1830 (unless (member form (cdr elt))
1827 (nconc elt (purecopy (list form))))))) 1831 (nconc elt (purecopy (list form)))))))
diff --git a/lisp/tar-mode.el b/lisp/tar-mode.el
index 949ac4c0889..3eb2be15698 100644
--- a/lisp/tar-mode.el
+++ b/lisp/tar-mode.el
@@ -634,6 +634,9 @@ inside of a tar archive without extracting it and re-archiving it.
634 634
635See also: variables `tar-update-datestamp' and `tar-anal-blocksize'. 635See also: variables `tar-update-datestamp' and `tar-anal-blocksize'.
636\\{tar-mode-map}" 636\\{tar-mode-map}"
637 (and buffer-file-name
638 (file-writable-p buffer-file-name)
639 (setq buffer-read-only nil)) ; undo what `special-mode' did
637 (make-local-variable 'tar-parse-info) 640 (make-local-variable 'tar-parse-info)
638 (set (make-local-variable 'require-final-newline) nil) ; binary data, dude... 641 (set (make-local-variable 'require-final-newline) nil) ; binary data, dude...
639 (set (make-local-variable 'local-enable-local-variables) nil) 642 (set (make-local-variable 'local-enable-local-variables) nil)
diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el
index c1fcb6013b2..bbd433ec9fc 100644
--- a/lisp/textmodes/ispell.el
+++ b/lisp/textmodes/ispell.el
@@ -324,9 +324,9 @@ Uses `query-replace' (\\[query-replace]) for corrections."
324Skips any text between strings matching regular expressions 324Skips any text between strings matching regular expressions
325`ispell-tib-ref-beginning' and `ispell-tib-ref-end'. 325`ispell-tib-ref-beginning' and `ispell-tib-ref-end'.
326 326
327TeX users beware: Any field starting with [. will skip until a .] -- even 327TeX users beware: Any text between [. and .] will be skipped -- even if
328your whole buffer -- unless you set `ispell-skip-tib' to nil. That includes 328that's your whole buffer -- unless you set `ispell-skip-tib' to nil.
329a [.5mm] type of number...." 329That includes the [.5mm] type of number..."
330 :type 'boolean 330 :type 'boolean
331 :group 'ispell) 331 :group 'ispell)
332 332
@@ -337,13 +337,13 @@ a [.5mm] type of number...."
337 "Regexp matching the end of a Tib reference.") 337 "Regexp matching the end of a Tib reference.")
338 338
339(defcustom ispell-keep-choices-win t 339(defcustom ispell-keep-choices-win t
340 "*When non-nil, the `*Choices*' window remains for spelling session. 340 "*If non-nil, keep the `*Choices*' window for the entire spelling session.
341This minimizes redisplay thrashing." 341This minimizes redisplay thrashing."
342 :type 'boolean 342 :type 'boolean
343 :group 'ispell) 343 :group 'ispell)
344 344
345(defcustom ispell-choices-win-default-height 2 345(defcustom ispell-choices-win-default-height 2
346 "*The default size of the `*Choices*' window, including mode line. 346 "*The default size of the `*Choices*' window, including the mode line.
347Must be greater than 1." 347Must be greater than 1."
348 :type 'integer 348 :type 'integer
349 :group 'ispell) 349 :group 'ispell)
@@ -493,7 +493,7 @@ default dictionary and LANG the two letter language code."
493 :group 'ispell) 493 :group 'ispell)
494 494
495(defcustom ispell-silently-savep nil 495(defcustom ispell-silently-savep nil
496 "*When non-nil, save the personal dictionary without confirmation." 496 "*When non-nil, save personal dictionary without asking for confirmation."
497 :type 'boolean 497 :type 'boolean
498 :group 'ispell) 498 :group 'ispell)
499 499
@@ -714,7 +714,7 @@ Hint: regexp syntax requires the hyphen to be declared first here.
714 714
715CASECHARS, NOT-CASECHARS, and OTHERCHARS must be unibyte strings 715CASECHARS, NOT-CASECHARS, and OTHERCHARS must be unibyte strings
716containing bytes of CHARACTER-SET. In addition, if they contain 716containing bytes of CHARACTER-SET. In addition, if they contain
717a non-ASCII byte, the regular expression must be a single 717non-ASCII bytes, the regular expression must be a single
718`character set' construct that doesn't specify a character range 718`character set' construct that doesn't specify a character range
719for non-ASCII bytes. 719for non-ASCII bytes.
720 720
@@ -734,27 +734,31 @@ but the dictionary can control the extended character mode.
734Both defaults can be overruled in a buffer-local fashion. See 734Both defaults can be overruled in a buffer-local fashion. See
735`ispell-parsing-keyword' for details on this. 735`ispell-parsing-keyword' for details on this.
736 736
737CHARACTER-SET used for languages with multibyte characters. 737CHARACTER-SET used to encode text sent to the ispell subprocess
738when the language uses non-ASCII characters.
738 739
739Note that the CASECHARS and OTHERCHARS slots of the alist should 740Note that with \"ispell\" as the speller, the CASECHARS and
740contain the same character set as casechars and otherchars in the 741OTHERCHARS slots of the alist should contain the same character
741LANGUAGE.aff file \(e.g., english.aff\).") 742set as casechars and otherchars in the LANGUAGE.aff file \(e.g.,
743english.aff\). apsell and hunspell don't have this limitation.")
742 744
743(defvar ispell-really-aspell nil) ; Non-nil if we can use aspell extensions. 745(defvar ispell-really-aspell nil) ; Non-nil if we can use aspell extensions.
744(defvar ispell-really-hunspell nil) ; Non-nil if we can use hunspell extensions. 746(defvar ispell-really-hunspell nil) ; Non-nil if we can use hunspell extensions.
745(defvar ispell-encoding8-command nil 747(defvar ispell-encoding8-command nil
746 "Command line option prefix to select UTF-8 if supported, nil otherwise. 748 "Command line option prefix to select encoding if supported, nil otherwise.
747If UTF-8 if supported by spellchecker and is selectable from the command line 749If setting the encoding is supported by spellchecker and is selectable from
748this variable will contain \"--encoding=\" for aspell and \"-i \" for hunspell, 750the command line, this variable will contain \"--encoding=\" for aspell
749so UTF-8 or other mime charsets can be selected. That will be set for hunspell 751and \"-i \" for hunspell, so the appropriate mime charset can be selected.
750>=1.1.6 or aspell >= 0.60 in `ispell-check-version'. 752That will be set in `ispell-check-version' for hunspell >= 1.1.6 and
751 753aspell >= 0.60.
752For aspell non-nil means to try to automatically find aspell dictionaries. 754
753Earlier aspell versions do not consistently support UTF-8. Handling 755For aspell, non-nil also means to try to automatically find its dictionaries.
756
757Earlier aspell versions do not consistently support charset encoding. Handling
754this would require some extra guessing in `ispell-aspell-find-dictionary'.") 758this would require some extra guessing in `ispell-aspell-find-dictionary'.")
755 759
756(defvar ispell-aspell-supports-utf8 nil 760(defvar ispell-aspell-supports-utf8 nil
757 "Non nil if aspell has consistent command line UTF-8 support. Obsolete. 761 "Non-nil if aspell has consistent command line UTF-8 support. Obsolete.
758ispell.el and flyspell.el will use for this purpose the more generic 762ispell.el and flyspell.el will use for this purpose the more generic
759variable `ispell-encoding8-command' for both aspell and hunspell. Is left 763variable `ispell-encoding8-command' for both aspell and hunspell. Is left
760here just for backwards compatibility.") 764here just for backwards compatibility.")
@@ -780,7 +784,7 @@ here just for backwards compatibility.")
780 784
781 785
782(defun ispell-check-version (&optional interactivep) 786(defun ispell-check-version (&optional interactivep)
783 "Ensure that `ispell-program-name' is valid and the correct version. 787 "Ensure that `ispell-program-name' is valid and has the correct version.
784Returns version number if called interactively. 788Returns version number if called interactively.
785Otherwise returns the library directory name, if that is defined." 789Otherwise returns the library directory name, if that is defined."
786 ;; This is a little wasteful as we actually launch ispell twice: once 790 ;; This is a little wasteful as we actually launch ispell twice: once
@@ -983,8 +987,8 @@ Assumes that value contains no whitespace."
983 987
984(defun ispell-aspell-find-dictionary (dict-name) 988(defun ispell-aspell-find-dictionary (dict-name)
985 "For aspell dictionary DICT-NAME, return a list of parameters if an 989 "For aspell dictionary DICT-NAME, return a list of parameters if an
986 associated data file is found or nil otherwise. List format is 990associated data file is found or nil otherwise. List format is that
987 that of `ispell-dictionary-base-alist' elements." 991of `ispell-dictionary-base-alist' elements."
988 ;; Make sure `ispell-aspell-data-dir' is defined 992 ;; Make sure `ispell-aspell-data-dir' is defined
989 (or ispell-aspell-data-dir 993 (or ispell-aspell-data-dir
990 (setq ispell-aspell-data-dir 994 (setq ispell-aspell-data-dir
@@ -1117,7 +1121,7 @@ aspell is used along with Emacs).")
1117 1121
1118(defun ispell-valid-dictionary-list () 1122(defun ispell-valid-dictionary-list ()
1119 "Return a list of valid dictionaries. 1123 "Return a list of valid dictionaries.
1120The variable `ispell-library-directory' defines the library location." 1124The variable `ispell-library-directory' defines their location."
1121 ;; Initialize variables and dictionaries alists for desired spellchecker. 1125 ;; Initialize variables and dictionaries alists for desired spellchecker.
1122 ;; Make sure ispell.el is loaded to avoid some autoload loops in XEmacs 1126 ;; Make sure ispell.el is loaded to avoid some autoload loops in XEmacs
1123 ;; (and may be others) 1127 ;; (and may be others)
@@ -1307,7 +1311,8 @@ Protects against bogus binding of `enable-multibyte-characters' in XEmacs."
1307 (let* ((slot (or 1311 (let* ((slot (or
1308 (assoc ispell-current-dictionary ispell-local-dictionary-alist) 1312 (assoc ispell-current-dictionary ispell-local-dictionary-alist)
1309 (assoc ispell-current-dictionary ispell-dictionary-alist) 1313 (assoc ispell-current-dictionary ispell-dictionary-alist)
1310 (error "No match for the current dictionary"))) 1314 (error "No data for dictionary \"%s\", neither in `ispell-local-dictionary-alist' nor in `ispell-dictionary-alist'"
1315 ispell-current-dictionary)))
1311 (str (nth n slot))) 1316 (str (nth n slot)))
1312 (when (and (> (length str) 0) 1317 (when (and (> (length str) 0)
1313 (not (multibyte-string-p str))) 1318 (not (multibyte-string-p str)))
@@ -1381,7 +1386,7 @@ Set to the MIME boundary locations when checking messages.")
1381(defconst ispell-words-keyword "LocalWords: " 1386(defconst ispell-words-keyword "LocalWords: "
1382 "The keyword for local oddly-spelled words to accept. 1387 "The keyword for local oddly-spelled words to accept.
1383The keyword will be followed by any number of local word spellings. 1388The keyword will be followed by any number of local word spellings.
1384There can be multiple of these keywords in the file.") 1389There can be multiple instances of this keyword in the file.")
1385 1390
1386(defconst ispell-dictionary-keyword "Local IspellDict: " 1391(defconst ispell-dictionary-keyword "Local IspellDict: "
1387 "The keyword for a local dictionary to use. 1392 "The keyword for a local dictionary to use.
@@ -1786,7 +1791,8 @@ If optional argument FOLLOWING is non-nil or if `ispell-following-word'
1786is non-nil when called interactively, then the following word 1791is non-nil when called interactively, then the following word
1787\(rather than preceding\) is checked when the cursor is not over a word. 1792\(rather than preceding\) is checked when the cursor is not over a word.
1788Optional second argument contains otherchars that can be included in word 1793Optional second argument contains otherchars that can be included in word
1789many times. 1794many times (see the doc string of `ispell-dictionary-alist' for details
1795about otherchars).
1790 1796
1791Word syntax is controlled by the definition of the chosen dictionary, 1797Word syntax is controlled by the definition of the chosen dictionary,
1792which is in `ispell-local-dictionary-alist' or `ispell-dictionary-alist'." 1798which is in `ispell-local-dictionary-alist' or `ispell-dictionary-alist'."
@@ -2817,8 +2823,8 @@ By just answering RET you can find out what the current dictionary is."
2817 2823
2818(defun ispell-internal-change-dictionary () 2824(defun ispell-internal-change-dictionary ()
2819 "Update the dictionary and the personal dictionary used by Ispell. 2825 "Update the dictionary and the personal dictionary used by Ispell.
2820This may kill the Ispell process; if so, 2826This may kill the Ispell process; if so, a new one will be started
2821a new one will be started when needed." 2827when needed."
2822 (let ((dict (or ispell-local-dictionary ispell-dictionary)) 2828 (let ((dict (or ispell-local-dictionary ispell-dictionary))
2823 (pdict (or ispell-local-pdict ispell-personal-dictionary))) 2829 (pdict (or ispell-local-pdict ispell-personal-dictionary)))
2824 (unless (and (equal ispell-current-dictionary dict) 2830 (unless (and (equal ispell-current-dictionary dict)
@@ -2836,8 +2842,8 @@ a new one will be started when needed."
2836;;;###autoload 2842;;;###autoload
2837(defun ispell-region (reg-start reg-end &optional recheckp shift) 2843(defun ispell-region (reg-start reg-end &optional recheckp shift)
2838 "Interactively check a region for spelling errors. 2844 "Interactively check a region for spelling errors.
2839Return nil if spell session is quit, 2845Return nil if spell session was terminated, otherwise returns shift offset
2840 otherwise returns shift offset amount for last line processed." 2846amount for last line processed."
2841 (interactive "r") ; Don't flag errors on read-only bufs. 2847 (interactive "r") ; Don't flag errors on read-only bufs.
2842 (ispell-set-spellchecker-params) ; Initialize variables and dicts alists 2848 (ispell-set-spellchecker-params) ; Initialize variables and dicts alists
2843 (if (not recheckp) 2849 (if (not recheckp)
@@ -2956,7 +2962,7 @@ Return nil if spell session is quit,
2956(defun ispell-begin-skip-region-regexp () 2962(defun ispell-begin-skip-region-regexp ()
2957 "Return a regexp of the search keys for region skipping. 2963 "Return a regexp of the search keys for region skipping.
2958Includes `ispell-skip-region-alist' plus tex, tib, html, and comment keys. 2964Includes `ispell-skip-region-alist' plus tex, tib, html, and comment keys.
2959Must call after `ispell-buffer-local-parsing' due to dependence on mode." 2965Must be called after `ispell-buffer-local-parsing' due to dependence on mode."
2960 (mapconcat 2966 (mapconcat
2961 'identity 2967 'identity
2962 (delq nil 2968 (delq nil
@@ -3016,7 +3022,7 @@ Includes regions defined by `ispell-skip-region-alist', tex mode,
3016`ispell-html-skip-alists', and `ispell-checking-message'. 3022`ispell-html-skip-alists', and `ispell-checking-message'.
3017Manual checking must include comments and tib references. 3023Manual checking must include comments and tib references.
3018The list is of the form described by variable `ispell-skip-region-alist'. 3024The list is of the form described by variable `ispell-skip-region-alist'.
3019Must call after `ispell-buffer-local-parsing' due to dependence on mode." 3025Must be called after `ispell-buffer-local-parsing' due to dependence on mode."
3020 (let ((skip-alist ispell-skip-region-alist)) 3026 (let ((skip-alist ispell-skip-region-alist))
3021 ;; only additional explicit region definition is tex. 3027 ;; only additional explicit region definition is tex.
3022 (if (eq ispell-parser 'tex) 3028 (if (eq ispell-parser 'tex)
@@ -3046,7 +3052,7 @@ Must call after `ispell-buffer-local-parsing' due to dependence on mode."
3046 3052
3047(defun ispell-ignore-fcc (start end) 3053(defun ispell-ignore-fcc (start end)
3048 "Delete the Fcc: message header when large attachments are included. 3054 "Delete the Fcc: message header when large attachments are included.
3049Return value `nil' if file with large attachments are saved. 3055Return value `nil' if file with large attachments is saved.
3050This can be used to avoid multiple questions for multiple large attachments. 3056This can be used to avoid multiple questions for multiple large attachments.
3051Returns point to starting location afterwards." 3057Returns point to starting location afterwards."
3052 (let ((result t)) 3058 (let ((result t))
@@ -3153,7 +3159,7 @@ Returns a string with the line data."
3153 coding))))) 3159 coding)))))
3154 3160
3155(defun ispell-process-line (string shift) 3161(defun ispell-process-line (string shift)
3156 "Send STRING, a line of text, to ispell and processes the result. 3162 "Send STRING, a line of text, to ispell and process the result.
3157This will modify the buffer for spelling errors. 3163This will modify the buffer for spelling errors.
3158Requires variables ISPELL-START and ISPELL-END to be defined in its 3164Requires variables ISPELL-START and ISPELL-END to be defined in its
3159dynamic scope. 3165dynamic scope.
@@ -3468,7 +3474,7 @@ With a prefix argument ARG, enable Ispell minor mode if ARG is
3468positive, and disable it otherwise. If called from Lisp, enable 3474positive, and disable it otherwise. If called from Lisp, enable
3469the mode if ARG is omitted or nil. 3475the mode if ARG is omitted or nil.
3470 3476
3471Ispell minor mode is a buffer-local mior mode. When enabled, 3477Ispell minor mode is a buffer-local minor mode. When enabled,
3472typing SPC or RET warns you if the previous word is incorrectly 3478typing SPC or RET warns you if the previous word is incorrectly
3473spelled. 3479spelled.
3474 3480
@@ -3481,7 +3487,7 @@ RET, use `flyspell-mode'."
3481 nil " Spell" ispell-minor-keymap) 3487 nil " Spell" ispell-minor-keymap)
3482 3488
3483(defun ispell-minor-check () 3489(defun ispell-minor-check ()
3484 "Check previous word then continue with the normal binding of this key. 3490 "Check previous word, then continue with the normal binding of this key.
3485Don't check previous word when character before point is a space or newline. 3491Don't check previous word when character before point is a space or newline.
3486Don't read buffer-local settings or word lists." 3492Don't read buffer-local settings or word lists."
3487 (interactive "*") 3493 (interactive "*")
@@ -3519,8 +3525,8 @@ Don't read buffer-local settings or word lists."
3519 ;; Matches commonly used "cut" boundaries 3525 ;; Matches commonly used "cut" boundaries
3520 "^\\(- \\)?[-=_]+\\s ?\\(cut here\\|Environment Follows\\)") 3526 "^\\(- \\)?[-=_]+\\s ?\\(cut here\\|Environment Follows\\)")
3521 "\\|") 3527 "\\|")
3522 "*End of text which will be checked in `ispell-message'. 3528 "*Text beyond which `ispell-message' will not spell-check.
3523If it is a string, limit at first occurrence of that regular expression. 3529If it is a string, limit is the first occurrence of that regular expression.
3524Otherwise, it must be a function which is called to get the limit.") 3530Otherwise, it must be a function which is called to get the limit.")
3525(put 'ispell-message-text-end 'risky-local-variable t) 3531(put 'ispell-message-text-end 'risky-local-variable t)
3526 3532
@@ -3625,7 +3631,7 @@ Don't check included messages.
3625 3631
3626To abort spell checking of a message region and send the message anyway, 3632To abort spell checking of a message region and send the message anyway,
3627use the `x' command. (Any subsequent regions will be checked.) 3633use the `x' command. (Any subsequent regions will be checked.)
3628The `X' command aborts the message send so that you can edit the buffer. 3634The `X' command aborts sending the message so that you can edit the buffer.
3629 3635
3630To spell-check whenever a message is sent, include the appropriate lines 3636To spell-check whenever a message is sent, include the appropriate lines
3631in your .emacs file: 3637in your .emacs file:
@@ -3788,7 +3794,7 @@ You can bind this to the key C-c i in GNUS or mail by adding to
3788(defun ispell-buffer-local-parsing () 3794(defun ispell-buffer-local-parsing ()
3789 "Place Ispell into parsing mode for this buffer. 3795 "Place Ispell into parsing mode for this buffer.
3790Overrides the default parsing mode. 3796Overrides the default parsing mode.
3791Includes Latex/Nroff modes and extended character mode." 3797Includes LaTeX/Nroff modes and extended character mode."
3792 ;; (ispell-init-process) must already be called. 3798 ;; (ispell-init-process) must already be called.
3793 (ispell-send-string "!\n") ; Put process in terse mode. 3799 (ispell-send-string "!\n") ; Put process in terse mode.
3794 ;; We assume all major modes with "tex-mode" in them should use latex parsing 3800 ;; We assume all major modes with "tex-mode" in them should use latex parsing
@@ -3838,7 +3844,7 @@ Includes Latex/Nroff modes and extended character mode."
3838 3844
3839(defun ispell-buffer-local-dict (&optional no-reload) 3845(defun ispell-buffer-local-dict (&optional no-reload)
3840 "Initializes local dictionary and local personal dictionary. 3846 "Initializes local dictionary and local personal dictionary.
3841If optional NO-RELOAD is non-nil, do not make any dictionary reloading. 3847If optional NO-RELOAD is non-nil, do not reload any dictionary.
3842When a dictionary is defined in the buffer (see variable 3848When a dictionary is defined in the buffer (see variable
3843`ispell-dictionary-keyword'), it will override the local setting 3849`ispell-dictionary-keyword'), it will override the local setting
3844from \\[ispell-change-dictionary]. 3850from \\[ispell-change-dictionary].
diff --git a/lisp/url/ChangeLog b/lisp/url/ChangeLog
index 960649bdbc9..ff6a6e6f805 100644
--- a/lisp/url/ChangeLog
+++ b/lisp/url/ChangeLog
@@ -1,3 +1,8 @@
12012-03-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
2
3 * url-queue.el (url-queue-kill-job): Make sure that the callback
4 is always called, even if we have a timeout.
5
12012-03-11 Chong Yidong <cyd@gnu.org> 62012-03-11 Chong Yidong <cyd@gnu.org>
2 7
3 * url-http.el (url-http-end-of-document-sentinel): Handle 8 * url-http.el (url-http-end-of-document-sentinel): Handle
diff --git a/lisp/url/url-queue.el b/lisp/url/url-queue.el
index 6e4cedddaf3..46124717fed 100644
--- a/lisp/url/url-queue.el
+++ b/lisp/url/url-queue.el
@@ -156,9 +156,20 @@ The variable `url-queue-timeout' sets a timeout."
156 (while (setq process (get-buffer-process (url-queue-buffer job))) 156 (while (setq process (get-buffer-process (url-queue-buffer job)))
157 (set-process-sentinel process 'ignore) 157 (set-process-sentinel process 'ignore)
158 (ignore-errors 158 (ignore-errors
159 (delete-process process)))) 159 (delete-process process)))))
160 (ignore-errors 160 ;; Call the callback with an error message to ensure that the caller
161 (kill-buffer (url-queue-buffer job))))) 161 ;; is notified that the job has failed.
162 (with-current-buffer
163 (if (bufferp (url-queue-buffer job))
164 ;; Use the (partially filled) process buffer it it exists.
165 (url-queue-buffer job)
166 ;; If not, just create a new buffer, which will probably be
167 ;; killed again by the caller.
168 (generate-new-buffer " *temp*"))
169 (apply (url-queue-callback job)
170 (cons (list :error (list 'error 'url-queue-timeout
171 "Queue timeout exceeded"))
172 (url-queue-cbargs job)))))
162 173
163(provide 'url-queue) 174(provide 'url-queue)
164 175
diff --git a/lisp/vc/vc-hg.el b/lisp/vc/vc-hg.el
index f3ba009b8c2..52e8051342d 100644
--- a/lisp/vc/vc-hg.el
+++ b/lisp/vc/vc-hg.el
@@ -226,45 +226,14 @@ highlighting the Log View buffer."
226 226
227(defun vc-hg-working-revision (file) 227(defun vc-hg-working-revision (file)
228 "Hg-specific version of `vc-working-revision'." 228 "Hg-specific version of `vc-working-revision'."
229 (let* 229 (let ((default-directory (if (file-directory-p file)
230 ((status nil) 230 (file-name-as-directory file)
231 (default-directory (file-name-directory file)) 231 (file-name-directory file))))
232 ;; Avoid localization of messages so we can parse the output. 232 (ignore-errors
233 (avoid-local-env (append (list "TERM=dumb" "LANGUAGE=C") 233 (with-output-to-string
234 process-environment)) 234 (process-file vc-hg-program nil standard-output nil
235 (out 235 "log" "-l" "1" "--template" "{rev}"
236 (with-output-to-string 236 (file-relative-name file))))))
237 (with-current-buffer
238 standard-output
239 (setq status
240 (condition-case nil
241 (let ((process-environment avoid-local-env))
242 ;; Ignore all errors.
243 (process-file
244 vc-hg-program nil t nil
245 "--config" "alias.parents=parents"
246 "--config" "defaults.parents="
247 "parents" "--template" "{rev}" (file-relative-name file)))
248 ;; Some problem happened. E.g. We can't find an `hg'
249 ;; executable.
250 (error nil)))))))
251 (if (eq 0 status)
252 out
253 ;; Check if the file is in the 'added state, the above hg
254 ;; command does not distinguish between 'added and 'unregistered.
255 (setq status
256 (condition-case nil
257 (let ((process-environment avoid-local-env))
258 (process-file
259 vc-hg-program nil nil nil
260 ;; We use "log" here, if there's a faster command
261 ;; that returns true for an 'added file and false
262 ;; for an 'unregistered one, we could use that.
263 "log" "-l1" (file-relative-name file)))
264 ;; Some problem happened. E.g. We can't find an `hg'
265 ;; executable.
266 (error nil)))
267 (when (eq 0 status) "0"))))
268 237
269;;; History functions 238;;; History functions
270 239
diff --git a/lisp/view.el b/lisp/view.el
index 4a219971097..41cb9752288 100644
--- a/lisp/view.el
+++ b/lisp/view.el
@@ -309,7 +309,11 @@ this argument instead of explicitly setting `view-exit-action'.
309Do not set EXIT-ACTION to `kill-buffer' when BUFFER visits a 309Do not set EXIT-ACTION to `kill-buffer' when BUFFER visits a
310file: Users may suspend viewing in order to modify the buffer. 310file: Users may suspend viewing in order to modify the buffer.
311Exiting View mode will then discard the user's edits. Setting 311Exiting View mode will then discard the user's edits. Setting
312EXIT-ACTION to `kill-buffer-if-not-modified' avoids this." 312EXIT-ACTION to `kill-buffer-if-not-modified' avoids this.
313
314This function does not enable View mode if the buffer's major-mode
315has a `special' mode-class, because such modes usually have their
316own View-like bindings."
313 (interactive "bView buffer: ") 317 (interactive "bView buffer: ")
314 (switch-to-buffer buffer) 318 (switch-to-buffer buffer)
315 (if (eq (get major-mode 'mode-class) 'special) 319 (if (eq (get major-mode 'mode-class) 'special)
@@ -331,7 +335,11 @@ Optional argument NOT-RETURN is ignored.
331 335
332Optional argument EXIT-ACTION is either nil or a function with buffer as 336Optional argument EXIT-ACTION is either nil or a function with buffer as
333argument. This function is called when finished viewing buffer. Use 337argument. This function is called when finished viewing buffer. Use
334this argument instead of explicitly setting `view-exit-action'." 338this argument instead of explicitly setting `view-exit-action'.
339
340This function does not enable View mode if the buffer's major-mode
341has a `special' mode-class, because such modes usually have their
342own View-like bindings."
335 (interactive "bIn other window view buffer:\nP") 343 (interactive "bIn other window view buffer:\nP")
336 (let ((pop-up-windows t)) 344 (let ((pop-up-windows t))
337 (pop-to-buffer buffer t)) 345 (pop-to-buffer buffer t))
@@ -354,7 +362,11 @@ Optional argument NOT-RETURN is ignored.
354 362
355Optional argument EXIT-ACTION is either nil or a function with buffer as 363Optional argument EXIT-ACTION is either nil or a function with buffer as
356argument. This function is called when finished viewing buffer. Use 364argument. This function is called when finished viewing buffer. Use
357this argument instead of explicitly setting `view-exit-action'." 365this argument instead of explicitly setting `view-exit-action'.
366
367This function does not enable View mode if the buffer's major-mode
368has a `special' mode-class, because such modes usually have their
369own View-like bindings."
358 (interactive "bView buffer in other frame: \nP") 370 (interactive "bView buffer in other frame: \nP")
359 (let ((pop-up-frames t)) 371 (let ((pop-up-frames t))
360 (pop-to-buffer buffer t)) 372 (pop-to-buffer buffer t))