all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: bojohan+news@dd.chalmers.se (Johan Bockgård)
To: emacs-devel@gnu.org
Cc: emacs-pretest-bug@gnu.org
Subject: Re: hexl: doesn't play nicely with dynamic-completion-mode
Date: Thu, 13 Sep 2007 10:26:54 +0200	[thread overview]
Message-ID: <yoijlkbbj7ht.fsf@gamma02.me.chalmers.se> (raw)
In-Reply-To: jwvhcm2wa47.fsf-monnier+emacs@gnu.org

Stefan Monnier <monnier@iro.umontreal.ca> 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

      reply	other threads:[~2007-09-13  8:26 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <m2r6tcu25g.fsf@gmail.com>
2007-09-08 14:47 ` hexl: doesn't play nicely with dynamic-completion-mode Chris Moore
     [not found]   ` <E1IUCIj-0000B4-Rz@fencepost.gnu.org>
2007-09-09 18:01     ` Chris Moore
2007-09-10  1:13       ` Richard Stallman
2007-09-10 11:35         ` Chris Moore
2007-09-10 14:14           ` Stefan Monnier
2007-09-10 18:43             ` Chris Moore
2007-09-10 20:20               ` Stefan Monnier
2007-09-13  8:26                 ` Johan Bockgård [this message]

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=yoijlkbbj7ht.fsf@gamma02.me.chalmers.se \
    --to=bojohan+news@dd.chalmers.se \
    --cc=emacs-devel@gnu.org \
    --cc=emacs-pretest-bug@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.