Hello mark-end-of-buffer (beginning) is defined in simple.el and it
looks sort of complicated
(defun mark-end-of-buffer (&optional arg)
"Push a mark at the end of the buffer; leave point where it is.
With arg N, push mark N/10 of the way from the true end."
(interactive "P")
(push-mark (if arg
(- (1+ (buffer-size))
(if (> (buffer-size) 10000)
;; Avoid overflow for large buffer sizes!
(* (prefix-numeric-value arg)
(/ (buffer-size) 10))
(/ (* (buffer-size) (prefix-numeric-value arg)) 10)))
(point-max))
nil
t))
Now GNU emacs has a much simpler solution.
(defun mark-beginning-of-buffer ()
"Set mark at the beginning of the buffer."
(interactive)
(push-mark (point-min)))
(defun mark-end-of-buffer ()
"Set mark at the end of the buffer."
(interactive)
(push-mark (point-max)))
It does not make the region visible, so I think a more comfortable solution
should be:
(defun mark-beginning-of-buffer ()
"Set mark at the beginning of the buffer."
(interactive)
(push-mark (point-min) nil t ))
(defun mark-end-of-buffer ()
"Set mark at the end of the buffer."
(interactive)
(push-mark (point-max) nil t))
In any case what is the reason that our version is so complicated?
Maybe it is from a time, when Xemacs had difficulties with large
buffers?
Thanks
Uwe Brauer
_______________________________________________
XEmacs-Beta mailing list
XEmacs-Beta(a)xemacs.org
http://lists.xemacs.org/mailman/listinfo/xemacs-beta