Confused by what command is "dot repeatable"

York Zhao gtdplatform at gmail.com
Fri Jul 13 21:31:32 CEST 2012


> sorry for not answering immediately, but I've been on a business trip
> last weak and had simply no time. The same will be true for large
> parts of the next few months so please excuse if responses take some
> time. I'll always try to answer as soon as possible.

Really appreciate that you have taken your valuable time to answer my question,
and your answer have been very useful so far.

> Note that currently repeating only works for commands bound to
> some key-bindings, calling them via M-x COMMAND RET may fail.

Yes, you are right, I never binded these functions to any key, I used "M-x". And
if I bind my command "bar" to a key the dot repeating works. What I still don't
understand however, is that "M-x foo" is dot repeatable but not "M-x bar".

> So please provide a complete example (full function definition, key
> sequences, ...), preferably starting from a fresh emacs instance, that
> demonstrates the problem. Otherwise it is really hard to isolate the
> problem.

Here's the scenario:

First, in "scratch" buffer, input the following:

(defun york-bar ()
  (interactive)
  (save-excursion
    (insert "printf(\"checkpoint\")")))

Type "C-M-x" to instrument the command `york-bar'.

Then open a file in c++-mode and "M-x york-bar", "printf()" function
call gets inserted.

Hit ".", but nothing wouldn't get inserted again.

> The mode *should* not make difference ...

Yes, I've tried "M-x york-bar" in an org-mode buffer and got the same results.

On the other hand, the command `york-foo' which is dot repeatable even when
being executed by "M-x", is way more complicated, I have tried to isolate it but
failed, it had been tightly "connected" with my other part of configuration
files (huge).

The bottom line is, however, `york-bar' is dot repeatable if having it binded to
some key. Thanks again for the help.

York



More information about the implementations-list mailing list