emacs-elpa-diffs
[Top][All Lists]
Advanced

[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)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]