[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/consult d1d48bd993 2/7: consult--jump-1: Inline functio
From: |
ELPA Syncer |
Subject: |
[elpa] externals/consult d1d48bd993 2/7: consult--jump-1: Inline function |
Date: |
Sun, 1 Oct 2023 06:57:40 -0400 (EDT) |
branch: externals/consult
commit d1d48bd9931611584289f35a8785e1213f053ab3
Author: Daniel Mendler <mail@daniel-mendler.de>
Commit: Daniel Mendler <mail@daniel-mendler.de>
consult--jump-1: Inline function
---
consult.el | 19 +++++++++----------
1 file changed, 9 insertions(+), 10 deletions(-)
diff --git a/consult.el b/consult.el
index 38f8de7114..6b324bcadb 100644
--- a/consult.el
+++ b/consult.el
@@ -1474,14 +1474,6 @@ See `isearch-open-necessary-overlays' and
`isearch-open-overlay-temporary'."
;; command.
(message "Buffer is dead"))))
-(defun consult--jump-1 (pos)
- "Go to POS, switch buffer and widen if necessary."
- (consult--jump-to-buffer pos)
- ;; Widen if we cannot jump to the position
- (unless (= (goto-char pos) (point))
- (widen)
- (goto-char pos)))
-
(defun consult--jump (pos)
"Jump to POS.
First push current position to mark ring, then move to new
@@ -1497,7 +1489,10 @@ position and run `consult-after-jump-hook'."
;; We all love side effects!
(setq pos (+ pos 0))
(push-mark (point) t))
- (consult--jump-1 pos)
+ (consult--jump-to-buffer pos)
+ (unless (= (goto-char pos) (point)) ;; Widen if jump failed
+ (widen)
+ (goto-char pos))
(consult--invisible-open-permanently)
(run-hooks 'consult-after-jump-hook))
nil)
@@ -1523,7 +1518,11 @@ The function can be used as the `:state' argument of
`consult--read'."
(narrow-to-region saved-min saved-max)
(goto-char saved-pos)))
;; Candidate can be previewed
- (consult--jump-1 (or (car-safe cand) cand))
+ (let ((pos (or (car-safe cand) cand)))
+ (consult--jump-to-buffer pos)
+ (unless (= (goto-char pos) (point)) ;; Widen if jump failed
+ (widen)
+ (goto-char pos)))
(setq restore (consult--invisible-open-temporarily))
;; Ensure that cursor is properly previewed (gh:minad/consult#764)
(unless (eq cursor-in-non-selected-windows 'box)
- [elpa] externals/consult updated (43380042da -> e269bc3c99), ELPA Syncer, 2023/10/01
- [elpa] externals/consult e2ecccd3eb 3/7: consult--jump-ensure-buffer: Rename from consult--jump-to-buffer, refactor, ELPA Syncer, 2023/10/01
- [elpa] externals/consult d1d48bd993 2/7: consult--jump-1: Inline function,
ELPA Syncer <=
- [elpa] externals/consult 22d6821281 5/7: consult--jump-preview: Ensure that buffer position is restored (Fix #858), ELPA Syncer, 2023/10/01
- [elpa] externals/consult 8228075d87 1/7: consult--jump-to-buffer: New function, ELPA Syncer, 2023/10/01
- [elpa] externals/consult 18dc54c25c 6/7: Remove consult--maybe-recenter, ELPA Syncer, 2023/10/01
- [elpa] externals/consult e269bc3c99 7/7: Rename variables to improve readability, ELPA Syncer, 2023/10/01
- [elpa] externals/consult f84da06f7a 4/7: Reuse consult--jump-ensure-buffer for restoration, ELPA Syncer, 2023/10/01