From d6a1d28906986cfc7fefe41c88b5c686d3d9e1b8 Mon Sep 17 00:00:00 2001 From: Gerd Moellmann Date: Tue, 12 Dec 2000 16:54:45 +0000 Subject: [PATCH] (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. --- lisp/gnus/smiley-ems.el | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/lisp/gnus/smiley-ems.el b/lisp/gnus/smiley-ems.el index 78d8007f7fa..4b54197c40e 100644 --- a/lisp/gnus/smiley-ems.el +++ b/lisp/gnus/smiley-ems.el @@ -52,9 +52,9 @@ This is in addition to the normal image search path." ;; The XEmacs version has a baroque, if not rococo, set of these. (defcustom smiley-regexp-alist ;; Perhaps :-) should be distinct -- it does appear in the Jargon File. - '(("\\([:;]-?)\\)\\W" 1 "smile.pbm") - ("\\(:-[/\\]\\)\\W" 1 "wry.pbm") - ("\\(:-[({]\\)\\W" 1 "frown.pbm")) + '(("\\([:;]-?)\\)\\(\\W\\|\\'\\)" 1 "smile.pbm") + ("\\(:-[/\\]\\)\\(\\W\\|\\'\\)" 1 "wry.pbm") + ("\\(:-[({]\\)\\(\\W\\|\\'\\)" 1 "frown.pbm")) "*A list of regexps to map smilies to images. The elements are (REGEXP MATCH FILE), where MATCH is the submatch in rgexp to replace with IMAGE. IMAGE is the name of a PBM file in @@ -123,7 +123,8 @@ which smileys to operate on and which images to use for them." (overlay-put overlay 'smiley t) (overlay-put overlay 'help-echo "mouse-2: toggle smilies in buffer") - (overlay-put overlay 'keymap smiley-mouse-map)))))) + (overlay-put overlay 'keymap smiley-mouse-map) + (goto-char (match-end group))))))) (setq smiley-active t))) (defun smiley-toggle-buffer (&optional arg) -- 2.39.2