From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/20207 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:18:49 -0500 Sender: owner-ding@hpc.uh.edu Message-ID: References: NNTP-Posting-Host: coloc-standby.netfonds.no Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: main.gmane.org 1035158540 16539 80.91.224.250 (21 Oct 2002 00:02:20 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Mon, 21 Oct 2002 00:02:20 +0000 (UTC) Keywords: patch 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 RAA06465 for ; Mon, 11 Jan 1999 17:19:53 -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 QAB18606; Mon, 11 Jan 1999 16:19:29 -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:19:37 -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 QAA03914 for ; Mon, 11 Jan 1999 16:19:27 -0600 (CST) Original-Received: from piinbh1.ms.com (firewall-user@piinbh1.ms.com [199.89.64.71]) by sclp3.sclp.com (8.8.5/8.8.5) with ESMTP id RAA06449 for ; Mon, 11 Jan 1999 17:19:21 -0500 (EST) Original-Received: (from uucp@localhost) by piinbh1.ms.com (8.8.6/fw v1.22) id RAA00143 for ; Mon, 11 Jan 1999 17:19:07 -0500 (EST) Original-Received: from unknown(144.14.8.140) by piinbh1.ms.com via smap (4.1) id xma029552; Mon, 11 Jan 99 17:18:51 -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 RAA20798 for ; Mon, 11 Jan 1999 17:18:50 -0500 (EST) Original-Received: (from craffert@localhost) by sag3.morgan.com (8.8.5/client v1.15) id WAA12322; Mon, 11 Jan 1999 22:18:50 GMT Original-To: GNUS Mailing List X-Face: ""xJff%{>hr-{:QXl"Xk2O@@(+F]e{"%EYQiW@mUuvEsL>=mx96j12qW[%m;|:B^n{J8k?Mz[K1_+H;$v,nYx^1o_=4M,L+]FIU~[[`-w~~xsy-BX,?tAF_.8u&0y*@aCv;a}Y'{w@#*@iwAl?oZpvvv X-Y-Zippy: Sorry, wrong ZIP CODE!! In-Reply-To: Colin Rafferty's message of "11 Jan 1999 16:17:22 -0500" Original-Lines: 78 User-Agent: Gnus/5.070069 (Pterodactyl Gnus v0.69) XEmacs/21.0(beta61) (Poitou61) Precedence: list X-Majordomo: 1.94.jlt7 Xref: main.gmane.org gmane.emacs.gnus.general:20207 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:20207 This is a MIME multipart message. If you are reading this, you shouldn't. --=-=-= Colin Rafferty writes: > [bad patch deleted] I am a moron. I hit C-c C-a on a file that I hadn't saved. Here is the correct patch. --=-=-= Content-Disposition: attachment Content-Description: correct 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: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 --=-=-=--