Article View: gnu.emacs.bug
Article #88002GNUS Suggestion: Display underline and bold with text properties
From: Per Abrahamsen
Date: Sat, 13 Aug 1994 03:26
Date: Sat, 13 Aug 1994 03:26
38 lines
2042 bytes
2042 bytes
I suggest somethink like the following is added to GNUS. It replaces
attempted use of overstriking to create underline and bold text with
text properties. For example:
_t_e_x_t
is displayed as `text' with underline face and
tteexxtt
is displayed as `text' in bold face.
This is common in some newsgroups. I don't think the code gives a
measurable delay for articles that does not use overstriking, a single
call to `search-forward' for the backspace.
(defun gnus-article-prepare-overstrike ()
;; Prepare article for overstrike commands.
(save-excursion
(set-buffer gnus-article-buffer)
(let ((buffer-read-only nil))
(while (search-forward "\b" nil t)
(let ((next (following-char))
(previous (char-after (- (point) 2))))
(cond ((eq next previous)
(delete-region (- (point) 2) (point))
(put-text-property (point) (1+ (point))
'face 'bold))
((eq next ?_)
(delete-region (1- (point)) (1+ (point)))
(put-text-property (1- (point)) (point)
'face 'underline))
((eq previous ?_)
(delete-region (- (point) 2) (point))
(put-text-property (point) (1+ (point))
'face 'underline))))))))
(add-hook 'gnus-article-prepare-hook 'gnus-article-prepare-overstrike)
Technical Details
Message-ID:
<9408130017.AA06977@eupectic.research.att.com>Path:
arc1-ca.pugleaf.net!bga.com!news.sprintlink.net!primenet!netnews.asu.edu !asuvax!cs.utexas.edu!swrinde!howland.reston.ans.net!math.ohio-state.edu!pacific.mps.ohio-state.edu!cis.ohio-state.edu!research.att.com!abrahamShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fb2f1,af51fbcbe2f3b3b1,start X-Google-Attributes: gidfb2f1,public X-Google-ArrivalTime: 1994-08-13 06:23:51 PST Path: arc1-ca.pugleaf.net!bga.com!news.sprintlink.net!primenet!netnews.asu.edu !asuvax!cs.utexas.edu!swrinde!howland.reston.ans.net!math.ohio-state.edu!pacific.mps.ohio-state.edu!cis.ohio-state.edu!research.att.com!abraham From: abraham@research.att.com (Per Abrahamsen) Newsgroups: gnu.emacs.bug Subject: GNUS Suggestion: Display underline and bold with text properties Date: 12 Aug 1994 23:26:52 -0400 Organization: GNUs Not Usenet Lines: 39 Sender: daemon@cis.ohio-state.edu Approved: bug-gnu-emacs@prep.ai.mit.edu Distribution: gnu Message-ID: <9408130017.AA06977@eupectic.research.att.com>