diff options
author | Sean Whitton <spwhitton@spwhitton.name> | 2020-05-30 16:43:10 -0700 |
---|---|---|
committer | Sean Whitton <spwhitton@spwhitton.name> | 2020-05-31 18:56:03 -0700 |
commit | 42c9826d409c7515aea34af309bb3005dc696163 (patch) | |
tree | ea78508e60ee4e692ad03065ce0e0df1a9cfda39 | |
parent | 8bf1da7b5de3ef7c80c239dedebfc80259d610ce (diff) | |
download | dotfiles-42c9826d409c7515aea34af309bb3005dc696163.tar.gz |
new Transient Mark mode halfway house
-rw-r--r-- | .emacs.d/init-spw.el | 26 |
1 files changed, 22 insertions, 4 deletions
diff --git a/.emacs.d/init-spw.el b/.emacs.d/init-spw.el index 51d96295..560f422a 100644 --- a/.emacs.d/init-spw.el +++ b/.emacs.d/init-spw.el @@ -176,6 +176,28 @@ add places the library might be available to `load-path'." (with-eval-after-load 'notmuch-show (define-key notmuch-show-mode-map "\M-=" nil)) +(setq transient-mark-mode nil) +(defun spw/remap-mark-command (command) + "Remap a mark-* command to temporarily activate Transient Mark mode." + (let* ((cmd (symbol-name command)) + (fun (intern (concat "spw/" cmd))) + (doc (concat "Call `" + cmd + "' and temporarily activate Transient Mark mode."))) + (fset fun `(lambda () + ,doc + (interactive) + (call-interactively ',command) + (activate-mark))) + (global-set-key (vector 'remap command) fun))) +(dolist (command '(mark-word + mark-sexp + mark-paragraph + mark-defun + mark-page + mark-whole-buffer)) + (spw/remap-mark-command command)) + ;;;; Packages @@ -1694,10 +1716,6 @@ Used in my `message-mode' yasnippets." ;; and a binding to do so manually (bind-key "C-x C-r" (lambda () (interactive) (revert-buffer nil t))) -;; mark settings -(setq transient-mark-mode t - set-mark-command-repeat-pop nil) - ;; recursive minibuffers (setq enable-recursive-minibuffers t) (minibuffer-depth-indicate-mode 1) |