Gnus development mailing list
 help / color / mirror / Atom feed
* Group highlighting
@ 1997-02-27 15:59 Jens Lautenbacher
  1997-03-01  0:01 ` Lars Magne Ingebrigtsen
  0 siblings, 1 reply; 4+ messages in thread
From: Jens Lautenbacher @ 1997-02-27 15:59 UTC (permalink / raw)




Hi,

There seem to be some inconsitencies with the way groups lines are
highlighted. 

As far as I see there are two incompatible ways to do this:

a) using custom gnus-face-x fonts in the gnus-group-line-format.

b) by a call to gnus-group-highlight-line, which is on by default, and
   which uses gnus-group-highlight to see how a particular line should
   be highlighted.

The problem is that first a) is done and then, if it is selected, b).
But b) overwrites any (face) changes done by a).

But I would like to have both the same time. a) for colouring e.g. the
number of articles or methods and b) for the group name. One should do:

Restrict b) on a certain part of the group line, e.q. by some new spec
one could give to gnus-group-line-format. This would be the cleanest
approach IMHO, but I don't know how to do this... :-( 

Another possibility would go along the following I tried:

----------------------------------------

<removing gnus-group-highlight-line from gnus-group-update-hook>

I defined gnus-face-7

(setq gnus-face-7 '(progn
		     (let ((list gnus-group-highlight) elem)
		       (while (not (eval (car (setq elem (pop list))))))
		       (setq res (cdr elem)))))


I set Gnus Group Line Format to  %M%S%p%P%5y: %7{%(%g%)%}%l\n

I changed gnus-face-face-function:

(defun gnus-face-face-function (form type)
  (let (elem)
    `(gnus-put-text-property
    (point) (progn ,@form (point))
    'face ',(if (symbolp
		 (setq elem
		       (symbol-value (intern (format "gnus-face-%d" type)))))
		elem
	      (eval elem)))))
-----------------------------------------

and hoped that this would work, but nada, it didn't because all the
variables defined in the gnus-group-highlight list are not defiend
when the format spec is evaluated.

Maybe one could also fix this. Anyways it would be a good idea IMHO to
make the change to gnus-face-face-function allowing for forms instead
of just faces.

   Jens


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

* Re: Group highlighting
  1997-02-27 15:59 Group highlighting Jens Lautenbacher
@ 1997-03-01  0:01 ` Lars Magne Ingebrigtsen
  1997-03-01  1:58   ` Jens Lautenbacher
  0 siblings, 1 reply; 4+ messages in thread
From: Lars Magne Ingebrigtsen @ 1997-03-01  0:01 UTC (permalink / raw)


Jens Lautenbacher <jens@lemming0.lem.uni-karlsruhe.de> writes:

> There seem to be some inconsitencies with the way groups lines are
> highlighted. 
> 
> As far as I see there are two incompatible ways to do this:
> 
> a) using custom gnus-face-x fonts in the gnus-group-line-format.
> 
> b) by a call to gnus-group-highlight-line, which is on by default, and
>    which uses gnus-group-highlight to see how a particular line should
>    be highlighted.
> 
> The problem is that first a) is done and then, if it is selected, b).
> But b) overwrites any (face) changes done by a).

Yes, this is a problem.  Uhm.  The fontification done by A can't be
done after B, since it's actually done while inserting the text.
Uhm.  Well, perhaps the `gnus-group-highlight-line' should be
rewritten to be done before inserting anything in the buffer, so that
we know what the default face is supposed to be before inserting any
of the text?  I don't know whether that's workable...

-- 
(domestic pets only, the antidote for overdose, milk.)
  larsi@ifi.uio.no * Lars Ingebrigtsen


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

* Re: Group highlighting
  1997-03-01  0:01 ` Lars Magne Ingebrigtsen
@ 1997-03-01  1:58   ` Jens Lautenbacher
  1997-03-01  3:20     ` Lars Magne Ingebrigtsen
  0 siblings, 1 reply; 4+ messages in thread
From: Jens Lautenbacher @ 1997-03-01  1:58 UTC (permalink / raw)
  Cc: Lars Magne Ingebrigtsen

Lars Magne Ingebrigtsen <larsi@ifi.uio.no> writes:

> Jens Lautenbacher <jens@lemming0.lem.uni-karlsruhe.de> writes:
> 
> > There seem to be some inconsitencies with the way groups lines are
> > highlighted. 
[blurb] 
> > The problem is that first a) is done and then, if it is selected, b).
> > But b) overwrites any (face) changes done by a).
> 
> Yes, this is a problem.  Uhm.  The fontification done by A can't be
> done after B, since it's actually done while inserting the text.
> Uhm.  Well, perhaps the `gnus-group-highlight-line' should be
> rewritten to be done before inserting anything in the buffer, so that
> we know what the default face is supposed to be before inserting any
> of the text?  I don't know whether that's workable...

Why not doing it the way I suggested: Introduce another spec for the
gnus-group-format-line which, if present, will limit the area
gnus-group-highlight-line will work on. This could be achived by
inserting an extent spanning the area with a special property, say
'do-highlight-here set. Gnus-group-highlight-line only needs to be
changed to 1) check if such an extent is present here. If not, proceed
as before. 2) If it is, highlight only the area that covers this
extent.

If I would know how to define another spec , say something along the
line %&{ ..... %} (this is not present already, is it?) I would do
this, but unfortunately I didn't really understand that part from a
quick glance...

      JTL


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

* Re: Group highlighting
  1997-03-01  1:58   ` Jens Lautenbacher
@ 1997-03-01  3:20     ` Lars Magne Ingebrigtsen
  0 siblings, 0 replies; 4+ messages in thread
From: Lars Magne Ingebrigtsen @ 1997-03-01  3:20 UTC (permalink / raw)


Jens Lautenbacher <jens@metrix.de> writes:

> Why not doing it the way I suggested: Introduce another spec for the
> gnus-group-format-line which, if present, will limit the area
> gnus-group-highlight-line will work on.

It seems like a rather roundabout way of doing things.  Might as well
just exclude `gnus-group-highlight-line' from the areas that have
already been fontified by the "%{%}" specs.

In any case, highlighting parts of the line in this manner seems
kludgy.

-- 
(domestic pets only, the antidote for overdose, milk.)
  larsi@ifi.uio.no * Lars Ingebrigtsen


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

end of thread, other threads:[~1997-03-01  3:20 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1997-02-27 15:59 Group highlighting Jens Lautenbacher
1997-03-01  0:01 ` Lars Magne Ingebrigtsen
1997-03-01  1:58   ` Jens Lautenbacher
1997-03-01  3:20     ` Lars Magne 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).