Announcements and discussions for Gnus, the GNU Emacs Usenet newsreader
 help / color / mirror / Atom feed
* Way to detect "raw" display of article?
@ 2019-03-16 21:52 Damien Collard
  2019-03-17  2:46 ` Eric Abrahamsen
  0 siblings, 1 reply; 4+ messages in thread
From: Damien Collard @ 2019-03-16 21:52 UTC (permalink / raw)
  To: info-gnus-english

Hello,

I have written a module for Gnus that replaces the standard `>` citation
marks in article-mode with nicer Unicode ones using the same face as the
corresponding cited text.

However, I only want to apply this transformation in the "regular" (C-g)
view of the article, not if it's being viewed "raw" (`C-u g` or `C-u C-u
g`). Is their a reliable way to detect this?

Damien


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

* Re: Way to detect "raw" display of article?
  2019-03-16 21:52 Way to detect "raw" display of article? Damien Collard
@ 2019-03-17  2:46 ` Eric Abrahamsen
  2019-03-17  8:54   ` Damien Collard
  2019-03-17 21:34   ` Damien Collard
  0 siblings, 2 replies; 4+ messages in thread
From: Eric Abrahamsen @ 2019-03-17  2:46 UTC (permalink / raw)
  To: info-gnus-english

Damien Collard <damien.collard@distfp.net> writes:

> Hello,
>
> I have written a module for Gnus that replaces the standard `>` citation
> marks in article-mode with nicer Unicode ones using the same face as the
> corresponding cited text.
>
> However, I only want to apply this transformation in the "regular" (C-g)
> view of the article, not if it's being viewed "raw" (`C-u g` or `C-u C-u
> g`). Is their a reliable way to detect this?

I think the "appropriate" way of doing this would be to make this a
washing function that does this on command, then a corresponding
`gnus-treat-FOO' variable, then allow people to set that as they like.

Eric



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

* Re: Way to detect "raw" display of article?
  2019-03-17  2:46 ` Eric Abrahamsen
@ 2019-03-17  8:54   ` Damien Collard
  2019-03-17 21:34   ` Damien Collard
  1 sibling, 0 replies; 4+ messages in thread
From: Damien Collard @ 2019-03-17  8:54 UTC (permalink / raw)
  To: Eric Abrahamsen; +Cc: info-gnus-english

On Sam, mar 16 2019, Eric Abrahamsen wrote:

> I think the "appropriate" way of doing this would be to make this a
> washing function that does this on command, then a corresponding
> `gnus-treat-FOO' variable, then allow people to set that as they like.

This works very well, thank you!

And it's cleaner than my abusing of `fontification-functions` previously
(for which I had to make sure the prettification was only performed
once).

Now to see if I can avoid using `fontification-functions` in
message-mode...

-- 
Damien Collard


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

* Re: Way to detect "raw" display of article?
  2019-03-17  2:46 ` Eric Abrahamsen
  2019-03-17  8:54   ` Damien Collard
@ 2019-03-17 21:34   ` Damien Collard
  1 sibling, 0 replies; 4+ messages in thread
From: Damien Collard @ 2019-03-17 21:34 UTC (permalink / raw)
  To: Eric Abrahamsen; +Cc: info-gnus-english


Here's what I have so far:

    https://github.com/damiencollard/nice-citation

It works very well, although in some rare cases the face of the citation
mark doesn't match that of the cited text even though the face is taken
from Gnus' own citation faces. I'm guessing Gnus is selecting the
citation face differently than I do (the face of each mark is picked
based on the citation depth).

It doesn't apply the treatment when viewing an article in raw mode, as
expected.

I also enabled it in message-mode, where it adds itself to the
`fontification-functions` alist.

-- 
Damien Collard


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

end of thread, other threads:[~2019-03-17 21:34 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-16 21:52 Way to detect "raw" display of article? Damien Collard
2019-03-17  2:46 ` Eric Abrahamsen
2019-03-17  8:54   ` Damien Collard
2019-03-17 21:34   ` Damien Collard

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