From fd0d60e3aaff50cba41328531be886f1c26cbade Mon Sep 17 00:00:00 2001 From: 10sr <8.slashes@gmail.com> Date: Sat, 25 Jan 2020 04:50:50 +0900 Subject: [PATCH] Add visible-mark-mode --- emacs.el | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/emacs.el b/emacs.el index 3e28048..c29a29f 100644 --- a/emacs.el +++ b/emacs.el @@ -538,6 +538,23 @@ Otherwize hook it." (when (fboundp 'back-button-local-backward) (global-set-key (kbd "") 'back-button-local-backward)) +(when (fboundp 'global-visible-mark-mode) + (set-variable 'visible-mark-max 2) + (set-variable 'visible-mark-faces '(visible-mark-face1 visible-mark-face2)) + + ;; http://emacs.rubikitch.com/visible-mark/ + ;; transient-mark-modeでC-SPC C-SPC、あるいはC-SPC C-gすると消えるバグ修正 + (defun visible-mark-move-overlays--avoid-disappear (&rest them) + "Fix. + +THEM are function and its args." + (let ((mark-active t)) (apply them))) + (advice-add 'visible-mark-move-overlays + :around + 'visible-mark-move-overlays--avoid-disappear) + + (global-visible-mark-mode 1)) + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; title and mode-line