From: Alan Mackenzie <acm@muc.de>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: "Miles Bader" <miles@gnu.org>, Röhler <andreas.roehler@online.de>,
emacs-devel@gnu.org
Subject: Re: end-of-defun is fubsr.
Date: Fri, 13 Feb 2009 16:42:10 +0000 [thread overview]
Message-ID: <20090213164210.GC2975@muc.de> (raw)
In-Reply-To: <jwv3aei5s3u.fsf-monnier+emacs@gnu.org>
[N.B. There is no Andreas@muc.de]
Hi, Stefan,
On Fri, Feb 13, 2009 at 09:31:19AM -0500, Stefan Monnier wrote:
> > If point also begins somewhere in the inter-defun WS, after calling
> > BOD-function and EOD-function, it will land back at an arbitrary place
> > in the same WS, which may be before, at, or after the starting point.
> It's not arbitrary: it's carefully chosen by the implementor of
> [EB]OD-function.
An unknown number of implementors of EOD-functions will have chosen
carefully; well, maybe some of them weren't so careful, who knows? The
point is, they probably haven't all chosen the "same" place in that WS,
for whatever value of "same". Most of them will expect their
EOD-functions to work the same in Emacs 23 as Emacs n, n < 23.
> If you make your choices arbitrarily, you get what you ask for, of
> course ;-)
No. The whole point of Miles's bug report was that he DIDN'T get what
he asked for, neither did he get what c-end-of-defun asked for.
> I.e. "notabug" (or at least "wontfix") for what I can see.
> Did you notice any other problem?
Well, the ones I pointed out before:
(i) The meaning of end-of-defun-function has been radically changed, so
that uses and definitions of them pre- and post- Emacs-23 will no longer
be compatible with eachother.
The Emacs 23 handling of this variable isn't compatible with its
docstring in Emacs 22, which states that the EOD-function is used when
the "normal method" is not appropriate.
(ii) The symmetry between beginning/end-of-defun-function has been
broken, which will lead to confusion.
How about renaming `end-of-defun-function' to, say,
`forward-defun-function', thus precluding any possible confusion?
(iii) Infinite recursion will occur if an existing BOD-function with
-ve argument calls EOD-function. I don't know if this happens. If so,
I think it would have happend in Emacs 22 too.
(iv) The way things are done introduces the unnecessary restriction that
BODs and EODs alternate strictly in a source file. Although this is
virtually universally true, it might not be in a language which defined
EOD as a match for "^)", for example, as Elisp could well have done. It
might also constrain a major mode's handling of nested defuns, though I
haven't got the energy to think this through at the moment.
(v) Most of all, using BOD/EOD-function is so difficult to understand
that it's more work than just binding C-M-[aeh] in a major-mode map,
even if starting from scratch.
Additionally, not all the doc strings are optimal, but that doesn't seem
particularly urgent at the moment; for example, that for
end-of-defun-function says why a function is called, but not what it
should do, nor what its result means, nor where it should leave point.
> Stefan
--
Alan Mackenzie (Nuremberg, Germany).
next prev parent reply other threads:[~2009-02-13 16:42 UTC|newest]
Thread overview: 42+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-02-02 8:13 end-of-defun acts weirdly in c-mode; also, mark-defun in c-mode Miles Bader
2009-02-02 20:27 ` Alan Mackenzie
2009-02-02 22:46 ` Stefan Monnier
2009-02-03 9:17 ` Miles Bader
2009-02-03 10:50 ` Alan Mackenzie
2009-02-03 11:23 ` Miles Bader
2009-02-03 11:35 ` Miles Bader
2009-02-03 12:29 ` Alan Mackenzie
2009-02-03 13:00 ` Alan Mackenzie
2009-02-03 16:09 ` end-of-defun is fubsr. [Was: end-of-defun acts weirdly in c-mode] Alan Mackenzie
2009-02-03 15:56 ` Juanma Barranquero
2009-02-03 16:34 ` end-of-defun is fubsr Chong Yidong
2009-02-03 17:18 ` Andreas Roehler
2009-02-04 11:33 ` Alan Mackenzie
2009-02-04 14:54 ` Andreas Roehler
2009-02-03 16:40 ` end-of-defun is fubsr. [Was: end-of-defun acts weirdly in c-mode] Alan Mackenzie
2009-02-03 17:13 ` end-of-defun is fubsr Stefan Monnier
2009-02-03 18:58 ` Alan Mackenzie
2009-02-03 20:50 ` Stefan Monnier
2009-02-04 0:14 ` Alan Mackenzie
2009-02-04 2:21 ` Stefan Monnier
2009-02-04 13:37 ` Alan Mackenzie
2009-02-04 14:29 ` Stefan Monnier
2009-02-04 15:44 ` Alan Mackenzie
2009-02-05 10:37 ` Andreas Roehler
2009-02-12 21:35 ` Stefan Monnier
2009-02-13 11:08 ` Alan Mackenzie
2009-02-13 14:31 ` Stefan Monnier
2009-02-13 16:42 ` Alan Mackenzie [this message]
2009-02-13 17:06 ` Stefan Monnier
2009-02-13 18:57 ` Alan Mackenzie
2009-02-14 4:22 ` Stefan Monnier
2009-02-14 18:00 ` Alan Mackenzie
2009-02-14 21:16 ` Stefan Monnier
2009-02-14 23:25 ` Alan Mackenzie
2009-02-15 0:57 ` Miles Bader
2009-02-15 19:26 ` Stefan Monnier
2009-02-15 22:00 ` Alan Mackenzie
2009-02-05 11:44 ` Problems C Mode has with src/regex.c [was: end-of-defun is fubsr.] Alan Mackenzie
2009-02-05 21:50 ` end-of-defun acts weirdly in c-mode Alan Mackenzie
2009-02-06 1:03 ` Glenn Morris
2009-02-06 12:23 ` Alan Mackenzie
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=20090213164210.GC2975@muc.de \
--to=acm@muc.de \
--cc=andreas.roehler@online.de \
--cc=emacs-devel@gnu.org \
--cc=miles@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.