From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: make pred customable in auto-save-visited-mode Date: Sat, 31 Mar 2018 13:45:24 +0300 Message-ID: <83605c8qwr.fsf@gnu.org> References: <83a7uo8wk5.fsf@gnu.org> Reply-To: Eli Zaretskii NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: blaine.gmane.org 1522493014 1101 195.159.176.226 (31 Mar 2018 10:43:34 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 31 Mar 2018 10:43:34 +0000 (UTC) Cc: jixiuf@qq.com, emacs-devel@gnu.org To: Philipp Stephani Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Mar 31 12:43:30 2018 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1f2Dys-0000BH-7W for ged-emacs-devel@m.gmane.org; Sat, 31 Mar 2018 12:43:30 +0200 Original-Received: from localhost ([::1]:37735 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f2E0v-0003mo-LQ for ged-emacs-devel@m.gmane.org; Sat, 31 Mar 2018 06:45:37 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:35951) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f2E0o-0003m4-O5 for emacs-devel@gnu.org; Sat, 31 Mar 2018 06:45:31 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f2E0k-0006y4-IE for emacs-devel@gnu.org; Sat, 31 Mar 2018 06:45:30 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:47165) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f2E0k-0006xw-E5; Sat, 31 Mar 2018 06:45:26 -0400 Original-Received: from [176.228.60.248] (port=2413 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1f2E0j-0002t7-DV; Sat, 31 Mar 2018 06:45:26 -0400 In-reply-to: (message from Philipp Stephani on Sat, 31 Mar 2018 10:28:58 +0000) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:224202 Archived-At: > From: Philipp Stephani > Date: Sat, 31 Mar 2018 10:28:58 +0000 > Cc: 纪秀峰 , emacs-devel@gnu.org > > I agree that customization isn't the best solution here. However, I'm suprised that `save-some-buffers' > still prompts even if :noprompt is passed. > The issue might be in `save-some-buffers': Its docstring says "If PRED is t, then certain non-file buffers > will also be considered.", but later it only checks whether PRED is non-nil: > > (or > (buffer-file-name buffer) > (with-current-buffer buffer > (or (eq buffer-offer-save 'always) > (and pred buffer-offer-save (> (buffer-size) 0))))) > > Maybe instead of `pred' here we should say (eq pred t). Alternative, the predicate lambda should check > whether `buffer-file-name' is non-nil. > > Probably the second option is better because the first option would prevent PRED from running for > non-file-visiting buffers. Patch attached. AFAIU, this will unconditionally disable auto-saving in *ediff-merge* and all the similar buffers, when auto-save-visited-mode is turned on. Is that what we want? And if that's going to be the default, how are users supposed to override it if they want?