diff options
| author | Karl Heuer | 1998-06-02 06:54:40 +0000 |
|---|---|---|
| committer | Karl Heuer | 1998-06-02 06:54:40 +0000 |
| commit | 72f69d0fb317125ef5c0dbe7db29410547cc8285 (patch) | |
| tree | c43d40e7a73a09f25ef972489d60f71891186e0e | |
| parent | 8a8147d64b5c8ad5148ca9952add6a4b18149dad (diff) | |
| download | emacs-72f69d0fb317125ef5c0dbe7db29410547cc8285.tar.gz emacs-72f69d0fb317125ef5c0dbe7db29410547cc8285.zip | |
(rmail-toggle-header): Preserve point
and window-start (more or less) when reverting to original header.
| -rw-r--r-- | lisp/mail/rmail.el | 66 |
1 files changed, 36 insertions, 30 deletions
diff --git a/lisp/mail/rmail.el b/lisp/mail/rmail.el index dde5e975989..b94f4657c6f 100644 --- a/lisp/mail/rmail.el +++ b/lisp/mail/rmail.el | |||
| @@ -1780,36 +1780,42 @@ Otherwise, delete all header fields whose names match `rmail-ignored-headers'." | |||
| 1780 | With argument ARG, show the message header pruned if ARG is greater than zero; | 1780 | With argument ARG, show the message header pruned if ARG is greater than zero; |
| 1781 | otherwise, show it in full." | 1781 | otherwise, show it in full." |
| 1782 | (interactive "P") | 1782 | (interactive "P") |
| 1783 | (let* ((buffer-read-only nil) | 1783 | (save-excursion |
| 1784 | (pruned (rmail-msg-is-pruned)) | 1784 | (let* ((buffer-read-only nil) |
| 1785 | (prune (if arg | 1785 | (pruned (rmail-msg-is-pruned)) |
| 1786 | (> (prefix-numeric-value arg) 0) | 1786 | (prune (if arg |
| 1787 | (not pruned)))) | 1787 | (> (prefix-numeric-value arg) 0) |
| 1788 | (if (eq pruned prune) | 1788 | (not pruned)))) |
| 1789 | t | 1789 | (if (eq pruned prune) |
| 1790 | (rmail-maybe-set-message-counters) | 1790 | t |
| 1791 | (narrow-to-region (rmail-msgbeg rmail-current-message) (point-max)) | 1791 | (rmail-maybe-set-message-counters) |
| 1792 | (if pruned | 1792 | (narrow-to-region (rmail-msgbeg rmail-current-message) (point-max)) |
| 1793 | (progn (goto-char (point-min)) | 1793 | (if pruned |
| 1794 | (forward-line 1) | 1794 | (let (window-at-top) |
| 1795 | (delete-char 1) | 1795 | (goto-char (point-min)) |
| 1796 | (insert ?0) | 1796 | (forward-line 1) |
| 1797 | (forward-line 1) | 1797 | (delete-char 1) |
| 1798 | (let ((case-fold-search t)) | 1798 | (insert ?0) |
| 1799 | (while (looking-at "Summary-Line:\\|Mail-From:") | 1799 | (forward-line 1) |
| 1800 | (forward-line 1))) | 1800 | (let ((case-fold-search t)) |
| 1801 | (insert "*** EOOH ***\n") | 1801 | (while (looking-at "Summary-Line:\\|Mail-From:") |
| 1802 | (forward-char -1) | 1802 | (forward-line 1))) |
| 1803 | (search-forward "\n*** EOOH ***\n") | 1803 | (insert "*** EOOH ***\n") |
| 1804 | (forward-line -1) | 1804 | (forward-char -1) |
| 1805 | (let ((temp (point))) | 1805 | (search-forward "\n*** EOOH ***\n") |
| 1806 | (and (search-forward "\n\n" nil t) | 1806 | (forward-line -1) |
| 1807 | (delete-region temp (point)))) | 1807 | (let ((temp (point))) |
| 1808 | (goto-char (point-min)) | 1808 | (when (search-forward "\n\n" nil t) |
| 1809 | (search-forward "\n*** EOOH ***\n") | 1809 | (if (< (window-start) (point)) |
| 1810 | (narrow-to-region (point) (point-max))) | 1810 | (setq window-at-top t)) |
| 1811 | (rmail-reformat-message (point-min) (point-max))) | 1811 | (delete-region temp (point)))) |
| 1812 | (rmail-highlight-headers)))) | 1812 | (goto-char (point-min)) |
| 1813 | (search-forward "\n*** EOOH ***\n") | ||
| 1814 | (if window-at-top | ||
| 1815 | (set-window-start (selected-window) (point) t)) | ||
| 1816 | (narrow-to-region (point) (point-max))) | ||
| 1817 | (rmail-reformat-message (point-min) (point-max))) | ||
| 1818 | (rmail-highlight-headers))))) | ||
| 1813 | 1819 | ||
| 1814 | ;;;; *** Rmail Attributes and Keywords *** | 1820 | ;;;; *** Rmail Attributes and Keywords *** |
| 1815 | 1821 | ||