From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Joost Kremers Newsgroups: gmane.emacs.help Subject: Re: Clearning a keymap completely Date: 9 Sep 2016 09:04:28 GMT Message-ID: References: NNTP-Posting-Host: blaine.gmane.org X-Trace: blaine.gmane.org 1473411942 26119 195.159.176.226 (9 Sep 2016 09:05:42 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 9 Sep 2016 09:05:42 +0000 (UTC) User-Agent: slrn/1.0.1 (Linux) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Sep 09 11:05:36 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 1biHkZ-0005aj-I9 for geh-help-gnu-emacs@m.gmane.org; Fri, 09 Sep 2016 11:05:31 +0200 Original-Received: from localhost ([::1]:56714 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1biHkX-0007k5-J8 for geh-help-gnu-emacs@m.gmane.org; Fri, 09 Sep 2016 05:05:29 -0400 Original-Path: usenet.stanford.edu!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 25 Original-X-Trace: individual.net TrPO57eDOVyaW3lQujad8QXoIlQj2FNDDR8L/ndVnhqKapgpVS Cancel-Lock: sha1:lrlQ7JYub4y6M3fBFf7bfIITUMg= Mail-Copies-To: nobody X-Editor: Emacs of course! Original-Xref: usenet.stanford.edu gnu.emacs.help:218920 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:111321 Archived-At: Narendra Joshi wrote: > I need to remove all the self-insert commands in a buffer. I want to > be able to insert text into the buffer through emacs lisp but don't > want the user to be able to insert text. How can this be done? Easiest way is to set the buffer to read-only, then whenever you want to insert text programmatically, do: ``` (let ((inhibit-read-only t)) (insert-text) ...) ``` You can of course use a keymap that binds every normal key to `nil`, but you'll have to install it in such a way that it actually overrides all other keymaps in that buffer. You'd have to read up on keymaps in the Elisp manual to learn how to do that. -- Joost Kremers joostkremers@fastmail.fm Selbst in die Unterwelt dringt durch Spalten Licht EN:SiS(9)