diff options
author | Vasilij Schneidermann <mail@vasilij.de> | 2017-08-31 20:48:51 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-08-31 20:48:51 +0200 |
commit | 8f084382678ec5a7a52d25eb11884658f213e147 (patch) | |
tree | de965ea9c8a75210150743b8fd0bf6af36475b1b | |
parent | f103fc17513e48fe66966a93696ac732b47acd81 (diff) | |
parent | dc3d1c98efeafdc98bec6cfb4c85d589ea042252 (diff) |
Merge pull request #1 from aplaice/master
Add scroll-down command and keybinding
-rw-r--r-- | nov.el | 12 |
1 files changed, 12 insertions, 0 deletions
@@ -312,6 +312,8 @@ Each alist item consists of the identifier and full path.") (define-key map (kbd "M-TAB") 'shr-previous-link) (define-key map (kbd "<backtab>") 'shr-previous-link) (define-key map (kbd "SPC") 'nov-scroll-up) + (define-key map (kbd "S-SPC") 'nov-scroll-down) + (define-key map (kbd "DEL") 'nov-scroll-down) (define-key map (kbd "<home>") 'beginning-of-buffer) (define-key map (kbd "<end>") 'end-of-buffer) map)) @@ -496,6 +498,16 @@ the HTML is rendered with `shr-render-region'." (nov-next-chapter) (scroll-up arg))) +(defun nov-scroll-down (arg) + "Scroll with `scroll-down' or visit previous chapter if at top." + (interactive "P") + (if (and (<= (window-start) (point-min)) + (> nov-documents-index 0)) + (progn + (nov-previous-chapter) + (goto-char (point-max))) + (scroll-down arg))) + (defun nov-visit-relative-file (filename target) "Visit the document as specified by FILENAME and TARGET." (let* ((current-path (cdr (aref nov-documents nov-documents-index))) |