diff options
| author | Tino Calancha | 2016-02-23 20:12:59 +1100 |
|---|---|---|
| committer | Lars Ingebrigtsen | 2016-02-23 20:12:59 +1100 |
| commit | b8dfc7beeb49d3fe673966f630126a38397e8d78 (patch) | |
| tree | 284b19319f51b5487c201afe8b59f260300d3666 | |
| parent | ed91405a07f694b0061ff5ebf9972a726cb1cb6e (diff) | |
| download | emacs-b8dfc7beeb49d3fe673966f630126a38397e8d78.tar.gz emacs-b8dfc7beeb49d3fe673966f630126a38397e8d78.zip | |
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).
| -rw-r--r-- | 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 1d6182596ed..aa3ccbd40f7 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]." | |||
| 1412 | (ibuffer-map-marked-lines | 1412 | (ibuffer-map-marked-lines |
| 1413 | #'(lambda (buf _mark) | 1413 | #'(lambda (buf _mark) |
| 1414 | (setq ibuffer-copy-filename-as-kill-result | 1414 | (setq ibuffer-copy-filename-as-kill-result |
| 1415 | (concat ibuffer-copy-filename-as-kill-result | 1415 | (concat ibuffer-copy-filename-as-kill-result |
| 1416 | (let ((name (buffer-file-name buf))) | 1416 | (let ((name (buffer-file-name buf))) |
| 1417 | (if name | 1417 | (cond (name |
| 1418 | (pcase type | 1418 | (concat |
| 1419 | (`full | 1419 | (pcase type |
| 1420 | name) | 1420 | (`full |
| 1421 | (`relative | 1421 | name) |
| 1422 | (file-relative-name | 1422 | (`relative |
| 1423 | name (or ibuffer-default-directory | 1423 | (file-relative-name |
| 1424 | default-directory))) | 1424 | name (or ibuffer-default-directory |
| 1425 | (_ | 1425 | default-directory))) |
| 1426 | (file-name-nondirectory name))) | 1426 | (_ |
| 1427 | "")) | 1427 | (file-name-nondirectory name))) " ")) |
| 1428 | " ")))) | 1428 | (t ""))))))) |
| 1429 | (when (not (zerop (length ibuffer-copy-filename-as-kill-result))) | ||
| 1430 | (setq ibuffer-copy-filename-as-kill-result | ||
| 1431 | (substring ibuffer-copy-filename-as-kill-result 0 -1))) | ||
| 1429 | (kill-new ibuffer-copy-filename-as-kill-result)))) | 1432 | (kill-new ibuffer-copy-filename-as-kill-result)))) |
| 1430 | 1433 | ||
| 1431 | (defun ibuffer-mark-on-buffer (func &optional ibuffer-mark-on-buffer-mark group) | 1434 | (defun ibuffer-mark-on-buffer (func &optional ibuffer-mark-on-buffer-mark group) |