emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master 5780523: * lisp/thingatpt.el (region): Put property bounds-of-thi


From: Juri Linkov
Subject: master 5780523: * lisp/thingatpt.el (region): Put property bounds-of-thing-at-point, bug#39512
Date: Wed, 21 Apr 2021 15:37:30 -0400 (EDT)

branch: master
commit 57805231b2580d304dc2e0e642644ebe52c24f33
Author: Juri Linkov <juri@linkov.net>
Commit: Juri Linkov <juri@linkov.net>

    * lisp/thingatpt.el (region): Put property bounds-of-thing-at-point, 
bug#39512
---
 lisp/thingatpt.el | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/lisp/thingatpt.el b/lisp/thingatpt.el
index c52fcfc..8ca0f42 100644
--- a/lisp/thingatpt.el
+++ b/lisp/thingatpt.el
@@ -600,10 +600,14 @@ with angle brackets.")
              (buffer-substring-no-properties
               (car boundary-pair) (cdr boundary-pair))))))
 
-;;  Buffer
+;;  Buffer and region
 
 (put 'buffer 'end-op (lambda () (goto-char (point-max))))
 (put 'buffer 'beginning-op (lambda () (goto-char (point-min))))
+(put 'region 'bounds-of-thing-at-point
+     (lambda ()
+       (when (use-region-p)
+         (cons (region-beginning) (region-end)))))
 
 ;; UUID
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]