diff options
author | Karoly Lorentey <karoly@lorentey.hu> | 2007-04-22 11:42:03 +0000 |
---|---|---|
committer | Karoly Lorentey <karoly@lorentey.hu> | 2007-04-22 11:42:03 +0000 |
commit | 81088e260b086fe28f36964f32b6338210ec6fd8 (patch) | |
tree | 53d5af73ca0c971fe6925944d4d059caab5337a2 /lisp/progmodes/python.el | |
parent | fa1b1007cac59bafd16df7bd501ef2591dd77d62 (diff) | |
parent | a6f0e674ebf44b1d37732b64070b804673481d28 (diff) | |
download | emacs-81088e260b086fe28f36964f32b6338210ec6fd8.tar.gz |
Merged from emacs@sv.gnu.org
Patches applied:
* emacs@sv.gnu.org/emacs--devo--0--patch-650
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-651
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-652
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-653
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-654
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-655
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-656
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-657
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-658
Merge from gnus--rel--5.10
* emacs@sv.gnu.org/emacs--devo--0--patch-659
Update from CVS
* emacs@sv.gnu.org/gnus--rel--5.10--patch-203
Merge from emacs--devo--0
* emacs@sv.gnu.org/gnus--rel--5.10--patch-204
Update from CVS
* emacs@sv.gnu.org/gnus--rel--5.10--patch-205
Update from CVS
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-599
Diffstat (limited to 'lisp/progmodes/python.el')
-rw-r--r-- | lisp/progmodes/python.el | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el index f94a3d63653..38e846aa2cc 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el @@ -163,7 +163,7 @@ Used for syntactic keywords. N is the match number (1, 2 or 3)." (= (match-beginning 1) (match-end 1))) ; prefix is null (and (= n 1) ; prefix (/= (match-beginning 1) (match-end 1)))) ; non-empty - (unless (eq 'string (syntax-ppss-context (syntax-ppss))) + (unless (nth 3 (syntax-ppss)) (eval-when-compile (string-to-syntax "|")))) ;; Otherwise (we're in a non-matching string) the property is ;; nil, which is OK. @@ -1743,12 +1743,11 @@ Otherwise, do nothing." (orig (point)) (start (nth 8 syntax)) end) - (cond ((eq t (nth 3 syntax)) ; in fenced string - (goto-char (nth 8 syntax)) ; string start - (condition-case () ; for unbalanced quotes - (progn (forward-sexp) - (setq end (point))) - (error (setq end (point-max))))) + (cond ((eq t (nth 3 syntax)) ; in fenced string + (goto-char (nth 8 syntax)) ; string start + (setq end (condition-case () ; for unbalanced quotes + (progn (forward-sexp) (point)) + (error (point-max))))) ((re-search-backward "\\s|\\s-*\\=" nil t) ; end of fenced ; string (forward-char) @@ -1756,13 +1755,17 @@ Otherwise, do nothing." (condition-case () (progn (backward-sexp) (setq start (point))) - (error nil)))) + (error (setq end nil))))) (when end (save-restriction (narrow-to-region start end) (goto-char orig) - (fill-paragraph justify)))))) - t) + (let ((paragraph-separate + ;; Make sure that fenced-string delimiters that stand + ;; on their own line stay there. + (concat "[ \t]*['\"]+[ \t]*$\\|" paragraph-separate))) + (fill-paragraph justify)))))) + t)) (defun python-shift-left (start end &optional count) "Shift lines in region COUNT (the prefix arg) columns to the left. |