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

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

bug#14352:


From: Fabián Ezequiel Gallina
Subject: bug#14352:
Date: Wed, 25 Dec 2013 17:07:30 -0300
User-agent: mu4e 0.9.9.6pre2; emacs 24.3.1

Unfortunately, this seems like intended behavior (and I do agree that I
don't like it either). I suggest you raise this to emacs-devel if you
really want to change default behavior.

Check the `mark-defun' definition at
emacs/trunk/lisp/emacs-lisp/lisp.el:427 and you'll see that it does have
an explicit call to `beginning-of-defun' for "languages with nested
functions... e.g. Python."

A similar approach seems to takes place in `narrow-to-defun' at
emacs/trunk/lisp/emacs-lisp/lisp.el:470 which causes this.

>From my side I've been narrowing defuns by calling `end-of-line' first
if I'm looking at it. You could rebind the `narrow-to-defun' command in
the `python-mode-map' to the following command:

    (defun python-narrow-to-defun (&optional _arg)
      "Make text outside current defun invisible.
    The defun visible is the one that contains point or follows
    point.  Optional ARG is ignored."
      (interactive)
      (save-excursion
        (end-of-line 1)
        (narrow-to-defun)))


Regards,
Fabián.





reply via email to

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