diff options
| author | Stefan Monnier | 2004-02-02 15:22:39 +0000 |
|---|---|---|
| committer | Stefan Monnier | 2004-02-02 15:22:39 +0000 |
| commit | 82eb0daee6b1b56bd1e415550cf6f9d06698e058 (patch) | |
| tree | c512e031e82de8df7fc1500e50aeba67ee3a2f89 | |
| parent | d83a97ab5fbcde063e4a87042cd721a23f13fbe0 (diff) | |
| download | emacs-82eb0daee6b1b56bd1e415550cf6f9d06698e058.tar.gz emacs-82eb0daee6b1b56bd1e415550cf6f9d06698e058.zip | |
(cperl-mode-map, cperl-do-auto-fill, cperl-menu): Use fill-paragraph,
not cperl-fill-paragraph.
(cperl-mode): Set fill-paragraph-function.
(cperl-fill-paragraph): Make it non-interactive.
| -rw-r--r-- | lisp/progmodes/cperl-mode.el | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/lisp/progmodes/cperl-mode.el b/lisp/progmodes/cperl-mode.el index e847ef4e44e..7202a083d79 100644 --- a/lisp/progmodes/cperl-mode.el +++ b/lisp/progmodes/cperl-mode.el | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | ;;; cperl-mode.el --- Perl code editing commands for Emacs | 1 | ;;; cperl-mode.el --- Perl code editing commands for Emacs |
| 2 | 2 | ||
| 3 | ;; Copyright (C) 1985, 86, 87, 91, 92, 93, 94, 95, 96, 97, 98, 99, 2000, 2003 | 3 | ;; Copyright (C) 1985,86,87,91,92,93,94,95,96,97,98,99,2000,03,2004 |
| 4 | ;; Free Software Foundation, Inc. | 4 | ;; Free Software Foundation, Inc. |
| 5 | 5 | ||
| 6 | ;; Author: Ilya Zakharevich and Bob Olson | 6 | ;; Author: Ilya Zakharevich and Bob Olson |
| @@ -1064,9 +1064,6 @@ the faces: please specify bold, italic, underline, shadow and box.) | |||
| 1064 | 'indent-sexp 'cperl-indent-exp | 1064 | 'indent-sexp 'cperl-indent-exp |
| 1065 | cperl-mode-map global-map) | 1065 | cperl-mode-map global-map) |
| 1066 | (substitute-key-definition | 1066 | (substitute-key-definition |
| 1067 | 'fill-paragraph 'cperl-fill-paragraph | ||
| 1068 | cperl-mode-map global-map) | ||
| 1069 | (substitute-key-definition | ||
| 1070 | 'indent-region 'cperl-indent-region | 1067 | 'indent-region 'cperl-indent-region |
| 1071 | cperl-mode-map global-map) | 1068 | cperl-mode-map global-map) |
| 1072 | (substitute-key-definition | 1069 | (substitute-key-definition |
| @@ -1086,7 +1083,7 @@ the faces: please specify bold, italic, underline, shadow and box.) | |||
| 1086 | ["End of function" end-of-defun t] | 1083 | ["End of function" end-of-defun t] |
| 1087 | ["Mark function" mark-defun t] | 1084 | ["Mark function" mark-defun t] |
| 1088 | ["Indent expression" cperl-indent-exp t] | 1085 | ["Indent expression" cperl-indent-exp t] |
| 1089 | ["Fill paragraph/comment" cperl-fill-paragraph t] | 1086 | ["Fill paragraph/comment" fill-paragraph t] |
| 1090 | "----" | 1087 | "----" |
| 1091 | ["Line up a construction" cperl-lineup (cperl-use-region-p)] | 1088 | ["Line up a construction" cperl-lineup (cperl-use-region-p)] |
| 1092 | ["Invert if/unless/while etc" cperl-invert-if-unless t] | 1089 | ["Invert if/unless/while etc" cperl-invert-if-unless t] |
| @@ -1464,6 +1461,7 @@ or as help on variables `cperl-tips', `cperl-problems', | |||
| 1464 | (setq paragraph-separate paragraph-start) | 1461 | (setq paragraph-separate paragraph-start) |
| 1465 | (make-local-variable 'paragraph-ignore-fill-prefix) | 1462 | (make-local-variable 'paragraph-ignore-fill-prefix) |
| 1466 | (setq paragraph-ignore-fill-prefix t) | 1463 | (setq paragraph-ignore-fill-prefix t) |
| 1464 | (set (make-local-variable 'fill-paragraph-function) 'cperl-fill-paragraph) | ||
| 1467 | (make-local-variable 'indent-line-function) | 1465 | (make-local-variable 'indent-line-function) |
| 1468 | (setq indent-line-function 'cperl-indent-line) | 1466 | (setq indent-line-function 'cperl-indent-line) |
| 1469 | (make-local-variable 'require-final-newline) | 1467 | (make-local-variable 'require-final-newline) |
| @@ -4255,11 +4253,11 @@ conditional/loop constructs." | |||
| 4255 | ;; Stolen from lisp-mode with a lot of improvements | 4253 | ;; Stolen from lisp-mode with a lot of improvements |
| 4256 | 4254 | ||
| 4257 | (defun cperl-fill-paragraph (&optional justify iteration) | 4255 | (defun cperl-fill-paragraph (&optional justify iteration) |
| 4258 | "Like \\[fill-paragraph], but handle CPerl comments. | 4256 | "Like `fill-paragraph', but handle CPerl comments. |
| 4259 | If any of the current line is a comment, fill the comment or the | 4257 | If any of the current line is a comment, fill the comment or the |
| 4260 | block of it that point is in, preserving the comment's initial | 4258 | block of it that point is in, preserving the comment's initial |
| 4261 | indentation and initial hashes. Behaves usually outside of comment." | 4259 | indentation and initial hashes. Behaves usually outside of comment." |
| 4262 | (interactive "P") | 4260 | ;; (interactive "P") ; Only works when called from fill-paragraph. -stef |
| 4263 | (let (;; Non-nil if the current line contains a comment. | 4261 | (let (;; Non-nil if the current line contains a comment. |
| 4264 | has-comment | 4262 | has-comment |
| 4265 | 4263 | ||
| @@ -4346,9 +4344,11 @@ indentation and initial hashes. Behaves usually outside of comment." | |||
| 4346 | (let ((c (save-excursion (beginning-of-line) | 4344 | (let ((c (save-excursion (beginning-of-line) |
| 4347 | (cperl-to-comment-or-eol) (point))) | 4345 | (cperl-to-comment-or-eol) (point))) |
| 4348 | (s (memq (following-char) '(?\ ?\t))) marker) | 4346 | (s (memq (following-char) '(?\ ?\t))) marker) |
| 4349 | (if (>= c (point)) nil | 4347 | (if (>= c (point)) |
| 4348 | ;; Don't break line inside code: only inside comment. | ||
| 4349 | nil | ||
| 4350 | (setq marker (point-marker)) | 4350 | (setq marker (point-marker)) |
| 4351 | (cperl-fill-paragraph) | 4351 | (fill-paragraph nil) |
| 4352 | (goto-char marker) | 4352 | (goto-char marker) |
| 4353 | ;; Is not enough, sometimes marker is a start of line | 4353 | ;; Is not enough, sometimes marker is a start of line |
| 4354 | (if (bolp) (progn (re-search-forward "#+[ \t]*") | 4354 | (if (bolp) (progn (re-search-forward "#+[ \t]*") |