GNU bug report logs - #41879
28.0.50; [Patch]: Add project-switch-to-buffer in project.el

Previous Next

Package: emacs;

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


View this message in rfc822 format

From: "Basil L. Contovounesios" <contovob <at> tcd.ie>
To: Theodor Thornhill <theo <at> thornhill.no>
Cc: 41879 <at> debbugs.gnu.org, "Philip K." <philip <at> warpmail.net>, Dmitry Gutov <dgutov <at> yandex.ru>
Subject: bug#41879: 28.0.50; [Patch]: Add project-switch-to-buffer in project.el
Date: Tue, 16 Jun 2020 19:19:41 +0100
Theodor Thornhill <theo <at> thornhill.no> writes:

> +;;;###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
> +      (lambda (buffer)
> +        ;; buffer is a alist of ("filename" . #<buffer filename>)

That's not right: BUFFER is a flat cons cell, not an alist.  Please also
start sentences with a capital letter and end them with a full stop.
I'd write something like this:

  ;; BUFFER is an entry (BUF-NAME . BUF-OBJ) of Vbuffer_alist.

> +        (when-let ((file (buffer-file-name (cdr buffer))))
> +          (file-in-directory-p file root)))))))

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.