aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/progmodes/python.el
diff options
context:
space:
mode:
authorFabián Ezequiel Gallina2012-10-08 19:18:05 -0300
committerFabián Ezequiel Gallina2012-10-08 19:18:05 -0300
commit24517d82a98eaeb33f44854e72bfbf342bf24ea4 (patch)
treea079cac4f3b4c6262bacf3d8227dd18930d16669 /lisp/progmodes/python.el
parenta9e7a9d5430ba48645cc475c101a26b6531acfd6 (diff)
downloademacs-24517d82a98eaeb33f44854e72bfbf342bf24ea4.tar.gz
emacs-24517d82a98eaeb33f44854e72bfbf342bf24ea4.zip
* progmodes/python.el (python-fill-paragraph): Rename from
python-fill-paragraph-function. Fixed fill-paragraph for decorators. Fixes: debbugs:12605
Diffstat (limited to 'lisp/progmodes/python.el')
-rw-r--r--lisp/progmodes/python.el23
1 files changed, 11 insertions, 12 deletions
diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el
index 018d6a7a1f2..0bde8ce3334 100644
--- a/lisp/progmodes/python.el
+++ b/lisp/progmodes/python.el
@@ -2272,28 +2272,28 @@ inferior python process is updated properly."
2272 2272
2273(defcustom python-fill-comment-function 'python-fill-comment 2273(defcustom python-fill-comment-function 'python-fill-comment
2274 "Function to fill comments. 2274 "Function to fill comments.
2275This is the function used by `python-fill-paragraph-function' to 2275This is the function used by `python-fill-paragraph' to
2276fill comments." 2276fill comments."
2277 :type 'symbol 2277 :type 'symbol
2278 :group 'python) 2278 :group 'python)
2279 2279
2280(defcustom python-fill-string-function 'python-fill-string 2280(defcustom python-fill-string-function 'python-fill-string
2281 "Function to fill strings. 2281 "Function to fill strings.
2282This is the function used by `python-fill-paragraph-function' to 2282This is the function used by `python-fill-paragraph' to
2283fill strings." 2283fill strings."
2284 :type 'symbol 2284 :type 'symbol
2285 :group 'python) 2285 :group 'python)
2286 2286
2287(defcustom python-fill-decorator-function 'python-fill-decorator 2287(defcustom python-fill-decorator-function 'python-fill-decorator
2288 "Function to fill decorators. 2288 "Function to fill decorators.
2289This is the function used by `python-fill-paragraph-function' to 2289This is the function used by `python-fill-paragraph' to
2290fill decorators." 2290fill decorators."
2291 :type 'symbol 2291 :type 'symbol
2292 :group 'python) 2292 :group 'python)
2293 2293
2294(defcustom python-fill-paren-function 'python-fill-paren 2294(defcustom python-fill-paren-function 'python-fill-paren
2295 "Function to fill parens. 2295 "Function to fill parens.
2296This is the function used by `python-fill-paragraph-function' to 2296This is the function used by `python-fill-paragraph' to
2297fill parens." 2297fill parens."
2298 :type 'symbol 2298 :type 'symbol
2299 :group 'python) 2299 :group 'python)
@@ -2370,7 +2370,7 @@ SYMMETRIC:
2370 :safe (lambda (val) 2370 :safe (lambda (val)
2371 (memq val '(django onetwo pep-257 pep-257-nn symmetric nil)))) 2371 (memq val '(django onetwo pep-257 pep-257-nn symmetric nil))))
2372 2372
2373(defun python-fill-paragraph-function (&optional justify) 2373(defun python-fill-paragraph (&optional justify)
2374 "`fill-paragraph-function' handling multi-line strings and possibly comments. 2374 "`fill-paragraph-function' handling multi-line strings and possibly comments.
2375If any of the current line is in or at the end of a multi-line string, 2375If any of the current line is in or at the end of a multi-line string,
2376fill the string or the paragraph of it that point is in, preserving 2376fill the string or the paragraph of it that point is in, preserving
@@ -2389,8 +2389,7 @@ Optional argument JUSTIFY defines if the paragraph should be justified."
2389 (funcall python-fill-string-function justify)) 2389 (funcall python-fill-string-function justify))
2390 ;; Decorators 2390 ;; Decorators
2391 ((equal (char-after (save-excursion 2391 ((equal (char-after (save-excursion
2392 (back-to-indentation) 2392 (python-nav-beginning-of-statement))) ?@)
2393 (point))) ?@)
2394 (funcall python-fill-decorator-function justify)) 2393 (funcall python-fill-decorator-function justify))
2395 ;; Parens 2394 ;; Parens
2396 ((or (python-syntax-context 'paren) 2395 ((or (python-syntax-context 'paren)
@@ -2402,12 +2401,12 @@ Optional argument JUSTIFY defines if the paragraph should be justified."
2402 (t t)))) 2401 (t t))))
2403 2402
2404(defun python-fill-comment (&optional justify) 2403(defun python-fill-comment (&optional justify)
2405 "Comment fill function for `python-fill-paragraph-function'. 2404 "Comment fill function for `python-fill-paragraph'.
2406JUSTIFY should be used (if applicable) as in `fill-paragraph'." 2405JUSTIFY should be used (if applicable) as in `fill-paragraph'."
2407 (fill-comment-paragraph justify)) 2406 (fill-comment-paragraph justify))
2408 2407
2409(defun python-fill-string (&optional justify) 2408(defun python-fill-string (&optional justify)
2410 "String fill function for `python-fill-paragraph-function'. 2409 "String fill function for `python-fill-paragraph'.
2411JUSTIFY should be used (if applicable) as in `fill-paragraph'." 2410JUSTIFY should be used (if applicable) as in `fill-paragraph'."
2412 (let* ((marker (point-marker)) 2411 (let* ((marker (point-marker))
2413 (str-start-pos 2412 (str-start-pos
@@ -2477,12 +2476,12 @@ JUSTIFY should be used (if applicable) as in `fill-paragraph'."
2477 (indent-according-to-mode))))) t) 2476 (indent-according-to-mode))))) t)
2478 2477
2479(defun python-fill-decorator (&optional justify) 2478(defun python-fill-decorator (&optional justify)
2480 "Decorator fill function for `python-fill-paragraph-function'. 2479 "Decorator fill function for `python-fill-paragraph'.
2481JUSTIFY should be used (if applicable) as in `fill-paragraph'." 2480JUSTIFY should be used (if applicable) as in `fill-paragraph'."
2482 t) 2481 t)
2483 2482
2484(defun python-fill-paren (&optional justify) 2483(defun python-fill-paren (&optional justify)
2485 "Paren fill function for `python-fill-paragraph-function'. 2484 "Paren fill function for `python-fill-paragraph'.
2486JUSTIFY should be used (if applicable) as in `fill-paragraph'." 2485JUSTIFY should be used (if applicable) as in `fill-paragraph'."
2487 (save-restriction 2486 (save-restriction
2488 (narrow-to-region (progn 2487 (narrow-to-region (progn
@@ -3133,7 +3132,7 @@ if that value is non-nil."
3133 3132
3134 (set (make-local-variable 'paragraph-start) "\\s-*$") 3133 (set (make-local-variable 'paragraph-start) "\\s-*$")
3135 (set (make-local-variable 'fill-paragraph-function) 3134 (set (make-local-variable 'fill-paragraph-function)
3136 'python-fill-paragraph-function) 3135 'python-fill-paragraph)
3137 3136
3138 (set (make-local-variable 'beginning-of-defun-function) 3137 (set (make-local-variable 'beginning-of-defun-function)
3139 #'python-beginning-of-defun-function) 3138 #'python-beginning-of-defun-function)