summaryrefslogtreecommitdiff
path: root/lisp/thingatpt.el
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>1997-07-09 00:04:00 +0000
committerRichard M. Stallman <rms@gnu.org>1997-07-09 00:04:00 +0000
commita1c9b4d08012aa6794ad817904596265aa3e6d55 (patch)
tree3cf1a86f3b83ee2ed00e3eddbd82cd36d9a27738 /lisp/thingatpt.el
parentcf09633a19a6bc0d51bdcd2da4987a490a97b945 (diff)
downloademacs-a1c9b4d08012aa6794ad817904596265aa3e6d55.tar.gz
(url): Define end-op property again. Wrap end-op
and beginning-op lambdas with `function', not quote.
Diffstat (limited to 'lisp/thingatpt.el')
-rw-r--r--lisp/thingatpt.el20
1 files changed, 11 insertions, 9 deletions
diff --git a/lisp/thingatpt.el b/lisp/thingatpt.el
index 4ea50c5dd23..88a2807538b 100644
--- a/lisp/thingatpt.el
+++ b/lisp/thingatpt.el
@@ -299,16 +299,18 @@ point."
(goto-char match)
(looking-at regexp)))))
-;; Can't do it sensibly?
-;(put 'url 'end-op
-; '(lambda () (skip-chars-forward (concat ":" thing-at-point-url-chars))
-; (skip-chars-backward ".,:")))
+(put 'url 'end-op
+ (function (lambda ()
+ (let ((bounds (thing-at-point-bounds-of-url-at-point)))
+ (if bounds
+ (goto-char (cdr bounds))
+ (error "No URL here"))))))
(put 'url 'beginning-op
- '(lambda ()
- (let ((bounds (thing-at-point-bounds-of-url-at-point)))
- (if bounds
- (goto-char (car bounds))
- (error "No URL here")))))
+ (function (lambda ()
+ (let ((bounds (thing-at-point-bounds-of-url-at-point)))
+ (if bounds
+ (goto-char (car bounds))
+ (error "No URL here"))))))
;; Whitespace