(python-quote-syntax): Don't bother with syntax-ppss-context.
(python-fill-paragraph): Make sure that fenced-string delimiters that stand on their own line stay there
This commit is contained in:
parent
404a2a4b52
commit
fc553234b5
2 changed files with 20 additions and 10 deletions
|
@ -1,3 +1,10 @@
|
||||||
|
2007-03-01 Stefan Monnier <monnier@iro.umontreal.ca>
|
||||||
|
|
||||||
|
* progmodes/python.el (python-quote-syntax): Don't bother with
|
||||||
|
syntax-ppss-context.
|
||||||
|
(python-fill-paragraph): Make sure that fenced-string delimiters that
|
||||||
|
stand on their own line stay there
|
||||||
|
|
||||||
2007-03-01 Lennart Borgman <lennart.borgman.073@student.lu.se>
|
2007-03-01 Lennart Borgman <lennart.borgman.073@student.lu.se>
|
||||||
|
|
||||||
* replace.el (perform-replace): Propertize message.
|
* replace.el (perform-replace): Propertize message.
|
||||||
|
|
|
@ -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
|
(= (match-beginning 1) (match-end 1))) ; prefix is null
|
||||||
(and (= n 1) ; prefix
|
(and (= n 1) ; prefix
|
||||||
(/= (match-beginning 1) (match-end 1)))) ; non-empty
|
(/= (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 "|"))))
|
(eval-when-compile (string-to-syntax "|"))))
|
||||||
;; Otherwise (we're in a non-matching string) the property is
|
;; Otherwise (we're in a non-matching string) the property is
|
||||||
;; nil, which is OK.
|
;; nil, which is OK.
|
||||||
|
@ -1743,12 +1743,11 @@ Otherwise, do nothing."
|
||||||
(orig (point))
|
(orig (point))
|
||||||
(start (nth 8 syntax))
|
(start (nth 8 syntax))
|
||||||
end)
|
end)
|
||||||
(cond ((eq t (nth 3 syntax)) ; in fenced string
|
(cond ((eq t (nth 3 syntax)) ; in fenced string
|
||||||
(goto-char (nth 8 syntax)) ; string start
|
(goto-char (nth 8 syntax)) ; string start
|
||||||
(condition-case () ; for unbalanced quotes
|
(setq end (condition-case () ; for unbalanced quotes
|
||||||
(progn (forward-sexp)
|
(progn (forward-sexp) (point))
|
||||||
(setq end (point)))
|
(error (point-max)))))
|
||||||
(error (setq end (point-max)))))
|
|
||||||
((re-search-backward "\\s|\\s-*\\=" nil t) ; end of fenced
|
((re-search-backward "\\s|\\s-*\\=" nil t) ; end of fenced
|
||||||
; string
|
; string
|
||||||
(forward-char)
|
(forward-char)
|
||||||
|
@ -1756,13 +1755,17 @@ Otherwise, do nothing."
|
||||||
(condition-case ()
|
(condition-case ()
|
||||||
(progn (backward-sexp)
|
(progn (backward-sexp)
|
||||||
(setq start (point)))
|
(setq start (point)))
|
||||||
(error nil))))
|
(error (setq end nil)))))
|
||||||
(when end
|
(when end
|
||||||
(save-restriction
|
(save-restriction
|
||||||
(narrow-to-region start end)
|
(narrow-to-region start end)
|
||||||
(goto-char orig)
|
(goto-char orig)
|
||||||
(fill-paragraph justify))))))
|
(let ((paragraph-separate
|
||||||
t)
|
;; 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)
|
(defun python-shift-left (start end &optional count)
|
||||||
"Shift lines in region COUNT (the prefix arg) columns to the left.
|
"Shift lines in region COUNT (the prefix arg) columns to the left.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue