GNU bug report logs - #78099
[PATCH] Make 'project-remember-project' interactive

Previous Next

Package: emacs;

Reported by: Elijah Gabe Pérez <eg642616 <at> gmail.com>

Date: Sun, 27 Apr 2025 20:19:02 UTC

Severity: normal

Tags: patch

Fixed in version 31.1

Done: Dmitry Gutov <dmitry <at> gutov.dev>

Full log


View this message in rfc822 format

From: Juri Linkov <juri <at> linkov.net>
To: Elijah Gabe Pérez <eg642616 <at> gmail.com>
Cc: Dmitry Gutov <dmitry <at> gutov.dev>, 78099 <at> debbugs.gnu.org
Subject: bug#78099: [PATCH] Make 'project-remember-project' interactive
Date: Mon, 28 Apr 2025 18:03:34 +0300
> Sometimes when creating a new project it is not added to project list.
> AFAIK the only way to do it is using `project-remember-projects-under'
> or `project-switch-project' but they are uncomfortable to use when you
> just want to remember the current project you're in.
>
> So I decided to make `project-remember-project' interactive in this
> patch for archive this; this let to users use it in hooks (e.g
> find-file-hook)

For the same purpose I added an advice to functions like
'read-directory-name' and 'vc-dir' with the trick to
call 'project-current' that remembers a new project:

(define-advice vc-dir (:after (dir &optional _backend) add-project)
  (when (featurep 'project)
    ;; Add current vc project dir to project list
    (let ((default-directory dir))
      (project-current))))

But maybe `project-remember-project' would be more correct to use here.




This bug report was last modified 19 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.