Gnus development mailing list
 help / color / mirror / Atom feed
* Summary line format and gnus-face-X
@ 2012-08-02  6:31 Tassilo Horn
  2012-09-04 22:30 ` Lars Ingebrigtsen
  0 siblings, 1 reply; 24+ messages in thread
From: Tassilo Horn @ 2012-08-02  6:31 UTC (permalink / raw)
  To: ding

Hi all,

as documented in (info "(gnus)Formatting Fonts"), you can make your
summary or group buffers an angry fruit salat by using %i{...%} specs
for i being some number and creating vars gnus-face-i bound to crazy
faces.  And so I did.

Now my problem is that I used that approach to print subjects in summary
buffers using a proportional font.  Works great, except that this format
spec overrides the usual gnus summary fontification that would fontify
according to readness and score.  That only seems to apply to summary
elements not enclosed by %{...%} specs.

Can I have the best of all worlds somehow?  I mean, for the subjects I
just want to have a proportional font but the coloring should be as if
it wasn't enclosed in %5{...%}.

That's the relevant part of my config:

--8<---------------cut here---------------start------------->8---
(defface th-gnus-face-5
  '((default (:family "DeJaVu Sans")))
  "A proportional face.")

(setq gnus-face-5 'th-gnus-face-5
      gnus-summary-line-format
      "%U%R%4{┃%}%2us%4{┃%}%(%-23,23f%)%4{┃ %*%B%} %5{%s%} %3{<%&user-date;>%}\n")
--8<---------------cut here---------------end--------------->8---

Bye,
Tassilo



^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: Summary line format and gnus-face-X
  2012-08-02  6:31 Summary line format and gnus-face-X Tassilo Horn
@ 2012-09-04 22:30 ` Lars Ingebrigtsen
  2012-09-05  6:38   ` Tassilo Horn
  0 siblings, 1 reply; 24+ messages in thread
From: Lars Ingebrigtsen @ 2012-09-04 22:30 UTC (permalink / raw)
  To: Tassilo Horn; +Cc: ding

Tassilo Horn <tsdh@gnu.org> writes:

> Now my problem is that I used that approach to print subjects in summary
> buffers using a proportional font.  Works great, except that this format
> spec overrides the usual gnus summary fontification that would fontify
> according to readness and score.  That only seems to apply to summary
> elements not enclosed by %{...%} specs.

Do you get no colourisation and stuff based on readedness if you use
%{...%}?

-- 
(domestic pets only, the antidote for overdose, milk.)
  http://lars.ingebrigtsen.no  *  Sent from my Emacs



^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: Summary line format and gnus-face-X
  2012-09-04 22:30 ` Lars Ingebrigtsen
@ 2012-09-05  6:38   ` Tassilo Horn
  2012-09-05 13:09     ` Lars Ingebrigtsen
  0 siblings, 1 reply; 24+ messages in thread
From: Tassilo Horn @ 2012-09-05  6:38 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: ding

Lars Ingebrigtsen <larsi@gnus.org> writes:

>> Now my problem is that I used that approach to print subjects in
>> summary buffers using a proportional font.  Works great, except that
>> this format spec overrides the usual gnus summary fontification that
>> would fontify according to readness and score.  That only seems to
>> apply to summary elements not enclosed by %{...%} specs.
>
> Do you get no colourisation and stuff based on readedness if you use
> %{...%}?

If I use %{%s%}, I get bold subjects which are not colorized based on
readedness/score.  Seems %{...%} is a shorthand for %0{...%} which is
gnus-face-0 which is bold (and only bold!) by default.

I think, I want both: faces that are not colorized by gnus for defining
my tabular summary layout, e.g., for column separators |, and faces that
I can adjust to my likings (e.g., use a proportional font for the
subject) and still get the colorization, boldification, italicification
indicating the readedness and score.

Bye,
Tassilo



^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: Summary line format and gnus-face-X
  2012-09-05  6:38   ` Tassilo Horn
@ 2012-09-05 13:09     ` Lars Ingebrigtsen
  2012-09-05 13:27       ` Tassilo Horn
  0 siblings, 1 reply; 24+ messages in thread
From: Lars Ingebrigtsen @ 2012-09-05 13:09 UTC (permalink / raw)
  To: Tassilo Horn; +Cc: ding

Tassilo Horn <tsdh@gnu.org> writes:

> I think, I want both: faces that are not colorized by gnus for defining
> my tabular summary layout, e.g., for column separators |, and faces that
> I can adjust to my likings (e.g., use a proportional font for the
> subject) and still get the colorization, boldification, italicification
> indicating the readedness and score.

I think this is a feature of sorts.  Gnus uses
`gnus-put-text-property-excluding-characters-with-faces' to avoid
highlighting (i.e. changing the face) of stuff that has already faces
set.

Try (fset 'gnus-put-text-property-excluding-characters-with-faces
'put-text-property) or something and see whether that's nice or not.

-- 
(domestic pets only, the antidote for overdose, milk.)
  http://lars.ingebrigtsen.no  *  Sent from my Emacs



^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: Summary line format and gnus-face-X
  2012-09-05 13:09     ` Lars Ingebrigtsen
@ 2012-09-05 13:27       ` Tassilo Horn
  2012-09-05 16:22         ` Lars Ingebrigtsen
  0 siblings, 1 reply; 24+ messages in thread
From: Tassilo Horn @ 2012-09-05 13:27 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: ding

Lars Ingebrigtsen <larsi@gnus.org> writes:

Hi Lars,

>> I think, I want both:

Let this be (1):

>> faces that are not colorized by gnus for defining my tabular summary
>> layout, e.g., for column separators |, 

and this (2):

>> and faces that I can adjust to my likings (e.g., use a proportional
>> font for the subject) and still get the colorization, boldification,
>> italicification indicating the readedness and score.
>
> I think this is a feature of sorts.  Gnus uses
> `gnus-put-text-property-excluding-characters-with-faces' to avoid
> highlighting (i.e. changing the face) of stuff that has already faces
> set.
>
> Try (fset 'gnus-put-text-property-excluding-characters-with-faces
> 'put-text-property) or something and see whether that's nice or not.

That's nice for (2), but bad for (1).  Now I can have
colorized/boldified subjects with proportional fonts, but my column
separators and stuff are also mangled which I don't want.

How about that idea: We allow face specs %n{...%} where n may now also
be negative.  n and -n would be basically identical, i.e., the text is
fontified with gnus-face-n.  But with the negative version, a different
text property 'gnus-face-mergable instead of 'gnus-face is used.  Then,
gnus-put-text-property-excluding-characters-with-faces could be extended
to merge face properties in the gnus-face-mergable case and act just
like now in the gnus-face case.

Bye,
Tassilo



^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: Summary line format and gnus-face-X
  2012-09-05 13:27       ` Tassilo Horn
@ 2012-09-05 16:22         ` Lars Ingebrigtsen
  2012-09-05 17:10           ` Tassilo Horn
  2012-09-06 13:31           ` Wolfgang Jenkner
  0 siblings, 2 replies; 24+ messages in thread
From: Lars Ingebrigtsen @ 2012-09-05 16:22 UTC (permalink / raw)
  To: Tassilo Horn; +Cc: ding

Tassilo Horn <tsdh@gnu.org> writes:

> That's nice for (2), but bad for (1).  Now I can have
> colorized/boldified subjects with proportional fonts, but my column
> separators and stuff are also mangled which I don't want.

The problem is really more practical than theoretical.  Emacs doesn't
provide "combining" faces when using text properties.  You can put
overlays over text (say, italic and then green), but you can't do that
with text properties.  So Gnus has the option of either overwriting your
carefully chosen faces, or not touching them, and there isn't much of a
third choice.

Until Emacs implements combining `face' text properties, which is
something that I really really really want to have.  Overlays are yucky.

-- 
(domestic pets only, the antidote for overdose, milk.)
  http://lars.ingebrigtsen.no  *  Lars Magne Ingebrigtsen



^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: Summary line format and gnus-face-X
  2012-09-05 16:22         ` Lars Ingebrigtsen
@ 2012-09-05 17:10           ` Tassilo Horn
  2012-09-06 13:31           ` Wolfgang Jenkner
  1 sibling, 0 replies; 24+ messages in thread
From: Tassilo Horn @ 2012-09-05 17:10 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: ding

Lars Ingebrigtsen <larsi@gnus.org> writes:

>> That's nice for (2), but bad for (1).  Now I can have
>> colorized/boldified subjects with proportional fonts, but my column
>> separators and stuff are also mangled which I don't want.
>
> The problem is really more practical than theoretical.  Emacs doesn't
> provide "combining" faces when using text properties.  You can put
> overlays over text (say, italic and then green), but you can't do that
> with text properties.  So Gnus has the option of either overwriting
> your carefully chosen faces, or not touching them, and there isn't
> much of a third choice.
>
> Until Emacs implements combining `face' text properties, which is
> something that I really really really want to have.  Overlays are
> yucky.

Ok, I see.  It's not much of an issue for me.  After some time of
testing, I found out that having monospaced fonts everywhere is more
readable for me anyway. :-)

Bye,
Tassilo



^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: Summary line format and gnus-face-X
  2012-09-05 16:22         ` Lars Ingebrigtsen
  2012-09-05 17:10           ` Tassilo Horn
@ 2012-09-06 13:31           ` Wolfgang Jenkner
  2012-09-06 13:53             ` Lars Ingebrigtsen
  1 sibling, 1 reply; 24+ messages in thread
From: Wolfgang Jenkner @ 2012-09-06 13:31 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: Tassilo Horn, ding

On Wed, Sep 05 2012, Lars Ingebrigtsen wrote:

> Tassilo Horn <tsdh@gnu.org> writes:
>
>> That's nice for (2), but bad for (1).  Now I can have
>> colorized/boldified subjects with proportional fonts, but my column
>> separators and stuff are also mangled which I don't want.
>
> The problem is really more practical than theoretical.  Emacs doesn't
> provide "combining" faces when using text properties.  You can put
> overlays over text (say, italic and then green), but you can't do that
> with text properties.  So Gnus has the option of either overwriting your
> carefully chosen faces, or not touching them, and there isn't much of a
> third choice.
>
> Until Emacs implements combining `face' text properties, which is
> something that I really really really want to have.  Overlays are yucky.

What's the difference to using list of faces as the `face' text
property, i.e., addressing something like Tassilo's use-case:

(defun gnus-combine-text-property (beg end prop val)
  "Combine PROP with text properties between BEG and END.
This combines attributes if PROP is `face' otherwise this is just
like `put-text-property', more or less.
Beware: Proof-of-concept."
  (let ((b beg))
    (while (< b end)
      (let ((oldval (get-text-property b prop)))
	(gnus-put-text-property
	 b (setq b (next-single-property-change b prop nil end))
	 prop (cond ((or (not (eq prop 'face))
			 (null oldval))
		     val)
		    ((and (consp oldval)
			  (not (keywordp (car oldval))))
		     (cons val oldval))
		    (t
		     (list val oldval))))))))
(fset 'gnus-put-text-property-excluding-characters-with-faces
      'gnus-combine-text-property)

;; So, in my case, the face text property in the subject of an unread
;; article is (gnus-summary-normal-unread variable-pitch) and when
;; selected it becomes (gnus-summary-normal-read gnus-summary-normal-unread variable-pitch).
;; For each attribute, the first non-`unspecified' value of a face in
;; the list wins.
(setq gnus-face-9 'variable-pitch)
(setq gnus-summary-line-format
      "%U%R%z%I%(%[%4L: %-23,23f%]%) %9{%s%}
")




^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: Summary line format and gnus-face-X
  2012-09-06 13:31           ` Wolfgang Jenkner
@ 2012-09-06 13:53             ` Lars Ingebrigtsen
  2012-09-06 14:23               ` Wolfgang Jenkner
  0 siblings, 1 reply; 24+ messages in thread
From: Lars Ingebrigtsen @ 2012-09-06 13:53 UTC (permalink / raw)
  To: Tassilo Horn; +Cc: ding

Wolfgang Jenkner <wjenkner@inode.at> writes:

> What's the difference to using list of faces as the `face' text
> property, i.e., addressing something like Tassilo's use-case:

That would be useful, but it should be an Emacs-level thing.

-- 
(domestic pets only, the antidote for overdose, milk.)
  http://lars.ingebrigtsen.no  *  Lars Magne Ingebrigtsen



^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: Summary line format and gnus-face-X
  2012-09-06 13:53             ` Lars Ingebrigtsen
@ 2012-09-06 14:23               ` Wolfgang Jenkner
  2012-09-06 14:34                 ` Lars Ingebrigtsen
  2012-09-06 14:36                 ` Lars Ingebrigtsen
  0 siblings, 2 replies; 24+ messages in thread
From: Wolfgang Jenkner @ 2012-09-06 14:23 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: Tassilo Horn, ding

On Thu, Sep 06 2012, Lars Ingebrigtsen wrote:

> Wolfgang Jenkner <wjenkner@inode.at> writes:
>
>> What's the difference to using list of faces as the `face' text
>> property, i.e., addressing something like Tassilo's use-case:
>
> That would be useful, but it should be an Emacs-level thing.

How is this not an Emacs-level thing?  It is documented, it works and
some packages like ansi-color have been using this for years now.

Wolfgang



^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: Summary line format and gnus-face-X
  2012-09-06 14:23               ` Wolfgang Jenkner
@ 2012-09-06 14:34                 ` Lars Ingebrigtsen
  2012-09-06 14:58                   ` Wolfgang Jenkner
  2012-09-06 18:14                   ` Tassilo Horn
  2012-09-06 14:36                 ` Lars Ingebrigtsen
  1 sibling, 2 replies; 24+ messages in thread
From: Lars Ingebrigtsen @ 2012-09-06 14:34 UTC (permalink / raw)
  To: ding

Wolfgang Jenkner <wjenkner@inode.at> writes:

> How is this not an Emacs-level thing?  It is documented, it works and
> some packages like ansi-color have been using this for years now.

Oh, I had no idea.  So you can just put a list of faces instead of a
single one, and Emacs will do the right thing?

What's the "proof of concept"-ness about the function?  

-- 
(domestic pets only, the antidote for overdose, milk.)
  http://lars.ingebrigtsen.no  *  Lars Magne Ingebrigtsen



^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: Summary line format and gnus-face-X
  2012-09-06 14:23               ` Wolfgang Jenkner
  2012-09-06 14:34                 ` Lars Ingebrigtsen
@ 2012-09-06 14:36                 ` Lars Ingebrigtsen
  2012-09-06 14:51                   ` Wolfgang Jenkner
  1 sibling, 1 reply; 24+ messages in thread
From: Lars Ingebrigtsen @ 2012-09-06 14:36 UTC (permalink / raw)
  To: ding

And will `add-text-properties' add the properties instead of overwriting
them?

-- 
(domestic pets only, the antidote for overdose, milk.)
  http://lars.ingebrigtsen.no  *  Lars Magne Ingebrigtsen




^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: Summary line format and gnus-face-X
  2012-09-06 14:36                 ` Lars Ingebrigtsen
@ 2012-09-06 14:51                   ` Wolfgang Jenkner
  2012-09-06 18:29                     ` Lars Ingebrigtsen
  0 siblings, 1 reply; 24+ messages in thread
From: Wolfgang Jenkner @ 2012-09-06 14:51 UTC (permalink / raw)
  To: ding

On Thu, Sep 06 2012, Lars Ingebrigtsen wrote:

> And will `add-text-properties' add the properties instead of overwriting
> them?

No, it doesn't do anything special for the `face' property.  That's the
reason why a function like gnus-combine-text-property has to do some
minimal amount of work.

Wolfgang



^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: Summary line format and gnus-face-X
  2012-09-06 14:34                 ` Lars Ingebrigtsen
@ 2012-09-06 14:58                   ` Wolfgang Jenkner
  2012-09-06 18:14                   ` Tassilo Horn
  1 sibling, 0 replies; 24+ messages in thread
From: Wolfgang Jenkner @ 2012-09-06 14:58 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: ding

On Thu, Sep 06 2012, Lars Ingebrigtsen wrote:

> Wolfgang Jenkner <wjenkner@inode.at> writes:
>
>> How is this not an Emacs-level thing?  It is documented, it works and
>> some packages like ansi-color have been using this for years now.
>
> Oh, I had no idea.  So you can just put a list of faces instead of a
> single one, and Emacs will do the right thing?

Yes.  See (info "(elisp)Special Properties").

> What's the "proof of concept"-ness about the function?  

Well, I loaded the code (after starting gnus), tested it for 10 minutes
or so and sent the mail...

Wolfgang



^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: Summary line format and gnus-face-X
  2012-09-06 14:34                 ` Lars Ingebrigtsen
  2012-09-06 14:58                   ` Wolfgang Jenkner
@ 2012-09-06 18:14                   ` Tassilo Horn
  2012-09-06 18:30                     ` Lars Ingebrigtsen
  1 sibling, 1 reply; 24+ messages in thread
From: Tassilo Horn @ 2012-09-06 18:14 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: ding

Hi!

I'm running the new code now, and the variable-pitch subjects with
additional colorization now works fine.  Cool!

But now my separators in summary lines like the ┃ and the arrows are
colorized and boldified, too.

R ┃ +┃Lars Ingebrigtsen      ┃   ╰─❯  <Today, 16:34>

For those I'd like to have a fixed face that doesn't change because of
score/readedness/age.

Bye,
Tassilo



^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: Summary line format and gnus-face-X
  2012-09-06 14:51                   ` Wolfgang Jenkner
@ 2012-09-06 18:29                     ` Lars Ingebrigtsen
  0 siblings, 0 replies; 24+ messages in thread
From: Lars Ingebrigtsen @ 2012-09-06 18:29 UTC (permalink / raw)
  To: ding

Wolfgang Jenkner <wjenkner@inode.at> writes:

> No, it doesn't do anything special for the `face' property.  That's the
> reason why a function like gnus-combine-text-property has to do some
> minimal amount of work.

Right.  I've now applied a version of your function to Gnus.

-- 
(domestic pets only, the antidote for overdose, milk.)
  http://lars.ingebrigtsen.no  *  Lars Magne Ingebrigtsen




^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: Summary line format and gnus-face-X
  2012-09-06 18:14                   ` Tassilo Horn
@ 2012-09-06 18:30                     ` Lars Ingebrigtsen
  2012-09-07 15:59                       ` Wolfgang Jenkner
  0 siblings, 1 reply; 24+ messages in thread
From: Lars Ingebrigtsen @ 2012-09-06 18:30 UTC (permalink / raw)
  To: ding

Tassilo Horn <tsdh@gnu.org> writes:

> But now my separators in summary lines like the ┃ and the arrows are
> colorized and boldified, too.
>
> R ┃ +┃Lars Ingebrigtsen      ┃   ╰─❯  <Today, 16:34>
>
> For those I'd like to have a fixed face that doesn't change because of
> score/readedness/age.

Hm.  That sounds difficult.  :-)

-- 
(domestic pets only, the antidote for overdose, milk.)
  http://lars.ingebrigtsen.no  *  Lars Magne Ingebrigtsen




^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: Summary line format and gnus-face-X
  2012-09-06 18:30                     ` Lars Ingebrigtsen
@ 2012-09-07 15:59                       ` Wolfgang Jenkner
  2012-09-08  9:41                         ` Wolfgang Jenkner
  0 siblings, 1 reply; 24+ messages in thread
From: Wolfgang Jenkner @ 2012-09-07 15:59 UTC (permalink / raw)
  To: ding

On Thu, Sep 06 2012, Lars Ingebrigtsen wrote:

> Tassilo Horn <tsdh@gnu.org> writes:
>
>> But now my separators in summary lines like the ┃ and the arrows are
>> colorized and boldified, too.
>>
>> R ┃ +┃Lars Ingebrigtsen      ┃   ╰─❯  <Today, 16:34>
>>
>> For those I'd like to have a fixed face that doesn't change because of
>> score/readedness/age.
>
> Hm.  That sounds difficult.  :-)

What about something like the (barely tested) patch below?  This would
make it possible to do things like

(progn
  (fset 'gnus-put-text-property-excluding-characters-with-faces
	(lambda (start end property value)
	  (add-face start end value)))

  (defface foo
    `((t (:weight normal :foreground ,(face-attribute 'default :foreground))))
    "Foo face.")

  (setq gnus-face-9 'foo)

  (setq add-face-function
	(lambda (face faces)
	  (when (eq (car faces) 'foo)
	    (cons 'foo (cons face (cdr faces))))))

  (setq gnus-summary-line-format
	"%U%R%z%I%(%[%4L: %-23,23f%]%) %9{*%} %s
"))


Subject: [PATCH] New variable add-face-function.

The value (if non-nil) is a function which computes how the faces
should be combined.
---
 lisp/gnus-compat.el | 30 ++++++++++++++++++++++--------
 1 file changed, 22 insertions(+), 8 deletions(-)

diff --git a/lisp/gnus-compat.el b/lisp/gnus-compat.el
index 3241cd1..d829bbc 100644
--- a/lisp/gnus-compat.el
+++ b/lisp/gnus-compat.el
@@ -107,20 +107,34 @@ TRASH is ignored."
 
 ;; Emacs less than 24.3
 (unless (fboundp 'add-face)
+  (defvar add-face-function nil
+    "The value may be a function which is passed a face and
+a list of faces and which should return something suitable as
+value of the `face' property.  If it returns nil, however, or the
+value of `add-face-function' was nil to begin with, `add-face'
+will effectively just cons the face to the list of faces.")
+
   (defun add-face (beg end face)
-    "Combine FACE BEG and END."
+    "Combine FACE with the `face' text property values between BEG and END."
     (let ((b beg))
       (while (< b end)
 	(let ((oldval (get-text-property b 'face)))
 	  (put-text-property
 	   b (setq b (next-single-property-change b 'face nil end))
-	   'face (cond ((null oldval)
-			face)
-		       ((and (consp oldval)
-			     (not (keywordp (car oldval))))
-			(cons face oldval))
-		       (t
-			(list face oldval)))))))))
+	   'face (or (and add-face-function
+			  (funcall add-face-function
+				   face
+				   (if (and (listp oldval)
+					    (not (keywordp (car oldval))))
+				       oldval
+				     (list oldval))))
+		     (cond ((null oldval)
+			    face)
+			   ((and (consp oldval)
+				 (not (keywordp (car oldval))))
+			    (cons face oldval))
+			   (t
+			    (list face oldval))))))))))
 
 (provide 'gnus-compat)
 
-- 
1.7.11.5




^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: Summary line format and gnus-face-X
  2012-09-07 15:59                       ` Wolfgang Jenkner
@ 2012-09-08  9:41                         ` Wolfgang Jenkner
  2012-09-08 11:45                           ` Wolfgang Jenkner
  0 siblings, 1 reply; 24+ messages in thread
From: Wolfgang Jenkner @ 2012-09-08  9:41 UTC (permalink / raw)
  To: ding

On Fri, Sep 07 2012, Wolfgang Jenkner wrote:

> What about something like the (barely tested) patch below?

Or rather not.  I think that this face combining business should be used
(if at all) for Tassilo's use case, so that perhaps faces specified in
format strings are prepended to the "regular" faces (like
gnus-summary-normal-unread etc.) but those regular faces should be
applied exclusively, as before.  That is, the value of the face property
would be a single regular face or a list of a face specified in the
format string and a regular face.

And as was pointed out in emacs-devel, there's already
font-lock-append-text-property and font-lock-prepend-text-property, so
the add-face function should probably be removed.

Wolfgang



^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: Summary line format and gnus-face-X
  2012-09-08  9:41                         ` Wolfgang Jenkner
@ 2012-09-08 11:45                           ` Wolfgang Jenkner
  2012-09-08 12:37                             ` Tassilo Horn
  0 siblings, 1 reply; 24+ messages in thread
From: Wolfgang Jenkner @ 2012-09-08 11:45 UTC (permalink / raw)
  To: ding

On Sat, Sep 08 2012, Wolfgang Jenkner wrote:

> That is, the value of the face property
> would be a single regular face or a list of a face specified in the
> format string and a regular face.

I think the following redefinition is a minimally invasive change that
could work.  Tassilo, could you try this out with the current gnus git
HEAD?

(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)
	(let ((e (next-single-property-change b 'gnus-face nil end)))
	  (when (eq prop 'face)
	    (let ((gnus-face (get-text-property b 'face)))
	      (inline
		(gnus-put-text-property
		 b e
		 'face (if gnus-face
			   (list (if (and (consp gnus-face)
					  (not (keywordp (car gnus-face))))
				     (car gnus-face)
				   gnus-face)
				 val)
			 val)))))
	  (setq b e)))
      (when (/= b end)
	(inline
	  (gnus-put-text-property
	   b (setq b (next-single-property-change b 'gnus-face nil end))
	   prop val))))))

Wolfgang



^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: Summary line format and gnus-face-X
  2012-09-08 11:45                           ` Wolfgang Jenkner
@ 2012-09-08 12:37                             ` Tassilo Horn
  2012-09-09 13:13                               ` Wolfgang Jenkner
  0 siblings, 1 reply; 24+ messages in thread
From: Tassilo Horn @ 2012-09-08 12:37 UTC (permalink / raw)
  To: ding

Wolfgang Jenkner <wjenkner@inode.at> writes:

Hi Wolfgang,

> I think the following redefinition is a minimally invasive change that
> could work.  Tassilo, could you try this out with the current gnus git
> HEAD?

Did so, and now

(setq gnus-face-3 'th-shadow-proportinal
      gnus-face-4 'default
      gnus-face-5 'variable-pitch
      gnus-summary-line-format
      "%U%R%4{┃%}%2us%4{┃%}%(%-23,23f%)%4{┃ %*%B%} %5{%s%} %3{<%&user-date;>%}\n")

gives my variable-pitch subjects that are also fontified according to
readedness/score.  Perfect!

Thanks a lot,
Tassilo



^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: Summary line format and gnus-face-X
  2012-09-08 12:37                             ` Tassilo Horn
@ 2012-09-09 13:13                               ` Wolfgang Jenkner
  2012-09-09 18:54                                 ` Lars Ingebrigtsen
  0 siblings, 1 reply; 24+ messages in thread
From: Wolfgang Jenkner @ 2012-09-09 13:13 UTC (permalink / raw)
  To: Tassilo Horn; +Cc: ding

On Sat, Sep 08 2012, Tassilo Horn wrote:

> Wolfgang Jenkner <wjenkner@inode.at> writes:
>
>> I think the following redefinition is a minimally invasive change that
>> could work.  Tassilo, could you try this out with the current gnus git
>> HEAD?
>
> Did so, and now
>
> (setq gnus-face-3 'th-shadow-proportinal
>       gnus-face-4 'default
>       gnus-face-5 'variable-pitch
>       gnus-summary-line-format
>       "%U%R%4{┃%}%2us%4{┃%}%(%-23,23f%)%4{┃ %*%B%} %5{%s%} %3{<%&user-date;>%}\n")
>
> gives my variable-pitch subjects that are also fontified according to
> readedness/score.  Perfect!

Thanks for testing.  I'm playing with one or two small modifications
(without changing the overall behaviour) and will then submit a patch.

Then, we've to wait for the feature being included by popular demand :-)

Wolfgang



^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: Summary line format and gnus-face-X
  2012-09-09 13:13                               ` Wolfgang Jenkner
@ 2012-09-09 18:54                                 ` Lars Ingebrigtsen
  2012-09-15 15:24                                   ` Wolfgang Jenkner
  0 siblings, 1 reply; 24+ messages in thread
From: Lars Ingebrigtsen @ 2012-09-09 18:54 UTC (permalink / raw)
  To: Tassilo Horn; +Cc: ding

Wolfgang Jenkner <wjenkner@inode.at> writes:

> Then, we've to wait for the feature being included by popular demand :-)

It's popular already!

-- 
(domestic pets only, the antidote for overdose, milk.)
  http://lars.ingebrigtsen.no  *  Lars Magne Ingebrigtsen



^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: Summary line format and gnus-face-X
  2012-09-09 18:54                                 ` Lars Ingebrigtsen
@ 2012-09-15 15:24                                   ` Wolfgang Jenkner
  0 siblings, 0 replies; 24+ messages in thread
From: Wolfgang Jenkner @ 2012-09-15 15:24 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: Tassilo Horn, ding

On Sun, Sep 09 2012, Lars Ingebrigtsen wrote:

> Wolfgang Jenkner <wjenkner@inode.at> writes:
>
>> Then, we've to wait for the feature being included by popular demand :-)
>
> It's popular already!

Oh, so it's not sophisticated enough!

Anyway, I've submitted the patch to the gnus bug tracker:

http://debbugs.gnu.org/cgi/bugreport.cgi?bug=12451

Wolfgang



^ permalink raw reply	[flat|nested] 24+ messages in thread

end of thread, other threads:[~2012-09-15 15:24 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-08-02  6:31 Summary line format and gnus-face-X Tassilo Horn
2012-09-04 22:30 ` Lars Ingebrigtsen
2012-09-05  6:38   ` Tassilo Horn
2012-09-05 13:09     ` Lars Ingebrigtsen
2012-09-05 13:27       ` Tassilo Horn
2012-09-05 16:22         ` Lars Ingebrigtsen
2012-09-05 17:10           ` Tassilo Horn
2012-09-06 13:31           ` Wolfgang Jenkner
2012-09-06 13:53             ` Lars Ingebrigtsen
2012-09-06 14:23               ` Wolfgang Jenkner
2012-09-06 14:34                 ` Lars Ingebrigtsen
2012-09-06 14:58                   ` Wolfgang Jenkner
2012-09-06 18:14                   ` Tassilo Horn
2012-09-06 18:30                     ` Lars Ingebrigtsen
2012-09-07 15:59                       ` Wolfgang Jenkner
2012-09-08  9:41                         ` Wolfgang Jenkner
2012-09-08 11:45                           ` Wolfgang Jenkner
2012-09-08 12:37                             ` Tassilo Horn
2012-09-09 13:13                               ` Wolfgang Jenkner
2012-09-09 18:54                                 ` Lars Ingebrigtsen
2012-09-15 15:24                                   ` Wolfgang Jenkner
2012-09-06 14:36                 ` Lars Ingebrigtsen
2012-09-06 14:51                   ` Wolfgang Jenkner
2012-09-06 18:29                     ` Lars Ingebrigtsen

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).