diff options
| author | Richard M. Stallman | 1993-12-23 03:47:06 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1993-12-23 03:47:06 +0000 |
| commit | 5590a2242892b8ab542d71fa71c486b581e62dbd (patch) | |
| tree | 1ddb7f12267bc3830799aa16f0551d7bf330b30e /lisp | |
| parent | 9b9f9c9dc1dde419f18ad2509b1e523bfb19ed05 (diff) | |
| download | emacs-5590a2242892b8ab542d71fa71c486b581e62dbd.tar.gz emacs-5590a2242892b8ab542d71fa71c486b581e62dbd.zip | |
(reposition-window): Fix whitespace-skipping regexp.
(reposition-window): Don't err if comment-height = 0.
Don't repeat at load time any bindings that are autoloaded.
Diffstat (limited to 'lisp')
| -rw-r--r-- | lisp/reposition.el | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/lisp/reposition.el b/lisp/reposition.el index 0dda524f079..f7285c80826 100644 --- a/lisp/reposition.el +++ b/lisp/reposition.el | |||
| @@ -71,13 +71,13 @@ first comment line visible (if point is in a comment)." | |||
| 71 | ;; the beginning of the preceding comment | 71 | ;; the beginning of the preceding comment |
| 72 | (save-excursion | 72 | (save-excursion |
| 73 | (if (not (eobp)) (forward-char 1)) | 73 | (if (not (eobp)) (forward-char 1)) |
| 74 | (end-of-defun -1) | 74 | (end-of-defun -1) |
| 75 | ;; Skip whitespace, newlines, and form feeds. | 75 | ;; Skip whitespace, newlines, and form feeds. |
| 76 | (re-search-forward "[^\\s \n\014]") | 76 | (if (re-search-forward "[^ \t\n\f]" nil t) |
| 77 | (backward-char 1) | 77 | (backward-char 1)) |
| 78 | (point)) | 78 | (point)) |
| 79 | here))) | 79 | here))) |
| 80 | (defun-height | 80 | (defun-height |
| 81 | (repos-count-screen-lines-signed | 81 | (repos-count-screen-lines-signed |
| 82 | (save-excursion | 82 | (save-excursion |
| 83 | (end-of-defun 1) ; so comments associate with following defuns | 83 | (end-of-defun 1) ; so comments associate with following defuns |
| @@ -119,16 +119,16 @@ first comment line visible (if point is in a comment)." | |||
| 119 | ;; whose first line is offscreen. | 119 | ;; whose first line is offscreen. |
| 120 | ;; Avoid moving definition up even if defun runs offscreen; | 120 | ;; Avoid moving definition up even if defun runs offscreen; |
| 121 | ;; we care more about getting the comment onscreen. | 121 | ;; we care more about getting the comment onscreen. |
| 122 | 122 | ||
| 123 | (cond ((= line ht) | 123 | (cond ((= line ht) |
| 124 | ;; cursor on last screen line (and so in a comment) | 124 | ;; cursor on last screen line (and so in a comment) |
| 125 | (if arg (progn (end-of-defun) (beginning-of-defun))) | 125 | (if arg (progn (end-of-defun) (beginning-of-defun))) |
| 126 | (recenter 0) | 126 | (recenter 0) |
| 127 | ;;(repos-debug-macro "2a") | 127 | ;;(repos-debug-macro "2a") |
| 128 | ) | 128 | ) |
| 129 | 129 | ||
| 130 | ;; This condition, copied from case 4, may not be quite right | 130 | ;; This condition, copied from case 4, may not be quite right |
| 131 | 131 | ||
| 132 | ((and arg (< ht comment-height)) | 132 | ((and arg (< ht comment-height)) |
| 133 | ;; Can't get first comment line onscreen. | 133 | ;; Can't get first comment line onscreen. |
| 134 | ;; Go there and try again. | 134 | ;; Go there and try again. |
| @@ -169,8 +169,7 @@ first comment line visible (if point is in a comment)." | |||
| 169 | ;;(repos-debug-macro "4") | 169 | ;;(repos-debug-macro "4") |
| 170 | )))) | 170 | )))) |
| 171 | 171 | ||
| 172 | ;;;###autoload | 172 | ;;;###autoload (define-key esc-map "\C-l" 'reposition-window) |
| 173 | (define-key esc-map "\C-l" 'reposition-window) | ||
| 174 | 173 | ||
| 175 | ;;; Auxiliary functions | 174 | ;;; Auxiliary functions |
| 176 | 175 | ||