[Top][All Lists]

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

Re: special-mode buffer changes to fundamental when modified

From: Stefan Huchler
Subject: Re: special-mode buffer changes to fundamental when modified
Date: Thu, 20 Oct 2016 18:34:49 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux)

Michael Heerdegen <> writes:

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

Again I used first other methods like with-temp-buffer and stuff like
that, but it always either dont insert the stuff I want, or it changes
the mode of the buffer to fundamental mode.

>> 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 used first princ or prin1 doesnt fix it. If I try insert, it tells me
that its read only.

I dont confuse it, just in the source of other mode, people often if not
always use something like with-temp-buffer to insert content there.

I want to have some text in the new buffer, thats what I want to do.

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

Yes because of that, I wrote this question, else I would gone more try &

The try and error were some sort of last resort, cause the api
documentation is pretty bad on this aspect.

Also there are no simple examples out there too, the real
"documentation" you get to develop such modes is looking the source of
other modes.

And they are often very complex, I dont know every of the 5000 elisp
functions so its hard to read that often very complex code, when I only
want to make pretty simple stuff.

So insert does not work, too, including toggle-read-only before that
(nor is it meant to be used in source). its not that I gone for strange
with-*-buffer functions because it was the obvious way to do so, its
because insert does not work for read-only-buffers and people use this
with-* constructs in similar buffers/modes apperently for that purpose.

reply via email to

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