POV-Ray : Newsgroups : povray.off-topic : Emacs Server Time
29 Sep 2024 00:19:20 EDT (-0400)
  Emacs (Message 71 to 80 of 349)  
<<< Previous 10 Messages Goto Latest 10 Messages Next 10 Messages >>>
From: Tor Olav Kristensen
Subject: Re: Emacs
Date: 15 Apr 2009 08:56:46
Message: <49e5d98e$1@news.povray.org>
Invisible wrote:
>>> Er, no... HOW DO YOU TYPE THAT? What buttons is it actually telling 
>>> you to press?
>>
>> Control-u 10 Control-f
> 
> So, hold control, tap U, release control, tap 1 and then 0, hold 
> control, tap F, and then release control?

Yes, that's almost right =)

(I wrote "u" and "f" not "U" and "F", but the result will be the same.)

-- 
Tor Olav
http://subcube.com


Post a reply to this message

From: Bill Pragnell
Subject: Re: Emacs
Date: 15 Apr 2009 09:05:01
Message: <web.49e5dab6be8f6db96dd25f0b0@news.povray.org>
Invisible <voi### [at] devnull> wrote:
> >>> on-screen. (Like Scotty bringing up a 3D model of transparent aluminium in 4
> >>> seconds work - name that movie!)
> >> I don't know the title. Whichever Star Trek movie it was that featured
> >> time travel.
> >
> > Ha, you only get 1/2.
>
> Random guess: The search for Spock?

The one after; the Voyage Home.

"Excuse me, can you tell me where they keep the nuclear wessels?"


Post a reply to this message

From: triple r
Subject: Re: Emacs
Date: 15 Apr 2009 09:15:01
Message: <web.49e5dd80be8f6db963a1b7c30@news.povray.org>
Tor Olav Kristensen <tor### [at] TOBEREMOVEDgmailcom> wrote:

> If you do the following keystrokes:
>
> C-home        // beginning-of-buffer
> down          // next-line
> C-k           // kill-line
> C-y           // yank
> down          // next-line
> C-x (         // start-kbd-macro
> down          // next-line
> C-e           // move-end-of-line
> C-y           // yank
> C-x )         // kmacro-end-macro
> C-u           // universal-argument
> 9             // 9
> C-x e         // kmacro-end-and-call-macro

Or its vim equivalent for those afraid of the control key ;-)

2G     //line 2
yy     //yank (copy) the line
2j     //down two lines
$      //end of line
qa     //start macro 'a'
p      //paste
j      //next line
q      //end macro
9@a    //run macro 'a' 9 times

 - Ricky


Post a reply to this message

From: Mike Raiford
Subject: Re: Emacs
Date: 15 Apr 2009 10:11:36
Message: <49e5eb18$1@news.povray.org>
Invisible wrote:
> 
> Actually, it appears that kill = cut and yank = paste. (WTF?)
> 

Yeah, that's pretty screwy terminology. Why not use terminology like 
delete, copy and insert?

at least that makes sense ... even if the terms cut and paste didn't 
exist back then.

Interestingly, Visual Studio has Emacs emulation. I don't know how far 
it goes, though. But, I suppose if you're used to doing things the Emacs 
way it could be very useful.


-- 
~Mike


Post a reply to this message

From: Tor Olav Kristensen
Subject: Re: Emacs
Date: 15 Apr 2009 10:22:07
Message: <49e5ed8f$1@news.povray.org>
Invisible wrote:
...
  > By the way... what kind of keyboard actually has a Meta key?
...

It is likely that you have a keyboard where Emacs regards the Esc
key as the Meta key.

-- 
Tor Olav
http://subcube.com


Post a reply to this message

From: Tor Olav Kristensen
Subject: Re: Emacs
Date: 15 Apr 2009 10:32:44
Message: <49e5f00c$1@news.povray.org>
Tor Olav Kristensen wrote:
...
> C-home        // beginning-of-buffer
> down          // next-line
> C-k           // kill-line
> C-y           // yank
> down          // next-line
> C-x (         // start-kbd-macro
> down          // next-line
> C-e           // move-end-of-line
> C-y           // yank
> C-x )         // kmacro-end-macro
> C-u           // universal-argument
> 9             // 9
> C-x e         // kmacro-end-and-call-macro
...

Btw.: Here's a quick Emacs reference:

http://www.math.uh.edu/~bgb/emacs_keys.html

-- 
Tor Olav
http://subcube.com


Post a reply to this message

From: Tor Olav Kristensen
Subject: Re: Emacs
Date: 15 Apr 2009 10:39:38
Message: <49e5f1aa$1@news.povray.org>
Invisible wrote:
> Tor Olav Kristensen wrote:
>> Invisible wrote:
>> ...
>>> Or you have a grid of numbers, and you want to add another column in 
>>> the middle. Or stuff like that. Since Emacs == Lisp, it seems that 
>>> you could probably spend 20 minutes writing some code that would do 
>>> what you want. 
>> ...
>>
>>
http://www.gnu.org/software/emacs/manual/html_node/emacs/Text-Based-Tables.html#Text-Based-Tables

> 
> 
> Close, but not quite what I was thinking of.
> 
> I was thinking more like you have some text such as
> 
>   case x of
>     5 -> return [(1, 4), (2, 3)]
>     6 -> return [(1, 5), (2, 4), (3, 3)]
>     7 -> return [(1, 6), (2, 5), (3, 4)]
> 
> and you suddenly decide you need to change that to
> 
>   case x of
>     5 -> return $ Just [(1, 4), (2, 3)]
>     6 -> return $ Just [(1, 5), (2, 4), (3, 3)]
>     7 -> return $ Just [(1, 6), (2, 5), (3, 4)]
> 
> It's kinda tedious to do this by hand. (Depending on just how many times 
> you need to do it, obviously...)

Have a look at this:

http://www.gnu.org/software/emacs/manual/html_node/emacs/Rectangles.html

(The text cursor is the "point" and you can put a "mark" in the text with C-space.)

-- 
Tor Olav
http://subcube.com


Post a reply to this message

From: Mueen Nawaz
Subject: Re: Emacs
Date: 15 Apr 2009 10:48:51
Message: <49e5f3d3$1@news.povray.org>
Invisible wrote:
> One feature I actually *want* and that no known editor seems to have is
> the ability to do stuff to tabular data easily. Like, if you suddenly
> decide that you need to append the same piece of text to all 10 lines.

	Emacs can do this. Probably many decent editors can. Define a macro
that does it to one line (and then moves down a line). Then tell it to
execute the macro 10 times.

> Or you have a grid of numbers, and you want to add another column in the
> middle. Or stuff like that. Since Emacs == Lisp, it seems that you could

	You can use rectangular editing to add space for that column. Then just
change from insert mode to overwrite and add in the numbers.
Alternatively, in a separate buffer, type in that column. Then use
rectangular editing to copy that rectangle, and yank it into the text
that you want.

> probably spend 20 minutes writing some code that would do what you want.

	It's an old, old feature.



-- 
For a while, she had a boyfriend with a wooden leg. Then she broke it off.


                    /\  /\               /\  /
                   /  \/  \ u e e n     /  \/  a w a z
                       >>>>>>mue### [at] nawazorg<<<<<<
                                   anl


Post a reply to this message

From: Mueen Nawaz
Subject: Re: Emacs
Date: 15 Apr 2009 10:51:44
Message: <49e5f480$1@news.povray.org>
Invisible wrote:
>>> Does anybody know what the hell "C-u 10 C-f" is actually supposed to
>>> mean?
>>
>>     I believe it means to do C-f many, many times. Don't know for sure as
>> I'm not (yet) a real emacs user.
> 
> No no, I mean... HOW DO YOU TYPE THAT? What keys is it actually talking
> about?

	Oh come on! This is the lamest of your complaints. If it was written as:

Ctrl-u 10 Ctrl-f

OR

^u 10 ^f

	You'd get it. But C-u 10 C-f? *That's* creating problems for you?

>>     As for kill and yank, do realize that Emacs is old. I'm not sure cut
>> and paste was common editor parlance in those days.
> 
> Fair enough. But... pretty strange choice of terms, even if nothing
> existed before.

	No stranger than cut and paste. In emacs, deleting a bunch of text is
the same as putting it into the "clipboard" (kill buffer). So kill makes
sense, because that's really what you may be doing - just deleting text.
Yank simply yanks the text from the kill buffer where you want it.

	Cut? Makes sense for papers, but not for screens.

-- 
For a while, she had a boyfriend with a wooden leg. Then she broke it off.


                    /\  /\               /\  /
                   /  \/  \ u e e n     /  \/  a w a z
                       >>>>>>mue### [at] nawazorg<<<<<<
                                   anl


Post a reply to this message

From: Tor Olav Kristensen
Subject: Re: Emacs
Date: 15 Apr 2009 10:53:11
Message: <49e5f4d7$1@news.povray.org>
Tor Olav Kristensen wrote:
> Invisible wrote:
>> Tor Olav Kristensen wrote:
>>> Invisible wrote:
>>> ...
>>>> Or you have a grid of numbers, and you want to add another column in 
>>>> the middle. Or stuff like that. Since Emacs == Lisp, it seems that 
>>>> you could probably spend 20 minutes writing some code that would do 
>>>> what you want. 
>>> ...
>>>
>>>
http://www.gnu.org/software/emacs/manual/html_node/emacs/Text-Based-Tables.html#Text-Based-Tables

>>
>>
>>
>> Close, but not quite what I was thinking of.
>>
>> I was thinking more like you have some text such as
>>
>>   case x of
>>     5 -> return [(1, 4), (2, 3)]
>>     6 -> return [(1, 5), (2, 4), (3, 3)]
>>     7 -> return [(1, 6), (2, 5), (3, 4)]
>>
>> and you suddenly decide you need to change that to
>>
>>   case x of
>>     5 -> return $ Just [(1, 4), (2, 3)]
>>     6 -> return $ Just [(1, 5), (2, 4), (3, 3)]
>>     7 -> return $ Just [(1, 6), (2, 5), (3, 4)]
>>
>> It's kinda tedious to do this by hand. (Depending on just how many 
>> times you need to do it, obviously...)
> 
> Have a look at this:
> 
> http://www.gnu.org/software/emacs/manual/html_node/emacs/Rectangles.html
> 
> (The text cursor is the "point" and you can put a "mark" in the text 
> with C-space.)

So here's what you could do:

M-g g      // goto-line
2          // 2
C-right    // forward-word
C-right    // forward-word
C-space    // set-mark-command
down       // next-line
down       // next-line
C-x r t    // string-rectangle
  $ Just    //


-- 
Tor Olav
http://subcube.com


Post a reply to this message

<<< Previous 10 Messages Goto Latest 10 Messages Next 10 Messages >>>

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.