all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Andreas Roehler <andreas.roehler@online.de>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: emacs-devel@gnu.org, "Eric M. Ludlam" <eric@siege-engine.com>,
	XEmacs-Beta@xemacs.org
Subject: Re: simplifying beginning-of-defun
Date: Mon, 28 Sep 2009 08:50:02 +0200	[thread overview]
Message-ID: <4AC05C9A.2010802@online.de> (raw)
In-Reply-To: <jwv4oqockch.fsf-monnier+emacs@gnu.org>

Stefan Monnier wrote:
>>>> simplifying forms as below should ease maintenance and speed up execution.
>>> To what extent does it preserve compatibility?
>> Don't see anything incompatible for the moment.
> 
> I actually mentionned obvious incompatibilities in the email to which
> you reply.
> 
>> With `beginning-of-defun-function',
>> `end-of-defun-function' python-mode for example
>> https://launchpad.net/python-mode
>> may set its own function and M-x beginning-of-defun then
>> will work still - which is not the case presently and my point of
>> depart here.
> 
> I do not understand the above paragraph.
> 
>>> Apparently it makes beginning-of-defun-raw ignore
>>> beginning-of-defun-function, and it calls end-of-defun-function with one
>>> argument contrary to the current situation where it's called without
>>> any argument.
>> An argument is useful here: as a repeat or specifier.
> 
> I was pointing out incompatibilities. 


Can't see any. If you write

>>> Apparently it makes beginning-of-defun-raw ignore
>>> beginning-of-defun-function,

it should do exactly that IMHO. Beginning-of-defun-function
was already called  by beginning-of-defun in my scheme - if necessary.


 Also the current way
> end-of-defun-function is defined, it does not need a repeat because it
> only jumps from the beginning of a defun to its end (i.e. it doesn't do
> the same as end-of-defun).
> 


Why not let modes say what they want and need? An argument must not mean a
repeat BTW. In python-mode is a selection to deliver too.



>>> Which performance problem is it trying to solve?
>> All which useless code execution causes.
>> Regard the lines of code saved that way to have an approximation.
> 
> This is much too general: OT1H it's not true (larger code is not
> necessarily slower), OTOH (and more importantly) it doesn't help me
> understand which specific performance problem this is aiming to address.
> 
>> open-paren-in-column-0-is-defun-start is purely redundant, as the
>> regexp may specify that - and indeed does already(?) its just that
>> what I read with "^\\s("
> 
> Again, please move this discussion to a separate thread.
> 
>> Mentioned code of a end-of-defun-function in lisp.el is a bug.
>> Suggest to cancel it.
> 
> I do not know which code nor which bug you talking about.  Your code?
> Emacs's code?

from GNU lisp.el.

"(defvar end-of-defun-function
  (lambda () ...."

Giving it a value here, it will be called. Which is
to avoid, as only languages-modes should set and use it.

This setting reintroduces all the mess, beginning/end-of-defun-function are invented for.



> 
>> Let the -raw functions do everything needed for emacs-lisp.
> 
> AFAICT, that's already the way it's designed (that's why it doesn't set
> the mark, for example).
> 
>> Funcalls of beginning-of-defun-function, end-of-defun-function should
>> be reserved for progmodes.
> 
> I have no idea what you mean by "progmodes".

Modes of other programming languages than emacs-lisp

> 
>> BTW if mode-specific, probably it should be introduced as a local var
>> from the very beginning?
> 
> I'm not sure I understand.  Are you suggesting we
> (make-varible-buffer-local 'beginning-of-defun-function)?
> 

Yes, that's the question. I.e it should be mode-specific, in any case not global.

Andreas
> 
>         Stefan
> 
> 
> 





  reply	other threads:[~2009-09-28  6:50 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 [this message]
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
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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4AC05C9A.2010802@online.de \
    --to=andreas.roehler@online.de \
    --cc=XEmacs-Beta@xemacs.org \
    --cc=emacs-devel@gnu.org \
    --cc=eric@siege-engine.com \
    --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.