[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] master 45c5ccd 1/4: Fix inserting parts with `E' in Gnus
From: |
Katsumi Yamaoka |
Subject: |
[Emacs-diffs] master 45c5ccd 1/4: Fix inserting parts with `E' in Gnus |
Date: |
Sun, 15 Feb 2015 23:12:59 +0000 |
branch: master
commit 45c5ccd48cee9c703e64fc67139a2e3bb8e9b3a5
Author: Lars Magne Ingebrigtsen <address@hidden>
Commit: Katsumi Yamaoka <address@hidden>
Fix inserting parts with `E' in Gnus
* lisp/gnus/mm-decode.el (mm-head-p): New function.
(mm-display-part): Go to a blank line when inserting parts internally.
Fix inserting parts with `E' in Gnus
* lisp/gnus/mm-decode.el (mm-head-p): New function.
(mm-display-part): Go to a blank line when inserting parts internally.
---
lisp/gnus/ChangeLog | 5 +++++
lisp/gnus/gnus-art.el | 3 ++-
lisp/gnus/mm-decode.el | 12 ++++++++++++
3 files changed, 19 insertions(+), 1 deletions(-)
diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog
index 67929a3..b9ae796 100644
--- a/lisp/gnus/ChangeLog
+++ b/lisp/gnus/ChangeLog
@@ -1,3 +1,8 @@
+2015-02-14 Lars Ingebrigtsen <address@hidden>
+
+ * mm-decode.el (mm-head-p): New function.
+ (mm-display-part): Go to a blank line when inserting parts internally.
+
2015-02-13 Lars Ingebrigtsen <address@hidden>
* gnus-msg.el (gnus-msg-mail): Don't let-bind `gnus-newsgroup-name' so
diff --git a/lisp/gnus/gnus-art.el b/lisp/gnus/gnus-art.el
index b3121bf..8503095 100644
--- a/lisp/gnus/gnus-art.el
+++ b/lisp/gnus/gnus-art.el
@@ -5505,7 +5505,8 @@ If no internal viewer is available, use an external
viewer."
(gnus-mime-view-part-as-type
nil (lambda (type) (mm-inlinable-p handle type)))
(when handle
- (gnus-bind-safe-url-regexp (mm-display-part handle))))))
+ (gnus-bind-safe-url-regexp
+ (mm-display-part handle nil t))))))
(defun gnus-mime-action-on-part (&optional action)
"Do something with the MIME attachment at \(point\)."
diff --git a/lisp/gnus/mm-decode.el b/lisp/gnus/mm-decode.el
index 3fdcdba..459c793 100644
--- a/lisp/gnus/mm-decode.el
+++ b/lisp/gnus/mm-decode.el
@@ -791,6 +791,14 @@ MIME-Version header before proceeding."
(autoload 'mailcap-parse-mailcaps "mailcap")
(autoload 'mailcap-mime-info "mailcap")
+(defun mm-head-p (&optional point)
+ "Return non-nil if point is in the article header."
+ (let ((point (or point (point))))
+ (save-excursion
+ (goto-char point)
+ (and (not (re-search-backward "^$" nil t))
+ (re-search-forward "^$" nil t)))))
+
(defun mm-display-part (handle &optional no-default force)
"Display the MIME part represented by HANDLE.
Returns nil if the part is removed; inline if displayed inline;
@@ -824,6 +832,10 @@ external if displayed external."
'inline)
((and (mm-inlinable-p ehandle)
(mm-inlined-p ehandle))
+ (when force
+ (if (mm-head-p)
+ (re-search-forward "^$" nil t)
+ (forward-line 1)))
(mm-display-inline handle)
'inline)
((or method