branch: externals/gtags-mode commit 3c685185625e03343c995974ee1d026c9ef808c4 Author: Jimmy Aguilar Mena <kratsbinov...@gmail.com> Commit: Jimmy Aguilar Mena <kratsbinov...@gmail.com>
Remove nil buffers from project-buffers The output form project-buffers is not intended to have nil entries; but mapcar keeps the conditions evaluated as nil, so it requires to filter them. --- gtags-mode.el | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/gtags-mode.el b/gtags-mode.el index 5c446e8968..abed23ec16 100644 --- a/gtags-mode.el +++ b/gtags-mode.el @@ -5,7 +5,7 @@ ;; Author: Jimmy Aguilar Mena ;; URL: https://github.com/Ergus/gtags-mode ;; Keywords: xref, project, imenu, gtags, global -;; Version: 1.1 +;; Version: 1.2 ;; Package-Requires: ((emacs "28")) ;; This program is free software: you can redistribute it and/or modify @@ -328,14 +328,15 @@ Return as a list of xref location objects." (cl-defmethod project-buffers ((project (head :gtagsroot))) "Return the list of all live buffers that belong to PROJECT." - (mapcar (lambda (buff) - (cond - ((eq (buffer-local-value 'gtags-mode--plist buff) project) buff) - ((local-variable-p 'gtags-mode--plist buff) nil) - (t (with-current-buffer buff - (when (eq (gtags-mode--local-plist) project) - (current-buffer)))))) - (buffer-list))) + (delq nil + (mapcar (lambda (buff) + (cond + ((eq (buffer-local-value 'gtags-mode--plist buff) project) buff) + ((local-variable-p 'gtags-mode--plist buff) nil) + (t (with-current-buffer buff + (when (eq (gtags-mode--local-plist) project) + (current-buffer)))))) + (buffer-list)))) ;; Completion-at-point-function (capf) =============================== (defun gtags-mode-completion-function ()