[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#41879: 28.0.50; [Patch]: Add project-switch-to-buffer in project.el
From: |
Basil L. Contovounesios |
Subject: |
bug#41879: 28.0.50; [Patch]: Add project-switch-to-buffer in project.el |
Date: |
Tue, 16 Jun 2020 11:26:04 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) |
Theodor Thornhill <theo@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
- bug#41879: 28.0.50; [Patch]: Add project-switch-to-buffer in project.el, Theodor Thornhill, 2020/06/15
- bug#41879: 28.0.50; [Patch]: Add project-switch-to-buffer in project.el, Philip K., 2020/06/15
- bug#41879: 28.0.50; [Patch]: Add project-switch-to-buffer in project.el, Dmitry Gutov, 2020/06/15
- bug#41879: 28.0.50; [Patch]: Add project-switch-to-buffer in project.el, Theodor Thornhill, 2020/06/15
- bug#41879: 28.0.50; [Patch]: Add project-switch-to-buffer in project.el, Dmitry Gutov, 2020/06/15
- bug#41879: 28.0.50; [Patch]: Add project-switch-to-buffer in project.el, Theodor Thornhill, 2020/06/16
- bug#41879: 28.0.50; [Patch]: Add project-switch-to-buffer in project.el, Philip K., 2020/06/16
- bug#41879: 28.0.50; [Patch]: Add project-switch-to-buffer in project.el, Theodor Thornhill, 2020/06/16
- bug#41879: 28.0.50; [Patch]: Add project-switch-to-buffer in project.el,
Basil L. Contovounesios <=
- bug#41879: 28.0.50; [Patch]: Add project-switch-to-buffer in project.el, Theodor Thornhill, 2020/06/16
- bug#41879: 28.0.50; [Patch]: Add project-switch-to-buffer in project.el, Basil L. Contovounesios, 2020/06/16
- bug#41879: 28.0.50; [Patch]: Add project-switch-to-buffer in project.el, Theodor Thornhill, 2020/06/16
- bug#41879: 28.0.50; [Patch]: Add project-switch-to-buffer in project.el, Basil L. Contovounesios, 2020/06/16
- bug#41879: 28.0.50; [Patch]: Add project-switch-to-buffer in project.el, Theodor Thornhill, 2020/06/16
- bug#41879: 28.0.50; [Patch]: Add project-switch-to-buffer in project.el, Basil L. Contovounesios, 2020/06/16
- bug#41879: 28.0.50; [Patch]: Add project-switch-to-buffer in project.el, Dmitry Gutov, 2020/06/16
- bug#41879: 28.0.50; [Patch]: Add project-switch-to-buffer in project.el, Dmitry Gutov, 2020/06/17
- bug#41879: 28.0.50; [Patch]: Add project-switch-to-buffer in project.el, Dmitry Gutov, 2020/06/16
- bug#41879: 28.0.50; [Patch]: Add project-switch-to-buffer in project.el, Basil L. Contovounesios, 2020/06/16