GNU bug report logs -
#49980
28.0.50; [PATCH] Should we have project-save-buffers?
Previous Next
Reported by: Giap Tran <txgvnn <at> gmail.com>
Date: Tue, 10 Aug 2021 14:49:02 UTC
Severity: normal
Tags: fixed, patch
Fixed in version 28.0.50
Done: Juri Linkov <juri <at> linkov.net>
Bug is archived. No further changes may be made.
Full log
Message #57 received at 49980 <at> debbugs.gnu.org (full text, mbox):
> (save-some-buffers t 'save-some-buffers-root)
>
> So how does it work? save-some-buffers-root auto detects a git repo
> root via project-find-functions in project.el or something there? I
> havent followed entire call chain. I ask, because I guess this is going
> to be part of Emacs 28 but wonder if you have any plans to port it
> into older versions?
You can make it backward-compatible with older versions by copying
the contents of the function save-some-buffers-root literally
to your code. This call should work in older versions:
#+begin_src emacs-lisp
(save-some-buffers
t
(let ((root (or (and (project-current) (project-root (project-current)))
default-directory)))
(lambda () (file-in-directory-p default-directory root))))
#+end_src
> Could you guys care to take a look at my little branch switcher? If you
> have time. I could use some review and advice. It is ~200 sloc and most
> of it is helm boiler code, I am really interesting about opinion on
> stash/unstash strategy. I stash everything include untracked
> files. However I am thinking of implementing other strategy, via commit
> and undo commit.
Thanks, this is a useful package. It uses the right strategy
to stash and unstash changes. This is much better than committing
and undoing commits like we recently discussed in
https://lists.gnu.org/archive/html/emacs-devel/2021-08/msg00346.html
This bug report was last modified 3 years and 338 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.