emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/lisp/progmodes/mantemp.el,v


From: Chong Yidong
Subject: [Emacs-diffs] Changes to emacs/lisp/progmodes/mantemp.el,v
Date: Sat, 21 Apr 2007 20:04:06 +0000

CVSROOT:        /sources/emacs
Module name:    emacs
Changes by:     Chong Yidong <cyd>      07/04/21 20:04:06

Index: mantemp.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/progmodes/mantemp.el,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -b -r1.8 -r1.9
--- mantemp.el  21 Jan 2007 03:20:44 -0000      1.8
+++ mantemp.el  21 Apr 2007 20:04:06 -0000      1.9
@@ -105,14 +105,14 @@
            "^[A-z :&*<>~=,0-9+]*>::operator " nil t nil)
       (progn
        (backward-char 11)
-       (kill-line)))
+       (delete-region (point) (line-end-position))))
     ;; Remove other member function extensions.
     (goto-char (point-min))
     (message "Removing member function extensions")
     (while (re-search-forward "^[A-z :&*<>~=,0-9+]*>::" nil t nil)
       (progn
        (backward-char 2)
-       (kill-line)))))
+       (delete-region (point) (line-end-position))))))
 
 (defun mantemp-sort-and-unique-lines ()
   "Eliminate all consecutive duplicate lines in the buffer."
@@ -127,7 +127,7 @@
       (progn
        (forward-line -1)
        (beginning-of-line)
-       (kill-line 1)))))
+       (delete-region (point) (progn (forward-line 1) (point)))))))
 
 (defun mantemp-insert-cxx-syntax ()
   "Insert C++ syntax around each template class and function.
@@ -161,7 +161,7 @@
       (progn
        (beginning-of-line)
        (forward-word 1)
-       (kill-word 1)))))
+       (delete-region (point) (progn (forward-word 1) (point)))))))
 
 (defun mantemp-make-mantemps ()
   "Gathering interface to the functions modifying the buffer."
@@ -189,16 +189,16 @@
 but operates on the region."
   (interactive)
   (let ((cur-buf (current-buffer))
-       (mantemp-buffer (generate-new-buffer "*mantemp*")))
+       (mantemp-buffer (generate-new-buffer "*mantemp*"))
+       (str (buffer-substring (mark) (point))))
     ;; Copy the region to a temporary buffer, make the C++ code there
     ;; and copy the result back to the current buffer.
-    (kill-region (mark) (point))
     (set-buffer mantemp-buffer)
-    (yank)
+    (insert str)
     (mantemp-make-mantemps)
-    (kill-region (point-min) (point-max))
+    (setq str (buffer-string))
     (set-buffer cur-buf)
-    (yank)
+    (insert str)
     (kill-buffer mantemp-buffer))
   (message "Done"))
 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]