From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/20206 Path: main.gmane.org!not-for-mail From: Colin Rafferty Newsgroups: gmane.emacs.gnus.general Subject: [patch] gnus-start-date-timer vs. picons and single-article-buffer Date: 11 Jan 1999 17:16:01 -0500 Sender: owner-ding@hpc.uh.edu Message-ID: NNTP-Posting-Host: coloc-standby.netfonds.no Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: main.gmane.org 1035158539 16538 80.91.224.250 (21 Oct 2002 00:02:19 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Mon, 21 Oct 2002 00:02:19 +0000 (UTC) Keywords: patch,article Return-Path: Original-Received: from karazm.math.uh.edu (karazm.math.uh.edu [129.7.128.1]) by sclp3.sclp.com (8.8.5/8.8.5) with ESMTP id RAA06392 for ; Mon, 11 Jan 1999 17:17:22 -0500 (EST) Original-Received: from sina.hpc.uh.edu (lists@Sina.HPC.UH.EDU [129.7.3.5]) by karazm.math.uh.edu (8.9.1/8.9.1) with ESMTP id QAB18555; Mon, 11 Jan 1999 16:16:45 -0600 (CST) Original-Received: by sina.hpc.uh.edu (TLB v0.09a (1.20 tibbs 1996/10/09 22:03:07)); Mon, 11 Jan 1999 16:16:52 -0600 (CST) Original-Received: from sclp3.sclp.com (root@sclp3.sclp.com [204.252.123.139]) by sina.hpc.uh.edu (8.7.3/8.7.3) with ESMTP id QAA03854 for ; Mon, 11 Jan 1999 16:16:41 -0600 (CST) Original-Received: from hqinbh2.ms.com (hqinbh2.ms.com [205.228.12.72]) by sclp3.sclp.com (8.8.5/8.8.5) with ESMTP id RAA06361 for ; Mon, 11 Jan 1999 17:16:36 -0500 (EST) Original-Received: (from uucp@localhost) by hqinbh2.ms.com (8.8.6/fw v1.30) id RAA10852 for ; Mon, 11 Jan 1999 17:16:17 -0500 (EST) Original-Received: from unknown(144.14.8.140) by hqinbh2 via smap (4.1) id xma010841; Mon, 11 Jan 99 17:16:02 -0500 Original-Received: from sag3.morgan.com (sag3.morgan.com [144.14.8.198]) by sas1.morgan.com (8.8.5/hub v1.9) with ESMTP id RAA20759 for ; Mon, 11 Jan 1999 17:16:02 -0500 (EST) Original-Received: (from craffert@localhost) by sag3.morgan.com (8.8.5/client v1.15) id WAA11730; Mon, 11 Jan 1999 22:16:01 GMT Original-To: GNUS Mailing List X-Face: D>:hrrB{l6#\wU;)0R:OHSTA@ayd.Oq?s@Rrc;[+z0m+<-U"$G-J6L)F2QY`qK~uPu!s1(6{\#uy!Ag/D)?'L[}xErXvxoPn8T_hKi{M]/(`BF{e}X7;hby`p\.E$rJ}Aff#BT,rdDIw\y X-Y-Zippy: I feel better about world problems now! Original-Lines: 137 Precedence: list X-Majordomo: 1.94.jlt7 Xref: main.gmane.org gmane.emacs.gnus.general:20206 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:20206 This is a MIME multipart message. If you are reading this, you shouldn't. --=-=-= This patch mostly deals with the fact that I read multiple newsgroups at once (setq gnus-single-article-buffer nil). In fact, I don't understand how anyone can survive with the default. Three changes in one patch: 1. Using picons sets the mode of *Article* to 'gnus-picons-mode. However, `article-update-date-lapsed' only checks for for 'gnus-article-mode. 2. The variable gnus-current-header is only set for gnus-summary-mode. Therefore, all *Article* buffers are getting the X-Sent of whichever article I last hit SPC in. 3. `walk-windows' only walks in the current frame. We really want to walk in all visible frames. Otherwise, side-by-side newsgroup reading loses. --=-=-= Content-Disposition: attachment Content-Description: patch to make date-timers work with picons 1999-01-11 Colin Rafferty * gnus-art.el (article-update-date-lapsed): Made it work with picons, and make it update on all visible frames. (article-date-ut): Get summary-buffer's current-headers. --- lisp/gnus-art.el~ Sun Jan 3 08:36:04 1999 +++ lisp/gnus-art.el Mon Jan 11 16:48:46 1999 @@ -1451,7 +1451,9 @@ how much time has lapsed since DATE." (interactive (list 'ut t)) (let* ((header (or header - (mail-header-date gnus-current-headers) + (mail-header-date (save-excursion + (set-buffer gnus-summary-buffer) + gnus-current-headers)) (message-fetch-field "date") "")) (date (if (vectorp header) (mail-header-date header) @@ -1601,7 +1603,7 @@ (walk-windows (lambda (w) (set-buffer (window-buffer w)) - (when (eq major-mode 'gnus-article-mode) + (when (memq major-mode '(gnus-article-mode gnus-picons-mode)) (goto-char (point-min)) (when (re-search-forward "^X-Sent:" nil t) (article-date-lapsed t))))))))) --- lisp/gnus-art.el~ Sun Jan 3 08:36:04 1999 +++ lisp/gnus-art.el Mon Jan 11 16:55:05 1999 @@ -1451,7 +1451,9 @@ how much time has lapsed since DATE." (interactive (list 'ut t)) (let* ((header (or header - (mail-header-date gnus-current-headers) + (mail-header-date (save-excursion + (set-buffer gnus-summary-buffer) + gnus-current-headers)) (message-fetch-field "date") "")) (date (if (vectorp header) (mail-header-date header) @@ -1601,10 +1603,11 @@ (walk-windows (lambda (w) (set-buffer (window-buffer w)) - (when (eq major-mode 'gnus-article-mode) + (when (memq major-mode '(gnus-article-mode gnus-picons-mode)) (goto-char (point-min)) (when (re-search-forward "^X-Sent:" nil t) - (article-date-lapsed t))))))))) + (article-date-lapsed t)))) + nil 'visible))))) (defun gnus-start-date-timer (&optional n) "Start a timer to update the X-Sent header in the article buffers. --- lisp/gnus-art.el~ Sun Jan 3 08:36:04 1999 +++ lisp/gnus-art.el Mon Jan 11 16:55:05 1999 @@ -1446,17 +1446,19 @@ "Mapping from time units to seconds.") (defun article-date-ut (&optional type highlight header) "Convert DATE date to universal time in the current article. If TYPE is `local', convert to local time; if it is `lapsed', output how much time has lapsed since DATE." (interactive (list 'ut t)) (let* ((header (or header - (mail-header-date gnus-current-headers) + (mail-header-date (save-excursion + (set-buffer gnus-summary-buffer) + gnus-current-headers)) (message-fetch-field "date") "")) (date (if (vectorp header) (mail-header-date header) header)) (date-regexp "^Date:[ \t]\\|^X-Sent:[ \t]") (inhibit-point-motion-hooks t) bface eface newline) (when (and date (not (string= date ""))) @@ -1596,20 +1598,21 @@ (defun article-update-date-lapsed () "Function to be run from a timer to update the lapsed time line." (let (deactivate-mark) (save-excursion (ignore-errors (walk-windows (lambda (w) (set-buffer (window-buffer w)) - (when (eq major-mode 'gnus-article-mode) + (when (memq major-mode '(gnus-article-mode gnus-picons-mode)) (goto-char (point-min)) (when (re-search-forward "^X-Sent:" nil t) - (article-date-lapsed t))))))))) + (article-date-lapsed t)))) + nil 'visible))))) (defun gnus-start-date-timer (&optional n) "Start a timer to update the X-Sent header in the article buffers. The numerical prefix says how frequently (in seconds) the function is to run." (interactive "p") (unless n (setq n 1)) --=-=-= ;; Colin --=-=-=--