From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Andreas =?UTF-8?Q?R=C3=B6hler?= Newsgroups: gmane.emacs.bugs Subject: bug#8141: 23.2.94; python-fill-paragraph Date: Mon, 28 Feb 2011 21:56:16 +0100 Message-ID: <4D6C0BF0.3050001@easy-emacs.de> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------080504060007070502070409" X-Trace: dough.gmane.org 1298927227 3638 80.91.229.12 (28 Feb 2011 21:07:07 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 28 Feb 2011 21:07:07 +0000 (UTC) To: 8141@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Feb 28 22:07:03 2011 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.69) (envelope-from ) id 1PuAJ4-00023s-De for geb-bug-gnu-emacs@m.gmane.org; Mon, 28 Feb 2011 22:07:02 +0100 Original-Received: from localhost ([127.0.0.1]:36359 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PuAJ3-0004bv-Jr for geb-bug-gnu-emacs@m.gmane.org; Mon, 28 Feb 2011 16:07:01 -0500 Original-Received: from [140.186.70.92] (port=42389 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PuAIs-0004Ye-7H for bug-gnu-emacs@gnu.org; Mon, 28 Feb 2011 16:06:51 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PuAIq-0001eV-DB for bug-gnu-emacs@gnu.org; Mon, 28 Feb 2011 16:06:50 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:44545) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PuAIq-0001eN-B7 for bug-gnu-emacs@gnu.org; Mon, 28 Feb 2011 16:06:48 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1PuA5W-00053T-BF; Mon, 28 Feb 2011 15:53:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Andreas =?UTF-8?Q?R=C3=B6hler?= Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 28 Feb 2011 20:53:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 8141 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.129892635119392 (code B ref -1); Mon, 28 Feb 2011 20:53:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 28 Feb 2011 20:52:31 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PuA50-00052j-PC for submit@debbugs.gnu.org; Mon, 28 Feb 2011 15:52:30 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PuA4y-00052W-JY for submit@debbugs.gnu.org; Mon, 28 Feb 2011 15:52:29 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PuA4s-0007CZ-7C for submit@debbugs.gnu.org; Mon, 28 Feb 2011 15:52:23 -0500 Original-Received: from lists.gnu.org ([199.232.76.165]:44419) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PuA4q-0007Bu-Tf for submit@debbugs.gnu.org; Mon, 28 Feb 2011 15:52:22 -0500 Original-Received: from [140.186.70.92] (port=47816 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PuA4j-0006Ks-T9 for bug-gnu-emacs@gnu.org; Mon, 28 Feb 2011 15:52:19 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PuA4h-00079v-0n for bug-gnu-emacs@gnu.org; Mon, 28 Feb 2011 15:52:12 -0500 Original-Received: from moutng.kundenserver.de ([212.227.126.187]:53372) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PuA4g-000797-GO for bug-gnu-emacs@gnu.org; Mon, 28 Feb 2011 15:52:10 -0500 Original-Received: from [192.168.178.29] (brln-d9ba3489.pool.mediaWays.net [217.186.52.137]) by mrelayeu.kundenserver.de (node=mreu2) with ESMTP (Nemesis) id 0MM2cS-1PvH462R36-008Efz; Mon, 28 Feb 2011 21:52:07 +0100 User-Agent: Mozilla/5.0 (X11; U; Linux i686; de; rv:1.9.1.11) Gecko/20100711 Thunderbird/3.0.6 X-Provags-ID: V02:K0:GvFcj4Rc+b7FO3KTqRGiULfe0UUJSGEWHEP1sTEW/g9 JOM8H7FkcuX0GsABNRfMoeJLG8DO4i1JQPQ5ACG+N0bAxuK5WU wIXN0NacOVc6ScZRUk7oD5CN8LqI1fwhgnNk2jwmz+26lXh7x2 rHJMlyVg26QxZysgCH7LYry7p+oTSisBxN3P/opbHUFt/CLVt1 ++svXutwAwXxtNCr/vqFr1qR5LL8oKn1jG1e9lCqMo= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Mon, 28 Feb 2011 15:53:02 -0500 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org 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:44451 Archived-At: This is a multi-part message in MIME format. --------------080504060007070502070409 Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit Hi, attached a test file, revealing a bug in python-fill-paragraph already reported at lp, which pertains to python.el and python-mode.el likewise. Patch attached. Andreas -- https://code.launchpad.net/~a-roehler/python-mode/python-mode-components https://code.launchpad.net/s-x-emacs-werkstatt/ --------------080504060007070502070409 Content-Type: text/x-emacs-lisp; name="fill-paragraph-problems-lp710373-test.el" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="fill-paragraph-problems-lp710373-test.el" (defun py-fill-paragraph-problems-lp:710373-test (&optional arg load-branch-function) (interactive "p") (when load-branch-function (funcall load-branch-function)) (py-fill-paragraph-problems-lp:710373-test-intern arg)) (defun py-fill-paragraph-problems-lp:710373-test-intern (&optional arg) "If no `load-branch-function' is specified, make sure the appropriate branch is loaded. Otherwise default python-mode will be checked. " (let ((tmp-dir "/tmp/") (fpp-exec-buffer "fill-paragraph-problems-lp:710373") (diff-buffer "fpp-lp:710373-old") (fpp-teststring " \"\"\" triple-quoted string containing \"quotation\" marks. triple-quoted string containing \"quotation\" marks. triple-quoted string containing \"quotation\" marks. triple-quoted string containing \"quotation\" marks. triple-quoted string containing \"quotation\" marks. \"\"\" ") erg) (set-buffer (get-buffer-create diff-buffer)) (erase-buffer) (insert fpp-teststring) (write-file (concat tmp-dir diff-buffer)) (if arg (progn (set-buffer (get-buffer-create fpp-exec-buffer)) (when arg (switch-to-buffer (current-buffer))) (erase-buffer) (py-fill-paragraph-problems-lp:710373-test-base)) (with-temp-buffer (py-fill-paragraph-problems-lp:710373-test-base))))) (defun py-fill-paragraph-problems-lp:710373-test-base () (python-mode) (insert fpp-teststring) (set-buffer fpp-exec-buffer) (font-lock-mode 1) (font-lock-fontify-buffer) (goto-char (point-min)) (forward-line 3) (message "I'm here: %s" (point)) (set-buffer-modified-p nil) ;; (describe-function 'py-fill-paragraph) (setq fill-column 55) (if (functionp 'py-fill-paragraph) (py-fill-paragraph) (python-fill-paragraph)) (write-file (concat tmp-dir fpp-exec-buffer)) (setq erg (diff (concat tmp-dir fpp-exec-buffer) (concat tmp-dir diff-buffer) "-u")) (if (featurep 'xemacs) (progn (set-buffer "*Diff Output*") (switch-to-buffer (current-buffer))) (set-buffer erg) (sit-for 1) (assert (numberp (progn (goto-char (point-min))(search-forward "no differences" nil t 1))) t) (message "%s" "py-fill-paragraph-problems-lp:710373 passed"))) --------------080504060007070502070409 Content-Type: text/x-patch; name="python.el.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="python.el.diff" --- python.el 2011/02/28 20:22:31 1.1 +++ python.el 2011/02/28 20:24:23 @@ -2022,7 +2022,9 @@ ;; current line. ((eq t (nth 3 syntax)) ; in fenced string (goto-char (nth 8 syntax)) ; string start - (setq start (line-beginning-position)) + (if (looking-at "\\(?:'''\\|\"\"\"\\|'\\|\"\\)\\\\?\n?") + (setq start (match-end 0)) + (setq start (line-beginning-position))) (setq end (condition-case () ; for unbalanced quotes (progn (forward-sexp) (- (point) 3)) --------------080504060007070502070409--