unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* efficient editing question (hot key , ccmode)
@ 2006-11-19  7:39 Ronald
  2006-11-19  9:36 ` Dieter Wilhelm
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Ronald @ 2006-11-19  7:39 UTC (permalink / raw)


If I press ``M-(", there will be a space before `(' ,
how to inhibit it?
And how to let ``{}" work in the same way?

When the caret is in the middle of a line,
how to new a line and move the caret there automatically? 

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

* Re: efficient editing question (hot key , ccmode)
  2006-11-19  7:39 efficient editing question (hot key , ccmode) Ronald
@ 2006-11-19  9:36 ` Dieter Wilhelm
  2006-11-20 21:50   ` Dieter Wilhelm
  2006-11-21 16:24 ` Kevin Rodgers
       [not found] ` <mailman.951.1164126341.2155.help-gnu-emacs@gnu.org>
  2 siblings, 1 reply; 7+ messages in thread
From: Dieter Wilhelm @ 2006-11-19  9:36 UTC (permalink / raw)
  Cc: help-gnu-emacs

"Ronald" <followait@163.com> writes:

> If I press ``M-(", there will be a space before `(' ,
> how to inhibit it?

(setq parens-require-spaces nil)	;no space before parens with M-(

> And how to let ``{}" work in the same way?

Unfortunately it is not working out of the box analogous because M-{
is already taken by forward-paragraph.  Or is there some hack in
cc-mode, please let me know.

At least I got M-" running without interfering something:

(global-set-key [?\M-\"] 'insert-pair) 	;insert pair of quotes (`"'), see lisp.el

>
> When the caret is in the middle of a line,

what do you mean exactly by caret? (Sorry, not a native speaker
myself.)

-- 
    Best wishes

    H. Dieter Wilhelm
    Darmstadt, Germany

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

* Re: efficient editing question (hot key , ccmode)
  2006-11-19  9:36 ` Dieter Wilhelm
@ 2006-11-20 21:50   ` Dieter Wilhelm
  0 siblings, 0 replies; 7+ messages in thread
From: Dieter Wilhelm @ 2006-11-20 21:50 UTC (permalink / raw)
  Cc: help-gnu-emacs

Dieter Wilhelm <dieter@duenenhof-wilhelm.de> writes:

>
>> And how to let ``{}" work in the same way?
>
> Unfortunately it is not working out of the box analogous because M-{
> is already taken by forward-paragraph.  Or is there some hack in
> cc-mode, please let me know.

Found that AUC-TeX has C-c { for inserting a pair of braces.  Maybe
it's the same with cc-mode?

-- 
    Best wishes

    H. Dieter Wilhelm
    Darmstadt, Germany

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

* Re: efficient editing question (hot key , ccmode)
  2006-11-19  7:39 efficient editing question (hot key , ccmode) Ronald
  2006-11-19  9:36 ` Dieter Wilhelm
@ 2006-11-21 16:24 ` Kevin Rodgers
       [not found] ` <mailman.951.1164126341.2155.help-gnu-emacs@gnu.org>
  2 siblings, 0 replies; 7+ messages in thread
From: Kevin Rodgers @ 2006-11-21 16:24 UTC (permalink / raw)


Ronald wrote:
> If I press ``M-(", there will be a space before `(' ,
> how to inhibit it?

,----[ C-h k M-( ]
| M-( runs the command insert-parentheses
|    which is an interactive compiled Lisp function in `lisp.el'.
| It is bound to M-(.
| (insert-parentheses &optional arg)
|
| Enclose following arg sexps in parentheses.
| Leave point after open-paren.
| A negative arg encloses the preceding arg sexps instead.
| No argument is equivalent to zero: just insert `()' and leave point 
between.
| If `parens-require-spaces' is non-nil, this command also inserts a space
| before and after, depending on the surrounding characters.
| If region is active, insert enclosing characters at region boundaries.
|
| [back]
`----

> And how to let ``{}" work in the same way?

(global-set-key "\M-{" 'insert-pair)

> When the caret is in the middle of a line,
> how to new a line and move the caret there automatically? 

If by caret you mean point: C-e RET

-- 
Kevin

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

* Re: efficient editing question (hot key , ccmode)
       [not found] ` <mailman.951.1164126341.2155.help-gnu-emacs@gnu.org>
@ 2006-11-22  4:06   ` Ronald
  2006-11-22  6:37     ` Dieter Wilhelm
  0 siblings, 1 reply; 7+ messages in thread
From: Ronald @ 2006-11-22  4:06 UTC (permalink / raw)



"Kevin Rodgers" <ihs_4664@yahoo.com> 
??????:mailman.951.1164126341.2155.help-gnu-emacs@gnu.org...
> Ronald wrote:
>> If I press ``M-(", there will be a space before `(' ,
>> how to inhibit it?
>
> ,----[ C-h k M-( ]
> | M-( runs the command insert-parentheses
> |    which is an interactive compiled Lisp function in `lisp.el'.
> | It is bound to M-(.
> | (insert-parentheses &optional arg)
> |
> | Enclose following arg sexps in parentheses.
> | Leave point after open-paren.
> | A negative arg encloses the preceding arg sexps instead.
> | No argument is equivalent to zero: just insert `()' and leave point 
> between.
> | If `parens-require-spaces' is non-nil, this command also inserts a space
> | before and after, depending on the surrounding characters.
> | If region is active, insert enclosing characters at region boundaries.
> |
> | [back]
> `----
>
>> And how to let ``{}" work in the same way?
>
> (global-set-key "\M-{" 'insert-pair)
>
Maybe I should get the function,``insert-pair",first.

>> When the caret is in the middle of a line,
>> how to new a line and move the caret there automatically?
>
> If by caret you mean point: C-e RET
Maybe I should define something like C-; , who has less key strokes.
>
> -- 
> Kevin
>
>
> 

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

* Re: efficient editing question (hot key , ccmode)
  2006-11-22  4:06   ` Ronald
@ 2006-11-22  6:37     ` Dieter Wilhelm
  2006-11-22 16:12       ` Kevin Rodgers
  0 siblings, 1 reply; 7+ messages in thread
From: Dieter Wilhelm @ 2006-11-22  6:37 UTC (permalink / raw)
  Cc: help-gnu-emacs

"Ronald" <followait@163.com> writes:

> "Kevin Rodgers" <ihs_4664@yahoo.com> 
> ??????:mailman.951.1164126341.2155.help-gnu-emacs@gnu.org...
>> Ronald wrote:
>>> If I press ``M-(", there will be a space before `(' ,
>>> how to inhibit it?
>>
>> ,----[ C-h k M-( ]
>> | M-( runs the command insert-parentheses
>> |    which is an interactive compiled Lisp function in `lisp.el'.
>> | It is bound to M-(.
>> | (insert-parentheses &optional arg)
>> |
>> | Enclose following arg sexps in parentheses.
>> | Leave point after open-paren.
>> | A negative arg encloses the preceding arg sexps instead.
>> | No argument is equivalent to zero: just insert `()' and leave point 
>> between.
>> | If `parens-require-spaces' is non-nil, this command also inserts a space
>> | before and after, depending on the surrounding characters.
>> | If region is active, insert enclosing characters at region boundaries.
>> |
>> | [back]
>> `----
>>
>>> And how to let ``{}" work in the same way?
>>
>> (global-set-key "\M-{" 'insert-pair)
>>
> Maybe I should get the function,``insert-pair",first.

It's a standard Emacs (22) function.

>
>>> When the caret is in the middle of a line,
>>> how to new a line and move the caret there automatically?
>>
>> If by caret you mean point: C-e RET
> Maybe I should define something like C-; , who has less key strokes.

When it's not taken already, why not?

>>
>> -- 
>> Kevin
>>
>>
>> 

-- 
    Best wishes

    H. Dieter Wilhelm
    Darmstadt, Germany

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

* Re: efficient editing question (hot key , ccmode)
  2006-11-22  6:37     ` Dieter Wilhelm
@ 2006-11-22 16:12       ` Kevin Rodgers
  0 siblings, 0 replies; 7+ messages in thread
From: Kevin Rodgers @ 2006-11-22 16:12 UTC (permalink / raw)


Dieter Wilhelm wrote:
> "Ronald" <followait@163.com> writes:
> 
>> "Kevin Rodgers" <ihs_4664@yahoo.com> 
>> ??????:mailman.951.1164126341.2155.help-gnu-emacs@gnu.org...
>>> Ronald wrote:
...
>>>> And how to let ``{}" work in the same way?
>>> (global-set-key "\M-{" 'insert-pair)
>>>
>> Maybe I should get the function,``insert-pair",first.
> 
> It's a standard Emacs (22) function.

Oops, sorry for not checking that.

>>>> When the caret is in the middle of a line,
>>>> how to new a line and move the caret there automatically?
>>> If by caret you mean point: C-e RET
>> Maybe I should define something like C-; , who has less key strokes.
> 
> When it's not taken already, why not?

,----[ File: emacs,  Node: Keymaps,  Next: Prefix Keymaps,  Up: Key 
Bindings ]
|   As a user, you can redefine any key; but it is usually best to stick
| to key sequences that consist of `C-c' followed by a letter (upper or
| lower case).  These keys are "reserved for users," so they won't
| conflict with any properly designed Emacs extension.  The function keys
| <F5> through <F9> are also reserved for users.  If you redefine some
| other key, your definition may be overridden by certain extensions or
| major modes which redefine the same key.
`----

-- 
Kevin

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

end of thread, other threads:[~2006-11-22 16:12 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-11-19  7:39 efficient editing question (hot key , ccmode) Ronald
2006-11-19  9:36 ` Dieter Wilhelm
2006-11-20 21:50   ` Dieter Wilhelm
2006-11-21 16:24 ` Kevin Rodgers
     [not found] ` <mailman.951.1164126341.2155.help-gnu-emacs@gnu.org>
2006-11-22  4:06   ` Ronald
2006-11-22  6:37     ` Dieter Wilhelm
2006-11-22 16:12       ` Kevin Rodgers

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