From: Stefan Monnier <monnier@iro.umontreal.ca>
To: eric@siege-engine.com
Cc: emacs-devel@gnu.org, Andreas Roehler <andreas.roehler@online.de>,
XEmacs-Beta@xemacs.org
Subject: Re: simplifying beginning-of-defun
Date: Sun, 27 Sep 2009 18:52:25 -0400 [thread overview]
Message-ID: <jwvab0gau17.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <1254082041.6168.65.camel@projectile.siege-engine.com> (Eric M. Ludlam's message of "Sun, 27 Sep 2009 16:07:21 -0400")
>> We already have beginning-of-defun and beginning-of-defun-raw exactly
>> for these kinds of reasons.
> Ok. I didn't research before responding. ;)
> I just now grepped around, and no programs use beginning-of-defun-raw,
> but they do use beginning-of-defun, and some use
> MODE-beginning-of-defun.
Yes, this area is sufficiently messy (and different between versions
and flavors of Emacs) that only the main entry point is ever used.
> I think there are these variants:
> * A program wants the default behavior
> * A major mode wants to change the interactive form
> * A program wants use the major-mode behavior
> * A third tool (ie - cedet) wants to change the interactive forms
> without breaking the above three, and without modifying the global map
I can't think of a reason why #3 wouldn't want to be affected by #4.
Note that for #2, it's not just the interactive form, since it also
affects #3 (e.g. mark-defun, send-defun-to-inferior-process, younameit,
...).
> That is one solution, though I'm not sure about the
> beginning-of-defun-function setting, as the major mode may expect the
> function to be set as done in the major-mode.
Yes, it appears that some major-mode that set
beginning-of-defun-function also call beginning-of-defun, so there's
a chance that one of those calls actually is wrong and should call the
major-mode's code rather than going through beginning-of-defun-function.
It's OK: such bugs need to be fixed, it's not CEDET's responsibility if
the major mode breaks in this case.
>> I think that interactive/noninteractive is not the right distinction
>> (there are non-interactive cases which would also benefit from using an
>> improved implementation). It's probably the best (conservative)
>> solution you could use, because the right solution requires more changes
>> to other packages.
[...]
> I think of CEDET as being able to 'glitz' up functions like
> beginning-of-defun by making them accurate. Programs that actually want
> to use CEDET to get the more accurate behavior will not use
> 'beginning-of-defun' at all.
What about programs that want to use CEDET but that also want to work
when CEDET is not available? They would most likely want to use
beginning-of-defun.
Stefan
next prev parent reply other threads:[~2009-09-27 22:52 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-09-26 17:52 simplifying beginning-of-defun Andreas Roehler
2009-09-26 21:44 ` Stefan Monnier
2009-09-27 8:10 ` Andreas Roehler
2009-09-27 18:40 ` Stefan Monnier
2009-09-28 6:50 ` Andreas Roehler
2009-09-28 22:46 ` Stefan Monnier
2009-09-29 6:53 ` Andreas Roehler
2009-09-29 8:29 ` Andreas Roehler
2009-09-27 10:26 ` Andreas Roehler
2009-09-27 11:17 ` Eric M. Ludlam
2009-09-27 18:53 ` Stefan Monnier
2009-09-27 20:07 ` Eric M. Ludlam
2009-09-27 22:52 ` Stefan Monnier [this message]
2009-09-28 2:04 ` Eric M. Ludlam
2009-09-28 4:06 ` Stefan Monnier
2009-09-28 11:20 ` Eric M. Ludlam
2009-09-29 6:50 ` Alan Mackenzie
2009-09-27 19:06 ` Glenn Morris
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=jwvab0gau17.fsf-monnier+emacs@gnu.org \
--to=monnier@iro.umontreal.ca \
--cc=XEmacs-Beta@xemacs.org \
--cc=andreas.roehler@online.de \
--cc=emacs-devel@gnu.org \
--cc=eric@siege-engine.com \
/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).