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

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

Re: hit end-of-buffer key twice, now where was I?


From: Kevin Rodgers
Subject: Re: hit end-of-buffer key twice, now where was I?
Date: Tue, 12 Oct 2004 10:31:17 -0600
User-agent: Mozilla/5.0 (X11; U; SunOS i86pc; en-US; rv:0.9.4.1) Gecko/20020406 Netscape6/6.2.2

Dan Jacobson wrote:
> Hit the key you bind to end-of-buffer twice by accident.  Notice how
> now exchange-point-and-mark will not get you back to where you were.

C-x C-x
C-u C-SPC
C-u C-SPC

> There ought to be boob protection. Same for beginning-of-buffer.
> "Who would ever need to store a mark if the distance is 0?" perhaps?

Only boobs need boob protection:

(defadvice end-of-buffer (around eob-disable activate)
  "When called interactively at the end of the buffer, do nothing.
This prevents the mark from being reset."
  (or (and (interactive-p) (eobp))
      ad-do-it))

(defadvice beginning-of-buffer (around bob-disable activate)
  "When called interactively at the beginning of the buffer, do nothing.
This prevents the mark from being reset."
  (or (and (interactive-p) (bobp))
      ad-do-it))

--
Kevin Rodgers





reply via email to

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