comparison lisp/gnus/smiley-ems.el @ 34493:3e2309d79ff3

(smiley-regexp-alist): Make regexps match at the end of the buffer. (smiley-region): In the loop, move to the end of the submatch matching the smiley instead of using the end of the match of the whole regexp.
author Gerd Moellmann <gerd@gnu.org>
date Tue, 12 Dec 2000 16:54:45 +0000
parents ce1470fa2100
children e223a51dca47
comparison
equal deleted inserted replaced
34492:c0363a97e5cb 34493:3e2309d79ff3
50 :group 'smiley) 50 :group 'smiley)
51 51
52 ;; The XEmacs version has a baroque, if not rococo, set of these. 52 ;; The XEmacs version has a baroque, if not rococo, set of these.
53 (defcustom smiley-regexp-alist 53 (defcustom smiley-regexp-alist
54 ;; Perhaps :-) should be distinct -- it does appear in the Jargon File. 54 ;; Perhaps :-) should be distinct -- it does appear in the Jargon File.
55 '(("\\([:;]-?)\\)\\W" 1 "smile.pbm") 55 '(("\\([:;]-?)\\)\\(\\W\\|\\'\\)" 1 "smile.pbm")
56 ("\\(:-[/\\]\\)\\W" 1 "wry.pbm") 56 ("\\(:-[/\\]\\)\\(\\W\\|\\'\\)" 1 "wry.pbm")
57 ("\\(:-[({]\\)\\W" 1 "frown.pbm")) 57 ("\\(:-[({]\\)\\(\\W\\|\\'\\)" 1 "frown.pbm"))
58 "*A list of regexps to map smilies to images. 58 "*A list of regexps to map smilies to images.
59 The elements are (REGEXP MATCH FILE), where MATCH is the submatch in 59 The elements are (REGEXP MATCH FILE), where MATCH is the submatch in
60 rgexp to replace with IMAGE. IMAGE is the name of a PBM file in 60 rgexp to replace with IMAGE. IMAGE is the name of a PBM file in
61 `smiley-data-directory' or the normal image search path." 61 `smiley-data-directory' or the normal image search path."
62 :type '(repeat (list regexp 62 :type '(repeat (list regexp
121 'display `(when smiley-active ,@image)) 121 'display `(when smiley-active ,@image))
122 (overlay-put overlay 'mouse-face 'highlight) 122 (overlay-put overlay 'mouse-face 'highlight)
123 (overlay-put overlay 'smiley t) 123 (overlay-put overlay 'smiley t)
124 (overlay-put overlay 124 (overlay-put overlay
125 'help-echo "mouse-2: toggle smilies in buffer") 125 'help-echo "mouse-2: toggle smilies in buffer")
126 (overlay-put overlay 'keymap smiley-mouse-map)))))) 126 (overlay-put overlay 'keymap smiley-mouse-map)
127 (goto-char (match-end group)))))))
127 (setq smiley-active t))) 128 (setq smiley-active t)))
128 129
129 (defun smiley-toggle-buffer (&optional arg) 130 (defun smiley-toggle-buffer (&optional arg)
130 "Toggle displaying smiley faces. 131 "Toggle displaying smiley faces.
131 With arg, turn displaying on if and only if arg is positive." 132 With arg, turn displaying on if and only if arg is positive."