GNU bug report logs -
#24982
24.5; way to let Elisp reader ignore unreadable #(...) constructs
Previous Next
Reported by: Drew Adams <drew.adams <at> oracle.com>
Date: Mon, 21 Nov 2016 21:49:01 UTC
Severity: wishlist
Tags: wontfix
Found in version 24.5
Done: Lars Ingebrigtsen <larsi <at> gnus.org>
Bug is archived. No further changes may be made.
Full log
Message #35 received at 24982 <at> debbugs.gnu.org (full text, mbox):
Drew Adams <drew.adams <at> oracle.com> writes:
>> In Common Lisp, this is the #| ... |# operator, and it's handy
>> occasionally. It's really like a nesting comment thing...
>
> Good point. I was thinking of #(...), but yes,
> the situation is more general. It's about #
> syntax that's found to be invalid, but for cases
> where # nevertheless can tell where the sexp
> parsing should end (and so can advance point there).
Yup.
I couldn't quite remember whether the Common Lisp #| |# was balanced,
but it is, which is nice. That is, you can write
#| foo #| bar |# zot |#
and the first |# doesn't end the first #|.
Digression: While Googling, I was reminded that Common Lisp also has
#+condition
(foo:bar)
which (possibly) ignores the next sexp... which is handy in Common
Lisp, but Emacs doesn't need it. Common Lisp needs it because reference
to an unloaded package is a read error, instead of an undefined error.
Which is a really bad design choice. That is, you can't say
(if (fboundp 'foo:bar) ...) if foo is a package that isn't loaded --
it's a read error.
Digression over!
I'm not an expert on the Emacs Lisp reader, but poking at it at bit, it
seems like adding support for #| |# should be trivial: It's just a new
comment syntax, really, so we just have to count #|'s and discard the
input.
A bigger issue would be in emacs-lisp-mode -- having forward-sexp etc do
the right thing. However, surely that's handled already in the Common
Lisp modes, so we could just crib code from those, I'd have thought...
So I think it's doable, which only leaves us with the question: What's
the use case?
Well, I think it's handy when developing. If I'm in the middle of a
function
...
(foo)
(bar)
(and-here-i'm-adding-some-new-stuff-that's-not-finished
...
)
(zot)
...
and I'm testing stuff, and I decide to take out the stuff I'm
writing... Emacs doesn't really handle that well. I usually end up
deleting the sexp, and hoping that the kill ring is big enough to hold
it until I need it again, or slapping a (when nil ...) around it, which
is unsatisfactory, because that changes the indentation.
Just being able to do:
...
(foo)
(bar)
#|
(and-here-i'm-adding-some-new-stuff-that's-not-finished
...
)
|#
(zot)
...
would be nice. And then the stuff I'm working on doesn't even have to
be syntactically correct.
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
This bug report was last modified 3 years and 81 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.