summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--bookmark-conf.el15
1 files changed, 15 insertions, 0 deletions
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