diff lisp/utils/thing.el @ 203:850242ba4a81 r20-3b28

Import from CVS: tag r20-3b28
author cvs
date Mon, 13 Aug 2007 10:02:21 +0200
parents c7528f8e288d
children
line wrap: on
line diff
--- a/lisp/utils/thing.el	Mon Aug 13 10:01:24 2007 +0200
+++ b/lisp/utils/thing.el	Mon Aug 13 10:02:21 2007 +0200
@@ -165,11 +165,13 @@
   (cond ((memq (char-syntax (char-after here)) '(?_ ?w))
          (setq *last-thing* 'symbol)
          (let ((end (scan-sexps here 1)))
-           (thing-region (min here (scan-sexps end -1)) end)))))
+           (if end
+	       (thing-region (min here (scan-sexps end -1)) end))))))
 
 (defun thing-filename (here)
   "Return start and end of filename at HERE."
-  (cond ((memq (char-syntax (char-after here)) '(?w ?_ ?.))
+  (cond ((and (memq (char-syntax (char-after here)) '(?w ?_ ?.))
+	      (< here (point-max)))
          (let (start end)
 	   (save-excursion
 	     (goto-char here)