GNU bug report logs -
#41879
28.0.50; [Patch]: Add project-switch-to-buffer in project.el
Previous Next
Reported by: Theodor Thornhill <theo <at> thornhill.no>
Date: Mon, 15 Jun 2020 17:52:01 UTC
Severity: normal
Tags: patch
Found in version 28.0.50
Done: Dmitry Gutov <dgutov <at> yandex.ru>
Bug is archived. No further changes may be made.
Full log
Message #35 received at 41879 <at> debbugs.gnu.org (full text, mbox):
Theodor Thornhill <theo <at> thornhill.no> writes:
> diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el
> index 218058b195..a61b29abe6 100644
> --- a/lisp/progmodes/project.el
> +++ b/lisp/progmodes/project.el
> @@ -753,6 +753,18 @@ project-compile
> (default-directory (project-root pr)))
> (compile command comint)))
>
> +;;;###autoload
> +(defun project-switch-to-buffer ()
> + "Switch to a buffer in the current project."
> + (interactive)
> + (let ((root (project-root (project-current t))))
> + (switch-to-buffer
> + (read-buffer
> + "Switch-to-buffer: " nil t
Nit: For consistency with switch-to-buffer,
this should be "Switch to buffer: " without the hyphens.
> + (lambda (buffer)
> + (when-let ((file (buffer-file-name (cdr buffer))))
Nit: Neither the manual nor read-buffer's docstring documents what
(cdr buffer) is here, so a comment mentioning Vbuffer_alist or something
along those lines would be nice.
> + (file-in-directory-p file root)))))))
> +
Otherwise LGTM, thanks,
--
Basil
This bug report was last modified 4 years and 333 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.