aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
Diffstat (limited to 'lisp')
-rw-r--r--lisp/ChangeLog50
-rw-r--r--lisp/allout-widgets.el2
-rw-r--r--lisp/allout.el2
-rw-r--r--lisp/dired-x.el85
-rw-r--r--lisp/dired.el3
-rw-r--r--lisp/emacs-lisp/autoload.el16
-rw-r--r--lisp/emacs-lisp/bytecomp.el1
-rw-r--r--lisp/files-x.el22
-rw-r--r--lisp/files.el96
-rw-r--r--lisp/gnus/ChangeLog70
-rw-r--r--lisp/gnus/auth-source.el298
-rw-r--r--lisp/gnus/gnus-art.el3
-rw-r--r--lisp/gnus/gnus-msg.el5
-rw-r--r--lisp/gnus/gnus-start.el5
-rw-r--r--lisp/gnus/gnus-sum.el8
-rw-r--r--lisp/gnus/nnimap.el1
-rw-r--r--lisp/gnus/nnir.el26
-rw-r--r--lisp/gnus/nnmail.el3
-rw-r--r--lisp/help-fns.el20
-rw-r--r--lisp/international/ja-dic-cnv.el2
-rw-r--r--lisp/international/titdic-cnv.el7
-rw-r--r--lisp/mail/mailclient.el2
-rw-r--r--lisp/mail/mailheader.el2
-rw-r--r--lisp/mail/rmail.el12
-rw-r--r--lisp/mail/rmailmm.el45
-rw-r--r--lisp/progmodes/sql.el5
26 files changed, 496 insertions, 295 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index c817a59a03a..c44c491cad0 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,49 @@
12011-02-24 Glenn Morris <rgm@gnu.org>
2
3 * files-x.el (modify-dir-local-variable): Handle dir-locals from
4 the cache, and from non-file sources.
5
6 * help-fns.el (describe-variable): Return consistent results when a
7 dir-local from a file came from the cache or did not. (Bug#8095)
8 If a dir-local has no associated file, say it came from a "directory".
9
10 * files.el (hack-dir-local-variables): Fix setting of `dir-name'.
11 (hack-local-variables-confirm, hack-local-variables-filter): Doc fix.
12
13 * files.el (dir-locals-find-file): Doc fix.
14 Fix the check for cache elements that have no associated file,
15 and the mtime check for those that do. (Bug#8095)
16
17 * dired-x.el (dired-hack-local-variables):
18 Handle interrupts during hacking local variables. (Bug#5216)
19
20 * emacs-lisp/autoload.el (autoload-save-buffers)
21 (autoload-find-destination, update-directory-autoloads):
22 Avoid prompts when updating autoloads.
23
242011-02-23 Stefan Monnier <monnier@iro.umontreal.ca>
25
26 * emacs-lisp/bytecomp.el (byte-compile-disable-print-circle): Obsolete.
27
282011-02-23 Kenichi Handa <handa@m17n.org>
29
30 * mail/rmailmm.el (rmail-mime-process-multipart): Do not signal an
31 error when a multipart boundary in the nested multipart is found.
32
33 * mail/rmail.el (rmail-start-mail): Decode "encoded-words" of
34 header components.
35
362011-02-23 Glenn Morris <rgm@gnu.org>
37
38 * dired.el (dired-mode): Call hack-dir-local-variables-non-file-buffer.
39 * dired-x.el (dired-omit-mode): Safe if boolean.
40 (dired-enable-local-variables): Fix doc and custom type.
41 (dired-enable-local-variables, dired-local-variables-file)
42 (dired-hack-local-variables): Make obsolete.
43 (dired-omit-here-always): Use dir-locals.el instead.
44
45 * files.el (safe-local-eval-forms): Add the write-file-hooks version.
46
12011-02-22 Stefan Monnier <monnier@iro.umontreal.ca> 472011-02-22 Stefan Monnier <monnier@iro.umontreal.ca>
2 48
3 * help-fns.el (describe-function-1): Don't signal an error just because 49 * help-fns.el (describe-function-1): Don't signal an error just because
@@ -9036,7 +9082,7 @@
9036 * htmlfontify.el (hfy-face-attr-for-class): Use append instead 9082 * htmlfontify.el (hfy-face-attr-for-class): Use append instead
9037 of nconc to avoid pure storage error (Bug#6239). 9083 of nconc to avoid pure storage error (Bug#6239).
9038 9084
90392010-06-27 Christoph <cschol2112@googlemail.com> (tiny change) 90852010-06-27 Christoph Scholtes <cschol2112@googlemail.com>
9040 9086
9041 * bookmark.el (bookmark-bmenu-2-window, bookmark-bmenu-other-window) 9087 * bookmark.el (bookmark-bmenu-2-window, bookmark-bmenu-other-window)
9042 (bookmark-bmenu-other-window-with-mouse): Remove unnecessary 9088 (bookmark-bmenu-other-window-with-mouse): Remove unnecessary
@@ -11219,7 +11265,7 @@
11219 11265
11220 * ido.el (ido-file-internal): Fix 2009-12-02 change. 11266 * ido.el (ido-file-internal): Fix 2009-12-02 change.
11221 11267
112222010-04-19 Christoph <cschol2112@googlemail.com> (tiny change) 112682010-04-19 Christoph Scholtes <cschol2112@googlemail.com>
11223 11269
11224 * progmodes/grep.el (grep-compute-defaults): Fix handling of host 11270 * progmodes/grep.el (grep-compute-defaults): Fix handling of host
11225 default settings (Bug#5928). 11271 default settings (Bug#5928).
diff --git a/lisp/allout-widgets.el b/lisp/allout-widgets.el
index 75e1e5882f6..cc5fd6d96fa 100644
--- a/lisp/allout-widgets.el
+++ b/lisp/allout-widgets.el
@@ -2013,7 +2013,7 @@ Optional FORCE means force reassignment of the region property."
2013 ;; item body), to bias the registered values. 2013 ;; item body), to bias the registered values.
2014 ;; 2014 ;;
2015 ;; This is not necessary/useful when the item is being decorated, because 2015 ;; This is not necessary/useful when the item is being decorated, because
2016 ;; that always must be preceeded by a fresh item parse. 2016 ;; that always must be preceded by a fresh item parse.
2017 2017
2018 (if (not (eq field :body-end)) 2018 (if (not (eq field :body-end))
2019 (widget-get item-widget :from) 2019 (widget-get item-widget :from)
diff --git a/lisp/allout.el b/lisp/allout.el
index 1a7d8cb1593..d881e1177fa 100644
--- a/lisp/allout.el
+++ b/lisp/allout.el
@@ -255,7 +255,7 @@ prevails."
255 255
256This is in contrast to the majority of allout-mode bindings on 256This is in contrast to the majority of allout-mode bindings on
257`allout-prefixed-bindings', whose bindings are created with a 257`allout-prefixed-bindings', whose bindings are created with a
258preceeding command key. 258preceding command key.
259 259
260Use vector format for the keys: 260Use vector format for the keys:
261 - put literal keys after a '?' question mark, eg: '?a', '?.' 261 - put literal keys after a '?' question mark, eg: '?a', '?.'
diff --git a/lisp/dired-x.el b/lisp/dired-x.el
index 8b1dbb1ef83..ce07676fc99 100644
--- a/lisp/dired-x.el
+++ b/lisp/dired-x.el
@@ -145,6 +145,8 @@ See Info node `(dired-x) Omitting Variables' for more information."
145 (let ((dired-omit-size-limit nil)) (dired-omit-expunge)) 145 (let ((dired-omit-size-limit nil)) (dired-omit-expunge))
146 (revert-buffer))) 146 (revert-buffer)))
147 147
148(put 'dired-omit-mode 'safe-local-variable 'booleanp)
149
148;; For backward compatibility 150;; For backward compatibility
149(define-obsolete-variable-alias 'dired-omit-files-p 'dired-omit-mode "22.1") 151(define-obsolete-variable-alias 'dired-omit-files-p 'dired-omit-mode "22.1")
150 152
@@ -185,15 +187,19 @@ If nil, there is no maximum size."
185 187
186(defcustom dired-enable-local-variables t 188(defcustom dired-enable-local-variables t
187 "Control use of local-variables lists in Dired. 189 "Control use of local-variables lists in Dired.
188The value can be t, nil or something else.
189A value of t means local-variables lists are obeyed;
190nil means they are ignored; anything else means query.
191
192This temporarily overrides the value of `enable-local-variables' when 190This temporarily overrides the value of `enable-local-variables' when
193listing a directory. See also `dired-local-variables-file'." 191listing a directory. See also `dired-local-variables-file'."
194 :type 'boolean 192 :risky t
193 :type '(choice (const :tag "Query Unsafe" t)
194 (const :tag "Safe Only" :safe)
195 (const :tag "Do all" :all)
196 (const :tag "Ignore" nil)
197 (other :tag "Query" other))
195 :group 'dired-x) 198 :group 'dired-x)
196 199
200(make-obsolete-variable 'dired-enable-local-variables
201 "use a standard `dir-locals-file' instead." "24.1")
202
197(defcustom dired-guess-shell-gnutar 203(defcustom dired-guess-shell-gnutar
198 (catch 'found 204 (catch 'found
199 (dolist (exe '("tar" "gtar")) 205 (dolist (exe '("tar" "gtar"))
@@ -723,26 +729,25 @@ Knows about the special cases in variable `dired-default-directory-alist'."
723 729
724;;; LOCAL VARIABLES FOR DIRED BUFFERS. 730;;; LOCAL VARIABLES FOR DIRED BUFFERS.
725 731
726;; Brief Description: 732;; Brief Description (This feature is obsolete as of Emacs 24.1)
727;;; 733;;
728;; * `dired-extra-startup' is part of the `dired-mode-hook'. 734;; * `dired-extra-startup' is part of the `dired-mode-hook'.
729;;; 735;;
730;; * `dired-extra-startup' calls `dired-hack-local-variables' 736;; * `dired-extra-startup' calls `dired-hack-local-variables'
731;;; 737;;
732;; * `dired-hack-local-variables' checks the value of 738;; * `dired-hack-local-variables' checks the value of
733;;; `dired-local-variables-file' 739;; `dired-local-variables-file'
734;;; 740;;
735;; * Check if `dired-local-variables-file' is a non-nil string and is a 741;; * Check if `dired-local-variables-file' is a non-nil string and is a
736;;; filename found in the directory of the Dired Buffer being created. 742;; filename found in the directory of the Dired Buffer being created.
737;;; 743;;
738;; * If `dired-local-variables-file' satisfies the above, then temporarily 744;; * If `dired-local-variables-file' satisfies the above, then temporarily
739;;; include it in the Dired Buffer at the bottom. 745;; include it in the Dired Buffer at the bottom.
740;;; 746;;
741;; * Set `enable-local-variables' temporarily to the user variable 747;; * Set `enable-local-variables' temporarily to the user variable
742;;; `dired-enable-local-variables' and run `hack-local-variables' on the 748;; `dired-enable-local-variables' and run `hack-local-variables' on the
743;;; Dired Buffer. 749;; Dired Buffer.
744 750
745;; FIXME do standard dir-locals obsolete this?
746(defcustom dired-local-variables-file (convert-standard-filename ".dired") 751(defcustom dired-local-variables-file (convert-standard-filename ".dired")
747 "Filename, as string, containing local dired buffer variables to be hacked. 752 "Filename, as string, containing local dired buffer variables to be hacked.
748If this file found in current directory, then it will be inserted into dired 753If this file found in current directory, then it will be inserted into dired
@@ -752,6 +757,8 @@ See also `dired-enable-local-variables'."
752 :type 'file 757 :type 'file
753 :group 'dired) 758 :group 'dired)
754 759
760(make-obsolete-variable 'dired-local-variables-file 'dir-locals-file "24.1")
761
755(defun dired-hack-local-variables () 762(defun dired-hack-local-variables ()
756 "Evaluate local variables in `dired-local-variables-file' for dired buffer." 763 "Evaluate local variables in `dired-local-variables-file' for dired buffer."
757 (and (stringp dired-local-variables-file) 764 (and (stringp dired-local-variables-file)
@@ -767,29 +774,37 @@ See also `dired-enable-local-variables'."
767 (insert "\^L\n") 774 (insert "\^L\n")
768 (insert-file-contents dired-local-variables-file)) 775 (insert-file-contents dired-local-variables-file))
769 ;; Hack 'em. 776 ;; Hack 'em.
770 (let ((buffer-file-name dired-local-variables-file)) 777 (unwind-protect
771 (hack-local-variables)) 778 (let ((buffer-file-name dired-local-variables-file))
779 (hack-local-variables))
780 ;; Delete this stuff: `eobp' is used to find last subdir by dired.el.
781 (delete-region opoint (point-max)))
772 ;; Make sure that the modeline shows the proper information. 782 ;; Make sure that the modeline shows the proper information.
773 (dired-sort-set-modeline) 783 (dired-sort-set-modeline))))
774 ;; Delete this stuff: `eobp' is used to find last subdir by dired.el. 784
775 (delete-region opoint (point-max))))) 785(make-obsolete 'dired-hack-local-variables
786 'hack-dir-local-variables-non-file-buffer "24.1")
776 787
788;; Not sure this is worth having a dedicated command for...
777(defun dired-omit-here-always () 789(defun dired-omit-here-always ()
778 "Create `dired-local-variables-file' for omitting and reverts directory. 790 "Create `dir-locals-file' setting `dired-omit-mode' to t in `dired-mode'.
779Sets `dired-omit-mode' to t in a local variables file that is readable by 791If in a Dired buffer, reverts it."
780dired."
781 (interactive) 792 (interactive)
782 (if (file-exists-p dired-local-variables-file) 793 (if (file-exists-p dired-local-variables-file)
783 (message "File `./%s' already exists." dired-local-variables-file) 794 (error "Old-style dired-local-variables-file `./%s' found;
784 ;; Create `dired-local-variables-file'. 795replace it with a dir-locals-file `./%s'"
785 (with-current-buffer (get-buffer-create " *dot-dired*") 796 dired-local-variables-file
786 (erase-buffer) 797 dir-locals-file))
787 (insert "Local Variables:\ndired-omit-mode: t\nEnd:\n") 798 (if (file-exists-p dir-locals-file)
788 (write-file dired-local-variables-file) 799 (message "File `./%s' already exists." dir-locals-file)
789 (kill-buffer)) 800 (with-temp-buffer
801 (insert "((dired-mode . ((dired-omit-mode . t))))\n")
802 (write-file dir-locals-file))
790 ;; Run extra-hooks and revert directory. 803 ;; Run extra-hooks and revert directory.
791 (dired-extra-startup) 804 (when (derived-mode-p 'dired-mode)
792 (dired-revert))) 805 (hack-dir-local-variables-non-file-buffer)
806 (dired-extra-startup)
807 (dired-revert))))
793 808
794 809
795;;; GUESS SHELL COMMAND. 810;;; GUESS SHELL COMMAND.
diff --git a/lisp/dired.el b/lisp/dired.el
index 910d59f2cce..3f31ba58139 100644
--- a/lisp/dired.el
+++ b/lisp/dired.el
@@ -1860,6 +1860,7 @@ Keybindings:
1860 (set (make-local-variable 'desktop-save-buffer) 1860 (set (make-local-variable 'desktop-save-buffer)
1861 'dired-desktop-buffer-misc-data) 1861 'dired-desktop-buffer-misc-data)
1862 (setq dired-switches-alist nil) 1862 (setq dired-switches-alist nil)
1863 (hack-dir-local-variables-non-file-buffer) ; before sorting
1863 (dired-sort-other dired-actual-switches t) 1864 (dired-sort-other dired-actual-switches t)
1864 (when (featurep 'dnd) 1865 (when (featurep 'dnd)
1865 (set (make-local-variable 'dnd-protocol-alist) 1866 (set (make-local-variable 'dnd-protocol-alist)
@@ -4072,7 +4073,7 @@ true then the type of the file linked to by FILE is printed instead.
4072;;;*** 4073;;;***
4073 4074
4074;;;### (autoloads (dired-do-relsymlink dired-jump) "dired-x" "dired-x.el" 4075;;;### (autoloads (dired-do-relsymlink dired-jump) "dired-x" "dired-x.el"
4075;;;;;; "86d436093caa9ae80f7b73915c6a4b4c") 4076;;;;;; "515e1dbc42acebd9a0175c4209b6673c")
4076;;; Generated autoloads from dired-x.el 4077;;; Generated autoloads from dired-x.el
4077 4078
4078(autoload 'dired-jump "dired-x" "\ 4079(autoload 'dired-jump "dired-x" "\
diff --git a/lisp/emacs-lisp/autoload.el b/lisp/emacs-lisp/autoload.el
index 7b610d11b0f..d6e7ee9e3cb 100644
--- a/lisp/emacs-lisp/autoload.el
+++ b/lisp/emacs-lisp/autoload.el
@@ -537,7 +537,8 @@ Return non-nil if and only if FILE adds no autoloads to OUTFILE
537(defun autoload-save-buffers () 537(defun autoload-save-buffers ()
538 (while autoload-modified-buffers 538 (while autoload-modified-buffers
539 (with-current-buffer (pop autoload-modified-buffers) 539 (with-current-buffer (pop autoload-modified-buffers)
540 (save-buffer)))) 540 (let ((version-control 'never))
541 (save-buffer)))))
541 542
542;;;###autoload 543;;;###autoload
543(defun update-file-autoloads (file &optional save-after) 544(defun update-file-autoloads (file &optional save-after)
@@ -569,8 +570,9 @@ removes any prior now out-of-date autoload entries."
569 (with-current-buffer 570 (with-current-buffer
570 ;; We used to use `raw-text' to read this file, but this causes 571 ;; We used to use `raw-text' to read this file, but this causes
571 ;; problems when the file contains non-ASCII characters. 572 ;; problems when the file contains non-ASCII characters.
572 (find-file-noselect 573 (let ((enable-local-variables :safe))
573 (autoload-ensure-default-file (autoload-generated-file))) 574 (find-file-noselect
575 (autoload-ensure-default-file (autoload-generated-file))))
574 ;; This is to make generated-autoload-file have Unix EOLs, so 576 ;; This is to make generated-autoload-file have Unix EOLs, so
575 ;; that it is portable to all platforms. 577 ;; that it is portable to all platforms.
576 (or (eq 0 (coding-system-eol-type buffer-file-coding-system)) 578 (or (eq 0 (coding-system-eol-type buffer-file-coding-system))
@@ -656,8 +658,9 @@ directory or directories specified."
656 (autoload-modified-buffers nil)) 658 (autoload-modified-buffers nil))
657 659
658 (with-current-buffer 660 (with-current-buffer
659 (find-file-noselect 661 (let ((enable-local-variables :safe))
660 (autoload-ensure-default-file (autoload-generated-file))) 662 (find-file-noselect
663 (autoload-ensure-default-file (autoload-generated-file))))
661 (save-excursion 664 (save-excursion
662 665
663 ;; Canonicalize file names and remove the autoload file itself. 666 ;; Canonicalize file names and remove the autoload file itself.
@@ -721,7 +724,8 @@ directory or directories specified."
721 (current-buffer) nil nil no-autoloads this-time) 724 (current-buffer) nil nil no-autoloads this-time)
722 (insert generate-autoload-section-trailer)) 725 (insert generate-autoload-section-trailer))
723 726
724 (save-buffer) 727 (let ((version-control 'never))
728 (save-buffer))
725 ;; In case autoload entries were added to other files because of 729 ;; In case autoload entries were added to other files because of
726 ;; file-local autoload-generated-file settings. 730 ;; file-local autoload-generated-file settings.
727 (autoload-save-buffers)))) 731 (autoload-save-buffers))))
diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el
index 199927d536e..2f113dfb479 100644
--- a/lisp/emacs-lisp/bytecomp.el
+++ b/lisp/emacs-lisp/bytecomp.el
@@ -227,6 +227,7 @@ the functions you loaded will not be able to run.")
227 227
228(defvar byte-compile-disable-print-circle nil 228(defvar byte-compile-disable-print-circle nil
229 "If non-nil, disable `print-circle' on printing a byte-compiled code.") 229 "If non-nil, disable `print-circle' on printing a byte-compiled code.")
230(make-obsolete-variable 'byte-compile-disable-print-circle nil "24.1")
230;;;###autoload(put 'byte-compile-disable-print-circle 'safe-local-variable 'booleanp) 231;;;###autoload(put 'byte-compile-disable-print-circle 'safe-local-variable 'booleanp)
231 232
232(defcustom byte-compile-dynamic-docstrings t 233(defcustom byte-compile-dynamic-docstrings t
diff --git a/lisp/files-x.el b/lisp/files-x.el
index a3cb5331e67..a9c32477155 100644
--- a/lisp/files-x.el
+++ b/lisp/files-x.el
@@ -360,18 +360,28 @@ from the MODE alist ignoring the input argument VALUE."
360 (catch 'exit 360 (catch 'exit
361 (unless enable-local-variables 361 (unless enable-local-variables
362 (throw 'exit (message "Directory-local variables are disabled"))) 362 (throw 'exit (message "Directory-local variables are disabled")))
363
364 (let ((variables-file (or (and (buffer-file-name) 363 (let ((variables-file (or (and (buffer-file-name)
365 (not (file-remote-p (buffer-file-name))) 364 (not (file-remote-p (buffer-file-name)))
366 (dir-locals-find-file (buffer-file-name))) 365 (dir-locals-find-file (buffer-file-name)))
367 dir-locals-file)) 366 dir-locals-file))
368 variables) 367 variables)
369 368 (if (consp variables-file) ; result from cache
369 ;; If cache element has an mtime, assume it came from a file.
370 ;; Otherwise, assume it was set directly.
371 (setq variables-file (if (nth 2 variables-file)
372 (expand-file-name dir-locals-file
373 (car variables-file))
374 (cadr variables-file))))
375 ;; I can't be bothered to handle this case right now.
376 ;; Dir locals were set directly from a class. You need to
377 ;; directly modify the class in dir-locals-class-alist.
378 (and variables-file (not (stringp variables-file))
379 (throw 'exit (message "Directory locals were not set from a file")))
370 ;; Don't create ".dir-locals.el" for the deletion operation. 380 ;; Don't create ".dir-locals.el" for the deletion operation.
371 (when (and (eq op 'delete) 381 (and (eq op 'delete)
372 (not (file-exists-p variables-file))) 382 (or (not variables-file)
373 (throw 'exit (message "File .dir-locals.el not found"))) 383 (not (file-exists-p variables-file)))
374 384 (throw 'exit (message "No .dir-locals.el file was found")))
375 (let ((auto-insert nil)) 385 (let ((auto-insert nil))
376 (find-file variables-file)) 386 (find-file variables-file))
377 (widen) 387 (widen)
diff --git a/lisp/files.el b/lisp/files.el
index 014469ed8fc..5890bf9b8c9 100644
--- a/lisp/files.el
+++ b/lisp/files.el
@@ -2806,7 +2806,9 @@ symbol and VAL is a value that is considered safe."
2806 :type 'alist) 2806 :type 'alist)
2807 2807
2808(defcustom safe-local-eval-forms 2808(defcustom safe-local-eval-forms
2809 '((add-hook 'write-file-functions 'time-stamp) 2809 ;; This should be here at least as long as Emacs supports write-file-hooks.
2810 '((add-hook 'write-file-hooks 'time-stamp)
2811 (add-hook 'write-file-functions 'time-stamp)
2810 (add-hook 'before-save-hook 'time-stamp)) 2812 (add-hook 'before-save-hook 'time-stamp))
2811 "Expressions that are considered safe in an `eval:' local variable. 2813 "Expressions that are considered safe in an `eval:' local variable.
2812Add expressions to this list if you want Emacs to evaluate them, when 2814Add expressions to this list if you want Emacs to evaluate them, when
@@ -2814,7 +2816,7 @@ they appear in an `eval' local variable specification, without first
2814asking you for confirmation." 2816asking you for confirmation."
2815 :risky t 2817 :risky t
2816 :group 'find-file 2818 :group 'find-file
2817 :version "22.2" 2819 :version "24.1" ; added write-file-hooks
2818 :type '(repeat sexp)) 2820 :type '(repeat sexp))
2819 2821
2820;; Risky local variables: 2822;; Risky local variables:
@@ -2917,8 +2919,8 @@ variable to set.")
2917ALL-VARS is the list of all variables to be set up. 2919ALL-VARS is the list of all variables to be set up.
2918UNSAFE-VARS is the list of those that aren't marked as safe or risky. 2920UNSAFE-VARS is the list of those that aren't marked as safe or risky.
2919RISKY-VARS is the list of those that are marked as risky. 2921RISKY-VARS is the list of those that are marked as risky.
2920DIR-NAME is a directory name if these settings come from 2922If these settings come from directory-local variables, then
2921directory-local variables, or nil otherwise." 2923DIR-NAME is the name of the associated directory. Otherwise it is nil."
2922 (if noninteractive 2924 (if noninteractive
2923 nil 2925 nil
2924 (save-window-excursion 2926 (save-window-excursion
@@ -3060,8 +3062,8 @@ VARIABLES is the alist of variable-value settings. This alist is
3060 `enable-local-eval', `enable-local-variables', and (if necessary) 3062 `enable-local-eval', `enable-local-variables', and (if necessary)
3061 user interaction. The results are added to 3063 user interaction. The results are added to
3062 `file-local-variables-alist', without applying them. 3064 `file-local-variables-alist', without applying them.
3063DIR-NAME is a directory name if these settings come from 3065If these settings come from directory-local variables, then
3064 directory-local variables, or nil otherwise." 3066DIR-NAME is the name of the associated directory. Otherwise it is nil."
3065 ;; Find those variables that we may want to save to 3067 ;; Find those variables that we may want to save to
3066 ;; `safe-local-variable-values'. 3068 ;; `safe-local-variable-values'.
3067 (let (all-vars risky-vars unsafe-vars) 3069 (let (all-vars risky-vars unsafe-vars)
@@ -3345,11 +3347,11 @@ Each element in this list has the form (DIR CLASS MTIME).
3345DIR is the name of the directory. 3347DIR is the name of the directory.
3346CLASS is the name of a variable class (a symbol). 3348CLASS is the name of a variable class (a symbol).
3347MTIME is the recorded modification time of the directory-local 3349MTIME is the recorded modification time of the directory-local
3348 variables file associated with this entry. This time is a list 3350variables file associated with this entry. This time is a list
3349 of two integers (the same format as `file-attributes'), and is 3351of two integers (the same format as `file-attributes'), and is
3350 used to test whether the cache entry is still valid. 3352used to test whether the cache entry is still valid.
3351 Alternatively, MTIME can be nil, which means the entry is always 3353Alternatively, MTIME can be nil, which means the entry is always
3352 considered valid.") 3354considered valid.")
3353 3355
3354(defsubst dir-locals-get-class-variables (class) 3356(defsubst dir-locals-get-class-variables (class)
3355 "Return the variable list for CLASS." 3357 "Return the variable list for CLASS."
@@ -3458,13 +3460,20 @@ across different environments and users.")
3458(defun dir-locals-find-file (file) 3460(defun dir-locals-find-file (file)
3459 "Find the directory-local variables for FILE. 3461 "Find the directory-local variables for FILE.
3460This searches upward in the directory tree from FILE. 3462This searches upward in the directory tree from FILE.
3461If the directory root of FILE has been registered in 3463It stops at the first directory that has been registered in
3462 `dir-locals-directory-cache' and the directory-local variables 3464`dir-locals-directory-cache' or contains a `dir-locals-file'.
3463 file has not been modified, return the matching entry in 3465If it finds an entry in the cache, it checks that it is valid.
3464 `dir-locals-directory-cache'. 3466A cache entry with no modification time element (normally, one that
3465Otherwise, if a directory-local variables file is found, return 3467has been assigned directly using `dir-locals-set-directory-class', not
3466 the file name. 3468set from a file) is always valid.
3467Otherwise, return nil." 3469A cache entry based on a `dir-locals-file' is valid if the modification
3470time stored in the cache matches the current file modification time.
3471If not, the cache entry is cleared so that the file will be re-read.
3472
3473This function returns either nil (no directory local variables found),
3474or the matching entry from `dir-locals-directory-cache' (a list),
3475or the full path to the `dir-locals-file' (a string) in the case
3476of no valid cache entry."
3468 (setq file (expand-file-name file)) 3477 (setq file (expand-file-name file))
3469 (let* ((dir-locals-file-name 3478 (let* ((dir-locals-file-name
3470 (if (eq system-type 'ms-dos) 3479 (if (eq system-type 'ms-dos)
@@ -3473,8 +3482,8 @@ Otherwise, return nil."
3473 (locals-file (locate-dominating-file file dir-locals-file-name)) 3482 (locals-file (locate-dominating-file file dir-locals-file-name))
3474 (dir-elt nil)) 3483 (dir-elt nil))
3475 ;; `locate-dominating-file' may have abbreviated the name. 3484 ;; `locate-dominating-file' may have abbreviated the name.
3476 (when locals-file 3485 (if locals-file
3477 (setq locals-file (expand-file-name dir-locals-file-name locals-file))) 3486 (setq locals-file (expand-file-name dir-locals-file-name locals-file)))
3478 ;; Find the best cached value in `dir-locals-directory-cache'. 3487 ;; Find the best cached value in `dir-locals-directory-cache'.
3479 (dolist (elt dir-locals-directory-cache) 3488 (dolist (elt dir-locals-directory-cache)
3480 (when (and (eq t (compare-strings file nil (length (car elt)) 3489 (when (and (eq t (compare-strings file nil (length (car elt))
@@ -3483,23 +3492,32 @@ Otherwise, return nil."
3483 '(windows-nt cygwin ms-dos)))) 3492 '(windows-nt cygwin ms-dos))))
3484 (> (length (car elt)) (length (car dir-elt)))) 3493 (> (length (car elt)) (length (car dir-elt))))
3485 (setq dir-elt elt))) 3494 (setq dir-elt elt)))
3486 (let ((use-cache (and dir-elt 3495 (if (and dir-elt
3487 (or (null locals-file) 3496 (or (null locals-file)
3488 (<= (length (file-name-directory locals-file)) 3497 (<= (length (file-name-directory locals-file))
3489 (length (car dir-elt))))))) 3498 (length (car dir-elt)))))
3490 (if use-cache 3499 ;; Found a potential cache entry. Check validity.
3491 ;; Check the validity of the cache. 3500 ;; A cache entry with no MTIME is assumed to always be valid
3492 (if (and (file-readable-p (car dir-elt)) 3501 ;; (ie, set directly, not from a dir-locals file).
3493 (or (null (nth 2 dir-elt)) 3502 ;; Note, we don't bother to check that there is a matching class
3503 ;; element in dir-locals-class-alist, since that's done by
3504 ;; dir-locals-set-directory-class.
3505 (if (or (null (nth 2 dir-elt))
3506 (let ((cached-file (expand-file-name dir-locals-file-name
3507 (car dir-elt))))
3508 (and (file-readable-p cached-file)
3494 (equal (nth 2 dir-elt) 3509 (equal (nth 2 dir-elt)
3495 (nth 5 (file-attributes (car dir-elt)))))) 3510 (nth 5 (file-attributes cached-file))))))
3496 ;; This cache entry is OK. 3511 ;; This cache entry is OK.
3497 dir-elt 3512 dir-elt
3498 ;; This cache entry is invalid; clear it. 3513 ;; This cache entry is invalid; clear it.
3499 (setq dir-locals-directory-cache 3514 (setq dir-locals-directory-cache
3500 (delq dir-elt dir-locals-directory-cache)) 3515 (delq dir-elt dir-locals-directory-cache))
3501 locals-file) 3516 ;; Return the first existing dir-locals file. Might be the same
3502 locals-file)))) 3517 ;; as dir-elt's, might not (eg latter might have been deleted).
3518 locals-file)
3519 ;; No cache entry.
3520 locals-file)))
3503 3521
3504(defun dir-locals-read-from-file (file) 3522(defun dir-locals-read-from-file (file)
3505 "Load a variables FILE and register a new class and instance. 3523 "Load a variables FILE and register a new class and instance.
@@ -3529,10 +3547,8 @@ and `file-local-variables-alist', without applying them."
3529 (dir-name nil)) 3547 (dir-name nil))
3530 (cond 3548 (cond
3531 ((stringp variables-file) 3549 ((stringp variables-file)
3532 (setq dir-name (if (buffer-file-name) 3550 (setq dir-name (file-name-directory variables-file)
3533 (file-name-directory (buffer-file-name)) 3551 class (dir-locals-read-from-file variables-file)))
3534 default-directory))
3535 (setq class (dir-locals-read-from-file variables-file)))
3536 ((consp variables-file) 3552 ((consp variables-file)
3537 (setq dir-name (nth 0 variables-file)) 3553 (setq dir-name (nth 0 variables-file))
3538 (setq class (nth 1 variables-file)))) 3554 (setq class (nth 1 variables-file))))
diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog
index 3695b94b510..9dd315782ff 100644
--- a/lisp/gnus/ChangeLog
+++ b/lisp/gnus/ChangeLog
@@ -1,7 +1,77 @@
12011-02-24 Katsumi Yamaoka <yamaoka@jpl.org>
2
3 * auth-source.el (auth-source-netrc-create): Use `read-char' with no
4 argument that XEmacs doesn't support.
5
62011-02-23 Julien Danjou <julien@danjou.info>
7
8 * gnus-art.el (article-make-date-line): Ignore errors if time is
9 invalid and not convertible.
10 (article-make-date-line): Only add lapsed time if time is not nil.
11
122011-02-23 Teodor Zlatanov <tzz@lifelogs.com>
13
14 * auth-source.el (auth-source-netrc-create): Use `read-char' instead of
15 `read-char-choice' for backwards compatibility.
16 (auth-source-netrc-element-or-first): New function to DTRT for
17 parameter extraction.
18 (auth-source-netrc-create): Use it and fix multiple parameter print
19 bug. Use the default passed from above (given-default) or the
20 built-in (user-login-name for :user).
21
222011-02-23 Lars Ingebrigtsen <larsi@gnus.org>
23
24 * gnus-start.el (gnus-dribble-read-file): Set
25 buffer-save-without-query, since we always want to save the dribble
26 file, probably.
27
28 * nnmail.el (nnmail-article-group): Allow a final "" split to work on
29 nnimap.
30
31 * gnus-sum.el (gnus-user-date-format-alist): Renamed back again from
32 -summary- since it's a user-visible variable.
33
34 * nnimap.el (nnimap-retrieve-group-data-early): Don't do QRESYNC the
35 first time you use the new Gnus.
36
372011-02-22 Teodor Zlatanov <tzz@lifelogs.com>
38
39 * auth-source.el: Don't load netrc.el.
40 (auth-sources): Search ~/.netrc as well by default.
41 (auth-source-debug): Add 'trivia option for extra output.
42 (auth-source-do-trivia): Use it.
43 (auth-source-search): Simplify logic to use
44 `auth-source-search-backends'. Use `auth-source-do-trivia' where
45 appropriate. Don't keep a running count at this level. Layer :create
46 and :delete options appropriately on the first and second passes.
47 Don't track the backend with the search results.
48 (auth-source-search-backends): New function to search a list of
49 backends for a processed spec.
50 (auth-source-netrc-parse): Cache all netrc files, making
51 auth-source-netrc-cache an alist keyed by the file name and using the
52 file mtime as the caching criterion. Keep the obfuscated data secret
53 with a lexical bind.
54 (auth-source-netrc-search): Don't calculate the length of the results
55 unnecessarily.
56 (auth-source-search-backends): Fix bug.
57 (auth-source-netrc-create): Rework prompts.
58
592011-02-22 Andrew Cohen <cohen@andy.bu.edu>
60
61 * nnir.el (nnir-imap-search-arguments,nnir-imap-default-search-key):
62 Lower case names of search constraints.
63 (nnir-run-query): Cache and reuse search constraints for all imap
64 servers.
65
662011-02-22 Sam Steingold <sds@gnu.org>
67
68 * gnus-msg.el (gnus-setup-message): Also bind `winconf-name'.
69
12011-02-22 Lars Ingebrigtsen <larsi@gnus.org> 702011-02-22 Lars Ingebrigtsen <larsi@gnus.org>
2 71
3 * gnus-msg.el (gnus-inews-add-send-actions): Restore the winconf name 72 * gnus-msg.el (gnus-inews-add-send-actions): Restore the winconf name
4 after exit. 73 after exit.
74 (gnus-setup-message): Define missing variable from last checkin.
5 75
6 * gnus-sum.el (gnus-summary-show-article): When called with t as the 76 * gnus-sum.el (gnus-summary-show-article): When called with t as the
7 value, show the raw article. 77 value, show the raw article.
diff --git a/lisp/gnus/auth-source.el b/lisp/gnus/auth-source.el
index 57fecc7ae32..63ec93dd760 100644
--- a/lisp/gnus/auth-source.el
+++ b/lisp/gnus/auth-source.el
@@ -42,7 +42,6 @@
42(require 'password-cache) 42(require 'password-cache)
43(require 'mm-util) 43(require 'mm-util)
44(require 'gnus-util) 44(require 'gnus-util)
45(require 'netrc)
46(require 'assoc) 45(require 'assoc)
47(eval-when-compile (require 'cl)) 46(eval-when-compile (require 'cl))
48(require 'eieio) 47(require 'eieio)
@@ -164,16 +163,19 @@ If the value is a function, debug messages are logged by calling
164 :type `(choice 163 :type `(choice
165 :tag "auth-source debugging mode" 164 :tag "auth-source debugging mode"
166 (const :tag "Log using `message' to the *Messages* buffer" t) 165 (const :tag "Log using `message' to the *Messages* buffer" t)
166 (const :tag "Log all trivia with `message' to the *Messages* buffer"
167 trivia)
167 (function :tag "Function that takes arguments like `message'") 168 (function :tag "Function that takes arguments like `message'")
168 (const :tag "Don't log anything" nil))) 169 (const :tag "Don't log anything" nil)))
169 170
170(defcustom auth-sources '("~/.authinfo.gpg" "~/.authinfo") 171(defcustom auth-sources '("~/.authinfo.gpg" "~/.authinfo" "~/.netrc")
171 "List of authentication sources. 172 "List of authentication sources.
172 173
173The default will get login and password information from 174The default will get login and password information from
174\"~/.authinfo.gpg\", which you should set up with the EPA/EPG 175\"~/.authinfo.gpg\", which you should set up with the EPA/EPG
175packages to be encrypted. If that file doesn't exist, it will 176packages to be encrypted. If that file doesn't exist, it will
176try the unencrypted version \"~/.authinfo\". 177try the unencrypted version \"~/.authinfo\" and the famous
178\"~/.netrc\" file.
177 179
178See the auth.info manual for details. 180See the auth.info manual for details.
179 181
@@ -256,6 +258,11 @@ If the value is not a list, symmetric encryption will be used."
256 (when auth-source-debug 258 (when auth-source-debug
257 (apply 'auth-source-do-warn msg))) 259 (apply 'auth-source-do-warn msg)))
258 260
261(defun auth-source-do-trivia (&rest msg)
262 (when (or (eq auth-source-debug 'trivia)
263 (functionp auth-source-debug))
264 (apply 'auth-source-do-warn msg)))
265
259(defun auth-source-do-warn (&rest msg) 266(defun auth-source-do-warn (&rest msg)
260 (apply 267 (apply
261 ;; set logger to either the function in auth-source-debug or 'message 268 ;; set logger to either the function in auth-source-debug or 'message
@@ -500,7 +507,7 @@ must call it to obtain the actual value."
500 unless (memq (nth i spec) ignored-keys) 507 unless (memq (nth i spec) ignored-keys)
501 collect (nth i spec))) 508 collect (nth i spec)))
502 (found (auth-source-recall spec)) 509 (found (auth-source-recall spec))
503 filtered-backends accessor-key found-here goal matches backend) 510 filtered-backends accessor-key backend)
504 511
505 (if (and found auth-source-do-cache) 512 (if (and found auth-source-do-cache)
506 (auth-source-do-debug 513 (auth-source-do-debug
@@ -509,7 +516,7 @@ must call it to obtain the actual value."
509 516
510 (assert 517 (assert
511 (or (eq t create) (listp create)) t 518 (or (eq t create) (listp create)) t
512 "Invalid auth-source :create parameter (must be nil, t, or a list): %s %s") 519 "Invalid auth-source :create parameter (must be t or a list): %s %s")
513 520
514 (setq filtered-backends (copy-sequence backends)) 521 (setq filtered-backends (copy-sequence backends))
515 (dolist (backend backends) 522 (dolist (backend backends)
@@ -523,66 +530,64 @@ must call it to obtain the actual value."
523 (return)) 530 (return))
524 (invalid-slot-name)))) 531 (invalid-slot-name))))
525 532
526 (auth-source-do-debug 533 (auth-source-do-trivia
527 "auth-source-search: found %d backends matching %S" 534 "auth-source-search: found %d backends matching %S"
528 (length filtered-backends) spec) 535 (length filtered-backends) spec)
529 536
530 ;; (debug spec "filtered" filtered-backends) 537 ;; (debug spec "filtered" filtered-backends)
531 (setq goal max)
532 ;; First go through all the backends without :create, so we can 538 ;; First go through all the backends without :create, so we can
533 ;; query them all. 539 ;; query them all.
534 (let ((uspec (copy-sequence spec))) 540 (setq found (auth-source-search-backends filtered-backends
535 (plist-put uspec :create nil) 541 spec
536 (dolist (backend filtered-backends) 542 ;; to exit early
537 (let ((match (apply 543 max
538 (slot-value backend 'search-function) 544 ;; create and delete
539 :backend backend 545 nil delete))
540 uspec))) 546
541 (when match 547 (auth-source-do-debug
542 (push (list backend match) matches))))) 548 "auth-source-search: found %d results (max %d) matching %S"
549 (length found) max spec)
550
543 ;; If we didn't find anything, then we allow the backend(s) to 551 ;; If we didn't find anything, then we allow the backend(s) to
544 ;; create the entries. 552 ;; create the entries.
545 (when (and create 553 (when (and create
546 (not matches)) 554 (not found))
547 (dolist (backend filtered-backends) 555 (setq found (auth-source-search-backends filtered-backends
548 (unless matches 556 spec
549 (let ((match (apply 557 ;; to exit early
550 (slot-value backend 'search-function) 558 max
551 :backend backend 559 ;; create and delete
552 :create create 560 create delete))
553 :delete delete 561 (auth-source-do-warn
554 spec))) 562 "auth-source-search: CREATED %d results (max %d) matching %S"
555 (when match 563 (length found) max spec))
556 (push (list backend match) matches)))))) 564
557 565 (when (and found auth-source-do-cache)
558 (setq backend (caar matches) 566 (auth-source-remember spec found)))
559 found-here (cadar matches)) 567
560 568 found))
561 (block nil 569
562 ;; if max is 0, as soon as we find something, return it 570(defun auth-source-search-backends (backends spec max create delete)
563 (when (and (zerop max) (> 0 (length found-here))) 571 (let (matches)
564 (return t)) 572 (dolist (backend backends)
565 573 (when (> max (length matches)) ; when we need more matches...
566 ;; decrement the goal by the number of new results 574 (let ((bmatches (apply
567 (decf goal (length found-here)) 575 (slot-value backend 'search-function)
568 ;; and append the new results to the full list 576 :backend backend
569 (setq found (append found found-here)) 577 ;; note we're overriding whatever the spec
570 578 ;; has for :create and :delete
571 (auth-source-do-debug 579 :create create
572 "auth-source-search: found %d results (max %d/%d) in %S matching %S" 580 :delete delete
573 (length found-here) max goal backend spec) 581 spec)))
574 582 (when bmatches
575 ;; return full list if the goal is 0 or negative 583 (auth-source-do-trivia
576 (when (zerop (max 0 goal)) 584 "auth-source-search-backend: got %d (max %d) in %s:%s matching %S"
577 (return found)) 585 (length bmatches) max
578 586 (slot-value backend :type)
579 ;; change the :max parameter in the spec to the goal 587 (slot-value backend :source)
580 (setq spec (plist-put spec :max goal)) 588 spec)
581 589 (setq matches (append matches bmatches))))))
582 (when (and found auth-source-do-cache) 590 matches))
583 (auth-source-remember spec found))))
584
585 found))
586 591
587;;; (auth-source-search :max 1) 592;;; (auth-source-search :max 1)
588;;; (funcall (plist-get (nth 0 (auth-source-search :max 1)) :secret)) 593;;; (funcall (plist-get (nth 0 (auth-source-search :max 1)) :secret))
@@ -704,25 +709,35 @@ Note that the MAX parameter is used so we can exit the parse early."
704 (when (file-exists-p file) 709 (when (file-exists-p file)
705 (setq port (auth-source-ensure-strings port)) 710 (setq port (auth-source-ensure-strings port))
706 (with-temp-buffer 711 (with-temp-buffer
707 (let ((tokens '("machine" "host" "default" "login" "user" 712 (let* ((tokens '("machine" "host" "default" "login" "user"
708 "password" "account" "macdef" "force" 713 "password" "account" "macdef" "force"
709 "port" "protocol")) 714 "port" "protocol"))
710 (max (or max 5000)) ; sanity check: default to stop at 5K 715 (max (or max 5000)) ; sanity check: default to stop at 5K
711 (modified 0) 716 (modified 0)
712 alist elem result pair) 717 (cached (cdr-safe (assoc file auth-source-netrc-cache)))
713 (if (and auth-source-netrc-cache 718 (cached-mtime (plist-get cached :mtime))
714 (equal (car auth-source-netrc-cache) 719 (cached-secrets (plist-get cached :secret))
715 (nth 5 (file-attributes file)))) 720 alist elem result pair)
716 (insert (base64-decode-string 721
717 (rot13-string (cdr auth-source-netrc-cache)))) 722 (if (and (functionp cached-secrets)
718 (insert-file-contents file) 723 (equal cached-mtime
719 (when (string-match "\\.gpg\\'" file) 724 (nth 5 (file-attributes file))))
720 ;; Store the contents of the file heavily encrypted in memory. 725 (progn
721 (setq auth-source-netrc-cache 726 (auth-source-do-trivia
722 (cons (nth 5 (file-attributes file)) 727 "auth-source-netrc-parse: using CACHED file data for %s"
723 (rot13-string 728 file)
724 (base64-encode-string 729 (insert (funcall cached-secrets)))
725 (buffer-string))))))) 730 (insert-file-contents file)
731 ;; cache all netrc files (used to be just .gpg files)
732 ;; Store the contents of the file heavily encrypted in memory.
733 ;; (note for the irony-impaired: they are just obfuscated)
734 (aput 'auth-source-netrc-cache file
735 (list :mtime (nth 5 (file-attributes file))
736 :secret (lexical-let ((v (rot13-string
737 (base64-encode-string
738 (buffer-string)))))
739 (lambda () (base64-decode-string
740 (rot13-string v)))))))
726 (goto-char (point-min)) 741 (goto-char (point-min))
727 ;; Go through the file, line by line. 742 ;; Go through the file, line by line.
728 (while (and (not (eobp)) 743 (while (and (not (eobp))
@@ -868,7 +883,7 @@ See `auth-source-search' for details on SPEC."
868 883
869 ;; if we need to create an entry AND none were found to match 884 ;; if we need to create an entry AND none were found to match
870 (when (and create 885 (when (and create
871 (= 0 (length results))) 886 (not results))
872 887
873 ;; create based on the spec and record the value 888 ;; create based on the spec and record the value
874 (setq results (or 889 (setq results (or
@@ -883,6 +898,11 @@ See `auth-source-search' for details on SPEC."
883 (plist-put spec :create nil))))) 898 (plist-put spec :create nil)))))
884 results)) 899 results))
885 900
901(defun auth-source-netrc-element-or-first (v)
902 (if (listp v)
903 (nth 0 v)
904 v))
905
886;;; (auth-source-search :host "nonesuch" :type 'netrc :max 1 :create t) 906;;; (auth-source-search :host "nonesuch" :type 'netrc :max 1 :create t)
887;;; (auth-source-search :host "nonesuch" :type 'netrc :max 1 :create t :create-extra-keys '((A "default A") (B))) 907;;; (auth-source-search :host "nonesuch" :type 'netrc :max 1 :create t :create-extra-keys '((A "default A") (B)))
888 908
@@ -897,7 +917,6 @@ See `auth-source-search' for details on SPEC."
897 (required (append base-required create-extra)) 917 (required (append base-required create-extra))
898 (file (oref backend source)) 918 (file (oref backend source))
899 (add "") 919 (add "")
900 (show "")
901 ;; `valist' is an alist 920 ;; `valist' is an alist
902 valist 921 valist
903 ;; `artificial' will be returned if no creation is needed 922 ;; `artificial' will be returned if no creation is needed
@@ -928,63 +947,39 @@ See `auth-source-search' for details on SPEC."
928 ;; for each required element 947 ;; for each required element
929 (dolist (r required) 948 (dolist (r required)
930 (let* ((data (aget valist r)) 949 (let* ((data (aget valist r))
950 ;; take the first element if the data is a list
951 (data (auth-source-netrc-element-or-first data))
952 ;; this is the default to be offered
931 (given-default (aget auth-source-creation-defaults r)) 953 (given-default (aget auth-source-creation-defaults r))
932 ;; the defaults are simple 954 ;; the default supplementals are simple: for the user,
955 ;; try (user-login-name), otherwise take given-default
933 (default (cond 956 (default (cond
934 ((and (not given-default) (eq r 'user)) 957 ((and (not given-default) (eq r 'user))
935 (user-login-name)) 958 (user-login-name))
936 ;; note we need this empty string 959 (t given-default))))
937 ((and (not given-default) (eq r 'port)) 960
938 "") 961 ;; store the data, prompting for the password if needed
939 (t given-default))) 962 (setq data
940 ;; the prompt's default string depends on the data so far 963 (cond
941 (default-string (if (and default (< 0 (length default))) 964 ((and (null data) (eq r 'secret))
942 (format " (default %s)" default) 965 ;; special case prompt for passwords
943 " (no default)")) 966 (read-passwd (format "Password for %s@%s:%s: "
944 ;; the prompt should also show what's entered so far 967 (or
945 (user-value (aget valist 'user)) 968 (auth-source-netrc-element-or-first
946 (host-value (aget valist 'host)) 969 (aget valist 'user))
947 (port-value (aget valist 'port)) 970 (plist-get artificial :user)
948 ;; note this handles lists by just printing them 971 "[any user]")
949 ;; later we allow the user to use completing-read to pick 972 (or
950 (info-so-far (concat (if user-value 973 (auth-source-netrc-element-or-first
951 (format "%s@" user-value) 974 (aget valist 'host))
952 "[USER?]") 975 (plist-get artificial :host)
953 (if host-value 976 "[any host]")
954 (format "%s" host-value) 977 (or
955 "[HOST?]") 978 (auth-source-netrc-element-or-first
956 (if port-value 979 (aget valist 'port))
957 ;; this distinguishes protocol between 980 (plist-get artificial :port)
958 (if (zerop (length port-value)) 981 "[any port]"))))
959 "" ; 'entered as "no default"' vs. 982 (t (or data default))))
960 (format ":%s" port-value)) ; given
961 ;; and this is when the protocol is unknown
962 "[PORT?]"))))
963
964 ;; now prompt if the search SPEC did not include a required key;
965 ;; take the result and put it in `data' AND store it in `valist'
966 (aput 'valist r
967 (setq data
968 (cond
969 ((and (null data) (eq r 'secret))
970 ;; special case prompt for passwords
971 (read-passwd (format "Password for %s: " info-so-far)))
972 ((null data)
973 (read-string
974 (format "Enter %s for %s%s: "
975 r info-so-far default-string)
976 nil nil default))
977 ((listp data)
978 (completing-read
979 (format "Enter %s for %s (TAB to see the choices): "
980 r info-so-far)
981 data
982 nil ; no predicate
983 t ; require a match
984 ;; note the default is nil, but if the user
985 ;; hits RET we'll get "", which is handled OK later
986 nil))
987 (t data))))
988 983
989 (when data 984 (when data
990 (setq artificial (plist-put artificial 985 (setq artificial (plist-put artificial
@@ -997,7 +992,9 @@ See `auth-source-search' for details on SPEC."
997 ;; when r is not an empty string... 992 ;; when r is not an empty string...
998 (when (and (stringp data) 993 (when (and (stringp data)
999 (< 0 (length data))) 994 (< 0 (length data)))
1000 (let ((printer (lambda (hide) 995 ;; this function is not strictly necessary but I think it
996 ;; makes the code clearer -tzz
997 (let ((printer (lambda ()
1001 ;; append the key (the symbol name of r) 998 ;; append the key (the symbol name of r)
1002 ;; and the value in r 999 ;; and the value in r
1003 (format "%s%s %S" 1000 (format "%s%s %S"
@@ -1005,17 +1002,14 @@ See `auth-source-search' for details on SPEC."
1005 (if (zerop (length add)) "" " ") 1002 (if (zerop (length add)) "" " ")
1006 ;; remap auth-source tokens to netrc 1003 ;; remap auth-source tokens to netrc
1007 (case r 1004 (case r
1008 ('user "login") 1005 ('user "login")
1009 ('host "machine") 1006 ('host "machine")
1010 ('secret "password") 1007 ('secret "password")
1011 ('port "port") ; redundant but clearer 1008 ('port "port") ; redundant but clearer
1012 (t (symbol-name r))) 1009 (t (symbol-name r)))
1013 ;; the value will be printed in %S format 1010 ;; the value will be printed in %S format
1014 (if (and hide (eq r 'secret)) 1011 data))))
1015 "HIDDEN_SECRET" 1012 (setq add (concat add (funcall printer)))))))
1016 data)))))
1017 (setq add (concat add (funcall printer nil)))
1018 (setq show (concat show (funcall printer t)))))))
1019 1013
1020 (with-temp-buffer 1014 (with-temp-buffer
1021 (when (file-exists-p file) 1015 (when (file-exists-p file)
@@ -1032,17 +1026,35 @@ See `auth-source-search' for details on SPEC."
1032 (goto-char (point-max)) 1026 (goto-char (point-max))
1033 1027
1034 ;; ask AFTER we've successfully opened the file 1028 ;; ask AFTER we've successfully opened the file
1035 (if (y-or-n-p (format "Add to file %s: line [%s]" file show)) 1029 (let ((prompt (format "Add to file %s? %s: "
1030 file
1031 "(y)es/(n)o but use it/(e)dit line/(s)kip file"))
1032 done k)
1033 (while (not done)
1034 (message "%s" prompt)
1035 (setq k (read-char))
1036 (case k
1037 (?y (setq done t))
1038 (?n (setq add ""
1039 done t))
1040 (?s (setq add ""
1041 done 'skip))
1042 (?e (setq add (read-string "Line to add: " add)))
1043 (t nil)))
1044
1045 (when (< 0 (length add))
1036 (progn 1046 (progn
1037 (unless (bolp) 1047 (unless (bolp)
1038 (insert "\n")) 1048 (insert "\n"))
1039 (insert add "\n") 1049 (insert add "\n")
1040 (write-region (point-min) (point-max) file nil 'silent) 1050 (write-region (point-min) (point-max) file nil 'silent)
1041 (auth-source-do-debug 1051 (auth-source-do-warn
1042 "auth-source-netrc-create: wrote 1 new line to %s" 1052 "auth-source-netrc-create: wrote 1 new line to %s"
1043 file) 1053 file)
1044 nil) 1054 nil))
1045 (list artificial))))) 1055
1056 (when (eq done t)
1057 (list artificial))))))
1046 1058
1047;;; Backend specific parsing: Secrets API backend 1059;;; Backend specific parsing: Secrets API backend
1048 1060
diff --git a/lisp/gnus/gnus-art.el b/lisp/gnus/gnus-art.el
index 2a36c43130c..5b3489a72ee 100644
--- a/lisp/gnus/gnus-art.el
+++ b/lisp/gnus/gnus-art.el
@@ -3463,7 +3463,7 @@ possible values."
3463 combined-lapsed)) 3463 combined-lapsed))
3464 (error "Unknown conversion type: %s" type)) 3464 (error "Unknown conversion type: %s" type))
3465 (condition-case () 3465 (condition-case ()
3466 (let ((time (date-to-time date))) 3466 (let ((time (ignore-errors (date-to-time date))))
3467 (cond 3467 (cond
3468 ;; Convert to the local timezone. 3468 ;; Convert to the local timezone.
3469 ((eq type 'local) 3469 ((eq type 'local)
@@ -3515,6 +3515,7 @@ possible values."
3515 (segments 3) 3515 (segments 3)
3516 lapsed-string) 3516 lapsed-string)
3517 (while (and 3517 (while (and
3518 time
3518 (setq lapsed-string 3519 (setq lapsed-string
3519 (concat " (" (article-lapsed-string time segments) ")")) 3520 (concat " (" (article-lapsed-string time segments) ")"))
3520 (> (+ (length date-string) 3521 (> (+ (length date-string)
diff --git a/lisp/gnus/gnus-msg.el b/lisp/gnus/gnus-msg.el
index 29ac43115c8..093eec33fcd 100644
--- a/lisp/gnus/gnus-msg.el
+++ b/lisp/gnus/gnus-msg.el
@@ -383,6 +383,7 @@ Thank you for your help in stamping out bugs.
383(defvar gnus-article-reply nil) 383(defvar gnus-article-reply nil)
384(defmacro gnus-setup-message (config &rest forms) 384(defmacro gnus-setup-message (config &rest forms)
385 (let ((winconf (make-symbol "gnus-setup-message-winconf")) 385 (let ((winconf (make-symbol "gnus-setup-message-winconf"))
386 (winconf-name (make-symbol "gnus-setup-message-winconf-name"))
386 (buffer (make-symbol "gnus-setup-message-buffer")) 387 (buffer (make-symbol "gnus-setup-message-buffer"))
387 (article (make-symbol "gnus-setup-message-article")) 388 (article (make-symbol "gnus-setup-message-article"))
388 (yanked (make-symbol "gnus-setup-yanked-articles")) 389 (yanked (make-symbol "gnus-setup-yanked-articles"))
@@ -433,7 +434,7 @@ Thank you for your help in stamping out bugs.
433 (progn 434 (progn
434 ,@forms) 435 ,@forms)
435 (gnus-inews-add-send-actions ,winconf ,buffer ,article ,config 436 (gnus-inews-add-send-actions ,winconf ,buffer ,article ,config
436 ,yanked ,winconf-name) 437 ,yanked ',winconf-name)
437 (setq gnus-message-buffer (current-buffer)) 438 (setq gnus-message-buffer (current-buffer))
438 (set (make-local-variable 'gnus-message-group-art) 439 (set (make-local-variable 'gnus-message-group-art)
439 (cons ,group ,article)) 440 (cons ,group ,article))
@@ -541,7 +542,7 @@ Gcc: header for archiving purposes."
541 (gnus-post-method arg ,gnus-newsgroup-name))) 542 (gnus-post-method arg ,gnus-newsgroup-name)))
542 (message-add-action 543 (message-add-action
543 `(progn 544 `(progn
544 (setq gnus-current-window-configuration ,winconf-name) 545 (setq gnus-current-window-configuration ',winconf-name)
545 (when (gnus-buffer-exists-p ,buffer) 546 (when (gnus-buffer-exists-p ,buffer)
546 (set-window-configuration ,winconf))) 547 (set-window-configuration ,winconf)))
547 'exit 'postpone 'kill) 548 'exit 'postpone 'kill)
diff --git a/lisp/gnus/gnus-start.el b/lisp/gnus/gnus-start.el
index e5e2468058c..dea6aabc75b 100644
--- a/lisp/gnus/gnus-start.el
+++ b/lisp/gnus/gnus-start.el
@@ -864,6 +864,7 @@ prompt the user for the name of an NNTP server to use."
864 (gnus-get-buffer-create 864 (gnus-get-buffer-create
865 (file-name-nondirectory dribble-file))) 865 (file-name-nondirectory dribble-file)))
866 (set (make-local-variable 'file-precious-flag) t) 866 (set (make-local-variable 'file-precious-flag) t)
867 (setq buffer-save-without-query t)
867 (erase-buffer) 868 (erase-buffer)
868 (setq buffer-file-name dribble-file) 869 (setq buffer-file-name dribble-file)
869 (auto-save-mode t) 870 (auto-save-mode t)
@@ -1717,8 +1718,8 @@ If SCAN, request a scan of that group as well."
1717 gnus-secondary-select-methods)) 1718 gnus-secondary-select-methods))
1718 (when (and (not (assoc method type-cache)) 1719 (when (and (not (assoc method type-cache))
1719 (gnus-check-backend-function 'request-list (car method))) 1720 (gnus-check-backend-function 'request-list (car method)))
1720 (with-current-buffer nntp-server-buffer 1721 (with-current-buffer nntp-server-buffer
1721 (gnus-read-active-file-1 method nil)))) 1722 (gnus-read-active-file-1 method nil))))
1722 1723
1723 ;; Do the rest of the retrieval. 1724 ;; Do the rest of the retrieval.
1724 (dolist (elem type-cache) 1725 (dolist (elem type-cache)
diff --git a/lisp/gnus/gnus-sum.el b/lisp/gnus/gnus-sum.el
index 2d78a5698df..abe6367f0d0 100644
--- a/lisp/gnus/gnus-sum.el
+++ b/lisp/gnus/gnus-sum.el
@@ -3853,7 +3853,7 @@ This function is intended to be used in
3853 ((< c (* 1000 10000)) (format "%1.1fM" (/ c (* 1024.0 1024)))) 3853 ((< c (* 1000 10000)) (format "%1.1fM" (/ c (* 1024.0 1024))))
3854 (t (format "%dM" (/ c (* 1024.0 1024))))))) 3854 (t (format "%dM" (/ c (* 1024.0 1024)))))))
3855 3855
3856(defcustom gnus-summary-user-date-format-alist 3856(defcustom gnus-user-date-format-alist
3857 '(((gnus-seconds-today) . "Today, %H:%M") 3857 '(((gnus-seconds-today) . "Today, %H:%M")
3858 ((+ 86400 (gnus-seconds-today)) . "Yesterday, %H:%M") 3858 ((+ 86400 (gnus-seconds-today)) . "Yesterday, %H:%M")
3859 (604800 . "%A %H:%M") ; That's one week 3859 (604800 . "%A %H:%M") ; That's one week
@@ -3880,11 +3880,9 @@ respectively."
3880 :version "24.1" 3880 :version "24.1"
3881 :group 'gnus-summary-format 3881 :group 'gnus-summary-format
3882 :type '(alist :key-type sexp :value-type string)) 3882 :type '(alist :key-type sexp :value-type string))
3883(make-obsolete-variable 'gnus-user-date-format-alist
3884 'gnus-summary-user-date-format-alist "24.1")
3885 3883
3886(defun gnus-user-date (messy-date) 3884(defun gnus-user-date (messy-date)
3887 "Format the messy-date according to `gnus-summary-user-date-format-alist'. 3885 "Format the messy-date according to `gnus-user-date-format-alist'.
3888Returns \" ? \" if there's bad input or if another error occurs. 3886Returns \" ? \" if there's bad input or if another error occurs.
3889Input should look like this: \"Sun, 14 Oct 2001 13:34:39 +0200\"." 3887Input should look like this: \"Sun, 14 Oct 2001 13:34:39 +0200\"."
3890 (condition-case () 3888 (condition-case ()
@@ -3893,7 +3891,7 @@ Input should look like this: \"Sun, 14 Oct 2001 13:34:39 +0200\"."
3893 ;;If we don't find something suitable we'll use this one 3891 ;;If we don't find something suitable we'll use this one
3894 (my-format "%b %d '%y")) 3892 (my-format "%b %d '%y"))
3895 (let* ((difference (- now messy-date)) 3893 (let* ((difference (- now messy-date))
3896 (templist gnus-summary-user-date-format-alist) 3894 (templist gnus-user-date-format-alist)
3897 (top (eval (caar templist)))) 3895 (top (eval (caar templist))))
3898 (while (if (numberp top) (< top difference) (not top)) 3896 (while (if (numberp top) (< top difference) (not top))
3899 (progn 3897 (progn
diff --git a/lisp/gnus/nnimap.el b/lisp/gnus/nnimap.el
index 138875ba477..b2733407836 100644
--- a/lisp/gnus/nnimap.el
+++ b/lisp/gnus/nnimap.el
@@ -1151,6 +1151,7 @@ textual parts.")
1151 (setf (nnimap-examined nnimap-object) group) 1151 (setf (nnimap-examined nnimap-object) group)
1152 (if (and qresyncp 1152 (if (and qresyncp
1153 uidvalidity 1153 uidvalidity
1154 active
1154 modseq) 1155 modseq)
1155 (push 1156 (push
1156 (list (nnimap-send-command "EXAMINE %S (%s (%s %s))" 1157 (list (nnimap-send-command "EXAMINE %S (%s (%s %s))"
diff --git a/lisp/gnus/nnir.el b/lisp/gnus/nnir.el
index 8e91c68b391..eaaac3f88ce 100644
--- a/lisp/gnus/nnir.el
+++ b/lisp/gnus/nnir.el
@@ -203,11 +203,12 @@
203;; Imap variables 203;; Imap variables
204 204
205(defvar nnir-imap-search-arguments 205(defvar nnir-imap-search-arguments
206 '(("Whole message" . "TEXT") 206 '(("whole message" . "TEXT")
207 ("Subject" . "SUBJECT") 207 ("subject" . "SUBJECT")
208 ("To" . "TO") 208 ("to" . "TO")
209 ("From" . "FROM") 209 ("from" . "FROM")
210 ("Imap" . "")) 210 ("body" . "BODY")
211 ("imap" . ""))
211 "Mapping from user readable keys to IMAP search items for use in nnir") 212 "Mapping from user readable keys to IMAP search items for use in nnir")
212 213
213(defvar nnir-imap-search-other "HEADER %S" 214(defvar nnir-imap-search-other "HEADER %S"
@@ -335,7 +336,7 @@ result, `gnus-retrieve-headers' will be called instead."
335 :type '(function) 336 :type '(function)
336 :group 'nnir) 337 :group 'nnir)
337 338
338(defcustom nnir-imap-default-search-key "Whole message" 339(defcustom nnir-imap-default-search-key "whole message"
339 "*The default IMAP search key for an nnir search. Must be one of 340 "*The default IMAP search key for an nnir search. Must be one of
340 the keys in `nnir-imap-search-arguments'. To use raw imap queries 341 the keys in `nnir-imap-search-arguments'. To use raw imap queries
341 by default set this to \"Imap\"." 342 by default set this to \"Imap\"."
@@ -1500,11 +1501,14 @@ Tested with Namazu 2.0.6 on a GNU/Linux system."
1500 (setq search-func (cadr (assoc nnir-search-engine 1501 (setq search-func (cadr (assoc nnir-search-engine
1501 nnir-engines))) 1502 nnir-engines)))
1502 (if search-func 1503 (if search-func
1503 (funcall search-func 1504 (funcall
1504 (if nnir-extra-parms 1505 search-func
1505 (nnir-read-parms q nnir-search-engine) 1506 (if nnir-extra-parms
1506 q) 1507 (or (and (eq nnir-search-engine 'imap)
1507 server (cadr x)) 1508 (assq 'criteria q) q)
1509 (setq q (nnir-read-parms q nnir-search-engine)))
1510 q)
1511 server (cadr x))
1508 nil))) 1512 nil)))
1509 groups)))) 1513 groups))))
1510 1514
diff --git a/lisp/gnus/nnmail.el b/lisp/gnus/nnmail.el
index b2336e13b64..8906a036779 100644
--- a/lisp/gnus/nnmail.el
+++ b/lisp/gnus/nnmail.el
@@ -1215,7 +1215,8 @@ FUNC will be called with the group name to determine the article number."
1215 ;; This is the final group, which is used as a 1215 ;; This is the final group, which is used as a
1216 ;; catch-all. 1216 ;; catch-all.
1217 (when (and (not group-art) 1217 (when (and (not group-art)
1218 (not nnmail-inhibit-default-split-group)) 1218 (or (equal "" (nth 1 method))
1219 (not nnmail-inhibit-default-split-group)))
1219 (setq group-art 1220 (setq group-art
1220 (list (cons (car method) 1221 (list (cons (car method)
1221 (funcall func (car method)))))))) 1222 (funcall func (car method))))))))
diff --git a/lisp/help-fns.el b/lisp/help-fns.el
index 1cd5526fcff..38e331dc992 100644
--- a/lisp/help-fns.el
+++ b/lisp/help-fns.el
@@ -748,15 +748,21 @@ it is displayed along with the global value."
748 (setq extra-line t) 748 (setq extra-line t)
749 (if (member (cons variable val) dir-local-variables-alist) 749 (if (member (cons variable val) dir-local-variables-alist)
750 (let ((file (and (buffer-file-name) 750 (let ((file (and (buffer-file-name)
751 (not (file-remote-p (buffer-file-name))) 751 (not (file-remote-p (buffer-file-name)))
752 (dir-locals-find-file (buffer-file-name))))) 752 (dir-locals-find-file
753 (buffer-file-name))))
754 (type "file"))
753 (princ " This variable is a directory local variable") 755 (princ " This variable is a directory local variable")
754 (when file 756 (when file
755 (princ (concat "\n from the file \"" 757 (if (consp file) ; result from cache
756 (if (consp file) 758 ;; If the cache element has an mtime, we
757 (car file) 759 ;; assume it came from a file.
758 file) 760 (if (nth 2 file)
759 "\""))) 761 (setq file (expand-file-name
762 dir-locals-file (car file)))
763 ;; Otherwise, assume it was set directly.
764 (setq type "directory")))
765 (princ (format "\n from the %s \"%s\"" type file)))
760 (princ ".\n")) 766 (princ ".\n"))
761 (princ " This variable is a file local variable.\n"))) 767 (princ " This variable is a file local variable.\n")))
762 768
diff --git a/lisp/international/ja-dic-cnv.el b/lisp/international/ja-dic-cnv.el
index 7e317ea09c0..c0fcf19d841 100644
--- a/lisp/international/ja-dic-cnv.el
+++ b/lisp/international/ja-dic-cnv.el
@@ -337,7 +337,7 @@ The name of generated file is specified by the variable `ja-dic-filename'."
337 (erase-buffer) 337 (erase-buffer)
338 (buffer-disable-undo) 338 (buffer-disable-undo)
339 (insert ";;; ja-dic.el --- dictionary for Japanese input method" 339 (insert ";;; ja-dic.el --- dictionary for Japanese input method"
340 " -*-coding: euc-japan; byte-compile-disable-print-circle:t; -*-\n" 340 " -*-coding: euc-japan; -*-\n"
341 ";;\tGenerated by the command `skkdic-convert'\n" 341 ";;\tGenerated by the command `skkdic-convert'\n"
342 ";;\tDate: " (current-time-string) "\n" 342 ";;\tDate: " (current-time-string) "\n"
343 ";;\tOriginal SKK dictionary file: " 343 ";;\tOriginal SKK dictionary file: "
diff --git a/lisp/international/titdic-cnv.el b/lisp/international/titdic-cnv.el
index 935d66c613b..e68dc8bdc17 100644
--- a/lisp/international/titdic-cnv.el
+++ b/lisp/international/titdic-cnv.el
@@ -272,8 +272,7 @@ SPC, 6, 3, 4, or 7 specifing a tone (SPC:$(0?v(N(B, 6:$(0Dm(N(B, 3:$(0&9Vy
272 272
273 (princ ";; Quail package `") 273 (princ ";; Quail package `")
274 (princ package) 274 (princ package)
275 (princ (format "' -*- coding:%s; " coding-system-for-write)) 275 (princ (format "' -*- coding:%s -*-\n" coding-system-for-write))
276 (princ "byte-compile-disable-print-circle:t; -*-\n")
277 (princ ";; Generated by the command `titdic-convert'\n;;\tDate: ") 276 (princ ";; Generated by the command `titdic-convert'\n;;\tDate: ")
278 (princ (current-time-string)) 277 (princ (current-time-string))
279 (princ "\n;;\tOriginal TIT dictionary file: ") 278 (princ "\n;;\tOriginal TIT dictionary file: ")
@@ -1154,8 +1153,8 @@ the generated Quail package is saved."
1154 (setq coding-system-for-write 1153 (setq coding-system-for-write
1155 (coding-system-change-eol-conversion coding 'unix)) 1154 (coding-system-change-eol-conversion coding 'unix))
1156 (with-temp-file (expand-file-name quailfile dirname) 1155 (with-temp-file (expand-file-name quailfile dirname)
1157 (insert (format ";; Quail package `%s' -*- coding:%s; " name coding)) 1156 (insert (format ";; Quail package `%s' -*- coding:%s -*-\n"
1158 (insert "byte-compile-disable-print-circle:t; -*-\n") 1157 name coding))
1159 (insert ";; Generated by the command `miscdic-convert'\n") 1158 (insert ";; Generated by the command `miscdic-convert'\n")
1160 (insert ";; Date: " (current-time-string) "\n") 1159 (insert ";; Date: " (current-time-string) "\n")
1161 (insert ";; Source dictionary file: " dicfile "\n") 1160 (insert ";; Source dictionary file: " dicfile "\n")
diff --git a/lisp/mail/mailclient.el b/lisp/mail/mailclient.el
index ab9f3662745..b957d9f36c6 100644
--- a/lisp/mail/mailclient.el
+++ b/lisp/mail/mailclient.el
@@ -1,4 +1,4 @@
1;;; mailclient.el --- mail sending via system's mail client. -*- byte-compile-dynamic: t -*- 1;;; mailclient.el --- mail sending via system's mail client.
2 2
3;; Copyright (C) 2005-2011 Free Software Foundation 3;; Copyright (C) 2005-2011 Free Software Foundation
4 4
diff --git a/lisp/mail/mailheader.el b/lisp/mail/mailheader.el
index 896400068cc..1277d1d4109 100644
--- a/lisp/mail/mailheader.el
+++ b/lisp/mail/mailheader.el
@@ -101,7 +101,7 @@ value."
101 (cons (cdr header) (funcall (cdr rule) (cdr header)))))))) 101 (cons (cdr header) (funcall (cdr rule) (cdr header))))))))
102 headers) 102 headers)
103 103
104;; Advertized part of the interface; see mail-header, mail-header-set. 104;; Advertised part of the interface; see mail-header, mail-header-set.
105(defvar headers) 105(defvar headers)
106 106
107(defsubst mail-header (header &optional header-alist) 107(defsubst mail-header (header &optional header-alist)
diff --git a/lisp/mail/rmail.el b/lisp/mail/rmail.el
index 06867f6d92a..7fe5383d865 100644
--- a/lisp/mail/rmail.el
+++ b/lisp/mail/rmail.el
@@ -3443,6 +3443,16 @@ does not pop any summary buffer."
3443 (setq yank-action (list 'insert-buffer replybuffer))) 3443 (setq yank-action (list 'insert-buffer replybuffer)))
3444 (push (cons "cc" cc) other-headers) 3444 (push (cons "cc" cc) other-headers)
3445 (push (cons "in-reply-to" in-reply-to) other-headers) 3445 (push (cons "in-reply-to" in-reply-to) other-headers)
3446 (setq other-headers
3447 (mapcar #'(lambda (elt)
3448 (cons (car elt) (if (stringp (cdr elt))
3449 (rfc2047-decode-string (cdr elt)))))
3450 other-headers))
3451 (if (stringp to) (setq to (rfc2047-decode-string to)))
3452 (if (stringp in-reply-to)
3453 (setq in-reply-to (rfc2047-decode-string in-reply-to)))
3454 (if (stringp cc) (setq cc (rfc2047-decode-string cc)))
3455 (if (stringp subject) (setq subject (rfc2047-decode-string subject)))
3446 (prog1 3456 (prog1
3447 (compose-mail to subject other-headers noerase 3457 (compose-mail to subject other-headers noerase
3448 switch-function yank-action sendactions 3458 switch-function yank-action sendactions
@@ -3450,7 +3460,7 @@ does not pop any summary buffer."
3450 (if (eq switch-function 'switch-to-buffer-other-frame) 3460 (if (eq switch-function 'switch-to-buffer-other-frame)
3451 ;; This is not a standard frame parameter; nothing except 3461 ;; This is not a standard frame parameter; nothing except
3452 ;; sendmail.el looks at it. 3462 ;; sendmail.el looks at it.
3453 (modify-frame-parameters (selected-frame) 3463 (modify-frame-parameters (selected-frame)
3454 '((mail-dedicated-frame . t))))))) 3464 '((mail-dedicated-frame . t)))))))
3455 3465
3456(defun rmail-mail-return () 3466(defun rmail-mail-return ()
diff --git a/lisp/mail/rmailmm.el b/lisp/mail/rmailmm.el
index 0bfeb121ca4..96132739b20 100644
--- a/lisp/mail/rmailmm.el
+++ b/lisp/mail/rmailmm.el
@@ -853,28 +853,33 @@ The other arguments are the same as `rmail-mime-multipart-handler'."
853 ((looking-at "[ \t]*\n") 853 ((looking-at "[ \t]*\n")
854 (setq next (copy-marker (match-end 0) t))) 854 (setq next (copy-marker (match-end 0) t)))
855 (t 855 (t
856 (rmail-mm-get-boundary-error-message 856 ;; The original code signalled an error as below, but
857 "Malformed boundary" content-type content-disposition 857 ;; this line may be a boundary of nested multipart. So,
858 content-transfer-encoding))) 858 ;; we just set `next' to nil to skip this line
859 859 ;; (rmail-mm-get-boundary-error-message
860 (setq index (1+ index)) 860 ;; "Malformed boundary" content-type content-disposition
861 ;; Handle the part. 861 ;; content-transfer-encoding)
862 (if parse-tag 862 (setq next nil)))
863
864 (when next
865 (setq index (1+ index))
866 ;; Handle the part.
867 (if parse-tag
868 (save-restriction
869 (narrow-to-region beg end)
870 (let ((child (rmail-mime-process
871 nil (format "%s/%d" parse-tag index)
872 content-type content-disposition)))
873 ;; Display a tagline.
874 (aset (aref (rmail-mime-entity-display child) 1) 1
875 (aset (rmail-mime-entity-tagline child) 2 t))
876 (push child entities)))
877
878 (delete-region end next)
863 (save-restriction 879 (save-restriction
864 (narrow-to-region beg end) 880 (narrow-to-region beg end)
865 (let ((child (rmail-mime-process 881 (rmail-mime-show)))
866 nil (format "%s/%d" parse-tag index) 882 (goto-char (setq beg next))))
867 content-type content-disposition)))
868 ;; Display a tagline.
869 (aset (aref (rmail-mime-entity-display child) 1) 1
870 (aset (rmail-mime-entity-tagline child) 2 t))
871 (push child entities)))
872
873 (delete-region end next)
874 (save-restriction
875 (narrow-to-region beg end)
876 (rmail-mime-show)))
877 (goto-char (setq beg next)))
878 883
879 (when parse-tag 884 (when parse-tag
880 (setq entities (nreverse entities)) 885 (setq entities (nreverse entities))
diff --git a/lisp/progmodes/sql.el b/lisp/progmodes/sql.el
index 9e49f0e775b..1c1ffc41624 100644
--- a/lisp/progmodes/sql.el
+++ b/lisp/progmodes/sql.el
@@ -2801,7 +2801,7 @@ server/database name."
2801(defun sql-rename-buffer (&optional new-name) 2801(defun sql-rename-buffer (&optional new-name)
2802 "Rename a SQL interactive buffer. 2802 "Rename a SQL interactive buffer.
2803 2803
2804Prompts for the new name if command is preceeded by 2804Prompts for the new name if command is preceded by
2805\\[universal-argument]. If no buffer name is provided, then the 2805\\[universal-argument]. If no buffer name is provided, then the
2806`sql-alternate-buffer-name' is used. 2806`sql-alternate-buffer-name' is used.
2807 2807
@@ -3262,7 +3262,7 @@ you must tell Emacs. Here's how to do that in your `~/.emacs' file:
3262 :abbrev-table sql-mode-abbrev-table 3262 :abbrev-table sql-mode-abbrev-table
3263 (if sql-mode-menu 3263 (if sql-mode-menu
3264 (easy-menu-add sql-mode-menu)); XEmacs 3264 (easy-menu-add sql-mode-menu)); XEmacs
3265 3265
3266 (set (make-local-variable 'comment-start) "--") 3266 (set (make-local-variable 'comment-start) "--")
3267 ;; Make each buffer in sql-mode remember the "current" SQLi buffer. 3267 ;; Make each buffer in sql-mode remember the "current" SQLi buffer.
3268 (make-local-variable 'sql-buffer) 3268 (make-local-variable 'sql-buffer)
@@ -4257,4 +4257,3 @@ buffer.
4257(provide 'sql) 4257(provide 'sql)
4258 4258
4259;;; sql.el ends here 4259;;; sql.el ends here
4260