all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Phil Sainty <psainty@orcon.net.nz>
To: Eli Zaretskii <eliz@gnu.org>
Cc: mithraeum@protonmail.com, monnier@IRO.UMontreal.CA, emacs-devel@gnu.org
Subject: Re: Performance degradation from long lines
Date: Sun, 10 Mar 2019 23:22:02 +1300	[thread overview]
Message-ID: <85d7a4df-27b1-1cc5-64b0-95fc7bd14ccb@orcon.net.nz> (raw)
In-Reply-To: <83pnt2f80q.fsf@gnu.org>

On 13/01/19 12:08 AM, Eli Zaretskii wrote:
>> http://git.savannah.gnu.org/cgit/emacs.git/log?h=scratch/so-long
> 
> Thanks.  I think we can land this on master, but see a few minor
> comments below, mostly about documentation.
> 
> Please use quoting 'like this' consistently [in NEWS].

Fixed.


>   +;; This library advises `set-auto-mode' (in order to react after Emacs has
>   +;; chosen the major mode for a buffer), and `hack-local-variables' (so that we
>   +;; may behave differently when a file-local mode is set).  In earlier versions
>   +;; of Emacs (< 26.1) we also advise `hack-one-local-variable' (to prevent a
>   +;; file-local mode from restoring the original major mode if we had changed it).
> 
> I'd prefer not to use advices in bundled code.  Is it feasible to
> instead include hooks in Emacs that so-long-mode could use?  If the
> problem is older versions of Emacs, I'm okay with using advices only
> for those old versions.

This harks back to my earlier comments here:
https://lists.gnu.org/archive/html/emacs-devel/2018-10/msg00551.html

I was subsequently convinced by the argument that building the GNU ELPA
release directly from the core version for Emacs 27 was the sensible
approach, so the library as-is is intended to be backwards-compatible
(minimum version is presently 24.4).

I'm sure that we could introduce some new changes and hooks to 27 to
avoid the need for the advice, but I think that could be version 1.1.


>   +(defgroup so-long nil
>   +  "Prevent unacceptable performance degradation with very long lines."
>   +  :prefix "so-long"
>   +  :group 'convenience)
>   +
>   +(defcustom so-long-threshold 250
>   +  "Maximum line length permitted before invoking `so-long-function'.
>   +
>   +See `so-long-detected-long-line-p' for details."
>   +  :type 'integer
>   +  :package-version '(so-long . "1.0")
>   +  :group 'so-long)
> 
> Please add :version tags to all the customizable options.

It hadn't occurred to me that the defgroup should specify a version,
but I can add that.

I thought that :package-version functioned as an alternative to
:version which worked both for the core library and for the GNU ELPA
package for earlier emacs versions?

Libraries like rst.el and mh-e.el seem to use it this way.

I already have:

(add-to-list 'customize-package-emacs-version-alist
             '(so-long ("1.0" . "27.1")))

And :package-version '(so-long . "1.0") for all options.

Do I need to add :version "27.1" as well?


>   +(defcustom so-long-target-modes
>   +  '(prog-mode css-mode sgml-mode nxml-mode)
>   +  "`so-long' affects only these modes and their derivatives.
> 
> I've heard complaints from users of JASON and JavaScript -- should the
> default value cover those as well?

JSON rather than JASON, I imagine?

js-mode is derived from prog-mode, so both of those are covered.


>   +(defun so-long-action-alist-setter (option value)
>   +  "The :set function for `so-long-action-alist'."
> 
> For non-internal functions, please reference the arguments in the
> first line of the doc string.

That's pretty internal.  I'll rename that and `so-long-action-type'
with a so-long-- prefix.


>   +(defun so-long-change-major-mode ()
>   +  "Ensures that `so-long-mode' knows the original `major-mode'
>   +even when invoked interactively.
> 
> "Ensure", to be consistent with our style of writing the first
> sentence of the doc strings.

Done.

> Also, please make the first sentence fit on a single line -- this
> is important for Apropos commands, which only display one line.

In this instance I had intentionally wrapped the line early so that
the first line was coherent on its own, even though it was part of a
longer sentence.  i.e.:

"Ensures that `so-long-mode' knows the original `major-mode'"

If that's not sufficient, I can rephrase it over multiple sentences.


>   +(defun so-long-menu ()
>   +  "Dynamically generate the \"So Long\" menu."
>   +  ;; (info "(elisp) Menu Example")
> 
> How about providing some help-echo for this menu?

I'd tried that initially, but I found it so glitchy that I removed it.
As I recall, there was a tendency for a blank popup to appear a lot of
the time, which wasn't useful, and wasn't something I wanted to debug.

The Help sub-menu contains an option for reading the Commentary,
which covers the various menu items, so I'm happy with that for
documentation.


>   +(defun so-long-menu-item-revert ()
>   +  "Invoke `so-long-revert'."
> 
> This doc string is not very informative, and neither is that of
> so-long-revert.  How about adding more detailed description here?
> I believe this is an important command that users will want to know
> about.

True.  I don't think there's very much to add, but I shall elaborate
somewhat on the latter's documentation.

I think the `so-long-menu-item-revert' docstring can remain as a
simple cross-reference to `so-long-revert', or else I could do this:

;; Duplicate the `so-long-revert' documentation for the menu item.
(put 'so-long-menu-item-revert 'function-documentation
     (documentation 'so-long-revert t))


-Phil



  reply	other threads:[~2019-03-10 10:22 UTC|newest]

Thread overview: 106+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-24 23:59 Performance degradation from long lines mithraeum
2018-10-25  0:27 ` Stefan Monnier
2018-10-25 15:02   ` Eli Zaretskii
2018-10-25 15:37     ` Stefan Monnier
2018-10-25  3:26 ` Phil Sainty
2018-10-25 12:44   ` Stefan Monnier
2018-10-25 13:23     ` Eli Zaretskii
2018-10-25 13:30       ` Stefan Monnier
2018-10-25 15:08         ` Eli Zaretskii
2018-10-25 22:34           ` Phil Sainty
2018-10-26  6:36             ` Eli Zaretskii
2018-10-26 12:48             ` Stefan Monnier
2018-10-27  8:38               ` Phil Sainty
2018-10-27 15:32                 ` Drew Adams
2018-10-28  1:51                   ` Phil Sainty
2018-10-28  1:58                     ` Drew Adams
2018-10-27 22:18                 ` Stefan Monnier
2018-12-08 23:08                 ` Stefan Monnier
2018-12-09 14:40                   ` Phil Sainty
2018-12-30  4:07                     ` Phil Sainty
2019-01-12  1:03                       ` Phil Sainty
2019-01-12 11:08                         ` Eli Zaretskii
2019-03-10 10:22                           ` Phil Sainty [this message]
2019-03-10 12:58                             ` Eli Zaretskii
2019-03-10 13:36                               ` martin rudalics
2019-03-10 13:46                                 ` Eli Zaretskii
2019-03-10 23:16                                   ` Phil Sainty
2019-03-10 18:06                                 ` Stefan Monnier
2019-03-11  9:14                                   ` martin rudalics
2019-03-10 23:31                               ` Phil Sainty
2019-03-11  3:35                                 ` Eli Zaretskii
2019-03-11  3:48                                   ` Phil Sainty
2019-03-11 14:35                                     ` Eli Zaretskii
2018-10-26  1:46   ` mithraeum
2018-10-26  2:39     ` Phil Sainty
2018-10-26  2:58       ` mithraeum
2018-10-26  4:43         ` Phil Sainty
2018-10-26  5:54           ` mithraeum
2018-10-26  2:54     ` Phil Sainty
2018-10-26 15:18       ` Stefan Monnier
2018-10-27  3:10     ` Phil Sainty
2018-10-27 22:15       ` Stefan Monnier
2018-12-30  5:23         ` Phil Sainty
2018-10-28  2:03   ` Phil Sainty
2018-10-25 15:00 ` Eli Zaretskii
2018-10-25 17:18   ` Michael Heerdegen
2018-10-25 17:30     ` Eli Zaretskii
2018-10-26  0:59     ` mithraeum
2018-10-26  6:48       ` Eli Zaretskii
2018-10-26  7:00   ` Ihor Radchenko
2018-10-26  7:28     ` Eli Zaretskii
2018-10-26  7:36       ` Ihor Radchenko
2018-10-26  7:57         ` Eli Zaretskii
2018-10-26  8:05           ` Ihor Radchenko
2018-10-26  8:46             ` Eli Zaretskii
2018-10-26  8:58               ` Ihor Radchenko
2018-10-26  9:08                 ` Eli Zaretskii
2018-10-26  9:46                   ` Noam Postavsky
2018-10-26 12:35                     ` Eli Zaretskii
2018-10-26 15:09                 ` Stefan Monnier
2018-10-26  9:52               ` mithraeum
2018-10-26  8:05         ` mithraeum
2018-10-26 16:05     ` Gemini Lasswell
2018-10-31 13:05       ` Ihor Radchenko
2018-10-31 15:49         ` Eli Zaretskii
2018-10-25 17:53 ` Clément Pit-Claudel
2018-10-25 19:14   ` Eli Zaretskii
2018-10-25 19:17     ` Clément Pit-Claudel
2018-10-26  6:40 ` mithraeum
2018-10-26  7:26   ` Eli Zaretskii
2018-10-26  7:47     ` mithraeum
2018-10-26  8:30       ` Eli Zaretskii
2018-10-26  8:56         ` mithraeum
2018-10-26  9:06           ` Eli Zaretskii
2018-10-26 15:29           ` Stefan Monnier
2018-10-26 15:34 ` Alexander Shukaev
2018-10-26 16:18   ` Stefan Monnier
2018-10-26 16:50     ` Alexander Shukaev
2018-10-26 17:27       ` Stefan Monnier
2018-10-27  2:09   ` Phil Sainty
     [not found] <20190107065207.21793.53271@vcs0.savannah.gnu.org>
     [not found] ` <20190107065208.BA36C21736@vcs0.savannah.gnu.org>
2019-01-10 18:07   ` [Emacs-diffs] scratch/so-long 7273fb2: Add so-long library Stefan Monnier
2019-01-12  2:20     ` Phil Sainty
2019-01-12 15:11       ` Stefan Monnier
2019-04-14 13:09         ` Phil Sainty
2019-04-14 15:14           ` Stefan Monnier
2019-04-14 22:33             ` Phil Sainty
2019-06-27 13:46               ` Performance degradation from long lines Phil Sainty
2019-07-06 14:18                 ` Phil Sainty
2019-07-13  8:07                   ` Eli Zaretskii
2019-07-13  9:07                     ` Stefan Kangas
2019-07-13  9:51                       ` Eli Zaretskii
2019-07-13 10:23                         ` Stefan Kangas
2019-07-13 10:29                           ` Eli Zaretskii
2019-07-13 10:38                             ` Stefan Kangas
2019-07-13 10:58                               ` Phil Sainty
2019-07-13 11:23                                 ` Eli Zaretskii
2019-07-13 11:23                               ` Eli Zaretskii
2019-07-13  9:33                     ` Phil Sainty
2019-07-13  9:56                       ` Eli Zaretskii
2019-07-13 13:31                         ` Stefan Monnier
2019-07-13 13:43                           ` Stefan Kangas
2019-07-13 14:14                           ` Eli Zaretskii
2019-07-13 14:17                             ` Stefan Monnier
2019-07-13 18:17                               ` Eli Zaretskii
2019-07-13 22:22                                 ` Stefan Monnier
2019-07-14  5:39                                   ` Eli Zaretskii
2019-07-15 13:12                                     ` Dmitry Gutov
2019-07-18  6:30                                       ` Eli Zaretskii
2019-07-18 14:48                                         ` Stefan Monnier
2019-07-18 17:11                                           ` Clément Pit-Claudel
2019-07-18 18:11                                             ` Stefan Monnier
2019-07-18 18:33                                           ` Andy Moreton

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

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

  git send-email \
    --in-reply-to=85d7a4df-27b1-1cc5-64b0-95fc7bd14ccb@orcon.net.nz \
    --to=psainty@orcon.net.nz \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=mithraeum@protonmail.com \
    --cc=monnier@IRO.UMontreal.CA \
    /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 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.