Gnus development mailing list
 help / color / mirror / Atom feed
From: Wolfgang Jenkner <wjenkner@inode.at>
To: Lars Ingebrigtsen <larsi@gnus.org>
Cc: Tassilo Horn <tsdh@gnu.org>,  ding@gnus.org
Subject: Re: Summary line format and gnus-face-X
Date: Thu, 06 Sep 2012 15:31:52 +0200	[thread overview]
Message-ID: <85ipbruvaz.fsf@iznogoud.viz> (raw)
In-Reply-To: <87d320783z.fsf@gnus.org>

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%}
")




  parent reply	other threads:[~2012-09-06 13:31 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-02  6:31 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 [this message]
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

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=85ipbruvaz.fsf@iznogoud.viz \
    --to=wjenkner@inode.at \
    --cc=ding@gnus.org \
    --cc=larsi@gnus.org \
    --cc=tsdh@gnu.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).