all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: emacs-devel@gnu.org
Subject: Re: [Emacs-diffs] master 012487b: * lisp/display-line-numbers.el (display-line-numbers-type): Autoload it.
Date: Mon, 24 Jul 2017 21:04:18 +0300	[thread overview]
Message-ID: <83o9s97lul.fsf@gnu.org> (raw)
In-Reply-To: <jwvd18psqkv.fsf-monnier+gmane.emacs.devel@gnu.org> (message from Stefan Monnier on Mon, 24 Jul 2017 13:29:39 -0400)

> From: Stefan Monnier <monnier@iro.umontreal.ca>
> Date: Mon, 24 Jul 2017 13:29:39 -0400
> 
> >> +;; Following function calls will autoload the library.
> >> +(defvar display-line-numbers-type)
> >> +
> >> (defun menu-bar-display-line-numbers-mode (type)
> >> (setq display-line-numbers-type type)
> >> (if global-display-line-numbers-mode
> > How is this better than the autoload?
> 
> Autoloading variables is a source of corner-case problems, and
> autoloading defcustoms even more so.

Emacs is full of corner-case problems, one more or one less won't
change anything.

And can you PLEASE make the problems documented somewhere?  The way
you are fighting this makes it sound like some black magic that only
you understand.  Maybe if the problem description is out in the open,
it will be easier to get people to follow your views?

> It's not serious enough to ban such autoloads, but it's a good
> practice to try and avoid them when it can be done cheaply, and to
> clearly document them when we do need them.

Good practice comes out from clearly documented problems and well
explained solutions.  We should _educate_ people to avoid such
problems, not haunt them with review comments that, left unexplained,
make little sense.  If it's important, it should be in "code
conventions" in the ELisp manual.

> - the comment on the defvar isn't needed anyway: it's pretty clear why the
>   defvar is used

It isn't clear to me, at least.



  reply	other threads:[~2017-07-24 18:04 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20170723072843.23485.53761@vcs0.savannah.gnu.org>
     [not found] ` <20170723072844.877FD22EF0@vcs0.savannah.gnu.org>
2017-07-23 13:28   ` [Emacs-diffs] master 012487b: * lisp/display-line-numbers.el (display-line-numbers-type): Autoload it Stefan Monnier
2017-07-23 14:02     ` Michael Albinus
2017-07-24 16:57       ` Glenn Morris
2017-07-24 17:01         ` Eli Zaretskii
2017-07-24 17:29           ` Stefan Monnier
2017-07-24 18:04             ` Eli Zaretskii [this message]
2017-07-24 18:16               ` Stefan Monnier
2017-07-24 18:37                 ` Eli Zaretskii
2017-07-24 20:05                   ` Stefan Monnier
2017-07-24 18:20               ` Stefan Monnier
2017-07-24 18:43                 ` Eli Zaretskii
2017-07-24 20:02                   ` Stefan Monnier
2017-07-25  2:36                     ` Eli Zaretskii
2017-07-25  3:22                       ` Stefan Monnier
2017-07-25  5:18                         ` Eli Zaretskii
2017-07-25  7:37                         ` Michael Albinus
2017-07-25 13:56                           ` Stefan Monnier
2017-07-26 16:54                           ` Glenn Morris
2017-07-26 18:59                             ` Eli Zaretskii
2017-07-24 17:26         ` Michael Albinus
2017-07-24 17:30           ` Stefan Monnier
2017-07-24 17:34             ` Michael Albinus

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=83o9s97lul.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --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.