branch: externals/doc-toc commit e6e20d2d65c6a65cd930bf6b2f2e80b22a63ebf4 Author: Daniel Nicolai <dalanico...@gmail.com> Commit: Daniel Nicolai <dalanico...@gmail.com>
Implement shift all remaining numbers and follow/preview --- README.org | 8 +++++--- toc-mode.el | 12 ++++++++++++ 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/README.org b/README.org index 0d17d4ba6e..437c314577 100644 --- a/README.org +++ b/README.org @@ -87,11 +87,13 @@ buffer can be navigated with the arrow =up/down= keys. The =left= and =right= ar keys will shift =down/up= all the page numbers from the current line and below (combine with =SHIFT= for setting individual pagenumbers). -The =TAB= key jumps to the pagenumber of the current line. =S-up/S-donw= in the -tablist window will scroll page up/down in the document window while, only for pdf, =C-up/C-down= +The =TAB= key jumps to the pagenumber of the current line, while =C-right/C-left= +will shift all remaining page numbers up/down while jumping/scrolling to the +line its page in the document window. to the =S-up/S-donw= in the tablist window +will just scroll page up/down in the document window and, only for pdf, =C-up/C-down= will scroll smoothly in that window. -For type =C-c C-c= when done. +Type =C-c C-c= when done. ** 4. TOC-mode (add outline to document) The text of this buffer should have the right structure for adding the contents diff --git a/toc-mode.el b/toc-mode.el index a1201ab731..0455bd38c1 100644 --- a/toc-mode.el +++ b/toc-mode.el @@ -307,6 +307,16 @@ Use with the universal argument (C-u) omits cleanup to get the unprocessed text. ((string= ".djvu" ext) (djvu-goto-page page))) (other-window 1))) +(defun toc-increase-remaining-and-follow () + (interactive) + (toc-increase-remaining) + (toc-tablist-follow)) + +(defun toc-decrease-remaining-and-follow () + (interactive) + (toc-decrease-remaining) + (toc-tablist-follow)) + (defun toc-scroll-other-window-page-up () (interactive) (other-window 1) @@ -341,6 +351,8 @@ Use with the universal argument (C-u) omits cleanup to get the unprocessed text. (define-key map [left] 'toc-decrease-remaining) (define-key map [S-right] 'toc-increase) (define-key map [S-left] 'toc-decrease) + (define-key map [C-right] 'toc-increase-remaining-and-follow) + (define-key map [C-left] 'toc-decrease-remaining-and-follow) (define-key map [tab] 'toc-tablist-follow) (define-key map [S-down] 'toc-scroll-other-window-page-up) (define-key map [S-up] 'toc-scroll-other-window-page-down)