help-gnu-emacs
[Top][All Lists]
Advanced

[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 18:09:28 +0100
User-agent: Gnus/5.110011 (No Gnus v0.11) Emacs/22.2 (gnu/linux)

Rodolfo Medina <rodolfo.medina@gmail.com> writes:
> I copied the definition of `beginning-of-buffer' from the file simple.el and
> commented out the part related to mark:
>
<SNIP>
>
> , then bound `M-<' to the new definition:
>
> (global-set-key (kbd "M-<") 'my-beginning-of-buffer)
>
>
> .  It seems to work all right.
> Rodolfo

Hmm, a conceptually neater way to me would be something like:

(defun my-beginning-of-buffer (&optional arg)
  (beginning-of-buffer (or arg '(4))))

and setting M-< as you do. However, this does mean that (unlike your
code), the mark is set if you use crazy prefix args to jump back 50% of
the file or whatever.

I guess the question is whether you'd prefer to have a local copy of a
core defun (which I find a bit icky) or to have the desired behaviour
with prefix argument, which I don't think you can get without completely
redefining beginning-of-buffer as you do.

Rupert

Attachment: pgp0QSUmdbJr7.pgp
Description: PGP signature


reply via email to

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