From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Dave Love Newsgroups: gmane.emacs.bugs Subject: Re: python-find-imports fails on multi-line import statements Date: Sat, 08 Sep 2007 12:54:42 +0100 Message-ID: References: <7b2578730709071059k1ed3a09dj26eaebc633d0b294@mail.gmail.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="PLO-warfare-pink-noise-UOP-bluebird" X-Trace: sea.gmane.org 1189256776 21420 80.91.229.12 (8 Sep 2007 13:06:16 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sat, 8 Sep 2007 13:06:16 +0000 (UTC) Cc: bug-gnu-emacs@gnu.org To: "Michael Droettboom" Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Sep 08 15:06:13 2007 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1IU00k-0005aT-MW for geb-bug-gnu-emacs@m.gmane.org; Sat, 08 Sep 2007 15:06:06 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IU00i-0006no-Hp for geb-bug-gnu-emacs@m.gmane.org; Sat, 08 Sep 2007 09:06:04 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1ITytj-0006fF-Dn for bug-gnu-emacs@gnu.org; Sat, 08 Sep 2007 07:54:47 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1ITytg-0006cH-Tl for bug-gnu-emacs@gnu.org; Sat, 08 Sep 2007 07:54:47 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1ITytg-0006cE-Oj for bug-gnu-emacs@gnu.org; Sat, 08 Sep 2007 07:54:44 -0400 Original-Received: from clarity.mcc.ac.uk ([130.88.200.144]) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1ITytg-0000Ec-C2 for bug-gnu-emacs@gnu.org; Sat, 08 Sep 2007 07:54:44 -0400 Original-Received: from rankine.its.manchester.ac.uk ([130.88.25.196]) by clarity.mcc.ac.uk with esmtps (TLSv1:AES256-SHA:256) (Exim 4.63 (FreeBSD)) (envelope-from ) id 1ITytf-0007uo-25; Sat, 08 Sep 2007 12:54:43 +0100 Original-Received: from marvin.smb.man.ac.uk ([130.88.234.141]:53879) by rankine.its.manchester.ac.uk with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.43) id 1ITyte-0000b3-UN; Sat, 08 Sep 2007 12:54:42 +0100 Original-Received: from fx by marvin.smb.man.ac.uk with local (Exim 4.63) (envelope-from ) id 1ITyte-0002DO-NP; Sat, 08 Sep 2007 12:54:42 +0100 X-Draft-From: ("nnml:Misc" 1853) In-Reply-To: <7b2578730709071059k1ed3a09dj26eaebc633d0b294@mail.gmail.com> (Michael Droettboom's message of "Fri\, 7 Sep 2007 13\:59\:53 -0400") User-Agent: Gnus/5.1008 (Gnus v5.10.8) X-Authenticated-Sender: David Love from marvin.smb.man.ac.uk [130.88.234.141]:53879 X-Authenticated-From: David.Love@manchester.ac.uk X-UoM: Scanned by the University Mail System. See http://www.itservices.manchester.ac.uk/email/filtering/information/ for details. X-Detected-Kernel: FreeBSD 6.x (1) X-Mailman-Approved-At: Sat, 08 Sep 2007 09:05:55 -0400 X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:16508 Archived-At: --PLO-warfare-pink-noise-UOP-bluebird "Michael Droettboom" writes: > I imagine this can be fixed by tinkering with the regular > expressions/filtering in python-find-imports, but I'm not much of an > emacs lisp hacker. Yes, I was sloppy. Thanks. It's fixed in http://www.loveshack.ukfsn.org/emacs/python-21.el. Perhaps this will apply to your version: --PLO-warfare-pink-noise-UOP-bluebird Content-Type: text/x-patch Content-Disposition: inline --- python-21.el 2007/08/30 22:22:45 1.47 +++ python-21.el 2007/09/08 11:44:55 1.48 @@ -1935,9 +1935,13 @@ (goto-char (point-min)) (while (re-search-forward "^import\\>\\|^from\\>" nil t) (unless (syntax-ppss-context (syntax-ppss)) - (push (buffer-substring (line-beginning-position) - (line-beginning-position 2)) - lines))) + (let ((start (line-beginning-position))) + ;; Skip over continued lines. + (while (and (eq ?\\ (char-before (line-end-position))) + (= 0 (forward-line 1))) + t) + (push (buffer-substring start (line-beginning-position 2)) + lines)))) (setq python-imports (if lines (apply #'concat --PLO-warfare-pink-noise-UOP-bluebird Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ bug-gnu-emacs mailing list bug-gnu-emacs@gnu.org http://lists.gnu.org/mailman/listinfo/bug-gnu-emacs --PLO-warfare-pink-noise-UOP-bluebird--