File: dot.vm-hide-ref

package info (click to toggle)
vm 7.19-11
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 3,876 kB
  • ctags: 2,117
  • sloc: lisp: 31,154; sh: 354; ansic: 292; makefile: 202
file content (26 lines) | stat: -rw-r--r-- 968 bytes parent folder | download | duplicates (14)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
In .emacs

(defun hide-references-hook ()
  (save-excursion
    (let (lim)
      (goto-char (point-min))
      (re-search-forward (concat "^" (regexp-quote mail-header-separator) "$"))
      (setq lim (match-beginning 0))
      (goto-char (point-min))
      (cond ((re-search-forward "^References:.*\n\\([ \t].*\n\\)*" lim t)
	     (let ((o (make-overlay (match-beginning 0) (match-end 0))))
	       (overlay-put o 'invisible t)))))))

(defun hide-in-reply-to-hook ()
  (save-excursion
    (let (lim)
      (goto-char (point-min))
      (re-search-forward (concat "^" (regexp-quote mail-header-separator) "$"))
      (setq lim (match-beginning 0))
      (goto-char (point-min))
      (cond ((re-search-forward "^In-Reply-To:.*\n\\([ \t].*\n\\)*" lim t)
	     (let ((o (make-overlay (match-beginning 0) (match-end 0))))
	       (overlay-put o 'invisible t)))))))

(add-hook 'vm-mail-mode-hook 'hide-references-hook)
(add-hook 'vm-mail-mode-hook 'hide-in-reply-to-hook)