Gnus development mailing list
 help / color / mirror / Atom feed
From: Hrvoje Niksic <hniksic@srce.hr>
Subject: gnus-emphasis-alist
Date: 29 Oct 1996 21:40:12 +0100	[thread overview]
Message-ID: <kigaft5fqs3.fsf@jagor.srce.hr> (raw)

Since I have started using gnus-emphasis-alist, I have noticed that
the default was not too well chosen.  Try to press `W e' while viewing
this test example:

---example---
*test* something
something
_test_ something test_something_test _something test_ _something_
_something
test_
2*3*4
---end---

It is obviously wrong.  `something' in `test_something_test' is
highlighted, which shouldn't be, whereas `_something test_' is not
highlighted, whereas it probably should be.  I have worked a little on
that problem, and came up with the following regexps:

(setq gnus-emphasis-alist
  '(("\\(\\s-+\\|^\\)\\(_\\(\\w+\\([ \C-i]+\\w+\\)*\\)_\\)\\(\\s-+\\|$\\)" 2 3 underline)
    ("\\W\\(/\\(\\w+\\)/\\)\\W" 1 2 italic)
    ("\\(_\\*\\|\\*_\\)\\(\\w+\\)\\(_\\*\\|\\*_\\)" 0 2 bold-underline)
    ("\\(\\s-+\\|^\\)\\(*\\(\\w+\\)\\*\\)\\(\\s-+\\|$\\)" 2 3 bold))
  )

For these to work, a tiny buglet in article.el must be patched.
article.el jumps from regexp to regexp by stepping over _whole_
regexps, whereas I would like to step over the invisible part.  If you
apply the following patch and use the above regexps, you get behaviour
much more reasonable than default.

Is anyone willing to try out my changes?  Can they become the default?

*** article.el.orig	Fri Oct 11 12:07:35 1996
--- article.el	Tue Oct 29 21:15:10 1996
***************
*** 903,909 ****
  	     (match-beginning visible) (match-end visible) 'emphasis)
  	    (put-text-property 
  	     (match-beginning visible) (match-end visible)
! 	     'face face)))))))
  
  (provide 'article)
  
--- 903,910 ----
  	     (match-beginning visible) (match-end visible) 'emphasis)
  	    (put-text-property 
  	     (match-beginning visible) (match-end visible)
! 	     'face face)
! 	    (goto-char (match-end invisible))))))))
  
  (provide 'article)
  


-- 
Hrvoje Niksic <hniksic@srce.hr> | Student at FER Zagreb, Croatia
--------------------------------+--------------------------------
`VI' - An editor used by those heretics that don't subscribe to
       the Emacs religion.


             reply	other threads:[~1996-10-29 20:40 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1996-10-29 20:40 Hrvoje Niksic [this message]
1996-10-30 12:19 gnus-emphasis-alist Kai Grossjohann
1996-10-30 12:29 ` gnus-emphasis-alist Kai Grossjohann
1996-10-30 13:46 ` gnus-emphasis-alist Hrvoje Niksic

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=kigaft5fqs3.fsf@jagor.srce.hr \
    --to=hniksic@srce.hr \
    /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).