all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* autorevert-tail-truncate proposed for Emacs 31 and/or ELPA
@ 2025-02-03 17:32 Ship Mints
  2025-02-03 22:32 ` Stefan Kangas
                   ` (3 more replies)
  0 siblings, 4 replies; 31+ messages in thread
From: Ship Mints @ 2025-02-03 17:32 UTC (permalink / raw)
  To: Emacs Devel

[-- Attachment #1: Type: text/plain, Size: 435 bytes --]

I've been using a variant of this for a while in my own config. It seems
sufficiently general and broadly useful to warrant consideration for
inclusion as part of the autorevert.el family of modes (for which I'll
submit a patch, if agreed) and/or via ELPA for people to use in the
meantime, or forever if not adopted in Emacs proper.

I welcome thoughtful feedback.

https://github.com/shipmints/autorevert-tail-truncate.el

-Stephane

[-- Attachment #2: Type: text/html, Size: 987 bytes --]

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: autorevert-tail-truncate proposed for Emacs 31 and/or ELPA
  2025-02-03 17:32 autorevert-tail-truncate proposed for Emacs 31 and/or ELPA Ship Mints
@ 2025-02-03 22:32 ` Stefan Kangas
  2025-02-04 10:42   ` Michael Albinus
  2025-02-04 10:39 ` Michael Albinus
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 31+ messages in thread
From: Stefan Kangas @ 2025-02-03 22:32 UTC (permalink / raw)
  To: Ship Mints, Emacs Devel; +Cc: Stefan Monnier, Philip Kaludercic

Ship Mints <shipmints@gmail.com> writes:

> I've been using a variant of this for a while in my own config. It seems
> sufficiently general and broadly useful to warrant consideration for
> inclusion as part of the autorevert.el family of modes (for which I'll
> submit a patch, if agreed) and/or via ELPA for people to use in the
> meantime, or forever if not adopted in Emacs proper.
>
> I welcome thoughtful feedback.
>
> https://github.com/shipmints/autorevert-tail-truncate.el
>
> -Stephane

I guess this is a version of `tail -f` for Emacs?  Looks useful.

I don't know if it should be in core, but putting it on GNU ELPA seems
like a no-brainer.  Perhaps we could put it there and move it to core if
there is more demand for something like this?

Let's see if other people have more to add here.



^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: autorevert-tail-truncate proposed for Emacs 31 and/or ELPA
  2025-02-03 17:32 autorevert-tail-truncate proposed for Emacs 31 and/or ELPA Ship Mints
  2025-02-03 22:32 ` Stefan Kangas
@ 2025-02-04 10:39 ` Michael Albinus
  2025-02-04 11:11   ` Ship Mints
  2025-02-04 18:57 ` Philip Kaludercic
  2025-02-05 22:33 ` Stefan Kangas
  3 siblings, 1 reply; 31+ messages in thread
From: Michael Albinus @ 2025-02-04 10:39 UTC (permalink / raw)
  To: Ship Mints; +Cc: Emacs Devel

Ship Mints <shipmints@gmail.com> writes:

Hi Ship,

> I welcome thoughtful feedback.

Thanks for the package. I haven't tested it (yet). Just some few
comments after cursary reading:

> ;; Copyright (C) 2025 Stephane Marks
> ;; Copyright (C) 2025 Free Software Foundation, Inc.

In core Emacs, files are copyrighted to the FSF only. Usually.

> ;;; Commentary:
>
> ;; `auto-revert-tail-truncate-mode' extends `auto-revert-tail-mode' to

Perhaps you say explicitly, that it is a minor-mode which is intended
for `auto-revert-tail-mode'.

> (defcustom auto-revert-tail-truncate-max-lines 5000
>   "Truncate buffer to this maximum number of lines.
> If nil, truncation is disabled.  Bind this as a buffer-local variable to
> control the maximum number lines to retain for specific buffers."
>   :group 'auto-revert
>   :type 'natnum)

Pleae add a :version tag. If nil is allowed, you shall specify it in the
:type.

> (defcustom auto-revert-tail-truncate-file-size-hint 64
>   :group 'auto-revert
>   :type 'natnum)

Pleae add a :version tag.

> (defcustom auto-revert-tail-truncate-revert-interval auto-revert-interval
> (defcustom auto-revert-tail-truncate-verbose auto-revert-verbose
> (defcustom auto-revert-tail-truncate-immediately t
> (defcustom auto-revert-tail-truncate-read-only t
> (defcustom auto-revert-tail-truncate-disable-undo t
> (defcustom auto-revert-tail-truncate-disable-font-lock t
> (defcustom auto-revert-tail-truncate-check-vc-info auto-revert-check-vc-info
> (defcustom auto-revert-tail-truncate-mode-text " TailTrunc"

Dito.

I'm asking myself, whether we need
auto-revert-tail-truncate-check-vc-info here. Rather we shall suppress
the call of vc-refresh-state in auto-revert-tail-mode buffers at all. To
be changed in autorevert.el.

> -Stephane

Best regards, Michael.



^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: autorevert-tail-truncate proposed for Emacs 31 and/or ELPA
  2025-02-03 22:32 ` Stefan Kangas
@ 2025-02-04 10:42   ` Michael Albinus
  2025-02-04 13:49     ` Stefan Monnier
  0 siblings, 1 reply; 31+ messages in thread
From: Michael Albinus @ 2025-02-04 10:42 UTC (permalink / raw)
  To: Stefan Kangas; +Cc: Ship Mints, Emacs Devel, Stefan Monnier, Philip Kaludercic

Stefan Kangas <stefankangas@gmail.com> writes:

Hi Stefan,

> I don't know if it should be in core, but putting it on GNU ELPA seems
> like a no-brainer.  Perhaps we could put it there and move it to core if
> there is more demand for something like this?
>
> Let's see if other people have more to add here.

My preference would be to have it in both core Emacs and GNU ELPA (as
built-in package).

See my other message for some few minor comments on the code.

Best regards, Michael.



^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: autorevert-tail-truncate proposed for Emacs 31 and/or ELPA
  2025-02-04 10:39 ` Michael Albinus
@ 2025-02-04 11:11   ` Ship Mints
  2025-02-04 14:13     ` Michael Albinus
  0 siblings, 1 reply; 31+ messages in thread
From: Ship Mints @ 2025-02-04 11:11 UTC (permalink / raw)
  To: Michael Albinus; +Cc: Emacs Devel

[-- Attachment #1: Type: text/plain, Size: 2640 bytes --]

I'd just removed the :version tags as I felt they were presumptuous at this
time. I'll restore them as "31.1" if this package is agreed to merge as
part of autorevert.el proper.

I will change the commentary to say "for" instead of "extend".

I think suppressing vc-refresh-state in tailed buffers is a good idea,
hence the control that people can put in their hooks on a buffer-local
basis for this mode. If this behavior is made the default, there might be
some wacky reason to have it be optional, but I can't imagine one.

Thank you for the thoughtful feedback, Michael.

-Stephane

On Tue, Feb 4, 2025 at 5:39 AM Michael Albinus <michael.albinus@gmx.de>
wrote:

> Ship Mints <shipmints@gmail.com> writes:
>
> Hi Ship,
>
> > I welcome thoughtful feedback.
>
> Thanks for the package. I haven't tested it (yet). Just some few
> comments after cursary reading:
>
> > ;; Copyright (C) 2025 Stephane Marks
> > ;; Copyright (C) 2025 Free Software Foundation, Inc.
>
> In core Emacs, files are copyrighted to the FSF only. Usually.
>
> > ;;; Commentary:
> >
> > ;; `auto-revert-tail-truncate-mode' extends `auto-revert-tail-mode' to
>
> Perhaps you say explicitly, that it is a minor-mode which is intended
> for `auto-revert-tail-mode'.
>
> > (defcustom auto-revert-tail-truncate-max-lines 5000
> >   "Truncate buffer to this maximum number of lines.
> > If nil, truncation is disabled.  Bind this as a buffer-local variable to
> > control the maximum number lines to retain for specific buffers."
> >   :group 'auto-revert
> >   :type 'natnum)
>
> Pleae add a :version tag. If nil is allowed, you shall specify it in the
> :type.
>
> > (defcustom auto-revert-tail-truncate-file-size-hint 64
> >   :group 'auto-revert
> >   :type 'natnum)
>
> Pleae add a :version tag.
>
> > (defcustom auto-revert-tail-truncate-revert-interval auto-revert-interval
> > (defcustom auto-revert-tail-truncate-verbose auto-revert-verbose
> > (defcustom auto-revert-tail-truncate-immediately t
> > (defcustom auto-revert-tail-truncate-read-only t
> > (defcustom auto-revert-tail-truncate-disable-undo t
> > (defcustom auto-revert-tail-truncate-disable-font-lock t
> > (defcustom auto-revert-tail-truncate-check-vc-info
> auto-revert-check-vc-info
> > (defcustom auto-revert-tail-truncate-mode-text " TailTrunc"
>
> Dito.
>
> I'm asking myself, whether we need
> auto-revert-tail-truncate-check-vc-info here. Rather we shall suppress
> the call of vc-refresh-state in auto-revert-tail-mode buffers at all. To
> be changed in autorevert.el.
>
> > -Stephane
>
> Best regards, Michael.
>

[-- Attachment #2: Type: text/html, Size: 3867 bytes --]

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: autorevert-tail-truncate proposed for Emacs 31 and/or ELPA
  2025-02-04 10:42   ` Michael Albinus
@ 2025-02-04 13:49     ` Stefan Monnier
  2025-02-04 14:17       ` Michael Albinus
  0 siblings, 1 reply; 31+ messages in thread
From: Stefan Monnier @ 2025-02-04 13:49 UTC (permalink / raw)
  To: Michael Albinus; +Cc: Stefan Kangas, Ship Mints, Emacs Devel, Philip Kaludercic

> My preference would be to have it in both core Emacs and GNU ELPA (as
> built-in package).

Could you explain why you think it should be in core?
Do you expect to make use of it as a library for some bundled package,
like Tramp?


        Stefan




^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: autorevert-tail-truncate proposed for Emacs 31 and/or ELPA
  2025-02-04 11:11   ` Ship Mints
@ 2025-02-04 14:13     ` Michael Albinus
  2025-02-04 14:18       ` Ship Mints
  0 siblings, 1 reply; 31+ messages in thread
From: Michael Albinus @ 2025-02-04 14:13 UTC (permalink / raw)
  To: Ship Mints; +Cc: Emacs Devel

Ship Mints <shipmints@gmail.com> writes:

Hi Ship,

> I think suppressing vc-refresh-state in tailed buffers is a good idea,
> hence the control that people can put in their hooks on a buffer-local
> basis for this mode. If this behavior is made the default, there might
> be some wacky reason to have it be optional, but I can't imagine one.

I've just checked the status. The documentation (docstring and manual)
for auto-revert-check-vc-info mentions only auto-revert-mode. So it is
an error to call it in auto-revert-tail-mode.

I've fixed this just now in the master branch. In your package, I
recommend you to get rid of auto-revert-tail-truncate-check-vc-info, and
to bind auto-revert-check-vc-info to nil for backward
compatibility. Perhaps with a comment, that this won't be necessary any
longer starting with Emacs 31.

> Thank you for the thoughtful feedback, Michael.
>
> -Stephane

Best regards, Michael.



^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: autorevert-tail-truncate proposed for Emacs 31 and/or ELPA
  2025-02-04 13:49     ` Stefan Monnier
@ 2025-02-04 14:17       ` Michael Albinus
  0 siblings, 0 replies; 31+ messages in thread
From: Michael Albinus @ 2025-02-04 14:17 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: Stefan Kangas, Ship Mints, Emacs Devel, Philip Kaludercic

Stefan Monnier <monnier@iro.umontreal.ca> writes:

Hi Stefan,

>> My preference would be to have it in both core Emacs and GNU ELPA (as
>> built-in package).
>
> Could you explain why you think it should be in core?
> Do you expect to make use of it as a library for some bundled package,
> like Tramp?

No hard facts, just thinking about usefulness. No plans for Tramp.

Finally, it is up to the maintainers to decide. I've expressed my preference.

>         Stefan

Best regards, Michael.



^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: autorevert-tail-truncate proposed for Emacs 31 and/or ELPA
  2025-02-04 14:13     ` Michael Albinus
@ 2025-02-04 14:18       ` Ship Mints
  2025-02-04 14:34         ` Michael Albinus
  0 siblings, 1 reply; 31+ messages in thread
From: Ship Mints @ 2025-02-04 14:18 UTC (permalink / raw)
  To: Michael Albinus; +Cc: Emacs Devel

[-- Attachment #1: Type: text/plain, Size: 1397 bytes --]

Done. This should suffice as a comment. Thanks for checking into the
details.

        (when (version< emacs-version "31")
          (make-local-variable 'auto-revert-check-vc-info)
          (setq auto-revert-check-vc-info nil))

I know I could have used setq-local. I'm keeping this in line with the code
above.

On Tue, Feb 4, 2025 at 9:13 AM Michael Albinus <michael.albinus@gmx.de>
wrote:

> Ship Mints <shipmints@gmail.com> writes:
>
> Hi Ship,
>
> > I think suppressing vc-refresh-state in tailed buffers is a good idea,
> > hence the control that people can put in their hooks on a buffer-local
> > basis for this mode. If this behavior is made the default, there might
> > be some wacky reason to have it be optional, but I can't imagine one.
>
> I've just checked the status. The documentation (docstring and manual)
> for auto-revert-check-vc-info mentions only auto-revert-mode. So it is
> an error to call it in auto-revert-tail-mode.
>
> I've fixed this just now in the master branch. In your package, I
> recommend you to get rid of auto-revert-tail-truncate-check-vc-info, and
> to bind auto-revert-check-vc-info to nil for backward
> compatibility. Perhaps with a comment, that this won't be necessary any
> longer starting with Emacs 31.
>
> > Thank you for the thoughtful feedback, Michael.
> >
> > -Stephane
>
> Best regards, Michael.
>

[-- Attachment #2: Type: text/html, Size: 2137 bytes --]

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: autorevert-tail-truncate proposed for Emacs 31 and/or ELPA
  2025-02-04 14:34         ` Michael Albinus
@ 2025-02-04 14:34           ` Ship Mints
  2025-02-04 14:42             ` Michael Albinus
  0 siblings, 1 reply; 31+ messages in thread
From: Ship Mints @ 2025-02-04 14:34 UTC (permalink / raw)
  To: Michael Albinus; +Cc: Emacs Devel

[-- Attachment #1: Type: text/plain, Size: 695 bytes --]

I hope this is the biggest issue with the code...

On Tue, Feb 4, 2025 at 9:34 AM Michael Albinus <michael.albinus@gmx.de>
wrote:

> Ship Mints <shipmints@gmail.com> writes:
>
> Hi Ship,
>
> > Done. This should suffice as a comment. Thanks for checking into the
> > details.
> >
> >         (when (version< emacs-version "31")
> >           (make-local-variable 'auto-revert-check-vc-info)
> >           (setq auto-revert-check-vc-info nil))
>
> This works, of course. In my taste, I would prefer a cooment over the
> explicit version check, because in the comment you can say something
> about the reasoning. But of course, it is up to you.
>
> Best regards, Michael.
>

[-- Attachment #2: Type: text/html, Size: 1206 bytes --]

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: autorevert-tail-truncate proposed for Emacs 31 and/or ELPA
  2025-02-04 14:18       ` Ship Mints
@ 2025-02-04 14:34         ` Michael Albinus
  2025-02-04 14:34           ` Ship Mints
  0 siblings, 1 reply; 31+ messages in thread
From: Michael Albinus @ 2025-02-04 14:34 UTC (permalink / raw)
  To: Ship Mints; +Cc: Emacs Devel

Ship Mints <shipmints@gmail.com> writes:

Hi Ship,

> Done. This should suffice as a comment. Thanks for checking into the
> details.
>
>         (when (version< emacs-version "31")
>           (make-local-variable 'auto-revert-check-vc-info)
>           (setq auto-revert-check-vc-info nil))

This works, of course. In my taste, I would prefer a cooment over the
explicit version check, because in the comment you can say something
about the reasoning. But of course, it is up to you.

Best regards, Michael.



^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: autorevert-tail-truncate proposed for Emacs 31 and/or ELPA
  2025-02-04 14:34           ` Ship Mints
@ 2025-02-04 14:42             ` Michael Albinus
  2025-02-04 15:55               ` Eshel Yaron
  0 siblings, 1 reply; 31+ messages in thread
From: Michael Albinus @ 2025-02-04 14:42 UTC (permalink / raw)
  To: Ship Mints; +Cc: Emacs Devel

Ship Mints <shipmints@gmail.com> writes:

> I hope this is the biggest issue with the code...

For now 😃

Best regards, Michael.



^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: autorevert-tail-truncate proposed for Emacs 31 and/or ELPA
  2025-02-04 14:42             ` Michael Albinus
@ 2025-02-04 15:55               ` Eshel Yaron
  2025-02-04 16:03                 ` Ship Mints
  0 siblings, 1 reply; 31+ messages in thread
From: Eshel Yaron @ 2025-02-04 15:55 UTC (permalink / raw)
  To: Michael Albinus; +Cc: Ship Mints, Emacs Devel

Hi,

Michael Albinus <michael.albinus@gmx.de> writes:

> Ship Mints <shipmints@gmail.com> writes:
>
>> I hope this is the biggest issue with the code...
>
> For now 😃

Here's one more:

--8<---------------cut here---------------start------------->8---
;;;###autoload
(defun auto-revert-tail-mode-on-log-files ()
  "Enable `auto-revert-tail-truncate-mode' for all *.log files."
  (interactive)
  (add-to-list 'auto-mode-alist '("\\.log\\'" . auto-revert-tail-truncate-mode)))
--8<---------------cut here---------------end--------------->8---

auto-mode-alist is for major modes, while auto-revert-tail-truncate-mode
is a minor mode.


Best,

Eshel



^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: autorevert-tail-truncate proposed for Emacs 31 and/or ELPA
  2025-02-04 15:55               ` Eshel Yaron
@ 2025-02-04 16:03                 ` Ship Mints
  2025-02-04 16:29                   ` Eshel Yaron
  2025-02-04 18:30                   ` Michael Albinus
  0 siblings, 2 replies; 31+ messages in thread
From: Ship Mints @ 2025-02-04 16:03 UTC (permalink / raw)
  To: Eshel Yaron; +Cc: Michael Albinus, Emacs Devel

[-- Attachment #1: Type: text/plain, Size: 1072 bytes --]

It's a convenience thing, even if it's wrong. Happy to remove it from the
code and suggest something in the documentation via a major-mode hook.

I don't think there is an equivalent auto-minor-mode-alist.

Or I can define a major mode for this and add that.

On Tue, Feb 4, 2025 at 10:55 AM Eshel Yaron <me@eshelyaron.com> wrote:

> Hi,
>
> Michael Albinus <michael.albinus@gmx.de> writes:
>
> > Ship Mints <shipmints@gmail.com> writes:
> >
> >> I hope this is the biggest issue with the code...
> >
> > For now 😃
>
> Here's one more:
>
> --8<---------------cut here---------------start------------->8---
> ;;;###autoload
> (defun auto-revert-tail-mode-on-log-files ()
>   "Enable `auto-revert-tail-truncate-mode' for all *.log files."
>   (interactive)
>   (add-to-list 'auto-mode-alist '("\\.log\\'" .
> auto-revert-tail-truncate-mode)))
> --8<---------------cut here---------------end--------------->8---
>
> auto-mode-alist is for major modes, while auto-revert-tail-truncate-mode
> is a minor mode.
>
>
> Best,
>
> Eshel
>

[-- Attachment #2: Type: text/html, Size: 1951 bytes --]

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: autorevert-tail-truncate proposed for Emacs 31 and/or ELPA
  2025-02-04 16:03                 ` Ship Mints
@ 2025-02-04 16:29                   ` Eshel Yaron
  2025-02-04 16:34                     ` Ship Mints
  2025-02-04 18:30                   ` Michael Albinus
  1 sibling, 1 reply; 31+ messages in thread
From: Eshel Yaron @ 2025-02-04 16:29 UTC (permalink / raw)
  To: Ship Mints; +Cc: Michael Albinus, Emacs Devel

Ship Mints <shipmints@gmail.com> writes:

> It's a convenience thing, even if it's wrong. Happy to remove it from the code and suggest something in the
> documentation via a major-mode hook.
>
> I don't think there is an equivalent auto-minor-mode-alist.

One common solution is to define a global minor mode.  You can check
buffer-file-name during setup to enable the local minor mode only in
buffers that visit certain files (or files with certain extensions).
Alternatively, I think find-file-hook might also work.


Eshel



^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: autorevert-tail-truncate proposed for Emacs 31 and/or ELPA
  2025-02-04 16:29                   ` Eshel Yaron
@ 2025-02-04 16:34                     ` Ship Mints
  2025-02-04 16:58                       ` Ship Mints
  0 siblings, 1 reply; 31+ messages in thread
From: Ship Mints @ 2025-02-04 16:34 UTC (permalink / raw)
  To: Eshel Yaron; +Cc: Michael Albinus, Emacs Devel

[-- Attachment #1: Type: text/plain, Size: 817 bytes --]

Could do that later on but it seems overkill for this minor mode. I'll
rescind the function and update to advise users to enable the mode in their
appropriate hooks.

On Tue, Feb 4, 2025 at 11:29 AM Eshel Yaron <me@eshelyaron.com> wrote:

> Ship Mints <shipmints@gmail.com> writes:
>
> > It's a convenience thing, even if it's wrong. Happy to remove it from
> the code and suggest something in the
> > documentation via a major-mode hook.
> >
> > I don't think there is an equivalent auto-minor-mode-alist.
>
> One common solution is to define a global minor mode.  You can check
> buffer-file-name during setup to enable the local minor mode only in
> buffers that visit certain files (or files with certain extensions).
> Alternatively, I think find-file-hook might also work.
>
>
> Eshel
>

[-- Attachment #2: Type: text/html, Size: 1291 bytes --]

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: autorevert-tail-truncate proposed for Emacs 31 and/or ELPA
  2025-02-04 16:34                     ` Ship Mints
@ 2025-02-04 16:58                       ` Ship Mints
  0 siblings, 0 replies; 31+ messages in thread
From: Ship Mints @ 2025-02-04 16:58 UTC (permalink / raw)
  To: Eshel Yaron; +Cc: Michael Albinus, Emacs Devel

[-- Attachment #1: Type: text/plain, Size: 934 bytes --]

Pushed.

On Tue, Feb 4, 2025 at 11:34 AM Ship Mints <shipmints@gmail.com> wrote:

> Could do that later on but it seems overkill for this minor mode. I'll
> rescind the function and update to advise users to enable the mode in their
> appropriate hooks.
>
> On Tue, Feb 4, 2025 at 11:29 AM Eshel Yaron <me@eshelyaron.com> wrote:
>
>> Ship Mints <shipmints@gmail.com> writes:
>>
>> > It's a convenience thing, even if it's wrong. Happy to remove it from
>> the code and suggest something in the
>> > documentation via a major-mode hook.
>> >
>> > I don't think there is an equivalent auto-minor-mode-alist.
>>
>> One common solution is to define a global minor mode.  You can check
>> buffer-file-name during setup to enable the local minor mode only in
>> buffers that visit certain files (or files with certain extensions).
>> Alternatively, I think find-file-hook might also work.
>>
>>
>> Eshel
>>
>

[-- Attachment #2: Type: text/html, Size: 1733 bytes --]

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: autorevert-tail-truncate proposed for Emacs 31 and/or ELPA
  2025-02-04 16:03                 ` Ship Mints
  2025-02-04 16:29                   ` Eshel Yaron
@ 2025-02-04 18:30                   ` Michael Albinus
  1 sibling, 0 replies; 31+ messages in thread
From: Michael Albinus @ 2025-02-04 18:30 UTC (permalink / raw)
  To: Ship Mints; +Cc: Eshel Yaron, Emacs Devel

Ship Mints <shipmints@gmail.com> writes:

Hi Ship,

> Or I can define a major mode for this and add that.

Pls don't. In autorevert.el, there are several places assuming that there
are just auto-vert-mode, auto-revert-tail-mode, and global-auto-revert-mode.
Another major mode would require changes there.

Best regards, Michael.



^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: autorevert-tail-truncate proposed for Emacs 31 and/or ELPA
  2025-02-03 17:32 autorevert-tail-truncate proposed for Emacs 31 and/or ELPA Ship Mints
  2025-02-03 22:32 ` Stefan Kangas
  2025-02-04 10:39 ` Michael Albinus
@ 2025-02-04 18:57 ` Philip Kaludercic
  2025-02-04 19:51   ` Ship Mints
  2025-02-05 22:33 ` Stefan Kangas
  3 siblings, 1 reply; 31+ messages in thread
From: Philip Kaludercic @ 2025-02-04 18:57 UTC (permalink / raw)
  To: Ship Mints; +Cc: Emacs Devel

[-- Attachment #1: Type: text/plain, Size: 532 bytes --]

Ship Mints <shipmints@gmail.com> writes:

> I've been using a variant of this for a while in my own config. It seems
> sufficiently general and broadly useful to warrant consideration for
> inclusion as part of the autorevert.el family of modes (for which I'll
> submit a patch, if agreed) and/or via ELPA for people to use in the
> meantime, or forever if not adopted in Emacs proper.
>
> I welcome thoughtful feedback.
>
> https://github.com/shipmints/autorevert-tail-truncate.el

I have a few general comments on the code here:


[-- Attachment #2: Type: text/plain, Size: 2519 bytes --]

diff --git a/autorevert-tail-truncate.el b/autorevert-tail-truncate.el
index 9104143..82c729c 100644
--- a/autorevert-tail-truncate.el
+++ b/autorevert-tail-truncate.el
@@ -1,6 +1,5 @@
-;;; autorevert-tail-truncate.el -- Summary;: -*- mode: emacs-lisp; lexical-binding: t; -*-
+;;; autorevert-tail-truncate.el -- Summary; ???: -*- mode: emacs-lisp; lexical-binding: t; -*-
 
-;; Copyright (C) 2025 Stephane Marks
 ;; Copyright (C) 2025 Free Software Foundation, Inc.
 
 ;; Author: Stephane Marks <shipmints@gmail.com>
@@ -57,8 +56,9 @@
 If nil, truncation is disabled.  Bind this as a buffer-local variable to
 control the maximum number lines to retain for specific buffers."
   :group 'auto-revert
-  :type 'natnum
-  :version "31.1")
+  :type '(choice (const :tag "Disabled" nil) natnum)
+  :safe #'natnump
+  :version "31.1")			;if you want to add it to ELPA, a :package-version would also be nice.
 
 (defcustom auto-revert-tail-truncate-file-size-hint 64
   "Bytes per line hint to `auto-revert-tail-truncate-file'.
@@ -136,7 +136,7 @@ buffer in which it is displayed.
 
 Customize `auto-revert-tail-mode-hook' to control features such as
 `truncate-lines' for the tailed buffer."
-  :group 'find-file
+  :group 'find-file			;why this group?
   :lighter auto-revert-tail-truncate-mode-text
   (if auto-revert-tail-truncate-mode
       (progn
@@ -144,6 +144,8 @@ Customize `auto-revert-tail-mode-hook' to control features such as
         (auto-revert-tail-mode)
         (make-local-variable 'auto-revert-interval)
         (make-local-variable 'auto-revert-timer)
+	;; it is unusual to use `setopt' in code, why not just invoke
+	;; the setter functionality you need?
         (setopt auto-revert-interval auto-revert-tail-truncate-revert-interval)
         (setq-local auto-revert-verbose auto-revert-tail-truncate-verbose)
         (when auto-revert-tail-truncate-read-only
@@ -209,10 +211,11 @@ Invoke programmatically specifying FILENAME."
     (pop-to-buffer buf)))
 
 ;;;###autoload
-(defun auto-revert-tail-mode-on-log-files ()
-  "Enable `auto-revert-tail-truncate-mode' for all *.log files."
-  (interactive)
-  (add-to-list 'auto-mode-alist '("\\.log\\'" . auto-revert-tail-truncate-mode)))
+(progn					;avoid force-loading the entire file
+  (defun auto-revert-tail-mode-on-log-files ()
+    "Enable `auto-revert-tail-truncate-mode' for all *.log files."
+    (interactive)
+    (add-to-list 'auto-mode-alist '("\\.log\\'" . auto-revert-tail-truncate-mode))))
 
 (provide 'autorevert-tail-truncate)
 

[-- Attachment #3: Type: text/plain, Size: 16 bytes --]



>
> -Stephane

^ permalink raw reply related	[flat|nested] 31+ messages in thread

* Re: autorevert-tail-truncate proposed for Emacs 31 and/or ELPA
  2025-02-04 18:57 ` Philip Kaludercic
@ 2025-02-04 19:51   ` Ship Mints
  2025-02-04 20:17     ` Philip Kaludercic
  0 siblings, 1 reply; 31+ messages in thread
From: Ship Mints @ 2025-02-04 19:51 UTC (permalink / raw)
  To: Philip Kaludercic; +Cc: Emacs Devel

[-- Attachment #1: Type: text/plain, Size: 3862 bytes --]

Good comments. Thank you. Pushed.

Question for you: if this is going in ELPA, is this part of GNU Emacs or
not part of GNU Emacs? I've seen both claims in ELPA package headers.

What else would I need to do to support ELPA packaging? I read the
Packaging Basics information but it was silent on where package attributes
like brief or long descriptions are derived from or otherwise sourced.

On Tue, Feb 4, 2025 at 1:57 PM Philip Kaludercic <philipk@posteo.net> wrote:

> Ship Mints <shipmints@gmail.com> writes:
>
> > I've been using a variant of this for a while in my own config. It seems
> > sufficiently general and broadly useful to warrant consideration for
> > inclusion as part of the autorevert.el family of modes (for which I'll
> > submit a patch, if agreed) and/or via ELPA for people to use in the
> > meantime, or forever if not adopted in Emacs proper.
> >
> > I welcome thoughtful feedback.
> >
> > https://github.com/shipmints/autorevert-tail-truncate.el
>
> I have a few general comments on the code here:
>
> diff --git a/autorevert-tail-truncate.el b/autorevert-tail-truncate.el
> index 9104143..82c729c 100644
> --- a/autorevert-tail-truncate.el
> +++ b/autorevert-tail-truncate.el
> @@ -1,6 +1,5 @@
> -;;; autorevert-tail-truncate.el -- Summary;: -*- mode: emacs-lisp;
> lexical-binding: t; -*-
> +;;; autorevert-tail-truncate.el -- Summary; ???: -*- mode: emacs-lisp;
> lexical-binding: t; -*-
>
> -;; Copyright (C) 2025 Stephane Marks
>  ;; Copyright (C) 2025 Free Software Foundation, Inc.
>
>  ;; Author: Stephane Marks <shipmints@gmail.com>
> @@ -57,8 +56,9 @@
>  If nil, truncation is disabled.  Bind this as a buffer-local variable to
>  control the maximum number lines to retain for specific buffers."
>    :group 'auto-revert
> -  :type 'natnum
> -  :version "31.1")
> +  :type '(choice (const :tag "Disabled" nil) natnum)
> +  :safe #'natnump
> +  :version "31.1")                     ;if you want to add it to ELPA, a
> :package-version would also be nice.
>
>  (defcustom auto-revert-tail-truncate-file-size-hint 64
>    "Bytes per line hint to `auto-revert-tail-truncate-file'.
> @@ -136,7 +136,7 @@ buffer in which it is displayed.
>
>  Customize `auto-revert-tail-mode-hook' to control features such as
>  `truncate-lines' for the tailed buffer."
> -  :group 'find-file
> +  :group 'find-file                    ;why this group?
>    :lighter auto-revert-tail-truncate-mode-text
>    (if auto-revert-tail-truncate-mode
>        (progn
> @@ -144,6 +144,8 @@ Customize `auto-revert-tail-mode-hook' to control
> features such as
>          (auto-revert-tail-mode)
>          (make-local-variable 'auto-revert-interval)
>          (make-local-variable 'auto-revert-timer)
> +       ;; it is unusual to use `setopt' in code, why not just invoke
> +       ;; the setter functionality you need?
>          (setopt auto-revert-interval
> auto-revert-tail-truncate-revert-interval)
>          (setq-local auto-revert-verbose auto-revert-tail-truncate-verbose)
>          (when auto-revert-tail-truncate-read-only
> @@ -209,10 +211,11 @@ Invoke programmatically specifying FILENAME."
>      (pop-to-buffer buf)))
>
>  ;;;###autoload
> -(defun auto-revert-tail-mode-on-log-files ()
> -  "Enable `auto-revert-tail-truncate-mode' for all *.log files."
> -  (interactive)
> -  (add-to-list 'auto-mode-alist '("\\.log\\'" .
> auto-revert-tail-truncate-mode)))
> +(progn                                 ;avoid force-loading the entire
> file
> +  (defun auto-revert-tail-mode-on-log-files ()
> +    "Enable `auto-revert-tail-truncate-mode' for all *.log files."
> +    (interactive)
> +    (add-to-list 'auto-mode-alist '("\\.log\\'" .
> auto-revert-tail-truncate-mode))))
>
>  (provide 'autorevert-tail-truncate)
>
>
>
> >
> > -Stephane
>

[-- Attachment #2: Type: text/html, Size: 5178 bytes --]

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: autorevert-tail-truncate proposed for Emacs 31 and/or ELPA
  2025-02-04 19:51   ` Ship Mints
@ 2025-02-04 20:17     ` Philip Kaludercic
  2025-02-04 20:22       ` Ship Mints
  0 siblings, 1 reply; 31+ messages in thread
From: Philip Kaludercic @ 2025-02-04 20:17 UTC (permalink / raw)
  To: Ship Mints; +Cc: Emacs Devel

Ship Mints <shipmints@gmail.com> writes:

> Good comments. Thank you. Pushed.

You seem to have added :version back in since I checked your commit out,
but 29.1 is "more wrong", as you aren't saying that the user options
were added in Emacs 29.1.

Also, it might be nice to have a separate sub-group of auto-revert,
instead of injecting the user options into the existing group.

> Question for you: if this is going in ELPA, is this part of GNU Emacs or
> not part of GNU Emacs? I've seen both claims in ELPA package headers.

There is some disagreement on the matter (if you want to I can find the
thread where I counted how common which statement in on GNU ELPA), but I
would say it is part of GNU Emacs if it is on ELPA.  That's why you have
to sign the CA after all.

> What else would I need to do to support ELPA packaging? I read the
> Packaging Basics information but it was silent on where package attributes
> like brief or long descriptions are derived from or otherwise sourced.

I can build the latest commit, so all that you would need is to
increment the version header at some point so as to indicate the commit
to be used when building the package.

> On Tue, Feb 4, 2025 at 1:57 PM Philip Kaludercic <philipk@posteo.net> wrote:
>
>> Ship Mints <shipmints@gmail.com> writes:
>>
>> > I've been using a variant of this for a while in my own config. It seems
>> > sufficiently general and broadly useful to warrant consideration for
>> > inclusion as part of the autorevert.el family of modes (for which I'll
>> > submit a patch, if agreed) and/or via ELPA for people to use in the
>> > meantime, or forever if not adopted in Emacs proper.
>> >
>> > I welcome thoughtful feedback.
>> >
>> > https://github.com/shipmints/autorevert-tail-truncate.el
>>
>> I have a few general comments on the code here:
>>
>> diff --git a/autorevert-tail-truncate.el b/autorevert-tail-truncate.el
>> index 9104143..82c729c 100644
>> --- a/autorevert-tail-truncate.el
>> +++ b/autorevert-tail-truncate.el
>> @@ -1,6 +1,5 @@
>> -;;; autorevert-tail-truncate.el -- Summary;: -*- mode: emacs-lisp;
>> lexical-binding: t; -*-
>> +;;; autorevert-tail-truncate.el -- Summary; ???: -*- mode: emacs-lisp;
>> lexical-binding: t; -*-
>>
>> -;; Copyright (C) 2025 Stephane Marks
>>  ;; Copyright (C) 2025 Free Software Foundation, Inc.
>>
>>  ;; Author: Stephane Marks <shipmints@gmail.com>
>> @@ -57,8 +56,9 @@
>>  If nil, truncation is disabled.  Bind this as a buffer-local variable to
>>  control the maximum number lines to retain for specific buffers."
>>    :group 'auto-revert
>> -  :type 'natnum
>> -  :version "31.1")
>> +  :type '(choice (const :tag "Disabled" nil) natnum)
>> +  :safe #'natnump
>> +  :version "31.1")                     ;if you want to add it to ELPA, a
>> :package-version would also be nice.
>>
>>  (defcustom auto-revert-tail-truncate-file-size-hint 64
>>    "Bytes per line hint to `auto-revert-tail-truncate-file'.
>> @@ -136,7 +136,7 @@ buffer in which it is displayed.
>>
>>  Customize `auto-revert-tail-mode-hook' to control features such as
>>  `truncate-lines' for the tailed buffer."
>> -  :group 'find-file
>> +  :group 'find-file                    ;why this group?
>>    :lighter auto-revert-tail-truncate-mode-text
>>    (if auto-revert-tail-truncate-mode
>>        (progn
>> @@ -144,6 +144,8 @@ Customize `auto-revert-tail-mode-hook' to control
>> features such as
>>          (auto-revert-tail-mode)
>>          (make-local-variable 'auto-revert-interval)
>>          (make-local-variable 'auto-revert-timer)
>> +       ;; it is unusual to use `setopt' in code, why not just invoke
>> +       ;; the setter functionality you need?
>>          (setopt auto-revert-interval
>> auto-revert-tail-truncate-revert-interval)
>>          (setq-local auto-revert-verbose auto-revert-tail-truncate-verbose)
>>          (when auto-revert-tail-truncate-read-only
>> @@ -209,10 +211,11 @@ Invoke programmatically specifying FILENAME."
>>      (pop-to-buffer buf)))
>>
>>  ;;;###autoload
>> -(defun auto-revert-tail-mode-on-log-files ()
>> -  "Enable `auto-revert-tail-truncate-mode' for all *.log files."
>> -  (interactive)
>> -  (add-to-list 'auto-mode-alist '("\\.log\\'" .
>> auto-revert-tail-truncate-mode)))
>> +(progn                                 ;avoid force-loading the entire
>> file
>> +  (defun auto-revert-tail-mode-on-log-files ()
>> +    "Enable `auto-revert-tail-truncate-mode' for all *.log files."
>> +    (interactive)
>> +    (add-to-list 'auto-mode-alist '("\\.log\\'" .
>> auto-revert-tail-truncate-mode))))
>>
>>  (provide 'autorevert-tail-truncate)
>>
>>
>>
>> >
>> > -Stephane
>>



^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: autorevert-tail-truncate proposed for Emacs 31 and/or ELPA
  2025-02-04 20:17     ` Philip Kaludercic
@ 2025-02-04 20:22       ` Ship Mints
  2025-02-04 22:23         ` Stefan Kangas
  2025-02-05  8:23         ` Michael Albinus
  0 siblings, 2 replies; 31+ messages in thread
From: Ship Mints @ 2025-02-04 20:22 UTC (permalink / raw)
  To: Philip Kaludercic; +Cc: Emacs Devel

[-- Attachment #1: Type: text/plain, Size: 1914 bytes --]

On Tue, Feb 4, 2025 at 3:17 PM Philip Kaludercic <philipk@posteo.net> wrote:

> Ship Mints <shipmints@gmail.com> writes:
>
> > Good comments. Thank you. Pushed.
>
> You seem to have added :version back in since I checked your commit out,
> but 29.1 is "more wrong", as you aren't saying that the user options
> were added in Emacs 29.1.
>

I tried to find documentation on :version vs. :package-version and took a
look at a bunch of ELPA packages including those considered a part of Emacs
and it wasn't uniform.

I'll follow whatever pattern you think is TRT, even if others don't agree,
heh.


> Also, it might be nice to have a separate sub-group of auto-revert,
> instead of injecting the user options into the existing group.
>

Coming soon. I'd originally assumed this was a sufficiently tiny and useful
addition to autorevert.el that we'd just reuse the infrastructure.


> > Question for you: if this is going in ELPA, is this part of GNU Emacs or
> > not part of GNU Emacs? I've seen both claims in ELPA package headers.
>
> There is some disagreement on the matter (if you want to I can find the
> thread where I counted how common which statement in on GNU ELPA), but I
> would say it is part of GNU Emacs if it is on ELPA.  That's why you have
> to sign the CA after all.
>

I'll consider it part of.

> What else would I need to do to support ELPA packaging? I read the
> > Packaging Basics information but it was silent on where package
> attributes
> > like brief or long descriptions are derived from or otherwise sourced.
>
> I can build the latest commit, so all that you would need is to
> increment the version header at some point so as to indicate the commit
> to be used when building the package.
>

How about I check in 0.1 for now and after other people chime in with good
ideas, I'll bump it to 1.0 and we can use that as a semaphore?

[-- Attachment #2: Type: text/html, Size: 3328 bytes --]

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: autorevert-tail-truncate proposed for Emacs 31 and/or ELPA
  2025-02-04 20:22       ` Ship Mints
@ 2025-02-04 22:23         ` Stefan Kangas
  2025-02-04 22:28           ` Ship Mints
  2025-02-05  8:23         ` Michael Albinus
  1 sibling, 1 reply; 31+ messages in thread
From: Stefan Kangas @ 2025-02-04 22:23 UTC (permalink / raw)
  To: Ship Mints, Philip Kaludercic; +Cc: Emacs Devel

Ship Mints <shipmints@gmail.com> writes:

> I tried to find documentation on :version vs. :package-version and took a
> look at a bunch of ELPA packages including those considered a part of Emacs
> and it wasn't uniform.
>
> I'll follow whatever pattern you think is TRT, even if others don't agree,
> heh.

It's a bit complicated, yes.  If you're interested, the best explanation
I know of is the last message by Eli here:

    Bug#13824

The bug is not fixed yet, unfortunately.



^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: autorevert-tail-truncate proposed for Emacs 31 and/or ELPA
  2025-02-04 22:23         ` Stefan Kangas
@ 2025-02-04 22:28           ` Ship Mints
  2025-02-05 22:32             ` Stefan Kangas
  0 siblings, 1 reply; 31+ messages in thread
From: Ship Mints @ 2025-02-04 22:28 UTC (permalink / raw)
  To: Stefan Kangas; +Cc: Philip Kaludercic, Emacs Devel

[-- Attachment #1: Type: text/plain, Size: 930 bytes --]

I guess it's low priority enough, if it is still open from 6 years ago. Is
there a compromise, either use :version or :package-version but not both?
And which one? :version seems more popular and probably just about
guaranteed to work, even if its meaning has been absconded with by packages
external to core.

On Tue, Feb 4, 2025 at 5:23 PM Stefan Kangas <stefankangas@gmail.com> wrote:

> Ship Mints <shipmints@gmail.com> writes:
>
> > I tried to find documentation on :version vs. :package-version and took a
> > look at a bunch of ELPA packages including those considered a part of
> Emacs
> > and it wasn't uniform.
> >
> > I'll follow whatever pattern you think is TRT, even if others don't
> agree,
> > heh.
>
> It's a bit complicated, yes.  If you're interested, the best explanation
> I know of is the last message by Eli here:
>
>     Bug#13824
>
> The bug is not fixed yet, unfortunately.
>

[-- Attachment #2: Type: text/html, Size: 1422 bytes --]

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: autorevert-tail-truncate proposed for Emacs 31 and/or ELPA
  2025-02-04 20:22       ` Ship Mints
  2025-02-04 22:23         ` Stefan Kangas
@ 2025-02-05  8:23         ` Michael Albinus
  2025-02-05 10:39           ` Ship Mints
  1 sibling, 1 reply; 31+ messages in thread
From: Michael Albinus @ 2025-02-05  8:23 UTC (permalink / raw)
  To: Ship Mints; +Cc: Philip Kaludercic, Emacs Devel

Ship Mints <shipmints@gmail.com> writes:

Hi,

> I'll follow whatever pattern you think is TRT, even if others don't
> agree, heh.
>
>     Also, it might be nice to have a separate sub-group of
>     auto-revert,
>     instead of injecting the user options into the existing group.

As (kind of *) responsible of autorevert.el, I can live with both: using
group 'auto-revert', or using a sub-group of.

> How about I check in 0.1 for now and after other people chime in with
> good ideas, I'll bump it to 1.0 and we can use that as a semaphore?

The trick is to use version 0, if you want to add it to GNU ELPA, but
suppress an early release. (Philip, pls correct me if I misremember.)

*): See admin/MAINTAINERS

Best regards, Michael.



^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: autorevert-tail-truncate proposed for Emacs 31 and/or ELPA
  2025-02-05  8:23         ` Michael Albinus
@ 2025-02-05 10:39           ` Ship Mints
  2025-02-05 11:07             ` Philip Kaludercic
  0 siblings, 1 reply; 31+ messages in thread
From: Ship Mints @ 2025-02-05 10:39 UTC (permalink / raw)
  To: Michael Albinus; +Cc: Philip Kaludercic, Emacs Devel

[-- Attachment #1: Type: text/plain, Size: 1433 bytes --]

Referring to the autorevert group makes sense as naming prefixes are all
the same.

Now seems like the right time to decide among:

1. autorevert.el proper as part of Emacs 31 and no ELPA (I can keep it on
github for people who want to adopt it via package-vc/:vc)

2. Publish on ELPA and on-board to Emacs 31 as a built-in, but separate
file to autorevert.el.

3. Never Emacs cor and just use ELPA.

In light of the choice above, defcustom metadata seems easier to choose. 1.
:version. 2. :package-version. 3. :package-version.

On Wed, Feb 5, 2025 at 3:23 AM Michael Albinus <michael.albinus@gmx.de>
wrote:

> Ship Mints <shipmints@gmail.com> writes:
>
> Hi,
>
> > I'll follow whatever pattern you think is TRT, even if others don't
> > agree, heh.
> >
> >     Also, it might be nice to have a separate sub-group of
> >     auto-revert,
> >     instead of injecting the user options into the existing group.
>
> As (kind of *) responsible of autorevert.el, I can live with both: using
> group 'auto-revert', or using a sub-group of.
>
> > How about I check in 0.1 for now and after other people chime in with
> > good ideas, I'll bump it to 1.0 and we can use that as a semaphore?
>
> The trick is to use version 0, if you want to add it to GNU ELPA, but
> suppress an early release. (Philip, pls correct me if I misremember.)
>
> *): See admin/MAINTAINERS
>
> Best regards, Michael.
>

[-- Attachment #2: Type: text/html, Size: 2608 bytes --]

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: autorevert-tail-truncate proposed for Emacs 31 and/or ELPA
  2025-02-05 10:39           ` Ship Mints
@ 2025-02-05 11:07             ` Philip Kaludercic
  0 siblings, 0 replies; 31+ messages in thread
From: Philip Kaludercic @ 2025-02-05 11:07 UTC (permalink / raw)
  To: Ship Mints; +Cc: Michael Albinus, Emacs Devel

Ship Mints <shipmints@gmail.com> writes:

> Referring to the autorevert group makes sense as naming prefixes are all
> the same.

It depends on the below.  If the code is added to the core, then it
doesn't make a difference.  But if the package is on ELPA and users can
install it, it is nice to have all options related to a package in one
place, clearly distinguishable from the core functionality.

> Now seems like the right time to decide among:
>
> 1. autorevert.el proper as part of Emacs 31 and no ELPA (I can keep it on
> github for people who want to adopt it via package-vc/:vc)
>
> 2. Publish on ELPA and on-board to Emacs 31 as a built-in, but separate
> file to autorevert.el.
>
> 3. Never Emacs cor and just use ELPA.
>
> In light of the choice above, defcustom metadata seems easier to choose. 1.
> :version. 2. :package-version. 3. :package-version.
>
> On Wed, Feb 5, 2025 at 3:23 AM Michael Albinus <michael.albinus@gmx.de>
> wrote:
>
>> Ship Mints <shipmints@gmail.com> writes:
>>
>> Hi,
>>
>> > I'll follow whatever pattern you think is TRT, even if others don't
>> > agree, heh.
>> >
>> >     Also, it might be nice to have a separate sub-group of
>> >     auto-revert,
>> >     instead of injecting the user options into the existing group.
>>
>> As (kind of *) responsible of autorevert.el, I can live with both: using
>> group 'auto-revert', or using a sub-group of.
>>
>> > How about I check in 0.1 for now and after other people chime in with
>> > good ideas, I'll bump it to 1.0 and we can use that as a semaphore?
>>
>> The trick is to use version 0, if you want to add it to GNU ELPA, but
>> suppress an early release. (Philip, pls correct me if I misremember.)

Yes, either that or by adding a suffix like -dev (or really anything
that `version-to-list' would parse to include a negative value).

>> *): See admin/MAINTAINERS
>>
>> Best regards, Michael.
>>



^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: autorevert-tail-truncate proposed for Emacs 31 and/or ELPA
  2025-02-04 22:28           ` Ship Mints
@ 2025-02-05 22:32             ` Stefan Kangas
  2025-02-06  8:20               ` Eli Zaretskii
  0 siblings, 1 reply; 31+ messages in thread
From: Stefan Kangas @ 2025-02-05 22:32 UTC (permalink / raw)
  To: Ship Mints; +Cc: Philip Kaludercic, Emacs Devel

Ship Mints <shipmints@gmail.com> writes:

> I guess it's low priority enough, if it is still open from 6 years ago. Is
> there a compromise, either use :version or :package-version but not both?
> And which one? :version seems more popular and probably just about
> guaranteed to work, even if its meaning has been absconded with by packages
> external to core.

I think using either one is fine in practice.



^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: autorevert-tail-truncate proposed for Emacs 31 and/or ELPA
  2025-02-03 17:32 autorevert-tail-truncate proposed for Emacs 31 and/or ELPA Ship Mints
                   ` (2 preceding siblings ...)
  2025-02-04 18:57 ` Philip Kaludercic
@ 2025-02-05 22:33 ` Stefan Kangas
  2025-02-05 22:40   ` Ship Mints
  3 siblings, 1 reply; 31+ messages in thread
From: Stefan Kangas @ 2025-02-05 22:33 UTC (permalink / raw)
  To: Ship Mints, Emacs Devel

Ship Mints <shipmints@gmail.com> writes:

> I've been using a variant of this for a while in my own config. It seems
> sufficiently general and broadly useful to warrant consideration for
> inclusion as part of the autorevert.el family of modes (for which I'll
> submit a patch, if agreed) and/or via ELPA for people to use in the
> meantime, or forever if not adopted in Emacs proper.
>
> I welcome thoughtful feedback.
>
> https://github.com/shipmints/autorevert-tail-truncate.el
>
> -Stephane

Could you please explain how this relates to `auto-revert-tail-mode`?

Could your mode be merged with that one somehow?



^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: autorevert-tail-truncate proposed for Emacs 31 and/or ELPA
  2025-02-05 22:33 ` Stefan Kangas
@ 2025-02-05 22:40   ` Ship Mints
  0 siblings, 0 replies; 31+ messages in thread
From: Ship Mints @ 2025-02-05 22:40 UTC (permalink / raw)
  To: Stefan Kangas; +Cc: Emacs Devel

[-- Attachment #1: Type: text/plain, Size: 1633 bytes --]

This mode differs from auto-revert-tail in that it keeps the tailed buffer
trimmed to the limit specified by the user. It also has a few extra
controls over the buffer; e.g., disabling the undo tree, disabling
font-lock.

To me, the key things that make this better as a separate mode vs.
integrating into auto-revert-tail mode itself (though it does use
auto-revert-tail under the covers) are that it specifies its own interval
which may differ from the global auto-revert timer interval and localizes
the timer to the buffer rather than use the global timer. I have typically
set my global auto-revert interval to 5 seconds and tail-truncate interval
to 1 second.

This could be a mode in autorevert.el as a small addition. It seems useful
enough in general that when I first looked for this feature, I was
surprised it wasn't already in autorevert.

-Stephane

On Wed, Feb 5, 2025 at 5:33 PM Stefan Kangas <stefankangas@gmail.com> wrote:

> Ship Mints <shipmints@gmail.com> writes:
>
> > I've been using a variant of this for a while in my own config. It seems
> > sufficiently general and broadly useful to warrant consideration for
> > inclusion as part of the autorevert.el family of modes (for which I'll
> > submit a patch, if agreed) and/or via ELPA for people to use in the
> > meantime, or forever if not adopted in Emacs proper.
> >
> > I welcome thoughtful feedback.
> >
> > https://github.com/shipmints/autorevert-tail-truncate.el
> >
> > -Stephane
>
> Could you please explain how this relates to `auto-revert-tail-mode`?
>
> Could your mode be merged with that one somehow?
>

[-- Attachment #2: Type: text/html, Size: 2609 bytes --]

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: autorevert-tail-truncate proposed for Emacs 31 and/or ELPA
  2025-02-05 22:32             ` Stefan Kangas
@ 2025-02-06  8:20               ` Eli Zaretskii
  0 siblings, 0 replies; 31+ messages in thread
From: Eli Zaretskii @ 2025-02-06  8:20 UTC (permalink / raw)
  To: Stefan Kangas; +Cc: shipmints, philipk, emacs-devel

> From: Stefan Kangas <stefankangas@gmail.com>
> Date: Wed, 5 Feb 2025 14:32:23 -0800
> Cc: Philip Kaludercic <philipk@posteo.net>, Emacs Devel <emacs-devel@gnu.org>
> 
> Ship Mints <shipmints@gmail.com> writes:
> 
> > I guess it's low priority enough, if it is still open from 6 years ago. Is
> > there a compromise, either use :version or :package-version but not both?
> > And which one? :version seems more popular and probably just about
> > guaranteed to work, even if its meaning has been absconded with by packages
> > external to core.
> 
> I think using either one is fine in practice.

Yes.  But if a package will be on ELPA, I think :package-version is
preferred, as it allows to decouple package versions from Emacs
versions without losing the support of customize-changed.



^ permalink raw reply	[flat|nested] 31+ messages in thread

end of thread, other threads:[~2025-02-06  8:20 UTC | newest]

Thread overview: 31+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-02-03 17:32 autorevert-tail-truncate proposed for Emacs 31 and/or ELPA Ship Mints
2025-02-03 22:32 ` Stefan Kangas
2025-02-04 10:42   ` Michael Albinus
2025-02-04 13:49     ` Stefan Monnier
2025-02-04 14:17       ` Michael Albinus
2025-02-04 10:39 ` Michael Albinus
2025-02-04 11:11   ` Ship Mints
2025-02-04 14:13     ` Michael Albinus
2025-02-04 14:18       ` Ship Mints
2025-02-04 14:34         ` Michael Albinus
2025-02-04 14:34           ` Ship Mints
2025-02-04 14:42             ` Michael Albinus
2025-02-04 15:55               ` Eshel Yaron
2025-02-04 16:03                 ` Ship Mints
2025-02-04 16:29                   ` Eshel Yaron
2025-02-04 16:34                     ` Ship Mints
2025-02-04 16:58                       ` Ship Mints
2025-02-04 18:30                   ` Michael Albinus
2025-02-04 18:57 ` Philip Kaludercic
2025-02-04 19:51   ` Ship Mints
2025-02-04 20:17     ` Philip Kaludercic
2025-02-04 20:22       ` Ship Mints
2025-02-04 22:23         ` Stefan Kangas
2025-02-04 22:28           ` Ship Mints
2025-02-05 22:32             ` Stefan Kangas
2025-02-06  8:20               ` Eli Zaretskii
2025-02-05  8:23         ` Michael Albinus
2025-02-05 10:39           ` Ship Mints
2025-02-05 11:07             ` Philip Kaludercic
2025-02-05 22:33 ` Stefan Kangas
2025-02-05 22:40   ` Ship Mints

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.