Mercurial > hg > xemacs-beta
comparison lisp/simple.el @ 3361:9fddb79e8a88
[xemacs-hg @ 2006-04-25 19:46:23 by scop]
Add optional buffer arg to goto-line, update next-line-add-newlines docs.
author | scop |
---|---|
date | Tue, 25 Apr 2006 19:46:24 +0000 |
parents | b350e85a2a5e |
children | bd7189f2e967 |
comparison
equal
deleted
inserted
replaced
3360:316fddbf58e2 | 3361:9fddb79e8a88 |
---|---|
897 ;; next-history-element | 897 ;; next-history-element |
898 ;; previous-history-element | 898 ;; previous-history-element |
899 ;; next-complete-history-element | 899 ;; next-complete-history-element |
900 ;; previous-complete-history-element | 900 ;; previous-complete-history-element |
901 | 901 |
902 (defun goto-line (line) | 902 (defun goto-line (line &optional buffer) |
903 "Goto line LINE, counting from line 1 at beginning of buffer." | 903 "Goto line LINE, counting from line 1 at beginning of BUFFER." |
904 (interactive "NGoto line: ") | 904 (interactive "NGoto line: ") |
905 (setq line (prefix-numeric-value line)) | 905 (setq line (prefix-numeric-value line)) |
906 (if buffer | |
907 (let ((window (get-buffer-window buffer))) | |
908 (if window (select-window window) | |
909 (switch-to-buffer-other-window buffer)))) | |
906 (save-restriction | 910 (save-restriction |
907 (widen) | 911 (widen) |
908 (goto-char 1) | 912 (goto-char 1) |
909 (if (eq selective-display t) | 913 (if (eq selective-display t) |
910 (re-search-forward "[\n\C-m]" nil 'end (1- line)) | 914 (re-search-forward "[\n\C-m]" nil 'end (1- line)) |
1962 scroll-up-command | 1966 scroll-up-command |
1963 scroll-down-command" | 1967 scroll-down-command" |
1964 :type 'boolean | 1968 :type 'boolean |
1965 :group 'editing-basics) | 1969 :group 'editing-basics) |
1966 | 1970 |
1967 ;;; After 8 years of waiting ... -sb | 1971 (defcustom next-line-add-newlines nil |
1968 (defcustom next-line-add-newlines nil ; XEmacs | |
1969 "*If non-nil, `next-line' inserts newline when the point is at end of buffer. | 1972 "*If non-nil, `next-line' inserts newline when the point is at end of buffer. |
1970 This behavior used to be the default, and is still default in FSF Emacs. | 1973 This behavior used to be the default, but is now considered an unnecessary and |
1971 We think it is an unnecessary and unwanted side-effect." | 1974 unwanted side-effect." |
1972 :type 'boolean | 1975 :type 'boolean |
1973 :group 'editing-basics) | 1976 :group 'editing-basics) |
1974 | 1977 |
1975 (defcustom shifted-motion-keys-select-region t | 1978 (defcustom shifted-motion-keys-select-region t |
1976 "*If non-nil, shifted motion keys select text, like in MS Windows. | 1979 "*If non-nil, shifted motion keys select text, like in MS Windows. |