all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* help with lisp function
@ 2004-02-17 15:03 Javier Oviedo
  2004-02-17 15:21 ` Pascal Bourguignon
  0 siblings, 1 reply; 4+ messages in thread
From: Javier Oviedo @ 2004-02-17 15:03 UTC (permalink / raw)


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 ()
  (interactive)
  (setq buf-name "*JOTest*")
  (setq curbuf (buffer-name))
  (setq test-buf (get-buffer-create buf-name))
  (display-buffer test-buf)
  (save-excursion
    (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)
(line-end-position)))
          (forward-line 1)
          (with-current-buffer test-buf
            (insert (concat curMatch "\n"))
            )
          )
        )
      )
    )
  )

-- 
Javier

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2004-02-17 16:18 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-02-17 15:03 help with lisp function Javier Oviedo
2004-02-17 15:21 ` Pascal Bourguignon
2004-02-17 16:03   ` Peter Lee
2004-02-17 16:18   ` Javier Oviedo

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.