From unknown Fri Jun 20 07:17:12 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#8316 <8316@debbugs.gnu.org> To: bug#8316 <8316@debbugs.gnu.org> Subject: Status: 23.3; python-find-function is broken Reply-To: bug#8316 <8316@debbugs.gnu.org> Date: Fri, 20 Jun 2025 14:17:12 +0000 retitle 8316 23.3; python-find-function is broken reassign 8316 emacs submitter 8316 Christophe Kalt severity 8316 normal thanks From debbugs-submit-bounces@debbugs.gnu.org Mon Mar 21 22:01:17 2011 Received: (at submit) by debbugs.gnu.org; 22 Mar 2011 02:01:17 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Q1quL-00014Q-0P for submit@debbugs.gnu.org; Mon, 21 Mar 2011 22:01:17 -0400 Received: from eggs.gnu.org ([140.186.70.92]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Q1qTK-0000SM-Pq for submit@debbugs.gnu.org; Mon, 21 Mar 2011 21:33:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Q1qTE-0000yT-Ov for submit@debbugs.gnu.org; Mon, 21 Mar 2011 21:33:17 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW autolearn=unavailable version=3.3.1 Received: from lists.gnu.org ([199.232.76.165]:55116) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Q1qTE-0000yP-M7 for submit@debbugs.gnu.org; Mon, 21 Mar 2011 21:33:16 -0400 Received: from [140.186.70.92] (port=45669 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Q1qTD-00020Y-2y for bug-gnu-emacs@gnu.org; Mon, 21 Mar 2011 21:33:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Q1qTB-0000yB-SI for bug-gnu-emacs@gnu.org; Mon, 21 Mar 2011 21:33:14 -0400 Received: from mail-qy0-f169.google.com ([209.85.216.169]:55473) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Q1qTB-0000y1-Ph for bug-gnu-emacs@gnu.org; Mon, 21 Mar 2011 21:33:13 -0400 Received: by qyk2 with SMTP id 2so3116500qyk.0 for ; Mon, 21 Mar 2011 18:33:12 -0700 (PDT) Received: by 10.224.76.74 with SMTP id b10mr4001332qak.339.1300757592303; Mon, 21 Mar 2011 18:33:12 -0700 (PDT) MIME-Version: 1.0 Received: by 10.52.155.72 with HTTP; Mon, 21 Mar 2011 18:32:42 -0700 (PDT) From: Christophe Kalt Date: Mon, 21 Mar 2011 21:32:42 -0400 Message-ID: Subject: 23.3; python-find-function is broken To: bug-gnu-emacs@gnu.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 199.232.76.165 X-Spam-Score: -6.6 (------) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Mon, 21 Mar 2011 22:01:15 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 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.6 (------) python-find-function cannot work as the emacs.location_of function is missing from etc/emacs[23].py The following seems to work for Python 2.x def location_of (name, imports): =A0=A0=A0 """Get location at which NAME is defined (or nil). =A0=A0=A0 Provides a pair (PATH, LINE), where LINE is the start of the defi= nition =A0=A0=A0 in path name PATH. =A0=A0=A0 Exec IMPORTS first.""" =A0=A0=A0 locls =3D {} =A0=A0=A0 if imports: =A0=A0=A0=A0=A0=A0=A0 try: exec (imports, locls) =A0=A0=A0=A0=A0=A0=A0 except: pass =A0=A0=A0 try: =A0=A0=A0=A0=A0=A0=A0 obj =3D eval (name, globals (), locls) =A0=A0=A0=A0=A0=A0=A0 # Bug: (in Python 2.5) `getsourcefile' only works wit= h modules, =A0=A0=A0=A0=A0=A0=A0 # hence the `getmodule' here. =A0=A0=A0=A0=A0=A0=A0 srcfile =3D inspect.getsourcefile (inspect.getmodule = (obj)) =A0=A0=A0=A0=A0=A0=A0 _, line =3D inspect.getsourcelines (obj) =A0=A0=A0=A0=A0=A0=A0 print '_emacs_out ("%s" . %d)' % (srcfile.replace('\\= ', '/'), line) =A0=A0=A0 except: =A0=A0=A0=A0=A0=A0=A0 print "_emacs_out ()" Couple comments: - it isn't mine, was simply adapted from http://www.loveshack.ukfsn.org/emacs/emacs.py - .replace('\\', '/') seems necessary on Windows but feels like an ugly hac= k In GNU Emacs 23.3.1 (i386-mingw-nt6.1.7600) =A0of 2011-03-10 on 3249CTO Windowing system distributor `Microsoft Corp.', version 6.1.7600 configured using `configure --with-gcc (4.5) --no-opt --cflags -Ic:/imagesupport/include' From debbugs-submit-bounces@debbugs.gnu.org Mon Jun 18 19:38:37 2012 Received: (at 8316-done) by debbugs.gnu.org; 18 Jun 2012 23:38:37 +0000 Received: from localhost ([127.0.0.1]:47319 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SglWn-0001Cy-Cy for submit@debbugs.gnu.org; Mon, 18 Jun 2012 19:38:37 -0400 Received: from fencepost.gnu.org ([208.118.235.10]:54029) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SglWl-0001Cr-9H for 8316-done@debbugs.gnu.org; Mon, 18 Jun 2012 19:38:36 -0400 Received: from rgm by fencepost.gnu.org with local (Exim 4.71) (envelope-from ) id 1SglTY-0003UM-8Z; Mon, 18 Jun 2012 19:35:16 -0400 From: Glenn Morris To: 8316-done@debbugs.gnu.org Subject: Re: bug#8316: 23.3; python-find-function is broken References: X-Spook: Freeh Saudi Arabia NORAD ANC CBNRC UMTS Zachawi Watergate X-Ran: p1V+-Udz\X>~Dgk@uGiBGZ~Wan^`NvFvhipH&FXa/;?oE(~(?;}Je*nY;koGD!O,x~*z;/ X-Hue: red X-Attribution: GM Date: Mon, 18 Jun 2012 19:35:16 -0400 In-Reply-To: (Christophe Kalt's message of "Mon, 21 Mar 2011 21:32:42 -0400") Message-ID: User-Agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Spam-Score: -6.9 (------) X-Debbugs-Envelope-To: 8316-done 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.9 (------) Version: 24.2 Thanks for the report. The Emacs trunk has a new python.el, and it seems your problem is fixed there. This should appear in Emacs 24.2. python-find-function is replaced by python-nav-jump-to-defun. From unknown Fri Jun 20 07:17:12 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Tue, 17 Jul 2012 11: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