From debbugs-submit-bounces@debbugs.gnu.org Sun May 05 13:44:29 2013 Received: (at submit) by debbugs.gnu.org; 5 May 2013 17:44:29 +0000 Received: from localhost ([127.0.0.1]:59027 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UZ2z7-00083h-1x for submit@debbugs.gnu.org; Sun, 05 May 2013 13:44:29 -0400 Received: from eggs.gnu.org ([208.118.235.92]:47966) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UZ2z4-00083V-6R for submit@debbugs.gnu.org; Sun, 05 May 2013 13:44:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UZ2yB-0004KI-LO for submit@debbugs.gnu.org; Sun, 05 May 2013 13:43:33 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-99.2 required=5.0 tests=BAYES_50,FREEMAIL_FROM, HTML_MESSAGE, T_DKIM_INVALID, USER_IN_WHITELIST autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([208.118.235.17]:58299) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UZ2yB-0004JE-BR for submit@debbugs.gnu.org; Sun, 05 May 2013 13:43:31 -0400 Received: from eggs.gnu.org ([208.118.235.92]:59302) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UZ2y9-000317-KH for bug-gnu-emacs@gnu.org; Sun, 05 May 2013 13:43:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UZ2y7-0004Ex-6Z for bug-gnu-emacs@gnu.org; Sun, 05 May 2013 13:43:29 -0400 Received: from mail-wi0-x232.google.com ([2a00:1450:400c:c05::232]:38392) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UZ2y6-0004Ee-TB for bug-gnu-emacs@gnu.org; Sun, 05 May 2013 13:43:27 -0400 Received: by mail-wi0-f178.google.com with SMTP id hm14so1919528wib.11 for ; Sun, 05 May 2013 10:43:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:mime-version:from:date:message-id:subject:to :content-type; bh=lwhMbA9BiPXbr7szoyN/T/hX1iOdAaEPUYZMwQ9ahbg=; b=dDkOZcAwq3AMDwrvwe032W2NAB3my7/3Tpg4gvjQfzUxlGlXeK5kbNHhgJvXZY6LF5 lVVcfKrPtwpJyY4j8Z3B/Fbfcw34FZfdfSzDFoy5Rqcj35lpmQQOVtQcRm34Pg3BApFw +jcaCNMY6mtiWsCzWVFuTBHkSwBRRm8cSZ/ykhsuC53cGpKQrMQYFuOJmlwqKDTJlF5/ w/XVu8lI7x3JryuFzDx55VgoFswBMt7g9mpHI/YUXJ0bnPT/A4uY6ASEQ0ap0gFo22W5 1AWvfZ6Cb0/5p04X3rNzNSCgVjs8dE6bT3bOpbtiKUfMjKFG6YHaf1iaTKDs41zg7F72 s1hQ== X-Received: by 10.180.188.198 with SMTP id gc6mr5349791wic.14.1367775805638; Sun, 05 May 2013 10:43:25 -0700 (PDT) MIME-Version: 1.0 Received: by 10.194.64.202 with HTTP; Sun, 5 May 2013 10:43:05 -0700 (PDT) From: Eric Hanchrow Date: Sun, 5 May 2013 10:43:05 -0700 Message-ID: Subject: 24.3; Python: narrow-to-defun narrows to class, not method To: bug-gnu-emacs@gnu.org Content-Type: multipart/alternative; boundary=001a11c389a407111904dbfc1f17 X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 208.118.235.17 X-Spam-Score: -6.1 (------) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.1 (------) --001a11c389a407111904dbfc1f17 Content-Type: text/plain; charset=UTF-8 This bug report will be sent to the Bug-GNU-Emacs mailing list and the GNU bug tracker at debbugs.gnu.org. Please check that the From: line contains a valid email address. After a delay of up to one day, you should receive an acknowledgment at that address. Please write in English if possible, as the Emacs maintainers usually do not have translators for other languages. Please describe exactly what actions triggered the bug, and the precise symptoms of the bug. If you can, give a recipe starting from `emacs -Q': Put the following python program into a file named /tmp/repro.py. It should have 9 lines and 120 characters. ==>8====>8====>8====>8====>8====>8====>8====>8====>8====>8====>8====>8== # Hello world class Frotz(object): def meth(self): foo = 'bar' def seth(self): znort='frotz' ==8<====8<====8<====8<====8<====8<====8<====8<====8<====8<====8<====8<== Start emacs with "emacs -Q". C-x C-f /tmp/repro.py RET M-x goto-line RET 5 RET C-x n d I see almost the entire file -- only the first two lines have been hidden by narrowing. I'd have expected to see only the two lines starting with "def meth". In GNU Emacs 24.3.1 (x86_64-apple-darwin, NS apple-appkit-1038.36) of 2013-03-12 on bob.porkrind.org Windowing system distributor `Apple', version 10.3.1187 Configured using: `configure '--host=x86_64-apple-darwin' '--build=i686-apple-darwin' '--with-ns' 'build_alias=i686-apple-darwin' 'host_alias=x86_64-apple-darwin' 'CC=gcc -mmacosx-version-min=10.7 -isystem /Users/david/Xcode-10.7_4.5.2/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk/usr/include/ -F/Users/david/Xcode-10.7_4.5.2/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk/System/Library/Frameworks'' Important settings: locale-coding-system: nil default enable-multibyte-characters: t Major mode: Python Minor modes in effect: tooltip-mode: t mouse-wheel-mode: t tool-bar-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t line-number-mode: t transient-mark-mode: t Recent input: C-x C-f / t m p / r e p C-u C-n C-u C-n C-n C-n C-n C-x n d M-x r e p o r t - e m Recent messages: For information about GNU Emacs and the GNU system, type C-h C-a. Load-path shadows: None found. Features: (shadow sort gnus-util mail-extr emacsbug message format-spec rfc822 mml mml-sec mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils python rx easymenu comint ring ansi-color time-date tooltip ediff-hook vc-hooks lisp-float-type mwheel ns-win tool-bar dnd fontset image regexp-opt fringe tabulated-list newcomment lisp-mode register page menu-bar rfn-eshadow timer select scroll-bar mouse jit-lock font-lock syntax facemenu font-core frame cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese case-table epa-hook jka-cmpr-hook help simple abbrev minibuffer loaddefs button faces cus-face macroexp files text-properties overlay sha1 md5 base64 format env code-pages mule custom widget hashtable-print-readable backquote make-network-process ns multi-tty emacs) --001a11c389a407111904dbfc1f17 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
This bug report will be sent to the Bug-GNU-Emacs mai= ling list
and the GNU bug tracker at debbugs.gnu.org. =C2=A0Please check that
the From:= line contains a valid email address. =C2=A0After a delay of up
to one day, you should receive an acknowledgment at that address.

Please write in English if possible, as the Emacs main= tainers
usually do not have translators for other languages.

Please describe exactly what actions triggered the bug,= and
the precise symptoms of the bug. =C2=A0If you can, give a re= cipe
starting from `emacs -Q':

Put t= he following python program into a file named /tmp/repro.py. =C2=A0It
should have 9 lines and 120 characters.

=3D= =3D>8=3D=3D=3D=3D>8=3D=3D=3D=3D>8=3D=3D=3D=3D>8=3D=3D=3D=3D>= 8=3D=3D=3D=3D>8=3D=3D=3D=3D>8=3D=3D=3D=3D>8=3D=3D=3D=3D>8=3D=3D= =3D=3D>8=3D=3D=3D=3D>8=3D=3D=3D=3D>8=3D=3D
# Hello world=

class Frotz(object):

=C2=A0 =C2=A0 def meth(s= elf):
=C2=A0 =C2=A0 =C2=A0 =C2=A0 foo =3D 'bar'

=C2=A0 =C2=A0 def seth(self):
=C2=A0 =C2=A0 =C2= =A0 =C2=A0 znort=3D'frotz'
=3D=3D8<=3D=3D=3D=3D8<= =3D=3D=3D=3D8<=3D=3D=3D=3D8<=3D=3D=3D=3D8<=3D=3D=3D=3D8<=3D=3D= =3D=3D8<=3D=3D=3D=3D8<=3D=3D=3D=3D8<=3D=3D=3D=3D8<=3D=3D=3D=3D8= <=3D=3D=3D=3D8<=3D=3D

Start emacs with "emacs -Q".

C-x C-f /tmp/repro.py RET

M-x goto-line R= ET 5 RET

C-x n d

I see al= most the entire file -- only the first two lines have been
hidden by narrowing. =C2=A0I'd have expected to see only the two l= ines
starting with "def meth".

In GNU Emacs 24.3.1 (x86_64-apple-darwin, NS apple-appkit-1038.36)
=C2=A0of 2013-03-12 on bob.porkrind.org=
Windowing system distributor `Apple', version 10.3.1187<= /div>
Configured using:
=C2=A0`configure '--host=3Dx86_64= -apple-darwin' '--build=3Di686-apple-darwin'
=C2=A0'--with-ns' 'build_alias=3Di686-apple-darwin'
=C2=A0'host_alias=3Dx86_64-apple-darwin' 'CC=3Dgcc -mma= cosx-version-min=3D10.7
=C2=A0-isystem
=C2=A0/Users/dav= id/Xcode-10.7_4.5.2/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/= Developer/SDKs/MacOSX10.7.sdk/usr/include/
=C2=A0-F/Users/david/Xcode-10.7_4.5.2/Xcode.app/Contents/Developer/Pla= tforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk/System/Library/Framewo= rks''

Important settings:
=C2=A0= locale-coding-system: nil
=C2=A0 default enable-multibyte-characters: t

Major mode: Python

Minor modes in effect:
=C2=A0 tooltip-mode: t
=C2=A0 mouse-wheel-mode: t
= =C2=A0 tool-bar-mode: t
=C2=A0 menu-bar-mode: t
=C2=A0 file-name-shadow-mode: t
=C2=A0 global-font-lock-mode: t
=C2=A0 font-lock-mode: t
=C2=A0 blink-cursor-mode: t
=C2=A0 auto-composition-mode:= t
=C2=A0 auto-encryption-mode: t
=C2=A0 auto-compression-mode: t
=C2=A0 line-number-mode: t
=C2=A0 transient-mark-mode: t

Recent inpu= t:
C-x C-f / t m p / r e p <tab> <return> C-u C-n C-u= =C2=A0
C-n C-n C-n C-n C-x n d M-x r e p o r t - e m <tab>=C2=A0
&= lt;return>

Recent messages:
For infor= mation about GNU Emacs and the GNU system, type C-h C-a.

Load-path shadows:
None found.

Feat= ures:
(shadow sort gnus-util mail-extr emacsbug message format-sp= ec rfc822 mml
mml-sec mm-decode mm-bodies mm-encode mail-parse rf= c2231 mailabbrev
gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums mm-util
=
mail-prsvr mail-utils python rx easymenu comint ring ansi-color
<= div>time-date tooltip ediff-hook vc-hooks lisp-float-type mwheel ns-win
tool-bar dnd fontset image regexp-opt fringe tabulated-list newcomment=
lisp-mode register page menu-bar rfn-eshadow timer select scroll= -bar
mouse jit-lock font-lock syntax facemenu font-core frame cha= m georgian
utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean
=
japanese hebrew greek romanian slovak czech european ethiopic indian
cyrillic chinese case-table epa-hook jka-cmpr-hook help simple abb= rev
minibuffer loaddefs button faces cus-face macroexp files text-properti= es
overlay sha1 md5 base64 format env code-pages mule custom widg= et
hashtable-print-readable backquote make-network-process ns mul= ti-tty
emacs)
--001a11c389a407111904dbfc1f17-- From debbugs-submit-bounces@debbugs.gnu.org Wed Dec 25 15:08:04 2013 Received: (at 14352-done) by debbugs.gnu.org; 25 Dec 2013 20:08:04 +0000 Received: from localhost ([127.0.0.1]:41864 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VvukN-0003kN-Qn for submit@debbugs.gnu.org; Wed, 25 Dec 2013 15:08:04 -0500 Received: from fencepost.gnu.org ([208.118.235.10]:52412) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VvukM-0003jr-01 for 14352-done@debbugs.gnu.org; Wed, 25 Dec 2013 15:08:02 -0500 Received: from [181.164.60.202] (port=54298 helo=localhost) by fencepost.gnu.org with esmtpsa (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1VvukK-0005Bi-7x for 14352-done@debbugs.gnu.org; Wed, 25 Dec 2013 15:08:00 -0500 User-agent: mu4e 0.9.9.6pre2; emacs 24.3.1 From: fgallina@gnu.org (=?utf-8?Q?Fabi=C3=A1n?= Ezequiel Gallina) To: 14352-done@debbugs.gnu.org Subject: Date: Wed, 25 Dec 2013 17:07:30 -0300 Message-ID: <874n5w4rul.fsf@tata.lan> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -3.6 (---) X-Debbugs-Envelope-To: 14352-done X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.6 (---) 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. From unknown Fri Sep 12 04:34:04 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Thu, 23 Jan 2014 12:24:04 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator