all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* [patch] python.el (python-open-block-statement-p)
@ 2004-06-11 14:52 Karl Chen
  0 siblings, 0 replies; only message in thread
From: Karl Chen @ 2004-06-11 14:52 UTC (permalink / raw)



There's a bug in `python-open-block-statement-p' that causes
indentation after a block opening containing a comment to fail,
e.g.:

if foo:  # comment
<-- doesn't indent correctly here


Patch below fixes it.


Index: python.el
===================================================================
--- python.el	(revision 6501)
+++ python.el	(working copy)
@@ -323,7 +323,8 @@
 				     line-end))
 			    (save-excursion (python-end-of-statement))
 			    t)
-	 (not (python-in-string/comment)))))
+         (not (progn (goto-char (match-beginning 0))
+                     (python-in-string/comment))))))
 
 (defun python-close-block-statement-p (&optional bos)
   "Return non-nil if current line is a statement closing a block.


-- 
Karl 2004-06-11 16:48

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2004-06-11 14:52 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-06-11 14:52 [patch] python.el (python-open-block-statement-p) Karl Chen

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.