[Top][All Lists]

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

Re: open-rectangle

From: Andreas Röhler
Subject: Re: open-rectangle
Date: Tue, 26 Jun 2007 20:29:45 +0200
User-agent: KMail/1.8.2

Am Dienstag, 26. Juni 2007 14:21 schrieb martin rudalics:
>  > Intention is to copy extracts from *w3m*-buffer with
>  > `copy-rectangle-to-register'
>  >
>  > However, calling `open-rectangle' I get an error,
>  > because *w3m*-buffer is read-only. Toggling this it
>  > works.
> How do you manage to call `open-rectangle' here?
> `copy-rectangle-to-register' calls `extract-rectangle' which doesn't
> modify the buffer.
>  > Question: Is this star, which causes the error in the
>  >  interactive-form "*r\nP" of `open-rectangle' necessary?
> Yes.  Because `open-rectangle' may modify the buffer.

Lately the `register'-part of
`copy-rectangle-to-register' turned out not as suitable
for my needs. Tried to get rid of that.

What about such a thing?

(defun copy-rectangle (start end)
  " "
  (interactive "r")
  (let (extr)
    (dolist (elem (extract-rectangle start end))
      (setq extr (concat extr elem "\n")))
    (kill-new extr)))

Andreas Roehler

reply via email to

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