From debbugs-submit-bounces@debbugs.gnu.org Sat Sep 15 11:20:03 2012 Received: (at submit) by debbugs.gnu.org; 15 Sep 2012 15:20:03 +0000 Received: from localhost ([127.0.0.1]:35656 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TCuA6-00012v-9M for submit@debbugs.gnu.org; Sat, 15 Sep 2012 11:20:02 -0400 Received: from mx07.lb01.inode.at ([62.99.145.7]:25970 helo=mx.inode.at) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TCuA2-00012R-QH for submit@debbugs.gnu.org; Sat, 15 Sep 2012 11:20:00 -0400 Received: from [91.119.101.188] (port=6558 helo=iznogoud.viz) by smartmx-07.inode.at with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.69) (envelope-from ) id 1TCu90-0001ia-8L for submit@debbugs.gnu.org; Sat, 15 Sep 2012 17:18:54 +0200 Received: from wolfgang by iznogoud.viz with local (Exim 4.80 (FreeBSD)) (envelope-from ) id 1TCu8y-000DaO-RB for submit@debbugs.gnu.org; Sat, 15 Sep 2012 17:18:52 +0200 From: Wolfgang Jenkner To: submit@debbugs.gnu.org (The Gnus Bugfixing Girls + Boys) Subject: [PATCH] Combine formatting faces with other highlighting Date: Sat, 15 Sep 2012 16:55:00 +0200 X-Debbugs-Version: 5.130006 X-Debbugs-Package: gnus Message-ID: <85txuzl3fn.fsf@iznogoud.viz> User-Agent: Gnus/5.130006 (Ma Gnus v0.6) Emacs/24.2.50 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.4 (--) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.4 (--) This implements the proposal discussed in the thread starting with http://article.gmane.org/gmane.emacs.gnus.general/82112 tl;dr: A formatting face is effectively prepended to other highlighting (like gnus-summary-normal-unread). That is, the value of the `face' text property is a single face or a list of two faces. I haven't updated the manual because (info "(gnus)Formatting Fonts") doesn't really go into embarrassing details, to begin with. A list of faces as value of the `face' text property has been supported at least since emacs 21, see http://www.delorie.com/gnu/docs/elisp-manual-21/elisp_527.html I don't know since when xemacs has had this feature, though. I tested this only with Ma Gnus v0.6 GNU Emacs 24.2.50.1 (amd64-unknown-freebsd9.0, GTK+ Version 2.24.6) of 2012-09-11 on iznogoud.viz 2012-09-13 Wolfgang Jenkner * lisp/gnus-spec.el (gnus-face-face-function): Initialize the value of the `face' property with a list whose car is the face specified in the format string and whose cdr is (nil). * lisp/gnus-util.el (gnus-put-text-property-excluding-characters-with-faces): Change accordingly. (gnus-get-text-property-excluding-characters-with-faces): New function. * lisp/gnus-sum.el (gnus-summary-highlight-line): * lisp/gnus-salt.el (gnus-tree-highlight-node): * lisp/gnus-group.el (gnus-group-highlight-line): Use it -- >8 -- Subject: [PATCH] Inherit from other highlighting where the gnus-face text property is set. --- lisp/gnus-group.el | 2 +- lisp/gnus-salt.el | 2 +- lisp/gnus-spec.el | 9 ++++++++- lisp/gnus-sum.el | 2 +- lisp/gnus-util.el | 33 ++++++++++++++++++++++----------- 5 files changed, 33 insertions(+), 15 deletions(-) diff --git a/lisp/gnus-group.el b/lisp/gnus-group.el index a19ba4d..becae7c 100644 --- a/lisp/gnus-group.el +++ b/lisp/gnus-group.el @@ -1667,7 +1667,7 @@ and ends at END." (let ((face (cdar (gnus-group-update-eval-form group gnus-group-highlight)))) - (unless (eq face (get-text-property beg 'face)) + (unless (eq face (gnus-get-text-property-excluding-characters-with-faces beg 'face)) (let ((inhibit-read-only t)) (gnus-put-text-property-excluding-characters-with-faces beg end 'face diff --git a/lisp/gnus-salt.el b/lisp/gnus-salt.el index 760a7a0..5ac2c55 100644 --- a/lisp/gnus-salt.el +++ b/lisp/gnus-salt.el @@ -659,7 +659,7 @@ Two predefined functions are available: (while (and list (not (eval (caar list)))) (setq list (cdr list))))) - (unless (eq (setq face (cdar list)) (get-text-property beg 'face)) + (unless (eq (setq face (cdar list)) (gnus-get-text-property-excluding-characters-with-faces beg 'face)) (gnus-put-text-property-excluding-characters-with-faces beg end 'face (if (boundp face) (symbol-value face) face))))) diff --git a/lisp/gnus-spec.el b/lisp/gnus-spec.el index f40177d..22d4627 100644 --- a/lisp/gnus-spec.el +++ b/lisp/gnus-spec.el @@ -265,7 +265,14 @@ Return a list of updated types." (defun gnus-face-face-function (form type) `(gnus-add-text-properties (point) (progn ,@form (point)) - '(gnus-face t face ,(symbol-value (intern (format "gnus-face-%d" type)))))) + (cons 'face + (cons + ;; Delay consing the value of the `face' property until + ;; `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))) nil) + ;; Redundant now, but still convenient. + '(gnus-face t))))) (defun gnus-balloon-face-function (form type) `(gnus-put-text-property diff --git a/lisp/gnus-sum.el b/lisp/gnus-sum.el index efbcb4d..e005007 100644 --- a/lisp/gnus-sum.el +++ b/lisp/gnus-sum.el @@ -12532,7 +12532,7 @@ If REVERSE, save parts that do not match TYPE." (memq article gnus-newsgroup-undownloaded) (not (memq article gnus-newsgroup-cached))))) (let ((face (funcall (gnus-summary-highlight-line-0)))) - (unless (eq face (get-text-property beg 'face)) + (unless (eq face (gnus-get-text-property-excluding-characters-with-faces beg 'face)) (gnus-put-text-property-excluding-characters-with-faces beg (point-at-eol) 'face (setq face (if (boundp face) (symbol-value face) face))) diff --git a/lisp/gnus-util.el b/lisp/gnus-util.el index f5e1077..beec74c 100644 --- a/lisp/gnus-util.el +++ b/lisp/gnus-util.el @@ -866,18 +866,29 @@ If there's no subdirectory, delete DIRECTORY as well." (setq beg (point))) (gnus-overlay-put (gnus-make-overlay beg (point)) prop val))))) -(defun gnus-put-text-property-excluding-characters-with-faces (beg end - prop val) - "The same as `put-text-property', but don't put props on characters with the `gnus-face' property." - (let ((b beg)) - (while (/= b end) - (when (get-text-property b 'gnus-face) - (setq b (next-single-property-change b 'gnus-face nil end))) - (when (/= b end) +(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)) val)) (inline - (gnus-put-text-property - b (setq b (next-single-property-change b 'gnus-face nil end)) - prop val)))))) + (gnus-put-text-property beg stop prop val))) + (setq beg stop)))) + +(defun gnus-get-text-property-excluding-characters-with-faces (pos prop) + "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)))) (defmacro gnus-faces-at (position) "Return a list of faces at POSITION." -- 1.7.11.5 From debbugs-submit-bounces@debbugs.gnu.org Tue Dec 25 07:56:56 2012 Received: (at 12451) by debbugs.gnu.org; 25 Dec 2012 12:56:56 +0000 Received: from localhost ([127.0.0.1]:58742 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TnU3v-0003SR-9U for submit@debbugs.gnu.org; Tue, 25 Dec 2012 07:56:56 -0500 Received: from hermes.netfonds.no ([80.91.224.195]:46023) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TnU3o-0003SC-9e for 12451@debbugs.gnu.org; Tue, 25 Dec 2012 07:56:49 -0500 Received: from ip-90-20-179-93.dialup.ice.net ([93.179.20.90] helo=rusty) by hermes.netfonds.no with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.72) (envelope-from ) id 1TnU32-0008NR-Qt; Tue, 25 Dec 2012 13:55:57 +0100 To: Wolfgang Jenkner Subject: Re: bug#12451: [PATCH] Combine formatting faces with other highlighting References: <85txuzl3fn.fsf@iznogoud.viz> X-Now-Playing: Winston Tong's _Theoretically Chinese_ From: Lars Ingebrigtsen Date: Tue, 25 Dec 2012 13:55:53 +0100 In-Reply-To: <85txuzl3fn.fsf@iznogoud.viz> (Wolfgang Jenkner's message of "Sat, 15 Sep 2012 16:55:00 +0200") Message-ID: <87licm5m06.fsf@gnus.org> User-Agent: Gnus/5.130006 (Ma Gnus v0.6) Emacs/24.3.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-MailScanner-ID: 1TnU32-0008NR-Qt X-Netfonds-MailScanner: Found to be clean X-Netfonds-MailScanner-From: larsi@gnus.org MailScanner-NULL-Check: 1357044957.78493@XRE3DGyAbzVLijbFPxoibw X-Spam-Status: No X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 12451 Cc: bugs@gnus.org, 12451@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list Reply-To: bugs@gnus.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.9 (-) Wolfgang Jenkner writes: > This implements the proposal discussed in the thread starting with > > http://article.gmane.org/gmane.emacs.gnus.general/82112 Thanks; applied to Ma Gnus. -- (domestic pets only, the antidote for overdose, milk.) http://lars.ingebrigtsen.no * Lars Magne Ingebrigtsen From debbugs-submit-bounces@debbugs.gnu.org Tue Dec 25 07:56:56 2012 Received: (at control) by debbugs.gnu.org; 25 Dec 2012 12:56:57 +0000 Received: from localhost ([127.0.0.1]:58745 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TnU40-0003Sg-Cp for submit@debbugs.gnu.org; Tue, 25 Dec 2012 07:56:56 -0500 Received: from hermes.netfonds.no ([80.91.224.195]:46034) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TnU3x-0003ST-34 for control@debbugs.gnu.org; Tue, 25 Dec 2012 07:56:53 -0500 Received: from ip-90-20-179-93.dialup.ice.net ([93.179.20.90] helo=rusty) by hermes.netfonds.no with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.72) (envelope-from ) id 1TnU3G-0008Ny-Rf for control@debbugs.gnu.org; Tue, 25 Dec 2012 13:56:11 +0100 Date: Tue, 25 Dec 2012 13:56:08 +0100 Message-Id: <87k3s65lzr.fsf@gnus.org> To: control@debbugs.gnu.org From: Lars Ingebrigtsen Subject: control message for bug #12451 X-MailScanner-ID: 1TnU3G-0008Ny-Rf X-Netfonds-MailScanner: Found to be clean X-Netfonds-MailScanner-From: larsi@gnus.org MailScanner-NULL-Check: 1357044971.36168@y+ug+d2V/AgLFAQoaFwgMQ X-Spam-Status: No X-Spam-Score: 0.8 (/) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: 0.8 (/) tags 12451 fixed close 12451 24.4 From debbugs-submit-bounces@debbugs.gnu.org Thu Dec 27 12:13:29 2012 Received: (at 12451) by debbugs.gnu.org; 27 Dec 2012 17:13:29 +0000 Received: from localhost ([127.0.0.1]:33871 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1ToH1M-0000jG-PS for submit@debbugs.gnu.org; Thu, 27 Dec 2012 12:13:29 -0500 Received: from mx21.lb01.inode.at ([62.99.145.23]:56998 helo=mx.inode.at) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1ToH1J-0000j6-8h for 12451@debbugs.gnu.org; Thu, 27 Dec 2012 12:13:26 -0500 Received: from [91.119.206.19] (port=8898 helo=iznogoud.viz) by smartmx-21.inode.at with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.69) (envelope-from ) id 1ToH0W-0005YH-60; Thu, 27 Dec 2012 18:12:36 +0100 Received: from wolfgang by iznogoud.viz with local (Exim 4.80.1 (FreeBSD)) (envelope-from ) id 1ToH0U-0000Pj-0m; Thu, 27 Dec 2012 18:12:34 +0100 From: Wolfgang Jenkner To: Lars Ingebrigtsen Subject: Re: bug#12451: [PATCH] Combine formatting faces with other highlighting Date: Thu, 27 Dec 2012 18:10:13 +0100 References: <85txuzl3fn.fsf@iznogoud.viz> <87licm5m06.fsf@gnus.org> Message-ID: <85d2xvl8qm.fsf@iznogoud.viz> User-Agent: Gnus/5.130006 (Ma Gnus v0.6) Emacs/24.3.50 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 12451 Cc: bugs@gnus.org, 12451@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.9 (-) On Tue, Dec 25 2012, Lars Ingebrigtsen wrote: > Wolfgang Jenkner writes: > >> This implements the proposal discussed in the thread starting with >> >> http://article.gmane.org/gmane.emacs.gnus.general/82112 > > Thanks; applied to Ma Gnus. Here's a small correction (I don't see the messages I'm talking about below in the echo area, only in *Messages*, so they had escaped me): 2012-12-27 Wolfgang Jenkner * gnus-spec.el (gnus-face-face-function): Don't use nil as no-op face place holder since this gives `Invalid face reference: nil' messages. Use the `default' face instead. It has the same effect here, even though it is not no-op. * gnus-util.el (gnus-put-text-property-excluding-characters-with-faces): Similarly. -- >8 -- Subject: [PATCH] Avoid `Invalid face reference: nil' messages. --- lisp/gnus-spec.el | 2 +- lisp/gnus-util.el | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lisp/gnus-spec.el b/lisp/gnus-spec.el index 22d4627..0b5203d 100644 --- a/lisp/gnus-spec.el +++ b/lisp/gnus-spec.el @@ -270,7 +270,7 @@ Return a list of updated types." ;; Delay consing the value of the `face' property until ;; `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))) nil) + (list ',(symbol-value (intern (format "gnus-face-%d" type))) 'default) ;; Redundant now, but still convenient. '(gnus-face t))))) diff --git a/lisp/gnus-util.el b/lisp/gnus-util.el index 705a9e0..fb218e5 100644 --- a/lisp/gnus-util.el +++ b/lisp/gnus-util.el @@ -875,7 +875,7 @@ Otherwise, do nothing." (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)) val)) + (setcar (cdr (get-text-property beg 'face)) (or val 'default))) (inline (gnus-put-text-property beg stop prop val))) (setq beg stop)))) -- 1.8.0.2 From debbugs-submit-bounces@debbugs.gnu.org Thu Dec 27 12:19:14 2012 Received: (at 12451) by debbugs.gnu.org; 27 Dec 2012 17:19:14 +0000 Received: from localhost ([127.0.0.1]:33901 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1ToH6v-0000u8-N2 for submit@debbugs.gnu.org; Thu, 27 Dec 2012 12:19:14 -0500 Received: from hermes.netfonds.no ([80.91.224.195]:58292) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1ToH6s-0000tz-R4 for 12451@debbugs.gnu.org; Thu, 27 Dec 2012 12:19:12 -0500 Received: from ip-90-20-179-93.dialup.ice.net ([93.179.20.90] helo=rusty) by hermes.netfonds.no with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.72) (envelope-from ) id 1ToH5y-0003Yo-Nn; Thu, 27 Dec 2012 18:18:15 +0100 From: Lars Ingebrigtsen To: Wolfgang Jenkner Subject: Re: bug#12451: [PATCH] Combine formatting faces with other highlighting References: <85txuzl3fn.fsf@iznogoud.viz> <87licm5m06.fsf@gnus.org> <85d2xvl8qm.fsf@iznogoud.viz> X-Now-Playing: Winston Tong's _Theoretically Chinese_ Date: Thu, 27 Dec 2012 18:18:11 +0100 In-Reply-To: <85d2xvl8qm.fsf@iznogoud.viz> (Wolfgang Jenkner's message of "Thu, 27 Dec 2012 18:10:13 +0100") Message-ID: <87k3s3ct2k.fsf@gnus.org> User-Agent: Gnus/5.130006 (Ma Gnus v0.6) Emacs/24.3.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-MailScanner-ID: 1ToH5y-0003Yo-Nn X-Netfonds-MailScanner: Found to be clean X-Netfonds-MailScanner-From: larsi@gnus.org MailScanner-NULL-Check: 1357233495.51357@YpnHn5uJDUp9ECz19Ly7lg X-Spam-Status: No X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 12451 Cc: 12451@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.9 (-) Wolfgang Jenkner writes: > Here's a small correction (I don't see the messages I'm talking about > below in the echo area, only in *Messages*, so they had escaped me): Thanks; applied. -- (domestic pets only, the antidote for overdose, milk.) http://lars.ingebrigtsen.no * Lars Magne Ingebrigtsen From unknown Mon Jun 23 13:11:12 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Fri, 25 Jan 2013 12:24:03 +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