[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/ivy-hydra 8277a70 197/395: ivy.el (ivy-switch-buffer-tr
From: |
Basil L. Contovounesios |
Subject: |
[elpa] externals/ivy-hydra 8277a70 197/395: ivy.el (ivy-switch-buffer-transformer): Simplify |
Date: |
Thu, 25 Feb 2021 08:32:01 -0500 (EST) |
branch: externals/ivy-hydra
commit 8277a70850a854ee4bd2b265ab13fa13bfb023cd
Author: Oleh Krehel <ohwoeowho@gmail.com>
Commit: Oleh Krehel <ohwoeowho@gmail.com>
ivy.el (ivy-switch-buffer-transformer): Simplify
---
ivy.el | 20 +++++++++-----------
1 file changed, 9 insertions(+), 11 deletions(-)
diff --git a/ivy.el b/ivy.el
index bd7a294..75d642a 100644
--- a/ivy.el
+++ b/ivy.el
@@ -4563,27 +4563,25 @@ Skip buffers that match `ivy-ignore-buffers'."
(defun ivy-append-face (str face)
"Append to STR the property FACE."
- (setq str (copy-sequence str))
- (ivy-add-face-text-property 0 (length str) face str t)
+ (when face
+ (setq str (copy-sequence str))
+ (ivy-add-face-text-property 0 (length str) face str t))
str)
(defun ivy-switch-buffer-transformer (str)
"Transform candidate STR when switching buffers."
- (let* ((b (get-buffer str))
- (dir (buffer-local-value 'default-directory b))
- (mode (buffer-local-value 'major-mode b)))
+ (let* ((buf (get-buffer str))
+ (dir (buffer-local-value 'default-directory buf))
+ (mode (buffer-local-value 'major-mode buf)))
(cond
((and dir (ignore-errors (file-remote-p dir)))
(ivy-append-face str 'ivy-remote))
- ((not (verify-visited-file-modtime b))
+ ((not (verify-visited-file-modtime buf))
(ivy-append-face str 'ivy-modified-outside-buffer))
- ((buffer-modified-p b)
+ ((buffer-modified-p buf)
(ivy-append-face str 'ivy-modified-buffer))
(t
- (let ((face (cdr (assq mode ivy-switch-buffer-faces-alist))))
- (if face
- (ivy-append-face str face)
- str))))))
+ (ivy-append-face str (cdr (assq mode
ivy-switch-buffer-faces-alist)))))))
(defun ivy-switch-buffer-occur (cands)
"Occur function for `ivy-switch-buffer' using `ibuffer'.
- [elpa] externals/ivy-hydra 1c1573e 167/395: ivy.el (ivy--update-prompt): Handle auto-insert.el, (continued)
- [elpa] externals/ivy-hydra 1c1573e 167/395: ivy.el (ivy--update-prompt): Handle auto-insert.el, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra 45a3609 176/395: counsel.el (counsel-rg-base-command): Add "-M 120" by default, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra 0258725 175/395: counsel.el: Fix candidate splitting when eol is CR or CRLF, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra 8fae568 184/395: counsel.el (counsel-org-link): Add, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra 9b36d9c 186/395: swiper.el (swiper-isearch): Use ivy-init-fns-alist, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra 9e1513f 195/395: ivy.el (ivy--split): Don't split consecutive group brackets, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra 7b9b3cc 200/395: ivy.el (ivy--switch-buffer-matcher): Complete remote dirs via ":", Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra 829cf8a 212/395: ivy.el (ivy--done): Set ivy-text, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra 95896df 221/395: Honour sentence-end-double-space in recent change, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra c0a960b 216/395: ivy.el (ivy-read): Don't error on "Selecting deleted buffer", Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra 8277a70 197/395: ivy.el (ivy-switch-buffer-transformer): Simplify,
Basil L. Contovounesios <=
- [elpa] externals/ivy-hydra df41a6d 220/395: counsel.el (counsel-rg-base-command): Double the default max columns, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra 51430ff 233/395: counsel.el: Fix candidate splitting when eol is CR or CRLF, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra 04ca164 275/395: ivy-resume: resume buffer for counsel-grep, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra 7dd6bfc 287/395: ivy.el (ivy-read): Document :extra-props as a plist, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra 3e281d0 315/395: ivy-test.el (counsel-find-file-single-match-directories): Add test, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra d3e14db 303/395: ivy.el (ivy--call-marked): Fix :multi-action with alist collection, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra 031ed58 331/395: ivy.el (ivy-call): Remove redundant cond branch, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra 453f510 306/395: * ivy-test.el (ivy-avy): Fix skip condition., Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra 1bf7f91 018/395: counsel.el (counsel--preselect-file): Do not pre-select URL., Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra 256deea 019/395: swiper.el (swiper--isearch-format): Prepend swiper-line-face property, Basil L. Contovounesios, 2021/02/25