[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/crux 139eb6f 096/112: Add crux-kill-buffer-truename
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/crux 139eb6f 096/112: Add crux-kill-buffer-truename |
Date: |
Wed, 11 Aug 2021 09:58:01 -0400 (EDT) |
branch: elpa/crux
commit 139eb6f1504b6885c86c658fd33c6d59bfac0a8c
Author: Martin Polden <mpolden@mpolden.no>
Commit: Bozhidar Batsov <bozhidar.batsov@gmail.com>
Add crux-kill-buffer-truename
Make it easy to kill the path of file visited in the current buffer.
---
CHANGELOG.md | 1 +
README.md | 1 +
crux.el | 10 ++++++++++
3 files changed, 12 insertions(+)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 8d5b16c..4b7604e 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -5,6 +5,7 @@
### New features
* [#65](https://github.com/bbatsov/crux/pull/65): Add a configuration option
to move using visual lines in `crux-move-to-mode-line-start`.
+* [#72](https://github.com/bbatsov/crux/pull/72): Add
`crux-kill-buffer-truename`. Kills path of file visited by current buffer.
### Bugs fixed
diff --git a/README.md b/README.md
index 64427e4..103c5f7 100644
--- a/README.md
+++ b/README.md
@@ -67,6 +67,7 @@ Command |
Suggested Keybinding(s)
`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-kill-buffer-truename ` | <kbd>C-c P</kbd> | Kill
absolute path of file visited in current buffer.
`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 eaf3a56..1603d5a 100644
--- a/crux.el
+++ b/crux.el
@@ -661,6 +661,16 @@ Doesn't mess with special buffers."
(delete (current-buffer) (seq-filter #'buffer-file-name (buffer-list))))))
;;;###autoload
+(defun crux-kill-buffer-truename ()
+ "Kill absolute path of file visited in current buffer."
+ (interactive)
+ (if buffer-file-name
+ (let ((truename (file-truename buffer-file-name)))
+ (kill-new truename)
+ (message "Added %s to kill ring." truename))
+ (message "Buffer is not visiting a file.")))
+
+;;;###autoload
(defun crux-create-scratch-buffer ()
"Create a new scratch buffer."
(interactive)
- [nongnu] elpa/crux 273390e 101/112: Read file name insead of raw string, (continued)
- [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
- [nongnu] elpa/crux 5395c06 076/112: New function: crux-find-user-custom-file, ELPA Syncer, 2021/08/11
- [nongnu] elpa/crux 7569d26 085/112: Bump the copyright years, ELPA Syncer, 2021/08/11
- [nongnu] elpa/crux 139eb6f 096/112: Add crux-kill-buffer-truename,
ELPA Syncer <=
- [nongnu] elpa/crux fb648f0 099/112: Add missing autoload, ELPA Syncer, 2021/08/11
- [nongnu] elpa/crux 95f5040 106/112: Update crux-transpose-window with other-window, ELPA Syncer, 2021/08/11
- [nongnu] elpa/crux 3445e7e 109/112: Release 0.4.0, ELPA Syncer, 2021/08/11
- [nongnu] elpa/crux 20c0784 104/112: Add support for org-mode links to crux-view-url, ELPA Syncer, 2021/08/11
- [nongnu] elpa/crux 4ce9c4b 070/112: Fix a couple of docstrings, ELPA Syncer, 2021/08/11
- [nongnu] elpa/crux 6958cb5 108/112: Update the changelog, ELPA Syncer, 2021/08/11
- [nongnu] elpa/crux e561eb4 111/112: Update the sponsorship methods, ELPA Syncer, 2021/08/11