From 2f9a30d1d142bd68b1dcbf2cc8a5ad4178e485ef Mon Sep 17 00:00:00 2001 From: 10sr <8.slashes@gmail.com> Date: Thu, 30 Jan 2020 11:56:19 +0900 Subject: [PATCH] Push mark when not set yet --- emacs.el | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/emacs.el b/emacs.el index 13022c7..c38445a 100644 --- a/emacs.el +++ b/emacs.el @@ -534,9 +534,10 @@ Otherwize hook it." ;; (when (fboundp 'visible-mark-move-overlays) ;; (visible-mark-move-overlays)) )) -(add-hook 'find-file-hook - 'push-mark - t) +(add-hook 'switch-buffer-functions + (lambda (&rest _) + (unless (mark t) + (push-mark)))) (when (fboundp 'back-button-mode) (back-button-mode 1))