diff options
| -rw-r--r-- | lisp/eshell/em-prompt.el | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/lisp/eshell/em-prompt.el b/lisp/eshell/em-prompt.el index 8c81b43b1fa..2fd1db2113d 100644 --- a/lisp/eshell/em-prompt.el +++ b/lisp/eshell/em-prompt.el | |||
| @@ -161,14 +161,25 @@ If N is negative, find the previous or Nth previous match." | |||
| 161 | "Move to end of Nth next prompt in the buffer. | 161 | "Move to end of Nth next prompt in the buffer. |
| 162 | See `eshell-prompt-regexp'." | 162 | See `eshell-prompt-regexp'." |
| 163 | (interactive "p") | 163 | (interactive "p") |
| 164 | (forward-paragraph n) | 164 | (if eshell-highlight-prompt |
| 165 | (progn | ||
| 166 | (while (< n 0) | ||
| 167 | (while (and (re-search-backward eshell-prompt-regexp nil t) | ||
| 168 | (not (get-text-property (match-beginning 0) 'read-only)))) | ||
| 169 | (setq n (1+ n))) | ||
| 170 | (while (> n 0) | ||
| 171 | (while (and (re-search-forward eshell-prompt-regexp nil t) | ||
| 172 | (not (get-text-property (match-beginning 0) 'read-only)))) | ||
| 173 | (setq n (1- n)))) | ||
| 174 | (re-search-forward eshell-prompt-regexp nil t n)) | ||
| 165 | (eshell-skip-prompt)) | 175 | (eshell-skip-prompt)) |
| 166 | 176 | ||
| 167 | (defun eshell-previous-prompt (n) | 177 | (defun eshell-previous-prompt (n) |
| 168 | "Move to end of Nth previous prompt in the buffer. | 178 | "Move to end of Nth previous prompt in the buffer. |
| 169 | See `eshell-prompt-regexp'." | 179 | See `eshell-prompt-regexp'." |
| 170 | (interactive "p") | 180 | (interactive "p") |
| 171 | (eshell-next-prompt (- (1+ n)))) | 181 | (beginning-of-line) ; Don't count prompt on current line. |
| 182 | (eshell-next-prompt (- n))) | ||
| 172 | 183 | ||
| 173 | (defun eshell-skip-prompt () | 184 | (defun eshell-skip-prompt () |
| 174 | "Skip past the text matching regexp `eshell-prompt-regexp'. | 185 | "Skip past the text matching regexp `eshell-prompt-regexp'. |