From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/82826 Path: news.gmane.org!not-for-mail From: Wolfgang Jenkner Newsgroups: gmane.emacs.gnus.general Subject: Re: face issue in latest emacs snapshot Date: Wed, 09 Jan 2013 20:33:39 +0100 Message-ID: <85k3rmqhgs.fsf@iznogoud.viz> References: <7vfw2b9r1w.fsf@news.eternal-september.org> <85ehhv5g2v.fsf@iznogoud.viz> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1357760060 26075 80.91.229.3 (9 Jan 2013 19:34:20 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 9 Jan 2013 19:34:20 +0000 (UTC) To: ding@gnus.org Original-X-From: ding-owner+M31092@lists.math.uh.edu Wed Jan 09 20:34:37 2013 Return-path: Envelope-to: ding-account@gmane.org Original-Received: from util0.math.uh.edu ([129.7.128.18]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Tt1Pz-0005zz-HB for ding-account@gmane.org; Wed, 09 Jan 2013 20:34:31 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.math.uh.edu) by util0.math.uh.edu with smtp (Exim 4.63) (envelope-from ) id 1Tt1PM-0007G1-8K; Wed, 09 Jan 2013 13:33:52 -0600 Original-Received: from mx2.math.uh.edu ([129.7.128.33]) by util0.math.uh.edu with esmtps (TLSv1:AES256-SHA:256) (Exim 4.63) (envelope-from ) id 1Tt1PK-0007Fl-C1 for ding@lists.math.uh.edu; Wed, 09 Jan 2013 13:33:50 -0600 Original-Received: from quimby.gnus.org ([80.91.231.51]) by mx2.math.uh.edu with esmtps (TLSv1:AES256-SHA:256) (Exim 4.76) (envelope-from ) id 1Tt1PI-0000tH-J1 for ding@lists.math.uh.edu; Wed, 09 Jan 2013 13:33:49 -0600 Original-Received: from mx10.lb01.inode.at ([62.99.145.10] helo=mx.inode.at) by quimby.gnus.org with esmtp (Exim 4.72) (envelope-from ) id 1Tt1PG-0000th-Hy for ding@gnus.org; Wed, 09 Jan 2013 20:33:46 +0100 Original-Received: from [91.119.206.19] (port=4172 helo=iznogoud.viz) by smartmx-10.inode.at with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.69) (envelope-from ) id 1Tt1PB-0007Dv-40 for ding@gnus.org; Wed, 09 Jan 2013 20:33:41 +0100 Original-Received: from wolfgang by iznogoud.viz with local (Exim 4.80.1 (FreeBSD)) (envelope-from ) id 1Tt1P9-0001Bm-AD for ding@gnus.org; Wed, 09 Jan 2013 20:33:39 +0100 Mail-Followup-To: ding@gnus.org In-Reply-To: (Richard Riley's message of "Wed, 09 Jan 2013 08:20:09 +0000") User-Agent: Gnus/5.130006 (Ma Gnus v0.6) Emacs/24.3.50 (berkeley-unix) X-Spam-Score: -1.9 (-) List-ID: Precedence: bulk Xref: news.gmane.org gmane.emacs.gnus.general:82826 Archived-At: On Wed, Jan 09 2013, Richard Riley wrote: > possibly more pertinently:- > > ,---- > | gnus-group-line-format's value is "%M%S%p%P%-12uy%(%-60ug%) > `---- > > the ug part is the important bit. Thanks. > Im assuming something here > > | (propertize "\x2709" 'face (rgr/unread-face > | "my-inbox-icon-face") 'gnus-face t) > > is the issue > > commenting out the intern line below I can still run Gnus. (This all > worked for ages before latest emacs snapshot) Well, on the one hand the `gnus-face' text-property is not documented and really just an internal implementation artefact, I think. On the other hand there's likely nothing else to achieve the desired effect in a reasonable way. Does the following patch work for you? Wolfgang -- >8 -- Subject: [PATCH] Try to be compatible with old usage of gnus-face. --- lisp/gnus-spec.el | 4 ++-- lisp/gnus-util.el | 18 ++++++++++-------- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/lisp/gnus-spec.el b/lisp/gnus-spec.el index 446e826..4337cb6 100644 --- a/lisp/gnus-spec.el +++ b/lisp/gnus-spec.el @@ -271,8 +271,8 @@ Return a list of updated types." ;; `gnus-add-text-properties' runs, since it will be modified ;; by `gnus-put-text-property-excluding-characters-with-faces'. (list ',(symbol-value (intern (format "gnus-face-%d" type))) 'default) - ;; Redundant now, but still convenient. - '(gnus-face t))))) + ;; Mark it as our own stuff. + '(gnus-face gnus-face--merge))))) (defun gnus-balloon-face-function (form type) `(gnus-put-text-property diff --git a/lisp/gnus-util.el b/lisp/gnus-util.el index df805c6..f93bbe8 100644 --- a/lisp/gnus-util.el +++ b/lisp/gnus-util.el @@ -872,9 +872,10 @@ 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) + (let ((stop (next-single-property-change beg 'face nil end)) + (what (get-text-property beg 'gnus-face))) + (if what + (when (and (eq prop 'face) (eq what 'gnus-face--merge)) (setcar (cdr (get-text-property beg 'face)) (or val 'default))) (inline (gnus-put-text-property beg stop prop val))) @@ -884,11 +885,12 @@ Otherwise, do nothing." "The same as `get-text-property', except where `gnus-face' is set. If so, and PROP is `face', return the second element of its value. Otherwise, return the value." - (let ((val (get-text-property pos prop))) - (if (and (get-text-property pos 'gnus-face) - (eq prop 'face)) - (cadr val) - (get-text-property pos prop)))) + (let ((val (get-text-property pos prop)) + (what (get-text-property pos 'gnus-face))) + (if what + (when (and (eq prop 'face) (eq what 'gnus-face--merge)) + (cadr val)) + val))) (defmacro gnus-faces-at (position) "Return a list of faces at POSITION." -- 1.8.0.3