Gnus development mailing list
 help / color / mirror / Atom feed
From: Wolfgang Jenkner <wjenkner@inode.at>
To: ding@gnus.org
Subject: Re: face issue in latest emacs snapshot
Date: Wed, 09 Jan 2013 20:33:39 +0100	[thread overview]
Message-ID: <85k3rmqhgs.fsf@iznogoud.viz> (raw)
In-Reply-To: <mmehhuzs1y.fsf@news.eternal-september.org> (Richard Riley's message of "Wed, 09 Jan 2013 08:20:09 +0000")

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




      parent reply	other threads:[~2013-01-09 19:33 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-08 23:46 Richard Riley
2013-01-09  0:45 ` Katsumi Yamaoka
2013-01-09  4:34   ` Katsumi Yamaoka
2013-01-09  0:56 ` Wolfgang Jenkner
2013-01-09  8:20   ` Richard Riley
2013-01-09 10:22     ` Katsumi Yamaoka
2013-01-09 19:33     ` Wolfgang Jenkner [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=85k3rmqhgs.fsf@iznogoud.viz \
    --to=wjenkner@inode.at \
    --cc=ding@gnus.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).