unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Philipp Stephani <p.stephani2@gmail.com>
Cc: phst@google.com, emacs-devel@gnu.org
Subject: Re: [PATCH] Allow inhibiting 'auto-save-visited-mode' on a per-buffer basis.
Date: Sun, 05 Apr 2020 16:11:22 +0300	[thread overview]
Message-ID: <838sjat6v9.fsf@gnu.org> (raw)
In-Reply-To: <CAArVCkTq7X+5tOCUd=xV1DeV+fFA24z5vM0V5SWXHy1O15BUcg@mail.gmail.com> (message from Philipp Stephani on Sun, 5 Apr 2020 11:52:16 +0200)

> From: Philipp Stephani <p.stephani2@gmail.com>
> Date: Sun, 5 Apr 2020 11:52:16 +0200
> Cc: Emacs developers <emacs-devel@gnu.org>, Philipp Stephani <phst@google.com>
> 
> > > +(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.

Indeed, we could either have some reference count in the timer to
disable it when there's no buffer that needs it, or keep it running at
all times.

Of course, if this is deemed too complicated, I guess we could go with
your original proposal, but in that case we should at least have some
comment there explaining why this mode is so different from others.

Thanks.



      reply	other threads:[~2020-04-05 13:11 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-01 17:57 [PATCH] Allow inhibiting 'auto-save-visited-mode' on a per-buffer basis Philipp Stephani
2020-04-02  9:24 ` Robert Pluim
2020-04-02  9:40   ` Philipp Stephani
2020-04-02  9:47     ` Robert Pluim
2020-04-02  9:59       ` Štěpán Němec
2020-04-02 11:15         ` Philipp Stephani
2020-04-02 11:27           ` Štěpán Němec
2020-04-02 13:38 ` Eli Zaretskii
2020-04-02 15:22   ` Stefan Monnier
2020-04-05  9:50     ` Philipp Stephani
2020-04-05 14:18       ` Stefan Monnier
2020-04-05 15:51         ` Philipp Stephani
2020-04-05 18:49           ` Stefan Monnier
2020-04-05 19:58             ` Philipp Stephani
2020-04-08 11:43               ` Philipp Stephani
2020-04-08 12:03                 ` Eli Zaretskii
2020-04-08 12:19                   ` Philipp Stephani
2020-04-08 13:07                     ` Eli Zaretskii
2020-04-08 14:58                 ` Stefan Monnier
2020-04-11 16:57                   ` Philipp Stephani
2020-04-11 17:11                     ` Stefan Monnier
2020-05-25 19:16                       ` Philipp Stephani
2020-04-05  9:52   ` Philipp Stephani
2020-04-05 13:11     ` Eli Zaretskii [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=838sjat6v9.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=p.stephani2@gmail.com \
    --cc=phst@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).