unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* replace TAB with 8 whitespaces
@ 2003-06-12 16:49 jinneemop
  2003-06-12 17:19 ` Henrik Enberg
                   ` (3 more replies)
  0 siblings, 4 replies; 19+ messages in thread
From: jinneemop @ 2003-06-12 16:49 UTC (permalink / raw)


Hi all,
I wish to use 8 spaces to indent source code under c++ mode. 
When I press TAB, I'd like emacs to insert 8 spaces instead.
How can I do this?
thx for anyone who replies 

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

* Re: replace TAB with 8 whitespaces
  2003-06-12 16:49 replace TAB with 8 whitespaces jinneemop
@ 2003-06-12 17:19 ` Henrik Enberg
  2003-06-12 17:26 ` Alan Mackenzie
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 19+ messages in thread
From: Henrik Enberg @ 2003-06-12 17:19 UTC (permalink / raw)


"jinneemop" <jinneemop@isee.zju.edu> writes:

> I wish to use 8 spaces to indent source code under c++ mode. 
> When I press TAB, I'd like emacs to insert 8 spaces instead.
> How can I do this?

(add-hook c++-mode-hook
	  (lambda ()
	    (setq indent-tabs-mode nil)))

-- 
hail satan

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

* Re: replace TAB with 8 whitespaces
  2003-06-12 16:49 replace TAB with 8 whitespaces jinneemop
  2003-06-12 17:19 ` Henrik Enberg
@ 2003-06-12 17:26 ` Alan Mackenzie
  2003-06-12 17:34 ` Peter J. Acklam
  2003-06-13  7:00 ` Kai Großjohann
  3 siblings, 0 replies; 19+ messages in thread
From: Alan Mackenzie @ 2003-06-12 17:26 UTC (permalink / raw)


jinneemop <jinneemop@isee.zju.edu> wrote on Fri, 13 Jun 2003 00:49:21 +0800:
> Hi all,
> I wish to use 8 spaces to indent source code under c++ mode. 
> When I press TAB, I'd like emacs to insert 8 spaces instead.
> How can I do this?

Finding the correct place in the Emacs info pages is the first challenge.
This can be done by:

C-h i
m emacs
m indentation

Then read through to the bit about "Just Spaces", which is exactly what
you're asking about.

Unfortunately, there are several ways to "solve" your problem, so here's
what's going on.

You need to set the variable indent-tabs-mode to nil.  This variable is
buffer-local, which means if you just set it, that setting only applies
to the current buffer.  If you are happy about always using spaces for
indentation (e.g. for other modes) you can change the default value of
this variable by putting this early on in your .emacs:

(setq-default indent-tabs-mode nil)

This is what I do.  If you just want this thing for c++ files, set the
variable in the c++-mode-hook, like this:

(defun my-nospaces ()
  (setq indent-tabs-mode nil))
(add-hook 'c++-mode-hook 'my-nospaces)

If you want a middle position, i.e. also using spaces in C Mode, Java
Mode, ... (all constituent modes of CC Mode), add the function to the
c-mode-common-hook instead of the c++-mode-hook, like this

(add-hook 'c-mode-common-hook 'my-nospaces)

All the best!

-- 
Alan Mackenzie (Munich, Germany)
Email: aacm@muuc.dee; to decode, wherever there is a repeated letter
(like "aa"), remove half of them (leaving, say, "a").

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

* Re: replace TAB with 8 whitespaces
  2003-06-12 16:49 replace TAB with 8 whitespaces jinneemop
  2003-06-12 17:19 ` Henrik Enberg
  2003-06-12 17:26 ` Alan Mackenzie
@ 2003-06-12 17:34 ` Peter J. Acklam
  2003-06-13  7:00 ` Kai Großjohann
  3 siblings, 0 replies; 19+ messages in thread
From: Peter J. Acklam @ 2003-06-12 17:34 UTC (permalink / raw)


"jinneemop" <jinneemop@isee.zju.edu> wrote:

> I wish to use 8 spaces to indent source code under c++ mode. 
> When I press TAB, I'd like emacs to insert 8 spaces instead.
> How can I do this?

   (setq-default indent-tabs-mode nil)

Peter

-- 
I wish dialog boxes had a button saying "Whatever".  I hate being
forced to answer "Yes" or "No" to a question I have no opinion on
whatsoever.  There ought to be a button matching my indifference.
                                          -- me

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

* Re: replace TAB with 8 whitespaces
  2003-06-12 16:49 replace TAB with 8 whitespaces jinneemop
                   ` (2 preceding siblings ...)
  2003-06-12 17:34 ` Peter J. Acklam
@ 2003-06-13  7:00 ` Kai Großjohann
  2003-06-16 12:51   ` jinneemop
  3 siblings, 1 reply; 19+ messages in thread
From: Kai Großjohann @ 2003-06-13  7:00 UTC (permalink / raw)


"jinneemop" <jinneemop@isee.zju.edu> writes:

> I wish to use 8 spaces to indent source code under c++ mode. 
> When I press TAB, I'd like emacs to insert 8 spaces instead.

What does Emacs currently do?

[ ] Inserts tab instead of 8 spaces.
[ ] Inserts N spaces instead of 8 spaces.  N = ___
[ ] Emacs crashes
[ ] Something interesting, please specify: _____________________
-- 
This line is not blank.

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

* Re: replace TAB with 8 whitespaces
  2003-06-16 12:51   ` jinneemop
@ 2003-06-16  7:26     ` Kai Großjohann
  2003-06-16 19:52       ` jinneemop
  0 siblings, 1 reply; 19+ messages in thread
From: Kai Großjohann @ 2003-06-16  7:26 UTC (permalink / raw)


"jinneemop" <jinneemop@isee.zju.edu> writes:

> On Fri, 13 Jun 2003 09:00:26 +0200, Kai Großjohann wrote:
>
>> [x] Something interesting, please specify: It seems like one tab 
> and one space.

It inserts a tab and a space?  That's strange.  Is it always like
this, or only in some situations.  Note the following snippet:

int main(int argc, char* argv[])
{
        int a;
        printf("some %string\n",
               argv[0]);
}

Here, the "argv[0]" line will be indented in such a way that it
aligns with the parenthesis above.  This means that the indentation
depends on the length of the function name "printf".  For example, if
it was "fprintf", then the indentation would be one column more.

Further, Emacs uses an optimum mix of tabs and spaces to achieve the
desired indentation.  In the above example, the argv[0] line needs to
be indented 15 columns, and since a tab is eight columns wide, the
optimum mix is one tab and 7 spaces.

This behavior can be controlled with the variable indent-tabs-mode.
Type M-x customize-variable RET indent-tabs-mode RET to change it.
If indent-tabs-mode is nil (off, false), then Emacs will use 15
spaces instead of 1 tab plus 7 spaces in the above case -- Emacs will
never use tabs for indentation when indent-tabs-mode is off.

Does that explain Emacs' behavior?  Does changing indent-tabs-mode
achieve what you want?
-- 
This line is not blank.

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

* Minibuffer and Dabbrev problems
  2003-06-16 19:52       ` jinneemop
@ 2003-06-16 12:36         ` K T Ligesh
  2003-06-16 13:17         ` replace TAB with 8 whitespaces Kai Großjohann
                           ` (2 subsequent siblings)
  3 siblings, 0 replies; 19+ messages in thread
From: K T Ligesh @ 2003-06-16 12:36 UTC (permalink / raw)




Greetings,

 I am a new convert to the Church of Emacs; 10 days ago I was a hardcore Vim User. June 6th is a momentous day for me...

 But I am facing certain problems with Emacs.

 1) Minibuffer Error Messages:

  When I move around in the minibuffer, I get error messages like "End of History" and the message persists for a few seconds which is extremely irritating. I searched and found that the error messages are -built into- the search-previous-history commands etc..

  Is there anyway I can change it to a simple (ding)... I know I can redefine the whole function, but is there any other way?

  I could redifine the "error" function but I couldn't find a way to 'return' smoothly out of a lisp function. Is that the standard way?

  Those error messages are really screwing up my brain. Sort of like speedbreakers that block my flow of thought.. So I would like some help before I go completely insane... 


 2) My spite with Dabbrev is a little more complex..

 Is there a way to get the "PREVIOUS" Match in Dabbrev? 
 
 M-/ circulates through the matchlist in the forward direction, but since I am person who types faster than my eyes (Or my brain) can follow (And hence I catch the match only after it has been replaced by the next one), I need a mechanism to backtrack to the previous match of the Dabbrev..

 Again after reading the bloody function, I couldn't figure out a simple way to implement this..

 VIm's abbrev (C-n, C-p) mechanism can go in BOTH directions.

 Any help would be greatly appreciated... 

 Thanks in advance


--
:: Ligesh :: http://ligesh.com :: http://lxlabs.com :: 

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

* Re: replace TAB with 8 whitespaces
  2003-06-13  7:00 ` Kai Großjohann
@ 2003-06-16 12:51   ` jinneemop
  2003-06-16  7:26     ` Kai Großjohann
  0 siblings, 1 reply; 19+ messages in thread
From: jinneemop @ 2003-06-16 12:51 UTC (permalink / raw)


On Fri, 13 Jun 2003 09:00:26 +0200, Kai Großjohann wrote:

> "jinneemop" <jinneemop@isee.zju.edu> writes:
> 
>> I wish to use 8 spaces to indent source code under c++ mode. 
>> When I press TAB, I'd like emacs to insert 8 spaces instead.
> 
> What does Emacs currently do?
> 
> [ ] Inserts tab instead of 8 spaces.
> [ ] Inserts N spaces instead of 8 spaces.  N = ___
> [ ] Emacs crashes
> [x] Something interesting, please specify: It seems like one tab 
and one space.

[ I am a newbie. ]

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

* Re: replace TAB with 8 whitespaces
  2003-06-16 19:52       ` jinneemop
  2003-06-16 12:36         ` Minibuffer and Dabbrev problems K T Ligesh
@ 2003-06-16 13:17         ` Kai Großjohann
  2003-06-16 13:53         ` Stefan Monnier
       [not found]         ` <mailman.7972.1055767014.21513.help-gnu-emacs@gnu.org>
  3 siblings, 0 replies; 19+ messages in thread
From: Kai Großjohann @ 2003-06-16 13:17 UTC (permalink / raw)


"jinneemop" <jinneemop@sohu.com> writes:

> Thanks a lot. 
> I add (setq indent-tabs-mode nil) to .emacs, and Emacs uses no 
> tabs. But it inserts only 2 spaces!
> Then I add this (googled from internet) to .emacs:
>     (defun my-c++-mode-hook ()
>       (c-set-style "k&r")
>       (setq tab-width 8)
>       (setq c-basic-offset 8)
>       (define-key c++-mode-map "\C-m" 'reindent-then-newline-and-indent)
>       (define-key c++-mode-map "\C-ce" 'c-comment-edit)
>       (setq c++-auto-hungry-initial-state 'none)
>       (setq c++-delete-function 'backward-delete-char)
>       (setq c++-tab-always-indent t)
>       (setq c-indent-level 8)
>       (setq c-continued-statement-offset 8)
>       (setq c++-empty-arglist-indent 8))
>     (add-hook 'c++-mode-hook 'my-c++-mode-hook)
> It works.

That's good :-)

> But becase I konw little about lisp, it is Greek to me. :-( How can
> I start to learn lisp?

There is an Emacs Lisp Introduction.  It is part of the development
version of Emacs, I think, but also available on ftp.gnu.org and its
mirrors.

Maybe it would have worked to use M-x customize-variable RET to set
c-default-style and c-basic-offset.  That would have been simple and
would not have required Lisp knowledge.
-- 
This line is not blank.

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

* Re: replace TAB with 8 whitespaces
  2003-06-16 19:52       ` jinneemop
  2003-06-16 12:36         ` Minibuffer and Dabbrev problems K T Ligesh
  2003-06-16 13:17         ` replace TAB with 8 whitespaces Kai Großjohann
@ 2003-06-16 13:53         ` Stefan Monnier
       [not found]         ` <mailman.7972.1055767014.21513.help-gnu-emacs@gnu.org>
  3 siblings, 0 replies; 19+ messages in thread
From: Stefan Monnier @ 2003-06-16 13:53 UTC (permalink / raw)


> I add (setq indent-tabs-mode nil) to .emacs, and Emacs uses no 

This will only apply to the current buffer in which it is executed,
which is typically the *scratch* buffer.  You probably want to either
put it on a hook or use (setq-default indent-tabs-mode nil) such that
it applies to every buffer.
Also I recommend staying away from (setq tab-width N) because it
probably doesn't do what you think it does.


        Stefan

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

* Re: Minibuffer and Dabbrev problems
       [not found]         ` <mailman.7972.1055767014.21513.help-gnu-emacs@gnu.org>
@ 2003-06-16 15:11           ` Kai Großjohann
  2003-06-16 17:25             ` Johan Bockgård
  2003-06-17 17:39           ` Kevin Rodgers
  1 sibling, 1 reply; 19+ messages in thread
From: Kai Großjohann @ 2003-06-16 15:11 UTC (permalink / raw)


K T Ligesh <ligesh@lxlabs.com> writes:

>  Is there a way to get the "PREVIOUS" Match in Dabbrev? 

C-h k M-/ tells you how.
-- 
This line is not blank.

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

* Re: Minibuffer and Dabbrev problems
  2003-06-16 15:11           ` Minibuffer and Dabbrev problems Kai Großjohann
@ 2003-06-16 17:25             ` Johan Bockgård
  2003-06-16 23:02               ` K T Ligesh
  0 siblings, 1 reply; 19+ messages in thread
From: Johan Bockgård @ 2003-06-16 17:25 UTC (permalink / raw)


kai.grossjohann@gmx.net (Kai Großjohann) writes:

> K T Ligesh <ligesh@lxlabs.com> writes:
>
>>  Is there a way to get the "PREVIOUS" Match in Dabbrev?
>
> C-h k M-/ tells you how.

Actually, I think the OP wants to know how to go back when he has
"cycled to far".

Pressing M-/ inserts text in the buffer. Just use undo.

-- 
The day Microsoft makes something that doesn't suck is probably the
day they start making vacuum cleaners. -- Ernst Jan Plugge

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

* Re: replace TAB with 8 whitespaces
  2003-06-16  7:26     ` Kai Großjohann
@ 2003-06-16 19:52       ` jinneemop
  2003-06-16 12:36         ` Minibuffer and Dabbrev problems K T Ligesh
                           ` (3 more replies)
  0 siblings, 4 replies; 19+ messages in thread
From: jinneemop @ 2003-06-16 19:52 UTC (permalink / raw)


On Mon, 16 Jun 2003 09:26:43 +0200, Kai Großjohann wrote:

> It inserts a tab and a space?  That's strange.  Is it always like
> this, or only in some situations.  Note the following snippet:
> 
> int main(int argc, char* argv[])
> {
>         int a;
>         printf("some %string\n",
>                argv[0]);
> }
> 
> Here, the "argv[0]" line will be indented in such a way that it
> aligns with the parenthesis above.  This means that the indentation
> depends on the length of the function name "printf".  For example, if
> it was "fprintf", then the indentation would be one column more.
> 
> Further, Emacs uses an optimum mix of tabs and spaces to achieve the
> desired indentation.  In the above example, the argv[0] line needs to
> be indented 15 columns, and since a tab is eight columns wide, the
> optimum mix is one tab and 7 spaces.
> 
> This behavior can be controlled with the variable indent-tabs-mode.
> Type M-x customize-variable RET indent-tabs-mode RET to change it.
> If indent-tabs-mode is nil (off, false), then Emacs will use 15
> spaces instead of 1 tab plus 7 spaces in the above case -- Emacs will
> never use tabs for indentation when indent-tabs-mode is off.
> 
> Does that explain Emacs' behavior?  Does changing indent-tabs-mode
> achieve what you want?

Thanks a lot. 
I add (setq indent-tabs-mode nil) to .emacs, and Emacs uses no 
tabs. But it inserts only 2 spaces!
Then I add this (googled from internet) to .emacs:
    (defun my-c++-mode-hook ()
      (c-set-style "k&r")
      (setq tab-width 8)
      (setq c-basic-offset 8)
      (define-key c++-mode-map "\C-m" 'reindent-then-newline-and-indent)
      (define-key c++-mode-map "\C-ce" 'c-comment-edit)
      (setq c++-auto-hungry-initial-state 'none)
      (setq c++-delete-function 'backward-delete-char)
      (setq c++-tab-always-indent t)
      (setq c-indent-level 8)
      (setq c-continued-statement-offset 8)
      (setq c++-empty-arglist-indent 8))
    (add-hook 'c++-mode-hook 'my-c++-mode-hook)
It works.  But becase I konw little about lisp, 
it is Greek to me. :-(
How can I start to learn lisp?

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

* Re: Minibuffer and Dabbrev problems
  2003-06-16 17:25             ` Johan Bockgård
@ 2003-06-16 23:02               ` K T Ligesh
  0 siblings, 0 replies; 19+ messages in thread
From: K T Ligesh @ 2003-06-16 23:02 UTC (permalink / raw)
  Cc: help-gnu-emacs

On Mon, Jun 16, 2003 at 07:25:21PM +0200, Johan Bockg?rd wrote:
>      kai.grossjohann@gmx.net (Kai Gro?johann) writes:
>      
>      > K T Ligesh <ligesh@lxlabs.com> writes:
>      >
>      >>  Is there a way to get the "PREVIOUS" Match in Dabbrev?
>      >
>      > C-h k M-/ tells you how.
>      
>      Actually, I think the OP wants to know how to go back when he has
>      "cycled to far".
>      

 Yeah, that's it. Actually I was using viper package and hence undo worked only -after- you came into the escape mode.

 But I think -that- is the solution.... So I have to map the <C-p> key to some kind of Undo I guess.

 thanks..

--
:: Ligesh :: http://ligesh.com :: http://lxlabs.com :: 

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

* Re: Minibuffer and Dabbrev problems
       [not found]         ` <mailman.7972.1055767014.21513.help-gnu-emacs@gnu.org>
  2003-06-16 15:11           ` Minibuffer and Dabbrev problems Kai Großjohann
@ 2003-06-17 17:39           ` Kevin Rodgers
  2003-06-18 12:11             ` K T Ligesh
       [not found]             ` <mailman.8150.1055940540.21513.help-gnu-emacs@gnu.org>
  1 sibling, 2 replies; 19+ messages in thread
From: Kevin Rodgers @ 2003-06-17 17:39 UTC (permalink / raw)


K T Ligesh wrote:

>  1) Minibuffer Error Messages:
> 
>   When I move around in the minibuffer, I get error messages like "End
>   of History" and the message persists for a few seconds which is
>   extremely irritating. I searched and found that the error messages
>   are -built into- the search-previous-history commands etc..

You don't have to wait; the message will disappear as soon you type
something.

>   Is there anyway I can change it to a simple (ding)... I know I can
>   redefine the whole function, but is there any other way?

Nope.

>   I could redifine the "error" function but I couldn't find a way to
>   'return' smoothly out of a lisp function. Is that the standard way?

`error' is the standard way to fail to return.  See the "Errors" node of
the Emacs Lisp manual.

>   Those error messages are really screwing up my brain. Sort of like
>   speedbreakers that block my flow of thought.. So I would like some
>   help before I go completely insane...

Relax, have a home brew.


-- 
<a href="mailto:&lt;kevin.rodgers&#64;ihs.com&gt;">Kevin Rodgers</a>

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

* Re: Minibuffer and Dabbrev problems
  2003-06-17 17:39           ` Kevin Rodgers
@ 2003-06-18 12:11             ` K T Ligesh
       [not found]             ` <mailman.8150.1055940540.21513.help-gnu-emacs@gnu.org>
  1 sibling, 0 replies; 19+ messages in thread
From: K T Ligesh @ 2003-06-18 12:11 UTC (permalink / raw)
  Cc: help-gnu-emacs

On Tue, Jun 17, 2003 at 11:39:53AM -0600, Kevin Rodgers wrote:
>      K T Ligesh wrote:
>      
>      > 1) Minibuffer Error Messages:
>      >
>      >  When I move around in the minibuffer, I get error messages like "End
>      >  of History" and the message persists for a few seconds which is
>      >  extremely irritating. I searched and found that the error messages
>      >  are -built into- the search-previous-history commands etc..



 You mean, you cannot 'return' from a function without generating an error message? Elisp doesn't have a straight 'return' statement?


>      >  Those error messages are really screwing up my brain. Sort of like
>      >  speedbreakers that block my flow of thought.. So I would like some
>      >  help before I go completely insane...
>      
>      Relax, have a home brew.

 Actually coming from the vim world, all these error messages are sort of strange. For a person used to just a beep, after some time, these messages can get into your head.

 There should be some option for advanced users to turn off -all- error messages; they do cause certain discomfort. But I guess, that is not trivially possible. I will just have to rewrite those functions without those error messages...  That will mean a lot of rewrite though....

 I noticed Emacs does not try to be Keyboard efficient. Pressing 2 <C-s> to get to the next match seems almost preposterous to me. (In vim it is just an 'n' - the difference is huge) Yeah, but I guess it all depends on your view point...

 Currently I am trying to implement incremental search into Viper search... As I said earlier, 2 <C-s> are too much for me..

 Could somebody give me a -SIMPLE- incremental search code. The one with package is too complex for me - I am just a 12 day old toddler.

 And I am repeating one of my previous requests here..

 Can I map <C-d> to generate a <C-c>. It is not about -define-key-... I need to map keys one step below that... When I press <C-d> I want the upper layers (mainly the elisp modules) to think that I have pressed <C-c>. Otherwise I will have to go around and remap the <C-c> in -every- module...


 Thanks for all the help...


--
:: Ligesh :: http://ligesh.com :: http://lxlabs.com :: 

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

* Re: Minibuffer and Dabbrev problems
       [not found]             ` <mailman.8150.1055940540.21513.help-gnu-emacs@gnu.org>
@ 2003-06-18 16:33               ` Kai Großjohann
  2003-06-18 19:29                 ` Stefan Monnier
  2003-06-18 23:30               ` Kevin Rodgers
  1 sibling, 1 reply; 19+ messages in thread
From: Kai Großjohann @ 2003-06-18 16:33 UTC (permalink / raw)


K T Ligesh <ligesh@lxlabs.com> writes:

>  You mean, you cannot 'return' from a function without generating an
>  error message? Elisp doesn't have a straight 'return' statement?

Well, there are catch and throw.  But most of the time it is easier
to just use if or cond or something like this.

If you (require 'cl), then you can use defun* which creates an
implicit block that you can return from, as I understand.  Or maybe
CL redefines defun to create such a block?  I'm not sure.

>  Actually coming from the vim world, all these error messages are
>  sort of strange. For a person used to just a beep, after some time,
>  these messages can get into your head.
>
>  There should be some option for advanced users to turn off -all-
>  error messages; they do cause certain discomfort. But I guess, that
>  is not trivially possible. I will just have to rewrite those
>  functions without those error messages...  That will mean a lot of
>  rewrite though....
>
>  I noticed Emacs does not try to be Keyboard efficient. Pressing 2
>  <C-s> to get to the next match seems almost preposterous to me. (In
>  vim it is just an 'n' - the difference is huge) Yeah, but I guess
>  it all depends on your view point...
>
>  Currently I am trying to implement incremental search into Viper
>  search... As I said earlier, 2 <C-s> are too much for me..

Amazing.  I never considered this.  But you can do (global-set-key
(kbd "<f3>") (kbd "C-s C-s")) and then you can hit <f3> instead.

Hm.  And probably (define-key isearch-mode-map (kbd "<f3>")
'isearch-repeat-forward) would be useful, as well.

>  Could somebody give me a -SIMPLE- incremental search code. The one
>  with package is too complex for me - I am just a 12 day old
>  toddler.

I think it's because incremental search is inherently difficult.

>  And I am repeating one of my previous requests here..
>
>  Can I map <C-d> to generate a <C-c>. It is not about
>  -define-key-... I need to map keys one step below that... When I
>  press <C-d> I want the upper layers (mainly the elisp modules) to
>  think that I have pressed <C-c>. Otherwise I will have to go around
>  and remap the <C-c> in -every- module...

See function keyboard-translate.

-- 
This line is not blank.

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

* Re: Minibuffer and Dabbrev problems
  2003-06-18 16:33               ` Kai Großjohann
@ 2003-06-18 19:29                 ` Stefan Monnier
  0 siblings, 0 replies; 19+ messages in thread
From: Stefan Monnier @ 2003-06-18 19:29 UTC (permalink / raw)


>> Actually coming from the vim world, all these error messages are
>> sort of strange. For a person used to just a beep, after some time,
>> these messages can get into your head.

Have you ever heard of "the standard text editor" ?
See etc/JOKES,


        Stefan

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

* Re: Minibuffer and Dabbrev problems
       [not found]             ` <mailman.8150.1055940540.21513.help-gnu-emacs@gnu.org>
  2003-06-18 16:33               ` Kai Großjohann
@ 2003-06-18 23:30               ` Kevin Rodgers
  1 sibling, 0 replies; 19+ messages in thread
From: Kevin Rodgers @ 2003-06-18 23:30 UTC (permalink / raw)


K T Ligesh wrote:

>  You mean, you cannot 'return' from a function without generating an
>  error message? Elisp doesn't have a straight 'return' statement?

Yes.  But the Common Lisp emulaton library has both `return' and `return-from'.

Just add this to your .emacs file:

(require 'cl)


>  Actually coming from the vim world, all these error messages are sort
>  of strange. For a person used to just a beep, after some time, these
>  messages can get into your head.

See http://www.dina.dk/~abraham/religion/poor-mans-vi-mode.html

>  There should be some option for advanced users to turn off -all-
>  error messages; they do cause certain discomfort. But I guess, that
>  is not trivially possible. I will just have to rewrite those
>  functions without those error messages...  That will mean a lot of
>  rewrite though....

Why don't you just rewrite/advise the `error' and/or `signal' function?
(See the "Signalling Errors" node of the Emacs Lisp manual.)


-- 
<a href="mailto:&lt;kevin.rodgers&#64;ihs.com&gt;">Kevin Rodgers</a>

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

end of thread, other threads:[~2003-06-18 23:30 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-06-12 16:49 replace TAB with 8 whitespaces jinneemop
2003-06-12 17:19 ` Henrik Enberg
2003-06-12 17:26 ` Alan Mackenzie
2003-06-12 17:34 ` Peter J. Acklam
2003-06-13  7:00 ` Kai Großjohann
2003-06-16 12:51   ` jinneemop
2003-06-16  7:26     ` Kai Großjohann
2003-06-16 19:52       ` jinneemop
2003-06-16 12:36         ` Minibuffer and Dabbrev problems K T Ligesh
2003-06-16 13:17         ` replace TAB with 8 whitespaces Kai Großjohann
2003-06-16 13:53         ` Stefan Monnier
     [not found]         ` <mailman.7972.1055767014.21513.help-gnu-emacs@gnu.org>
2003-06-16 15:11           ` Minibuffer and Dabbrev problems Kai Großjohann
2003-06-16 17:25             ` Johan Bockgård
2003-06-16 23:02               ` K T Ligesh
2003-06-17 17:39           ` Kevin Rodgers
2003-06-18 12:11             ` K T Ligesh
     [not found]             ` <mailman.8150.1055940540.21513.help-gnu-emacs@gnu.org>
2003-06-18 16:33               ` Kai Großjohann
2003-06-18 19:29                 ` Stefan Monnier
2003-06-18 23:30               ` 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).