diff options
| author | Justin Timmons | 2020-04-17 06:00:19 +0200 |
|---|---|---|
| committer | Stefan Kangas | 2020-04-17 06:26:43 +0200 |
| commit | 763ec05cc17973134c440f2d0afb6eb5d095d0d4 (patch) | |
| tree | 2ae2b9e4eefbdfc88bf281016137063090086623 /lisp | |
| parent | be77a68d527223f7f276e94e16fe05b49846c7a3 (diff) | |
| download | emacs-763ec05cc17973134c440f2d0afb6eb5d095d0d4.tar.gz emacs-763ec05cc17973134c440f2d0afb6eb5d095d0d4.zip | |
Bind 'n' and 'p' to move between symbols in apropos
* lisp/apropos.el (apropos-next-symbol)
(apropos-previous-symbol): New commands.
(apropos-mode-map): Bind above commands to 'n' and 'p'. (Bug#20694)
* etc/NEWS: Announce the new commands.
Diffstat (limited to 'lisp')
| -rw-r--r-- | lisp/apropos.el | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/lisp/apropos.el b/lisp/apropos.el index 23f70d10fd4..7277319cd89 100644 --- a/lisp/apropos.el +++ b/lisp/apropos.el | |||
| @@ -160,6 +160,10 @@ If value is `verbose', the computed score is shown for each match." | |||
| 160 | ;; definition of RET, so that users can use it anywhere in an | 160 | ;; definition of RET, so that users can use it anywhere in an |
| 161 | ;; apropos item, not just on top of a button. | 161 | ;; apropos item, not just on top of a button. |
| 162 | (define-key map "\C-m" 'apropos-follow) | 162 | (define-key map "\C-m" 'apropos-follow) |
| 163 | |||
| 164 | ;; Movement keys | ||
| 165 | (define-key map "n" 'apropos-next-symbol) | ||
| 166 | (define-key map "p" 'apropos-previous-symbol) | ||
| 163 | map) | 167 | map) |
| 164 | "Keymap used in Apropos mode.") | 168 | "Keymap used in Apropos mode.") |
| 165 | 169 | ||
| @@ -1270,6 +1274,21 @@ as a heading." | |||
| 1270 | (or (apropos-next-label-button (line-beginning-position)) | 1274 | (or (apropos-next-label-button (line-beginning-position)) |
| 1271 | (error "There is nothing to follow here")))) | 1275 | (error "There is nothing to follow here")))) |
| 1272 | 1276 | ||
| 1277 | (defun apropos-next-symbol () | ||
| 1278 | "Move cursor down to the next symbol in an apropos-mode buffer." | ||
| 1279 | (interactive) | ||
| 1280 | (forward-line) | ||
| 1281 | (while (and (not (eq (face-at-point) 'apropos-symbol)) | ||
| 1282 | (< (point) (point-max))) | ||
| 1283 | (forward-line))) | ||
| 1284 | |||
| 1285 | (defun apropos-previous-symbol () | ||
| 1286 | "Move cursor back to the last symbol in an apropos-mode buffer." | ||
| 1287 | (interactive) | ||
| 1288 | (forward-line -1) | ||
| 1289 | (while (and (not (eq (face-at-point) 'apropos-symbol)) | ||
| 1290 | (> (point) (point-min))) | ||
| 1291 | (forward-line -1))) | ||
| 1273 | 1292 | ||
| 1274 | (defun apropos-describe-plist (symbol) | 1293 | (defun apropos-describe-plist (symbol) |
| 1275 | "Display a pretty listing of SYMBOL's plist." | 1294 | "Display a pretty listing of SYMBOL's plist." |