all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stefan Huchler <stefan.huchler@mail.de>
To: help-gnu-emacs@gnu.org
Subject: Re: special-mode buffer changes to fundamental when modified
Date: Thu, 20 Oct 2016 18:34:49 +0200	[thread overview]
Message-ID: <87eg3bhtcm.fsf@jupiter.lan> (raw)
In-Reply-To: 87twc79gsa.fsf@web.de

Michael Heerdegen <michael_heerdegen@web.de> 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 &
error.

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	other threads:[~2016-10-20 16:34 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-20  2:25 special-mode buffer changes to fundamental when modified Stefan Huchler
2016-10-20 15:33 ` Michael Heerdegen
2016-10-20 16:34   ` Stefan Huchler [this message]
2016-10-21 10:58     ` Michael Heerdegen
2016-10-22  0:15       ` Stefan Huchler
2016-10-23 11:41         ` Michael Heerdegen
2016-10-23 12:58           ` Stefan Huchler
2016-10-23 16:24             ` Michael Heerdegen
2016-10-23 16:47               ` Stefan Huchler
2016-10-27 16:59                 ` Michael Heerdegen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87eg3bhtcm.fsf@jupiter.lan \
    --to=stefan.huchler@mail.de \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.