------------------------------------------------------------ revno: 116979 committer: Karl Fogel branch nick: trunk timestamp: Wed 2014-04-16 14:46:36 +0800 message: * savehist.el (savehist-save): Remove workaround for a read-passwd bug that was fixed before 24.3. Thanks to Juanma Barranquero for noticing that the shim was still present. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2014-04-14 21:01:37 +0000 +++ lisp/ChangeLog 2014-04-16 06:46:36 +0000 @@ -1,3 +1,9 @@ +2014-04-16 Karl Fogel + + * savehist.el (savehist-save): Remove workaround for a read-passwd + bug that was fixed before 24.3. Thanks to Juanma Barranquero for + noticing that the shim was still present. + 2014-04-14 Stefan Monnier * doc-view.el (doc-view-set-doc-type): Ignore file name case; add .pps. @@ -125,6 +131,7 @@ * subr.el (with-silent-modifications): Don't bind deactivate-mark, buffer-file-name, and buffer-file-truename any more. +>>>>>>> MERGE-SOURCE 2014-04-08 Leo Liu Use lexical-binding and require cl-lib. === modified file 'lisp/savehist.el' --- lisp/savehist.el 2014-02-21 00:47:17 +0000 +++ lisp/savehist.el 2014-04-16 06:46:36 +0000 @@ -278,13 +278,6 @@ (print-level nil) (print-readably t) (print-quoted t)) - ;; During the 24.3 development, read-passwd had a bug which resulted in - ;; the passwords being saved by savehist. Trim them, retroactively. - ;; This code can be removed after the 24.3 release. - (dolist (sym savehist-minibuffer-history-variables) - (if (and (symbolp sym) (equal (symbol-name sym) "forget-history")) - (setq savehist-minibuffer-history-variables - (delq sym savehist-minibuffer-history-variables)))) ;; Save the minibuffer histories, along with the value of ;; savehist-minibuffer-history-variables itself. (when savehist-save-minibuffer-history ------------------------------------------------------------ revno: 116978 committer: Katsumi Yamaoka branch nick: trunk timestamp: Tue 2014-04-15 23:37:21 +0000 message: lisp/gnus/message.el (message-insert-formatted-citation-line): Use the original author's time zone to express a date string diff: === modified file 'lisp/gnus/ChangeLog' --- lisp/gnus/ChangeLog 2014-04-06 18:25:34 +0000 +++ lisp/gnus/ChangeLog 2014-04-15 23:37:21 +0000 @@ -1,3 +1,10 @@ +2014-04-15 Katsumi Yamaoka + + * gmm-utils.el (gmm-format-time-string): New function. + + * message.el (message-insert-formatted-citation-line): Use the original + author's time zone to express a date string. + 2014-04-06 Stefan Monnier * gnus-srvr.el (gnus-tmp-how, gnus-tmp-name, gnus-tmp-where) === modified file 'lisp/gnus/gmm-utils.el' --- lisp/gnus/gmm-utils.el 2014-03-23 23:13:36 +0000 +++ lisp/gnus/gmm-utils.el 2014-04-15 23:37:21 +0000 @@ -443,6 +443,38 @@ (put 'gmm-labels 'lisp-indent-function 1) (put 'gmm-labels 'edebug-form-spec '((&rest (sexp sexp &rest form)) &rest form)) +(defun gmm-format-time-string (format-string &optional time tz) + "Use FORMAT-STRING to format the time TIME, or now if omitted. +The optional TZ specifies the time zone in a number of seconds; any +other non-nil value will be treated as 0. Note that both the format +specifiers `%Z' and `%z' will be replaced with a numeric form. " +;; FIXME: is there a smart way to replace %Z with a time zone name? + (if (and (numberp tz) (not (zerop tz))) + (let ((st 0) + (case-fold-search t) + ls nd rest) + (setq time (if time + (copy-sequence time) + (current-time))) + (if (>= (setq ls (- (cadr time) (car (current-time-zone)) (- tz))) 0) + (setcar (cdr time) ls) + (setcar (cdr time) (+ ls 65536)) + (setcar time (1- (car time)))) + (setq tz (format "%s%02d%02d" + (if (>= tz 0) "+" "-") + (/ (abs tz) 3600) + (/ (% (abs tz) 3600) 60))) + (while (string-match "%+z" format-string st) + (if (zerop (% (- (setq nd (match-end 0)) (match-beginning 0)) 2)) + (progn + (push (substring format-string st (- nd 2)) rest) + (push tz rest)) + (push (substring format-string st nd) rest)) + (setq st nd)) + (push (substring format-string st) rest) + (format-time-string (apply 'concat (nreverse rest)) time)) + (format-time-string format-string time tz))) + (provide 'gmm-utils) ;;; gmm-utils.el ends here === modified file 'lisp/gnus/message.el' --- lisp/gnus/message.el 2014-03-23 23:13:36 +0000 +++ lisp/gnus/message.el 2014-04-15 23:37:21 +0000 @@ -982,8 +982,8 @@ (defcustom message-citation-line-format "On %a, %b %d %Y, %N wrote:\n" "Format of the \"Whomever writes:\" line. -The string is formatted using `format-spec'. The following -constructs are replaced: +The string is formatted using `format-spec'. The following constructs +are replaced: %f The full From, e.g. \"John Doe \". %n The mail address, e.g. \"john.doe@example.invalid\". @@ -991,11 +991,14 @@ back to the mail address. %F The first name if present, e.g.: \"John\". %L The last name if present, e.g.: \"Doe\". + %Z, %z The time zone in the numeric form, e.g.:\"+0000\". All other format specifiers are passed to `format-time-string' -which is called using the date from the article your replying to. -Extracting the first (%F) and last name (%L) is done -heuristically, so you should always check it yourself. +which is called using the date from the article your replying to, but +the date in the formatted string will be expressed in the author's +time zone as much as possible. +Extracting the first (%F) and last name (%L) is done heuristically, +so you should always check it yourself. Please also read the note in the documentation of `message-citation-line-function'." @@ -3920,9 +3923,13 @@ (defvar gnus-extract-address-components) (autoload 'format-spec "format-spec") +(autoload 'gnus-date-get-time "gnus-util") -(defun message-insert-formatted-citation-line (&optional from date) +(defun message-insert-formatted-citation-line (&optional from date tz) "Function that inserts a formatted citation line. +The optional FROM, and DATE are strings containing the contents of +the From header and the Date header respectively. The optional TZ +is a number of seconds, overrides the time zone of DATE. See `message-citation-line-format'." ;; The optional args are for testing/debugging. They will disappear later. @@ -3930,7 +3937,7 @@ ;; (with-temp-buffer ;; (message-insert-formatted-citation-line ;; "John Doe " - ;; (current-time)) + ;; (message-make-date)) ;; (buffer-string)) (when (or message-reply-headers (and from date)) (unless from @@ -3947,28 +3954,43 @@ (net (car (cdr data))) (name-or-net (or (car data) (car (cdr data)) from)) - (replydate - (or - date - ;; We need Gnus functionality if the user wants date or time from - ;; the original article: - (when (string-match "%[^fnNFL]" message-citation-line-format) - (autoload 'gnus-date-get-time "gnus-util") - (gnus-date-get-time (mail-header-date message-reply-headers))))) + (time + (when (string-match "%[^fnNFL]" message-citation-line-format) + (cond ((numberp (car-safe date)) date) ;; backward compatibility + (date (gnus-date-get-time date)) + (t + (gnus-date-get-time + (setq date (mail-header-date message-reply-headers))))))) + (tz (or tz + (when (stringp date) + (nth 8 (parse-time-string date))))) (flist (let ((i ?A) lst) (when (stringp name) ;; Guess first name and last name: - (let* ((names (delq nil (mapcar (lambda (x) - (if (string-match "\\`\\(\\w\\|[-.]\\)+\\'" x) x nil)) - (split-string name "[ \t]+")))) - (count (length names))) - (cond ((= count 1) (setq fname (car names) - lname "")) - ((or (= count 2) (= count 3)) (setq fname (car names) - lname (mapconcat 'identity (cdr names) " "))) - ((> count 3) (setq fname (mapconcat 'identity (butlast names (- count 2)) " ") - lname (mapconcat 'identity (nthcdr 2 names) " "))) ) + (let* ((names (delq + nil + (mapcar + (lambda (x) + (if (string-match "\\`\\(\\w\\|[-.]\\)+\\'" + x) + x + nil)) + (split-string name "[ \t]+")))) + (count (length names))) + (cond ((= count 1) + (setq fname (car names) + lname "")) + ((or (= count 2) (= count 3)) + (setq fname (car names) + lname (mapconcat 'identity (cdr names) " "))) + ((> count 3) + (setq fname (mapconcat 'identity + (butlast names (- count 2)) + " ") + lname (mapconcat 'identity + (nthcdr 2 names) + " ")))) (when (string-match "\\(.*\\),\\'" fname) (let ((newlname (match-string 1 fname))) (setq fname lname lname newlname))))) @@ -3998,7 +4020,7 @@ (>= i ?a))) (push i lst) (push (condition-case nil - (format-time-string (format "%%%c" i) replydate) + (gmm-format-time-string (format "%%%c" i) time tz) (error (format ">%c<" i))) lst)) (setq i (1+ i))) ------------------------------------------------------------ revno: 116977 committer: Stefan Monnier branch nick: trunk timestamp: Mon 2014-04-14 17:01:37 -0400 message: * lisp/doc-view.el (doc-view-set-doc-type): Ignore file name case; add .pps. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2014-04-14 15:38:43 +0000 +++ lisp/ChangeLog 2014-04-14 21:01:37 +0000 @@ -1,3 +1,7 @@ +2014-04-14 Stefan Monnier + + * doc-view.el (doc-view-set-doc-type): Ignore file name case; add .pps. + 2014-04-14 Juanma Barranquero * faces.el (face-set-after-frame-default): Remove unused local variable. === modified file 'lisp/doc-view.el' --- lisp/doc-view.el 2014-04-04 17:42:55 +0000 +++ lisp/doc-view.el 2014-04-14 21:01:37 +0000 @@ -1621,24 +1621,25 @@ "Figure out the current document type (`doc-view-doc-type')." (let ((name-types (when buffer-file-name - (cdr (assoc (file-name-extension buffer-file-name) - '( - ;; DVI - ("dvi" dvi) - ;; PDF - ("pdf" pdf) ("epdf" pdf) - ;; PostScript - ("ps" ps) ("eps" ps) - ;; DjVu - ("djvu" djvu) - ;; OpenDocument formats - ("odt" odf) ("ods" odf) ("odp" odf) ("odg" odf) - ("odc" odf) ("odi" odf) ("odm" odf) ("ott" odf) - ("ots" odf) ("otp" odf) ("otg" odf) - ;; Microsoft Office formats (also handled - ;; by the odf conversion chain) - ("doc" odf) ("docx" odf) ("xls" odf) ("xlsx" odf) - ("ppt" odf) ("pptx" odf)))))) + (cdr (assoc-ignore-case + (file-name-extension buffer-file-name) + '( + ;; DVI + ("dvi" dvi) + ;; PDF + ("pdf" pdf) ("epdf" pdf) + ;; PostScript + ("ps" ps) ("eps" ps) + ;; DjVu + ("djvu" djvu) + ;; OpenDocument formats. + ("odt" odf) ("ods" odf) ("odp" odf) ("odg" odf) + ("odc" odf) ("odi" odf) ("odm" odf) ("ott" odf) + ("ots" odf) ("otp" odf) ("otg" odf) + ;; Microsoft Office formats (also handled by the odf + ;; conversion chain). + ("doc" odf) ("docx" odf) ("xls" odf) ("xlsx" odf) + ("ppt" odf) ("pps" odf) ("pptx" odf)))))) (content-types (save-excursion (goto-char (point-min))