emacs-elpa-diffs
[Top][All Lists]
Advanced

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

[nongnu] elpa/focus 58a91b29aa 34/82: Split focus-bounds into two functi


From: ELPA Syncer
Subject: [nongnu] elpa/focus 58a91b29aa 34/82: Split focus-bounds into two functions
Date: Tue, 6 Sep 2022 04:58:56 -0400 (EDT)

branch: elpa/focus
commit 58a91b29aa414a24decb8bbe5adac41c3ac4624d
Author: Lars Tveito <larstvei@ifi.uio.no>
Commit: Lars Tveito <larstvei@ifi.uio.no>

    Split focus-bounds into two functions
---
 focus.el | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/focus.el b/focus.el
index fa22c87386..636d83ac3c 100644
--- a/focus.el
+++ b/focus.el
@@ -88,12 +88,15 @@ Things that are defined include `symbol', `list', `sexp',
     (let ((v (funcall f (car lst))))
       (if v v (focus-any f (cdr lst))))))
 
-(defun focus-bounds ()
-  "Return the current bounds, based on `focus-mode-to-thing'."
+(defun focus-get-thing ()
+  "Return the current thing, based on `focus-mode-to-thing'."
   (let* ((modes (mapcar 'car focus-mode-to-thing))
-         (mode  (focus-any 'derived-mode-p modes))
-         (thing (if mode (cdr (assoc mode focus-mode-to-thing)) 'sentence)))
-    (bounds-of-thing-at-point thing)))
+         (mode  (focus-any 'derived-mode-p modes)))
+    (if mode (cdr (assoc mode focus-mode-to-thing)) 'sentence)))
+
+(defun focus-bounds ()
+  "Return the current bounds, based on `focus-get-thing'."
+  (bounds-of-thing-at-point (focus-get-thing)))
 
 (defun focus-average-colors (color &rest colors)
   "Takes an average of the colors given by argument.



reply via email to

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