karthink / project-x

Ehancements to Emacs' built in project library.
74 stars 5 forks source link

(void-function project--buffer-list) in Emacs Master branch #7

Closed johnhamelink closed 1 year ago

johnhamelink commented 1 year ago

Hi there,

I'm running Emacs from the master branch. It seems that as of commit d2f956807e87d1a4797a8686725912c780061a58 we cannot rely on project--buffer-list. See here for more context https://debbugs.gnu.org/cgi/bugreport.cgi?bug=59153. For now, I'm just adding the function to my config.el before (require 'project-x) in order to resolve this, but I just wanted to give a heads up.

(defun project--buffer-list (pr)
  "Return the list of all buffers in project PR."
  (let ((conn (file-remote-p (project-root pr)))
        bufs)
    (dolist (buf (buffer-list))
      ;; For now we go with the assumption that a project must reside
      ;; entirely on one host.  We might relax that in the future.
      (when (and (equal conn
                        (file-remote-p (buffer-local-value 'default-directory buf)))
                 (equal pr
                        (with-current-buffer buf
                          (project-current))))
        (push buf bufs)))
    (nreverse bufs)))
karthink commented 1 year ago

Fixed, thanks for the heads up. You can remove project--buffer-list from your config now.