]> code.delx.au - gnu-emacs/blobdiff - lisp/gnus/smiley-ems.el
*** empty log message ***
[gnu-emacs] / lisp / gnus / smiley-ems.el
index 78d8007f7fa6a472a6c7b02c3d717423868eee10..7fce284e500ee8b7ae70c32122da29fd30326100 100644 (file)
@@ -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
@@ -108,6 +108,7 @@ which smileys to operate on and which images to use for them."
       (smiley-update-cache))
     (save-excursion
       (let ((beg (or start (point-min)))
+           (inhibit-point-motion-hooks t)
            group overlay image)
        (dolist (entry smiley-cached-regexp-alist)
          (setq group (nth 1 entry)
@@ -123,7 +124,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)
@@ -146,7 +148,7 @@ With arg, turn displaying on if and only if arg is positive."
 (eval-when-compile (defvar gnus-article-buffer))
 
 (defun gnus-smiley-display (&optional arg)
-  "Display textual emoticaons (\"smilies\") as small graphical icons.
+  "Display textual emoticons (\"smilies\") as small graphical icons.
 With arg, turn displaying on if and only if arg is positive."
   (interactive "P")
   (save-excursion
@@ -160,4 +162,5 @@ With arg, turn displaying on if and only if arg is positive."
 
 (provide 'smiley)
 
+;;; arch-tag: e726728a-14fb-4e6a-9aef-889941bdf7ad
 ;;; smiley-ems.el ends here