]> code.delx.au - gnu-emacs/blobdiff - lisp/register.el
Update years in copyright notice; nfc.
[gnu-emacs] / lisp / register.el
index 17c804afbd90e56a6da936a4f8e213f50653c70c..4789047b0af2b98bbb50e347309fdff74309f36d 100644 (file)
@@ -19,8 +19,8 @@
 
 ;; You should have received a copy of the GNU General Public License
 ;; along with GNU Emacs; see the file COPYING.  If not, write to the
-;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-;; Boston, MA 02111-1307, USA.
+;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+;; Boston, MA 02110-1301, USA.
 
 ;;; Commentary:
 
@@ -146,7 +146,7 @@ Interactively, NUMBER is the prefix arg (none means nil)."
                  (if (looking-at "\\s-*-?[0-9]+")
                      (progn
                        (goto-char (match-end 0))
-                       (string-to-int (match-string 0)))
+                       (string-to-number (match-string 0)))
                    0))))
 
 (defun increment-register (number register)
@@ -227,8 +227,10 @@ The Lisp value REGISTER is a character."
        (princ (car val))))
 
      ((stringp val)
-      (remove-list-of-text-properties 0 (length val)
-                                      yank-excluded-properties val)
+      (if (eq yank-excluded-properties t)
+         (set-text-properties 0 (length val) nil val)
+       (remove-list-of-text-properties 0 (length val)
+                                       yank-excluded-properties val))
       (if verbose
          (progn
            (princ "the text:\n")
@@ -275,7 +277,7 @@ Interactively, second arg is non-nil if prefix arg is supplied."
 Called from program, takes four args: REGISTER, START, END and DELETE-FLAG.
 START and END are buffer positions indicating what to copy."
   (interactive "cCopy to register: \nr\nP")
-  (set-register register (buffer-substring start end))
+  (set-register register (filter-buffer-substring start end))
   (if delete-flag (delete-region start end)))
 
 (defun append-to-register (register start end &optional delete-flag)
@@ -287,7 +289,7 @@ START and END are buffer positions indicating what to append."
   (or (stringp (get-register register))
       (error "Register does not contain text"))
   (set-register register (concat (get-register register)
-                           (buffer-substring start end)))
+                           (filter-buffer-substring start end)))
   (if delete-flag (delete-region start end)))
 
 (defun prepend-to-register (register start end &optional delete-flag)
@@ -298,14 +300,16 @@ START and END are buffer positions indicating what to prepend."
   (interactive "cPrepend to register: \nr\nP")
   (or (stringp (get-register register))
       (error "Register does not contain text"))
-  (set-register register (concat (buffer-substring start end)
+  (set-register register (concat (filter-buffer-substring start end)
                            (get-register register)))
   (if delete-flag (delete-region start end)))
 
 (defun copy-rectangle-to-register (register start end &optional delete-flag)
   "Copy rectangular region into register REGISTER.
-With prefix arg, delete as well.
-Called from program, takes four args: REGISTER, START, END and DELETE-FLAG.
+With prefix arg, delete as well.  To insert this register
+in the buffer, use \\[insert-register].
+
+Called from a program, takes four args: REGISTER, START, END and DELETE-FLAG.
 START and END are buffer positions giving two corners of rectangle."
   (interactive "cCopy rectangle to register: \nr\nP")
   (set-register register
@@ -313,4 +317,6 @@ START and END are buffer positions giving two corners of rectangle."
                    (delete-extract-rectangle start end)
                  (extract-rectangle start end))))
 
+(provide 'register)
+;;; arch-tag: ce14dd68-8265-475f-9341-5d4ec5a53035
 ;;; register.el ends here