]> git.eshelyaron.com Git - emacs.git/commitdiff
(cua--extract-rectangle)
authorKim F. Storm <storm@cua.dk>
Sun, 9 Apr 2006 23:04:22 +0000 (23:04 +0000)
committerKim F. Storm <storm@cua.dk>
Sun, 9 Apr 2006 23:04:22 +0000 (23:04 +0000)
(cua-incr-rectangle, cua--rectangle-aux-replace):
Use filter-buffer-substring.

lisp/emulation/cua-rect.el

index 53056d667fbe7b6fa3787436c16da9a91340d3d8..43a66fd0e3e18123212e9e6b9ebc237d7259021c 100644 (file)
@@ -631,7 +631,7 @@ If command is repeated at same position, delete the rectangle."
     (if (not (cua--rectangle-virtual-edges))
        (cua--rectangle-operation nil nil nil nil nil ; do not tabify
          '(lambda (s e l r)
-            (setq rect (cons (buffer-substring-no-properties s e) rect))))
+            (setq rect (cons (filter-buffer-substring s e nil t) rect))))
       (cua--rectangle-operation nil 1 nil nil nil ; do not tabify
        '(lambda (s e l r v)
           (let ((copy t) (bs 0) (as 0) row)
@@ -649,7 +649,7 @@ If command is repeated at same position, delete the rectangle."
               (setq as (- r (max (current-column) l))
                     e (point)))
                     (setq row (if (and copy (> e s))
-                          (buffer-substring-no-properties s e)
+                          (filter-buffer-substring s e nil t)
                         ""))
             (when (> bs 0)
               (setq row (concat (make-string bs ?\s) row)))
@@ -1127,12 +1127,12 @@ The length of STRING need not be the same as the rectangle width."
      '(lambda (s e l r)
         (cond
          ((re-search-forward "0x\\([0-9a-fA-F]+\\)" e t)
-          (let* ((txt (buffer-substring-no-properties (match-beginning 1) (match-end 1)))
+          (let* ((txt (filter-buffer-substring (match-beginning 1) (match-end 1) nil t))
                  (n (string-to-number txt 16))
                  (fmt (format "0x%%0%dx" (length txt))))
             (replace-match (format fmt (+ n increment)))))
          ((re-search-forward "\\( *-?[0-9]+\\)" e t)
-          (let* ((txt (buffer-substring-no-properties (match-beginning 1) (match-end 1)))
+          (let* ((txt (filter-buffer-substring (match-beginning 1) (match-end 1) nil t))
                  (prefix (if (= (aref txt 0) ?0) "0" ""))
                  (n (string-to-number txt 10))
                  (fmt (format "%%%s%dd" prefix (length txt))))
@@ -1213,7 +1213,7 @@ The numbers are formatted according to the FORMAT string."
       (when replace
         (goto-char (point-min))
         (while (not (eobp))
-          (setq z (cons (buffer-substring (point) (line-end-position)) z))
+          (setq z (cons (filter-buffer-substring (point) (line-end-position)) z))
           (forward-line 1))))
     (if (not cua--debug)
        (kill-buffer auxbuf))