[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] master b8dfc7b 4/4: Completely ignore buffers with no name
From: |
Lars Ingebrigtsen |
Subject: |
[Emacs-diffs] master b8dfc7b 4/4: Completely ignore buffers with no name when copying file names |
Date: |
Tue, 23 Feb 2016 09:13:28 +0000 |
branch: master
commit b8dfc7beeb49d3fe673966f630126a38397e8d78
Author: Tino Calancha <address@hidden>
Commit: Lars Ingebrigtsen <address@hidden>
Completely ignore buffers with no name when copying file names
* lisp/ibuf-ext.el (ibuffer-copy-filename-as-kill): Completely
ignore buffers with no file name. (bug#21577).
---
lisp/ibuf-ext.el | 31 +++++++++++++++++--------------
1 files changed, 17 insertions(+), 14 deletions(-)
diff --git a/lisp/ibuf-ext.el b/lisp/ibuf-ext.el
index 1d61825..aa3ccbd 100644
--- a/lisp/ibuf-ext.el
+++ b/lisp/ibuf-ext.el
@@ -1412,20 +1412,23 @@ You can then feed the file name(s) to other commands
with \\[yank]."
(ibuffer-map-marked-lines
#'(lambda (buf _mark)
(setq ibuffer-copy-filename-as-kill-result
- (concat ibuffer-copy-filename-as-kill-result
- (let ((name (buffer-file-name buf)))
- (if name
- (pcase type
- (`full
- name)
- (`relative
- (file-relative-name
- name (or ibuffer-default-directory
- default-directory)))
- (_
- (file-name-nondirectory name)))
- ""))
- " "))))
+ (concat ibuffer-copy-filename-as-kill-result
+ (let ((name (buffer-file-name buf)))
+ (cond (name
+ (concat
+ (pcase type
+ (`full
+ name)
+ (`relative
+ (file-relative-name
+ name (or ibuffer-default-directory
+ default-directory)))
+ (_
+ (file-name-nondirectory name))) " "))
+ (t "")))))))
+ (when (not (zerop (length ibuffer-copy-filename-as-kill-result)))
+ (setq ibuffer-copy-filename-as-kill-result
+ (substring ibuffer-copy-filename-as-kill-result 0 -1)))
(kill-new ibuffer-copy-filename-as-kill-result))))
(defun ibuffer-mark-on-buffer (func &optional ibuffer-mark-on-buffer-mark
group)