Only kill-region and kill-ring-save act on the whole line.

This commit is contained in:
tastytea 2019-03-21 02:17:26 +01:00
parent 5988e3c59b
commit bfaba9a4af
2 changed files with 15 additions and 11 deletions

24
init.el
View File

@ -87,16 +87,20 @@
(setq user-login-name "tastytea"
user-mail-address "tastytea@tastytea.de")
;; Region commands act on the current line if no text is visually selected
;; kill-region (cut) and kill-ring-save (copy) act on the current line if no
;; text is visually selected
;; https://www.emacswiki.org/emacs/WholeLineOrRegion
(do-all-symbols (symbol)
(when (and (commandp symbol t)
(string-match-p "-region$\\|kill-ring-save" (symbol-name symbol)))
(put symbol 'interactive-form
'(interactive
(if (use-region-p)
(list (region-beginning) (region-end))
(list (line-beginning-position) (line-beginning-position 2)))))))
(put 'kill-ring-save 'interactive-form
'(interactive
(if (use-region-p)
(list (region-beginning) (region-end))
(list (line-beginning-position) (line-beginning-position 2)))))
(put 'kill-region 'interactive-form
'(interactive
(if (use-region-p)
(list (region-beginning) (region-end))
(list (line-beginning-position) (line-beginning-position 2)))))
;; Banish customizations to another file
(setq custom-file (concat user-emacs-directory "custom.el"))
@ -108,7 +112,7 @@
;; https://www.emacswiki.org/emacs/CleanBufferList
(use-package midnight
:config
(setq midnight-period (* 2 60 60) ; Clean every 2 hours
(setq midnight-period (* 1 60 60) ; Clean every 1 hours
clean-buffer-list-delay-general 1 ; Clean normal bufs after 1d
clean-buffer-list-delay-special (* 30 60) ; Clean special bufs after 30m
clean-buffer-list-kill-regexps ; Add these to special buffers

View File

@ -1,2 +1,2 @@
127.0.0.1:51313 6478
127.0.0.1:51313 12458
phahw2ohVoh0oopheish7IVie9desh8aequeenei3uo8wahShe%thuadaeNa4ieh