* Re: master ac6b62b: * lisp/time.el (world-clock-mode): Make non-interactive.
@ 2021-04-23 6:09 Eli Zaretskii
2021-04-23 9:22 ` Stefan Kangas
0 siblings, 1 reply; 10+ messages in thread
From: Eli Zaretskii @ 2021-04-23 6:09 UTC (permalink / raw)
To: Stefan Kangas; +Cc: emacs-devel
> * lisp/time.el (world-clock-mode): Make non-interactive.
> ---
> lisp/time.el | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/lisp/time.el b/lisp/time.el
> index 5abc6e9..fd53f63 100644
> --- a/lisp/time.el
> +++ b/lisp/time.el
> @@ -534,6 +534,7 @@ If the value is t instead of an alist, use the value of
> (define-derived-mode world-clock-mode special-mode "World clock"
> "Major mode for buffer that displays times in various time zones.
> See `world-clock'."
> + :interactive nil
> (setq-local revert-buffer-function #'world-clock-update)
> (setq show-trailing-whitespace nil))
Stefan, can you give your rationale for the change? Why should user
be unable to invoke this mode interactively, when they could do so for
a long time? And in any case, why isn't that change in NEWS?
Thanks.
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: master ac6b62b: * lisp/time.el (world-clock-mode): Make non-interactive.
2021-04-23 6:09 master ac6b62b: * lisp/time.el (world-clock-mode): Make non-interactive Eli Zaretskii
@ 2021-04-23 9:22 ` Stefan Kangas
2021-04-23 10:34 ` Eli Zaretskii
0 siblings, 1 reply; 10+ messages in thread
From: Stefan Kangas @ 2021-04-23 9:22 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: emacs-devel
Eli Zaretskii <eliz@gnu.org> writes:
>> * lisp/time.el (world-clock-mode): Make non-interactive.
>> ---
>> lisp/time.el | 1 +
>> 1 file changed, 1 insertion(+)
>>
>> diff --git a/lisp/time.el b/lisp/time.el
>> index 5abc6e9..fd53f63 100644
>> --- a/lisp/time.el
>> +++ b/lisp/time.el
>> @@ -534,6 +534,7 @@ If the value is t instead of an alist, use the value of
>> (define-derived-mode world-clock-mode special-mode "World clock"
>> "Major mode for buffer that displays times in various time zones.
>> See `world-clock'."
>> + :interactive nil
>> (setq-local revert-buffer-function #'world-clock-update)
>> (setq show-trailing-whitespace nil))
>
> Stefan, can you give your rationale for the change? Why should user
> be unable to invoke this mode interactively, when they could do so for
> a long time?
This mode is only useful in a buffer prepared for its use by
`world-clock'. Running it in an arbitrary buffer will silently fail.
That was the use-case for which the :interactive parameter was added:
‘:interactive’
Modes are interactive commands by default. If you specify a
‘nil’ value, the mode defined here won’t be interactive. This
is useful for modes that are never meant to be activated by
users manually, but are only supposed to be used in some
specially-formatted buffer.
> And in any case, why isn't that change in NEWS?
I don't see any particular need to put this in NEWS, as no one is likely
to have been running this command on purpose.
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: master ac6b62b: * lisp/time.el (world-clock-mode): Make non-interactive.
2021-04-23 9:22 ` Stefan Kangas
@ 2021-04-23 10:34 ` Eli Zaretskii
2021-04-23 10:58 ` Stefan Kangas
0 siblings, 1 reply; 10+ messages in thread
From: Eli Zaretskii @ 2021-04-23 10:34 UTC (permalink / raw)
To: Stefan Kangas; +Cc: emacs-devel
> From: Stefan Kangas <stefan@marxist.se>
> Date: Fri, 23 Apr 2021 09:22:29 +0000
> Cc: emacs-devel@gnu.org
>
> >> (define-derived-mode world-clock-mode special-mode "World clock"
> >> "Major mode for buffer that displays times in various time zones.
> >> See `world-clock'."
> >> + :interactive nil
> >> (setq-local revert-buffer-function #'world-clock-update)
> >> (setq show-trailing-whitespace nil))
> >
> > Stefan, can you give your rationale for the change? Why should user
> > be unable to invoke this mode interactively, when they could do so for
> > a long time?
>
> This mode is only useful in a buffer prepared for its use by
> `world-clock'. Running it in an arbitrary buffer will silently fail.
Is that true also for turning off the mode?
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: master ac6b62b: * lisp/time.el (world-clock-mode): Make non-interactive.
2021-04-23 10:34 ` Eli Zaretskii
@ 2021-04-23 10:58 ` Stefan Kangas
2021-04-23 11:25 ` Eli Zaretskii
0 siblings, 1 reply; 10+ messages in thread
From: Stefan Kangas @ 2021-04-23 10:58 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: emacs-devel
Eli Zaretskii <eliz@gnu.org> writes:
>> This mode is only useful in a buffer prepared for its use by
>> `world-clock'. Running it in an arbitrary buffer will silently fail.
>
> Is that true also for turning off the mode?
I don't think I understand the question: AFAIK, you can't turn off a
major mode (see `(elisp) Major Modes'). But you can of course still
switch to a different major mode with or without this change.
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: master ac6b62b: * lisp/time.el (world-clock-mode): Make non-interactive.
2021-04-23 10:58 ` Stefan Kangas
@ 2021-04-23 11:25 ` Eli Zaretskii
2021-04-23 12:34 ` Stefan Kangas
2021-04-23 13:01 ` Stefan Kangas
0 siblings, 2 replies; 10+ messages in thread
From: Eli Zaretskii @ 2021-04-23 11:25 UTC (permalink / raw)
To: Stefan Kangas; +Cc: emacs-devel
> From: Stefan Kangas <stefan@marxist.se>
> Date: Fri, 23 Apr 2021 10:58:24 +0000
> Cc: emacs-devel@gnu.org
>
> Eli Zaretskii <eliz@gnu.org> writes:
>
> >> This mode is only useful in a buffer prepared for its use by
> >> `world-clock'. Running it in an arbitrary buffer will silently fail.
> >
> > Is that true also for turning off the mode?
>
> I don't think I understand the question: AFAIK, you can't turn off a
> major mode (see `(elisp) Major Modes'). But you can of course still
> switch to a different major mode with or without this change.
Before your change, I could turn on this mode interactively in a
buffer which was already formatted (e.g., by copy/paste from another
such buffer, or in the original *wclock* buffer, if I switched to
another major mode in it). With this change, doing that is no longer
possible. So I think the least we need is to mention that in NEWS.
IOW, it's a user-visible change, whether we think the previous
functionality was useful or not.
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: master ac6b62b: * lisp/time.el (world-clock-mode): Make non-interactive.
2021-04-23 11:25 ` Eli Zaretskii
@ 2021-04-23 12:34 ` Stefan Kangas
2021-04-23 13:03 ` Eli Zaretskii
2021-04-23 13:01 ` Stefan Kangas
1 sibling, 1 reply; 10+ messages in thread
From: Stefan Kangas @ 2021-04-23 12:34 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: emacs-devel
Eli Zaretskii <eliz@gnu.org> writes:
> So I think the least we need is to mention that in NEWS.
Done.
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: master ac6b62b: * lisp/time.el (world-clock-mode): Make non-interactive.
2021-04-23 11:25 ` Eli Zaretskii
2021-04-23 12:34 ` Stefan Kangas
@ 2021-04-23 13:01 ` Stefan Kangas
2021-04-23 13:17 ` Eli Zaretskii
1 sibling, 1 reply; 10+ messages in thread
From: Stefan Kangas @ 2021-04-23 13:01 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: emacs-devel
Eli Zaretskii <eliz@gnu.org> writes:
> Before your change, I could turn on this mode interactively in a
> buffer which was already formatted (e.g., by copy/paste from another
> such buffer, or in the original *wclock* buffer, if I switched to
> another major mode in it).
Doing that in Emacs 27 has no effect other than giving you a broken
mode, BTW.
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: master ac6b62b: * lisp/time.el (world-clock-mode): Make non-interactive.
2021-04-23 12:34 ` Stefan Kangas
@ 2021-04-23 13:03 ` Eli Zaretskii
0 siblings, 0 replies; 10+ messages in thread
From: Eli Zaretskii @ 2021-04-23 13:03 UTC (permalink / raw)
To: Stefan Kangas; +Cc: emacs-devel
> From: Stefan Kangas <stefan@marxist.se>
> Date: Fri, 23 Apr 2021 07:34:23 -0500
> Cc: emacs-devel@gnu.org
>
> Eli Zaretskii <eliz@gnu.org> writes:
>
> > So I think the least we need is to mention that in NEWS.
>
> Done.
Thanks.
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: master ac6b62b: * lisp/time.el (world-clock-mode): Make non-interactive.
2021-04-23 13:01 ` Stefan Kangas
@ 2021-04-23 13:17 ` Eli Zaretskii
2021-04-23 13:36 ` Stefan Kangas
0 siblings, 1 reply; 10+ messages in thread
From: Eli Zaretskii @ 2021-04-23 13:17 UTC (permalink / raw)
To: Stefan Kangas; +Cc: emacs-devel
> From: Stefan Kangas <stefan@marxist.se>
> Date: Fri, 23 Apr 2021 08:01:05 -0500
> Cc: emacs-devel@gnu.org
>
> Eli Zaretskii <eliz@gnu.org> writes:
>
> > Before your change, I could turn on this mode interactively in a
> > buffer which was already formatted (e.g., by copy/paste from another
> > such buffer, or in the original *wclock* buffer, if I switched to
> > another major mode in it).
>
> Doing that in Emacs 27 has no effect other than giving you a broken
> mode, BTW.
Broken how?
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: master ac6b62b: * lisp/time.el (world-clock-mode): Make non-interactive.
2021-04-23 13:17 ` Eli Zaretskii
@ 2021-04-23 13:36 ` Stefan Kangas
0 siblings, 0 replies; 10+ messages in thread
From: Stefan Kangas @ 2021-04-23 13:36 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: emacs-devel
Eli Zaretskii <eliz@gnu.org> writes:
>> Doing that in Emacs 27 has no effect other than giving you a broken
>> mode, BTW.
>
> Broken how?
The only useful functionality of that mode in Emacs 27 is that it shows
the time (which it doesn't, you yanked it) and then updates that time
every minute (which it doesn't, as the timer is not started). So it is
just a convoluted way of setting show-trailing-whitespace to nil.
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2021-04-23 13:36 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-04-23 6:09 master ac6b62b: * lisp/time.el (world-clock-mode): Make non-interactive Eli Zaretskii
2021-04-23 9:22 ` Stefan Kangas
2021-04-23 10:34 ` Eli Zaretskii
2021-04-23 10:58 ` Stefan Kangas
2021-04-23 11:25 ` Eli Zaretskii
2021-04-23 12:34 ` Stefan Kangas
2021-04-23 13:03 ` Eli Zaretskii
2021-04-23 13:01 ` Stefan Kangas
2021-04-23 13:17 ` Eli Zaretskii
2021-04-23 13:36 ` Stefan Kangas
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.