[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Difference between 'C-x e' and 'M-x macro'
From: |
Stefan Monnier |
Subject: |
Re: Difference between 'C-x e' and 'M-x macro' |
Date: |
16 Jul 2003 15:35:42 -0400 |
User-agent: |
Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50 |
> My question is: why? What's the difference between 'C-x e' and 'M-x
> upmacro?'
Lots of things. Some macros (like `previous-line' bound to `up') use
variables like `last-command' or `this-command' to determine the
name under which they are being run or which was the previous
command executed. In your case, the second `upmacro' thinks that the
command executed just before was not `previous-line' but
something like `execute-extended-command' (bound to M-x) or maybe
`minibuffer-complete-and-exit' (bound to RET in the minibuffer
while entering the M-x thingy) so it behaves differently.
> Believe it or not, this difference effects an elisp program I'm
> currently working on. Thanks,
The docstring for `forward-line' says:
If you are thinking of using this in a Lisp program, consider using
`forward-line' with a negative argument instead. It is usually easier
to use and more reliable (no dependence on goal column, etc.).
Stefan