comparison lisp/simple.el @ 76295:d84c0ae58cc7

(beginning-of-buffer, end-of-buffer): Avoid treating plain C-u like numeric arg. (completion-setup-function): Don't set default-directory to nil.
author Richard M. Stallman <rms@gnu.org>
date Sun, 04 Mar 2007 17:48:56 +0000
parents f4e68d81c310
children 386921c38a15
comparison
equal deleted inserted replaced
76294:24e13e715a20 76295:d84c0ae58cc7
756 ;; Avoid overflow for large buffer sizes! 756 ;; Avoid overflow for large buffer sizes!
757 (* (prefix-numeric-value arg) 757 (* (prefix-numeric-value arg)
758 (/ size 10)) 758 (/ size 10))
759 (/ (+ 10 (* size (prefix-numeric-value arg))) 10))) 759 (/ (+ 10 (* size (prefix-numeric-value arg))) 10)))
760 (point-min)))) 760 (point-min))))
761 (if arg (forward-line 1))) 761 (if (and arg (not (consp arg))) (forward-line 1)))
762 762
763 (defun end-of-buffer (&optional arg) 763 (defun end-of-buffer (&optional arg)
764 "Move point to the end of the buffer; leave mark at previous position. 764 "Move point to the end of the buffer; leave mark at previous position.
765 With \\[universal-argument] prefix, do not set mark at previous position. 765 With \\[universal-argument] prefix, do not set mark at previous position.
766 With numeric arg N, put point N/10 of the way from the end. 766 With numeric arg N, put point N/10 of the way from the end.
783 (/ size 10)) 783 (/ size 10))
784 (/ (* size (prefix-numeric-value arg)) 10))) 784 (/ (* size (prefix-numeric-value arg)) 10)))
785 (point-max)))) 785 (point-max))))
786 ;; If we went to a place in the middle of the buffer, 786 ;; If we went to a place in the middle of the buffer,
787 ;; adjust it to the beginning of a line. 787 ;; adjust it to the beginning of a line.
788 (cond (arg (forward-line 1)) 788 (cond ((and arg (not (consp arg))) (forward-line 1))
789 ((> (point) (window-end nil t)) 789 ((> (point) (window-end nil t))
790 ;; If the end of the buffer is not already on the screen, 790 ;; If the end of the buffer is not already on the screen,
791 ;; then scroll specially to put it near, but not at, the bottom. 791 ;; then scroll specially to put it near, but not at, the bottom.
792 (overlay-recenter (point)) 792 (overlay-recenter (point))
793 (recenter -3)))) 793 (recenter -3))))
5086 ;; When reading a file name in the minibuffer, 5086 ;; When reading a file name in the minibuffer,
5087 ;; set default-directory in the minibuffer 5087 ;; set default-directory in the minibuffer
5088 ;; so it will get copied into the completion list buffer. 5088 ;; so it will get copied into the completion list buffer.
5089 (if minibuffer-completing-file-name 5089 (if minibuffer-completing-file-name
5090 (with-current-buffer mainbuf 5090 (with-current-buffer mainbuf
5091 (setq default-directory (file-name-directory mbuf-contents)))) 5091 (setq default-directory (or (file-name-directory mbuf-contents)
5092 default-directory))))
5092 (with-current-buffer standard-output 5093 (with-current-buffer standard-output
5093 (completion-list-mode) 5094 (completion-list-mode)
5094 (set (make-local-variable 'completion-reference-buffer) mainbuf) 5095 (set (make-local-variable 'completion-reference-buffer) mainbuf)
5095 (setq completion-base-size 5096 (setq completion-base-size
5096 (cond 5097 (cond