From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: bojohan+news@dd.chalmers.se (Johan =?utf-8?Q?Bockg=C3=A5rd?=) Newsgroups: gmane.emacs.devel,gmane.emacs.pretest.bugs Subject: Re: hexl: doesn't play nicely with dynamic-completion-mode Date: Thu, 13 Sep 2007 10:26:54 +0200 Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: sea.gmane.org 1189672066 18606 80.91.229.12 (13 Sep 2007 08:27:46 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 13 Sep 2007 08:27:46 +0000 (UTC) Cc: emacs-pretest-bug@gnu.org To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Sep 13 10:27:45 2007 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1IVk36-0000l2-O3 for ged-emacs-devel@m.gmane.org; Thu, 13 Sep 2007 10:27:45 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IVk36-0003qt-9Q for ged-emacs-devel@m.gmane.org; Thu, 13 Sep 2007 04:27:44 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1IVk2z-0003oR-W5 for emacs-devel@gnu.org; Thu, 13 Sep 2007 04:27:38 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1IVk2y-0003n2-LK for emacs-devel@gnu.org; Thu, 13 Sep 2007 04:27:37 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IVk2y-0003mo-CX for emacs-devel@gnu.org; Thu, 13 Sep 2007 04:27:36 -0400 Original-Received: from main.gmane.org ([80.91.229.2] helo=ciao.gmane.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1IVk2x-0004is-Ue for emacs-devel@gnu.org; Thu, 13 Sep 2007 04:27:36 -0400 Original-Received: from list by ciao.gmane.org with local (Exim 4.43) id 1IVk2f-0000e8-SU for emacs-devel@gnu.org; Thu, 13 Sep 2007 10:27:17 +0200 Original-Received: from gamma02.me.chalmers.se ([129.16.50.72]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 13 Sep 2007 10:27:17 +0200 Original-Received: from bojohan+news by gamma02.me.chalmers.se with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 13 Sep 2007 10:27:17 +0200 X-Injected-Via-Gmane: http://gmane.org/ Mail-Followup-To: emacs-devel@gnu.org Original-Lines: 26 Original-X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: gamma02.me.chalmers.se Mail-Copies-To: never User-Agent: Gnus/5.110007 (No Gnus v0.7) Emacs/22.1.50 (gnu/linux) Cancel-Lock: sha1:PR6Nwml2VueYejMgptZjGZZADto= X-Detected-Kernel: Linux 2.6, seldom 2.4 (older, 4) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:78751 gmane.emacs.pretest.bugs:19869 Archived-At: Stefan Monnier writes: >>> hexl-mode should probably install a before-change-function that checks that >>> this-command is among the supported ones. This won't fix those problems, >>> but will at least catch them before they corrupt the buffer. > >> Is there some way for a before-change-function to prevent a change? >> It can call 'error to prevent the change once, but this clears the >> before-change-function handler, so the 'bad' key won't be caught >> a 2nd time. > > Good point. Not only it clears this function but any other > before-change-functions as well, so it's clearly undesirable. Hmm.... pre-command-hook can be used to divert commands on the fly. I don't know if this solves your problem. ;; Example (defun foo () (when (eq this-command 'self-insert-command) (setq this-command 'ignore))) (add-hook 'pre-command-hook 'foo nil t) -- Johan Bockgård