[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/crux dd3f0e5 089/112: Add function crux-kill-and-join-forw
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/crux dd3f0e5 089/112: Add function crux-kill-and-join-forward |
Date: |
Wed, 11 Aug 2021 09:58:00 -0400 (EDT) |
branch: elpa/crux
commit dd3f0e5da00bc1b934d8d3992f588412c0e8e06f
Author: thdox <thdox@free.fr>
Commit: Bozhidar Batsov <bozhidar.batsov@gmail.com>
Add function crux-kill-and-join-forward
This is complementary to crux-kill-line-backwards, but moving forward,
and when called at end of line, it will join.
---
README.md | 1 +
crux.el | 10 ++++++++++
2 files changed, 11 insertions(+)
diff --git a/README.md b/README.md
index 146962a..64427e4 100644
--- a/README.md
+++ b/README.md
@@ -66,6 +66,7 @@ Command |
Suggested Keybinding(s)
`crux-top-join-line` | <kbd>Super-j</kbd> or
<kbd>C-^</kbd> | Join lines
`crux-kill-whole-line` | <kbd>Super-k</kbd> |
Kill whole line
`crux-kill-line-backwards` | <kbd>C-Backspace</kbd> |
Kill line backwards
+`crux-kill-and-join-forward` | <kbd>C-S-Backspace</kbd>
or <kbd>C-k</kbd> | If at end of line, join with following; otherwise kill line.
`crux-ispell-word-then-abbrev` | <kbd>C-c i</kbd> | Fix
word using `ispell` and then save to `abbrev`.
`crux-upcase-region` | <kbd>C-x C-u</kbd> |
`upcase-region` when `transient-mark-mode` is on and region is active.
`crux-downcase-region` | <kbd>C-x C-l</kbd> |
`downcase-region` when `transient-mark-mode` is on and region is active.
diff --git a/crux.el b/crux.el
index d0a5931..fdf6bef 100644
--- a/crux.el
+++ b/crux.el
@@ -294,6 +294,16 @@ Passes ARG to command `kill-whole-line' when provided."
(kill-line 0)
(indent-according-to-mode))
+;;;###autoload
+(defun crux-kill-and-join-forward (&optional arg)
+ "If at end of line, join with following; otherwise kill line.
+Passes ARG to command `kill-line' when provided.
+Deletes whitespace at join."
+ (interactive "P")
+ (if (and (eolp) (not (bolp)))
+ (delete-indentation 1)
+ (kill-line arg)))
+
(defun move-to-mode-line-start ()
"Move to the beginning, skipping mode specific line start regex."
(interactive)
- [nongnu] elpa/crux d989f2a 110/112: Bump copyright years, (continued)
- [nongnu] elpa/crux d989f2a 110/112: Bump copyright years, ELPA Syncer, 2021/08/11
- [nongnu] elpa/crux e0457f6 103/112: Fix a major mode check, ELPA Syncer, 2021/08/11
- [nongnu] elpa/crux e3e16c1 066/112: Add a missing space, ELPA Syncer, 2021/08/11
- [nongnu] elpa/crux fa064d7 068/112: Remove a bunch of redundant progn usages, ELPA Syncer, 2021/08/11
- [nongnu] elpa/crux 3e07035 073/112: Add missing autoloads, ELPA Syncer, 2021/08/11
- [nongnu] elpa/crux 7365fdc 075/112: Add crux-copy-file-preserve-attribute, ELPA Syncer, 2021/08/11
- [nongnu] elpa/crux e67d040 078/112: Allow crux-sudo-edit on remote files, ELPA Syncer, 2021/08/11
- [nongnu] elpa/crux 2a1a39a 083/112: Add a few GitHub templates, ELPA Syncer, 2021/08/11
- [nongnu] elpa/crux 5ba2f3b 084/112: Add a changelog, ELPA Syncer, 2021/08/11
- [nongnu] elpa/crux c014640 086/112: Tweak some wording, ELPA Syncer, 2021/08/11
- [nongnu] elpa/crux dd3f0e5 089/112: Add function crux-kill-and-join-forward,
ELPA Syncer <=
- [nongnu] elpa/crux 23ffa81 092/112: Touch up the previous commit, ELPA Syncer, 2021/08/11
- [nongnu] elpa/crux 519629b 094/112: Update the changelog, ELPA Syncer, 2021/08/11
- [nongnu] elpa/crux 273390e 101/112: Read file name insead of raw string, ELPA Syncer, 2021/08/11
- [nongnu] elpa/crux a471cbe 102/112: Add crux-recentf-find-directory, ELPA Syncer, 2021/08/11
- [nongnu] elpa/crux 6bfd212 112/112: Update my e-mail, ELPA Syncer, 2021/08/11
- [nongnu] elpa/crux ba4b05c 021/112: Support tcsh, fish and ksh for crux-find-shell-init-file, ELPA Syncer, 2021/08/11
- [nongnu] elpa/crux 785dfba 095/112: crux-smart-open-line-above: Use crux-move-to-mode-line-start, ELPA Syncer, 2021/08/11
- [nongnu] elpa/crux c3b6138 107/112: Fixed extra line issue when duplicating, ELPA Syncer, 2021/08/11
- [nongnu] elpa/crux 6c02dab 071/112: Fold a few long lists, ELPA Syncer, 2021/08/11
- [nongnu] elpa/crux 9341c6b 072/112: Silence byte compiler, ELPA Syncer, 2021/08/11