;;; gnus-summary-update-subject.el --- Display subject on the first line, dynamically ;;; Time-stamp: <2004-03-07 18:02:03 bojohan> ;; ;; Modified by Sacha to work with subjects anywhere in the summary line. ;; Note that this probably only works with my .gnus. ;; User beware. ;; i guess you could fix the problem with filling and ;; truncation of the subject. a spec like ">%20s" with a ;; short subject will become ">XXXXXXXXXXXXXsubject", i ;; think, where X are spaces and the `s' is the first ;; character to have the text property. then you have to ;; fill or truncate the overlay accordingly. ;; or you could replace the %B spec with a user format ;; function, and put the text property on that, and get rid ;; of the regexp search. ;; simply ;; (defun gnus-user-format-function-thread (dummy) ;; (propertize gnus-tmp-thread-tree-header-string ;; 'prop 'val)) ;; "%u&thread;" ;;; Code: (defvar gnus-summary-update-subject-overlay nil) (setq gnus-summary-same-subject (propertize " " 'gnus-summary-same-subject t)) (defvar gnus-summary-update-subject-thread-marker ">") (defun gnus-summary-update-subject (&optional window start) (when gnus-summary-update-subject-overlay (save-excursion (goto-char (or start (window-start))) (when (re-search-forward gnus-summary-update-subject-thread-marker (line-end-position) t) (if (not (text-property-any (line-beginning-position) (line-end-position) 'gnus-summary-same-subject t)) (delete-overlay gnus-summary-update-subject-overlay) (let ((subject (gnus-summary-subject-string (gnus-summary-article-number)))) (move-overlay gnus-summary-update-subject-overlay (1+ point) (+ point 1 (length subject))) ;;(overlay-put gnus-summary-subject-overlay 'window (selected-window)) (overlay-put gnus-summary-update-subject-overlay 'invisible t) (overlay-put gnus-summary-update-subject-overlay 'intangible t) (overlay-put gnus-summary-update-subject-overlay 'after-string subject))))))) (defun gnus-summary-update-subject-setup () (add-hook 'window-scroll-functions 'gnus-summary-update-subject nil t) (set (make-local-variable 'gnus-summary-update-subject-overlay) (make-overlay 0 0))) (add-hook 'gnus-summary-prepared-hook 'gnus-summary-update-subject-setup) (defadvice gnus-summary-position-point (after summary-update-subject activate) (gnus-summary-update-subject)) (provide 'gnus-summary-update-subject) ;;; gnus-summary-update-subject.el ends here