summaryrefslogtreecommitdiff
path: root/.emacs.d
diff options
context:
space:
mode:
authorSean Whitton <spwhitton@spwhitton.name>2020-05-29 08:22:45 -0700
committerSean Whitton <spwhitton@spwhitton.name>2020-05-31 18:49:40 -0700
commitfe74a6ad363fddf3c6f66dbbe52d75db02dbdc56 (patch)
tree65121cec52c943f177e70f1a527cff7e72e2e737 /.emacs.d
parent025e0fea4a34e3af4cc0d5dcadd732268d8dd740 (diff)
downloaddotfiles-fe74a6ad363fddf3c6f66dbbe52d75db02dbdc56.tar.gz
simplify by moving tab-to-tab-stop to M-I
Diffstat (limited to '.emacs.d')
-rw-r--r--.emacs.d/init-spw.el21
1 files changed, 10 insertions, 11 deletions
diff --git a/.emacs.d/init-spw.el b/.emacs.d/init-spw.el
index 9b62cd28..50d1cd83 100644
--- a/.emacs.d/init-spw.el
+++ b/.emacs.d/init-spw.el
@@ -153,9 +153,12 @@ add places the library might be available to `load-path'."
;; (setq save-place-forget-unreadable-files nil)
(save-place-mode 1))
-;; possible enhancement: M-i goes into a transient mode where C-n and
-;; C-p are like 'j' and 'k' in vim's mode accessed with 'V' (I think
-;; "visual line mode")
+;; This is an alternative way to activate the mark temporarily when
+;; `transient-mark-mode' is off, and whether it's on or off, makes it
+;; easier to operate on adjacent whole lines where the set of lines is
+;; not surrounded by blank lines such that `mark-paragraph' can be
+;; used. A possible enhancement would be to enter a transient mode in
+;; which C-n and C-p can select additional whole lines.
(defun spw/expand-region-to-whole-lines-and-activate ()
(interactive)
(when (> (point) (mark))
@@ -163,14 +166,10 @@ add places the library might be available to `load-path'."
(beginning-of-line)
(set-mark (save-excursion (goto-char (mark)) (beginning-of-line 2) (point)))
(activate-mark transient-mark-mode))
-(defun spw/meta-i (arg)
- (interactive "P")
- (call-interactively
- (if (or (region-active-p) arg)
- 'spw/expand-region-to-whole-lines-and-activate
- 'tab-to-tab-stop)))
-(global-set-key "\M-i" 'spw/meta-i)
-(global-set-key "\M-I" 'spw/expand-region-to-whole-lines-and-activate)
+(global-set-key "\M-i" 'spw/expand-region-to-whole-lines-and-activate)
+
+;; resettle the previous occupant of M-i
+(global-set-key "\M-I" 'tab-to-tab-stop)
;;;; Packages