help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: special-mode buffer changes to fundamental when modified


From: Michael Heerdegen
Subject: Re: special-mode buffer changes to fundamental when modified
Date: Thu, 20 Oct 2016 17:33:25 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux)

Stefan Huchler <address@hidden> writes:

> I try something like that:
>
>
> (define-derived-mode foo-mode special-mode "foo"
>   
>   (with-current-buffer-window "*foo*" nil nil
>    (print (concat "...:\n"
>                 (substitute-command-keys
>                  "\\{foo-mode-map}") ))
>    ) 
>   )

That looks very strange.  A mode definition should not make a particular
buffer current.  It should work in any (current) buffer where the mode
is enabled.

> but then its no special mode buffer anymore, and it overwrites my
> keymaps. Without the with-current-buffer-window macro it works it
> supposed to be but the buffer is empty.

Hard to guess what you want to do.  Maybe you confuse `print' with
`insert' or something else?

> I tried I think most with- macros and nothing worked, not very obvious
> for me how to write stuff in a special buffer.

In Emacs, trial and error doesn't work most of the time, you'll get
always "error" ;-)


Michael.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]