diff options
| author | Richard M. Stallman | 1996-12-28 20:56:53 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1996-12-28 20:56:53 +0000 |
| commit | dbf71ee969f6cc30363971b3c977cf9c6d541e0b (patch) | |
| tree | 88cea64bb36b65597a0b05212dcc8ef172095f1a /lisp | |
| parent | f2102d2cd7c29a97c4d7084b72078ae9652d3c0b (diff) | |
| download | emacs-dbf71ee969f6cc30363971b3c977cf9c6d541e0b.tar.gz emacs-dbf71ee969f6cc30363971b3c977cf9c6d541e0b.zip | |
(rmail-msg-is-pruned): New function.
(rmail-toggle-header): Add an optional argument to specify explicitly
whether the header should be pruned or displayed in full.
Diffstat (limited to 'lisp')
| -rw-r--r-- | lisp/mail/rmail.el | 63 |
1 files changed, 40 insertions, 23 deletions
diff --git a/lisp/mail/rmail.el b/lisp/mail/rmail.el index d882d24c330..30493fea700 100644 --- a/lisp/mail/rmail.el +++ b/lisp/mail/rmail.el | |||
| @@ -1397,33 +1397,50 @@ Otherwise, delete all header fields whose names match `rmail-ignored-headers'." | |||
| 1397 | (progn (re-search-forward "\n[^ \t]") | 1397 | (progn (re-search-forward "\n[^ \t]") |
| 1398 | (1- (point)))))))))) | 1398 | (1- (point)))))))))) |
| 1399 | 1399 | ||
| 1400 | (defun rmail-toggle-header () | 1400 | (defun rmail-msg-is-pruned () |
| 1401 | "Show original message header if pruned header currently shown, or vice versa." | ||
| 1402 | (interactive) | ||
| 1403 | (rmail-maybe-set-message-counters) | 1401 | (rmail-maybe-set-message-counters) |
| 1402 | (save-restriction | ||
| 1403 | (save-excursion | ||
| 1404 | (narrow-to-region (rmail-msgbeg rmail-current-message) (point-max)) | 1404 | (narrow-to-region (rmail-msgbeg rmail-current-message) (point-max)) |
| 1405 | (let ((buffer-read-only nil)) | ||
| 1406 | (goto-char (point-min)) | 1405 | (goto-char (point-min)) |
| 1407 | (forward-line 1) | 1406 | (forward-line 1) |
| 1408 | (if (= (following-char) ?1) | 1407 | (= (following-char) ?1)))) |
| 1409 | (progn (delete-char 1) | 1408 | |
| 1410 | (insert ?0) | 1409 | (defun rmail-toggle-header (&optional arg) |
| 1411 | (forward-line 1) | 1410 | "Show original message header if pruned header currently shown, or vice versa. |
| 1412 | (let ((case-fold-search t)) | 1411 | With argument ARG, show the message header pruned if ARG is greater than zero; |
| 1413 | (while (looking-at "Summary-Line:\\|Mail-From:") | 1412 | otherwise, show it in full." |
| 1414 | (forward-line 1))) | 1413 | (interactive "P") |
| 1415 | (insert "*** EOOH ***\n") | 1414 | (let* ((buffer-read-only nil) |
| 1416 | (forward-char -1) | 1415 | (pruned (rmail-msg-is-pruned)) |
| 1417 | (search-forward "\n*** EOOH ***\n") | 1416 | (prune (if arg |
| 1418 | (forward-line -1) | 1417 | (> (prefix-numeric-value arg) 0) |
| 1419 | (let ((temp (point))) | 1418 | (not pruned)))) |
| 1420 | (and (search-forward "\n\n" nil t) | 1419 | (if (eq pruned prune) |
| 1421 | (delete-region temp (point)))) | 1420 | t |
| 1422 | (goto-char (point-min)) | 1421 | (rmail-maybe-set-message-counters) |
| 1423 | (search-forward "\n*** EOOH ***\n") | 1422 | (narrow-to-region (rmail-msgbeg rmail-current-message) (point-max)) |
| 1424 | (narrow-to-region (point) (point-max))) | 1423 | (if pruned |
| 1425 | (rmail-reformat-message (point-min) (point-max)))) | 1424 | (progn (goto-char (point-min)) |
| 1426 | (rmail-highlight-headers)) | 1425 | (forward-line 1) |
| 1426 | (delete-char 1) | ||
| 1427 | (insert ?0) | ||
| 1428 | (forward-line 1) | ||
| 1429 | (let ((case-fold-search t)) | ||
| 1430 | (while (looking-at "Summary-Line:\\|Mail-From:") | ||
| 1431 | (forward-line 1))) | ||
| 1432 | (insert "*** EOOH ***\n") | ||
| 1433 | (forward-char -1) | ||
| 1434 | (search-forward "\n*** EOOH ***\n") | ||
| 1435 | (forward-line -1) | ||
| 1436 | (let ((temp (point))) | ||
| 1437 | (and (search-forward "\n\n" nil t) | ||
| 1438 | (delete-region temp (point)))) | ||
| 1439 | (goto-char (point-min)) | ||
| 1440 | (search-forward "\n*** EOOH ***\n") | ||
| 1441 | (narrow-to-region (point) (point-max))) | ||
| 1442 | (rmail-reformat-message (point-min) (point-max))) | ||
| 1443 | (rmail-highlight-headers)))) | ||
| 1427 | 1444 | ||
| 1428 | ;;;; *** Rmail Attributes and Keywords *** | 1445 | ;;;; *** Rmail Attributes and Keywords *** |
| 1429 | 1446 | ||