[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: How to make `M-<' not set mark?
From: |
Rupert Swarbrick |
Subject: |
Re: How to make `M-<' not set mark? |
Date: |
Sun, 05 Oct 2008 12:28:26 +0100 |
User-agent: |
Gnus/5.110011 (No Gnus v0.11) Emacs/22.2 (gnu/linux) |
Rodolfo Medina <rodolfo.medina@gmail.com> writes:
> Normally, the `M-<' and `M->' commands automatically set a new mark.
> How can I prevent that?
>
> Thanks for any help
> Rodolfo
Well, C-h f M-< gives:
-----
beginning-of-buffer is an interactive compiled Lisp function in `simple.el'.
It is bound to <begin>, <C-home>, M-<.
(beginning-of-buffer &optional ARG)
Move point to the beginning of the buffer; leave mark at previous position.
With C-u prefix, do not set mark at previous position.
With numeric arg N, put point N/10 of the way from the beginning.
If the buffer is narrowed, this command uses the beginning and size
of the accessible part of the buffer.
Don't use this command in Lisp programs!
(goto-char (point-min)) is faster and avoids clobbering the mark.
-----
So I'd recommend either hitting C-u beforehand, or (looking at section
21.12 of the elisp manual) do something like
(global-set-key (kbd "M-<")
(lambda () (beginning-of-buffer '(4))))
or indeed
(global-set-key (kbd "M-<")
(lambda () (goto-char (point-min))))
Rupert
pgpbI1GNOZxSj.pgp
Description: PGP signature