summaryrefslogtreecommitdiff
path: root/lisp/thingatpt.el
diff options
context:
space:
mode:
authorDave Love <fx@gnu.org>2003-01-27 11:38:45 +0000
committerDave Love <fx@gnu.org>2003-01-27 11:38:45 +0000
commit839aacc98f3ffa7b609fa75f7a9963dda55acbc6 (patch)
treede71a5a3dbd9661b3ffbfbefe5eee80f77e44b85 /lisp/thingatpt.el
parent1e56daa587d05f88a2be97160401be9b94c61f59 (diff)
downloademacs-839aacc98f3ffa7b609fa75f7a9963dda55acbc6.tar.gz
(thing-at-point-file-name-chars): Include
non-ASCII again and re-write the filename ops.
Diffstat (limited to 'lisp/thingatpt.el')
-rw-r--r--lisp/thingatpt.el12
1 files changed, 9 insertions, 3 deletions
diff --git a/lisp/thingatpt.el b/lisp/thingatpt.el
index 3e6b344a3f2..70f25da673a 100644
--- a/lisp/thingatpt.el
+++ b/lisp/thingatpt.el
@@ -195,13 +195,19 @@ a symbol as a valid THING."
;; Filenames and URLs www.com/foo%32bar
-(defvar thing-at-point-file-name-chars "~/A-Za-z0-9---_.${}#%,:"
+(defvar thing-at-point-file-name-chars "-~/[:alnum:]_.${}#%,:"
"Characters allowable in filenames.")
(put 'filename 'end-op
- (lambda () (skip-chars-forward thing-at-point-file-name-chars)))
+ (lambda ()
+ (re-search-forward (concat "\\=[" thing-at-point-file-name-chars "]*")
+ nil t)))
(put 'filename 'beginning-op
- (lambda () (skip-chars-backward thing-at-point-file-name-chars)))
+ (lambda ()
+ (if (re-search-backward (concat "[^" thing-at-point-file-name-chars "]")
+ nil t)
+ (forward-char)
+ (goto-char (point-min)))))
(defvar thing-at-point-url-path-regexp
"[^]\t\n \"'()<>[^`{}]*[^]\t\n \"'()<>[^`{}.,;]+"