unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Dmitry Gutov <dgutov@yandex.ru>
Cc: monnier@iro.umontreal.ca, emacs-devel@gnu.org
Subject: Re: Change in files.el
Date: Sat, 28 Jan 2017 18:12:48 +0200	[thread overview]
Message-ID: <834m0jyxhb.fsf@gnu.org> (raw)
In-Reply-To: <b60dc274-c5f2-89a3-a2c2-202da156cae7@yandex.ru> (message from Dmitry Gutov on Sat, 28 Jan 2017 18:31:29 +0300)

> Cc: emacs-devel@gnu.org
> From: Dmitry Gutov <dgutov@yandex.ru>
> Date: Sat, 28 Jan 2017 18:31:29 +0300
> 
> On 28.01.2017 17:57, Eli Zaretskii wrote:
> 
> > These sound minor to me (and the last two are also possible without
> > the requirement, AFAIU).  By contrast, insisting on a function value
> > instead of the default nil forces me to go through at least one more
> > level of indirection when I need to understand what happens in a
> > function that references such variables, which sounds like a more
> > serious trouble from my POV.
> 
> It's just one more level of indirection. We routinely deal with dozens 
> of them.

Each one is an additional annoyance, making maintenance harder.  Given
enough levels of indirection, it is practically impossible to
understand what the code does just by looking at the source; you need
to actually step through it in a debugger.  And that makes maintenance
a PITA, and in some cases might cause me to give up on a problem in
despair.

> This above rule should just be adhered consistently, and the
> indirection won't be a surprise every time.

There's no surprise here, only the annoying need to wade through
indirection levels.

> On the plus side, you might get a smaller function that calls the 
> -default one, because some code will be extracted.

That's only a plus when you need to write that code, not when you need
to understand or debug it.

> Finally, the default value of save-some-buffers-default-predicate can be 
> #'ignore or #'identity (it's either this, or the previous paragraph, I'm 
> not familiar with the code enough to be sure).

For predicates that need to return nil or t, the default value might
be ridiculous, if it has to be wrapped in a function.

> > I was up to my neck in this when I
> > needed to document all the various optional behaviors implemented in
> > isearch.el, and bumped into similar issues several times elsewhere.
> 
> isearch.el and etags.el have more egregious problems, such as extensive 
> use of dynamic bindings.

Yes, and using indirection doesn't help there.



  reply	other threads:[~2017-01-28 16:12 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-28  2:16 Change in files.el Richard Stallman
2017-01-28  2:46 ` Stefan Monnier
2017-01-28  9:10   ` Eli Zaretskii
2017-01-28 14:40     ` Stefan Monnier
2017-01-28 14:57       ` Eli Zaretskii
2017-01-28 15:31         ` Dmitry Gutov
2017-01-28 16:12           ` Eli Zaretskii [this message]
2017-01-28 15:40         ` Stefan Monnier
2017-01-28 16:08           ` Eli Zaretskii
2017-01-28 16:51             ` Stefan Monnier
2017-01-28 17:11               ` Eli Zaretskii
2017-01-28 17:22                 ` Stefan Monnier
2017-01-28 17:30                   ` Eli Zaretskii
2017-01-28 17:42                     ` Stefan Monnier
2017-01-28 17:53                       ` Eli Zaretskii
2017-01-29 18:59                         ` John Wiegley
2017-01-30  3:57                           ` Leo Liu
2017-01-30 15:58                             ` John Wiegley
2017-01-31  4:19                               ` Leo Liu
2017-01-31 14:01                                 ` John Wiegley
2017-01-31 14:46                               ` Stefan Monnier
2017-01-31 16:21                                 ` Kaushal Modi
2017-01-31 18:40                                   ` Default value of variables named `*-function' [was: Change in files.el] Drew Adams
2017-02-01  8:35                                     ` Andreas Röhler
2017-01-28 18:41                       ` Change in files.el Mark Oteiza
2017-01-28 19:37                         ` Eli Zaretskii
2017-02-01  3:49                           ` Mark Oteiza
2017-02-01  7:33                             ` Clément Pit-Claudel
2017-02-01 12:56                               ` Eli Zaretskii
2017-02-01 14:12                                 ` Kaushal Modi
2017-01-29  0:21       ` Richard Stallman
2017-02-04  9:18 ` Eli Zaretskii
2017-02-04 23:52   ` Richard Stallman

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=834m0jyxhb.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=dgutov@yandex.ru \
    --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 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).