From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Philipp Stephani Newsgroups: gmane.emacs.devel Subject: Re: [PATCH] Allow inhibiting 'auto-save-visited-mode' on a per-buffer basis. Date: Sun, 5 Apr 2020 11:52:16 +0200 Message-ID: References: <20200401175736.203124-1-phst@google.com> <83wo6yxb0s.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="13668"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Philipp Stephani , Emacs developers To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun Apr 05 11:53:07 2020 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jL1xh-0003O3-Lv for ged-emacs-devel@m.gmane-mx.org; Sun, 05 Apr 2020 11:53:05 +0200 Original-Received: from localhost ([::1]:46396 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jL1xg-00081B-QL for ged-emacs-devel@m.gmane-mx.org; Sun, 05 Apr 2020 05:53:04 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:36153) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jL1xF-0007VV-9J for emacs-devel@gnu.org; Sun, 05 Apr 2020 05:52:38 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jL1xE-0005Zd-Bj for emacs-devel@gnu.org; Sun, 05 Apr 2020 05:52:37 -0400 Original-Received: from mail-ot1-x344.google.com ([2607:f8b0:4864:20::344]:40481) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jL1x6-0005W4-Jd; Sun, 05 Apr 2020 05:52:28 -0400 Original-Received: by mail-ot1-x344.google.com with SMTP id r19so12186511otn.7; Sun, 05 Apr 2020 02:52:28 -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=RSpJHKPeAOcY/TNSPwKnteVakgxwhYJiiCN++e0jER0=; b=jfbtkBxWfoDT92zVBp489yGYeIdXwlCfQppGKjYMQnGGXiSuhtAzYbWDyEPdzbCSp1 4QHP+aw/+G9jIW2Ib7laSa5rsQRbHWg6ygjfIW2rC+3EfxS7rdXFiDNrUp8lkJH+eX42 DC3p2djOaniqIizsq6B1mkV7uVlhVX66A5iHR3g8CSycR8oWKYNL4Vf/K1yrexdXaTlw EtWcN1cypQJvYTv2aXTpSsBUZ+t1FGYwkFejLE3Qfn2xpLcK9tPCpmOBCAqgfuZo5N+U Rzqpk4BKUAXNCyVakrBF4qccQP9HxvuLxDdZIy/IdowYZnLQfIRH8Amay9TgT0NRilE6 7Vcg== 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=RSpJHKPeAOcY/TNSPwKnteVakgxwhYJiiCN++e0jER0=; b=eQC1nySMsMi3pP442NF8zHVPa9RbTL3SgmG52ZCxhL2LlQZ6G1L9aiGc4oMWtKkeJr INhK1RhNjQ9lx9pj1fG/W6sdY0XQ138JGasvjp5yJ7xoNe7TlcaMkZT/DM8mht2oH4dd QEFDwl1fSnOct1Ww5KBxkC391702sFzxC3lSP2tIfy8Ga+wbSJCvko+TcHeSh6uUNZZI 9lfPqvQrq2h0EI8ET9XA6bA78mhCosl7E8AZx73Omkj9VEDau47Ayuied0QABol9uXYi qsGm4mpEJybdu8cElH8EkR7BjXft79turrQcB2hCBtUnabGnPfKqaDCTdSRc8rGuQCk6 MWhw== X-Gm-Message-State: AGi0Pubkha5rIhYbEZcw9Yx7HjMpXM7MVErb2yvlOh6YEwlz/VhPsV6A j/9dZ6URSD5YI/fC7YMW/NnSXf5iDC8yzyCIIgcQfg== X-Google-Smtp-Source: APiQypI+qK16B5dU3XuUsxHd3X7WArYejKirL+lr1BHDGdwMD6Nln6Bm+/VMKFwLPimqIZEhQJ8r5JFY5MfOLCxTtrI= X-Received: by 2002:a9d:2963:: with SMTP id d90mr12561206otb.149.1586080347415; Sun, 05 Apr 2020 02:52:27 -0700 (PDT) In-Reply-To: <83wo6yxb0s.fsf@gnu.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::344 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 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-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:246444 Archived-At: Am Do., 2. Apr. 2020 um 15:39 Uhr schrieb Eli Zaretskii : > > > From: Philipp Stephani > > Date: Wed, 1 Apr 2020 19:57:36 +0200 > > Cc: Philipp Stephani > > > > +** Autosaving via 'auto-save-visited-mode' can now be inhibited using > > +the buffer-local variable 'auto-save-visited-inhibit'. > > + > > > > * Changes in Specialized Modes and Packages in Emacs 28.1 > > > > diff --git a/lisp/files.el b/lisp/files.el > > index 55a0958f54..f3ea1d083f 100644 > > --- a/lisp/files.el > > +++ b/lisp/files.el > > @@ -425,12 +425,17 @@ auto-save-visited-interval > > (when auto-save--timer > > (timer-set-idle-time auto-save--timer value :repeat)))) > > > > +(defvar-local auto-save-visited-inhibit nil > > + "If non-nil, ignore this buffer for `auto-save-visited-mode'.") > > + > > Wouldn't it be better to have a local minor mode and a globalized > minor mode, like we do in other cases? I don't think that's possible here. We have one global timer, and with a local minor mode we'd either need one timer per buffer or some additional complexity to ensure that the timer is enabled if at least one buffer has the minor mode on. Alternatively we could have a global timer that's always on.