[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

pre-command-hook not run for DEL

From: David Reitter
Subject: pre-command-hook not run for DEL
Date: Sat, 24 Feb 2007 14:48:43 +0000

Don't know if this is a bug - or if I'm making a mistake:

When the mark is active and a region is selected, pressing DEL (e.g., backward-delete-char-untabify) does not cause the functions in `pre- command-hook' to be run. I would expect them to be run, since DEL is supposed to be bound to an interactive command (see also the documentation of `pre-command-hook').

I used this code to find out what's happening:

(setq dbg-log nil)
(defun test ()
  (setq dbg-log (cons this-command dbg-log)))
(add-hook 'pre-command-hook 'test)

After evaluating this, and selecting a region with the mouse, and pressing DEL (Backspace, actually), the text in the region is deleted. But inspection of `dbg-log' shows that pre-command-hook wasn't run.
When there is no region, it works as expected.

When calling M-x delete-backward-char, `pre-command-hook' is not run, and the region content isn't deleted either.

I'm not running cua-mode or delete-selection-mode or anything like that.

Am I missing something?

In GNU Emacs (powerpc-apple-darwin7.9.0, Carbon Version 1.6.0)
 of 2007-02-14 on rodrigues.inf.ed.ac.uk
X server distributor `Apple Computers', version 10.4.8
configured using `configure  '--without-x' '--prefix=/usr/local''

Important settings:
  value of $LC_ALL: nil
  value of $LC_COLLATE: nil
  value of $LC_CTYPE: nil
  value of $LC_MESSAGES: nil
  value of $LC_MONETARY: nil
  value of $LC_NUMERIC: nil
  value of $LC_TIME: nil
  value of $LANG: nil
  locale-coding-system: iso-8859-1
  default-enable-multibyte-characters: t

Major mode: Lisp Interaction

Minor modes in effect:
  encoded-kbd-mode: t
  tooltip-mode: t
  tool-bar-mode: t
  mouse-wheel-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  unify-8859-on-encoding-mode: t
  utf-translate-cjk-mode: t
  auto-compression-mode: t
  line-number-mode: t
  transient-mark-mode: identity

Recent input:
C-x C-e <right> <down> <down> <left> C-x C-e <down>
C-x C-e <down> <down> <up> <up> <up> <up> <up> C-x
C-e <down-mouse-1> <mouse-1> <backspace> C-h v d b
g - l o g <return> <down-mouse-1> <mouse-1> <down-mouse-1>
<mouse-1> C-x C-e <down-mouse-1> <mouse-1> <double-down-mouse-1>
<double-mouse-1> <backspace> C-h v <up> <return> <help-echo>
<help-echo> <down-mouse-1> <mouse-1> c u a - m o d
e C-x C-e <backspace> <backspace> <backspace> <backspace>
<backspace> <backspace> <backspace> <backspace> p <backspace>
d e l e t e - s e l e c t i o n - m o d e C-x C-e <up>
<help-echo> <menu-bar> <help-menu> <report-emacs-b

Recent messages:
Loading help-fns...done
Loading pp...done
Type C-x 1 to remove help window.
nil [3 times]
Loading emacsbug...
Loading regexp-opt...done
Loading emacsbug...done

reply via email to

[Prev in Thread] Current Thread [Next in Thread]