From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Philipp Stephani Newsgroups: gmane.emacs.devel Subject: Re: make pred customable in auto-save-visited-mode Date: Sun, 01 Apr 2018 17:19:38 +0000 Message-ID: References: <83a7uo8wk5.fsf@gnu.org> <83605c8qwr.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="00000000000036f64b0568ccae18" X-Trace: blaine.gmane.org 1522603124 16967 195.159.176.226 (1 Apr 2018 17:18:44 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 1 Apr 2018 17:18:44 +0000 (UTC) Cc: jixiuf@qq.com, emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Apr 01 19:18:40 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 1f2gcq-0004Ih-1w for ged-emacs-devel@m.gmane.org; Sun, 01 Apr 2018 19:18:40 +0200 Original-Received: from localhost ([::1]:49529 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f2get-00005a-KF for ged-emacs-devel@m.gmane.org; Sun, 01 Apr 2018 13:20:47 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:35768) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f2ge2-0008Uy-Mc for emacs-devel@gnu.org; Sun, 01 Apr 2018 13:19:56 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f2ge1-0002IJ-Iq for emacs-devel@gnu.org; Sun, 01 Apr 2018 13:19:54 -0400 Original-Received: from mail-lf0-x231.google.com ([2a00:1450:4010:c07::231]:46146) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1f2gdy-0002HZ-VB; Sun, 01 Apr 2018 13:19:51 -0400 Original-Received: by mail-lf0-x231.google.com with SMTP id j68-v6so17954018lfg.13; Sun, 01 Apr 2018 10:19:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=F0rG0fxutZlulaX2olIopIX4C5+XLQqKBm3VfGiu0bY=; b=e15TZq4oZ95A8foWLuqhMDFReSSWbE9RAXX9LkqAhl/eKv8/XpJfF5qP+bocwsQZZT UAaQGMScJxji+xJrRkBMI4r93ofS1Zs9fXrz0j7u1IvZ3bE2ICJQxDgo8yx0ceDvGCTr tBjuRxm8mzDpsUMBO8T456ffbed/eXv4nbNyazZEw/Mrm0j8/pAGgIsrbAstTKiuqP0Z 7O6Fu4hdScVBkQkQ+UVw74IuW9H/kRYu2RHoPe1yRCgpprxrKNJ0hLbHKub5XSoQGKks FXYaox/9Iq6qnnWALUxKDjvTbscfFf0wO7sBGFC1JChtOP+bjJ/MrAAwt/x6c5cqkFZN 3BBQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=F0rG0fxutZlulaX2olIopIX4C5+XLQqKBm3VfGiu0bY=; b=HQvXjl8Vlf2jXwGYyQGR/sS/lz79CM9cnPttqNv+oIBzA2R46CYc7IqqjCMaQg3bGZ oUrl6rKft1LK2ixH7y4QoNkwcXVwgb5PoKUxLnSrzqoHQOKkhf2WGVFKyCgRoA8+8gZ9 csTacYqz+3FXGutlYZ+U4lML8q/erx2/lWwDuwZxSYIk+UJoTyU/tpd/zioorDchTNUr vhf3P2RJ44wbfh3v97qjr8Ew0rz7Alchvg/2C1dzaKj/4oHCaTlF2ofP/U+z40vsp53c JJfjqateA5ggOlARghRLPXEtpgCv7Rr7Q4ewT74k2Tzz+c12ICkISsAK/hYGCHymimCM l4zQ== X-Gm-Message-State: ALQs6tCpCo93QsnKRwBwdpfabwxQRcgo7sodRHDAsU4Wc1le3u0JvHXl BczMWCdxcq/NMqrCcmWZ2wLpBs+w8qACTGSNoyXMmg== X-Google-Smtp-Source: AIpwx4+wlb8EtBoe2RDZNPnn54MrmrsDg6WBSeNPd27q9p69xdHv7rneg0G4sO9QvH/2hbnb4xA2KQ3GqWfzMDpl4/g= X-Received: by 2002:a19:d015:: with SMTP id h21-v6mr3755051lfg.124.1522603189006; Sun, 01 Apr 2018 10:19:49 -0700 (PDT) In-Reply-To: <83605c8qwr.fsf@gnu.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4010:c07::231 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:224223 Archived-At: --00000000000036f64b0568ccae18 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Eli Zaretskii schrieb am Sa., 31. M=C3=A4rz 2018 um 12:45 Uh= r: > > From: Philipp Stephani > > Date: Sat, 31 Mar 2018 10:28:58 +0000 > > Cc: =E7=BA=AA=E7=A7=80=E5=B3=B0 , 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? > I think not prompting is the right approach. It's not very user-friendly to interrupt the user every couple of seconds, and no other application I know that has autosave prompts the user for filenames. I think we should change the behavior by applying the patch; if some users do want to be interrupted, we can still add a customization option later. --00000000000036f64b0568ccae18 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


Eli Za= retskii <eliz@gnu.org> schrieb am= Sa., 31. M=C3=A4rz 2018 um 12:45=C2=A0Uhr:
> From: Philipp Stephani <p.stephani2@gmail.com>
> Date: Sat, 31 Mar 2018 10:28:58 +0000
> Cc: =E7=BA=AA=E7=A7=80=E5=B3=B0 <jixiuf@qq.com>, emacs-devel@gnu.org
>
>=C2=A0 I agree that customization isn't the best solution here. How= ever, I'm suprised that `save-some-buffers'
>=C2=A0 still prompts even if :noprompt is passed.
>=C2=A0 The issue might be in `save-some-buffers': Its docstring say= s "If PRED is t, then certain non-file buffers
>=C2=A0 will also be considered.", but later it only checks whether= PRED is non-nil:
>
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 (or
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0(buffer-file-name buffer)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0(with-current-buffer buffer
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0(or (eq buffer-offer-save 'always)
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(and pred buffer-offer-save (> (buffer= -size) 0)))))
>
>=C2=A0 Maybe instead of `pred' here we should say (eq pred t). Alte= rnative, the predicate lambda should check
>=C2=A0 whether `buffer-file-name' is non-nil.
>
> Probably the second option is better because the first option would pr= event 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.=C2=A0 Is that what we want?=C2=A0 And if that's going to be the def= ault, how
are users supposed to override it if they want?

I think not prompting is the right approach. It's not very use= r-friendly to interrupt the user every couple of seconds, and no other appl= ication I know that has autosave prompts the user for filenames. I think we= should change the behavior by applying the patch; if some users do want to= be interrupted, we can still add a customization option later.=C2=A0
=
--00000000000036f64b0568ccae18--