[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/focus abad47f1c4 53/82: Add functions to pin/unpin the foc
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/focus abad47f1c4 53/82: Add functions to pin/unpin the focused section |
Date: |
Tue, 6 Sep 2022 04:58:57 -0400 (EDT) |
branch: elpa/focus
commit abad47f1c40e595779c376a1e936c1609be1cdf4
Author: Lars Tveito <larstvei@ifi.uio.no>
Commit: Lars Tveito <larstvei@ifi.uio.no>
Add functions to pin/unpin the focused section
---
focus.el | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/focus.el b/focus.el
index e53d2b19dc..231b52f528 100644
--- a/focus.el
+++ b/focus.el
@@ -196,6 +196,21 @@ default is overwritten. This function simply helps set the
(thing (completing-read "Thing: " candidates)))
(setq focus-current-thing (intern thing))))
+(defun focus-pin ()
+ "Pin the focused section to its current location or the region,
+if active."
+ (interactive)
+ (when focus-mode
+ (when (region-active-p)
+ (focus-move-overlays (region-beginning) (region-end)))
+ (remove-hook 'post-command-hook 'focus-move-focus t)))
+
+(defun focus-unpin ()
+ "Unpin the focused section."
+ (interactive)
+ (when focus-mode
+ (add-hook 'post-command-hook 'focus-move-focus nil t)))
+
(defun focus-next-thing (&optional n)
"Moves the point to the middle of the Nth next thing."
(interactive "p")
- [nongnu] elpa/focus d1bd81ee4d 39/82: Added focus-read-only-mode, (continued)
- [nongnu] elpa/focus d1bd81ee4d 39/82: Added focus-read-only-mode, ELPA Syncer, 2022/09/06
- [nongnu] elpa/focus 4c8391ea32 29/82: Fixed bug in defgroup, ELPA Syncer, 2022/09/06
- [nongnu] elpa/focus b21341bd40 38/82: Added function for briefly showing the cursor, ELPA Syncer, 2022/09/06
- [nongnu] elpa/focus 246eaeb8d1 72/82: Define faces for the unfocused and focused regions, ELPA Syncer, 2022/09/06
- [nongnu] elpa/focus b90cfb3c27 50/82: Fix #4, ELPA Syncer, 2022/09/06
- [nongnu] elpa/focus f590761dac 46/82: focus-read-only-mode calls for version bump, ELPA Syncer, 2022/09/06
- [nongnu] elpa/focus 01a7a95334 27/82: Changed paragraph to section in README, ELPA Syncer, 2022/09/06
- [nongnu] elpa/focus cd2aad5590 31/82: Cleaned up focus-dimness docstring, ELPA Syncer, 2022/09/06
- [nongnu] elpa/focus 5753e25fdf 30/82: fixed the focus-average-colors docstring, ELPA Syncer, 2022/09/06
- [nongnu] elpa/focus fee47bc7c9 11/82: Decrease the width of the gifs, ELPA Syncer, 2022/09/06
- [nongnu] elpa/focus abad47f1c4 53/82: Add functions to pin/unpin the focused section,
ELPA Syncer <=
- [nongnu] elpa/focus 3a2c4f1198 67/82: Merge pull request #19 from jcs-PR/master, ELPA Syncer, 2022/09/06
- [nongnu] elpa/focus a723f78dc4 37/82: Added function for hiding the cursor, ELPA Syncer, 2022/09/06
- [nongnu] elpa/focus d5631db0b6 73/82: Remove `face`-suffix from faces, ELPA Syncer, 2022/09/06
- [nongnu] elpa/focus 5bddbbb7d3 22/82: Remove newline, ELPA Syncer, 2022/09/06
- [nongnu] elpa/focus cfb1672fca 76/82: Merge pull request #22 from larstvei/focus-face, ELPA Syncer, 2022/09/06
- [nongnu] elpa/focus ffd97a5a36 56/82: Fix bug related to `post-command-hook`, ELPA Syncer, 2022/09/06
- [nongnu] elpa/focus 045ee6175e 63/82: Remove focus-any and simply apply derived-mode-p, ELPA Syncer, 2022/09/06
- [nongnu] elpa/focus 0f2a9945e9 66/82: Fixed some flycheck warnings., ELPA Syncer, 2022/09/06
- [nongnu] elpa/focus 1423efbd25 42/82: Don't assume bounds are found, ELPA Syncer, 2022/09/06
- [nongnu] elpa/focus 19b3c7b348 70/82: Just use a face for customizing the unfocused region, ELPA Syncer, 2022/09/06