From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/8519 Path: main.gmane.org!not-for-mail From: Hrvoje Niksic Newsgroups: gmane.emacs.gnus.general Subject: gnus-emphasis-alist Date: 29 Oct 1996 21:40:12 +0100 Sender: hniksic@public.srce.hr Message-ID: NNTP-Posting-Host: coloc-standby.netfonds.no X-Trace: main.gmane.org 1035148666 12580 80.91.224.250 (20 Oct 2002 21:17:46 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Sun, 20 Oct 2002 21:17:46 +0000 (UTC) Return-Path: Original-Received: (qmail 22166 invoked from smtpd); 29 Oct 1996 21:09:59 -0000 Original-Received: from ifi.uio.no (0@129.240.64.2) by deanna.miranova.com with SMTP; 29 Oct 1996 21:09:59 -0000 Original-Received: from jagor.srce.hr (hniksic@jagor.srce.hr [161.53.2.130]) by ifi.uio.no with ESMTP (8.6.11/ifi2.4) id for ; Tue, 29 Oct 1996 21:40:18 +0100 Original-Received: from hniksic@localhost by jagor.srce.hr (8.8.2/8.6.12.CI) id VAA11080; Tue, 29 Oct 1996 21:40:13 +0100 (MET) Original-To: ding@ifi.uio.no X-URL: ftp://gnjilux.cc.fer.hr/pub/unix/util/fetch/ X-Attribution: Hrv X-Face: &}4JQk=L;e.~x+|eo]#DGk@x3~ed!.~lZ}YQcYb7f[WL9L'Z*+OyA\nAEL1M(".[qvI#a2E 6WYI5>>e7'@_)3Ol9p|Nn2wNa/;~06jL*B%tTcn/XvhAu7qeES0\|MF%$;sI#yn1+y" Original-Lines: 60 X-Mailer: Red Gnus v0.52/XEmacs 19.14 Xref: main.gmane.org gmane.emacs.gnus.general:8519 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:8519 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 | Student at FER Zagreb, Croatia --------------------------------+-------------------------------- `VI' - An editor used by those heretics that don't subscribe to the Emacs religion.