diff options
| author | Chong Yidong | 2007-04-21 20:04:06 +0000 |
|---|---|---|
| committer | Chong Yidong | 2007-04-21 20:04:06 +0000 |
| commit | 97f67490e47e94ac763e1869d8c8db6e6f3d85df (patch) | |
| tree | 9c83fa077ba462eedc3ffc8109301bf847e34e26 | |
| parent | 895041fa6c9b2940c761d83f658eab4452f0a64b (diff) | |
| download | emacs-97f67490e47e94ac763e1869d8c8db6e6f3d85df.tar.gz emacs-97f67490e47e94ac763e1869d8c8db6e6f3d85df.zip | |
(mantemp-make-mantemps-region)
(mantemp-insert-cxx-syntax, mantemp-sort-and-unique-lines)
(mantemp-remove-memfuncs): Use delete-region instead of kill-word
and kill-line.
| -rw-r--r-- | lisp/progmodes/mantemp.el | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/lisp/progmodes/mantemp.el b/lisp/progmodes/mantemp.el index 61b8d3d4d3d..2084f364d55 100644 --- a/lisp/progmodes/mantemp.el +++ b/lisp/progmodes/mantemp.el | |||
| @@ -105,14 +105,14 @@ | |||
| 105 | "^[A-z :&*<>~=,0-9+]*>::operator " nil t nil) | 105 | "^[A-z :&*<>~=,0-9+]*>::operator " nil t nil) |
| 106 | (progn | 106 | (progn |
| 107 | (backward-char 11) | 107 | (backward-char 11) |
| 108 | (kill-line))) | 108 | (delete-region (point) (line-end-position)))) |
| 109 | ;; Remove other member function extensions. | 109 | ;; Remove other member function extensions. |
| 110 | (goto-char (point-min)) | 110 | (goto-char (point-min)) |
| 111 | (message "Removing member function extensions") | 111 | (message "Removing member function extensions") |
| 112 | (while (re-search-forward "^[A-z :&*<>~=,0-9+]*>::" nil t nil) | 112 | (while (re-search-forward "^[A-z :&*<>~=,0-9+]*>::" nil t nil) |
| 113 | (progn | 113 | (progn |
| 114 | (backward-char 2) | 114 | (backward-char 2) |
| 115 | (kill-line))))) | 115 | (delete-region (point) (line-end-position)))))) |
| 116 | 116 | ||
| 117 | (defun mantemp-sort-and-unique-lines () | 117 | (defun mantemp-sort-and-unique-lines () |
| 118 | "Eliminate all consecutive duplicate lines in the buffer." | 118 | "Eliminate all consecutive duplicate lines in the buffer." |
| @@ -127,7 +127,7 @@ | |||
| 127 | (progn | 127 | (progn |
| 128 | (forward-line -1) | 128 | (forward-line -1) |
| 129 | (beginning-of-line) | 129 | (beginning-of-line) |
| 130 | (kill-line 1))))) | 130 | (delete-region (point) (progn (forward-line 1) (point))))))) |
| 131 | 131 | ||
| 132 | (defun mantemp-insert-cxx-syntax () | 132 | (defun mantemp-insert-cxx-syntax () |
| 133 | "Insert C++ syntax around each template class and function. | 133 | "Insert C++ syntax around each template class and function. |
| @@ -161,7 +161,7 @@ the lines." | |||
| 161 | (progn | 161 | (progn |
| 162 | (beginning-of-line) | 162 | (beginning-of-line) |
| 163 | (forward-word 1) | 163 | (forward-word 1) |
| 164 | (kill-word 1))))) | 164 | (delete-region (point) (progn (forward-word 1) (point))))))) |
| 165 | 165 | ||
| 166 | (defun mantemp-make-mantemps () | 166 | (defun mantemp-make-mantemps () |
| 167 | "Gathering interface to the functions modifying the buffer." | 167 | "Gathering interface to the functions modifying the buffer." |
| @@ -189,16 +189,16 @@ This function does the same thing as `mantemp-make-mantemps-buffer', | |||
| 189 | but operates on the region." | 189 | but operates on the region." |
| 190 | (interactive) | 190 | (interactive) |
| 191 | (let ((cur-buf (current-buffer)) | 191 | (let ((cur-buf (current-buffer)) |
| 192 | (mantemp-buffer (generate-new-buffer "*mantemp*"))) | 192 | (mantemp-buffer (generate-new-buffer "*mantemp*")) |
| 193 | (str (buffer-substring (mark) (point)))) | ||
| 193 | ;; Copy the region to a temporary buffer, make the C++ code there | 194 | ;; Copy the region to a temporary buffer, make the C++ code there |
| 194 | ;; and copy the result back to the current buffer. | 195 | ;; and copy the result back to the current buffer. |
| 195 | (kill-region (mark) (point)) | ||
| 196 | (set-buffer mantemp-buffer) | 196 | (set-buffer mantemp-buffer) |
| 197 | (yank) | 197 | (insert str) |
| 198 | (mantemp-make-mantemps) | 198 | (mantemp-make-mantemps) |
| 199 | (kill-region (point-min) (point-max)) | 199 | (setq str (buffer-string)) |
| 200 | (set-buffer cur-buf) | 200 | (set-buffer cur-buf) |
| 201 | (yank) | 201 | (insert str) |
| 202 | (kill-buffer mantemp-buffer)) | 202 | (kill-buffer mantemp-buffer)) |
| 203 | (message "Done")) | 203 | (message "Done")) |
| 204 | 204 | ||