bug-gnu-emacs
[Top][All Lists]
Advanced

[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 19:19:41 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

Theodor Thornhill <theo@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





reply via email to

[Prev in Thread] Current Thread [Next in Thread]