From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#49980: 28.0.50; [PATCH] Should we have project-save-buffers? Date: Fri, 13 Aug 2021 19:05:58 +0300 Organization: LINKOV.NET Message-ID: <87h7ftba8p.fsf@mail.linkov.net> References: <87czqlodpl.fsf@gmail.com> <871r70lnyi.fsf@mail.linkov.net> <87y297azuu.fsf@mail.linkov.net> <3ea58870-6b9a-41b9-c06e-d045ff9764b9@yandex.ru> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="4225"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (x86_64-pc-linux-gnu) Cc: Giap Tran , 49980@debbugs.gnu.org, Dmitry Gutov To: Arthur Miller Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Aug 13 18:12:23 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mEZnD-0000rh-CP for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 13 Aug 2021 18:12:23 +0200 Original-Received: from localhost ([::1]:38080 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mEZnC-0006Jh-1q for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 13 Aug 2021 12:12:22 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:52130) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mEZms-0005yS-LF for bug-gnu-emacs@gnu.org; Fri, 13 Aug 2021 12:12:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:59670) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mEZms-0007W0-Eg for bug-gnu-emacs@gnu.org; Fri, 13 Aug 2021 12:12:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mEZms-0006ij-A3 for bug-gnu-emacs@gnu.org; Fri, 13 Aug 2021 12:12:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 13 Aug 2021 16:12:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 49980 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch fixed Original-Received: via spool by 49980-submit@debbugs.gnu.org id=B49980.162887108725766 (code B ref 49980); Fri, 13 Aug 2021 16:12:02 +0000 Original-Received: (at 49980) by debbugs.gnu.org; 13 Aug 2021 16:11:27 +0000 Original-Received: from localhost ([127.0.0.1]:42979 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mEZmJ-0006hW-5i for submit@debbugs.gnu.org; Fri, 13 Aug 2021 12:11:27 -0400 Original-Received: from relay7-d.mail.gandi.net ([217.70.183.200]:47783) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mEZmG-0006hB-Qy for 49980@debbugs.gnu.org; Fri, 13 Aug 2021 12:11:25 -0400 Original-Received: (Authenticated sender: juri@linkov.net) by relay7-d.mail.gandi.net (Postfix) with ESMTPSA id 0496120005; Fri, 13 Aug 2021 16:11:16 +0000 (UTC) In-Reply-To: (Arthur Miller's message of "Fri, 13 Aug 2021 11:39:32 +0200") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:211781 Archived-At: > I am sorry I am bit late to the party, but I would like to have a > command to save all modified buffers belonging to a project directory. I > am just about to code something like this for myself and a small project > of mine, so I would be happy if you can point me into something that > exists. > > I have coded a little branch switcher with helm. The purpose it so be > able to fast switch branch, say you are working on some bigger feature, > and than wish for some reason to switch to some other branch and then > comeback and continue on the previous one. The workflow is to simply > stash everything on change, and apply stash when branch is checked out > again. I have it working, minus the part to save all buffers belonging > to a project which is root directory wtih .git in my case. > > I don't know if that fits into your purpose or something, nor do I think > it is hard to code, but I always prefer if I can skip duplicating code > and per-use soemthing. Now it's possible just to type 'C-x s' after customizing 'save-some-buffers-default-predicate' to 'save-some-buffers-root', or after setting this value in project's .dir-locals.el. If you want to use this new feature programmatically, then just call: (save-some-buffers t 'save-some-buffers-root)