From debbugs-submit-bounces@debbugs.gnu.org Sat Oct 25 12:10:53 2014 Received: (at submit) by debbugs.gnu.org; 25 Oct 2014 16:10:54 +0000 Received: from localhost ([127.0.0.1]:35406 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Xi3vW-0003pY-F4 for submit@debbugs.gnu.org; Sat, 25 Oct 2014 12:10:51 -0400 Received: from mail-bn1bon0144.outbound.protection.outlook.com ([157.56.111.144]:31376 helo=na01-bn1-obe.outbound.protection.outlook.com) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Xi1dn-0007K7-Bz for submit@debbugs.gnu.org; Sat, 25 Oct 2014 09:44:24 -0400 Received: from localhost (68.119.94.37) by BY2PR02MB218.namprd02.prod.outlook.com (10.242.232.21) with Microsoft SMTP Server (TLS) id 15.0.1054.13; Sat, 25 Oct 2014 13:44:15 +0000 From: Zhitao Gong To: The Gnus Bugfixing Girls + Boys Subject: gnus-summary-line-format text face X-Debbugs-Version: 5.13 X-Debbugs-Package: gnus Date: Sat, 25 Oct 2014 08:44:05 -0500 Message-ID: <87zjck8dsq.fsf@auburn.edu> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [68.119.94.37] X-ClientProxiedBy: AM2PR03CA0040.eurprd03.prod.outlook.com (25.160.207.50) To BY2PR02MB218.namprd02.prod.outlook.com (10.242.232.21) X-Microsoft-Antispam: UriScan:; X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:;SRVR:BY2PR02MB218; X-AU: Internal message X-Exchange-Antispam-Report-Test: UriScan:; X-Forefront-PRVS: 0375972289 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(6009001)(6069001)(199003)(377424004)(129404003)(189002)(31966008)(110136001)(122386002)(76506005)(77096002)(97736003)(90282001)(89122001)(101416001)(42186005)(230783001)(64706001)(47776003)(20776003)(66066001)(102836001)(83506001)(76482002)(33646002)(54356999)(50466002)(229853001)(107886001)(106356001)(107046002)(105586002)(36756003)(88552001)(95666004)(85852003)(46102003)(50986999)(87976001)(75432002)(4396001)(21056001)(120916001)(92726001)(85306004)(80022003)(92566001)(48376002)(40100003)(42262002); DIR:OUT; SFP:1102; SCL:1; SRVR:BY2PR02MB218; H:localhost; FPR:; MLV:sfv; PTR:InfoNoRecords; A:1; MX:1; LANG:en; X-OriginatorOrg: auburn.edu X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Sat, 25 Oct 2014 12:10:45 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) I'm setting the date face according to how old the date is with the following code: --- code begins --- (defun header-age-level (header) "Return the age of the header The age are divided into three levels: 0: no more than one day old 1: no more than one week old 2: otherwise Based on the age of the header, I set different foreground color for the header string. " (let* ((now (time-to-day-in-year (current-time))) (header-date-time (time-to-day-in-year (safe-date-to-time (mail-header-date header)))) (mail-age (- now header-date-time))) (cond ((< mail-age 1) 0) ((< mail-age 7) 1) (t 2)))) (defface my-date-one-day-old-face '((default (:foreground "#ADFF2F"))) "...") (defface my-date-one-week-old-face '((default (:foreground "#79B221"))) "...") (defface my-date-more-than-one-week-old-face '((default (:foreground "#456613"))) "...") (defun gnus-user-format-function-color-date (header) (let ((header-date-time-string (format-time-string "%Y-%m-%d %H:%M" (safe-date-to-time (mail-header-date header)))) (age-level (header-age-level header))) (cond ((= 0 age-level) (propertize header-date-time-string 'face 'my-date-one-day-old-face 'gnus-face t )) ((= 1 age-level) (propertize header-date-time-string 'face 'my-date-one-week-old-face 'gnus-face t)) (t (propertize header-date-time-string 'face 'my-date-more-than-one-week-old-face 'gnus-face t))))) (setq-default gnus-summary-line-format "%U%R%z %(%u&color-date; %-30,30f %B%s%)\n") ^---- this is my function --- code ends --- This works fine in Emacs24, however, when I upgrade to the new version, emacs-25.x.x, I got the following error (please see the backtrace information). I've identified the source of this error --- code begins --- (defun gnus-put-text-property-excluding-characters-with-faces (beg end prop val) "The same as `put-text-property', except where `gnus-face' is set. If so, and PROP is `face', set the second element of its value to VAL. Otherwise, do nothing." (while (< beg end) ;; Property values are compared with `eq'. (let ((stop (next-single-property-change beg 'face nil end))) (if (get-text-property beg 'gnus-face) (when (eq prop 'face) (setcar (cdr (get-text-property beg 'face)) (or val 'default))) ;; <- !!! THIS LINE !!! (inline (gnus-put-text-property beg stop prop val))) (setq beg stop)))) --- code ends --- The `(get-text-property beg 'face)` returns a face object, say, `my-date-one-day-old-face`, which is NOT a list object, so `cdr` throws the error "wrong-type-argument listp my-date-more-than-one-week-old-face" Hope this helps! The backtrace: Debugger entered--Lisp error: (wrong-type-argument listp my-date-more-than-one-week-old-face) gnus-put-text-property-excluding-characters-with-faces(1 55 face gnus-summary-normal-unread) gnus-summary-highlight-line() gnus-summary-insert-line([0 "" "" "05 Apr 2001 23:33:09 +0400" "" "" 0 0 "" nil] 0 nil t 90 t nil "" nil 1) gnus-update-summary-mark-positions() gnus-summary-mode("Tiger/INBOX") gnus-summary-setup-buffer("Tiger/INBOX") gnus-summary-read-group-1("Tiger/INBOX" t t nil nil nil) gnus-summary-read-group("Tiger/INBOX" t t nil nil nil nil) gnus-group-read-group(nil t) gnus-group-select-group(nil) funcall-interactively(gnus-group-select-group nil) call-interactively(gnus-group-select-group nil nil) command-execute(gnus-group-select-group) Gnus v5.13 GNU Emacs 25.0.50.1 (x86_64-pc-linux-gnu, GTK+ Version 3.12.2) of 2014-10-24 on lgw01-26 From debbugs-submit-bounces@debbugs.gnu.org Sun Oct 26 11:00:28 2014 Received: (at 18830) by debbugs.gnu.org; 26 Oct 2014 15:00:28 +0000 Received: from localhost ([127.0.0.1]:36075 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XiPIx-0004Wk-9M for submit@debbugs.gnu.org; Sun, 26 Oct 2014 11:00:27 -0400 Received: from b2bfep12.mx.upcmail.net ([62.179.121.57]:48644) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XiPIu-0004WU-2a for 18830@debbugs.gnu.org; Sun, 26 Oct 2014 11:00:25 -0400 Received: from edge11.upcmail.net ([192.168.13.81]) by b2bfep12-int.chello.at (InterMail vM.8.01.05.11 201-2260-151-128-20120928) with ESMTP id <20141026150017.NWHT11692.b2bfep12-int.chello.at@edge11.upcmail.net> for <18830@debbugs.gnu.org>; Sun, 26 Oct 2014 16:00:17 +0100 Received: from iznogoud.viz ([91.119.112.128]) by edge11.upcmail.net with edge id 7r0D1p0142mGAdF0Br0E50; Sun, 26 Oct 2014 16:00:17 +0100 X-SourceIP: 91.119.112.128 Received: from wolfgang by iznogoud.viz with local (Exim 4.84 (FreeBSD)) (envelope-from ) id 1XiPIj-0000KS-Ju; Sun, 26 Oct 2014 16:00:13 +0100 From: Wolfgang Jenkner To: Zhitao Gong Subject: Re: bug#18830: gnus-summary-line-format text face References: <87zjck8dsq.fsf@auburn.edu> Date: Sun, 26 Oct 2014 16:00:13 +0100 In-Reply-To: <87zjck8dsq.fsf@auburn.edu> (Zhitao Gong's message of "Sat, 25 Oct 2014 08:44:05 -0500") Message-ID: <85oasykhaa.fsf@iznogoud.viz> User-Agent: Gnus/5.130012 (Ma Gnus v0.12) Emacs/24.4.50 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 18830 Cc: 18830@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) On Sat, Oct 25 2014, Zhitao Gong wrote: > (t > (propertize header-date-time-string > 'face 'my-date-more-than-one-week-old-face > 'gnus-face t))))) > > (setq-default > gnus-summary-line-format "%U%R%z %(%u&color-date; %-30,30f %B%s%)\n") > ^---- this is my function A similar case was reported in the thread starting with: http://permalink.gmane.org/gmane.emacs.gnus.general/82816 Strictly speaking, gnus-face is an undocumented text property for internal purposes; practically speaking, however, your use case requires using it in some way. The thread cited above indicates two possible solutions: 1) Rewrite your code to mimic how gnus does things now (i.e., replace my-date-one-day-old-face as the value of the face text property by, e.g., (list 'my-date-one-day-old-face 'default), etc.) See also gnus-face-face-function. or 2) There's a (small, but somewhat ugly) compatibility patch in the last message in the thread, viz., http://permalink.gmane.org/gmane.emacs.gnus.general/82826 From debbugs-submit-bounces@debbugs.gnu.org Wed Jan 25 15:53:33 2017 Received: (at 18830) by debbugs.gnu.org; 25 Jan 2017 20:53:33 +0000 Received: from localhost ([127.0.0.1]:43626 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cWUZQ-0000Ff-Vn for submit@debbugs.gnu.org; Wed, 25 Jan 2017 15:53:33 -0500 Received: from hermes.netfonds.no ([80.91.224.195]:45140) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cWUZO-0000FX-Vz for 18830@debbugs.gnu.org; Wed, 25 Jan 2017 15:53:31 -0500 Received: from 2.150.50.220.tmi.telenormobil.no ([2.150.50.220] helo=mouse) by hermes.netfonds.no with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1cWUZL-0003RY-8b; Wed, 25 Jan 2017 21:53:29 +0100 From: Lars Ingebrigtsen To: Wolfgang Jenkner Subject: Re: bug#18830: gnus-summary-line-format text face In-Reply-To: <85oasykhaa.fsf@iznogoud.viz> (Wolfgang Jenkner's message of "Sun, 26 Oct 2014 16:00:13 +0100") Date: Wed, 25 Jan 2017 21:44:07 +0100 Message-ID: <87o9yug99k.fsf@gnus.org> References: <87zjck8dsq.fsf@auburn.edu> <85oasykhaa.fsf@iznogoud.viz> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 18830 Cc: Zhitao Gong , 18830@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) Wolfgang Jenkner writes: > The thread cited above indicates two possible solutions: > > 1) Rewrite your code to mimic how gnus does things now (i.e., replace > my-date-one-day-old-face as the value of the face text property by, > e.g., (list 'my-date-one-day-old-face 'default), etc.) > See also gnus-face-face-function. Yes, I think that's the proper solution, so this isn't really a bug, I think. -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From debbugs-submit-bounces@debbugs.gnu.org Wed Jan 25 15:53:23 2017 Received: (at control) by debbugs.gnu.org; 25 Jan 2017 20:53:24 +0000 Received: from localhost ([127.0.0.1]:43623 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cWUZH-0000FI-PV for submit@debbugs.gnu.org; Wed, 25 Jan 2017 15:53:23 -0500 Received: from hermes.netfonds.no ([80.91.224.195]:45134) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cWUZF-0000FA-P1 for control@debbugs.gnu.org; Wed, 25 Jan 2017 15:53:22 -0500 Received: from 2.150.50.220.tmi.telenormobil.no ([2.150.50.220] helo=mouse) by hermes.netfonds.no with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1cWUZD-0002u9-Ce for control@debbugs.gnu.org; Wed, 25 Jan 2017 21:53:21 +0100 From: Lars Ingebrigtsen To: control@debbugs.gnu.org Subject: control message for bug #18830 Message-ID: <87pojag99n.fsf@totally-fudged-out-message-id> Date: Wed, 25 Jan 2017 21:53:13 +0100 User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux) X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) reassign 18830 emacs,gnus From debbugs-submit-bounces@debbugs.gnu.org Wed Jan 25 15:53:39 2017 Received: (at control) by debbugs.gnu.org; 25 Jan 2017 20:53:39 +0000 Received: from localhost ([127.0.0.1]:43629 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cWUZX-0000G0-6c for submit@debbugs.gnu.org; Wed, 25 Jan 2017 15:53:39 -0500 Received: from hermes.netfonds.no ([80.91.224.195]:45148) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cWUZV-0000Fs-W9 for control@debbugs.gnu.org; Wed, 25 Jan 2017 15:53:38 -0500 Received: from 2.150.50.220.tmi.telenormobil.no ([2.150.50.220] helo=mouse) by hermes.netfonds.no with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1cWUZT-00042W-My for control@debbugs.gnu.org; Wed, 25 Jan 2017 21:53:37 +0100 From: Lars Ingebrigtsen To: control@debbugs.gnu.org Subject: control message for bug #18830 Message-ID: <87mveeg99i.fsf@totally-fudged-out-message-id> Date: Wed, 25 Jan 2017 21:53:29 +0100 User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux) X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) close 18830 From unknown Fri Sep 05 20:36:40 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Thu, 23 Feb 2017 12:24:05 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator