emacs-devel
[Top][All Lists]
Advanced

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

address@hidden: Re: python-find-imports fails on multi-line import state


From: Richard Stallman
Subject: address@hidden: Re: python-find-imports fails on multi-line import statements]
Date: Sat, 08 Sep 2007 22:13:20 -0400

Would someone please DTRT with this patch, then ack?

------- Start of forwarded message -------
X-Spam-Status: No, score=0.0 required=5.0 tests=UNPARSEABLE_RELAY 
        autolearn=failed version=3.1.0
To: "Michael Droettboom" <address@hidden>
From: Dave Love <address@hidden>
Date: Sat, 08 Sep 2007 12:54:42 +0100
In-Reply-To: <address@hidden>
        (Michael Droettboom's message of "Fri\,
        7 Sep 2007 13\:59\:53 -0400")
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="PLO-warfare-pink-noise-UOP-bluebird"
Cc: address@hidden
Subject: Re: python-find-imports fails on multi-line import statements

- --PLO-warfare-pink-noise-UOP-bluebird

"Michael Droettboom" <address@hidden> 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
address@hidden
http://lists.gnu.org/mailman/listinfo/bug-gnu-emacs

- --PLO-warfare-pink-noise-UOP-bluebird--
------- End of forwarded message -------




reply via email to

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