unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* C-u C-space
@ 2007-05-09 22:45 A Soare
  2007-05-09 22:54 ` Maciej Katafiasz
  2007-05-09 22:54 ` Drew Adams
  0 siblings, 2 replies; 5+ messages in thread
From: A Soare @ 2007-05-09 22:45 UTC (permalink / raw)
  To: Emacs   Help  [help-gnu-emacs]; +Cc: Emacs   Bug  [bug-gnu-emacs]

Today I learned about this.

Now I am trying to find out what command is associated with C-u C-space. I do

C-h k C-u .

It appears <<C-u runs the command universal-argument>> . I did not arrive to press C-space.

Is it a bug? Or I used wrong describe-key ?

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

* Re: C-u C-space
  2007-05-09 22:45 C-u C-space A Soare
@ 2007-05-09 22:54 ` Maciej Katafiasz
  2007-05-09 22:54 ` Drew Adams
  1 sibling, 0 replies; 5+ messages in thread
From: Maciej Katafiasz @ 2007-05-09 22:54 UTC (permalink / raw)
  To: help-gnu-emacs; +Cc: bug-gnu-emacs

Den Thu, 10 May 2007 00:45:36 +0200 skrev A Soare:

> Now I am trying to find out what command is associated with C-u C-space.
> I do
> 
> C-h k C-u .
> 
> It appears <<C-u runs the command universal-argument>> . I did not
> arrive to press C-space.
> 
> Is it a bug? Or I used wrong describe-key ?

No, C-u modifies the command that follows. Strictly speaking, it supplies
the so called universal argument, which commands are free to read and
modify their behaviour accordingly. So what you really want is C-h k
C-SPC, which should (and does) explain what happens if you supply the
universal argument.

Cheers,
Maciej

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

* RE: C-u C-space
  2007-05-09 22:45 C-u C-space A Soare
  2007-05-09 22:54 ` Maciej Katafiasz
@ 2007-05-09 22:54 ` Drew Adams
  1 sibling, 0 replies; 5+ messages in thread
From: Drew Adams @ 2007-05-09 22:54 UTC (permalink / raw)
  To: alinsoar, Emacs   Help  [help-gnu-emacs]; +Cc: Emacs   Bug  [bug-gnu-emacs]

> Now I am trying to find out what command is associated with C-u 
> C-space. I do C-h k C-u .
> 
> It appears <<C-u runs the command universal-argument>> . I did 
> not arrive to press C-space.
> 
> Is it a bug? Or I used wrong describe-key ?

It is not a bug. It is the way Emacs works. You need to read the Emacs manual section on C-u (prefix argument). 

Once you understand that, you'll understand that you need only do C-h C-SPC. That will give you an explanation of the command bound to C-SPC, `set-mark-command', and that explanation will tell you what `C-u' means in that context:

 C-SPC runs the command set-mark-command
 ...

 With argument, e.g. C-u C-@, jump to mark, and pop a
 new position for mark off the local mark ring...

 With a double C-u prefix argument, e.g. C-u C-u C-@,
 unconditionally set mark where point is.

IOW, C-u has different meanings and behaviors, depending on what key sequence follows it. Use C-h on the base key sequence to find out about its behavior when it is modified by C-u.

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

* Re: C-u C-space
       [not found] <mailman.470.1178751193.32220.help-gnu-emacs@gnu.org>
@ 2007-05-09 23:11 ` Tyler Smith
  2007-05-10  7:34 ` Tim X
  1 sibling, 0 replies; 5+ messages in thread
From: Tyler Smith @ 2007-05-09 23:11 UTC (permalink / raw)
  To: help-gnu-emacs

On 2007-05-09, A Soare <alinsoar@voila.fr> wrote:
> Now I am trying to find out what command is associated with C-u
> C-space. I do
>
> C-h k C-u .
>
> It appears <<C-u runs the command universal-argument>> . I did not
> arrive to press C-space.
>
> Is it a bug? Or I used wrong describe-key ?
>

No, you used it right, and it's not a bug. C-u is the universal
argument command. You need to find out what happens when the universal
argument is given to C-space:

C-h k C-space	

C-SPC runs the command set-mark-command
   which is an interactive compiled Lisp function in `simple'.
(set-mark-command ARG)

Set mark at where point is, or jump to mark.
With no prefix argument, set mark, push old mark position on local mark
ring, and push mark on global mark ring.
With argument, jump to mark, and pop a new position for mark off the ring
(does not affect global mark ring).

The last line tells you what C-SPC does 'with argument', which means
when you prefix it with C-u.

HTH,

Tyler

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

* Re: C-u C-space
       [not found] <mailman.470.1178751193.32220.help-gnu-emacs@gnu.org>
  2007-05-09 23:11 ` Tyler Smith
@ 2007-05-10  7:34 ` Tim X
  1 sibling, 0 replies; 5+ messages in thread
From: Tim X @ 2007-05-10  7:34 UTC (permalink / raw)
  To: help-gnu-emacs

A Soare <alinsoar@voila.fr> writes:

> Today I learned about this.
>
> Now I am trying to find out what command is associated with C-u C-space. I do
>
> C-h k C-u .
>
> It appears <<C-u runs the command universal-argument>> . I did not arrive to press C-space.
>
> Is it a bug? Or I used wrong describe-key ?
>

No, its not a bug. C-u is the 'universal-argument, which basically means it is
a type of modifier for some functions. So, what you need to do is look up what
C-space does and you will probably find it states that the behavior of the
function is modified by using the optional argument, which is usually refered
to as the prefix argument. See below -

Tim


,----[ C-h k  CONTROL SPACE  ]
|  CONTROL SPACE  runs the command set-mark-command
|   which is an interactive compiled Lisp function in `simple.el'.
| It is bound to  control @ ,  CONTROL SPACE .
| (set-mark-command ARG)
| 
| Set the mark where point is, or jump to the mark.
| Setting the mark also alters the region, which is the text
| between point and mark; this is the closest equivalent in
| Emacs to what some editors call the "selection".
| 
| With no prefix argument, set the mark at point, and push the
| old mark position on local mark ring.  Also push the old mark on
| global mark ring, if the previous mark was set in another buffer.
| 
| Immediately repeating this command activates `transient-mark-mode' temporarily.
| 
| With prefix argument (e.g., C-u C-@), jump to the mark, and set the mark from
| position popped off the local mark ring (this does not affect the global
| mark ring).  Use C-x C-@ to jump to a mark popped off the global
| mark ring (see `pop-global-mark').
| 
| If `set-mark-command-repeat-pop' is non-nil, repeating
| the C-@ command with no prefix argument pops the next position
| off the local (or global) mark ring and jumps there.
| 
| With C-u C-u as prefix
| argument, unconditionally set mark where point is, even if
| `set-mark-command-repeat-pop' is non-nil.
| 
| Novice Emacs Lisp programmers often try to use the mark for the wrong
| purposes.  See the documentation of `set-mark' for more information.
| 
| This function is advised.
| 
| After-advice `emacspeak':
| Produce an auditory icon if possible.
`----

-- 
tcross (at) rapttech dot com dot au

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

end of thread, other threads:[~2007-05-10  7:34 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-05-09 22:45 C-u C-space A Soare
2007-05-09 22:54 ` Maciej Katafiasz
2007-05-09 22:54 ` Drew Adams
     [not found] <mailman.470.1178751193.32220.help-gnu-emacs@gnu.org>
2007-05-09 23:11 ` Tyler Smith
2007-05-10  7:34 ` Tim X

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).