From 19cc66979d336c0b62cf770ecb5863a86cfd510e Mon Sep 17 00:00:00 2001 From: Gnus developers Date: Thu, 27 Jan 2011 23:42:38 +0000 Subject: [PATCH] Merge changes made in Gnus trunk. mml2015.el (mml2015-epg-sign): Add and use mml2015-sign-with-sender. (mml2015-epg-encrypt): Use mml2015-sign-with-sender. gnus-art.el (article-update-date-lapsed): Ensure that point stays at the "same place" even if point is on the line being replaced. (article-update-date-lapsed): Allow updating both the combined lapsed and the lapsed headers. (article-update-date-lapsed): Skip past all the X-Sent/Date headers. (article-make-date-line): Limit the number of segments dynamically to avoid too-long lines. --- lisp/gnus/ChangeLog | 15 +++++++++++++++ lisp/gnus/gnus-art.el | 40 +++++++++++++++++++++++++++++++++------- lisp/gnus/mml2015.el | 12 ++++++++++-- 3 files changed, 58 insertions(+), 9 deletions(-) diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog index 5a915bb5aed..2bb58c98fec 100644 --- a/lisp/gnus/ChangeLog +++ b/lisp/gnus/ChangeLog @@ -1,3 +1,18 @@ +2011-01-27 Lars Ingebrigtsen + + * gnus-art.el (article-update-date-lapsed): Ensure that point stays at + the "same place" even if point is on the line being replaced. + (article-update-date-lapsed): Allow updating both the combined lapsed + and the lapsed headers. + (article-update-date-lapsed): Skip past all the X-Sent/Date headers. + (article-make-date-line): Limit the number of segments dynamically to + avoid too-long lines. + +2011-01-27 Julien Danjou + + * mml2015.el (mml2015-epg-sign): Add and use mml2015-sign-with-sender. + (mml2015-epg-encrypt): Use mml2015-sign-with-sender. + 2011-01-27 Katsumi Yamaoka * shr.el (shr-expand-newlines, shr-previous-newline-padding-width): diff --git a/lisp/gnus/gnus-art.el b/lisp/gnus/gnus-art.el index 327250e327b..2960e8f8e27 100644 --- a/lisp/gnus/gnus-art.el +++ b/lisp/gnus/gnus-art.el @@ -3570,8 +3570,20 @@ should replace the \"Date:\" one, or should be added below it." (concat "X-Sent: " (article-lapsed-string time))) ;; A combined date/lapsed format. ((eq type 'combined-lapsed) - (concat (article-make-date-line date 'original) - " (" (article-lapsed-string time 3) ")")) + (let ((date-string (article-make-date-line date 'original)) + (segments 3) + lapsed-string) + (while (and + (setq lapsed-string + (concat " (" (article-lapsed-string time segments) ")")) + (> (+ (length date-string) + (length lapsed-string)) + (+ fill-column 10)) + (> segments 0)) + (setq segments (1- segments))) + (if (> segments 0) + (concat date-string lapsed-string) + date-string))) ;; Display the date in proper English ((eq type 'english) (let ((dtime (decode-time time))) @@ -3674,19 +3686,33 @@ function and want to see what the date was before converting." "Function to be run from a timer to update the lapsed time line." (save-match-data (let (deactivate-mark) - (save-excursion + (save-window-excursion (ignore-errors (walk-windows (lambda (w) (set-buffer (window-buffer w)) (when (eq major-mode 'gnus-article-mode) - (let ((mark (point-marker))) + (let ((mark (point-marker)) + (old-point (point))) (goto-char (point-min)) (when (re-search-forward "^X-Sent:\\|^Date:" nil t) - (if gnus-treat-date-combined-lapsed - (article-date-combined-lapsed t) + ;; If the point is on the Date line, then use that + ;; absolute position. Otherwise, use the mark. + ;; This will ensure that point stays at the "same + ;; place". + (when (or (< old-point (match-beginning 0)) + (> old-point (progn + (forward-line 1) + (while (and (not (eobp)) + (looking-at "X-Sent:\\|Date:")) + (forward-line)) + (point)))) + (setq old-point nil)) + (when gnus-treat-date-combined-lapsed + (article-date-combined-lapsed t)) + (when gnus-treat-date-lapsed (article-date-lapsed t))) - (goto-char (marker-position mark)) + (goto-char (or old-point (marker-position mark))) (move-marker mark nil)))) nil 'visible)))))) diff --git a/lisp/gnus/mml2015.el b/lisp/gnus/mml2015.el index 0ac6208d9d9..eb01c924c2d 100644 --- a/lisp/gnus/mml2015.el +++ b/lisp/gnus/mml2015.el @@ -120,6 +120,12 @@ Whether the passphrase is cached at all is controlled by :group 'mime-security :type '(repeat (string :tag "Key ID"))) +(defcustom mml2015-sign-with-sender nil + "If t, use message sender so find a key to sign with." + :group 'mime-security + :type 'boolean + :version "24.1") + (defcustom mml2015-encrypt-to-self nil "If t, add your own key ID to recipient list when encryption." :group 'mime-security @@ -959,7 +965,8 @@ Whether the passphrase is cached at all is controlled by (let* ((inhibit-redisplay t) (context (epg-make-context)) (boundary (mml-compute-boundary cont)) - (sender (message-options-get 'message-sender)) + (sender (when mml2015-sign-with-sender + message-options-get 'message-sender)) signer-key (signers (or (message-options-get 'mml2015-epg-signers) @@ -1034,7 +1041,8 @@ If no one is selected, default secret key is used. " (let ((inhibit-redisplay t) (context (epg-make-context)) (config (epg-configuration)) - (sender (message-options-get 'message-sender)) + (sender (when mml2015-sign-with-sender + (message-options-get 'message-sender))) (recipients (message-options-get 'mml2015-epg-recipients)) cipher signers (boundary (mml-compute-boundary cont)) -- 2.39.5