help-gnu-emacs
[Top][All Lists]
Advanced

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

RE: on adding a function call to a s-exp


From: Drew Adams
Subject: RE: on adding a function call to a s-exp
Date: Wed, 13 Jun 2018 07:39:17 -0700 (PDT)

> > FWIW (he ducks), I work with a Lispy language, Elisp ;-).  And I
> > don't use any "structured-editing" feature (crutch / ball-&-chain)
> > such as `paredit' or `electric-pair-mode'.  I'm non-electric all
> > the way.
> >
> > To me, having an editor automatically insert a closing delimiter
> > each time I type an opening delimiter is a bother, not an aid.
> 
> For the sake of improving electric-pair-mode, can you explain exactly
> when/under what conditions it is a bother?

A bother _to me_.  People are different.  People use Emacs
differently.

To me, it's a bother to care about the inserted closing
delimiters and where they might currently be - they just
get in my way.

I think that if you go the route of using such
delimiter-balancing "aids" you need to do it whole-hog.
The ability to have things automatically closed for you
_necessitates_ slurping, barfing, etc.

What you see as convenience, I see as workaround hacks,
needed only because you've turned on automatically closing
delimiters.

If things are pre-closed then, yes, of course you need
commands to pull stuff inside the closings and push stuff
outside the closings.  You want to add a list element?
OK, now you have to insert it before the proper closing
paren.

I don't want Emacs to assume where/when I want to close
a list, vector, string, etc.  I'll close it where/when
I want.

With Emacs it's _trivial_ to see which closing delimiter
corresponds to which opening delimiter.  If this were
not easy to see then, sure, maybe there would be a stronger
case for automatically inserting closing delimiters.

In Emacs it's almost impossible to accidentally leave
something unclosed or to close something in the wrong
place.  Automatic closing?  YAGNI.

> I'm asking because that's precisely what electric-pair-mode attempts: It
> *doesn't* insert a closing delimiter "each time", only when it guesses
> that it will not bother you.  If it is mis-guessing some situation I
> would very much like to know about it.

FWIW: DWIM too often really means _not_ "Do what I mean"
but "Do what some programmer thought would be cool to
guess I might mean."

I don't want Mr. Electric trying to second-guess where/when
I want to close something.  I don't need that kind of "help".

It's easier for me to know whether a paren is escaped or
inside a string or whatever than it is for some "smart"
code.  I know my intentions.  DWIM code can only guess
my intentions.  And when it guesses wrong I need to go
behind it an sweep up the droppings.

But as I say, everyone's different.  It's _good_, not bad,
that such electric-delimiter modes exist.  I don't argue
against them.  With Emacs, anyone can get what s?he wants.



reply via email to

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