From unknown Mon Aug 18 14:23:36 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#49980 <49980@debbugs.gnu.org> To: bug#49980 <49980@debbugs.gnu.org> Subject: Status: 28.0.50; [PATCH] Should we have project-save-buffers? Reply-To: bug#49980 <49980@debbugs.gnu.org> Date: Mon, 18 Aug 2025 21:23:36 +0000 retitle 49980 28.0.50; [PATCH] Should we have project-save-buffers? reassign 49980 emacs submitter 49980 Giap Tran severity 49980 normal tag 49980 patch fixed thanks From debbugs-submit-bounces@debbugs.gnu.org Tue Aug 10 10:48:25 2021 Received: (at submit) by debbugs.gnu.org; 10 Aug 2021 14:48:25 +0000 Received: from localhost ([127.0.0.1]:60282 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mDT3I-0004pK-0z for submit@debbugs.gnu.org; Tue, 10 Aug 2021 10:48:25 -0400 Received: from lists.gnu.org ([209.51.188.17]:52168) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mDNz5-0006em-Aj for submit@debbugs.gnu.org; Tue, 10 Aug 2021 05:23:46 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45356) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mDNz5-0003Qx-4Q for bug-gnu-emacs@gnu.org; Tue, 10 Aug 2021 05:23:43 -0400 Received: from mail-pj1-x102f.google.com ([2607:f8b0:4864:20::102f]:35567) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mDNz3-0001Jp-Pt for bug-gnu-emacs@gnu.org; Tue, 10 Aug 2021 05:23:42 -0400 Received: by mail-pj1-x102f.google.com with SMTP id s22-20020a17090a1c16b0290177caeba067so3504102pjs.0 for ; Tue, 10 Aug 2021 02:23:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:mime-version; bh=en51w4wWWe8I0BrAWhJSS7pJ34ZVNvYu3eAniQ6E37o=; b=gjo8I88muqGbxDBWjaIk+WWz4Wr5V3x4qkynO4HwGVkJcx6YAkJRK78zcSe5EIeAIl +60al3xt1LGSUwdK6l3FedNmIcFX+8Aa+pUjJ2xN3wLibx6F5s6YKfHo+6TFiiTEyZo0 LZWD/Nt8ofYePFDO6MhrQ8/YYihtd1Asrt17pH+1CQfjWSwvqU9YxGo1aH4PDLmEZfJa 04QU5JC4oUg3H4uXAu1sN1E2lruw5+nBGUZduXvRrOhR3VQcd4VbqhSel469nu6lYY4I bhzMVcp7QIgtGodG3qVTL9uZ9pMpYNKEO3OxHqAxonBdDrMPDmAtuzXs/Sf8wUieNG6u eDkQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:mime-version; bh=en51w4wWWe8I0BrAWhJSS7pJ34ZVNvYu3eAniQ6E37o=; b=bcSj+tRIMkLZGWA8DQ4zZtNzGwiDK11IRTcksYo4Ajf7ih6WtYTlHaD1DEwg3PlKpQ hyaOwa5XcSLCnPmgFpbAOeTmb3HdYqaw32UAfprA1CRFkPryrqM2v5mqheIicoDEiHvw Nr9DAVdfB6mBHwOSH7aJPD2azqzw/zyRgUsn+RGjnvaDX2uX/xNQM+BivcW3bcG1006w mqLm7hCByRQKJM6scn5aQ5c2FGL0bjvOMqBDTMYwGEtJuBjFMaT9AvqqBQFzeqYRPo3O 41/bAXwAjTFnTWnlYZhAHCi+k2r/l6p9T/8ozyyMcmwVfwmkq4gzHPlEirKMKq1VrmYZ serg== X-Gm-Message-State: AOAM532d7mUIKraovJVc0IjPrJrF1OtwQ+Fld25e1wE5J7aCfQIz9V7d W3YMoyYbuDii+QGqcNP9336xkKOMzWE= X-Google-Smtp-Source: ABdhPJy3Ek+CK/+jeXRvFUFDbhXhfMKmC9EEYz2gUI5zQjBDeGRPtcFV2xNvQSYfO69g6KM+6U/tpA== X-Received: by 2002:a17:90a:44:: with SMTP id 4mr29415003pjb.130.1628587419626; Tue, 10 Aug 2021 02:23:39 -0700 (PDT) Received: from X230 ([113.23.51.50]) by smtp.gmail.com with ESMTPSA id p21sm18977823pfo.8.2021.08.10.02.23.37 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Aug 2021 02:23:39 -0700 (PDT) From: Giap Tran To: bug-gnu-emacs@gnu.org Subject: 28.0.50; [PATCH] Should we have project-save-buffers? Date: Tue, 10 Aug 2021 16:23:34 +0700 Message-ID: <87czqlodpl.fsf@gmail.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Received-SPF: pass client-ip=2607:f8b0:4864:20::102f; envelope-from=txgvnn@gmail.com; helo=mail-pj1-x102f.google.com X-Spam_score_int: -10 X-Spam_score: -1.1 X-Spam_bar: - X-Spam_report: (-1.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, HK_RANDOM_ENVFROM=0.998, HK_RANDOM_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-Spam-Score: -0.3 (/) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Tue, 10 Aug 2021 10:48:22 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.3 (-) --=-=-= Content-Type: text/plain Hello, After using `project-query-replace-regexp to query and replace. I see we don't have the function to save all buffers in project. So after learning from projectile package. I have this patch, hope it is useful. Thanks --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=project-save-buffers.diff Content-Description: project-save-buffers diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el index 4620ea8f47..b257222e21 100644 --- a/lisp/progmodes/project.el +++ b/lisp/progmodes/project.el @@ -1395,5 +1395,22 @@ to directory DIR." (project-current-inhibit-prompt t)) (call-interactively command)))) +(defun project-save-buffers () + "Save all project buffers." + (interactive) + (let* ((project (project-current t)) + (buffers (project--buffer-list project)) + (modified-buffers (cl-remove-if-not (lambda (buf) + (and (buffer-file-name buf) + (buffer-modified-p buf))) + buffers))) + (if (null modified-buffers) + (message "No buffers need saving") + (dolist (buf modified-buffers) + (with-current-buffer buf + (save-buffer))) + (message "Saved %d buffers" (length modified-buffers))))) + + (provide 'project) ;;; project.el ends here --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Wed Aug 11 03:05:53 2021 Received: (at 49980) by debbugs.gnu.org; 11 Aug 2021 07:05:53 +0000 Received: from localhost ([127.0.0.1]:33104 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mDiJE-0000A3-R7 for submit@debbugs.gnu.org; Wed, 11 Aug 2021 03:05:52 -0400 Received: from relay4-d.mail.gandi.net ([217.70.183.196]:57843) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mDiJB-00009n-FR for 49980@debbugs.gnu.org; Wed, 11 Aug 2021 03:05:51 -0400 Received: (Authenticated sender: juri@linkov.net) by relay4-d.mail.gandi.net (Postfix) with ESMTPSA id 463A7E0007; Wed, 11 Aug 2021 07:05:41 +0000 (UTC) From: Juri Linkov To: Giap Tran Subject: Re: bug#49980: 28.0.50; [PATCH] Should we have project-save-buffers? Organization: LINKOV.NET References: <87czqlodpl.fsf@gmail.com> Date: Wed, 11 Aug 2021 09:52:45 +0300 In-Reply-To: <87czqlodpl.fsf@gmail.com> (Giap Tran's message of "Tue, 10 Aug 2021 16:23:34 +0700") Message-ID: <871r70lnyi.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 49980 Cc: 49980@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) > After using `project-query-replace-regexp to query and replace. > I see we don't have the function to save all buffers in project. > So after learning from projectile package. I have this patch, hope it is > useful. Thanks It would be nice to have a keybinding for this useful command, as there is 'C-x s', but 'C-x p s' is bound to 'project-shell'. Maybe then to bind it to 'C-x p S'? From debbugs-submit-bounces@debbugs.gnu.org Wed Aug 11 03:39:38 2021 Received: (at 49980) by debbugs.gnu.org; 11 Aug 2021 07:39:38 +0000 Received: from localhost ([127.0.0.1]:33233 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mDipt-0003Fk-Tm for submit@debbugs.gnu.org; Wed, 11 Aug 2021 03:39:38 -0400 Received: from mail-pj1-f47.google.com ([209.85.216.47]:41909) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mDipp-0003FJ-Q1 for 49980@debbugs.gnu.org; Wed, 11 Aug 2021 03:39:36 -0400 Received: by mail-pj1-f47.google.com with SMTP id fa24-20020a17090af0d8b0290178bfa69d97so3378954pjb.0 for <49980@debbugs.gnu.org>; Wed, 11 Aug 2021 00:39:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=enZLYZET5KeI+wfon9xURwkJoeaAX5D1AXP6QSUBglg=; b=owZIBzeVSlXvd8a/X6qY7gR7n03ICvx5GsR/QH3Rnc8mV6exG3o9giuI7WydiHBLkN raXw3VifIiC5bO3H+ASUyhImRE609+oTHc7LWc19V4hg+owjhnEQlClSrdftKMc/6S+n m/MWpsJnG2V5PxCn54VaKeA/0/sT4tT3VeqY00dvgPwNBY3kjKdxpOHDZUtj66NfmR2J 28PuJlVJwxg0mIbn0ICQSq0E9KkBdUp3YLiPk/dFuthOviVbDuXhyp5e4AjOjgCvNGRr WqeHETG7NIRo4YHX1Daa5YZVDvn/GmJSQsM1XAKSFeF2LCkTxaCSrfiIZdnXsUJqDL1Q okBw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=enZLYZET5KeI+wfon9xURwkJoeaAX5D1AXP6QSUBglg=; b=CswynZmRCwbzZZFhd0I/IdeVQQFZZg3lYHEtr6qyyp6VHfALPj/B2hA7uK2c2sGIa5 h0xrhj+ZOFf/yhQSJomTkQeY4XieE9njZaXl77euPhA7/0BAprwju9cwl35/v8NTQs8a Md6JNIhQg4rwsjirSTCJFDpv0aXfKnuerGZerFaBxnJc+pw1FGzrOl6vz6D0Hl4LKE3B dRK5N05Zrf1jMO+SLM9tfMHHHwBfHOLmtEfyhH/lQ3foeaS17tlGZDEXxLcSFckXhAiw 0C3mLRqTwAqJ+tBG9jglre6yRrnUOBsHF9ucXEAplouh21REnIRymjDXBdk8KYpk1TfD ZP4Q== X-Gm-Message-State: AOAM530x/lPYdzAokszB72gr4hbcqMDQmrDjWT2Goz7f5+H+kig6UTz9 Scg8cwH2LuultRyHj/ekV9YltbixGtg= X-Google-Smtp-Source: ABdhPJzGR9WvjyQ0pKsQ5pnFPQY5gKBdenPcOKDGG0NJsmm3idd1WeMdM0QIg6fEJYVuhF8pjRvDew== X-Received: by 2002:a17:90a:c305:: with SMTP id g5mr24897400pjt.79.1628667567440; Wed, 11 Aug 2021 00:39:27 -0700 (PDT) Received: from X230 ([113.23.51.118]) by smtp.gmail.com with ESMTPSA id x8sm25179827pjn.10.2021.08.11.00.39.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Aug 2021 00:39:26 -0700 (PDT) From: Giap Tran To: Juri Linkov Subject: Re: bug#49980: 28.0.50; [PATCH] Should we have project-save-buffers? References: <87czqlodpl.fsf@gmail.com> <871r70lnyi.fsf@mail.linkov.net> Date: Wed, 11 Aug 2021 14:38:51 +0700 In-Reply-To: <871r70lnyi.fsf@mail.linkov.net> (Juri Linkov's message of "Wed, 11 Aug 2021 09:52:45 +0300") Message-ID: <87zgtov3as.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: 49980 Cc: 49980@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) Juri Linkov writes: > Maybe then to bind it to 'C-x p S'? I'm totally agree with you. From debbugs-submit-bounces@debbugs.gnu.org Wed Aug 11 08:22:45 2021 Received: (at 49980) by debbugs.gnu.org; 11 Aug 2021 12:22:45 +0000 Received: from localhost ([127.0.0.1]:33751 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mDnFt-0002hM-L6 for submit@debbugs.gnu.org; Wed, 11 Aug 2021 08:22:45 -0400 Received: from mail-wr1-f47.google.com ([209.85.221.47]:41852) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mDnFs-0002h7-1N for 49980@debbugs.gnu.org; Wed, 11 Aug 2021 08:22:44 -0400 Received: by mail-wr1-f47.google.com with SMTP id c9so2755864wri.8 for <49980@debbugs.gnu.org>; Wed, 11 Aug 2021 05:22:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:to:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=yz+n4cPpwlKb4lfy9Ja9T4ROLFA0nh7/NoNgXwlzpl8=; b=e5pC+bA5rUS+PkUaV4iP0mouUagZf737TxT6xbgMwpQoXTC5NoF3itA+bjwrkqpmcB YQRICDX0t+rM5lb3YH4iKnWtcp3p8suvROuKjp+C5d4ZMy7RKNChEptuOFU9xVVMve9H IrbH6GoFERcw6p9SRkgIWCXBFsjS0DoV1SOCMm4CFE51OTnCQjpamBHZPfP/R2ZuYLNc 4PY/pgr5h0ywFb+Wc2EK0mZ566fRSKXPe0znjvfzohW7QVWqmtS5SKY+/GFChrNBTTHh nIPRvve9+cOolgkGL3peUB3GeyBuyg0j6NUIlvKw1R+r0byMusUHx01lHHLuQihFZlXD TxtQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:subject:to:references:from:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=yz+n4cPpwlKb4lfy9Ja9T4ROLFA0nh7/NoNgXwlzpl8=; b=IOEZoxBvupCZfH1CL684UwoYtq2w36ZW7JihrlhByN2Adb3dcR+pgNq4FdLyZK+Dmi wcy7zaGdY082dqaeWAzBqshOzdRWdq9oZwrhf3Jv2tBNL4oqYpHyLvWZHgVgsAGU3WhO QRYRvPSj2ulsFO+Lg8uQ7ELMencYC146P71KHLUdA0g/Iuo8uSwYilFHow2as5TBS8+8 /pTb0a9XTr2tnAOkUlSm3R0MUCfkLcFf0EZkhi7nX8QYyDEP+M5bFmMquOv26PF/OoJ1 UdSY2pHQrUTfr+ajGqDG1eNXW23iMIpe2hKH0n+4iF2kYC+4+rt5qizT51Eoxvi15IrL jMsg== X-Gm-Message-State: AOAM531boFntAy2WrzMDJpsnB4TXQsrkh2dD6byTCPoWMZuNrzYx6Z6h KaB7TrNLBx1AcqrqGeSsH/o0NnYGQdo= X-Google-Smtp-Source: ABdhPJxLs3+1QAt+ePdNXsJrvZOhWnXPrMS31j+BW6kvZvhFJjx+2NhIcdMiK45IULrOelLD/omVrw== X-Received: by 2002:a5d:5384:: with SMTP id d4mr36684075wrv.193.1628684558472; Wed, 11 Aug 2021 05:22:38 -0700 (PDT) Received: from [192.168.0.6] ([46.251.119.176]) by smtp.googlemail.com with ESMTPSA id n3sm23514040wmi.0.2021.08.11.05.22.37 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 11 Aug 2021 05:22:37 -0700 (PDT) Subject: Re: bug#49980: 28.0.50; [PATCH] Should we have project-save-buffers? To: Giap Tran , 49980@debbugs.gnu.org References: <87czqlodpl.fsf@gmail.com> From: Dmitry Gutov Message-ID: Date: Wed, 11 Aug 2021 15:22:35 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: <87czqlodpl.fsf@gmail.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Score: 0.4 (/) X-Debbugs-Envelope-To: 49980 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.6 (/) Hi! On 10.08.2021 12:23, Giap Tran wrote: > After using `project-query-replace-regexp to query and replace. I see we don't have the function to save all buffers in project. Is there any reason not to just use 'save-some-buffers' (C-x s)? Do you often want to leave some buffers unsaved? From debbugs-submit-bounces@debbugs.gnu.org Wed Aug 11 08:24:06 2021 Received: (at 49980) by debbugs.gnu.org; 11 Aug 2021 12:24:06 +0000 Received: from localhost ([127.0.0.1]:33756 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mDnHB-0002jz-UN for submit@debbugs.gnu.org; Wed, 11 Aug 2021 08:24:06 -0400 Received: from mail-wm1-f45.google.com ([209.85.128.45]:37670) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mDnHA-0002jU-9N for 49980@debbugs.gnu.org; Wed, 11 Aug 2021 08:24:04 -0400 Received: by mail-wm1-f45.google.com with SMTP id l34-20020a05600c1d22b02902573c214807so4287431wms.2 for <49980@debbugs.gnu.org>; Wed, 11 Aug 2021 05:24:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=0MCbmvMag2IsHd/FpKD90yNnDOpfbtlMLpw3gGann1E=; b=fhtnjPxBlMaflHm5kT+9da09m/s16PEYRG+i4vuBv2v0ti2iqglmD1nRpHXukEAoBB 36VYV4b1ZYLZgJh5iafc5qblpBghlvdE7QCia/JRCbTk6nlo1/oemMk51rZ+OmqIPxNX rLk+/MpZ8Dcx42jJUd9OftOM14ZWy/hp5wxU1f2kK8oWWScCXGOXqVCa6+l+12KtANIM YIn3Aaj56KX38ccf2aw9MulbxfinlTuNhiauk1kXdBcKvSR8PMfqt0tEIyDrz4II/tPE nHEXfboTp8nxGzOlae8sQUrZjdIlsZ8HWp7eTWiQBcK5LkjhCPtLpjrIrDBUuJlWdYEO OsSg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:subject:to:cc:references:from:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=0MCbmvMag2IsHd/FpKD90yNnDOpfbtlMLpw3gGann1E=; b=GnbbZyu2I3zzYNqD4F2wZlUo5aXX7rmU1ssZSXIHURUK+xcoKG3KE3al5P6B4pFv4K Tz8rg+iRJpAQ/3zvyS3uZnXiEeOXhIIHtXxC6HKcYeupqJPoEbAFvCchypxGUiPEktom 0hnjkJmnwETrBfusy9pjIDQhiqJ0Bagq3vsEyHmcmt7kbvY5zP6lvAKrjS8/KuHZFZDS UmZ7M4Ng2KOHeqTS0Jxji+MstqXgWdFP/wIexdm2t+tjcrKkrBr6WbxEzLeLDiMQKA9u rliU2JE9lX1Hi9LbNCnPuqn6c/fGms8NDuXmUUw1Jr3nbpIycok8pcz4YZ5KM01e5GZ2 bSSg== X-Gm-Message-State: AOAM532SUO93uTRMTxPFrVdEtMQOqN2HIjddxYiUQ9hbA/OHfO9YlHj+ fB5dwKvvaJMtpuqp7gqhNNWyNNlwQRc= X-Google-Smtp-Source: ABdhPJyVKV9aCX3lrJ6b7UTGdcipR2hfQCF1FTA5u49/OW/VJHUmfLtnmFJoaXs4i7FH3AijYjFS1A== X-Received: by 2002:a7b:c8cd:: with SMTP id f13mr12963046wml.6.1628684638398; Wed, 11 Aug 2021 05:23:58 -0700 (PDT) Received: from [192.168.0.6] ([46.251.119.176]) by smtp.googlemail.com with ESMTPSA id g35sm6652342wmp.9.2021.08.11.05.23.57 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 11 Aug 2021 05:23:58 -0700 (PDT) Subject: Re: bug#49980: 28.0.50; [PATCH] Should we have project-save-buffers? To: Juri Linkov , Giap Tran References: <87czqlodpl.fsf@gmail.com> <871r70lnyi.fsf@mail.linkov.net> From: Dmitry Gutov Message-ID: Date: Wed, 11 Aug 2021 15:23:56 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: <871r70lnyi.fsf@mail.linkov.net> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Score: 0.4 (/) X-Debbugs-Envelope-To: 49980 Cc: 49980@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.6 (/) On 11.08.2021 09:52, Juri Linkov wrote: > It would be nice to have a keybinding for this useful command, > as there is 'C-x s', but 'C-x p s' is bound to 'project-shell'. > Maybe then to bind it to 'C-x p S'? If we do end up adding this command, we could move project-shell to 'C-x p E', for example, so that we don't spread shell-related commands over different letters. Then project-save-buffers could be on 'C-x p s'. But see my question in the other email. From debbugs-submit-bounces@debbugs.gnu.org Wed Aug 11 09:40:34 2021 Received: (at 49980) by debbugs.gnu.org; 11 Aug 2021 13:40:34 +0000 Received: from localhost ([127.0.0.1]:33867 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mDoTC-0004vF-Kv for submit@debbugs.gnu.org; Wed, 11 Aug 2021 09:40:34 -0400 Received: from mail-pj1-f51.google.com ([209.85.216.51]:41841) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mDoTA-0004v1-LK for 49980@debbugs.gnu.org; Wed, 11 Aug 2021 09:40:33 -0400 Received: by mail-pj1-f51.google.com with SMTP id fa24-20020a17090af0d8b0290178bfa69d97so5003687pjb.0 for <49980@debbugs.gnu.org>; Wed, 11 Aug 2021 06:40:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=+rHR2RX7eo3+tHmegyFQgFLC7xlpbM6CWSLlv5aY4k4=; b=buOsRsrULu863BwfVjXvjnaX4Vbhrp50AxDs2+zNHzqDgIrQMnZEnVEkfJE6ziS3Pn O16fE3YwbQt7Evs3brye/fgnesvYbOgj/s73PdUzT1O0tgJcaZjLR4mrUk2Xc0YangAk Ao7Evge/QeXO7Qf67smHUJqsBL2IWDHuwkkhBVAkOhC7xcpSSnbQCip0eQu4sX9ymE+o 3eg0TE46PxKTYEh+Iz1mNdETdKwWMNhjZbCv1guMULzjQTdIWY9hxbqma0K7hnpV7bJN CxHSov8ayAnQCOIwG/eMRH+u6TqcYOmCyRwHTLogxoo6kt0WGr17T+nZtIbFUX/yNq2C x2eA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=+rHR2RX7eo3+tHmegyFQgFLC7xlpbM6CWSLlv5aY4k4=; b=ffe0xDlL+5PRpSbunE2jrmn57COPmOf+hVfF4sDEqNRCy+A5p/fZmGVYy4vaZJpaeu ps4dpbv6Nl9utxZCaK3tMapq4LtWG3+u3lVUEd21sPW5Aw0OQ81HscLavwvYGwMiwH1K 1vodkEUQmkuZRl1BxRWHeE40WgnaelTCOtdBm6AJAml8+ptC5MEcAN8lAffCWN/i0y8z zNjyW+4VmjwqWcfxzmGim/qDxVWoWYHoW6quJsqVMXPS9+wMM8u88PgpqthtpEvzc0p4 O1f/pfgSDOuCWA0wkAukuuL4uzyp3eTmpeGgcxRHKXAnZv5XJ2z7j6u40f9XmQUirkor 1y9w== X-Gm-Message-State: AOAM5335QH4T0YqbQcQHRlnt+TZTQYjDpsE8snIt8dHVoJnFhybXr8Ri Q+S/KYTYzdMdP+PTBDun+GvcLPQ9I7Y= X-Google-Smtp-Source: ABdhPJzsEba8ZtAy3pXSpOQ+fcndV4Ri2vDVaZvaPKKqsxqvGLemC0nEHxxTivcKFZxrgWsfo7bHxg== X-Received: by 2002:a65:63c2:: with SMTP id n2mr147901pgv.292.1628689226237; Wed, 11 Aug 2021 06:40:26 -0700 (PDT) Received: from X230 ([113.23.51.118]) by smtp.gmail.com with ESMTPSA id s36sm33903842pgk.64.2021.08.11.06.40.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Aug 2021 06:40:25 -0700 (PDT) From: Giap Tran To: Dmitry Gutov Subject: Re: bug#49980: 28.0.50; [PATCH] Should we have project-save-buffers? References: <87czqlodpl.fsf@gmail.com> Date: Wed, 11 Aug 2021 20:40:19 +0700 In-Reply-To: (Dmitry Gutov's message of "Wed, 11 Aug 2021 15:22:35 +0300") Message-ID: <87v94cumkc.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: 49980 Cc: 49980@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) Dmitry Gutov writes: > Is there any reason not to just use 'save-some-buffers' (C-x s)? > > Do you often want to leave some buffers unsaved? Oh, so funny, I used Emacs for over 4 years and I don't know this function. Looks like I just need this to solve my problem > Then project-save-buffers could be on 'C-x p s'. Is `project-save-buffers necessary anymore? If anyone opens many projects with unsaved buffers. Maybe they need that because they don't want to save buffers not in this project. I think we don't need keybinding for that. We can use M-x, up to you :D -- Giap Tran GnuPG/0xE655BF766A56995D From debbugs-submit-bounces@debbugs.gnu.org Thu Aug 12 04:15:04 2021 Received: (at 49980) by debbugs.gnu.org; 12 Aug 2021 08:15:04 +0000 Received: from localhost ([127.0.0.1]:37429 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mE5rj-0007un-Pk for submit@debbugs.gnu.org; Thu, 12 Aug 2021 04:15:03 -0400 Received: from relay12.mail.gandi.net ([217.70.178.232]:51019) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mE5rh-0007tu-M5 for 49980@debbugs.gnu.org; Thu, 12 Aug 2021 04:15:02 -0400 Received: (Authenticated sender: juri@linkov.net) by relay12.mail.gandi.net (Postfix) with ESMTPSA id 5E138200006; Thu, 12 Aug 2021 08:14:53 +0000 (UTC) From: Juri Linkov To: Dmitry Gutov Subject: Re: bug#49980: 28.0.50; [PATCH] Should we have project-save-buffers? Organization: LINKOV.NET References: <87czqlodpl.fsf@gmail.com> <871r70lnyi.fsf@mail.linkov.net> Date: Thu, 12 Aug 2021 10:55:45 +0300 In-Reply-To: (Dmitry Gutov's message of "Wed, 11 Aug 2021 15:23:56 +0300") Message-ID: <87y297azuu.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 49980 Cc: Giap Tran , 49980@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) >> It would be nice to have a keybinding for this useful command, >> as there is 'C-x s', but 'C-x p s' is bound to 'project-shell'. >> Maybe then to bind it to 'C-x p S'? > > If we do end up adding this command, we could move project-shell to 'C-x > p E', for example, so that we don't spread shell-related commands over > different letters. Or to a new prefix map, e.g. 'C-x p x s' with mnemonics "eXecute Shell". > But see my question in the other email. > Is there any reason not to just use 'save-some-buffers' (C-x s)? In bug#46374 we are adding a new option 'project-root' to 'save-some-buffers-default-predicate' that will allow 'C-x s' to save only files under the same project root. From debbugs-submit-bounces@debbugs.gnu.org Thu Aug 12 22:06:31 2021 Received: (at 49980) by debbugs.gnu.org; 13 Aug 2021 02:06:31 +0000 Received: from localhost ([127.0.0.1]:40154 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mEMad-0000Cd-B7 for submit@debbugs.gnu.org; Thu, 12 Aug 2021 22:06:31 -0400 Received: from mail-wm1-f50.google.com ([209.85.128.50]:45675) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mEMaX-0000CK-P5 for 49980@debbugs.gnu.org; Thu, 12 Aug 2021 22:06:29 -0400 Received: by mail-wm1-f50.google.com with SMTP id 203-20020a1c00d40000b02902e6a4e244e4so5912773wma.4 for <49980@debbugs.gnu.org>; Thu, 12 Aug 2021 19:06:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=PIK3jh1T0XasppuMcqdFAWxhxifwfcruZonxkxERKnk=; b=UUyakijhb6mq6Wy+eXODDZuNkEIh3DKv+LGLf+sSenZIt43/McJgtmMIvmaeL4pQyZ 2z0+kBb9UrP953v60EVHIb4CrjjTdjAp0DOEg6A1NPTEKt9UWrEXHocAszg6JuPndPP/ TyfiMbSDnaEJXYpLLBfFz3rz6u1lf+33DzHdLcK5V2/6uOlkbThEQEJOBZNxMZRBCXbE Yq6LIZ25sO4nloDN+W1jBTbcaSJd1/AEDCT0tQLROEF+JwKjbA7qEpfcP8SmPoBxHPMr 3ZiJ5+4HjhV9mI/+w2aWixPVm1eAGTT4CZl2XGQg3lQ4OjLJqvZVwGdePHcwqMEWmmME frAA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:subject:to:cc:references:from:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=PIK3jh1T0XasppuMcqdFAWxhxifwfcruZonxkxERKnk=; b=lsgalnSXvBbH84cTb5iXe/s5esXFvBaRhI3/BEIOssWPxMLot+Yth9fCeX9Yi/R7Ll DUV4ZDud8yuyykTQeOVzSUBgo/JP/qtJRlRWQwtd8dSd//kRhpCLHAAI+NycYwjwvgXJ 5FcS8RegeeLb4X+/bimxsfBPuIqeK0XIDpCZ5eqPtz/fQ8TGsvxFz4a4fxMiAPz/5TRJ IT4U2kWXRtYfgieX1aEtTD3W/cQS4IDO5BjtfDJegcwvo8J70DROjNtGlb8rU+AUZWNk 6OTm8fx1xXfJkNag+p3Wka5zYvW1Byq04TwN7PslikZrCvsvPmhZwS8uc01zBW4ybo64 l75g== X-Gm-Message-State: AOAM533yV4+d+I94SCuR+JjEzWEh+WWVVrCGA0rlwOQLDGLVVbQLqWgC b95Wr/6oTNfHaeRZTVawhlFiq0LlEsQ= X-Google-Smtp-Source: ABdhPJwROmbqrLS8LlUMs3OQQ5qOdaNIpbFP2EKDRKiYy6i0VV9Pvj9jCdLXVUz0I1kVfDLyjDHeaQ== X-Received: by 2002:a05:600c:a08:: with SMTP id z8mr224707wmp.52.1628820379896; Thu, 12 Aug 2021 19:06:19 -0700 (PDT) Received: from [192.168.0.6] ([46.251.119.176]) by smtp.googlemail.com with ESMTPSA id o2sm8782wmq.30.2021.08.12.19.06.18 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 12 Aug 2021 19:06:19 -0700 (PDT) Subject: Re: bug#49980: 28.0.50; [PATCH] Should we have project-save-buffers? To: Juri Linkov References: <87czqlodpl.fsf@gmail.com> <871r70lnyi.fsf@mail.linkov.net> <87y297azuu.fsf@mail.linkov.net> From: Dmitry Gutov Message-ID: <3ea58870-6b9a-41b9-c06e-d045ff9764b9@yandex.ru> Date: Fri, 13 Aug 2021 05:06:17 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: <87y297azuu.fsf@mail.linkov.net> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Score: 0.4 (/) X-Debbugs-Envelope-To: 49980 Cc: Giap Tran , 49980@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.6 (/) On 12.08.2021 10:55, Juri Linkov wrote: >>> It would be nice to have a keybinding for this useful command, >>> as there is 'C-x s', but 'C-x p s' is bound to 'project-shell'. >>> Maybe then to bind it to 'C-x p S'? >> >> If we do end up adding this command, we could move project-shell to 'C-x >> p E', for example, so that we don't spread shell-related commands over >> different letters. > > Or to a new prefix map, e.g. 'C-x p x s' with mnemonics "eXecute Shell". That would also displace project-execute-extended-command, which seems gratuitous. And if we were putting different commands together to save keymap space, 'project-compile' seems closer in purpose to 'project-shell' than 'project-execute-extended-command'. Anyway, 'e' as a mnemonic for 'Eshell' or 'shEll' seems good enough for me. >> But see my question in the other email. >> Is there any reason not to just use 'save-some-buffers' (C-x s)? > > In bug#46374 we are adding a new option 'project-root' > to 'save-some-buffers-default-predicate' that will allow > 'C-x s' to save only files under the same project root. That also seems to indicate that we don't need a separate command. From debbugs-submit-bounces@debbugs.gnu.org Thu Aug 12 22:11:47 2021 Received: (at 49980) by debbugs.gnu.org; 13 Aug 2021 02:11:47 +0000 Received: from localhost ([127.0.0.1]:40159 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mEMff-0000Jx-Vj for submit@debbugs.gnu.org; Thu, 12 Aug 2021 22:11:47 -0400 Received: from mail-wr1-f46.google.com ([209.85.221.46]:38506) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mEMfb-0000Jh-0p for 49980@debbugs.gnu.org; Thu, 12 Aug 2021 22:11:42 -0400 Received: by mail-wr1-f46.google.com with SMTP id l18so11095213wrv.5 for <49980@debbugs.gnu.org>; Thu, 12 Aug 2021 19:11:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=o3EUg2IyS8RgdgDCvs2Iu1U8+pwQOToeVH2PnzMT5N4=; b=CO6a8KFHlEmMlp8KWEMfQ7VL13anBl/U5xsw4vVc3rN0G1xVuyAnHHWZWbQI16pXFZ 5mMcKeGhOo+Z211PN2i3AWbWAFsa3I1KKCQXK6ibO7PG1kz4ytW5tX9jgvrzKL7MvI19 crWHnvkF34PvmWzpbw89H1PkMiL1pCfPTtgUuqJ+ntPS3w76E2RsKUfrnF2uaKp7PH+z buKqahDJ7KihgxoUvzkiXIbjejd+mE5FM8aox9QJ/aqqV1OerdAYdDLQ4aCCa4PEkC8/ AhPZOdArezG15kl0pQdu1ZxRDkqvShuv+RY1qnZwsUroa54UU1jh8HTGZJzh+2TTvg0p jssg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:subject:to:cc:references:from:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=o3EUg2IyS8RgdgDCvs2Iu1U8+pwQOToeVH2PnzMT5N4=; b=M4YKE+mccG7mqEtT8uyG2wjJoy0I0ioPDCioOZ4Hh1847B5mHAokunHgkjkqTb67El 6rrpnnvjZGdSPO0Mmfm6cyqzgkGHrkFbe3tbxi9f9Y5CbUzsG2zSYK23kX8Nm7ekZ3iv 7cFYTckn5X66BIXcFuR+kIOJRHq2OhaWERCA4fV+Og8SnKKqNBm56GxRBdG93WTJ+PAZ me2syFXnR3bxMEQcuBNoEtZeuBUaqWBRq/hQtT35LWIXd61leIYX7wQwHbuDpu4LIMP2 AeHKvHvLkoXmm3j4hJ+Dfg3WCWrpqfmYfIKiP9vfI5kiakuZ0YuHEkbwvpab4+c72kH3 8JhA== X-Gm-Message-State: AOAM532+vpNNnULl71WGNkUoFvB1L8iY4con1fogcn9yCpSCJdnUhoCM cRbbUZPHi0180DNq7wjcxUa4u1IlRtk= X-Google-Smtp-Source: ABdhPJx+Rw8Jn8d7LjQRRAcnRwGnyG6jlHri3VajgwolkOgBGJqv5W16NJoTuDVhRQVfAvS2J2mbFw== X-Received: by 2002:a5d:4cc6:: with SMTP id c6mr156110wrt.383.1628820693143; Thu, 12 Aug 2021 19:11:33 -0700 (PDT) Received: from [192.168.0.6] ([46.251.119.176]) by smtp.googlemail.com with ESMTPSA id h4sm69189wru.2.2021.08.12.19.11.32 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 12 Aug 2021 19:11:32 -0700 (PDT) Subject: Re: bug#49980: 28.0.50; [PATCH] Should we have project-save-buffers? To: Giap Tran References: <87czqlodpl.fsf@gmail.com> <87v94cumkc.fsf@gmail.com> From: Dmitry Gutov Message-ID: <814032a7-ba6a-6f5f-04f2-b7be9e5f2ac6@yandex.ru> Date: Fri, 13 Aug 2021 05:11:31 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: <87v94cumkc.fsf@gmail.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Score: 0.4 (/) X-Debbugs-Envelope-To: 49980 Cc: 49980@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.6 (/) On 11.08.2021 16:40, Giap Tran wrote: > Dmitry Gutov writes: > >> Is there any reason not to just use 'save-some-buffers' (C-x s)? >> >> Do you often want to leave some buffers unsaved? > > Oh, so funny, I used Emacs for over 4 years and I don't know this > function. Looks like I just need this to solve my problem Excellent. >> Then project-save-buffers could be on 'C-x p s'. > > Is `project-save-buffers necessary anymore? If anyone opens many projects > with unsaved buffers. Maybe they need that because they don't want to > save buffers not in this project. I think we don't need > keybinding for that. We can use M-x, up to you :D I don't know if it's necessary indeed (and as Juri notes, there will be another approach available). We might consider it problematic, though, that for 'project-query-replace-regexp' to operate properly the user needs to save all the buffers manually (they both need to know that they need to do that, and how to do that). Maybe xref-query-replace-in-results should have an option to save all touched buffers in the end. Or maybe perform-replace should have one. Hopefully we can also resolve this difficulty another way, providing an inline editing mechanism for Xref buffers. From debbugs-submit-bounces@debbugs.gnu.org Fri Aug 13 03:14:37 2021 Received: (at 49980) by debbugs.gnu.org; 13 Aug 2021 07:14:37 +0000 Received: from localhost ([127.0.0.1]:40420 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mEROm-0007zj-S6 for submit@debbugs.gnu.org; Fri, 13 Aug 2021 03:14:37 -0400 Received: from relay5-d.mail.gandi.net ([217.70.183.197]:55051) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mEROj-0007z1-L7; Fri, 13 Aug 2021 03:14:35 -0400 Received: (Authenticated sender: juri@linkov.net) by relay5-d.mail.gandi.net (Postfix) with ESMTPSA id E4FC31C0006; Fri, 13 Aug 2021 07:14:25 +0000 (UTC) From: Juri Linkov To: Dmitry Gutov Subject: Re: bug#49980: 28.0.50; [PATCH] Should we have project-save-buffers? Organization: LINKOV.NET References: <87czqlodpl.fsf@gmail.com> <871r70lnyi.fsf@mail.linkov.net> <87y297azuu.fsf@mail.linkov.net> <3ea58870-6b9a-41b9-c06e-d045ff9764b9@yandex.ru> Date: Fri, 13 Aug 2021 10:12:24 +0300 In-Reply-To: <3ea58870-6b9a-41b9-c06e-d045ff9764b9@yandex.ru> (Dmitry Gutov's message of "Fri, 13 Aug 2021 05:06:17 +0300") Message-ID: <87v949ddif.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 49980 Cc: Giap Tran , 49980@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) tags 49980 fixed close 49980 28.0.50 quit >> Or to a new prefix map, e.g. 'C-x p x s' with mnemonics "eXecute Shell". > > That would also displace project-execute-extended-command, which seems > gratuitous. And if we were putting different commands together to save > keymap space, 'project-compile' seems closer in purpose to 'project-shell' > than 'project-execute-extended-command'. > > Anyway, 'e' as a mnemonic for 'Eshell' or 'shEll' seems good enough for me. Then maybe 'C-x p e e' for 'Eshell' with a mnemonic "Execute Eshell", and 'C-x p e s' for 'Shell' with a mnemonic "Execute Shell". >>> Is there any reason not to just use 'save-some-buffers' (C-x s)? >> In bug#46374 we are adding a new option 'project-root' >> to 'save-some-buffers-default-predicate' that will allow >> 'C-x s' to save only files under the same project root. > > That also seems to indicate that we don't need a separate command. Indeed, so after pushing the patch to use the project root in bug#46374, now closing this request too. From debbugs-submit-bounces@debbugs.gnu.org Fri Aug 13 05:39:50 2021 Received: (at 49980) by debbugs.gnu.org; 13 Aug 2021 09:39:50 +0000 Received: from localhost ([127.0.0.1]:40512 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mETfG-0005ah-B7 for submit@debbugs.gnu.org; Fri, 13 Aug 2021 05:39:50 -0400 Received: from mail-oln040092073068.outbound.protection.outlook.com ([40.92.73.68]:26597 helo=EUR04-HE1-obe.outbound.protection.outlook.com) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mETfA-0005aK-Pr for 49980@debbugs.gnu.org; Fri, 13 Aug 2021 05:39:44 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Y+auecELBLzUHco74MiiBoPYyOzr/vIYl1UAOlGhs24nfvQHzXSEivny4Z+A5XsA6DcAKa+zH+4nIiHBljrrFDCWgcIhDHz8kOk3m2iCH/ESbp+3HLMt9/WTnQLrrcjByNpVMHFnXwHikR/eBfq92yT5W8kZc8yTmrkKqHBuhniMB1iTPgdpkivqXCvGwqhaE7WjXErijdJZa7l/A3p2LB+yFgtNfdtH88LAHO3DDT2UGYsu7J84ygbTVMx85Zq0g5gBVoBatVe7hhP8JGcs63GuTSgnn727La5hpTxqLmGetYbPjwgkn9YRgG5a3Ey44OOxJ26h+kGFHix3zcl7Ig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Ckd1SCm9cws1cq9dA26H2LNTy/Ko8zbNLvLGokYWQc4=; b=exEyJgkfU5Xri1yLRxgdCFP43ght1h00sBUqWyh9axailhv7nBAJxPrjWvY9E3x87VXQPpj2iDD9vi0MDnA1sKghIWjcfge9z+o1R3w2+kqOvqNVm5HMt9LsLoi+89yzaZAbo5QlN6BMdn84x2tDFxqRPInIG2UXOEkdI4MLhX3p3gBXXsRGSC5Bf4Rd4mchpqa1JrGNaMLB9ftyIyZOxWKs3EFwySNHkXA3XZkVjjhNtqnRRNKkaFqJ7T+gnIUxEQjG4/vUkyXS9oZJycWdrcR35aMznmxjNyENBLvM2zE42DA+HrfPXizXvjKyxsXANFkv/RTb2JFCnfxcgzIXRw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=live.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Ckd1SCm9cws1cq9dA26H2LNTy/Ko8zbNLvLGokYWQc4=; b=TKgICqaxXuiaqhaheoF0NB/oYDgmov3u0Chk8fH4NunSyEshLvoreEtIICcZm7pHVnO5AB34Xg3V9Xr6EtcT+bps+XML06bDz8SeNqmtAjWqM+bNWr++vcvvmaTFv6mxpx/0vztFCklr1hPHSI4gnso81M+6fMH61BVWOQbMv9KnB8AHZ9DXgtlvcXmSAfd/kPMp9dR3/rGzum6K/swewBIjOjVXrw+NcEs7krWZLzB0fiajPVFB62zdZX5aYS5MRUPAdilQJNYvkpGbG9JBg8NgANHAzxrzl6enWlTKzr27KPcp0iys+HGx53W2ppmgO6d0RVVl7oXLUjfdBWRbJA== Received: from HE1EUR04FT037.eop-eur04.prod.protection.outlook.com (2a01:111:e400:7e0d::4f) by HE1EUR04HT054.eop-eur04.prod.protection.outlook.com (2a01:111:e400:7e0d::174) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4415.16; Fri, 13 Aug 2021 09:39:33 +0000 Received: from AM9PR09MB4977.eurprd09.prod.outlook.com (2a01:111:e400:7e0d::51) by HE1EUR04FT037.mail.protection.outlook.com (2a01:111:e400:7e0d::161) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4415.14 via Frontend Transport; Fri, 13 Aug 2021 09:39:33 +0000 X-IncomingTopHeaderMarker: OriginalChecksum:1C9B1AEE8596A74675F7AA3B061AB159331B77EC19C3989800F6BF4CDADEFB82; UpperCasedChecksum:394B523E2817798CDB282C5245B38B2EDEFD4B719C028936705918716CFD320A; SizeAsReceived:7658; Count:46 Received: from AM9PR09MB4977.eurprd09.prod.outlook.com ([fe80::6558:f201:6d1a:3f39]) by AM9PR09MB4977.eurprd09.prod.outlook.com ([fe80::6558:f201:6d1a:3f39%2]) with mapi id 15.20.4415.019; Fri, 13 Aug 2021 09:39:33 +0000 From: Arthur Miller To: Dmitry Gutov Subject: Re: bug#49980: 28.0.50; [PATCH] Should we have project-save-buffers? References: <87czqlodpl.fsf@gmail.com> <871r70lnyi.fsf@mail.linkov.net> <87y297azuu.fsf@mail.linkov.net> <3ea58870-6b9a-41b9-c06e-d045ff9764b9@yandex.ru> Date: Fri, 13 Aug 2021 11:39:32 +0200 In-Reply-To: <3ea58870-6b9a-41b9-c06e-d045ff9764b9@yandex.ru> (Dmitry Gutov's message of "Fri, 13 Aug 2021 05:06:17 +0300") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Content-Type: text/plain X-TMN: [P7voNoMyZ22heXHu4S5grzv7YB90rb/x] X-ClientProxiedBy: AM6P192CA0105.EURP192.PROD.OUTLOOK.COM (2603:10a6:209:8d::46) To AM9PR09MB4977.eurprd09.prod.outlook.com (2603:10a6:20b:304::20) X-Microsoft-Original-Message-ID: <87sfzdwunf.fsf@live.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from pascal.homepc (81.232.177.30) by AM6P192CA0105.EURP192.PROD.OUTLOOK.COM (2603:10a6:209:8d::46) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4415.16 via Frontend Transport; Fri, 13 Aug 2021 09:39:33 +0000 X-MS-PublicTrafficType: Email X-IncomingHeaderCount: 46 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-Correlation-Id: 74a46448-4841-4e6d-17f6-08d95e3e41b0 X-MS-TrafficTypeDiagnostic: HE1EUR04HT054: X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: CDWDL/42lrsCvNK72VQEDrcXWgljxszFeDto5JVEF8Qsf0G07w2YaaOFeYz3ugYlLCAilF5QdV8MOiflDNkBwY8wkXXZbJVZU4VuPjjSX9jqUmS+qFU1JlAtDV8ID0eLC6wz6B/+td1jzBkwENQELVxiY/YWfL0YfZ3kxm14+N7KI74lnCigslGQADlOTnxXKvE74cBC+VsuEKmdZsMQzq1u2F2vSLRsIMLm2FCItKZGt3PeyKAz1n5vJk2zaNspLlPb8ewHuIYgf8b2XlGla88BR5bqHWTZFhMXvWc0dy8FLKMC3lRqD0e7zCSeLQCGbJum3EBRVMsaa5rdQSCcugp1QDKTdRf9SW6JgbdHLxsz/aUpsLL/eqkCjRnr3GmSJ4BTCyk2liwp7LYKIVV2g6ZYeS+G6bl5rON3awVeKTUMbKWY3U1mWfHxuVIEv5/T X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: G4DWggfqlaaqgBOqO3p2H2/zqMakuihIBv67T6FfsEvC5KJmC7YmIOyXRpG4i78HzHiNEIPY1RyUzwYUcGHek1g6kNweTNj4TZBzFYP3U7HsEHxdb0Z3xMx2TQaDB9HNAB3n/nBj6HzMH4KSGam5OQ== X-OriginatorOrg: live.com X-MS-Exchange-CrossTenant-Network-Message-Id: 74a46448-4841-4e6d-17f6-08d95e3e41b0 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Aug 2021 09:39:33.6740 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-AuthSource: HE1EUR04FT037.eop-eur04.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: Internet X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1EUR04HT054 X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 49980 Cc: Giap Tran , 49980@debbugs.gnu.org, Juri Linkov X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Dmitry Gutov writes: > On 12.08.2021 10:55, Juri Linkov wrote: >>>> It would be nice to have a keybinding for this useful command, >>>> as there is 'C-x s', but 'C-x p s' is bound to 'project-shell'. >>>> Maybe then to bind it to 'C-x p S'? >>> >>> If we do end up adding this command, we could move project-shell to 'C-x >>> p E', for example, so that we don't spread shell-related commands over >>> different letters. >> Or to a new prefix map, e.g. 'C-x p x s' with mnemonics "eXecute Shell". > > That would also displace project-execute-extended-command, which seems > gratuitous. And if we were putting different commands together to save keymap > space, 'project-compile' seems closer in purpose to 'project-shell' than > 'project-execute-extended-command'. > > Anyway, 'e' as a mnemonic for 'Eshell' or 'shEll' seems good enough for me. > >>> But see my question in the other email. >>> Is there any reason not to just use 'save-some-buffers' (C-x s)? >> In bug#46374 we are adding a new option 'project-root' >> to 'save-some-buffers-default-predicate' that will allow >> 'C-x s' to save only files under the same project root. > > That also seems to indicate that we don't need a separate command. 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. From debbugs-submit-bounces@debbugs.gnu.org Fri Aug 13 12:11:27 2021 Received: (at 49980) by debbugs.gnu.org; 13 Aug 2021 16:11:27 +0000 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 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 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) From: Juri Linkov To: Arthur Miller Subject: Re: bug#49980: 28.0.50; [PATCH] Should we have project-save-buffers? Organization: LINKOV.NET References: <87czqlodpl.fsf@gmail.com> <871r70lnyi.fsf@mail.linkov.net> <87y297azuu.fsf@mail.linkov.net> <3ea58870-6b9a-41b9-c06e-d045ff9764b9@yandex.ru> Date: Fri, 13 Aug 2021 19:05:58 +0300 In-Reply-To: (Arthur Miller's message of "Fri, 13 Aug 2021 11:39:32 +0200") Message-ID: <87h7ftba8p.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 49980 Cc: Giap Tran , 49980@debbugs.gnu.org, Dmitry Gutov X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) > 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) From debbugs-submit-bounces@debbugs.gnu.org Fri Aug 13 13:22:31 2021 Received: (at 49980) by debbugs.gnu.org; 13 Aug 2021 17:22:31 +0000 Received: from localhost ([127.0.0.1]:43033 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mEat1-00005g-N4 for submit@debbugs.gnu.org; Fri, 13 Aug 2021 13:22:31 -0400 Received: from mail-oln040092069058.outbound.protection.outlook.com ([40.92.69.58]:27738 helo=EUR02-VE1-obe.outbound.protection.outlook.com) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mEasw-00005I-Eb for 49980@debbugs.gnu.org; Fri, 13 Aug 2021 13:22:26 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=c+KBJOXf9eP/m5S8J80WPvyzvjOHRA87l+6eP7Sk3dJSxZ3lKpYjMxbkAAyJ4LCFU1whpcgTZ5kBxkQc4hZX4lmEoMKjPGV54xtX7ERI+kIV+5v0hf8lolecAkF+TqZn8p3+JyQnLetgQlz5ZEE7GQd41qodhgP7ux+aVdE0yKW0ATSyKvmzwHfrtcc8CRyzl3AbM7QNvxYQyoJOLKWmWnWsq7hkLISS3hStLRpFOoVSl6G3ngOdrND+9qGr4a0dW7xkxtzTHcbSarcn4nhpN+BfsYlpAskas0RCvOEG49K0JtAsYBLDkFQsguw8WOPZZW+h3wn0lofr2ohFo3XTHA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=aPpFODNRhCptq3S+IBc0H689VSV/v/g4+YnQ4h4So2s=; b=HDlJ1fw+B9xxKsLOIawxdksQys5fE/Uviyp8rvJ4vKI3FsrYoB8Lj7cVk6VUSq2vRtjsmOmPmgMMCxfvX7yp1LkjfA9nUtJTL0PrFus/zzCIqy85txl+OYZ5ul7+hfpeN4c8izwyfjsA3/B4UYKx2g1f5IADcp4ODOEMTS5ilo5y5p4wXijnFboPQwe0e+38SOhUd5MysYz12ntXvj6qpo6ChZJfC5bdpluO15Ugn9vseI5Ia+ST/gT6SmieBOn0ZuWLE8i00VkeqmEhAJFm7ToGLcJHYJWcajFNKo8yRs6keY54udLTHfZIKlR9O4FYuS1vulfxdxxgEzR70A7CoQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=live.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=aPpFODNRhCptq3S+IBc0H689VSV/v/g4+YnQ4h4So2s=; b=IxwFGat7H8xwQuVLOcf3Pl3wRXWmUWApThwNzZIOZp6d4lhtxLxVcmsGkgk1zYGfLQCHoySpQG+BP+1D1Eb4Han7wuVbAeqdoEJvDveAmztBKxocr+gtTvrVz/1wMUzYz53xPEa+jUFlSCAYusZxDPwXCf/VLy+wrSxy/pdf0LHOhZavPZ3wiWUOgfECTYIF5yESunueYP/VBktfVPYqP/ZaAWxLqmhBw/w+WtCW1F5lJMst/VfcBY74UW1M99xSNK5HlPBWiFricTUQkEdwyszpLyKuK7M6o1L8tq3kropCOAzfr/E3KePVIgz77VRCtkXX67ITf8i5IJWgJA6njw== Received: from VE1EUR02FT021.eop-EUR02.prod.protection.outlook.com (2a01:111:e400:7e1e::45) by VE1EUR02HT125.eop-EUR02.prod.protection.outlook.com (2a01:111:e400:7e1e::441) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4415.16; Fri, 13 Aug 2021 17:22:14 +0000 Received: from AM9PR09MB4977.eurprd09.prod.outlook.com (2a01:111:e400:7e1e::53) by VE1EUR02FT021.mail.protection.outlook.com (2a01:111:e400:7e1e::111) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4415.16 via Frontend Transport; Fri, 13 Aug 2021 17:22:14 +0000 X-IncomingTopHeaderMarker: OriginalChecksum:D38F1F5F9C2F1D69CC39FD4924F9C629C6FCA6A0E10BB49E304F2A9081FDEB9E; UpperCasedChecksum:19104CA4641DAD9EE3324E1C465001F6187D5DC208357C64686C23585F956AFF; SizeAsReceived:7626; Count:45 Received: from AM9PR09MB4977.eurprd09.prod.outlook.com ([fe80::6558:f201:6d1a:3f39]) by AM9PR09MB4977.eurprd09.prod.outlook.com ([fe80::6558:f201:6d1a:3f39%2]) with mapi id 15.20.4415.019; Fri, 13 Aug 2021 17:22:14 +0000 From: Arthur Miller To: Juri Linkov Subject: Re: bug#49980: 28.0.50; [PATCH] Should we have project-save-buffers? References: <87czqlodpl.fsf@gmail.com> <871r70lnyi.fsf@mail.linkov.net> <87y297azuu.fsf@mail.linkov.net> <3ea58870-6b9a-41b9-c06e-d045ff9764b9@yandex.ru> <87h7ftba8p.fsf@mail.linkov.net> Date: Fri, 13 Aug 2021 19:22:13 +0200 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Content-Type: text/plain X-TMN: [z8Xyd1pOTCRYtIKWa23QXwETHW5MLxng] X-ClientProxiedBy: AM5PR0601CA0056.eurprd06.prod.outlook.com (2603:10a6:206::21) To AM9PR09MB4977.eurprd09.prod.outlook.com (2603:10a6:20b:304::20) X-Microsoft-Original-Message-ID: <874kbttg3e.fsf@live.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from pascal.homepc (81.232.177.30) by AM5PR0601CA0056.eurprd06.prod.outlook.com (2603:10a6:206::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4415.16 via Frontend Transport; Fri, 13 Aug 2021 17:22:14 +0000 X-MS-PublicTrafficType: Email X-IncomingHeaderCount: 45 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-Correlation-Id: 0cb42e45-a0de-4c55-6246-08d95e7ee4a6 X-MS-TrafficTypeDiagnostic: VE1EUR02HT125: X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 9pDkfrmqlMv7PPZPMogp8GSc6eUvICzijT8M8XFSGDTEF8t8bKzHubAQCoZVFqAjgMc1Ly2U0kIHz7VS8vUJEFpZ484DZd47uHKsbtldzGRdv/CfNYM3sSxWYZtLpTZwfCORCiCUNXTMHDURz/5CNJCjfodYuIQlq6www3F04Tj28V6omT1Bs3T84P6YCHh84ZyRK5ODV/5ESFtIvrq+ZKZgYOuNME3S5DO1PfMfFZ9aj6czhfLIHYYT83tVBKmPtEksCbdUMzoM2JU1mvuyP+oaV1GmhX6igOQvZsZxKRCwLHwaaWmHruryHi8uBiSRkiGTelP5ir5F7U2nn5XbHOflmxMHnfb4/18Bw9hHHibFeP9cpfJ1ISdK5LyGN32mqr6Ig+3YeSGPnDZUjvtk2R8PfomNa4ys6J4gLGYtAk/8smEhw6ZnREbfVclQFhhY X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: iAt+7NFjKLQXDTEX/WZJoSLj54soMAdc/L6Bu15h5IgFubeXno2XcuWXk+e6X1u6TSAGs8xUWFen9vH3VDS+2UGyh/MlbAeYl4s3x1tkfehHHjNUX84OzF1fRKMrqhAgkA4u5jo57a4GJo6AHZhCgA== X-OriginatorOrg: live.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0cb42e45-a0de-4c55-6246-08d95e7ee4a6 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Aug 2021 17:22:14.7851 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-AuthSource: VE1EUR02FT021.eop-EUR02.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: Internet X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1EUR02HT125 X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 49980 Cc: Giap Tran , 49980@debbugs.gnu.org, Dmitry Gutov X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Juri Linkov writes: >> 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: Yes, that is exactly my intention; I would like to save all modified buffers belonging to git root and subdirectories programmatically. > (save-some-buffers t 'save-some-buffers-root) Thank you, I have just pulled and rebuild. Will try it and let you know how it works when I am done testing. Thank you very much. From debbugs-submit-bounces@debbugs.gnu.org Fri Aug 13 19:54:14 2021 Received: (at 49980) by debbugs.gnu.org; 13 Aug 2021 23:54:14 +0000 Received: from localhost ([127.0.0.1]:43226 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mEh0A-0001Dw-9a for submit@debbugs.gnu.org; Fri, 13 Aug 2021 19:54:14 -0400 Received: from mail-wm1-f41.google.com ([209.85.128.41]:46818) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mEh08-0001Dj-Sx for 49980@debbugs.gnu.org; Fri, 13 Aug 2021 19:54:13 -0400 Received: by mail-wm1-f41.google.com with SMTP id h24-20020a1ccc180000b029022e0571d1a0so7905440wmb.5 for <49980@debbugs.gnu.org>; Fri, 13 Aug 2021 16:54:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=OTJmHjpco0sPk8bhC5aM+3x4vi++h14IZ51vX2UeJc4=; b=Tar1TaTAdi8bOm9UIuazykoE3X3hJ8DFHaBTKzH6HnVKc2RlDyP9T2LFbA+jX4zPMp k/WHrZr4lZmx67U3RmwFXW7hjCqnsbr+Mld1KMaQ5OslIV/qqowS3wtSuWm/8GQZ7WUw 0N7fb+6FgD70yMN7aYH7vzHWSV1OUGPfqy4ig8QIlio326Tvn1R/AqXtrVWF/EHGV6bO DEe5eY1XVboVeWexpcEUPjbcCnDB66dcbjuzk9Qmj3jXJnFJZ7qoOAmey9No/B833o+7 PklymMRyJ5XR0LF49vxxqwDCQNMl7dFOUPxeiDhd6hYWIOAlp0yCXltIevmcPwisnTlM c49g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:subject:to:cc:references:from:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=OTJmHjpco0sPk8bhC5aM+3x4vi++h14IZ51vX2UeJc4=; b=bB3mI5iekLb7wT49nzH1vcRSt2qaRwoIXk52yC3iiViAGhBi33oxOjM62jC45SJ/TM LMEicZquG4Ze9SldyGwD6wKJcJoZg2Mjs4lvR2o+BqXpkgNNLzjWydgJ0Jno8Oc8zcKL TsrZCLr2C4i/OKUkQ42ypoiJukRczgTrEpfIG0iZZ8+p8XkLEkTpygcGoDJbquJ96uHm n/ulmLfuLELyYc8UyLxR8oNKhzZ1sgnm15UncrvTwXI46qAZPn+7Xt88g6ZRN3O8p1tq emNgWxFbw6G8gI/ZsyvG64lbD/NAqqrhDLfQpc8sMwaZY/JFLIMVQ8IU6GCvrjizHwOM q6VA== X-Gm-Message-State: AOAM5336rzR7YzMSj65PbTRiC0ZELuboy3wOFBNrdloeoUXiPQu1ZVjU xpoXxpR96NNVKVOnLsU9tJB1uuqSfZs= X-Google-Smtp-Source: ABdhPJyDPcoWtXydGJJp9jSnRC3heLPPaanWItDCOQZfdeXidaGPkFc87efDgl9Fm744wPNth/Id/Q== X-Received: by 2002:a05:600c:2159:: with SMTP id v25mr4910970wml.187.1628898847063; Fri, 13 Aug 2021 16:54:07 -0700 (PDT) Received: from [192.168.0.6] ([46.251.119.176]) by smtp.googlemail.com with ESMTPSA id i8sm2761003wma.7.2021.08.13.16.54.05 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 13 Aug 2021 16:54:05 -0700 (PDT) Subject: Re: bug#49980: 28.0.50; [PATCH] Should we have project-save-buffers? To: Arthur Miller References: <87czqlodpl.fsf@gmail.com> <871r70lnyi.fsf@mail.linkov.net> <87y297azuu.fsf@mail.linkov.net> <3ea58870-6b9a-41b9-c06e-d045ff9764b9@yandex.ru> From: Dmitry Gutov Message-ID: <5fc1339b-5e18-f353-47bb-1123bf443710@yandex.ru> Date: Sat, 14 Aug 2021 02:54:04 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Score: 0.4 (/) X-Debbugs-Envelope-To: 49980 Cc: Giap Tran , 49980@debbugs.gnu.org, Juri Linkov X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.6 (/) On 13.08.2021 12:39, Arthur Miller wrote: > 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. Please check out Juri's solution, and if it doesn't work out, we can always add a dedicated command. From debbugs-submit-bounces@debbugs.gnu.org Fri Aug 13 22:26:01 2021 Received: (at 49980) by debbugs.gnu.org; 14 Aug 2021 02:26:01 +0000 Received: from localhost ([127.0.0.1]:43357 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mEjMz-0004sI-1k for submit@debbugs.gnu.org; Fri, 13 Aug 2021 22:26:00 -0400 Received: from mail-oln040092069101.outbound.protection.outlook.com ([40.92.69.101]:12869 helo=EUR02-VE1-obe.outbound.protection.outlook.com) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mEjMt-0004s1-9S for 49980@debbugs.gnu.org; Fri, 13 Aug 2021 22:25:55 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=lE6FGWDZTto0CfTG8w/PX2ZYWlZGfM7Kzf+469vr8JMF651WuYuRRXjVqJa7ACNZStpGev01OOGcwoXrTJYu7rCDR6jPNgfCmYLKK5GCcsTjsupVP35JOrfkFBEXnMOi52lMiDGJYGXPVX0tRFIPJkiXLEMlVrIXsDRJ6GUAvlhYt/gEs9WRPFZm9EUW5rFJyTwJUqpKB8VdrkThzcgnb9hQv5P0vT0A5+hcelXqYk+qFyPUykGlQ3HX7DW3FDi/UbzPyh0IRly57BprcKoJnGsVQZYBOu36G1AGJ1N3w74sqsCNOeHwfxbDWTMZCUDyygpA+UioKBcRXyo7N3+utQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=tnN5fOqJXEssH63OdqKzQlH7I8bPZ1szHH4kMj0W7F4=; b=IVbyEB+ulziS0gajaQQTfLITrHdD6YlJwzNlbR75Z5uc5EGa4y3jTQYeuubbx7d8ol1ThX0cbGIZWxNOfP51sLsuAr5pOi8aqfcjAFT9fcOp2+P4wC8JSPtYE2iPJ/uffADa9lPonmNLkxi94t1XAeSP+n3fJe7ZzK7WIz8RXwQwJtlPAWfCrNbvIaoHtIb1PN3h7JXKW0/xZqvn3HcV6MtphF7FsDfl0014Gme487iu0orEDovAZeMFlugz8LaZa+rGcgd+rnpxNuIO8vbgeEx/dLLPqRd9fZpfEYUQ+NtTEnN6HaZYAnqDaRcvGiKXEIVkLe2cOxeNLmVOV5p5cg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=live.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=tnN5fOqJXEssH63OdqKzQlH7I8bPZ1szHH4kMj0W7F4=; b=J0LfEvQ/I+XRXnZ+VcjFl09zV9ozsBASWlqWA39NFA658dAax75lFLscZ0LDao1RaEwO4YsAbNas54vGE9pwI2sCM7RMiL2PvqxF/gdsNPvGUtpINbhjazoEkYxRenaB3pyTRzRfkD58GJGLv1fNSNfy3Qah2BdpPOkDBjTVpeuKybAOw03xInutOI4v7Q/NsP5vVVSD/7QMf9QeZ0sESjXC3M6Ths2TueB1A1OuLvlzpYMmF8/cz6PE22+U3zIp1xBfLgriP3VpqE0+DTg9TuGV1AUX9S7LHkTuAu5Eyzyef0+iiACfnQED+T5S02h+2OIiEtTAcqX4ANko6TQIag== Received: from VE1EUR02FT050.eop-EUR02.prod.protection.outlook.com (2a01:111:e400:7e1e::44) by VE1EUR02HT134.eop-EUR02.prod.protection.outlook.com (2a01:111:e400:7e1e::321) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4415.16; Sat, 14 Aug 2021 02:25:44 +0000 Received: from AM9PR09MB4977.eurprd09.prod.outlook.com (2a01:111:e400:7e1e::42) by VE1EUR02FT050.mail.protection.outlook.com (2a01:111:e400:7e1e::454) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4415.16 via Frontend Transport; Sat, 14 Aug 2021 02:25:44 +0000 X-IncomingTopHeaderMarker: OriginalChecksum:5A50892E7196DA66F368F2FE53F0F76444BAC1F132668C3DA0900221B6ECDEEA; UpperCasedChecksum:525A6EEC8E4A8FA5604FA588082B11495201F47F8DFF7A07479C751BBB30876D; SizeAsReceived:7761; Count:46 Received: from AM9PR09MB4977.eurprd09.prod.outlook.com ([fe80::6558:f201:6d1a:3f39]) by AM9PR09MB4977.eurprd09.prod.outlook.com ([fe80::6558:f201:6d1a:3f39%2]) with mapi id 15.20.4415.021; Sat, 14 Aug 2021 02:25:44 +0000 From: Arthur Miller To: Juri Linkov Subject: Re: bug#49980: 28.0.50; [PATCH] Should we have project-save-buffers? References: <87czqlodpl.fsf@gmail.com> <871r70lnyi.fsf@mail.linkov.net> <87y297azuu.fsf@mail.linkov.net> <3ea58870-6b9a-41b9-c06e-d045ff9764b9@yandex.ru> <87h7ftba8p.fsf@mail.linkov.net> Date: Sat, 14 Aug 2021 04:25:43 +0200 In-Reply-To: <87h7ftba8p.fsf@mail.linkov.net> (Juri Linkov's message of "Fri, 13 Aug 2021 19:05:58 +0300") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Content-Type: text/plain X-TMN: [YqeU5U7PtLa07abVmbW82ViSxniL4V9u] X-ClientProxiedBy: AM6PR08CA0003.eurprd08.prod.outlook.com (2603:10a6:20b:b2::15) To AM9PR09MB4977.eurprd09.prod.outlook.com (2603:10a6:20b:304::20) X-Microsoft-Original-Message-ID: <87fsvc7oew.fsf@live.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from pascal.homepc (81.232.177.30) by AM6PR08CA0003.eurprd08.prod.outlook.com (2603:10a6:20b:b2::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4415.17 via Frontend Transport; Sat, 14 Aug 2021 02:25:43 +0000 X-MS-PublicTrafficType: Email X-IncomingHeaderCount: 46 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-Correlation-Id: 874d6dbe-8516-40b8-df52-08d95ecad156 X-MS-TrafficTypeDiagnostic: VE1EUR02HT134: X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: +jgCk7ldbiykB61wd77tSW/C33c76k1k1hP2gQqBgMGL91oY2ojRj9ne2oYnVlwm1k+qA197FqUlVA179k01OlZ0Wg1te7hieqCDjkAp8eFiYkRIlR/dUCbUSZ9SN8Hj5vLSG4QlJlBmIrDnddVqClRsC8013BUEYEBDq0VUETNnLU49oJ089FWpK4/vNeG17dKtKz92UJuVjSprmDEp1ECOb+wkEyoXIREOQ17hzjjIQCO93t/RNDpYOWOWYo2d0hXZZOX0i2QJ1Qpfns/203k7YUPYbmkDaNbsOyoD6C1cCxhJx0BEQYnD1RUph5QSv2FkIRmoNw7e6i5iwAJp8pVtW3+pVMdFB2CEn9fnGfaQv0yep2DeLH9AqaIQs54Tf/2jA4B6k8gp+JZ8FrPoCoPbeRKBNirpiPQG4LzviwD4pCtFTlPMNFIwd0YM3Xya X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: TSgE7QAfBBo+1c7uiM5Pzbbyv+e+697wW4faCsN34kcJNvvhPtVEhWQAWCDU7nXiRPQTZATXm6awA65BZg+DxsfjHVbaOITV0msjbqWAOzvzkUYZLdjQiPZapxPD9vTTizR+v6v6DELA2wtum87pIQ== X-OriginatorOrg: live.com X-MS-Exchange-CrossTenant-Network-Message-Id: 874d6dbe-8516-40b8-df52-08d95ecad156 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Aug 2021 02:25:44.1148 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-AuthSource: VE1EUR02FT050.eop-EUR02.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: Internet X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1EUR02HT134 X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 49980 Cc: Giap Tran , 49980@debbugs.gnu.org, Dmitry Gutov X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Juri Linkov writes: >> 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) Hi again, this works just wonderful! :) Actually it works so good, that I am thinking I am doing something wrong here. I created some files in top level and a subdirectory, with some content and it worked just fine. Literally with just adding the above line: (save-some-buffers t 'save-some-buffers-root) Fragment of my use-case: #+begin_src emacs-lisp (defun helm-git-branch--checkout (branch) (helm-aif (helm-ls-git-root-dir) (with-helm-default-directory it (with-output-to-string (with-current-buffer standard-output (save-some-buffers t 'save-some-buffers-root) (when (helm-git-branch--dirty-p) (helm-git-branch--stash)) (insert (call-process "git" nil t nil "checkout" branch)) (helm-git-branch--unstash)))))) #+end_src 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? Anyway, thank you. That was what I needed, I think you saved me quite some work. From debbugs-submit-bounces@debbugs.gnu.org Fri Aug 13 22:46:32 2021 Received: (at 49980) by debbugs.gnu.org; 14 Aug 2021 02:46:32 +0000 Received: from localhost ([127.0.0.1]:43363 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mEjgq-0005Mk-Gm for submit@debbugs.gnu.org; Fri, 13 Aug 2021 22:46:32 -0400 Received: from mail-oln040092069053.outbound.protection.outlook.com ([40.92.69.53]:24036 helo=EUR02-VE1-obe.outbound.protection.outlook.com) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mEjgk-0005MT-RI for 49980@debbugs.gnu.org; Fri, 13 Aug 2021 22:46:27 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=n8ZlAk1gs3n1wjJf6Z1SGimqn232mI9dv9noD2p0Z2WThPCLZc0JsJ6zQ/f0qpMcpA3uO6LIqHzSJHlRmVEC9pMcYikGywwo3pcptscXFTbvHxgTJf0b4/KqH5C0e36UxRuPK7oH7BfyAqjLj0QqXVqZBu/VlQRE7C3B/rc3+uAoB1z1h5SSG3aVx+LqKr1d/mpEfTnrLphlO59KLVuYy/Ev55iuNv9DzY2NUCOXfxH1KTR/83qvzCJYDxzse6Sh/Oqo9180MLqTSO5exd5KsQZcmx4Q2oK7nMDVBe4zQnclWQ8pkgb6y04PUTab99cdjOFqFomq+ccANFxaBMGXOg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=lgnMEgFotgpoDZk+sNR5erkFt393wA0uVjpDydN5dW0=; b=CLOA9y+hx4fg78Ns89k/pU/1gs0HkTvqVwpEFKF3NUz2iPU7wEIKrElzzrOJub8j0hiHhTg+//ktEYj95UPZRa0Enpwj8Y6FRGQCzgtqO+A1G1pmqdz+y4JRAdQloCDJUCfCMtcyWXjTO5xGo6PJkfUe8G2P5w0Bo1DC2RIDoAGXl5ZK3IX20Vp8vZXX1nqHb7fZvdzxialZSvH/H4E/QVGpMFYiTDxFxwn9Gc3hAJHAomUYAEbDnEqJxo0oHVnLUtdWw5oaoNnyy2oIEhXDcB7rV2MsmXGMIPVvgwL7Oa0X7KKvEGA2D2ndnMnNDlJpmSPXsWjVcaxm91xN82bWAw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=live.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=lgnMEgFotgpoDZk+sNR5erkFt393wA0uVjpDydN5dW0=; b=EdHhGK8KPdT4T9AVLSpudCASYpLMilcdg4HnCOLdSMkXF1tkrGcDoFE37WJdgxbr/7Pmwq8IA3nD8X/YV6CFbHv2g39FHjt90JkGrIfCixFhOxWP/nVmT7h1p+5K21mU96WPVOpiE3JSUb85bXejCjNkmowg2LoJeJV8M0/yKtGjCufUlN/SQdCv77fz54hhTqKx4HnClqSwv2VbvMmw3Iu+AfsvVE2r9Ek0XJ9CCx5NLXbz1wVbACy9QUscvOzGSqYsGQr8Nj05gEXXOM/81Y+gWtFbqWd+k5TepwfZqxwERs6Rc2vWfwPidC82ss2F46s9vsH7DJ+YT693wpg7Bg== Received: from AM5EUR02FT060.eop-EUR02.prod.protection.outlook.com (2a01:111:e400:7e1c::4f) by AM5EUR02HT003.eop-EUR02.prod.protection.outlook.com (2a01:111:e400:7e1c::135) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4415.14; Sat, 14 Aug 2021 02:46:16 +0000 Received: from AM9PR09MB4977.eurprd09.prod.outlook.com (2a01:111:e400:7e1c::4a) by AM5EUR02FT060.mail.protection.outlook.com (2a01:111:e400:7e1c::435) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4415.14 via Frontend Transport; Sat, 14 Aug 2021 02:46:16 +0000 X-IncomingTopHeaderMarker: OriginalChecksum:F66EB6F28330F6B851F86C102B38DBAF5346BDDA1616ABE7E46343F691CCE80A; UpperCasedChecksum:162452E6ACC0965D24DC54CCB9DD909DDD8EE106E3E99D059FE58D0BB2667222; SizeAsReceived:7768; Count:46 Received: from AM9PR09MB4977.eurprd09.prod.outlook.com ([fe80::6558:f201:6d1a:3f39]) by AM9PR09MB4977.eurprd09.prod.outlook.com ([fe80::6558:f201:6d1a:3f39%2]) with mapi id 15.20.4415.021; Sat, 14 Aug 2021 02:46:16 +0000 From: Arthur Miller To: Dmitry Gutov Subject: Re: bug#49980: 28.0.50; [PATCH] Should we have project-save-buffers? References: <87czqlodpl.fsf@gmail.com> <871r70lnyi.fsf@mail.linkov.net> <87y297azuu.fsf@mail.linkov.net> <3ea58870-6b9a-41b9-c06e-d045ff9764b9@yandex.ru> <5fc1339b-5e18-f353-47bb-1123bf443710@yandex.ru> Date: Sat, 14 Aug 2021 04:46:15 +0200 In-Reply-To: <5fc1339b-5e18-f353-47bb-1123bf443710@yandex.ru> (Dmitry Gutov's message of "Sat, 14 Aug 2021 02:54:04 +0300") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Content-Type: text/plain X-TMN: [0Wgh6voKfgccM6DDw/tnJz41WUm0pddV] X-ClientProxiedBy: AM5PR0601CA0083.eurprd06.prod.outlook.com (2603:10a6:206::48) To AM9PR09MB4977.eurprd09.prod.outlook.com (2603:10a6:20b:304::20) X-Microsoft-Original-Message-ID: <87bl607ngo.fsf@live.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from pascal.homepc (81.232.177.30) by AM5PR0601CA0083.eurprd06.prod.outlook.com (2603:10a6:206::48) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4415.14 via Frontend Transport; Sat, 14 Aug 2021 02:46:15 +0000 X-MS-PublicTrafficType: Email X-IncomingHeaderCount: 46 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-Correlation-Id: e4500544-a0ea-4811-eb2b-08d95ecdafc1 X-MS-TrafficTypeDiagnostic: AM5EUR02HT003: X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: mTaJghefNu6NwZ993yNbsJTKAUjvUY+Vm17uARiTb110xM7ZrY7OvfE544ZoB0VmOq/ecBJcSns7xeNhrnVYAXeFKKKLHOXqIDrXs09/zQrsQxXYtMwzM8y+QS6OKwm4K/xVyvEa36U9ZBpAPkdn4UCawrkcYQ5lxwDcar++JyDI8f5Vjc3KOy+cBVDRQCbYUn4G32yOXHQAN4ARhyRcaqlocjfwSXLyWllMRJIP23LGiLp7jDokZbi0bMMHZ69j1qDdsI08inFNOCJ+4uiNjbTVI62JD2xfhPNBYksqZV6gudtK5iK1NMuTJDDvo1act2uvm1weo/4XKwf1X6NlTYxhcoCuM0oaNZwDORx0qkZm+NZ7NdryB+TmQ2MybvhIqKiTv82mf2SrjOHIbyiZx5YaknOM7kD8ZYxo/xNAv1RWzImrDU0aH+r6BmMqq1xr X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: YaPuJwmcv7owRZZQMT9Sji+BcbeKKh0CY4XsoontWJUtgQ1uM0sMzPeIBco/XcT8ftcATlOouIqg3rmGrZRlyURJN2Qes62puYxtoJK8ixEG9DqT4kD8tTG0QekTkdX62F2wG7LgXVTh/dB3wn9RGg== X-OriginatorOrg: live.com X-MS-Exchange-CrossTenant-Network-Message-Id: e4500544-a0ea-4811-eb2b-08d95ecdafc1 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Aug 2021 02:46:16.3258 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-AuthSource: AM5EUR02FT060.eop-EUR02.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: Internet X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM5EUR02HT003 X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 49980 Cc: Giap Tran , 49980@debbugs.gnu.org, Juri Linkov X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Dmitry Gutov writes: > On 13.08.2021 12:39, Arthur Miller wrote: >> 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. > > Please check out Juri's solution, and if it doesn't work out, we can always add > a dedicated command. Yes I did, I just sent him an answer, it works great! So good that I am thinking I did something wrong :). 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. From debbugs-submit-bounces@debbugs.gnu.org Sun Aug 15 04:51:06 2021 Received: (at 49980) by debbugs.gnu.org; 15 Aug 2021 08:51:06 +0000 Received: from localhost ([127.0.0.1]:45739 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mFBrC-0005S0-Kl for submit@debbugs.gnu.org; Sun, 15 Aug 2021 04:51:06 -0400 Received: from relay6-d.mail.gandi.net ([217.70.183.198]:43215) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mFBr7-0005RI-0k for 49980@debbugs.gnu.org; Sun, 15 Aug 2021 04:51:00 -0400 Received: (Authenticated sender: juri@linkov.net) by relay6-d.mail.gandi.net (Postfix) with ESMTPSA id 0E9F8C0005; Sun, 15 Aug 2021 08:50:48 +0000 (UTC) From: Juri Linkov To: Arthur Miller Subject: Re: bug#49980: 28.0.50; [PATCH] Should we have project-save-buffers? Organization: LINKOV.NET References: <87czqlodpl.fsf@gmail.com> <871r70lnyi.fsf@mail.linkov.net> <87y297azuu.fsf@mail.linkov.net> <3ea58870-6b9a-41b9-c06e-d045ff9764b9@yandex.ru> <87h7ftba8p.fsf@mail.linkov.net> Date: Sun, 15 Aug 2021 11:32:49 +0300 In-Reply-To: (Arthur Miller's message of "Sat, 14 Aug 2021 04:25:43 +0200") Message-ID: <87bl5zl3na.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 49980 Cc: Giap Tran , 49980@debbugs.gnu.org, Dmitry Gutov X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) > (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 From debbugs-submit-bounces@debbugs.gnu.org Sun Aug 15 06:45:09 2021 Received: (at 49980) by debbugs.gnu.org; 15 Aug 2021 10:45:09 +0000 Received: from localhost ([127.0.0.1]:45847 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mFDdd-0002Aj-0F for submit@debbugs.gnu.org; Sun, 15 Aug 2021 06:45:09 -0400 Received: from mail-oln040092071068.outbound.protection.outlook.com ([40.92.71.68]:56807 helo=EUR03-DB5-obe.outbound.protection.outlook.com) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mFDdZ-00029u-8u for 49980@debbugs.gnu.org; Sun, 15 Aug 2021 06:45:08 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Lybcy8+/8+n7HBUonzpeqOqzfdgzEw4Oa+qYxVKZbs0IKJJwpVpODFQ917v9crM1M/AerS7k7N34JOjh1PK+kstICH4d8jvRhe3BOPwap2ltupSbIeiFcOPWpYBOdGQRmXRLpZHyiP9Yujuv+KsL+cNucH6G6AyNAzt88rHnPuBhGDzZL75srj/HLQvXwvwvKjqrJIIiKHvEbdsL/6gDBDyQfDTCu0uDuhLe03iQkMIgPH/iQylW4u6pAo6OKgiTcVQfUBMmoQzuFtA2OT7HKESfW5+x3wO5rxcmR6CWD513iQQjoREXZYrte/QEfoNKq+DryolnGGiHGsVBUQhvIg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=IOL8mvtgzoXvRUF2yfh61bDdbx9G2b4jSj1DcVRZc3g=; b=n9mX1ML2v/Jg4WMQsDfq/Uxy14IJr+QeK3+/eqS5pLgMMm7ViYWCo7g3u2MRMqLatb95EWBLiP9YTxdpo7JCmVMumpF9fQKI6SBnSj7pmQu+VgeQcSJ50S0i6KzQr2X4D7YXafMk2OYQbDCcmOHZU3K1QzWY73rn1xFzJMzTzxup04qTbE0uB8xYd70RSpHnNgIRLudiaYFr/VNEyBoyXoMR4jlQRgzcNtbeDKe82Xm9V3l47SCa8SZilGwawVb2JsPE3Eo1DnaHiLZYwhnrIZReYzoYO/TId2L+ij8h68TjIzRhffKznmFcxqT9IyHkuANcYpG9IaWvhVJ4jbj8LA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=live.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=IOL8mvtgzoXvRUF2yfh61bDdbx9G2b4jSj1DcVRZc3g=; b=N74DhLBek2dAjesn4IEqP+vlRQxBSRL9p9KY5wuAGVxIhMeilWd8/qb2AgGY6/r4Yhyw7xRpD1+Kw6Fg0d/+Jam4EdPFqRz/KJ7+uTfDgDH/50AMc1sPX5ufTNSKFAHltVEBo6cc0tXKIrT5Rq8qO6EaBhNd4eNIDOiavcnS+E2sn3jcg3qdBYtepGtEoGv1gEBNM3j+nlRUn1vgx/wO6efdXyv/G/Cn1acIw9NlCRADd3vjxhL3HAa6Y1KTCzXnUUHObfHCE5PPQ9SDbghREXiEhvVCbm0LwegUBXSr7p81joUpB96UyG1iC11VG3mJJtUJ+TjCbwn8tmRt93YW6Q== Received: from DB5EUR03FT033.eop-EUR03.prod.protection.outlook.com (2a01:111:e400:7e0a::53) by DB5EUR03HT043.eop-EUR03.prod.protection.outlook.com (2a01:111:e400:7e0a::352) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4415.16; Sun, 15 Aug 2021 10:44:58 +0000 Received: from AM9PR09MB4977.eurprd09.prod.outlook.com (2a01:111:e400:7e0a::43) by DB5EUR03FT033.mail.protection.outlook.com (2a01:111:e400:7e0a::76) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4415.16 via Frontend Transport; Sun, 15 Aug 2021 10:44:58 +0000 X-IncomingTopHeaderMarker: OriginalChecksum:7D3879EA39CFA3D4E7A6A7D019022C1212B0A626A2DB5CA3944AB4755A78E7A1; UpperCasedChecksum:14B8C5D47F9B2F291107D963146FE19454709E25828BEE83A3FC4AF7487A2130; SizeAsReceived:7894; Count:46 Received: from AM9PR09MB4977.eurprd09.prod.outlook.com ([fe80::6558:f201:6d1a:3f39]) by AM9PR09MB4977.eurprd09.prod.outlook.com ([fe80::6558:f201:6d1a:3f39%2]) with mapi id 15.20.4415.022; Sun, 15 Aug 2021 10:44:58 +0000 From: Arthur Miller To: Juri Linkov Subject: Re: bug#49980: 28.0.50; [PATCH] Should we have project-save-buffers? References: <87czqlodpl.fsf@gmail.com> <871r70lnyi.fsf@mail.linkov.net> <87y297azuu.fsf@mail.linkov.net> <3ea58870-6b9a-41b9-c06e-d045ff9764b9@yandex.ru> <87h7ftba8p.fsf@mail.linkov.net> <87bl5zl3na.fsf@mail.linkov.net> Date: Sun, 15 Aug 2021 12:44:57 +0200 In-Reply-To: <87bl5zl3na.fsf@mail.linkov.net> (Juri Linkov's message of "Sun, 15 Aug 2021 11:32:49 +0300") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Content-Type: multipart/mixed; boundary="=-=-=" X-TMN: [dUgUqO8smHiGIQuYo7RXiHD4FGyZcA+m] X-ClientProxiedBy: AM5PR0701CA0058.eurprd07.prod.outlook.com (2603:10a6:203:2::20) To AM9PR09MB4977.eurprd09.prod.outlook.com (2603:10a6:20b:304::20) X-Microsoft-Original-Message-ID: <87mtpjc7h2.fsf@live.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from pascal.homepc (81.232.177.30) by AM5PR0701CA0058.eurprd07.prod.outlook.com (2603:10a6:203:2::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4436.9 via Frontend Transport; Sun, 15 Aug 2021 10:44:58 +0000 X-MS-PublicTrafficType: Email X-IncomingHeaderCount: 46 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-Correlation-Id: 52768990-1b12-4f63-2bb8-08d95fd9b9ea X-MS-TrafficTypeDiagnostic: DB5EUR03HT043: X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: UWKS9RfWXq3mhj3nPvNrGuzCdTJc0X8qbvirKLIvrruKoaB75Q6w4Ocjs7+8ZevBbcS65XHKm/8c32AFkm5/MB+vehSZIcszQSo/HX/PpXJPwcwfnYGv5oNVi6PZyI8WvZHmsaygAEZZ2QTGev6lnof6VnfRaml4369DJEzymJTfC+ddgW3SHttnpGcK1vBZlaP1mddrzEK9IsVRM764JqJYru0mVog9jPLF88AH6vLJXTw1VhoisIKPhqi2RmJJKHSFlkvkZqUf4BE3GuTkepQaoyQWszHLKbQMKZeL9SQdwp4aMXAdEDiQ/YrPqyYrDnR7VnIC6D91bMpW5Qq+jV/1r/3Fg8OBBhNg2wY2+wNBe7aP82XDTB6m+IuPgjRxxBdj6FFpyRiFbcxLUopB7FBmNRo5WXj9qEQLJRjSdebndn6ay2ZmL4urXquevnXTTpi8c1uNPegjBcDmrwOQaofIdAjH1Fonnn42lEQ7CA4= X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: qlTV/ophoX+5Ye3GgqpIsbS9FSDb2cXC2BXGhtsCdPj2Cp0O2Nq0QPbfsli90sPea6qy70i8bJ++AnHnTaXieIwVZvInZANyXXNPJFf2YmKXnck/TETlmwMJ/rgL9ifupCS4l+jdpo0KcmWkSMjmpw== X-OriginatorOrg: live.com X-MS-Exchange-CrossTenant-Network-Message-Id: 52768990-1b12-4f63-2bb8-08d95fd9b9ea X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Aug 2021 10:44:58.4764 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-AuthSource: DB5EUR03FT033.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: Internet X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB5EUR03HT043 X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 49980 Cc: Giap Tran , 49980@debbugs.gnu.org, Dmitry Gutov X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --=-=-= Content-Type: text/plain Juri Linkov writes: >> (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: Ah, that was was the magic. I was looking into those functions, but wasn't really sure what I should snitch :). > 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 Thank you! >> 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 I have to admit, I haven't followed so much the discussion, this was just sommething I wished to had for longer time, but never come about to implement. I am not sure if my approach is correct. I think it can mess up things when multiple branches get changed. If there are only two branches invloved, a->b, b->c, there are no problems (I think). Also with multiple branches without changes there should be no problems. But in case of a->b, b->c, ... , c->n, I am not sure, but I believe they would have to be checked out in correct reversed order. Otherwise I think there is possiblity that applied stashes tramp over each others and cause conflicts. I don't know, I haven't had time to test it that far. I had this for a couple of weeks, and works fine for my modest need, but I would appreciate some more input on the code. I have attached it the source in this mail, if anyone is interested to look at it, but there is also a github project with some more info in a readme file at: https://github.com/amno1/helm-git-branch I am thankful for all input, and thanks for all your help Juri! --=-=-= Content-Type: text/plain Content-Disposition: attachment; filename=helm-git-branch.el ;;; helm-git-branch.el --- Switch git branch with Helm interface. -*- lexical-binding: t; -*- ;; Copyright (C) 2021 Arthur Miller ;; Author: Arthur Miller ;; Keywords: ;; This program is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by ;; the Free Software Foundation, either version 3 of the License, or ;; (at your option) any later version. ;; This program is distributed in the hope that it will be useful, ;; but WITHOUT ANY WARRANTY; without even the implied warranty of ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ;; GNU General Public License for more details. ;; You should have received a copy of the GNU General Public License ;; along with this program. If not, see . ;;; Commentary: ;; ;;; Code: (require 'helm-ls-git) (defvar helm-source-git-local-branches nil "This source will built at runtime. It can be build explicitly with function `helm-git-build-local-branches-source'.") (defface helm-git-branch-current-clean-face '((t :foreground "#2aa198")) "Files which contain rebase/merge conflicts." :group 'helm-ls-git) (defface helm-git-branch-current-dirty-face '((t :foreground "#dc322f")) "Files which contain rebase/merge conflicts." :group 'helm-ls-git) ;;; Custom (defgroup helm-git-branch nil "Fast git branch switching with Helm." :group 'helm) (defcustom helm-git-branch-changes-action 'stash "The default action upon changing a branch with uncommited changes. If this option is set to 'stash the changes will be automatically stashed. If this option is set to 'commit the changes will automatically commited." :type 'symbol :group 'helm) (defgroup helm-git-branch nil "Fast git branch switching with Helm." :group 'helm) (defcustom helm-git-branch-stash-prefix "helm-git-branch--" "The prefix to prepend to stash names when autostashing a branch." :type 'string :group 'helm) (defcustom helm-git-branch-auto-save-on-change t "" :type 'boolean :group 'helm) (defcustom helm-git-branch-auto-stash-unstaged t "" :type 'boolean :group 'helm) (defcustom helm-git-branch-fuzzy-match nil "Enable fuzzy matching in `helm-git-*-branch'." :group 'helm-branch-git :set (lambda (var val) (set var val) (setq helm-source-git-local-branches nil)) :type 'boolean) (defmacro replace-all (from to &optional buffer) `(with-current-buffer (or ,buffer (current-buffer)) (goto-char (point-min)) (while (search-forward ,from nil t) (replace-match ,to)))) (defun git-make-cmd (git-args &rest cmd-args) (let ((cmd (seq-concatenate 'list '(call-process "git" nil t nil) (split-string git-args) cmd-args))) `(lambda () ,cmd))) (defun git-call (git-args) (funcall (git-make-cmd git-args))) (defmacro with-helm-git (git-cmd &rest body) `(nbutlast (split-string (helm-aif (helm-ls-git-root-dir) (with-helm-default-directory it (with-output-to-string (with-current-buffer standard-output (insert (format "%s" (git-call ,git-cmd))) ,@body (buffer-string))))) "\n" t "[\s\t]*"))) (defvar helm-git-branch-map (let ((map (make-sparse-keymap))) (set-keymap-parent map helm-generic-files-map) map)) (defvar helm-git-branch-buffer-map (let ((map (make-sparse-keymap))) (set-keymap-parent map helm-buffer-map) map)) ;;; Sources (defun helm-git--local-branches () (with-helm-git "branch")) (defun helm-git-branch-local-transformer (candidates _source) (cl-loop with root = (helm-ls-git-root-dir) for i in candidates collect (cond ((string-match "^\\(*\\)\\(.*\\)" i) ; current branch (if (helm-git-branch--dirty-p) (cons (propertize i 'face 'helm-git-branch-current-dirty-face) (expand-file-name (match-string 2 i) root)) (cons (propertize i 'face 'helm-git-branch-current-clean-face) (expand-file-name (match-string 2 i) root)))) (t i)))) (defun helm-git-branch-local-action-transformer (actions _candidate) (when (= 1 (length (helm-marked-candidates))) (helm-make-actions "Checkout branch" (lambda (_candidate) (let ((marked (helm-marked-candidates))) (dolist (f marked) (vc-git-revert f) (helm-aif (get-file-buffer f) (with-current-buffer it (revert-buffer t t))))))) actions)) (defclass helm-git-local-source (helm-source-in-buffer) ((header-name :initform 'helm-ls-git-header-name) (init :initform (lambda () (helm-init-candidates-in-buffer 'global (helm-git--local-branches)))) (keymap :initform 'helm-git-branch-map) (action :initform (helm-make-actions "Git checkout" (lambda (_candidate) (helm-git-branch--checkout _candidate)))) (filtered-candidate-transformer :initform 'helm-git-branch-local-transformer) (action-transformer :initform 'helm-git-branch-local-action-transformer))) (defun helm-git-build-local-branches-source () ;;(and (memq 'helm-source-ls-git-branches helm-ls-git-default-sources) (helm-make-source "Local branches" 'helm-git-local-source :fuzzy-match helm-git-branch-fuzzy-match :group 'helm :keymap helm-git-branch-map)) (defun helm-git-branch--dirty-p () (not (string-blank-p (helm-ls-git-status)))) (defun helm-git-branch--stash () (helm-aif (helm-ls-git-root-dir) (with-helm-default-directory it (with-output-to-string (with-current-buffer standard-output (insert (call-process "git" nil t nil "stash" "save" (when helm-git-branch-auto-stash-unstaged "-u") (concat helm-git-branch-stash-prefix (helm-ls-git--branch))))))))) (defun helm-git-branch--unstash () (helm-aif (helm-ls-git-root-dir) (with-helm-default-directory it (with-output-to-string (with-current-buffer standard-output (insert (call-process "git" nil t nil "stash" "list")) (goto-char (point-min)) (when (search-forward (concat helm-git-branch-stash-prefix (helm-ls-git--branch)) nil t) (goto-char (line-beginning-position)) (search-forward "}" (line-end-position)) (let ((stash (buffer-substring-no-properties (line-beginning-position) (point)))) (call-process "git" nil t nil "stash" "apply" stash) (call-process "git" nil t nil "stash" "drop" stash)))))))) (defun helm-git-branch--checkout (branch) (helm-aif (helm-ls-git-root-dir) (with-helm-default-directory it (with-output-to-string (with-current-buffer standard-output (when helm-git-branch-auto-save-on-change (save-some-buffers t 'save-some-buffers-root)) (when (helm-git-branch--dirty-p) (helm-git-branch--stash)) (insert (call-process "git" nil t nil "checkout" branch)) (helm-git-branch--unstash)))))) ;;; Commands ;;;###autoload (defun helm-git-local-branches (&optional arg) (interactive "p") (let ((helm-ff-default-directory (or helm-ff-default-directory default-directory))) (when (and arg (not (helm-ls-git-root-dir))) (error "Not inside a Git repository")) (setq helm-source-git-local-branches (helm-git-build-local-branches-source)) (helm-set-local-variable 'helm-ls-git--current-branch (helm-ls-git--branch)) (helm :sources helm-source-git-local-branches :ff-transformer-show-only-basename nil :truncate-lines helm-buffers-truncate-lines :buffer "*helm branches*"))) (provide 'helm-git-branch) ;;; helm-git-branch.el ends here --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Sun Aug 15 20:37:52 2021 Received: (at 49980) by debbugs.gnu.org; 16 Aug 2021 00:37:52 +0000 Received: from localhost ([127.0.0.1]:47977 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mFQdU-0003W6-Ca for submit@debbugs.gnu.org; Sun, 15 Aug 2021 20:37:52 -0400 Received: from mail-wm1-f54.google.com ([209.85.128.54]:40828) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mFQdQ-0003Vr-Dk for 49980@debbugs.gnu.org; Sun, 15 Aug 2021 20:37:51 -0400 Received: by mail-wm1-f54.google.com with SMTP id f12-20020a05600c4e8c00b002e6bdd6ffe2so7962434wmq.5 for <49980@debbugs.gnu.org>; Sun, 15 Aug 2021 17:37:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=M+rREhzt5mCuwQgiBQKSEL41uOleSca85DOgwXpSQjI=; b=GYwwxuaQPOKK/RJvhYHVfhSnPxkwNwzIm3ti3Okk17WwyyvwssaexRiquUIqtujT/j 7WiXXBAb69hYODg+6i4VlGAiSyicc6MVtJHZDJBQU9QP9IfgbUczpSB/zzzcJqV6mtTS eZV1+pmZVf/lwdrr7CkuN+ueouvveOA5f02IizV/vPz7X6y2ogs7PvXB/kTDQJm06VYo qs8qoo0GibnCBNrZJVWIDq5ZR7BYkKInagHp19uOk0uAVBD1zBK3aHL/Dlk58IHfl7Wk poQRdxr5fFt+5F1ih1WNvBxoZ1AZbWCEFV7Q+uxS5ifnoFB7L8nnbX9aLMIfbJXeP3kB pwbw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:subject:to:cc:references:from:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=M+rREhzt5mCuwQgiBQKSEL41uOleSca85DOgwXpSQjI=; b=YjZHxBVMT9msz+wnHfg5aSikWf33eQg53/noT7cIx5HGbIz6YsmDahRT1YqMA85rsZ ahMt2EyTaSLr0LIF+bjtc8NYQ9vFicLAZC6USFI08Oq1LI4JVPUznj2E+8D6JCM+M1KK Z44d7TpZX1d//2wTSp+IblvnOBnUkYVXmyklKROrwqx+gqzszduda2HKBUn1HvSrqel0 9gBqxpZySmhoMlYW58vP9vzcmCXW4Tg5A+kDo4BRCDFOGwUaq/g1w6Y8361YnlvgB7H1 CDbjtovkTpnZMBh/qqgsc8rkU0Chu+rUgZSdQVqWFQPLf/Jlg2sSaQJ1mjIxeYmN/pcD d8BQ== X-Gm-Message-State: AOAM531I56LVZ6ishX84EIMlCGsx9Mqt3p2a7bDTj+lk4pYVjkKWcemT i4Fj1k8RcH1bJyfZ8+Niq04zLuS9yys= X-Google-Smtp-Source: ABdhPJxPige6hgWmPuIFMb46MPssnPEo4hX5+Kiy7DXqutRnverc+REJCFlR/Yq/7/oOL5NptIfqaw== X-Received: by 2002:a1c:26c5:: with SMTP id m188mr12810440wmm.19.1629074262613; Sun, 15 Aug 2021 17:37:42 -0700 (PDT) Received: from [192.168.0.6] ([46.251.119.176]) by smtp.googlemail.com with ESMTPSA id f2sm9666540wru.31.2021.08.15.17.37.41 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 15 Aug 2021 17:37:42 -0700 (PDT) Subject: Re: bug#49980: 28.0.50; [PATCH] Should we have project-save-buffers? To: Arthur Miller References: <87czqlodpl.fsf@gmail.com> <871r70lnyi.fsf@mail.linkov.net> <87y297azuu.fsf@mail.linkov.net> <3ea58870-6b9a-41b9-c06e-d045ff9764b9@yandex.ru> <5fc1339b-5e18-f353-47bb-1123bf443710@yandex.ru> From: Dmitry Gutov Message-ID: Date: Mon, 16 Aug 2021 03:37:40 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Score: 0.4 (/) X-Debbugs-Envelope-To: 49980 Cc: Giap Tran , 49980@debbugs.gnu.org, Juri Linkov X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.6 (/) On 14.08.2021 05:46, Arthur Miller wrote: > 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. Speaking of strategy, that sounds like something I routinely do by hand, so... it seems fine? Though I usually keep unregistered files alone, because those can be both related to the current work I'm doing, or totally unrelated and be, for example, some new project settings I haven't checked in (and perhaps never intend to). From debbugs-submit-bounces@debbugs.gnu.org Sun Aug 15 21:19:39 2021 Received: (at 49980) by debbugs.gnu.org; 16 Aug 2021 01:19:39 +0000 Received: from localhost ([127.0.0.1]:48003 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mFRHr-0004Vn-Ug for submit@debbugs.gnu.org; Sun, 15 Aug 2021 21:19:39 -0400 Received: from mail-oln040092068097.outbound.protection.outlook.com ([40.92.68.97]:20457 helo=EUR02-HE1-obe.outbound.protection.outlook.com) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mFRHm-0004VV-Ts for 49980@debbugs.gnu.org; Sun, 15 Aug 2021 21:19:35 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=NGm9KX9BfpGStu92TBgOfPNli/pDA1aHk7C6UmpRxQQVf/DIxfFQIDmspHX04dCXSFLqGau4DjjmcQTSl0hqP4VZ+199Vqh47k0PMMGulOPe3JRFGt2yOMwOKNwigTmf4xRFipvm2KjiSAlc4SWtd78doCbO3YC9lvyPV6X6+TbougUr3eLldtwfjwn6n7XdVLOWoBRQj4iJKXW/K+sPYH9F35u8DzHGn4PltfnuelLhy/QODtMulyu4ucnlLHYMFs1yWh3bwrZF9ZXTwMR4y/bs4PrO8o9eMKDxPQYW4YyUsK/IsOQqPTzmRzV6dk3duNPTVgRne7HUuCXAFZ7J3w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=K6aIeERf3iz+FdIXWt2hOBxh1oldh0x7oQ9ggwbypxI=; b=GMvwoTpIql4knYN/gow4E449A5oiYSll2h7fY0PwnrjU0Sv42J936sZJYuibA/sni1ZqYxy77PBacgx4m0qOVsUTQ6/lwDEU3E1oVTBROZbjfM+Kvj/7lftckyYtaTwSAWw9hhMWpRvEC3o8ntNslgSmrr0d73g6ykjEi6Ry2uVkr6QngdKTS30stEEJgDKqR/DvZQn+Xcq8b42kPf1wCeLKxK02ddT9Q1dSD3OuUgTptInL664ve0HmStGFk91DJTK2eAK+hn1QPxsq/2Xee1NHOYlhLTjJCZNCIUwgOCZsxEBjSwldBYV4WVNagCKxHH59Icb+sWBGiUJyVfsITQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=live.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=K6aIeERf3iz+FdIXWt2hOBxh1oldh0x7oQ9ggwbypxI=; b=C8Wvk3BO0ZSJSaruh7Smm2YVowDhUH0A8t6UXQpQJaRwH/bTy7E0K58UvSbMabl9e8f8zpwdBp1v4/sr+gFry6/HnD/f7i6W6bQPGGcGb17Hc2lbtEfv7sjMEefWI6ZJVtA4DBpVM/yssXt6qe7IL0z7d6/f6BbVnks9ddYLq4n2qJwvEjQGRhvyKtaj650jPMDZFDsMwFO+nHrrq9V4uaebd4MKopJdszVOuZqaKRHo01LpNMTBCNi4BHLPBCMAWkX2wI2KpF8BpQuxvE0/lYC+9Ozgx2y9KHvAjgfW2WjPGgnmGV17N6PanJS0cUgWfM62FR7vXJRUd8CgqNVSzQ== Received: from AM5EUR02FT006.eop-EUR02.prod.protection.outlook.com (2a01:111:e400:7e1c::48) by AM5EUR02HT109.eop-EUR02.prod.protection.outlook.com (2a01:111:e400:7e1c::212) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4415.16; Mon, 16 Aug 2021 01:19:23 +0000 Received: from AM9PR09MB4977.eurprd09.prod.outlook.com (2a01:111:e400:7e1c::43) by AM5EUR02FT006.mail.protection.outlook.com (2a01:111:e400:7e1c::77) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4415.16 via Frontend Transport; Mon, 16 Aug 2021 01:19:23 +0000 X-IncomingTopHeaderMarker: OriginalChecksum:151BCE51AF389E9C8730D6AB4B57D0ABCDBA4EB0C5EE68E5434A997EF0B36512; UpperCasedChecksum:98F7B9BE6B0D9B372424DD88C827ADBE06484555C853CA1847C4E99DD5365458; SizeAsReceived:7927; Count:46 Received: from AM9PR09MB4977.eurprd09.prod.outlook.com ([fe80::6558:f201:6d1a:3f39]) by AM9PR09MB4977.eurprd09.prod.outlook.com ([fe80::6558:f201:6d1a:3f39%2]) with mapi id 15.20.4415.023; Mon, 16 Aug 2021 01:19:23 +0000 From: Arthur Miller To: Dmitry Gutov Subject: Re: bug#49980: 28.0.50; [PATCH] Should we have project-save-buffers? References: <87czqlodpl.fsf@gmail.com> <871r70lnyi.fsf@mail.linkov.net> <87y297azuu.fsf@mail.linkov.net> <3ea58870-6b9a-41b9-c06e-d045ff9764b9@yandex.ru> <5fc1339b-5e18-f353-47bb-1123bf443710@yandex.ru> Date: Mon, 16 Aug 2021 03:19:22 +0200 In-Reply-To: (Dmitry Gutov's message of "Mon, 16 Aug 2021 03:37:40 +0300") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Content-Type: text/plain X-TMN: [0L3TV1rkSPOKPAbOC2q65JgDclqCX6jJ] X-ClientProxiedBy: AM6P195CA0078.EURP195.PROD.OUTLOOK.COM (2603:10a6:209:86::19) To AM9PR09MB4977.eurprd09.prod.outlook.com (2603:10a6:20b:304::20) X-Microsoft-Original-Message-ID: <87y292i3tx.fsf@live.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from pascal.homepc (81.232.177.30) by AM6P195CA0078.EURP195.PROD.OUTLOOK.COM (2603:10a6:209:86::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4415.15 via Frontend Transport; Mon, 16 Aug 2021 01:19:23 +0000 X-MS-PublicTrafficType: Email X-IncomingHeaderCount: 46 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-Correlation-Id: af319feb-2ee3-42ef-989c-08d96053e1b5 X-MS-TrafficTypeDiagnostic: AM5EUR02HT109: X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: GVzFd47ILIRz/6SvAjCC2UgYeOTOGNaLCTohOhOHHbiobIQZw0b+Vrxi3aiT9PxUwAZlnS7Q8mM9pZQTlh4A02kGTbcgx41ifAz/WheEicSTSL1u1h0cc/hjHlIp7qc5gfL+nhleC5i/p+jJeBPeT0WRin/Dtj4SmY06/0LiIAyvdslAN/SvWGbTcWG499CQXLLZA5fadXt19/iQD/ENbeBKEZM8mcaRyayJw+U8Wf//+1GvHtty0Z+80j317zaP2iuEheMAWDnsBSLphOjE8pDm5o+rUNwtCAFljGyX1RSZJ9YXrKi7bE/KqO1b+A6865Mv+UQvmsH/mghRLX/SGteffq2VhvjKFzts5Cu5olm6nWuP+dbjhcfUdqdZOyZTBIMUEtUm7sl/Ar/T+hkA5Q4okYXXP8K22pI8D0MqGBna87OkEDlTwm6/P4tzrByc X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: cIfP8PwI5pRnVXaQvE5BG0wrpKvEevPErJaFHleCFE5H6OzO6RTEusrST1Ma2HTcsYA4fO5aRfEFMriEL5rZNFrZr1bJyShYAFqFqB4Vup7il86unoiu+OgpIHpGBqYyxvZ6plb1eRXEBDqZn/MWdA== X-OriginatorOrg: live.com X-MS-Exchange-CrossTenant-Network-Message-Id: af319feb-2ee3-42ef-989c-08d96053e1b5 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Aug 2021 01:19:23.7750 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-AuthSource: AM5EUR02FT006.eop-EUR02.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: Internet X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM5EUR02HT109 X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 49980 Cc: Giap Tran , 49980@debbugs.gnu.org, Juri Linkov X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Dmitry Gutov writes: > On 14.08.2021 05:46, Arthur Miller wrote: >> 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. > > Speaking of strategy, that sounds like something I routinely do by hand, > so... it seems fine? > > Though I usually keep unregistered files alone, because those can be both > related to the current work I'm doing, or totally unrelated and be, for example, > some new project settings I haven't checked in (and perhaps never intend to). And as Oscar F. wrote in another thread, can lead to many gigabytes of data stashed away. Yes, I agree, I stash with -u by default, but I do have var to turn it off. What do you think about checking out, between multiple different branches? Switching two branches back and forth is no brainer, it should always work fine, but switching multiple branches can lead to mess since stashes are applied automatically. Any good strategy to automate this case? Honestly, I don't see much difference than doing it manually, but I am a bit affraid of auto applying stashes. From debbugs-submit-bounces@debbugs.gnu.org Sun Aug 15 23:06:33 2021 Received: (at 49980) by debbugs.gnu.org; 16 Aug 2021 03:06:33 +0000 Received: from localhost ([127.0.0.1]:48037 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mFSxN-00071o-2H for submit@debbugs.gnu.org; Sun, 15 Aug 2021 23:06:33 -0400 Received: from mail-wr1-f49.google.com ([209.85.221.49]:37479) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mFSxL-00071X-8u for 49980@debbugs.gnu.org; Sun, 15 Aug 2021 23:06:31 -0400 Received: by mail-wr1-f49.google.com with SMTP id r6so21547367wrt.4 for <49980@debbugs.gnu.org>; Sun, 15 Aug 2021 20:06:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=DhnFduby1R9wjUiRWQ+TawDrlMc8a/vnQuJxBunHDPQ=; b=eFNkvMA53YSD6EHPnFkZJW93qUK6QrIn73DO/nqwnNxKtYOxAx+s85IvbOzrJUjH40 Nk7FQ+/0tN4c6cGbO0APlG6jjprT863BKVs8KXE4SSar1JPZcr1TP1oFDU4LMuNkgbbC 8XtrNiKzvoPXuhPHsefSZx9pK5Hm+KzbjrpLsQrxTUfEXY7Cwoj4IHU/1LfOveB0Cmm3 zmBRIzVczfrFwV/PDlauUQr08Np9AAlmBtafVq+7uTEC8GimsJ5577k3nkoMG2EwV9s7 kuO6bdY0Cel/nsoBXOSulslYSD7RPIRhqGZK3KHxnGOdjXfJn1PShUHgX10jms1gMrOI QOgw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:subject:to:cc:references:from:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=DhnFduby1R9wjUiRWQ+TawDrlMc8a/vnQuJxBunHDPQ=; b=jvOplu0Mwjoudu2c7OsX2DWPwC9alviXExLOWOzhsJPgqgkeLlI4ZBtHRgdQy3LhSQ JBZGLiE9vD6dZpsdMS5eASo5GFCx8N9DDszTEnnA/TWUayLJ1lkaFpL9Wv3XaHi69MsY XE5rNnkorAkYf4U220sKEoMCeyeMBPaSeHIps8sx+8dSOurAnP/EO2n1yS1ty1DjN6aa dysZTGZl6/QDoicp/cB93BUPV1obIBDq3dLAMvFYI4q2/P48oMUzf2kETRsHnEPuEsnB 8yJHrRxWx0YUWPsyr3QnIwmeYvICL50LCVKCgWPp1Msarf+hY7qlSEXF1cv5hNuQiJ4m P12Q== X-Gm-Message-State: AOAM5333I9nk7TFkXyx0CXrJj1c9gkQRKzF062PIwqX9Vwg/Z++wDqlR Xt8rD+RD7OgtsMP+2D/fH6axn1fWiCg= X-Google-Smtp-Source: ABdhPJzQ8h/dtYTwbw3Y8XItl0H0f/RG3UjqRhnsjOapfm1oBWcQx7bKF9G9C/Vl/P3/0peVhcUjzA== X-Received: by 2002:a5d:638b:: with SMTP id p11mr15692068wru.257.1629083185553; Sun, 15 Aug 2021 20:06:25 -0700 (PDT) Received: from [192.168.0.6] ([46.251.119.176]) by smtp.googlemail.com with ESMTPSA id i3sm8862507wmb.17.2021.08.15.20.06.24 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 15 Aug 2021 20:06:24 -0700 (PDT) Subject: Re: bug#49980: 28.0.50; [PATCH] Should we have project-save-buffers? To: Arthur Miller References: <87czqlodpl.fsf@gmail.com> <871r70lnyi.fsf@mail.linkov.net> <87y297azuu.fsf@mail.linkov.net> <3ea58870-6b9a-41b9-c06e-d045ff9764b9@yandex.ru> <5fc1339b-5e18-f353-47bb-1123bf443710@yandex.ru> From: Dmitry Gutov Message-ID: <5965bcdd-d09a-0fef-18ba-c75de3200845@yandex.ru> Date: Mon, 16 Aug 2021 06:06:23 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Score: 0.4 (/) X-Debbugs-Envelope-To: 49980 Cc: Giap Tran , 49980@debbugs.gnu.org, Juri Linkov X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.6 (/) On 16.08.2021 04:19, Arthur Miller wrote: > What do you think about checking out, between multiple different > branches? Switching two branches back and forth is no brainer, it should > always work fine, but switching multiple branches can lead to mess since > stashes are applied automatically. Any good strategy to automate this > case? I don't know. You're automating a case I have been handling manually (and hadn't been bothered by that, thus far). You will most likely encounter some edge cases where the automation breaks, but it's hard to predict those in advance. > Honestly, I don't see much difference than doing it manually, but I am a > bit affraid of auto applying stashes. As long as they're named ones (and thus you won't miss and accidentally pop an unrelated one), this should work fine. From debbugs-submit-bounces@debbugs.gnu.org Mon Aug 16 09:22:48 2021 Received: (at 49980) by debbugs.gnu.org; 16 Aug 2021 13:22:48 +0000 Received: from localhost ([127.0.0.1]:49003 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mFcZj-0007Op-Qs for submit@debbugs.gnu.org; Mon, 16 Aug 2021 09:22:48 -0400 Received: from mail-db8eur05olkn2061.outbound.protection.outlook.com ([40.92.89.61]:44641 helo=EUR05-DB8-obe.outbound.protection.outlook.com) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mFcZg-0007OU-Q1 for 49980@debbugs.gnu.org; Mon, 16 Aug 2021 09:22:46 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=DDBDWGKi67v9EcEoE9VclyEAIjTdhU8TIdXbhtmgwNJ2B9p66WmELikGK8hPD9bIunL4x56H+vG1A96J6fLMskR9uMagYzT/dq8QM4iBKaugvtNQ8iiiYOvMGGgEH05UaEW4Jj5XGfmnpqR8M8uh+eOlR9535BUCRfW890+1GcrewL2Mrv9Nk/n+fN0RxnCPxzY/kE0h8QBNPc4FfztrM1HB89WDeK9cK/eGlwBZDluKrUzTupQLtZHm5LNlbTTS2xfACtAs8UvtvSR5to9YBqHR2bWM5QO56e1LTxoknKCCHmwLkj2j2KqhsmXhK4ujrmBkm9B1sYY076PS4vxE7Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=OtRCQrXh1fGVdgj90zBxg8mWaBqGM/oPpIh3TsS+Epc=; b=ca/c7BtQqe/3X3uIDhsEoXTIDetgLlbDtYGBDSKBGb8Kqs/uEhd5/K/R26BBIOXeXeA3M/Wx4TH80VlL/2C78cJfgsILno8aNPoouX+t12ZJ+r74Yu8sm+4vMkEG7LEqm1g4KlYL5h0t9tNYv4rSvFCibghA/q1VMUhcAQm6SGvGqKIeuTceaydxv8TdxIzIEJ+ci7kBL+ZXwXAyKWYZ0liSNuHXMOdqRiAPsXeh/YwbYV2uj7n/PxHVDNTwl6sqlO1ZljkIWqHt1N8tPig8intm5fNb7SOwyC+SWDxqp2ewDMpg/ONc2yAIdgaRmE+W1StphL0Lwo0Cwhs4co6q1w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=live.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=OtRCQrXh1fGVdgj90zBxg8mWaBqGM/oPpIh3TsS+Epc=; b=Jm7+8qOgfSE0+HUAwxaUlW+54D36s4RXbZDRm4Y4Zjh/5NtV494dbI+SApojUh40HO+5Xw59dhu2Pqjarq6PECJdtzepYZeM/UAcIrCcO1mI5yTLKO1hHTQQBa+ww5x1YqLwbxowVRyMqE2MyO75gTGy4aq3TIGJFqL7E6imC+hb7kCq0SiyIIkFkg/OFBLSXJVKx6h7HUapIvFGBlTO9UlxDm2I0XPCd0q2s1sMWH8L7SmXsnvJclrGy+rbA6EZtLxT3NUPHaLxTlU0CuQiUM1E2kEXsBFUStye6TcRVCn5dPj+jG+QUzXe7+TJ5M7XnYv9hB1n6EhjdmZTYzjdag== Received: from VI1EUR05FT043.eop-eur05.prod.protection.outlook.com (2a01:111:e400:fc12::4a) by VI1EUR05HT010.eop-eur05.prod.protection.outlook.com (2a01:111:e400:fc12::228) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4415.16; Mon, 16 Aug 2021 13:22:37 +0000 Received: from AM9PR09MB4977.eurprd09.prod.outlook.com (2a01:111:e400:fc12::43) by VI1EUR05FT043.mail.protection.outlook.com (2a01:111:e400:fc12::351) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4415.16 via Frontend Transport; Mon, 16 Aug 2021 13:22:37 +0000 X-IncomingTopHeaderMarker: OriginalChecksum:2D00645997E8DFE8BAC70D96B3EF8CE4246D1BA07AD12A3C7DA5B570B8EC289B; UpperCasedChecksum:ED52E512E073D1919C4888C3E06AE227D533F41C5F110D75E42F5746EE883392; SizeAsReceived:8067; Count:46 Received: from AM9PR09MB4977.eurprd09.prod.outlook.com ([fe80::6558:f201:6d1a:3f39]) by AM9PR09MB4977.eurprd09.prod.outlook.com ([fe80::6558:f201:6d1a:3f39%2]) with mapi id 15.20.4415.023; Mon, 16 Aug 2021 13:22:37 +0000 From: Arthur Miller To: Dmitry Gutov Subject: Re: bug#49980: 28.0.50; [PATCH] Should we have project-save-buffers? References: <87czqlodpl.fsf@gmail.com> <871r70lnyi.fsf@mail.linkov.net> <87y297azuu.fsf@mail.linkov.net> <3ea58870-6b9a-41b9-c06e-d045ff9764b9@yandex.ru> <5fc1339b-5e18-f353-47bb-1123bf443710@yandex.ru> <5965bcdd-d09a-0fef-18ba-c75de3200845@yandex.ru> Date: Mon, 16 Aug 2021 15:22:36 +0200 In-Reply-To: <5965bcdd-d09a-0fef-18ba-c75de3200845@yandex.ru> (Dmitry Gutov's message of "Mon, 16 Aug 2021 06:06:23 +0300") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Content-Type: text/plain X-TMN: [SS+dj6iIuFvIGsH9DajElrQeC8uWXNyT] X-ClientProxiedBy: AM5PR1001CA0047.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:206:15::24) To AM9PR09MB4977.eurprd09.prod.outlook.com (2603:10a6:20b:304::20) X-Microsoft-Original-Message-ID: <87o89xbk2r.fsf@live.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from pascal.homepc (81.232.177.30) by AM5PR1001CA0047.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:206:15::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4415.15 via Frontend Transport; Mon, 16 Aug 2021 13:22:36 +0000 X-MS-PublicTrafficType: Email X-IncomingHeaderCount: 46 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-Correlation-Id: 057297e0-337e-4489-0fa7-08d960b8ea2f X-MS-TrafficTypeDiagnostic: VI1EUR05HT010: X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Ni+Zmx9E4VG4Mzhu9oxhmx2YNPz1SsjdCJ0i/Yxn0M1inxZEWvEz3tqW4RecVmmXho5RIexmFVdJzGJ71G3NWKdOcWLSkPyxwe+ms1tt3Wzr03kpiWR0SWjAciZnKdQPMpbW7kRdc2kKxu/CKijR5Vl8dt7/eM5nRZbrQe7pLNuqcpRdPeg3iItr1F4yWZ1DD0zC55KIdY89LBkXUJ80kLqvHTLx+KExUkK3wwbOCVM3sNyM99XqQfcLkvpwbXDZpYd8FOzBxS6wfsOeYLuEeBaLs5oDU0Xj6Cjy2jqcujxmQRQkNs+Zc1oPgi/fiCor1T/3jhtPHKpcwjr+40II8Sl4UpehIG+zUDz4cnLaShT9TQaV+x02ll8R9UfKjirre+q9/ywboxqUVVoi0z+iEQDqQLtnHCaXTUI96WAjvWgMojHSFgVq1/E7EEtBCFEG X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 1h/xNWWw9fhVRerDwcrtxYgTSAOToeFOrLctl8l7jPddwbWnEWRhFxoET81Zltpkj3NQU3CbGTgwE0X3o/+NmUgAOcqLAa2qwcpVWi6/PtndmM93yaKlk7fe10tpasTW+gCgX68t6FoYLZk1q9eqTA== X-OriginatorOrg: live.com X-MS-Exchange-CrossTenant-Network-Message-Id: 057297e0-337e-4489-0fa7-08d960b8ea2f X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Aug 2021 13:22:37.5627 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-AuthSource: VI1EUR05FT043.eop-eur05.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: Internet X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1EUR05HT010 X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 49980 Cc: Giap Tran , 49980@debbugs.gnu.org, Juri Linkov X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Dmitry Gutov writes: > On 16.08.2021 04:19, Arthur Miller wrote: >> What do you think about checking out, between multiple different >> branches? Switching two branches back and forth is no brainer, it should >> always work fine, but switching multiple branches can lead to mess since >> stashes are applied automatically. Any good strategy to automate this >> case? > > I don't know. You're automating a case I have been handling manually (and hadn't > been bothered by that, thus far). > > You will most likely encounter some edge cases where the automation breaks, but > it's hard to predict those in advance. > >> Honestly, I don't see much difference than doing it manually, but I am a >> bit affraid of auto applying stashes. > > As long as they're named ones (and thus you won't miss and accidentally pop an > unrelated one), this should work fine. Yes, they are named ones. I am trying to think out what could get messed, but since everything is stashed away on every checkout, so I don't think it should be more dangerous than doing it manually. Don't time will tell me, I am using this myself, so I guess I'll notice. thanks for the feedback From unknown Mon Aug 18 14:23:36 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Tue, 14 Sep 2021 11:24:06 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator