[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/better-jumper ca6edffe62 30/48: Add new jump behavior conf
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/better-jumper ca6edffe62 30/48: Add new jump behavior config option |
Date: |
Sun, 9 Jan 2022 22:58:10 -0500 (EST) |
branch: elpa/better-jumper
commit ca6edffe6240a39a46c22701e849e052e07fd22a
Author: Bryan Gilbert <gilbertw1@gmail.com>
Commit: Bryan Gilbert <gilbertw1@gmail.com>
Add new jump behavior config option
---
Readme.md | 13 +++++++++++--
better-jumper.el | 11 +++++++++--
2 files changed, 20 insertions(+), 4 deletions(-)
diff --git a/Readme.md b/Readme.md
index 41eadb9675..1e5e3622e9 100644
--- a/Readme.md
+++ b/Readme.md
@@ -35,7 +35,7 @@ You can either a) enable one or both globally:
Or b) enable one or both locally, where you need it:
```elisp
-(add-hook 'python-mode-hook 'turn-on-better-jumper-mode
+(add-hook 'python-mode-hook #'turn-on-better-jumper-mode)
```
## Getting started
@@ -89,7 +89,7 @@ using something like `desktop` or `persp-mode`. This is the
default context.
While in the `'buffer` context, jump lists are maintained using buffer-local
variables and can optionally by saved using `savehist`.
-#### New Window Behavior (`better-jumper-new-window-behavior`)
+#### New Window Behavior (`better-jumper-new-window-behavior`)
This setting specifies the behavior that will take place when a new window is
created AND the current context is set to `'window`. This can be either set to
@@ -97,6 +97,15 @@ created AND the current context is set to `'window`. This
can be either set to
jump list will be copied to the new window. If the value is `'empty` then the
new window's jump list will start empty.
+#### Add Jump Behavior (`better-jumper-add-jump-behavior`)
+
+This setting specifies how the jump list is affected when a new jump is added.
+If the value is set to `'append` then new items are always added to the end
+of the jump list regardless of the current position. If the value is set to
+`replace`, then if the any jumps newer than the current position in the jump
+list will be replaced. I.e. If a user jumps back three times then adds a new
+jump, those three jumps will be replaced by the new jump in the list.
+
#### Max Length (`better-jumper-max-length`)
This is a numeric value that dictate the maximum length that a jump list can
diff --git a/better-jumper.el b/better-jumper.el
index 977791aa9d..3aa7f7401c 100644
--- a/better-jumper.el
+++ b/better-jumper.el
@@ -62,6 +62,12 @@
(other :tag "Copy last window" copy))
:group 'better-jumper)
+(defcustom better-jumper-add-jump-behavior 'append
+ "Determines the behavior when adding a new jump."
+ :type '(choice (const :tag "Replace remaining items in jump list" replace)
+ (other :tag "Append to end of jump list" append))
+ :group 'better-jumper)
+
(defcustom better-jumper-max-length 100
"The maximum number of jumps to keep track of."
:type 'integer
@@ -339,8 +345,9 @@ POS defaults to point."
(let* ((struct (better-jumper--get-struct))
(jump-list (better-jumper--get-struct-jump-list struct))
(idx (better-jumper-jump-list-struct-idx struct)))
- (cl-loop repeat idx
- do (ring-remove jump-list))
+ (when (eq better-jumper-add-jump-behavior 'replace)
+ (cl-loop repeat idx
+ do (ring-remove jump-list 0)))
(setf (better-jumper-jump-list-struct-idx struct) -1))
(save-excursion
(when pos
- [nongnu] elpa/better-jumper 73cc1939fe 06/48: add `evil-jump` configuration example, (continued)
- [nongnu] elpa/better-jumper 73cc1939fe 06/48: add `evil-jump` configuration example, ELPA Syncer, 2022/01/09
- [nongnu] elpa/better-jumper c5d0c727bc 08/48: Refactor to use window parameters, ELPA Syncer, 2022/01/09
- [nongnu] elpa/better-jumper e5a1b4a58a 10/48: Update doc with recent configuration changes, ELPA Syncer, 2022/01/09
- [nongnu] elpa/better-jumper 3ad6930b16 12/48: refactor evil jump advice, ELPA Syncer, 2022/01/09
- [nongnu] elpa/better-jumper e7826affb8 17/48: Improve readme formatting, ELPA Syncer, 2022/01/09
- [nongnu] elpa/better-jumper 3a0d02071a 18/48: Embed license in elisp comments, ELPA Syncer, 2022/01/09
- [nongnu] elpa/better-jumper 7926fff2c7 19/48: minor refactors, ELPA Syncer, 2022/01/09
- [nongnu] elpa/better-jumper 3bbd0a5889 20/48: Use markers in jump list w/ point fallback, ELPA Syncer, 2022/01/09
- [nongnu] elpa/better-jumper 2c04d4bc09 25/48: Add minor mode + cleanup, ELPA Syncer, 2022/01/09
- [nongnu] elpa/better-jumper 3aa1a8a766 28/48: Merge pull request #1 from hlissner/patch-1, ELPA Syncer, 2022/01/09
- [nongnu] elpa/better-jumper ca6edffe62 30/48: Add new jump behavior config option,
ELPA Syncer <=
- [nongnu] elpa/better-jumper 5600174ba9 02/48: Create LICENSE, ELPA Syncer, 2022/01/09
- [nongnu] elpa/better-jumper 8e82f33309 01/48: initial WIP implementation, ELPA Syncer, 2022/01/09
- [nongnu] elpa/better-jumper 06a98185e8 04/48: propertly maintain / cleanup buffer + window jumps, ELPA Syncer, 2022/01/09
- [nongnu] elpa/better-jumper 3624896c72 05/48: add documentation, ELPA Syncer, 2022/01/09
- [nongnu] elpa/better-jumper d6ecaa1f96 07/48: minor refactors + cleanup, ELPA Syncer, 2022/01/09
- [nongnu] elpa/better-jumper 719e412f43 03/48: Add support restricting jump list to contexts, ELPA Syncer, 2022/01/09
- [nongnu] elpa/better-jumper c307a253d9 09/48: Fixup copy struct function, ELPA Syncer, 2022/01/09
- [nongnu] elpa/better-jumper f9f0180894 13/48: update documentation, ELPA Syncer, 2022/01/09
- [nongnu] elpa/better-jumper 8d2b5f4c3a 11/48: Re-implement buffer context support using locals, ELPA Syncer, 2022/01/09
- [nongnu] elpa/better-jumper 50bf0f7ee7 15/48: add finder-known-keyword to Keywords, ELPA Syncer, 2022/01/09