Gnus development mailing list
 help / color / mirror / Atom feed
* Quote emphasis
@ 1996-11-29 22:45 Per Abrahamsen
  1996-11-30 13:12 ` Lars Magne Ingebrigtsen
  0 siblings, 1 reply; 10+ messages in thread
From: Per Abrahamsen @ 1996-11-29 22:45 UTC (permalink / raw)



I have been experimenting with gnus-emphasis-alist in order to make
the fruit salad in the article buffer even more angry.  Using emphasis
for "quote" and `stuff', 'like this' seems to work.

Should this be done by default?

Probably with some other faces than what font-lock uses.

You can try this

(setq gnus-emphasis-alist
      (append gnus-emphasis-alist
	      '(("\\W'\\(\\w[^']*\\w\\)'\\W" 1 1 font-lock-reference-face)
	        ("\\W\"\\(\\<[^\"]*\\>\\)\"\\W" 1 1 font-lock-string-face)
                ("\\W`\\(\\<[^`']*\\w\\)'\\W" 1 1 font-lock-keyword-face))))

to test it (I haven't).  

Or add customize entries  (like I did):

** gnus-emphasis-alist:

[ ... ]

[INS] [DEL] List:
            Regexp:  \W'\(\w[^']*\w\)'\W
            Match group:  1
            Emphasize group:  1
            Face: font-lock-reference-face (show)
            [-] 
[INS] [DEL] List:
            Regexp:  \W"\(\<[^"]*\>\)"\W
            Match group:  1
            Emphasize group:  1
            Face: font-lock-string-face (show)
            [-] 
[INS] [DEL] List:
            Regexp:  \W`\(\<[^`']*\w\)'\W
            Match group:  1
            Emphasize group:  1
            Face: font-lock-keyword-face (show)
            [-] 
[INS]
[!] [?] Alist that says how to fontify certain phrases.


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

* Re: Quote emphasis
  1996-11-29 22:45 Quote emphasis Per Abrahamsen
@ 1996-11-30 13:12 ` Lars Magne Ingebrigtsen
  1996-11-30 16:27   ` Per Abrahamsen
  0 siblings, 1 reply; 10+ messages in thread
From: Lars Magne Ingebrigtsen @ 1996-11-30 13:12 UTC (permalink / raw)


Per Abrahamsen <abraham@dina.kvl.dk> writes:

> I have been experimenting with gnus-emphasis-alist in order to make
> the fruit salad in the article buffer even more angry.  Using emphasis
> for "quote" and `stuff', 'like this' seems to work.
> 
> Should this be done by default?

I don't think so.  Usually, when I write "this", I mean for people to
read the quotes.  If I write _this_, however, I mean for it to be
underlined...

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


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

* Re: Quote emphasis
  1996-11-30 13:12 ` Lars Magne Ingebrigtsen
@ 1996-11-30 16:27   ` Per Abrahamsen
  1996-11-30 16:51     ` Lars Magne Ingebrigtsen
  0 siblings, 1 reply; 10+ messages in thread
From: Per Abrahamsen @ 1996-11-30 16:27 UTC (permalink / raw)


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

> I don't think so.  Usually, when I write "this", I mean for people to
> read the quotes.  

The extra entries doesn't remove the quotes, it just highlights the
text inside the quotes in another color.  Font lock does the same for
emacs lisp code, i.e. highlight `foobar' inside a string.  


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

* Re: Quote emphasis
  1996-11-30 16:27   ` Per Abrahamsen
@ 1996-11-30 16:51     ` Lars Magne Ingebrigtsen
  1996-11-30 20:22       ` Steven L Baur
  1996-12-02 20:21       ` Edward J. Sabol
  0 siblings, 2 replies; 10+ messages in thread
From: Lars Magne Ingebrigtsen @ 1996-11-30 16:51 UTC (permalink / raw)


Per Abrahamsen <abraham@dina.kvl.dk> writes:

> The extra entries doesn't remove the quotes, it just highlights the
> text inside the quotes in another color. 

Oops.  I really should start paying more attention before placing my
foot in my mouth...

> Font lock does the same for emacs lisp code, i.e. highlight `foobar'
> inside a string.

But I still don't think this sort of thing should be highlighted (by
default).  As it stands now, the emphasis thing is fairly
well-defined, and adding other syntax recognition thingies to it would
just muddle the issue.  However, we could add another variable and
command -- `gnus-article-syntax-highlight', or whatever, if we
want... 

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


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

* Re: Quote emphasis
  1996-11-30 16:51     ` Lars Magne Ingebrigtsen
@ 1996-11-30 20:22       ` Steven L Baur
  1996-11-30 23:14         ` Sudish Joseph
  1996-12-02 20:21       ` Edward J. Sabol
  1 sibling, 1 reply; 10+ messages in thread
From: Steven L Baur @ 1996-11-30 20:22 UTC (permalink / raw)


>>>>> "Lars" == Lars Magne Ingebrigtsen <larsi@proletcult.slip.ifi.uio.no> writes:

Lars> But I still don't think this sort of thing should be highlighted
Lars> (by default).  As it stands now, the emphasis thing is fairly
Lars> well-defined, and adding other syntax recognition thingies to it
Lars> would just muddle the issue.  However, we could add another
Lars> variable and command -- `gnus-article-syntax-highlight', or
Lars> whatever, if we want...

I played around a bit with it, and while it does add more color, it
has the potential for confusing things more in messages which contain
code.

It would work best IMO if it were controlled by YAV, and possibly
restricted to only original text.  (It clashes at times with the
citation highlight :-( ).
-- 
steve@miranova.com baur
Unsolicited commercial e-mail will be billed at $250/message.
"Bill Clinton is a bore.  He doesn't have a creative bone in his
body."  -- David Brinkley


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

* Re: Quote emphasis
  1996-11-30 20:22       ` Steven L Baur
@ 1996-11-30 23:14         ` Sudish Joseph
  1996-12-01  0:16           ` Per Abrahamsen
  0 siblings, 1 reply; 10+ messages in thread
From: Sudish Joseph @ 1996-11-30 23:14 UTC (permalink / raw)


In article <m2wwv3wcx8.fsf@altair.xemacs.org>,
Steven L Baur <steve@miranova.com> writes:
> I played around a bit with it, and while it does add more color, it
> has the potential for confusing things more in messages which contain
> code.

I liked it, but I agree that it can cause havoc for certain messages.

> It would work best IMO if it were controlled by YAV, and possibly
> restricted to only original text.  (It clashes at times with the
> citation highlight :-( ).

YAV wouldn't help much coz you typically want to turn it off for a
particular message.  There'll be groups where you want to off by
default, which is where another variable might be useful.

I think the general solution to article buffer massagers that get in
the way for special articles is to provide unmassagers, functions that
reverse the effects of the massagers.  This would be useful for
smiley.el as well.  

If all massagers provided two hook-safe functions, feature-foo-article
and un-feature-foo-article, we wouldn't need variables.  They could be
added to the appropriate hook and given bindings in the W keymap.

-Sudish


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

* Re: Quote emphasis
  1996-11-30 23:14         ` Sudish Joseph
@ 1996-12-01  0:16           ` Per Abrahamsen
  1996-12-01  1:15             ` Sudish Joseph
  0 siblings, 1 reply; 10+ messages in thread
From: Per Abrahamsen @ 1996-12-01  0:16 UTC (permalink / raw)



Sudish Joseph <sudish@mindspring.com> writes:

> In article <m2wwv3wcx8.fsf@altair.xemacs.org>,
> Steven L Baur <steve@miranova.com> writes:
> > I played around a bit with it, and while it does add more color, it
> > has the potential for confusing things more in messages which contain
> > code.
> 
> I liked it, but I agree that it can cause havoc for certain messages.

Which?  It works fine with the code snips I have seen.  The strings
gets highlighted, as if the code was font-locked.  

> > It would work best IMO if it were controlled by YAV, and possibly
> > restricted to only original text.  (It clashes at times with the
> > citation highlight :-( ).

I have emphasize before highlight-citation in
`gnus-article-display-hook' (that is the way they are listed in the
customization buffer), so I don't see this.

But I agree it should be on a separate hook function.  What should it
be called?  `highlight-quotes' would be "correct", but may be easy to
confuse with `highlight-citation'.

> I think the general solution to article buffer massagers that get in
> the way for special articles is to provide unmassagers, functions that
> reverse the effects of the massagers.  This would be useful for
> smiley.el as well.  
> 
> If all massagers provided two hook-safe functions, feature-foo-article
> and un-feature-foo-article, we wouldn't need variables.  They could be
> added to the appropriate hook and given bindings in the W keymap.

Too difficult, not all display features can be undone.

Here is an alternative:

Replace the call to `gnus-article-display-hook' with 

	(make-local-variable 'gnus-local-article-display-hook)
        (setq gnus-local-article-display-hook
              (copy-list gnus-article-display-hook))
        (run-hooks 'gnus-local-article-display-hook)

Bind each wash function along these lines:

  (defun gnus-wash-toggle-add-buttons ()
    "Toggle buttons in the current article."
    (interactive)
    (gnus-wash-toggle 'gnus-article-add-buttons))

  (defun gnus-wash-toggle (fun)
     "Toggle argument FUN in and redisplay the article."
     (if (memq fun gnus-local-article-display-hook)
         (remove-hook 'gnus-local-article-display-hook fun)
       (add-hook 'gnus-local-article-display-hook fun)
     ;; The next line is even more pseudo code than the rest...
     (copy-buffer " *Original Article*" "*Article*")
     (run-hooks 'gnus-local-article-display-hook)))

Some benefits would be:

The menu entries for the wash toggle functions would be checkboxes, and
they look *so* cool under XEmacs.

You could have the commands 

  (defun gnus-wash-apply ()
    "Use the current state to the wash toggles for future articles.
  The effect expires when you exit emacs."
    (interactive)
    (setq gnus-article-display-hook
          (copy-list gnus-local-article-display-hook)))

  (defun gnus-wash-set-defeault ()
    "Use the current state to the wash toggles for future articles.
  The effect expires when you exit emacs."
    (interactive)
    (gnus-wash-apply)
    (put 'gnus-article-display-hook 
         'saved-value (list gnus-article-display-hook))
    (custom-save))

with menu entries to make it really easy to customize the washing.


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

* Re: Quote emphasis
  1996-12-01  0:16           ` Per Abrahamsen
@ 1996-12-01  1:15             ` Sudish Joseph
  1996-12-01  6:27               ` Lars Magne Ingebrigtsen
  0 siblings, 1 reply; 10+ messages in thread
From: Sudish Joseph @ 1996-12-01  1:15 UTC (permalink / raw)


In article <rjn2vzf79z.fsf@babbage.dina.kvl.dk>,
Per Abrahamsen <abraham@dina.kvl.dk> writes:
> Sudish Joseph <sudish@mindspring.com> writes:
>> I liked it, but I agree that it can cause havoc for certain messages.

> Which?  It works fine with the code snips I have seen.  The strings
> gets highlighted, as if the code was font-locked.  

Some messages with quotes spanning multiple lines.  A backtrace
buffer, for instance.  Not a big deal, it looks great for the common
case.  Smilies cause more problems, but they're sufferable, too.  

> But I agree it should be on a separate hook function.  What should it
> be called?  `highlight-quotes' would be "correct", but may be easy to
> confuse with `highlight-citation'.

highlight-quoted-strings?  Redundancy in the name might reduce the
confusion.

>> If all massagers provided two hook-safe functions, feature-foo-article
>> and un-feature-foo-article, we wouldn't need variables.  They could be
>> added to the appropriate hook and given bindings in the W keymap.

> Too difficult, not all display features can be undone.

I like the part I snipped out.  

Another thing we can do is to have all article buffer face
manipulation pass through one gnus-supplied function.  This function
(gnus-article-add-text-props?) could then add an extra property
alongside of the face proerty it's adding.  This property could be
used to unmassage the text back.

That's simplistic, there're all kinds of priority/sequencing
problems.  But it's still doable.

Not that it's useful for all article display features--face
manipulation is the most common case, and it's the easiest to handle.

-Sudish



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

* Re: Quote emphasis
  1996-12-01  1:15             ` Sudish Joseph
@ 1996-12-01  6:27               ` Lars Magne Ingebrigtsen
  0 siblings, 0 replies; 10+ messages in thread
From: Lars Magne Ingebrigtsen @ 1996-12-01  6:27 UTC (permalink / raw)


Sudish Joseph <sudish@mindspring.com> writes:

> Another thing we can do is to have all article buffer face
> manipulation pass through one gnus-supplied function.  This function
> (gnus-article-add-text-props?) could then add an extra property
> alongside of the face proerty it's adding.  This property could be
> used to unmassage the text back.

Yup.  All (I think) "hiding" commands already do this, and are
toggles.  Doing the same with the highlighting commands shouldn't be
much of a problem.

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


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

* Re: Quote emphasis
  1996-11-30 16:51     ` Lars Magne Ingebrigtsen
  1996-11-30 20:22       ` Steven L Baur
@ 1996-12-02 20:21       ` Edward J. Sabol
  1 sibling, 0 replies; 10+ messages in thread
From: Edward J. Sabol @ 1996-12-02 20:21 UTC (permalink / raw)


Excerpts from mail: (30-Nov-96) Re: Quote emphasis by Lars Magne Ingebrigtsen
>> Font lock does the same for emacs lisp code, i.e. highlight `foobar'
>> inside a string.
> But I still don't think this sort of thing should be highlighted (by
> default). As it stands now, the emphasis thing is fairly well-defined,
> and adding other syntax recognition thingies to it would just muddle
> the issue.

I agree with Lars. I didn't much like the highlighting of quoted passages. If
it is added to Gnus, I suggest that it not be a default setting. I also do
not think it should be added to gnus-emphasis-alist. Instead, a separate
function should be defined so that people who want such highlighting can add
it to their gnus-article-display-hook. Gnus-emaphasis is really an
implementation of the 'setext' definition (with admittedly a few logical
extensions like interpreting _*foo*_ as bold-italic). Adding the highlighting
of quoted passages to gnus-emphasis would muddy the waters of this
quasi-standard.


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

end of thread, other threads:[~1996-12-02 20:21 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1996-11-29 22:45 Quote emphasis Per Abrahamsen
1996-11-30 13:12 ` Lars Magne Ingebrigtsen
1996-11-30 16:27   ` Per Abrahamsen
1996-11-30 16:51     ` Lars Magne Ingebrigtsen
1996-11-30 20:22       ` Steven L Baur
1996-11-30 23:14         ` Sudish Joseph
1996-12-01  0:16           ` Per Abrahamsen
1996-12-01  1:15             ` Sudish Joseph
1996-12-01  6:27               ` Lars Magne Ingebrigtsen
1996-12-02 20:21       ` Edward J. Sabol

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