aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorJoakim Verona2012-03-13 08:23:14 +0100
committerJoakim Verona2012-03-13 08:23:14 +0100
commit4b2cea2874f3a699ebe96349ef34fb7206cc0fa5 (patch)
treebbd39cf660d9b79b2cff9e39ef6209af4cf9fb8b /lisp
parent1de331c486475093aa6b75ef6c259f7164e7620c (diff)
parent6ea7151ba66df966974060711512b49b9059566e (diff)
downloademacs-4b2cea2874f3a699ebe96349ef34fb7206cc0fa5.tar.gz
emacs-4b2cea2874f3a699ebe96349ef34fb7206cc0fa5.zip
upstream
Diffstat (limited to 'lisp')
-rw-r--r--lisp/ChangeLog210
-rw-r--r--lisp/autorevert.el11
-rw-r--r--lisp/calendar/icalendar.el4
-rw-r--r--lisp/cedet/ChangeLog12
-rw-r--r--lisp/cedet/semantic/db-find.el6
-rw-r--r--lisp/cedet/semantic/wisent/javascript.el4
-rw-r--r--lisp/dabbrev.el157
-rw-r--r--lisp/dired.el110
-rw-r--r--lisp/emacs-lisp/package.el23
-rw-r--r--lisp/emulation/cua-base.el1
-rw-r--r--lisp/emulation/cua-rect.el1
-rw-r--r--lisp/emulation/ws-mode.el2
-rw-r--r--lisp/epa-mail.el4
-rw-r--r--lisp/faces.el2
-rw-r--r--lisp/files.el55
-rw-r--r--lisp/gnus/ChangeLog10
-rw-r--r--lisp/gnus/gnus-int.el2
-rw-r--r--lisp/gnus/mm-uu.el8
-rw-r--r--lisp/ibuffer.el16
-rw-r--r--lisp/international/fontset.el1
-rw-r--r--lisp/international/quail.el32
-rw-r--r--lisp/mail/mail-utils.el8
-rw-r--r--lisp/mail/rmail.el12
-rw-r--r--lisp/mail/sendmail.el4
-rw-r--r--lisp/mail/smtpmail.el5
-rw-r--r--lisp/minibuffer.el13
-rw-r--r--lisp/net/dbus.el3
-rw-r--r--lisp/net/mairix.el22
-rw-r--r--lisp/nxml/nxml-mode.el26
-rw-r--r--lisp/progmodes/cc-cmds.el27
-rw-r--r--lisp/progmodes/cc-engine.el4
-rw-r--r--lisp/progmodes/gdb-mi.el16
-rw-r--r--lisp/replace.el6
-rw-r--r--lisp/savehist.el4
-rw-r--r--lisp/server.el107
-rw-r--r--lisp/simple.el31
-rw-r--r--lisp/sort.el2
-rw-r--r--lisp/speedbar.el10
-rw-r--r--lisp/subr.el13
-rw-r--r--lisp/url/ChangeLog11
-rw-r--r--lisp/url/url-http.el83
-rw-r--r--lisp/window.el39
42 files changed, 752 insertions, 365 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 68b48f5047e..bd0e6f865cd 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,11 +1,203 @@
12012-03-13 Kaushik Srenevasan <ksrenevasan@gmail.com> (tiny change)
2
3 * progmodes/gdb-mi.el (gdb-invalidate-disassembly):
4 For dynamically generated code, follow $PC.
5 (gdb-disassembly-handler-custom): Handle no function name case.
6
72012-03-13 Tim Landscheidt <tim@tim-landscheidt.de> (tiny change)
8
9 * calendar/icalendar.el (icalendar-export-file, icalendar-import-file):
10 * emulation/ws-mode.el (ws-query-replace):
11 * sort.el (sort-regexp-fields):
12 Fix missing trailing whitespace in interactive prompts. (Bug#11002)
13
142012-03-12 Stefan Monnier <monnier@iro.umontreal.ca>
15
16 * dabbrev.el: Fix cycle completion order (bug#10963).
17 (dabbrev--last-obarray, dabbrev--last-completion-buffer): Remove.
18 (dabbrev-completion): Don't use an obarray; provide
19 a cycle-sort-function.
20
212012-03-12 Leo Liu <sdl.web@gmail.com>
22
23 * simple.el (kill-new): Use equal-including-properties for
24 comparison.
25 (kill-do-not-save-duplicates): Doc fix.
26
272012-03-12 Stefan Monnier <monnier@iro.umontreal.ca>
28
29 * dabbrev.el: Fix cycle completion (bug#10963).
30 Use lexical binding and wrap to 80 columns.
31 (dabbrev-completion): Delay computing the list of completions.
32
332012-03-12 Kenichi Handa <handa@m17n.org>
34
35 * international/quail.el (quail-insert-kbd-layout): Surround each
36 row by LRO and PDF instead of inserting many LRMs. Pad the left
37 and right of each non-spacing marks. Insert invisible space
38 between lower and upper characters to prevent composition.
39
402012-03-12 Stefan Monnier <monnier@iro.umontreal.ca>
41
42 * minibuffer.el (minibuffer-complete): Don't get confused when the
43 function is run twice via different commands (bug#10958).
44 (complete-with-action): Fix docstring.
45
462012-03-12 Chong Yidong <cyd@gnu.org>
47
48 * nxml/nxml-mode.el (nxml-mode-map): Do not bind C-RET (Bug#6776).
49 (nxml-completion-at-point-function): New function.
50 (nxml-mode): Use it.
51 (nxml-bind-meta-tab-to-complete-flag): Default to t.
52
53 * emacs-lisp/package.el (package-unpack, package-unpack-single):
54 Load generated autoloads file before byte compiling (Bug#10970).
55 (package--make-autoloads-and-compile): New helper fun.
56
572012-03-12 Christopher Schmidt <christopher@ch.ristopher.com>
58
59 * ibuffer.el (ibuffer-redisplay): Remove another gratuitous error.
60
612012-03-11 Michael Albinus <michael.albinus@gmx.de>
62
63 * autorevert.el (auto-revert-handler): Ensure, that
64 file-readable-p is applied only for local files or in
65 auto-revert-tail-mode.
66
672012-03-11 Andreas Schwab <schwab@linux-m68k.org>
68
69 * server.el (server-eval-at): Handle non-tcp connections.
70 Decode result string.
71
72 * server.el (server-msg-size): New constant.
73 (server-reply-print): New function.
74 (server-eval-and-print): Use it.
75 (server-eval-at): Use server-quote-arg and server-unquote-arg.
76 Handle -print-nonl.
77
782012-03-11 Christopher Schmidt <christopher@ch.ristopher.com>
79
80 * ibuffer.el (ibuffer-redisplay): Remove gratuitous error
81 (Bug#10987).
82
832012-03-11 Chong Yidong <cyd@gnu.org>
84
85 * simple.el (goto-line): Doc fix (Bug#9938).
86
87 * subr.el (save-window-excursion): Doc fix (Bug#9979).
88
89 * dabbrev.el (dabbrev--find-expansion): Update progress reporter
90 when finished (Bug#10963).
91
922012-03-11 Martin Rudalics <rudalics@gmx.at>
93
94 * window.el (split-window-below): Fix bug in case where
95 split-window-keep-point is nil (Bug#10971).
96
972012-03-11 Juri Linkov <juri@jurta.org>
98
99 * replace.el (replace-highlight): Set isearch-word to nil
100 unconditionally. (Bug#10887)
101
1022012-03-10 Eli Zaretskii <eliz@gnu.org>
103
104 * net/mairix.el (mairix-replace-invalid-chars): Rename from
105 mairix-replace-illegal-chars; all callers changed. Don't remove
106 ^, ~, and = characters: they are meaningful in mairix search
107 specs.
108 (mairix-widget-create-query): Add usage information about mairix
109 search forms: negating words, searching for substrings, etc.
110
1112012-03-10 Jae-hyeon Park <jae-hyeon.park@desy.de> (tiny change)
112
113 * international/fontset.el (font-encoding-alist): Add an entry for
114 ksx1001 (Bug#5667).
115
1162012-03-10 Richard Stallman <rms@gnu.org>
117
118 * mail/sendmail.el (mail-encode-header):
119 Set rfc2047-encode-encoded-words.
120
121 * mail/mail-utils.el (mail-quote-printable): Quote multibyte chars.
122
123 * mail/rmail.el (rmail-buffers-swapped-p): Don't assume dead
124 view buffer means not swapped.
125 (rmail-view-buffer-kill-buffer-hook): Give buf name in error msg.
126 (rmail-write-region-annotate): Error if real text has disappeared.
127
128 * epa-mail.el (epa-mail-encrypt): Bind inhibit-read-only.
129
1302012-03-10 Chong Yidong <cyd@gnu.org>
131
132 * emulation/cua-rect.el (cua--init-rectangles):
133 * emulation/cua-base.el (cua--init-keymaps):
134 Add delete-forward-char to remappings (Bug#9666).
135
1362012-03-10 Martin Rudalics <rudalics@gmx.at>
137
138 * speedbar.el (speedbar-unhighlight-one-tag-line):
139 Avoid unhighlighting due to frame switching (Bug#10275).
140
1412012-03-10 Chong Yidong <cyd@gnu.org>
142
143 * minibuffer.el (completion-in-region, completion-help-at-point):
144 Give the completion field overlay a high priority (Bug#6830).
145
146 * dired.el (dired-goto-file): Recognize absolute file name
147 listings (Bug#7126).
148 (dired-goto-file-1): New helper function.
149 (dired-toggle-read-only): Inhibit warnings.
150
1512012-03-09 Michael Albinus <michael.albinus@gmx.de>
152
153 * net/dbus.el: (dbus-property-handler): Return empty array if
154 there are no properties.
155
1562012-03-09 Leo Liu <sdl.web@gmail.com>
157
158 * savehist.el (savehist-printable): Stricter check for string
159 value (Bug#10937).
160
1612012-03-09 Eli Zaretskii <eliz@gnu.org>
162
163 * mail/smtpmail.el (smtpmail-send-it):
164 Bind coding-system-for-write to *-unix, so that FCC files are kept in
165 valid mbox format.
166
1672012-03-09 Glenn Morris <rgm@gnu.org>
168
169 * files.el (dir-locals-find-file):
170 Don't check result is regular, readable.
171 (dir-locals-read-from-file): Demote errors.
172
1732012-03-08 Eli Zaretskii <eliz@gnu.org>
174
175 * international/quail.el (quail-insert-kbd-layout):
176 Insert invisible LRM characters before each character in a keyboard
177 layout cell, to prevent their reordering by bidi display engine.
178 For details, see the discussion in
179 http://lists.gnu.org/archive/html/emacs-devel/2012-03/msg00085.html.
180
1812012-03-08 Alan Mackenzie <acm@muc.de>
182
183 * progmodes/cc-cmds.el (c-mark-function): Make it leave a mark at
184 the starting position; make it extend the marked region when
185 invoked repeatedly - all under appropriate circumstances.
186 Fixes bugs #5525, #10906.
187
1882012-03-08 Glenn Morris <rgm@gnu.org>
189
190 * files.el (locate-dominating-file, dir-locals-find-file):
191 Undo 2012-03-06 change.
192
12012-03-07 Eli Zaretskii <eliz@gnu.org> 1932012-03-07 Eli Zaretskii <eliz@gnu.org>
2 194
3 * international/quail.el (quail-help): Force 195 * international/quail.el (quail-help):
4 bidi-paragraph-direction be left-to-right. See discussion in 196 Force bidi-paragraph-direction be left-to-right. See discussion in
5 http://lists.gnu.org/archive/html/emacs-devel/2012-03/msg00062.html 197 http://lists.gnu.org/archive/html/emacs-devel/2012-03/msg00062.html
6 for the reason. 198 for the reason.
7 199
82012-03-07 Michael Albinus <Michael.Albinus@alcatel-lucent.com> 2002012-03-07 Michael Albinus <michael.albinus@gmx.de>
9 201
10 Avoid superfluous registering of signals. (Bug#10807) 202 Avoid superfluous registering of signals. (Bug#10807)
11 203
@@ -133,16 +325,16 @@
133 New variables for... 325 New variables for...
134 (c-state-semi-safe-place): New function. Here, in a macro is "safe". 326 (c-state-semi-safe-place): New function. Here, in a macro is "safe".
135 (c-invalidate-state-cache-1): New stuff for c-state-semi-safe-place. 327 (c-invalidate-state-cache-1): New stuff for c-state-semi-safe-place.
136 (c-in-literal, c-literal-limits, c-determine-limit-get-base): Use 328 (c-in-literal, c-literal-limits, c-determine-limit-get-base):
137 c-state-semi-safe-place. 329 Use c-state-semi-safe-place.
138 330
139 * progmodes/cc-langs.el (c-get-state-before-change-functions): Add 331 * progmodes/cc-langs.el (c-get-state-before-change-functions):
140 c-invalidate-macro-cache to the C, C++, Obj entries. 332 Add c-invalidate-macro-cache to the C, C++, Obj entries.
141 333
1422012-03-02 Michael Albinus <michael.albinus@gmx.de> 3342012-03-02 Michael Albinus <michael.albinus@gmx.de>
143 335
144 * jka-compr.el (jka-compr-call-process): Apply 336 * jka-compr.el (jka-compr-call-process):
145 `file-accessible-directory-p' only when the default directory is 337 Apply `file-accessible-directory-p' only when the default directory is
146 not remote. 338 not remote.
147 339
1482012-03-01 Michael Albinus <michael.albinus@gmx.de> 3402012-03-01 Michael Albinus <michael.albinus@gmx.de>
diff --git a/lisp/autorevert.el b/lisp/autorevert.el
index c0a77bd5935..e0bde7c6dc5 100644
--- a/lisp/autorevert.el
+++ b/lisp/autorevert.el
@@ -439,17 +439,18 @@ This is an internal function used by Auto-Revert Mode."
439 (let* ((buffer (current-buffer)) size 439 (let* ((buffer (current-buffer)) size
440 (revert 440 (revert
441 (or (and buffer-file-name 441 (or (and buffer-file-name
442 (file-readable-p buffer-file-name)
443 (if auto-revert-tail-mode 442 (if auto-revert-tail-mode
444 ;; Tramp caches the file attributes. Setting 443 ;; Tramp caches the file attributes. Setting
445 ;; `remote-file-name-inhibit-cache' forces Tramp 444 ;; `remote-file-name-inhibit-cache' forces Tramp
446 ;; to reread the values. 445 ;; to reread the values.
447 (let ((remote-file-name-inhibit-cache t)) 446 (let ((remote-file-name-inhibit-cache t))
448 (/= auto-revert-tail-pos 447 (and (file-readable-p buffer-file-name)
449 (setq size 448 (/= auto-revert-tail-pos
450 (nth 7 (file-attributes 449 (setq size
451 buffer-file-name))))) 450 (nth 7 (file-attributes
451 buffer-file-name))))))
452 (and (not (file-remote-p buffer-file-name)) 452 (and (not (file-remote-p buffer-file-name))
453 (file-readable-p buffer-file-name)
453 (not (verify-visited-file-modtime buffer))))) 454 (not (verify-visited-file-modtime buffer)))))
454 (and (or auto-revert-mode 455 (and (or auto-revert-mode
455 global-auto-revert-non-file-buffers) 456 global-auto-revert-non-file-buffers)
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 4dc5fe4df21..f185c457ee2 100644
--- a/lisp/cedet/ChangeLog
+++ b/lisp/cedet/ChangeLog
@@ -1,3 +1,15 @@
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
82012-03-11 David Engster <deng@randomsample.de>
9
10 * semantic/wisent/javascript.el (js-mode): Define `js-mode' as
11 child-mode of `javascript-mode' (bug #8445).
12
12012-02-28 Glenn Morris <rgm@gnu.org> 132012-02-28 Glenn Morris <rgm@gnu.org>
2 14
3 * semantic/db.el (semanticdb-search-results-table): 15 * semantic/db.el (semanticdb-search-results-table):
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/cedet/semantic/wisent/javascript.el b/lisp/cedet/semantic/wisent/javascript.el
index 33644414b30..8ed83e87bce 100644
--- a/lisp/cedet/semantic/wisent/javascript.el
+++ b/lisp/cedet/semantic/wisent/javascript.el
@@ -75,6 +75,10 @@ This function overrides `get-local-variables'."
75;; 75;;
76;; This sets up the javascript parser 76;; This sets up the javascript parser
77 77
78;; Since javascript-mode is an alias for js-mode, let it inherit all
79;; the overrides.
80(define-child-mode js-mode javascript-mode)
81
78;; In semantic-imenu.el, not part of Emacs. 82;; In semantic-imenu.el, not part of Emacs.
79(defvar semantic-imenu-summary-function) 83(defvar semantic-imenu-summary-function)
80 84
diff --git a/lisp/dabbrev.el b/lisp/dabbrev.el
index 7b94b53e6c7..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)))
@@ -763,6 +753,7 @@ of the start of the occurrence."
763 (- (length dabbrev--friend-buffer-list))) 753 (- (length dabbrev--friend-buffer-list)))
764 (setq dabbrev--last-expansion-location (point-min)) 754 (setq dabbrev--last-expansion-location (point-min))
765 (setq expansion (dabbrev--try-find abbrev nil 1 ignore-case))) 755 (setq expansion (dabbrev--try-find abbrev nil 1 ignore-case)))
756 (progress-reporter-done dabbrev--progress-reporter)
766 expansion))))) 757 expansion)))))
767 758
768;; Compute the list of buffers to scan. 759;; Compute the list of buffers to scan.
@@ -828,14 +819,15 @@ EXPANSION is the expansion substring to be used this time.
828RECORD-CASE-PATTERN, if non-nil, means set `dabbrev--last-case-pattern' 819RECORD-CASE-PATTERN, if non-nil, means set `dabbrev--last-case-pattern'
829to record whether we upcased the expansion, downcased it, or did neither." 820to record whether we upcased the expansion, downcased it, or did neither."
830 ;;(undo-boundary) 821 ;;(undo-boundary)
831 (let ((use-case-replace (and (if (eq dabbrev-case-fold-search 'case-fold-search) 822 (let ((use-case-replace
832 case-fold-search 823 (and (if (eq dabbrev-case-fold-search 'case-fold-search)
833 dabbrev-case-fold-search) 824 case-fold-search
834 (or (not dabbrev-upcase-means-case-search) 825 dabbrev-case-fold-search)
835 (string= abbrev (downcase abbrev))) 826 (or (not dabbrev-upcase-means-case-search)
836 (if (eq dabbrev-case-replace 'case-replace) 827 (string= abbrev (downcase abbrev)))
837 case-replace 828 (if (eq dabbrev-case-replace 'case-replace)
838 dabbrev-case-replace)))) 829 case-replace
830 dabbrev-case-replace))))
839 831
840 ;; If we upcased or downcased the original expansion, 832 ;; If we upcased or downcased the original expansion,
841 ;; do likewise for the subsequent words when we copy them. 833 ;; do likewise for the subsequent words when we copy them.
@@ -861,12 +853,13 @@ to record whether we upcased the expansion, downcased it, or did neither."
861 (let ((expansion-rest (substring expansion 1)) 853 (let ((expansion-rest (substring expansion 1))
862 (first-letter-position (string-match "[[:alpha:]]" abbrev))) 854 (first-letter-position (string-match "[[:alpha:]]" abbrev)))
863 (if (or (null first-letter-position) 855 (if (or (null first-letter-position)
864 (and (not (and (or (string= expansion-rest (downcase expansion-rest)) 856 (and (not
865 (string= expansion-rest (upcase expansion-rest))) 857 (and (or (string= expansion-rest (downcase expansion-rest))
866 (or (string= abbrev (downcase abbrev)) 858 (string= expansion-rest (upcase expansion-rest)))
867 (and (string= abbrev (upcase abbrev)) 859 (or (string= abbrev (downcase abbrev))
868 (> (- (length abbrev) first-letter-position) 860 (and (string= abbrev (upcase abbrev))
869 1))))) 861 (> (- (length abbrev) first-letter-position)
862 1)))))
870 (string= abbrev 863 (string= abbrev
871 (substring expansion 0 (length abbrev))))) 864 (substring expansion 0 (length abbrev)))))
872 (setq use-case-replace nil))) 865 (setq use-case-replace nil)))
@@ -950,9 +943,9 @@ Leaves point at the location of the start of the expansion."
950 ;; Limited search. 943 ;; Limited search.
951 (save-restriction 944 (save-restriction
952 (and dabbrev-limit 945 (and dabbrev-limit
953 (narrow-to-region dabbrev--last-expansion-location 946 (narrow-to-region
954 (+ (point) 947 dabbrev--last-expansion-location
955 (if reverse (- dabbrev-limit) dabbrev-limit)))) 948 (+ (point) (if reverse (- dabbrev-limit) dabbrev-limit))))
956 ;;-------------------------------- 949 ;;--------------------------------
957 ;; Look for a distinct expansion, using dabbrev--last-table. 950 ;; Look for a distinct expansion, using dabbrev--last-table.
958 ;;-------------------------------- 951 ;;--------------------------------
diff --git a/lisp/dired.el b/lisp/dired.el
index 57bf3c88322..d26e7004cc3 100644
--- a/lisp/dired.el
+++ b/lisp/dired.el
@@ -1964,7 +1964,8 @@ Otherwise, for buffers inheriting from dired-mode, call `toggle-read-only'."
1964 (interactive) 1964 (interactive)
1965 (if (eq major-mode 'dired-mode) 1965 (if (eq major-mode 'dired-mode)
1966 (wdired-change-to-wdired-mode) 1966 (wdired-change-to-wdired-mode)
1967 (toggle-read-only))) 1967 (with-no-warnings
1968 (toggle-read-only))))
1968 1969
1969(defun dired-next-line (arg) 1970(defun dired-next-line (arg)
1970 "Move down lines then position at filename. 1971 "Move down lines then position at filename.
@@ -2622,58 +2623,61 @@ instead of `dired-actual-switches'."
2622 (read-file-name "Goto file: " 2623 (read-file-name "Goto file: "
2623 (dired-current-directory)))) 2624 (dired-current-directory))))
2624 (push-mark))) 2625 (push-mark)))
2625 (setq file (directory-file-name file)) ; does no harm if no directory 2626 (unless (file-name-absolute-p file)
2626 (let (found case-fold-search dir) 2627 (error "File name `%s' is not absolute" file))
2627 (setq dir (or (file-name-directory file) 2628 (setq file (directory-file-name file)) ; does no harm if not a directory
2628 (error "File name `%s' is not absolute" file))) 2629 (let* ((case-fold-search nil)
2629 (save-excursion 2630 (dir (file-name-directory file))
2630 ;; The hair here is to get the result of dired-goto-subdir 2631 (found (or
2631 ;; without really calling it if we don't have any subdirs. 2632 ;; First, look for a listing under the absolute name.
2632 (if (if (string= dir (expand-file-name default-directory)) 2633 (save-excursion
2633 (goto-char (point-min)) 2634 (goto-char (point-min))
2634 (and (cdr dired-subdir-alist) 2635 (dired-goto-file-1 file file (point-max)))
2635 (dired-goto-subdir dir))) 2636 ;; Otherwise, look for it as a relative name. The
2636 (let ((base (file-name-nondirectory file)) 2637 ;; hair is to get the result of `dired-goto-subdir'
2637 search-string 2638 ;; without calling it if we don't have any subdirs.
2638 (boundary (dired-subdir-max))) 2639 (save-excursion
2639 (setq search-string 2640 (when (if (string= dir (expand-file-name default-directory))
2640 (replace-regexp-in-string "\^m" "\\^m" base nil t)) 2641 (goto-char (point-min))
2641 (setq search-string 2642 (and (cdr dired-subdir-alist)
2642 (replace-regexp-in-string "\\\\" "\\\\" search-string nil t)) 2643 (dired-goto-subdir dir)))
2643 (and (dired-switches-escape-p dired-actual-switches) 2644 (dired-goto-file-1 (file-name-nondirectory file)
2644 (string-match "[ \t\n]" search-string) 2645 file
2645 ;; FIXME to fix this for all possible file names 2646 (dired-subdir-max)))))))
2646 ;; (embedded control characters etc), we need to 2647 ;; Return buffer position, if found.
2647 ;; escape everything that `ls -b' does. 2648 (if found
2648 (setq search-string 2649 (goto-char found))))
2649 (replace-regexp-in-string " " "\\ " 2650
2650 search-string nil t) 2651(defun dired-goto-file-1 (file full-name limit)
2651 search-string 2652 "Advance to the Dired listing labeled by FILE; return its position.
2652 (replace-regexp-in-string "\t" "\\t" 2653Return nil if the listing is not found. If FILE contains
2653 search-string nil t) 2654characters that would not appear in a Dired buffer, search using
2654 search-string 2655the quoted forms of those characters.
2655 (replace-regexp-in-string "\n" "\\n" 2656
2656 search-string nil t))) 2657FULL-NAME specifies the actual file name the listing must have,
2657 (while (and (not found) 2658as returned by `dired-get-filename'. LIMIT is the search limit."
2658 ;; filenames are preceded by SPC, this makes 2659 (let (str)
2659 ;; the search faster (e.g. for the filename "-"!). 2660 (setq str (replace-regexp-in-string "\^m" "\\^m" file nil t))
2660 (search-forward (concat " " search-string) 2661 (setq str (replace-regexp-in-string "\\\\" "\\\\" str nil t))
2661 boundary 'move)) 2662 (and (dired-switches-escape-p dired-actual-switches)
2662 ;; Match could have BASE just as initial substring or 2663 (string-match "[ \t\n]" str)
2663 ;; or in permission bits or date or 2664 ;; FIXME: to fix this for embedded control characters etc, we
2664 ;; not be a proper filename at all: 2665 ;; should escape everything that `ls -b' does.
2665 (if (equal base (dired-get-filename 'no-dir t)) 2666 (setq str (replace-regexp-in-string " " "\\ " str nil t)
2666 ;; Must move to filename since an (actually 2667 str (replace-regexp-in-string "\t" "\\t" str nil t)
2667 ;; correct) match could have been elsewhere on the 2668 str (replace-regexp-in-string "\n" "\\n" str nil t)))
2668 ;; ;; line (e.g. "-" would match somewhere in the 2669 (let ((found nil)
2669 ;; permission bits). 2670 ;; filenames are preceded by SPC, this makes the search faster
2670 (setq found (dired-move-to-filename)) 2671 ;; (e.g. for the filename "-").
2671 ;; If this isn't the right line, move forward to avoid 2672 (search-string (concat " " str)))
2672 ;; trying this line again. 2673 (while (and (not found)
2673 (forward-line 1)))))) 2674 (search-forward search-string limit 'move))
2674 (and found 2675 ;; Check that we are in the right place. Match could have
2675 ;; return value of point (i.e., FOUND): 2676 ;; BASE just as initial substring or in permission bits etc.
2676 (goto-char found)))) 2677 (if (equal full-name (dired-get-filename nil t))
2678 (setq found (dired-move-to-filename))
2679 (forward-line 1)))
2680 found)))
2677 2681
2678(defvar dired-find-subdir) 2682(defvar dired-find-subdir)
2679 2683
diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el
index fd0eb029fc3..5b158eb994f 100644
--- a/lisp/emacs-lisp/package.el
+++ b/lisp/emacs-lisp/package.el
@@ -607,16 +607,25 @@ untar into a directory named DIR; otherwise, signal an error."
607 (error "Package does not untar cleanly into directory %s/" dir)))) 607 (error "Package does not untar cleanly into directory %s/" dir))))
608 (tar-untar-buffer)) 608 (tar-untar-buffer))
609 609
610(defun package-unpack (name version) 610(defun package-unpack (package version)
611 (let* ((dirname (concat (symbol-name name) "-" version)) 611 (let* ((name (symbol-name package))
612 (dirname (concat name "-" version))
612 (pkg-dir (expand-file-name dirname package-user-dir))) 613 (pkg-dir (expand-file-name dirname package-user-dir)))
613 (make-directory package-user-dir t) 614 (make-directory package-user-dir t)
614 ;; FIXME: should we delete PKG-DIR if it exists? 615 ;; FIXME: should we delete PKG-DIR if it exists?
615 (let* ((default-directory (file-name-as-directory package-user-dir))) 616 (let* ((default-directory (file-name-as-directory package-user-dir)))
616 (package-untar-buffer dirname) 617 (package-untar-buffer dirname)
617 (package-generate-autoloads (symbol-name name) pkg-dir) 618 (package--make-autoloads-and-compile name pkg-dir))))
618 (let ((load-path (cons pkg-dir load-path))) 619
619 (byte-recompile-directory pkg-dir 0 t))))) 620(defun package--make-autoloads-and-compile (name pkg-dir)
621 "Generate autoloads and do byte-compilation for package named NAME.
622PKG-DIR is the name of the package directory."
623 (package-generate-autoloads name pkg-dir)
624 (let ((load-path (cons pkg-dir load-path)))
625 ;; We must load the autoloads file before byte compiling, in
626 ;; case there are magic cookies to set up non-trivial paths.
627 (load (expand-file-name (concat name "-autoloads") pkg-dir) nil t)
628 (byte-recompile-directory pkg-dir 0 t)))
620 629
621(defun package--write-file-no-coding (file-name) 630(defun package--write-file-no-coding (file-name)
622 (let ((buffer-file-coding-system 'no-conversion)) 631 (let ((buffer-file-coding-system 'no-conversion))
@@ -656,9 +665,7 @@ untar into a directory named DIR; otherwise, signal an error."
656 nil 665 nil
657 pkg-file 666 pkg-file
658 nil nil nil 'excl)) 667 nil nil nil 'excl))
659 (package-generate-autoloads file-name pkg-dir) 668 (package--make-autoloads-and-compile file-name pkg-dir))))
660 (let ((load-path (cons pkg-dir load-path)))
661 (byte-recompile-directory pkg-dir 0 t)))))
662 669
663(defmacro package--with-work-buffer (location file &rest body) 670(defmacro package--with-work-buffer (location file &rest body)
664 "Run BODY in a buffer containing the contents of FILE at LOCATION. 671 "Run BODY in a buffer containing the contents of FILE at LOCATION.
diff --git a/lisp/emulation/cua-base.el b/lisp/emulation/cua-base.el
index 9e7be0f670d..a918f298a4e 100644
--- a/lisp/emulation/cua-base.el
+++ b/lisp/emulation/cua-base.el
@@ -1478,6 +1478,7 @@ If ARG is the atom `-', scroll upward by nearly full screen."
1478 (define-key cua--region-keymap [remap backward-delete-char] 'cua-delete-region) 1478 (define-key cua--region-keymap [remap backward-delete-char] 'cua-delete-region)
1479 (define-key cua--region-keymap [remap backward-delete-char-untabify] 'cua-delete-region) 1479 (define-key cua--region-keymap [remap backward-delete-char-untabify] 'cua-delete-region)
1480 (define-key cua--region-keymap [remap delete-char] 'cua-delete-region) 1480 (define-key cua--region-keymap [remap delete-char] 'cua-delete-region)
1481 (define-key cua--region-keymap [remap delete-forward-char] 'cua-delete-region)
1481 ;; kill region 1482 ;; kill region
1482 (define-key cua--region-keymap [remap kill-region] 'cua-cut-region) 1483 (define-key cua--region-keymap [remap kill-region] 'cua-cut-region)
1483 (define-key cua--region-keymap [remap clipboard-kill-region] 'cua-cut-region) 1484 (define-key cua--region-keymap [remap clipboard-kill-region] 'cua-cut-region)
diff --git a/lisp/emulation/cua-rect.el b/lisp/emulation/cua-rect.el
index 95b77a697f1..e3aade760dc 100644
--- a/lisp/emulation/cua-rect.el
+++ b/lisp/emulation/cua-rect.el
@@ -1420,6 +1420,7 @@ With prefix arg, indent to that column."
1420 (define-key cua--rectangle-keymap [remap kill-ring-save] 'cua-copy-rectangle) 1420 (define-key cua--rectangle-keymap [remap kill-ring-save] 'cua-copy-rectangle)
1421 (define-key cua--rectangle-keymap [remap kill-region] 'cua-cut-rectangle) 1421 (define-key cua--rectangle-keymap [remap kill-region] 'cua-cut-rectangle)
1422 (define-key cua--rectangle-keymap [remap delete-char] 'cua-delete-rectangle) 1422 (define-key cua--rectangle-keymap [remap delete-char] 'cua-delete-rectangle)
1423 (define-key cua--rectangle-keymap [remap delete-forward-char] 'cua-delete-rectangle)
1423 (define-key cua--rectangle-keymap [remap set-mark-command] 'cua-toggle-rectangle-mark) 1424 (define-key cua--rectangle-keymap [remap set-mark-command] 'cua-toggle-rectangle-mark)
1424 1425
1425 (define-key cua--rectangle-keymap [remap forward-char] 'cua-resize-rectangle-right) 1426 (define-key cua--rectangle-keymap [remap forward-char] 'cua-resize-rectangle-right)
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/epa-mail.el b/lisp/epa-mail.el
index 22bfe03cab0..be5b849651c 100644
--- a/lisp/epa-mail.el
+++ b/lisp/epa-mail.el
@@ -192,7 +192,9 @@ If no one is selected, symmetric encryption will be performed. "
192 (if sign 192 (if sign
193 (epa-select-keys context 193 (epa-select-keys context
194 "Select keys for signing. ")))))) 194 "Select keys for signing. "))))))
195 (epa-encrypt-region start end recipients sign signers)) 195 ;; Don't let some read-only text stop us from encrypting.
196 (let ((inhibit-read-only t))
197 (epa-encrypt-region start end recipients sign signers)))
196 198
197;;;###autoload 199;;;###autoload
198(defun epa-mail-import-keys () 200(defun epa-mail-import-keys ()
diff --git a/lisp/faces.el b/lisp/faces.el
index 0011e0357a1..bdac3a1bb6a 100644
--- a/lisp/faces.el
+++ b/lisp/faces.el
@@ -1516,7 +1516,7 @@ 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
diff --git a/lisp/files.el b/lisp/files.el
index 1d54ef81869..cde15c5d0b1 100644
--- a/lisp/files.el
+++ b/lisp/files.el
@@ -877,14 +877,13 @@ or mount points potentially requiring authentication as a different user.")
877;; (setq dir nil)))) 877;; (setq dir nil))))
878;; nil))) 878;; nil)))
879 879
880(defun locate-dominating-file (file name &optional predicate) 880(defun locate-dominating-file (file name)
881 "Look up the directory hierarchy from FILE for a file named NAME. 881 "Look up the directory hierarchy from FILE for a file named NAME.
882Stop at the first parent directory containing a file NAME, 882Stop at the first parent directory containing a file NAME,
883and return the directory. Return nil if not found. 883and return the directory. Return nil if not found.
884 884
885Optional argument PREDICATE is a function of one argument, a file. 885This function only tests if FILE exists. If you care about whether
886It should return non-nil if the file is acceptable. The default is 886it is readable, regular, etc., you should test the result."
887`file-exists-p'; you might, e.g., want to use `file-readable-p' instead."
888 ;; We used to use the above locate-dominating-files code, but the 887 ;; We used to use the above locate-dominating-files code, but the
889 ;; directory-files call is very costly, so we're much better off doing 888 ;; directory-files call is very costly, so we're much better off doing
890 ;; multiple calls using the code in here. 889 ;; multiple calls using the code in here.
@@ -911,8 +910,11 @@ It should return non-nil if the file is acceptable. The default is
911 ;; (setq user (nth 2 (file-attributes file))) 910 ;; (setq user (nth 2 (file-attributes file)))
912 ;; (and prev-user (not (equal user prev-user)))) 911 ;; (and prev-user (not (equal user prev-user))))
913 (string-match locate-dominating-stop-dir-regexp file))) 912 (string-match locate-dominating-stop-dir-regexp file)))
914 (setq try (funcall (or predicate 'file-exists-p) 913 ;; FIXME? maybe this function should (optionally?)
915 (expand-file-name name file))) 914 ;; use file-readable-p instead. In many cases, an unreadable
915 ;; FILE is no better than a non-existent one.
916 ;; See eg dir-locals-find-file.
917 (setq try (file-exists-p (expand-file-name name file)))
916 (cond (try (setq root file)) 918 (cond (try (setq root file))
917 ((equal file (setq file (file-name-directory 919 ((equal file (setq file (file-name-directory
918 (directory-file-name file)))) 920 (directory-file-name file))))
@@ -3550,7 +3552,7 @@ across different environments and users.")
3550 "Find the directory-local variables for FILE. 3552 "Find the directory-local variables for FILE.
3551This searches upward in the directory tree from FILE. 3553This searches upward in the directory tree from FILE.
3552It stops at the first directory that has been registered in 3554It stops at the first directory that has been registered in
3553`dir-locals-directory-cache' or contains a readable `dir-locals-file'. 3555`dir-locals-directory-cache' or contains a `dir-locals-file'.
3554If it finds an entry in the cache, it checks that it is valid. 3556If it finds an entry in the cache, it checks that it is valid.
3555A cache entry with no modification time element (normally, one that 3557A cache entry with no modification time element (normally, one that
3556has been assigned directly using `dir-locals-set-directory-class', not 3558has been assigned directly using `dir-locals-set-directory-class', not
@@ -3568,15 +3570,18 @@ of no valid cache entry."
3568 (if (eq system-type 'ms-dos) 3570 (if (eq system-type 'ms-dos)
3569 (dosified-file-name dir-locals-file) 3571 (dosified-file-name dir-locals-file)
3570 dir-locals-file)) 3572 dir-locals-file))
3571 ;; FIXME? Is it right to silently ignore unreadable files? 3573 (locals-file (locate-dominating-file file dir-locals-file-name))
3572 (locals-file (locate-dominating-file file dir-locals-file-name
3573 (lambda (file)
3574 (and (file-readable-p file)
3575 (file-regular-p file)))))
3576 (dir-elt nil)) 3574 (dir-elt nil))
3577 ;; `locate-dominating-file' may have abbreviated the name. 3575 ;; `locate-dominating-file' may have abbreviated the name.
3578 (if locals-file 3576 (and locals-file
3579 (setq locals-file (expand-file-name dir-locals-file-name locals-file))) 3577 (setq locals-file (expand-file-name dir-locals-file-name locals-file)))
3578 ;; Let dir-locals-read-from-file inform us via demoted-errors
3579 ;; about unreadable files, etc.
3580 ;; Maybe we'd want to keep searching though - that is
3581 ;; a locate-dominating-file issue.
3582;;; (or (not (file-readable-p locals-file))
3583;;; (not (file-regular-p locals-file)))
3584;;; (setq locals-file nil))
3580 ;; Find the best cached value in `dir-locals-directory-cache'. 3585 ;; Find the best cached value in `dir-locals-directory-cache'.
3581 (dolist (elt dir-locals-directory-cache) 3586 (dolist (elt dir-locals-directory-cache)
3582 (when (and (eq t (compare-strings file nil (length (car elt)) 3587 (when (and (eq t (compare-strings file nil (length (car elt))
@@ -3618,15 +3623,19 @@ FILE is the name of the file holding the variables to apply.
3618The new class name is the same as the directory in which FILE 3623The new class name is the same as the directory in which FILE
3619is found. Returns the new class name." 3624is found. Returns the new class name."
3620 (with-temp-buffer 3625 (with-temp-buffer
3621 (insert-file-contents file) 3626 ;; Errors reading the file are not very informative.
3622 (let* ((dir-name (file-name-directory file)) 3627 ;; Eg just "Error: (end-of-file)" does not give any clue that the
3623 (class-name (intern dir-name)) 3628 ;; problem is related to dir-locals.
3624 (variables (let ((read-circle nil)) 3629 (with-demoted-errors
3625 (read (current-buffer))))) 3630 (insert-file-contents file)
3626 (dir-locals-set-class-variables class-name variables) 3631 (let* ((dir-name (file-name-directory file))
3627 (dir-locals-set-directory-class dir-name class-name 3632 (class-name (intern dir-name))
3628 (nth 5 (file-attributes file))) 3633 (variables (let ((read-circle nil))
3629 class-name))) 3634 (read (current-buffer)))))
3635 (dir-locals-set-class-variables class-name variables)
3636 (dir-locals-set-directory-class dir-name class-name
3637 (nth 5 (file-attributes file)))
3638 class-name))))
3630 3639
3631(defun hack-dir-local-variables () 3640(defun hack-dir-local-variables ()
3632 "Read per-directory local variables for the current buffer. 3641 "Read per-directory local variables for the current buffer.
diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog
index a4c1513926d..1e787642664 100644
--- a/lisp/gnus/ChangeLog
+++ b/lisp/gnus/ChangeLog
@@ -1,3 +1,13 @@
12012-03-12 Lars Magne Ingebrigtsen <larsi@gnus.org>
2
3 * gnus-int.el (gnus-backend-trace): Flip default to nil before Emacs
4 24.1 release.
5
62012-03-10 David Edmondson <dme@dme.org>
7
8 * mm-uu.el (mm-uu-forward-extract): Allow for blank lines between the
9 'Forwarded Message' header and the start of the message.
10
12012-03-04 Thierry Volpiatto <thierry.volpiatto@gmail.com> 112012-03-04 Thierry Volpiatto <thierry.volpiatto@gmail.com>
2 12
3 * gnus-msg.el (gnus-msg-mail): Call `message-mail' correctly when Gnus 13 * gnus-msg.el (gnus-msg-mail): Call `message-mail' correctly when Gnus
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/mm-uu.el b/lisp/gnus/mm-uu.el
index 327665bdbbf..0cf3730d095 100644
--- a/lisp/gnus/mm-uu.el
+++ b/lisp/gnus/mm-uu.el
@@ -187,7 +187,7 @@ This can be either \"inline\" or \"attachment\".")
187 nil) 187 nil)
188 (verbatim-marks 188 (verbatim-marks
189 ;; slrn-style verbatim marks, see 189 ;; slrn-style verbatim marks, see
190 ;; http://www.slrn.org/manual/slrn-manual-6.html#ss6.81 190 ;; http://slrn.sourceforge.net/docs/slrn-manual-6.html#process_verbatim_marks
191 "^#v\\+" 191 "^#v\\+"
192 "^#v\\-$" 192 "^#v\\-$"
193 (lambda () (mm-uu-verbatim-marks-extract 0 0)) 193 (lambda () (mm-uu-verbatim-marks-extract 0 0))
@@ -430,7 +430,11 @@ apply the face `mm-uu-extract'."
430 430
431(defun mm-uu-forward-extract () 431(defun mm-uu-forward-extract ()
432 (mm-make-handle (mm-uu-copy-to-buffer 432 (mm-make-handle (mm-uu-copy-to-buffer
433 (progn (goto-char start-point) (forward-line) (point)) 433 (progn
434 (goto-char start-point)
435 (forward-line)
436 (skip-chars-forward "\n")
437 (point))
434 (progn (goto-char end-point) (forward-line -1) (point))) 438 (progn (goto-char end-point) (forward-line -1) (point)))
435 '("message/rfc822" (charset . gnus-decoded)))) 439 '("message/rfc822" (charset . gnus-decoded))))
436 440
diff --git a/lisp/ibuffer.el b/lisp/ibuffer.el
index 17be5534138..536992f5bc8 100644
--- a/lisp/ibuffer.el
+++ b/lisp/ibuffer.el
@@ -2140,11 +2140,10 @@ If optional arg SILENT is non-nil, do not display progress messages."
2140 (unless silent 2140 (unless silent
2141 (message "Redisplaying current buffer list...")) 2141 (message "Redisplaying current buffer list..."))
2142 (let ((blist (ibuffer-current-state-list))) 2142 (let ((blist (ibuffer-current-state-list)))
2143 (when (null blist) 2143 (when (and (null blist)
2144 (if (and (featurep 'ibuf-ext) 2144 (featurep 'ibuf-ext)
2145 (or ibuffer-filtering-qualifiers ibuffer-hidden-filter-groups)) 2145 (or ibuffer-filtering-qualifiers ibuffer-hidden-filter-groups))
2146 (message "No buffers! (note: filtering in effect)") 2146 (message "No buffers! (note: filtering in effect)"))
2147 (error "No buffers!")))
2148 (ibuffer-redisplay-engine blist t) 2147 (ibuffer-redisplay-engine blist t)
2149 (unless silent 2148 (unless silent
2150 (message "Redisplaying current buffer list...done")) 2149 (message "Redisplaying current buffer list...done"))
@@ -2174,11 +2173,10 @@ If optional arg SILENT is non-nil, do not display progress messages."
2174 (cadr bufs)) 2173 (cadr bufs))
2175 (ibuffer-current-buffers-with-marks bufs) 2174 (ibuffer-current-buffers-with-marks bufs)
2176 ibuffer-display-maybe-show-predicates))) 2175 ibuffer-display-maybe-show-predicates)))
2177 (when (null blist) 2176 (and (null blist)
2178 (if (and (featurep 'ibuf-ext) 2177 (featurep 'ibuf-ext)
2179 ibuffer-filtering-qualifiers) 2178 ibuffer-filtering-qualifiers
2180 (message "No buffers! (note: filtering in effect)") 2179 (message "No buffers! (note: filtering in effect)"))
2181 (error "No buffers!")))
2182 (unless silent 2180 (unless silent
2183 (message "Updating buffer list...")) 2181 (message "Updating buffer list..."))
2184 (ibuffer-redisplay-engine blist arg) 2182 (ibuffer-redisplay-engine blist arg)
diff --git a/lisp/international/fontset.el b/lisp/international/fontset.el
index 561194d710c..7e893a3d751 100644
--- a/lisp/international/fontset.el
+++ b/lisp/international/fontset.el
@@ -58,6 +58,7 @@
58 ("jisx0208" . japanese-jisx0208) 58 ("jisx0208" . japanese-jisx0208)
59 ("jisx0201" . jisx0201) 59 ("jisx0201" . jisx0201)
60 ("jisx0212" . japanese-jisx0212) 60 ("jisx0212" . japanese-jisx0212)
61 ("ksx1001" . korean-ksc5601)
61 ("ksc5601.1987" . korean-ksc5601) 62 ("ksc5601.1987" . korean-ksc5601)
62 ("cns11643.1992.*1" . chinese-cns11643-1) 63 ("cns11643.1992.*1" . chinese-cns11643-1)
63 ("cns11643.1992.*2" . chinese-cns11643-2) 64 ("cns11643.1992.*2" . chinese-cns11643-2)
diff --git a/lisp/international/quail.el b/lisp/international/quail.el
index 48aa013c674..e0e6bfd465b 100644
--- a/lisp/international/quail.el
+++ b/lisp/international/quail.el
@@ -825,20 +825,35 @@ The format of KBD-LAYOUT is the same as `quail-keyboard-layout'."
825 (setq i 0) 825 (setq i 0)
826 (while (< i quail-keyboard-layout-len) 826 (while (< i quail-keyboard-layout-len)
827 (when (= (% i 30) 0) 827 (when (= (% i 30) 0)
828 ;; Insert LRO to avoid bidi-reordering of keyboard cells.
829 (insert (propertize (string ?\x202d) 'invisible t))
828 (setq row (/ i 30)) 830 (setq row (/ i 30))
829 (if (> row 1) 831 (if (> row 1)
830 (insert-char 32 (+ row (/ (- row 2) 2))))) 832 (insert-char 32 (+ row (/ (- row 2) 2)))))
831 (setq lower (aref layout i) 833 (setq lower (aref layout i)
832 upper (aref layout (1+ i))) 834 upper (aref layout (1+ i)))
833 (insert bar) 835 (insert bar)
834 (if (= (if (stringp lower) (string-width lower) (char-width lower)) 1) 836 (if (< (if (stringp lower) (string-width lower) (char-width lower)) 2)
835 (insert " ")) 837 (insert " "))
836 (insert lower upper) 838 (if (and (characterp lower)
837 (if (= (if (stringp upper) (string-width upper) (char-width upper)) 1) 839 (eq (get-char-code-property lower 'general-category) 'Mn))
840 ;; Pad the left and right of non-spacing characters.
841 (setq lower (compose-string (string lower) 0 1
842 (format "\t%c\t" lower))))
843 (if (and (characterp upper)
844 (eq (get-char-code-property upper 'general-category) 'Mn))
845 ;; Pad the left and right of non-spacing characters.
846 (setq upper (compose-string (string upper) 0 1
847 (format "\t%c\t" upper))))
848 (insert lower (propertize " " 'invisible t) upper)
849 (if (< (if (stringp upper) (string-width upper) (char-width upper)) 2)
838 (insert " ")) 850 (insert " "))
839 (setq i (+ i 2)) 851 (setq i (+ i 2))
840 (if (= (% i 30) 0) 852 (if (= (% i 30) 0)
841 (insert bar "\n"))) 853 (insert bar
854 ;; Insert PDF to deny the previously inserted LRO.
855 (propertize (string ?\x202c) 'invisible t)
856 "\n")))
842 ;; Insert horizontal lines while deleting blank key columns at the 857 ;; Insert horizontal lines while deleting blank key columns at the
843 ;; beginning and end of each line. 858 ;; beginning and end of each line.
844 (save-restriction 859 (save-restriction
@@ -849,20 +864,21 @@ The format of KBD-LAYOUT is the same as `quail-keyboard-layout'."
849 ;;(delete-region pos (point))) 864 ;;(delete-region pos (point)))
850 (let ((from1 100) (to1 0) from2 to2) 865 (let ((from1 100) (to1 0) from2 to2)
851 (while (not (eobp)) 866 (while (not (eobp))
852 (if (looking-at "[| ]*$") 867 (if (looking-at "[| \u202c\u202d]*$")
853 ;; The entire row is blank. 868 ;; The entire row is blank.
854 (delete-region (point) (match-end 0)) 869 (delete-region (point) (match-end 0))
855 ;; Delete blank key columns at the head. 870 ;; Delete blank key columns at the head.
856 (if (looking-at " *\\(| \\)+") 871 (if (looking-at "\u202d? *\\(| \\)+")
857 (subst-char-in-region (point) (match-end 0) ?| ? )) 872 (subst-char-in-region (point) (match-end 0) ?| ? ))
858 ;; Delete blank key columns at the tail. 873 ;; Delete blank key columns at the tail.
859 (if (re-search-forward "\\( |\\)+$" (line-end-position) t) 874 (if (re-search-forward "\\( |\\)+\u202c?$"
875 (line-end-position) t)
860 (delete-region (match-beginning 0) (point))) 876 (delete-region (match-beginning 0) (point)))
861 (beginning-of-line)) 877 (beginning-of-line))
862 ;; Calculate the start and end columns of a horizontal line. 878 ;; Calculate the start and end columns of a horizontal line.
863 (if (eolp) 879 (if (eolp)
864 (setq from2 from1 to2 to1) 880 (setq from2 from1 to2 to1)
865 (skip-chars-forward " ") 881 (skip-chars-forward " \u202d")
866 (setq from2 (current-column)) 882 (setq from2 (current-column))
867 (end-of-line) 883 (end-of-line)
868 (setq to2 (current-column)) 884 (setq to2 (current-column))
diff --git a/lisp/mail/mail-utils.el b/lisp/mail/mail-utils.el
index a20201fb529..9059da817b6 100644
--- a/lisp/mail/mail-utils.el
+++ b/lisp/mail/mail-utils.el
@@ -63,12 +63,16 @@ from START (inclusive) to END (exclusive)."
63 63
64;;;###autoload 64;;;###autoload
65(defun mail-quote-printable (string &optional wrapper) 65(defun mail-quote-printable (string &optional wrapper)
66 "Convert a string to the \"quoted printable\" Q encoding. 66 "Convert a string to the \"quoted printable\" Q encoding if necessary.
67If the string contains only ASCII characters and no troublesome ones,
68we return it unconverted.
69
67If the optional argument WRAPPER is non-nil, 70If the optional argument WRAPPER is non-nil,
68we add the wrapper characters =?ISO-8859-1?Q?....?=." 71we add the wrapper characters =?ISO-8859-1?Q?....?=."
69 (let ((i 0) (result "")) 72 (let ((i 0) (result ""))
70 (save-match-data 73 (save-match-data
71 (while (string-match "[?=\"\200-\377]" string i) 74 (while (or (string-match "[?=\"]" string i)
75 (string-match "[^\000-\177]" string i))
72 (setq result 76 (setq result
73 (concat result (substring string i (match-beginning 0)) 77 (concat result (substring string i (match-beginning 0))
74 (upcase (format "=%02x" 78 (upcase (format "=%02x"
diff --git a/lisp/mail/rmail.el b/lisp/mail/rmail.el
index 2d327c7a0f0..3a9ba8122ab 100644
--- a/lisp/mail/rmail.el
+++ b/lisp/mail/rmail.el
@@ -1363,8 +1363,7 @@ sets the current buffer's `buffer-file-coding-system' to that of
1363(defun rmail-buffers-swapped-p () 1363(defun rmail-buffers-swapped-p ()
1364 "Return non-nil if the message collection is in `rmail-view-buffer'." 1364 "Return non-nil if the message collection is in `rmail-view-buffer'."
1365 ;; This is analogous to tar-data-swapped-p in tar-mode.el. 1365 ;; This is analogous to tar-data-swapped-p in tar-mode.el.
1366 (and (buffer-live-p rmail-view-buffer) 1366 rmail-buffer-swapped)
1367 rmail-buffer-swapped))
1368 1367
1369(defun rmail-change-major-mode-hook () 1368(defun rmail-change-major-mode-hook ()
1370 ;; Bring the actual Rmail messages back into the main buffer. 1369 ;; Bring the actual Rmail messages back into the main buffer.
@@ -1406,7 +1405,8 @@ If so restore the actual mbox message collection."
1406 (kill-buffer rmail-view-buffer)))) 1405 (kill-buffer rmail-view-buffer))))
1407 1406
1408(defun rmail-view-buffer-kill-buffer-hook () 1407(defun rmail-view-buffer-kill-buffer-hook ()
1409 (error "Can't kill message view buffer by itself")) 1408 (error "Can't kill Rmail view buffer `%s' by itself"
1409 (buffer-name (current-buffer))))
1410 1410
1411;; Set up the permanent locals associated with an Rmail file. 1411;; Set up the permanent locals associated with an Rmail file.
1412(defun rmail-perm-variables () 1412(defun rmail-perm-variables ()
@@ -4472,7 +4472,11 @@ encoded string (and the same mask) will decode the string."
4472 4472
4473;; Used in `write-region-annotate-functions' to write rmail files. 4473;; Used in `write-region-annotate-functions' to write rmail files.
4474(defun rmail-write-region-annotate (start end) 4474(defun rmail-write-region-annotate (start end)
4475 (when (and (null start) (rmail-buffers-swapped-p)) 4475 (when (and (null start) rmail-buffer-swapped)
4476 (unless (buffer-live-p rmail-view-buffer)
4477 (error "Buffer `%s' with real text of `%s' has disappeared"
4478 (buffer-name rmail-view-buffer)
4479 (buffer-name (current-buffer))))
4476 (setq rmail-message-encoding buffer-file-coding-system) 4480 (setq rmail-message-encoding buffer-file-coding-system)
4477 (set-buffer rmail-view-buffer) 4481 (set-buffer rmail-view-buffer)
4478 (widen) 4482 (widen)
diff --git a/lisp/mail/sendmail.el b/lisp/mail/sendmail.el
index 91e0b183a68..f4dfcfcf647 100644
--- a/lisp/mail/sendmail.el
+++ b/lisp/mail/sendmail.el
@@ -1085,7 +1085,9 @@ 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 (rfc2047-encode-encoded-words nil)) 1088 ;; rms: this proved necessary, but I don't recall why.
1089 ;; Can anyone determine why, and state it here?
1090 (rfc2047-encode-encoded-words t))
1089 (rfc2047-encode-message-header) 1091 (rfc2047-encode-message-header)
1090 (= tick (buffer-chars-modified-tick))))) 1092 (= tick (buffer-chars-modified-tick)))))
1091 1093
diff --git a/lisp/mail/smtpmail.el b/lisp/mail/smtpmail.el
index 3233cff2768..8e96e2c9438 100644
--- a/lisp/mail/smtpmail.el
+++ b/lisp/mail/smtpmail.el
@@ -324,7 +324,10 @@ The list is in preference order.")
324 (if (re-search-forward "^FCC:" delimline t) 324 (if (re-search-forward "^FCC:" delimline t)
325 ;; Force `mail-do-fcc' to use the encoding of the mail 325 ;; Force `mail-do-fcc' to use the encoding of the mail
326 ;; buffer to encode outgoing messages on FCC files. 326 ;; buffer to encode outgoing messages on FCC files.
327 (let ((coding-system-for-write smtpmail-code-conv-from)) 327 (let ((coding-system-for-write
328 ;; mbox files must have Unix EOLs.
329 (coding-system-change-eol-conversion
330 smtpmail-code-conv-from 'unix)))
328 (mail-do-fcc delimline))) 331 (mail-do-fcc delimline)))
329 (if mail-interactive 332 (if mail-interactive
330 (with-current-buffer errbuf 333 (with-current-buffer errbuf
diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el
index 1fdf33bf610..6a6bba13523 100644
--- a/lisp/minibuffer.el
+++ b/lisp/minibuffer.el
@@ -162,7 +162,7 @@ Like CL's `some'."
162(defun complete-with-action (action table string pred) 162(defun complete-with-action (action table string pred)
163 "Perform completion ACTION. 163 "Perform completion ACTION.
164STRING is the string to complete. 164STRING is the string to complete.
165TABLE is the completion table, which should not be a function. 165TABLE is the completion table.
166PRED is a completion predicate. 166PRED is a completion predicate.
167ACTION can be one of nil, t or `lambda'." 167ACTION can be one of nil, t or `lambda'."
168 (cond 168 (cond
@@ -776,7 +776,8 @@ scroll the window of possible completions."
776 (interactive) 776 (interactive)
777 ;; If the previous command was not this, 777 ;; If the previous command was not this,
778 ;; mark the completion buffer obsolete. 778 ;; mark the completion buffer obsolete.
779 (unless (eq this-command last-command) 779 (setq this-command 'completion-at-point)
780 (unless (eq 'completion-at-point last-command)
780 (completion--flush-all-sorted-completions) 781 (completion--flush-all-sorted-completions)
781 (setq minibuffer-scroll-window nil)) 782 (setq minibuffer-scroll-window nil))
782 783
@@ -1483,10 +1484,13 @@ exit."
1483 (minibuffer-completion-predicate predicate) 1484 (minibuffer-completion-predicate predicate)
1484 (ol (make-overlay start end nil nil t))) 1485 (ol (make-overlay start end nil nil t)))
1485 (overlay-put ol 'field 'completion) 1486 (overlay-put ol 'field 'completion)
1487 ;; HACK: if the text we are completing is already in a field, we
1488 ;; want the completion field to take priority (e.g. Bug#6830).
1489 (overlay-put ol 'priority 100)
1486 (when completion-in-region-mode-predicate 1490 (when completion-in-region-mode-predicate
1487 (completion-in-region-mode 1) 1491 (completion-in-region-mode 1)
1488 (setq completion-in-region--data 1492 (setq completion-in-region--data
1489 (list (current-buffer) start end collection))) 1493 (list (current-buffer) start end collection)))
1490 (unwind-protect 1494 (unwind-protect
1491 (call-interactively 'minibuffer-complete) 1495 (call-interactively 'minibuffer-complete)
1492 (delete-overlay ol))))) 1496 (delete-overlay ol)))))
@@ -1653,9 +1657,10 @@ The completion method is determined by `completion-at-point-functions'."
1653 ;; introduce a corresponding hook (plus another for word-completion, 1657 ;; introduce a corresponding hook (plus another for word-completion,
1654 ;; and another for force-completion, maybe?). 1658 ;; and another for force-completion, maybe?).
1655 (overlay-put ol 'field 'completion) 1659 (overlay-put ol 'field 'completion)
1660 (overlay-put ol 'priority 100)
1656 (completion-in-region-mode 1) 1661 (completion-in-region-mode 1)
1657 (setq completion-in-region--data 1662 (setq completion-in-region--data
1658 (list (current-buffer) start end collection)) 1663 (list (current-buffer) start end collection))
1659 (unwind-protect 1664 (unwind-protect
1660 (call-interactively 'minibuffer-completion-help) 1665 (call-interactively 'minibuffer-completion-help)
1661 (delete-overlay ol)))) 1666 (delete-overlay ol))))
diff --git a/lisp/net/dbus.el b/lisp/net/dbus.el
index fbc83bf1df0..feef78a305f 100644
--- a/lisp/net/dbus.el
+++ b/lisp/net/dbus.el
@@ -1039,7 +1039,8 @@ It will be registered for all objects created by `dbus-register-object'."
1039 (car (last key)) 1039 (car (last key))
1040 (list :variant (cdar (last (car val)))))))) 1040 (list :variant (cdar (last (car val))))))))
1041 dbus-registered-objects-table) 1041 dbus-registered-objects-table)
1042 (list result)))))) 1042 ;; Return the result, or an empty array.
1043 (list :array (or result '(:signature "{sv}"))))))))
1043 1044
1044 1045
1045;; Initialize :system and :session buses. This adds their file 1046;; Initialize :system and :session buses. This adds their file
diff --git a/lisp/net/mairix.el b/lisp/net/mairix.el
index 84343b7de00..a8e969a18c5 100644
--- a/lisp/net/mairix.el
+++ b/lisp/net/mairix.el
@@ -570,10 +570,10 @@ whole threads. Function returns t if messages were found."
570 mairix-output-buffer))) 570 mairix-output-buffer)))
571 (zerop rval))) 571 (zerop rval)))
572 572
573(defun mairix-replace-illegal-chars (header) 573(defun mairix-replace-invalid-chars (header)
574 "Replace illegal characters in HEADER for mairix query." 574 "Replace invalid characters in HEADER for mairix query."
575 (when header 575 (when header
576 (while (string-match "[^-.@/,& [:alnum:]]" header) 576 (while (string-match "[^-.@/,^=~& [:alnum:]]" header)
577 (setq header (replace-match "" t t header))) 577 (setq header (replace-match "" t t header)))
578 (while (string-match "[& ]" header) 578 (while (string-match "[& ]" header)
579 (setq header (replace-match "," t t header))) 579 (setq header (replace-match "," t t header)))
@@ -620,7 +620,7 @@ See %s for details" mairix-output-buffer)))
620 (concat 620 (concat
621 (nth 1 cur) 621 (nth 1 cur)
622 ":" 622 ":"
623 (mairix-replace-illegal-chars 623 (mairix-replace-invalid-chars
624 (widget-value 624 (widget-value
625 (cadr (assoc (concat "e" (car (cddr cur))) widgets))))) 625 (cadr (assoc (concat "e" (car (cddr cur))) widgets)))))
626 query))) 626 query)))
@@ -652,9 +652,17 @@ Fill in VALUES if based on an article."
652 (kill-all-local-variables) 652 (kill-all-local-variables)
653 (erase-buffer) 653 (erase-buffer)
654 (widget-insert 654 (widget-insert
655 "Specify your query for Mairix (check boxes for activating fields):\n\n") 655 "Specify your query for Mairix using check boxes for activating fields.\n\n")
656 (widget-insert 656 (widget-insert
657 "(Whitespaces will be converted to ',' (i.e. AND). Use '/' for OR.)\n\n") 657 (concat "Use ~word to match messages "
658 (propertize "not" 'face 'italic)
659 " containing the word)\n"
660 " substring= to match words containing the substring\n"
661 " substring=N to match words containing the substring, allowing\n"
662 " up to N errors(missing/extra/different letters)\n"
663 " ^substring= to match the substring at the beginning of a word.\n"))
664 (widget-insert
665 "Whitespace will be converted to ',' (i.e. AND). Use '/' for OR.\n\n")
658 (setq mairix-widgets (mairix-widget-build-editable-fields values)) 666 (setq mairix-widgets (mairix-widget-build-editable-fields values))
659 (when (member 'flags mairix-widget-other) 667 (when (member 'flags mairix-widget-other)
660 (widget-insert "\nFlags:\n Seen: ") 668 (widget-insert "\nFlags:\n Seen: ")
@@ -935,7 +943,7 @@ Use cursor keys or C-n,C-p to select next/previous search.\n\n")
935 (lambda (field) 943 (lambda (field)
936 (list (car (cddr field)) 944 (list (car (cddr field))
937 (if (car field) 945 (if (car field)
938 (mairix-replace-illegal-chars 946 (mairix-replace-invalid-chars
939 (funcall get-mail-header (car field))) 947 (funcall get-mail-header (car field)))
940 nil)))) 948 nil))))
941 mairix-widget-fields-list))) 949 mairix-widget-fields-list)))
diff --git a/lisp/nxml/nxml-mode.el b/lisp/nxml/nxml-mode.el
index a22288e7d4e..f9122e7245e 100644
--- a/lisp/nxml/nxml-mode.el
+++ b/lisp/nxml/nxml-mode.el
@@ -86,18 +86,9 @@ as the first attribute on the previous line."
86 :group 'nxml 86 :group 'nxml
87 :type 'integer) 87 :type 'integer)
88 88
89(defcustom nxml-bind-meta-tab-to-complete-flag (not window-system) 89(defcustom nxml-bind-meta-tab-to-complete-flag t
90 "Non-nil means bind M-TAB in `nxml-mode-map' to `nxml-complete'. 90 "Non-nil means to use nXML completion in \\[completion-at-point]."
91C-return will be bound to `nxml-complete' in any case.
92M-TAB gets swallowed by many window systems/managers, and
93`documentation' will show M-TAB rather than C-return as the
94binding for `nxml-complete' when both are bound. So it's better
95to bind M-TAB only when it will work."
96 :group 'nxml 91 :group 'nxml
97 :set (lambda (sym flag)
98 (set-default sym flag)
99 (when (and (boundp 'nxml-mode-map) nxml-mode-map)
100 (define-key nxml-mode-map "\M-\t" (and flag 'nxml-complete))))
101 :type 'boolean) 92 :type 'boolean)
102 93
103(defcustom nxml-prefer-utf-16-to-utf-8-flag nil 94(defcustom nxml-prefer-utf-16-to-utf-8-flag nil
@@ -418,9 +409,7 @@ reference.")
418 (define-key map "\C-c\C-o" nxml-outline-prefix-map) 409 (define-key map "\C-c\C-o" nxml-outline-prefix-map)
419 (define-key map [S-mouse-2] 'nxml-mouse-hide-direct-text-content) 410 (define-key map [S-mouse-2] 'nxml-mouse-hide-direct-text-content)
420 (define-key map "/" 'nxml-electric-slash) 411 (define-key map "/" 'nxml-electric-slash)
421 (define-key map [C-return] 'nxml-complete) 412 (define-key map "\M-\t" 'completion-at-point)
422 (when nxml-bind-meta-tab-to-complete-flag
423 (define-key map "\M-\t" 'nxml-complete))
424 map) 413 map)
425 "Keymap for nxml-mode.") 414 "Keymap for nxml-mode.")
426 415
@@ -479,7 +468,7 @@ the start-tag, point, and end-tag are all left on separate lines.
479If `nxml-slash-auto-complete-flag' is non-nil, then inserting a `</' 468If `nxml-slash-auto-complete-flag' is non-nil, then inserting a `</'
480automatically inserts the rest of the end-tag. 469automatically inserts the rest of the end-tag.
481 470
482\\[nxml-complete] performs completion on the symbol preceding point. 471\\[completion-at-point] performs completion on the symbol preceding point.
483 472
484\\[nxml-dynamic-markup-word] uses the contents of the current buffer 473\\[nxml-dynamic-markup-word] uses the contents of the current buffer
485to choose a tag to put around the word preceding point. 474to choose a tag to put around the word preceding point.
@@ -555,6 +544,8 @@ Many aspects this mode can be customized using
555 (nxml-clear-inside (point-min) (point-max)) 544 (nxml-clear-inside (point-min) (point-max))
556 (nxml-with-invisible-motion 545 (nxml-with-invisible-motion
557 (nxml-scan-prolog))))) 546 (nxml-scan-prolog)))))
547 (add-hook 'completion-at-point-functions
548 #'nxml-completion-at-point-function nil t)
558 (add-hook 'after-change-functions 'nxml-after-change nil t) 549 (add-hook 'after-change-functions 'nxml-after-change nil t)
559 (add-hook 'change-major-mode-hook 'nxml-cleanup nil t) 550 (add-hook 'change-major-mode-hook 'nxml-cleanup nil t)
560 551
@@ -1654,6 +1645,11 @@ depend on `nxml-completion-hook'."
1654 (ding) 1645 (ding)
1655 (message "Cannot complete in this context"))) 1646 (message "Cannot complete in this context")))
1656 1647
1648(defun nxml-completion-at-point-function ()
1649 "Call `nxml-complete' to perform completion at point."
1650 (when nxml-bind-meta-tab-to-complete-flag
1651 #'nxml-complete))
1652
1657;;; Movement 1653;;; Movement
1658 1654
1659(defun nxml-forward-balanced-item (&optional arg) 1655(defun nxml-forward-balanced-item (&optional arg)
diff --git a/lisp/progmodes/cc-cmds.el b/lisp/progmodes/cc-cmds.el
index 509bb203f78..55ab6c9981c 100644
--- a/lisp/progmodes/cc-cmds.el
+++ b/lisp/progmodes/cc-cmds.el
@@ -1958,7 +1958,12 @@ with a brace block."
1958 1958
1959(defun c-mark-function () 1959(defun c-mark-function ()
1960 "Put mark at end of the current top-level declaration or macro, point at beginning. 1960 "Put mark at end of the current top-level declaration or macro, point at beginning.
1961If point is not inside any then the closest following one is chosen. 1961If point is not inside any then the closest following one is
1962chosen. Each successive call of this command extends the marked
1963region by one function.
1964
1965A mark is left where the command started, unless the region is already active
1966\(in Transient Mark mode).
1962 1967
1963As opposed to \\[c-beginning-of-defun] and \\[c-end-of-defun], this 1968As opposed to \\[c-beginning-of-defun] and \\[c-end-of-defun], this
1964function does not require the declaration to contain a brace block." 1969function does not require the declaration to contain a brace block."
@@ -1974,8 +1979,24 @@ function does not require the declaration to contain a brace block."
1974 1979
1975 (if (not decl-limits) 1980 (if (not decl-limits)
1976 (error "Cannot find any declaration") 1981 (error "Cannot find any declaration")
1977 (goto-char (car decl-limits)) 1982 (let* ((extend-region-p
1978 (push-mark (cdr decl-limits) nil t)))) 1983 (and (eq this-command 'c-mark-function)
1984 (eq last-command 'c-mark-function)))
1985 (push-mark-p (and (eq this-command 'c-mark-function)
1986 (not extend-region-p)
1987 (not (and transient-mark-mode mark-active)))))
1988 (if push-mark-p (push-mark (point)))
1989 (if extend-region-p
1990 (progn
1991 (exchange-point-and-mark)
1992 (setq decl-limits (c-declaration-limits t))
1993 (when (not decl-limits)
1994 (exchange-point-and-mark)
1995 (error "Cannot find any declaration"))
1996 (goto-char (cdr decl-limits))
1997 (exchange-point-and-mark))
1998 (goto-char (car decl-limits))
1999 (push-mark (cdr decl-limits) nil t))))))
1979 2000
1980(defun c-cpp-define-name () 2001(defun c-cpp-define-name ()
1981 "Return the name of the current CPP macro, or NIL if we're not in one." 2002 "Return the name of the current CPP macro, or NIL if we're not in one."
diff --git a/lisp/progmodes/cc-engine.el b/lisp/progmodes/cc-engine.el
index 3b33ac894f2..f392971e7d1 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
@@ -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
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/replace.el b/lisp/replace.el
index 349e63d4201..9fbaa279079 100644
--- a/lisp/replace.el
+++ b/lisp/replace.el
@@ -2116,13 +2116,13 @@ make, or the user didn't cancel the call."
2116 (if query-replace-lazy-highlight 2116 (if query-replace-lazy-highlight
2117 (let ((isearch-string string) 2117 (let ((isearch-string string)
2118 (isearch-regexp regexp) 2118 (isearch-regexp regexp)
2119 ;; Set isearch-word to nil because word-replace is regexp-based,
2120 ;; so `isearch-search-fun' should not use `word-search-forward'.
2121 (isearch-word nil)
2119 (search-whitespace-regexp nil) 2122 (search-whitespace-regexp nil)
2120 (isearch-case-fold-search case-fold) 2123 (isearch-case-fold-search case-fold)
2121 (isearch-forward t) 2124 (isearch-forward t)
2122 (isearch-error nil)) 2125 (isearch-error nil))
2123 ;; Set isearch-word to nil because word-replace is regexp-based,
2124 ;; so `isearch-search-fun' should not use `word-search-forward'.
2125 (if (and isearch-word isearch-regexp) (setq isearch-word nil))
2126 (isearch-lazy-highlight-new-loop range-beg range-end)))) 2126 (isearch-lazy-highlight-new-loop range-beg range-end))))
2127 2127
2128(defun replace-dehighlight () 2128(defun replace-dehighlight ()
diff --git a/lisp/savehist.el b/lisp/savehist.el
index c1515fa48ce..a65906a1676 100644
--- a/lisp/savehist.el
+++ b/lisp/savehist.el
@@ -369,9 +369,11 @@ trimming of history lists to `history-length' items."
369 "Return non-nil if VALUE is printable." 369 "Return non-nil if VALUE is printable."
370 (cond 370 (cond
371 ;; Quick response for oft-encountered types known to be printable. 371 ;; Quick response for oft-encountered types known to be printable.
372 ((stringp value))
373 ((numberp value)) 372 ((numberp value))
374 ((symbolp value)) 373 ((symbolp value))
374 ;; String without properties
375 ((and (stringp value)
376 (equal-including-properties value (substring-no-properties value))))
375 (t 377 (t
376 ;; For others, check explicitly. 378 ;; For others, check explicitly.
377 (with-temp-buffer 379 (with-temp-buffer
diff --git a/lisp/server.el b/lisp/server.el
index 34ac5d7ba23..ed83225eccd 100644
--- a/lisp/server.el
+++ b/lisp/server.el
@@ -706,9 +706,29 @@ Server mode runs a process that accepts commands from the
706 (pp v) 706 (pp v)
707 (let ((text (buffer-substring-no-properties 707 (let ((text (buffer-substring-no-properties
708 (point-min) (point-max)))) 708 (point-min) (point-max))))
709 (server-send-string 709 (server-reply-print (server-quote-arg text) proc)))))))
710 proc (format "-print %s\n" 710
711 (server-quote-arg text))))))))) 711(defconst server-msg-size 1024
712 "Maximum size of a message sent to a client.")
713
714(defun server-reply-print (qtext proc)
715 "Send a `-print QTEXT' command to client PROC.
716QTEXT must be already quoted.
717This handles splitting the command if it would be bigger than
718`server-msg-size'."
719 (let ((prefix "-print ")
720 part)
721 (while (> (+ (length qtext) (length prefix) 1) server-msg-size)
722 ;; We have to split the string
723 (setq part (substring qtext 0 (- server-msg-size (length prefix) 1)))
724 ;; Don't split in the middle of a quote sequence
725 (if (string-match "\\(^\\|[^&]\\)\\(&&\\)+$" part)
726 ;; There is an uneven number of & at the end
727 (setq part (substring part 0 -1)))
728 (setq qtext (substring qtext (length part)))
729 (server-send-string proc (concat prefix part "\n"))
730 (setq prefix "-print-nonl "))
731 (server-send-string proc (concat prefix qtext "\n"))))
712 732
713(defun server-create-tty-frame (tty type proc) 733(defun server-create-tty-frame (tty type proc)
714 (unless tty 734 (unless tty
@@ -911,6 +931,11 @@ The following commands are accepted by the client:
911 Print STRING on stdout. Used to send values 931 Print STRING on stdout. Used to send values
912 returned by -eval. 932 returned by -eval.
913 933
934`-print-nonl STRING'
935 Print STRING on stdout. Used to continue a
936 preceding -print command that would be too big to send
937 in a single message.
938
914`-error DESCRIPTION' 939`-error DESCRIPTION'
915 Signal an error and delete process PROC. 940 Signal an error and delete process PROC.
916 941
@@ -1534,46 +1559,54 @@ only these files will be asked to be saved."
1534Returns the result of the evaluation, or signals an error if it 1559Returns the result of the evaluation, or signals an error if it
1535cannot contact the specified server. For example: 1560cannot contact the specified server. For example:
1536 \(server-eval-at \"server\" '(emacs-pid)) 1561 \(server-eval-at \"server\" '(emacs-pid))
1537returns the process ID of the Emacs instance running \"server\". 1562returns the process ID of the Emacs instance running \"server\"."
1538This function requires the use of TCP sockets. " 1563 (let* ((server-dir (if server-use-tcp server-auth-dir server-socket-dir))
1539 (or server-use-tcp 1564 (server-file (expand-file-name server server-dir))
1540 (error "This function requires TCP sockets")) 1565 (coding-system-for-read 'binary)
1541 (let ((auth-file (expand-file-name server server-auth-dir)) 1566 (coding-system-for-write 'binary)
1542 (coding-system-for-read 'binary) 1567 address port secret process)
1543 (coding-system-for-write 'binary) 1568 (unless (file-exists-p server-file)
1544 address port secret process) 1569 (error "No such server: %s" server))
1545 (unless (file-exists-p auth-file)
1546 (error "No such server definition: %s" auth-file))
1547 (with-temp-buffer 1570 (with-temp-buffer
1548 (insert-file-contents auth-file) 1571 (when server-use-tcp
1549 (unless (looking-at "\\([0-9.]+\\):\\([0-9]+\\)") 1572 (let ((coding-system-for-read 'no-conversion))
1550 (error "Invalid auth file")) 1573 (insert-file-contents server-file)
1551 (setq address (match-string 1) 1574 (unless (looking-at "\\([0-9.]+\\):\\([0-9]+\\)")
1552 port (string-to-number (match-string 2))) 1575 (error "Invalid auth file"))
1553 (forward-line 1) 1576 (setq address (match-string 1)
1554 (setq secret (buffer-substring (point) (line-end-position))) 1577 port (string-to-number (match-string 2)))
1555 (erase-buffer) 1578 (forward-line 1)
1556 (unless (setq process (open-network-stream "eval-at" (current-buffer) 1579 (setq secret (buffer-substring (point) (line-end-position)))
1557 address port)) 1580 (erase-buffer)))
1558 (error "Unable to contact the server")) 1581 (unless (setq process (make-network-process
1559 (set-process-query-on-exit-flag process nil) 1582 :name "eval-at"
1560 (process-send-string 1583 :buffer (current-buffer)
1561 process 1584 :host address
1562 (concat "-auth " secret " -eval " 1585 :service (if server-use-tcp port server-file)
1563 (replace-regexp-in-string 1586 :family (if server-use-tcp 'ipv4 'local)
1564 " " "&_" (format "%S" form)) 1587 :noquery t))
1565 "\n")) 1588 (error "Unable to contact the server"))
1589 (if server-use-tcp
1590 (process-send-string process (concat "-auth " secret "\n")))
1591 (process-send-string process
1592 (concat "-eval "
1593 (server-quote-arg (format "%S" form))
1594 "\n"))
1566 (while (memq (process-status process) '(open run)) 1595 (while (memq (process-status process) '(open run))
1567 (accept-process-output process 0 10)) 1596 (accept-process-output process 0 10))
1568 (goto-char (point-min)) 1597 (goto-char (point-min))
1569 ;; If the result is nil, there's nothing in the buffer. If the 1598 ;; If the result is nil, there's nothing in the buffer. If the
1570 ;; result is non-nil, it's after "-print ". 1599 ;; result is non-nil, it's after "-print ".
1571 (when (search-forward "\n-print" nil t) 1600 (let ((answer ""))
1572 (let ((start (point))) 1601 (while (re-search-forward "\n-print\\(-nonl\\)? " nil t)
1573 (while (search-forward "&_" nil t) 1602 (setq answer
1574 (replace-match " " t t)) 1603 (concat answer
1575 (goto-char start) 1604 (buffer-substring (point)
1576 (read (current-buffer))))))) 1605 (progn (skip-chars-forward "^\n")
1606 (point))))))
1607 (if (not (equal answer ""))
1608 (read (decode-coding-string (server-unquote-arg answer)
1609 'emacs-internal)))))))
1577 1610
1578 1611
1579(provide 'server) 1612(provide 'server)
diff --git a/lisp/simple.el b/lisp/simple.el
index 45daf99f614..936037f5caa 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -893,16 +893,23 @@ that uses or sets the mark."
893;; Counting lines, one way or another. 893;; Counting lines, one way or another.
894 894
895(defun goto-line (line &optional buffer) 895(defun goto-line (line &optional buffer)
896 "Goto LINE, counting from line 1 at beginning of buffer. 896 "Go to LINE, counting from line 1 at beginning of buffer.
897Normally, move point in the current buffer, and leave mark at the 897If called interactively, a numeric prefix argument specifies
898previous position. With just \\[universal-argument] as argument, 898LINE; without a numeric prefix argument, read LINE from the
899move point in the most recently selected other buffer, and switch to it. 899minibuffer.
900
901If optional argument BUFFER is non-nil, switch to that buffer and
902move to line LINE there. If called interactively with \\[universal-argument]
903as argument, BUFFER is the most recently selected other buffer.
900 904
901If there's a number in the buffer at point, it is the default for LINE. 905Prior to moving point, this function sets the mark (without
906activating it), unless Transient Mark mode is enabled and the
907mark is already active.
902 908
903This function is usually the wrong thing to use in a Lisp program. 909This function is usually the wrong thing to use in a Lisp program.
904What you probably want instead is something like: 910What you probably want instead is something like:
905 (goto-char (point-min)) (forward-line (1- N)) 911 (goto-char (point-min))
912 (forward-line (1- N))
906If at all possible, an even better solution is to use char counts 913If at all possible, an even better solution is to use char counts
907rather than line counts." 914rather than line counts."
908 (interactive 915 (interactive
@@ -3062,7 +3069,8 @@ before the Emacs kill and one can still paste it using \\[yank] \\[yank-pop]."
3062 :version "23.2") 3069 :version "23.2")
3063 3070
3064(defcustom kill-do-not-save-duplicates nil 3071(defcustom kill-do-not-save-duplicates nil
3065 "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'."
3066 :type 'boolean 3074 :type 'boolean
3067 :group 'killing 3075 :group 'killing
3068 :version "23.2") 3076 :version "23.2")
@@ -3090,7 +3098,10 @@ argument should still be a \"useful\" string for such uses."
3090 (signal 'args-out-of-range 3098 (signal 'args-out-of-range
3091 (list string "yank-handler specified for empty string")))) 3099 (list string "yank-handler specified for empty string"))))
3092 (unless (and kill-do-not-save-duplicates 3100 (unless (and kill-do-not-save-duplicates
3093 (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)))
3094 (if (fboundp 'menu-bar-update-yank-menu) 3105 (if (fboundp 'menu-bar-update-yank-menu)
3095 (menu-bar-update-yank-menu string (and replace (car kill-ring))))) 3106 (menu-bar-update-yank-menu string (and replace (car kill-ring)))))
3096 (when save-interprogram-paste-before-kill 3107 (when save-interprogram-paste-before-kill
@@ -3101,10 +3112,10 @@ argument should still be a \"useful\" string for such uses."
3101 (nreverse interprogram-paste) 3112 (nreverse interprogram-paste)
3102 (list interprogram-paste))) 3113 (list interprogram-paste)))
3103 (unless (and kill-do-not-save-duplicates 3114 (unless (and kill-do-not-save-duplicates
3104 (equal s (car kill-ring))) 3115 (equal-including-properties s (car kill-ring)))
3105 (push s kill-ring)))))) 3116 (push s kill-ring))))))
3106 (unless (and kill-do-not-save-duplicates 3117 (unless (and kill-do-not-save-duplicates
3107 (equal string (car kill-ring))) 3118 (equal-including-properties string (car kill-ring)))
3108 (if (and replace kill-ring) 3119 (if (and replace kill-ring)
3109 (setcar kill-ring string) 3120 (setcar kill-ring string)
3110 (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/speedbar.el b/lisp/speedbar.el
index 89211b2b86e..bb1debb4552 100644
--- a/lisp/speedbar.el
+++ b/lisp/speedbar.el
@@ -3987,11 +3987,11 @@ TEXT is the buffer's name, TOKEN and INDENT are unused."
3987 3987
3988(defun speedbar-unhighlight-one-tag-line () 3988(defun speedbar-unhighlight-one-tag-line ()
3989 "Unhighlight the currently highlighted line." 3989 "Unhighlight the currently highlighted line."
3990 (if speedbar-highlight-one-tag-line 3990 (when (and speedbar-highlight-one-tag-line
3991 (progn 3991 (not (eq this-command 'handle-switch-frame)))
3992 (speedbar-delete-overlay speedbar-highlight-one-tag-line) 3992 (speedbar-delete-overlay speedbar-highlight-one-tag-line)
3993 (setq speedbar-highlight-one-tag-line nil))) 3993 (setq speedbar-highlight-one-tag-line nil)
3994 (remove-hook 'pre-command-hook 'speedbar-unhighlight-one-tag-line)) 3994 (remove-hook 'pre-command-hook 'speedbar-unhighlight-one-tag-line)))
3995 3995
3996(defun speedbar-recenter-to-top () 3996(defun speedbar-recenter-to-top ()
3997 "Recenter the current buffer so point is on the top of the window." 3997 "Recenter the current buffer so point is on the top of the window."
diff --git a/lisp/subr.el b/lisp/subr.el
index 00a030c744c..e0b099dd16b 100644
--- a/lisp/subr.el
+++ b/lisp/subr.el
@@ -3026,13 +3026,12 @@ the buffer list."
3026 (set-buffer ,old-buffer)))))) 3026 (set-buffer ,old-buffer))))))
3027 3027
3028(defmacro save-window-excursion (&rest body) 3028(defmacro save-window-excursion (&rest body)
3029 "Execute BODY, preserving window sizes and contents. 3029 "Execute BODY, then restore previous window configuration.
3030Return the value of the last form in BODY. 3030This macro saves the window configuration on the selected frame,
3031Restore which buffer appears in which window, where display starts, 3031executes BODY, then calls `set-window-configuration' to restore
3032and the value of point and mark for each window. 3032the saved window configuration. The return value is the last
3033Also restore the choice of selected window. 3033form in BODY. The window configuration is also restored if BODY
3034Also restore which buffer is current. 3034exits nonlocally.
3035Does not restore the value of point in current buffer.
3036 3035
3037BEWARE: Most uses of this macro introduce bugs. 3036BEWARE: Most uses of this macro introduce bugs.
3038E.g. it should not be used to try and prevent some code from opening 3037E.g. it should not be used to try and prevent some code from opening
diff --git a/lisp/url/ChangeLog b/lisp/url/ChangeLog
index 55aa9194904..960649bdbc9 100644
--- a/lisp/url/ChangeLog
+++ b/lisp/url/ChangeLog
@@ -1,3 +1,14 @@
12012-03-11 Chong Yidong <cyd@gnu.org>
2
3 * url-http.el (url-http-end-of-document-sentinel): Handle
4 keepalive expiry by calling url-http again (Bug#10223).
5 (url-http): New arg, for the above.
6
72012-03-11 Devon Sean McCullough <emacs-hacker2012@jovi.net>
8
9 * url-http.el (url-http-find-free-connection): Don't pass a nil
10 argument to url-http-mark-connection-as-busy (bug#10891).
11
12012-02-20 Lars Ingebrigtsen <larsi@gnus.org> 122012-02-20 Lars Ingebrigtsen <larsi@gnus.org>
2 13
3 * url-queue.el (url-queue-kill-job): Delete the process sentinel 14 * url-queue.el (url-queue-kill-job): Delete the process sentinel
diff --git a/lisp/url/url-http.el b/lisp/url/url-http.el
index 0c911260ca5..a4726489814 100644
--- a/lisp/url/url-http.el
+++ b/lisp/url/url-http.el
@@ -27,6 +27,7 @@
27(eval-when-compile (require 'cl)) 27(eval-when-compile (require 'cl))
28(defvar url-http-extra-headers) 28(defvar url-http-extra-headers)
29(defvar url-http-target-url) 29(defvar url-http-target-url)
30(defvar url-http-no-retry)
30(defvar url-http-proxy) 31(defvar url-http-proxy)
31(defvar url-http-connection-opened) 32(defvar url-http-connection-opened)
32(require 'url-gw) 33(require 'url-gw)
@@ -153,38 +154,40 @@ request.")
153 154
154(defun url-http-find-free-connection (host port) 155(defun url-http-find-free-connection (host port)
155 (let ((conns (gethash (cons host port) url-http-open-connections)) 156 (let ((conns (gethash (cons host port) url-http-open-connections))
156 (found nil)) 157 (connection nil))
157 (while (and conns (not found)) 158 (while (and conns (not connection))
158 (if (not (memq (process-status (car conns)) '(run open connect))) 159 (if (not (memq (process-status (car conns)) '(run open connect)))
159 (progn 160 (progn
160 (url-http-debug "Cleaning up dead process: %s:%d %S" 161 (url-http-debug "Cleaning up dead process: %s:%d %S"
161 host port (car conns)) 162 host port (car conns))
162 (url-http-idle-sentinel (car conns) nil)) 163 (url-http-idle-sentinel (car conns) nil))
163 (setq found (car conns)) 164 (setq connection (car conns))
164 (url-http-debug "Found existing connection: %s:%d %S" host port found)) 165 (url-http-debug "Found existing connection: %s:%d %S" host port connection))
165 (pop conns)) 166 (pop conns))
166 (if found 167 (if connection
167 (url-http-debug "Reusing existing connection: %s:%d" host port) 168 (url-http-debug "Reusing existing connection: %s:%d" host port)
168 (url-http-debug "Contacting host: %s:%d" host port)) 169 (url-http-debug "Contacting host: %s:%d" host port))
169 (url-lazy-message "Contacting host: %s:%d" host port) 170 (url-lazy-message "Contacting host: %s:%d" host port)
170 (url-http-mark-connection-as-busy 171
171 host port 172 (unless connection
172 (or found 173 (let ((buf (generate-new-buffer " *url-http-temp*")))
173 (let ((buf (generate-new-buffer " *url-http-temp*"))) 174 ;; `url-open-stream' needs a buffer in which to do things
174 ;; `url-open-stream' needs a buffer in which to do things 175 ;; like authentication. But we use another buffer afterwards.
175 ;; like authentication. But we use another buffer afterwards. 176 (unwind-protect
176 (unwind-protect 177 (let ((proc (url-open-stream host buf host port)))
177 (let ((proc (url-open-stream host buf host port))) 178 ;; url-open-stream might return nil.
178 ;; url-open-stream might return nil. 179 (when (processp proc)
179 (when (processp proc) 180 ;; Drop the temp buffer link before killing the buffer.
180 ;; Drop the temp buffer link before killing the buffer. 181 (set-process-buffer proc nil)
181 (set-process-buffer proc nil)) 182 (setq connection proc)))
182 proc) 183 ;; If there was an error on connect, make sure we don't
183 ;; If there was an error on connect, make sure we don't 184 ;; get queried.
184 ;; get queried. 185 (when (get-buffer-process buf)
185 (when (get-buffer-process buf) 186 (set-process-query-on-exit-flag (get-buffer-process buf) nil))
186 (set-process-query-on-exit-flag (get-buffer-process buf) nil)) 187 (kill-buffer buf))))
187 (kill-buffer buf))))))) 188
189 (if connection
190 (url-http-mark-connection-as-busy host port connection))))
188 191
189;; Building an HTTP request 192;; Building an HTTP request
190(defun url-http-user-agent-string () 193(defun url-http-user-agent-string ()
@@ -873,19 +876,26 @@ should be shown to the user."
873 url-http-open-connections)) 876 url-http-open-connections))
874 877
875(defun url-http-end-of-document-sentinel (proc why) 878(defun url-http-end-of-document-sentinel (proc why)
876 ;; Sentinel used for old HTTP/0.9 or connections we know are going 879 ;; Sentinel used to handle (i) terminated old HTTP/0.9 connections,
877 ;; to die as the 'end of document' notifier. 880 ;; and (ii) closed connection due to reusing a HTTP connection which
881 ;; we believed was still alive, but which the server closed on us.
882 ;; We handle case (ii) by calling `url-http' again.
878 (url-http-debug "url-http-end-of-document-sentinel in buffer (%s)" 883 (url-http-debug "url-http-end-of-document-sentinel in buffer (%s)"
879 (process-buffer proc)) 884 (process-buffer proc))
880 (url-http-idle-sentinel proc why) 885 (url-http-idle-sentinel proc why)
881 (when (buffer-name (process-buffer proc)) 886 (when (buffer-name (process-buffer proc))
882 (with-current-buffer (process-buffer proc) 887 (with-current-buffer (process-buffer proc)
883 (goto-char (point-min)) 888 (goto-char (point-min))
884 (if (not (looking-at "HTTP/")) 889 (cond ((not (looking-at "HTTP/"))
885 ;; HTTP/0.9 just gets passed back no matter what 890 (if url-http-no-retry
886 (url-http-activate-callback) 891 ;; HTTP/0.9 just gets passed back no matter what
887 (if (url-http-parse-headers) 892 (url-http-activate-callback)
888 (url-http-activate-callback)))))) 893 ;; Call `url-http' again if our connection expired.
894 (erase-buffer)
895 (url-http url-current-object url-callback-function
896 url-callback-arguments (current-buffer))))
897 ((url-http-parse-headers)
898 (url-http-activate-callback))))))
889 899
890(defun url-http-simple-after-change-function (st nd length) 900(defun url-http-simple-after-change-function (st nd length)
891 ;; Function used when we do NOT know how long the document is going to be 901 ;; Function used when we do NOT know how long the document is going to be
@@ -1163,11 +1173,14 @@ the end of the document."
1163 (goto-char (point-max))))) 1173 (goto-char (point-max)))))
1164 1174
1165;;;###autoload 1175;;;###autoload
1166(defun url-http (url callback cbargs) 1176(defun url-http (url callback cbargs &optional retry-buffer)
1167 "Retrieve URL via HTTP asynchronously. 1177 "Retrieve URL via HTTP asynchronously.
1168URL must be a parsed URL. See `url-generic-parse-url' for details. 1178URL must be a parsed URL. See `url-generic-parse-url' for details.
1169When retrieval is completed, the function CALLBACK is executed with 1179When retrieval is completed, the function CALLBACK is executed with
1170CBARGS as the arguments." 1180CBARGS as the arguments.
1181
1182Optional arg RETRY-BUFFER, if non-nil, specifies the buffer of a
1183previous `url-http' call, which is being re-attempted."
1171 (check-type url vector "Need a pre-parsed URL.") 1184 (check-type url vector "Need a pre-parsed URL.")
1172 (declare (special url-current-object 1185 (declare (special url-current-object
1173 url-http-end-of-headers 1186 url-http-end-of-headers
@@ -1188,7 +1201,8 @@ CBARGS as the arguments."
1188 (let* ((host (url-host (or url-using-proxy url))) 1201 (let* ((host (url-host (or url-using-proxy url)))
1189 (port (url-port (or url-using-proxy url))) 1202 (port (url-port (or url-using-proxy url)))
1190 (connection (url-http-find-free-connection host port)) 1203 (connection (url-http-find-free-connection host port))
1191 (buffer (generate-new-buffer (format " *http %s:%d*" host port)))) 1204 (buffer (or retry-buffer
1205 (generate-new-buffer (format " *http %s:%d*" host port)))))
1192 (if (not connection) 1206 (if (not connection)
1193 ;; Failed to open the connection for some reason 1207 ;; Failed to open the connection for some reason
1194 (progn 1208 (progn
@@ -1218,6 +1232,7 @@ CBARGS as the arguments."
1218 url-http-extra-headers 1232 url-http-extra-headers
1219 url-http-data 1233 url-http-data
1220 url-http-target-url 1234 url-http-target-url
1235 url-http-no-retry
1221 url-http-connection-opened 1236 url-http-connection-opened
1222 url-http-proxy)) 1237 url-http-proxy))
1223 (set (make-local-variable var) nil)) 1238 (set (make-local-variable var) nil))
@@ -1233,6 +1248,7 @@ CBARGS as the arguments."
1233 url-callback-arguments cbargs 1248 url-callback-arguments cbargs
1234 url-http-after-change-function 'url-http-wait-for-headers-change-function 1249 url-http-after-change-function 'url-http-wait-for-headers-change-function
1235 url-http-target-url url-current-object 1250 url-http-target-url url-current-object
1251 url-http-no-retry retry-buffer
1236 url-http-connection-opened nil 1252 url-http-connection-opened nil
1237 url-http-proxy url-using-proxy) 1253 url-http-proxy url-using-proxy)
1238 1254
@@ -1259,6 +1275,7 @@ CBARGS as the arguments."
1259 (with-current-buffer (process-buffer proc) 1275 (with-current-buffer (process-buffer proc)
1260 (cond 1276 (cond
1261 (url-http-connection-opened 1277 (url-http-connection-opened
1278 (setq url-http-no-retry t)
1262 (url-http-end-of-document-sentinel proc why)) 1279 (url-http-end-of-document-sentinel proc why))
1263 ((string= (substring why 0 4) "open") 1280 ((string= (substring why 0 4) "open")
1264 (setq url-http-connection-opened t) 1281 (setq url-http-connection-opened t)
diff --git a/lisp/window.el b/lisp/window.el
index edd8a113876..f79041e0e6c 100644
--- a/lisp/window.el
+++ b/lisp/window.el
@@ -3273,7 +3273,7 @@ Otherwise, the window starts are chosen so as to minimize the
3273amount of redisplay; this is convenient on slow terminals." 3273amount of redisplay; this is convenient on slow terminals."
3274 (interactive "P") 3274 (interactive "P")
3275 (let ((old-window (selected-window)) 3275 (let ((old-window (selected-window))
3276 (old-point (point)) 3276 (old-point (window-point-1))
3277 (size (and size (prefix-numeric-value size))) 3277 (size (and size (prefix-numeric-value size)))
3278 moved-by-window-height moved new-window bottom) 3278 moved-by-window-height moved new-window bottom)
3279 (when (and size (< size 0) (< (- size) window-min-height)) 3279 (when (and size (< size 0) (< (- size) window-min-height))
@@ -3282,22 +3282,27 @@ amount of redisplay; this is convenient on slow terminals."
3282 (setq new-window (split-window nil size)) 3282 (setq new-window (split-window nil size))
3283 (unless split-window-keep-point 3283 (unless split-window-keep-point
3284 (with-current-buffer (window-buffer) 3284 (with-current-buffer (window-buffer)
3285 (goto-char (window-start)) 3285 ;; Use `save-excursion' around vertical movements below
3286 (setq moved (vertical-motion (window-height))) 3286 ;; (Bug#10971). Note: When the selected window's buffer has a
3287 (set-window-start new-window (point)) 3287 ;; header line, up to two lines of the buffer may not show up
3288 (when (> (point) (window-point new-window)) 3288 ;; in the resulting configuration.
3289 (set-window-point new-window (point))) 3289 (save-excursion
3290 (when (= moved (window-height)) 3290 (goto-char (window-start))
3291 (setq moved-by-window-height t) 3291 (setq moved (vertical-motion (window-height)))
3292 (vertical-motion -1)) 3292 (set-window-start new-window (point))
3293 (setq bottom (point))) 3293 (when (> (point) (window-point new-window))
3294 (and moved-by-window-height 3294 (set-window-point new-window (point)))
3295 (<= bottom (point)) 3295 (when (= moved (window-height))
3296 (set-window-point old-window (1- bottom))) 3296 (setq moved-by-window-height t)
3297 (and moved-by-window-height 3297 (vertical-motion -1))
3298 (<= (window-start new-window) old-point) 3298 (setq bottom (point)))
3299 (set-window-point new-window old-point) 3299 (and moved-by-window-height
3300 (select-window new-window))) 3300 (<= bottom (point))
3301 (set-window-point-1 old-window (1- bottom)))
3302 (and moved-by-window-height
3303 (<= (window-start new-window) old-point)
3304 (set-window-point new-window old-point)
3305 (select-window new-window))))
3301 ;; Always copy quit-restore parameter in interactive use. 3306 ;; Always copy quit-restore parameter in interactive use.
3302 (let ((quit-restore (window-parameter old-window 'quit-restore))) 3307 (let ((quit-restore (window-parameter old-window 'quit-restore)))
3303 (when quit-restore 3308 (when quit-restore