emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Ibuffer: w and B default to buffer at current line


From: John Wiegley
Subject: Re: Ibuffer: w and B default to buffer at current line
Date: Sat, 17 Sep 2016 19:18:22 -0700
User-agent: Gnus/5.130014 (Ma Gnus v0.14) Emacs/25.1 (darwin)

>>>>> Drew Adams <address@hidden> writes:

> Trying to find out what you are really saying, and how it might apply to
> Emacs development. You have a strong belief that each function should do one
> thing and one thing well. It would be helpful, if that is to be a guideline
> or if we can learn from it, to flesh out what you mean by it.

> My guess is that what you prefer here is probably something I would prefer
> too, but I'm not sure. The devil, as well as interesting guidelines, are
> likely in the details.

I had expected (naively?) that everyone would want this, since the intent is
to make code easier to learn and to maintain. It's natural to assume that a
function called "string-append" just appends strings, for example. It would be
quite surprising if it had a special behavior when the arguments are both
numbers. I know that some languages applaud this sort of hidden behavior, but
I find it confusing.

But maybe you're right, and I should just wait until there are other, more
specific contexts for me to champion this idea.

The basic philosophy behind "do one thing, do it well" is that a function
named `plus' should just add numbers; and a function called `save-file' should
just save files. If a function were named "dwim-at-point", then it could do
whatever it thinks is appropriate at point.

Since we don't have types in Emacs Lisp to enforce function semantics, we rely
on naming and documentation to figure out what things mean. I find myself
surprised that a function advertising itself as acting on "marked-files",
under some circumstances acts on unmarked files...

I mean nothing beyond this, but this can wait until it becomes clearer over
time. Thank you for your patience, and your interest.

-- 
John Wiegley                  GPG fingerprint = 4710 CF98 AF9B 327B B80F
http://newartisans.com                          60E1 46C4 BD1A 7AC1 4BA2



reply via email to

[Prev in Thread] Current Thread [Next in Thread]