unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* cua--rectangle-get-corners
@ 2007-06-30  6:20 Andreas Röhler
  2007-06-30 21:32 ` cua--rectangle-get-corners Kim F. Storm
  0 siblings, 1 reply; 4+ messages in thread
From: Andreas Röhler @ 2007-06-30  6:20 UTC (permalink / raw)
  To: Kim F. Storm; +Cc: bug-gnu-emacs


Hi,

had a look into cua-rect.el; thanks for writing it.

BTW:

defun cua--rectangle-get-corners

from `cua-rect.el' failt because 

`cua-virtual-rectangle-edges'

was not known. (Exits only once AFAIS.)

Too `cua-rect' functions are not listed with M-x apropos
rect.

Thanks

Andreas Roehler

GNU Emacs 22.1.50.1 (i686-pc-linux-gnu, X toolkit, Xaw3d scroll bars) of 
2007-06-07 on karton

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

* Re: cua--rectangle-get-corners
  2007-06-30  6:20 cua--rectangle-get-corners Andreas Röhler
@ 2007-06-30 21:32 ` Kim F. Storm
  2007-07-02 10:15   ` cua--rectangle-get-corners Andreas Röhler
  0 siblings, 1 reply; 4+ messages in thread
From: Kim F. Storm @ 2007-06-30 21:32 UTC (permalink / raw)
  To: Andreas Röhler; +Cc: bug-gnu-emacs

Andreas Röhler <andreas.roehler@online.de> writes:

> Hi,
>
> had a look into cua-rect.el; thanks for writing it.
>
> BTW:
>
> defun cua--rectangle-get-corners
>
> from `cua-rect.el' failt because 
>
> `cua-virtual-rectangle-edges'
>
> was not known. (Exits only once AFAIS.)

Please explain how this happened ?

How did you call cua--rectangle-get-corners ?

>
> Too `cua-rect' functions are not listed with M-x apropos
> rect.

They are once you hit C-RET....

I don't want to add autoload to the commands in cua-rect, as they
don't have any use unless you activate then after doing C-RET.

-- 
Kim F. Storm <storm@cua.dk> http://www.cua.dk

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

* Re: cua--rectangle-get-corners
  2007-06-30 21:32 ` cua--rectangle-get-corners Kim F. Storm
@ 2007-07-02 10:15   ` Andreas Röhler
  2007-07-02 13:16     ` cua--rectangle-get-corners Kim F. Storm
  0 siblings, 1 reply; 4+ messages in thread
From: Andreas Röhler @ 2007-07-02 10:15 UTC (permalink / raw)
  To: bug-gnu-emacs; +Cc: Kim F. Storm

Am Samstag, 30. Juni 2007 23:32 schrieb Kim F. Storm:
> Andreas Röhler <andreas.roehler@online.de> writes:
> > Hi,
> >
> > had a look into cua-rect.el; thanks for writing it.
> >
> > BTW:
> >
> > defun cua--rectangle-get-corners
> >
> > from `cua-rect.el' failt because
> >
> > `cua-virtual-rectangle-edges'
> >
> > was not known. (Exits only once AFAIS.)
>
> Please explain how this happened ?
>
> How did you call cua--rectangle-get-corners ?

It turns out, I didn't evaluate cua-rect.el
completely. Sorry for the noise.

BTW: cua-rect.el contains a lot of useful functions.

However, detected it only per chance.

For example I needed a copy-function, which is
meanwhile written that way:

(defun copy-rectangle (start end &optional as-is)
  " "
  (interactive "r\nP")
  (kill-new 
   (if as-is
       (mapconcat 'identity (extract-rectangle start end) "\n")
     (replace-regexp-in-string "[ \t]+" " " (mapconcat 'identity 
(extract-rectangle start end) " ")))))

IMHO it would be helpful to define aliases, in order to
list these functions together with functions from
rect.el.

Too many of them might be used interactively, if
provided therefor. This may help users to deal with
rectangles, to learn about it.

Other question: is the cua-stuff needed here? I didn't
expect to see the file in directory emulation.

>
> > Too `cua-rect' functions are not listed with M-x apropos
> > rect.
>
> They are once you hit C-RET....
>
> I don't want to add autoload to the commands in cua-rect, as they
> don't have any use unless you activate then after doing C-RET.

Sorry, don't understand what this could mean in this
context. Could you give the name of the function which
shall be called that way?

Thanks

Andreas Roehler

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

* Re: cua--rectangle-get-corners
  2007-07-02 10:15   ` cua--rectangle-get-corners Andreas Röhler
@ 2007-07-02 13:16     ` Kim F. Storm
  0 siblings, 0 replies; 4+ messages in thread
From: Kim F. Storm @ 2007-07-02 13:16 UTC (permalink / raw)
  To: Andreas Röhler; +Cc: bug-gnu-emacs

Andreas Röhler <andreas.roehler@online.de> writes:

> IMHO it would be helpful to define aliases, in order to
> list these functions together with functions from
> rect.el.

To the extend where they can be used on their own, yes.

> Other question: is the cua-stuff needed here? I didn't
> expect to see the file in directory emulation.

I haven't looked at this recently, but historically, cua-mode started
out by doing region-based copy/paste and at some point I extended it
do do rectangle-based copy/paste as well, with basically the same key
bindings, except that you start a region with C-SPC and a rectangle
with C-RET.

Then later again, I added the global mark feature, C-S-SPC, which
integrates fully with cua's region/rectangle copy/paste features.

So it started simple, and grew more complex.

Later, I tried to separate as much as possible of the rectangle
and global mark stuff into separate files cua-rect.el and cua-gmrk.el
but there still are some links between then and the basic cua.el which
I can't easily get rid of -- so I left it at that point, and haven't
had time to go further.

If you can see any way to make a cleaner split, you are most welcome
to make suggestions (but please be specific -- many people tell me
I should do this, but they never suggest how it can be done).

>
>>
>> > Too `cua-rect' functions are not listed with M-x apropos
>> > rect.
>>
>> They are once you hit C-RET....
>>
>> I don't want to add autoload to the commands in cua-rect, as they
>> don't have any use unless you activate then after doing C-RET.
>
> Sorry, don't understand what this could mean in this
> context. Could you give the name of the function which
> shall be called that way?

In _my_ context the cua-rect functions are only used when you
have enabled cua-mode and after you have hit C-RET.  

cua-rect is auto-loaded the first time you hit C-RET, and after that
everything you need is available...

If you want to use the cua-rect stuff in some _other_ context, you
could require cua-rect explicitly, but doing that would be at the risk
of breakage if I decide to change stuff in cua-rect unless I'm aware
that something else is relying on parts of it in specific ways.

-- 
Kim F. Storm <storm@cua.dk> http://www.cua.dk

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

end of thread, other threads:[~2007-07-02 13:16 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-06-30  6:20 cua--rectangle-get-corners Andreas Röhler
2007-06-30 21:32 ` cua--rectangle-get-corners Kim F. Storm
2007-07-02 10:15   ` cua--rectangle-get-corners Andreas Röhler
2007-07-02 13:16     ` cua--rectangle-get-corners Kim F. Storm

Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).