From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Stefan Huchler Newsgroups: gmane.emacs.help Subject: Re: special-mode buffer changes to fundamental when modified Date: Sun, 23 Oct 2016 18:47:23 +0200 Message-ID: <877f8zui5g.fsf@jupiter.lan> References: <87wph3n4d7.fsf@jupiter.lan> <87twc79gsa.fsf@web.de> <87eg3bhtcm.fsf@jupiter.lan> <87wph2j7e3.fsf@web.de> <877f911bnm.fsf@jupiter.lan> <87lgxfl2bf.fsf@web.de> <87lgxfusra.fsf@jupiter.lan> <87bmybkp7u.fsf@web.de> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1477250069 4466 195.159.176.226 (23 Oct 2016 19:14:29 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 23 Oct 2016 19:14:29 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun Oct 23 21:14:25 2016 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1byODi-0007Vq-GE for geh-help-gnu-emacs@m.gmane.org; Sun, 23 Oct 2016 21:14:10 +0200 Original-Received: from localhost ([::1]:42126 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1byODk-0007jo-RW for geh-help-gnu-emacs@m.gmane.org; Sun, 23 Oct 2016 15:14:12 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:37625) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1byLwP-0007Qf-Dr for help-gnu-emacs@gnu.org; Sun, 23 Oct 2016 12:48:10 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1byLwK-0007yw-Hz for help-gnu-emacs@gnu.org; Sun, 23 Oct 2016 12:48:09 -0400 Original-Received: from [195.159.176.226] (port=40712 helo=blaine.gmane.org) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1byLwK-0007ys-BL for help-gnu-emacs@gnu.org; Sun, 23 Oct 2016 12:48:04 -0400 Original-Received: from list by blaine.gmane.org with local (Exim 4.84_2) (envelope-from ) id 1byLvv-0005Up-Cg for help-gnu-emacs@gnu.org; Sun, 23 Oct 2016 18:47:39 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 49 Original-X-Complaints-To: usenet@blaine.gmane.org Cancel-Lock: sha1:iHkMmi8jBYwoPOwYNjRX3mn1WhY= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 195.159.176.226 X-Mailman-Approved-At: Sun, 23 Oct 2016 15:13:39 -0400 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.org gmane.emacs.help:111604 Archived-At: Michael Heerdegen writes: > Stefan Huchler writes: > >> condition-case: Buffer is read-only: # > > 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 :)