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: Sun, 23 Oct 2016 18:47:23 +0200	[thread overview]
Message-ID: <877f8zui5g.fsf@jupiter.lan> (raw)
In-Reply-To: 87bmybkp7u.fsf@web.de

Michael Heerdegen <michael_heerdegen@web.de> writes:

> Stefan Huchler <stefan.huchler@mail.de> writes:
>
>> condition-case: Buffer is read-only: #<killed buffer>
>
> Well, your code behaved differently depending on whether the buffer
> already existed or not.

ahh yes I get that now. cause I should done it not in the mode
activation function but the "open-buffer" function makes sense.

that happens if you look over other code and copy to much I guess :)


> Ok, I used the excerpt you posted and edited it very slightly.  There
> was indeed a problem: `special-mode', from which your mode derived,
> makes the buffer read-only.  So I suggest to bind `inhibit-read-only' to
> ignore the read-only flag, since I assume you want the buffer to stay
> read-only.

Yes thats exactly what I want. so I thought let is to define new
temporary varibbales, but in this case you use that to set a value
temporary? so it goes back to its default nil?

thats neat. so basicly you overwrite the buffer wide variable with a
let-scope wide, and after it it falls back to the buffer-wide?

Nice learned something new.

So basicly the straight forward way is right, I just aperently got
unconsistent results because I did the stuff in the mode-activation
function instead the buffer-open function.

Well then I take it back then its not so much a problem of the
documentiation but a mistake on my part.

Still some more example code especialy for special mode would help,
pointing to other modes as example can be problematic, especialy for
elisp noobs that are not so good in understanding the code.

>
> HTH,
>
> Michael.


Thank you very much, then I will soon release a new version of
kodi-remote :)




  reply	other threads:[~2016-10-23 16:47 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
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 [this message]
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=877f8zui5g.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.