Skip to content

Commit

Permalink
Remove unnecessary calls to buffer-live-p
Browse files Browse the repository at this point in the history
  • Loading branch information
minad committed Sep 30, 2021
1 parent d230fda commit 48474f1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion consult-register.el
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ This function can be used as `register-preview-function'."
(propertize (abbreviate-file-name (cadr val)) 'face 'consult-file)
(caddr val)))
;; Display full line of buffer
((and (markerp val) (buffer-live-p (marker-buffer val)))
((and (markerp val) (marker-buffer val))
(with-current-buffer (marker-buffer val)
(save-restriction
(save-excursion
Expand Down
4 changes: 2 additions & 2 deletions consult.el
Original file line number Diff line number Diff line change
Expand Up @@ -1102,7 +1102,7 @@ See `isearch-open-necessary-overlays' and `isearch-open-overlay-temporary'."
(defun consult--jump-nomark (pos)
"Go to POS and recenter."
(cond
((and (markerp pos) (not (buffer-live-p (marker-buffer pos))))
((and (markerp pos) (not (marker-buffer pos)))
;; Only print a message, no error in order to not mess
;; with the minibuffer update hook.
(message "Buffer is dead"))
Expand Down Expand Up @@ -1147,7 +1147,7 @@ FACE is the cursor face."
(cond
(restore
(let ((saved-buffer (marker-buffer saved-pos)))
(if (not (buffer-live-p saved-buffer))
(if (not saved-buffer)
(message "Buffer is dead")
(set-buffer saved-buffer)
(narrow-to-region saved-min saved-max)
Expand Down

0 comments on commit 48474f1

Please sign in to comment.