[Top][All Lists]

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

help with lisp function

From: Javier Oviedo
Subject: help with lisp function
Date: Tue, 17 Feb 2004 10:03:56 -0500

Hi all. I'm trying to write a function that copies lines from one buffer to
another buffer and keeps the original text properties. It works...sort of.
The problem is that after 70 lines, the copy stops carrying the text
properties over....the copy itself is done correctly and I end up with two
identical buffers. The problem is only with the text-properties being lost
after line 70. So, for the first 70 lines are displayed with the original
text-properties, but everything after that is displayed as plain text. Doing
a describe-text-properties verifies this.

Any help/thoughts/comments? Thanks in advance!

Here is the function:

(defun jo-test ()
  (setq buf-name "*JOTest*")
  (setq curbuf (buffer-name))
  (setq test-buf (get-buffer-create buf-name))
  (display-buffer test-buf)
    (goto-char (point-min))
    (with-current-buffer test-buf
      (setq buffer-read-only nil)
      (with-current-buffer curbuf
        (while (not (eobp))
          (setq curMatch "")
          (setq curMatch (buffer-substring (line-beginning-position)
          (forward-line 1)
          (with-current-buffer test-buf
            (insert (concat curMatch "\n"))


reply via email to

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