From ea1dc729170149e67c399bc6db500b54d32b84df Mon Sep 17 00:00:00 2001 From: JSDurand Date: Sun, 19 Sep 2021 17:35:47 +0800 Subject: Fit the annotation buffer to window * bookmark-conf.el: (durand-bookmark-jump-fit-to-window, bookmark-jump): Add an :after advice to fit the annotation buffer to its window. For some reason this is not done by default. --- bookmark-conf.el | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/bookmark-conf.el b/bookmark-conf.el index 1af7641..9de3d8d 100644 --- a/bookmark-conf.el +++ b/bookmark-conf.el @@ -131,5 +131,20 @@ (blist-define-criterion "elisp" "ELisp" (string-match-p "\\.el$" (blist-get-location bookmark))) +;;; Fit annotations buffer to window + +(defun durand-bookmark-jump-fit-to-window (&rest _args) + "Fit the annotations buffer to its window, if needed. +ARGS are ignored." + (let ((window (get-buffer-window "*Bookmark Annotation*"))) + (cond + ((and window (windowp window) (window-live-p window)) + (durand-fit-window-to-buffer-with-max + window))))) + +(advice-add #'bookmark-jump + :after + #'durand-bookmark-jump-fit-to-window) + (provide 'bookmark-conf) ;;; bookmark-conf.el ends here -- cgit v1.2.3-18-g5258