[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/doc-toc 34d16c6c06 07/84: implement pdf navigation from
From: |
ELPA Syncer |
Subject: |
[elpa] externals/doc-toc 34d16c6c06 07/84: implement pdf navigation from TOC-tabular-mode |
Date: |
Mon, 26 Sep 2022 13:58:34 -0400 (EDT) |
branch: externals/doc-toc
commit 34d16c6c06aa3c31421fdc3ade60c5b1dd8ed631
Author: Daniel Nicolai <dalanicolai@gmail.com>
Commit: Daniel Nicolai <dalanicolai@gmail.com>
implement pdf navigation from TOC-tabular-mode
---
README.org | 11 ++++++++---
toc-mode.el | 24 ++++++++++++++++--------
2 files changed, 24 insertions(+), 11 deletions(-)
diff --git a/README.org b/README.org
index 05470ad73e..13bd922066 100644
--- a/README.org
+++ b/README.org
@@ -70,9 +70,14 @@ Type =C-c C-c= when finished
** 3 TOC-tabular (adjust pagenumbers)
This mode provides the functionality for easy adjustment of pagenmumbers. The
-buffer can be navigated with the arrow =up/down= keys. The =left= and =right=
-arrow keys will shift =down/up= all the page numbers from the current line and
-below (combine with =SHIFT= for setting individual pagenumbers).
+buffer can be navigated with the arrow =up/down= keys. The =left= and =right=
arrow
+keys will shift =down/up= all the page numbers from the current line and below
+(combine with =SHIFT= for setting individual pagenumbers).
+
+**** Currently only for pdf's
+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
=C-up/C-down=
+will scroll smoothly in that window.
Type =C-c C-c= when done
diff --git a/toc-mode.el b/toc-mode.el
index ffdc2a817e..979e3fef19 100644
--- a/toc-mode.el
+++ b/toc-mode.el
@@ -51,6 +51,8 @@
(defun toc-cleanup-lines-roman-string (&optional arg)
(interactive)
(beginning-of-buffer)
+ ;; (re-search-forward "^ *[ivx0-9\\.]+ *$" nil t)
+ ;; (replace-match "")
(while (not (eobp))
(re-search-forward "^ *[ivx0-9\\.]* *$")
(replace-match "")
@@ -75,9 +77,9 @@
(replace-match (format "Contents %s" startpage)))
(toc-cleanup-lines-contents-string)
(toc-cleanup-dots)
- (toc-cleanup-lines-roman-string)
+ ;; (toc-cleanup-lines-roman-string)
(toc-cleanup-blank-lines)
- (toc-join-unnumbered-lines)
+ (toc-join-next-unnumbered-lines)
)
(defun get-index-levels (seperator)
@@ -125,9 +127,10 @@
(shell-quote-argument buffer-file-name))))
(buffer (get-buffer-create (file-name-sans-extension (buffer-name)))))
(switch-to-buffer buffer)
+ (toc-cleanup-mode) ;; required before setting local variable
(setq-local doc-buffer source-buffer)
(insert text)
- (kill-whole-line)
+ ;; (kill-whole-line)
))
@@ -136,7 +139,6 @@
Use with the universal argument (C-u) omits cleanup to get the unprocessed
text."
(interactive "nEnter start-pagenumber for extraction: \nnEnter
end-pagenumber for extraction: \nP")
(document-extract-pages-text startpage endpage)
- (toc-cleanup-mode)
(unless arg
(toc-cleanup startpage)))
@@ -157,11 +159,15 @@ Use with the universal argument (C-u) omits cleanup to
get the unprocessed text.
(setq-local doc-buffer source-buffer)
(insert text)))
+(defun toc-create-tablist-buffer ()
+ (interactive)
+ (toc-list doc-buffer))
+
;;;; toc major modes
(defvar toc-cleanup-mode-map
(let ((map (make-sparse-keymap)))
- (define-key map "\C-c\C-c" 'toc-list)
+ (define-key map "\C-c\C-c" 'toc-create-tablist-buffer)
(define-key map "\C-c\C-j" 'toc-join-next-unnumbered-lines)
map))
@@ -249,7 +255,7 @@ Use with the universal argument (C-u) omits cleanup to get
the unprocessed text.
(defun toc-tablist-follow ()
(interactive)
(let ((page (string-to-number (aref (tabulated-list-get-entry) 2))))
- (pop-to-buffer pdf-buffer)
+ (pop-to-buffer doc-buffer)
(pdf-view-goto-page page)
(other-window 1)))
@@ -297,11 +303,13 @@ Use with the universal argument (C-u) omits cleanup to
get the unprocessed text.
(setq-local tabulated-list-format [("level" 10 nil) ("name" 80 nil) ("page"
1 nil)])
(tabulated-list-init-header))
-(defun toc-list ()
+(defun toc-list (buffer)
(interactive)
- (let ((toc-tablist (toc-convert-to-tabulated-list)))
+ (let ((source-buffer buffer)
+ (toc-tablist (toc-convert-to-tabulated-list)))
(switch-to-buffer (concat (buffer-name) ".list"))
(toc-tabular-mode)
+ (setq-local doc-buffer source-buffer)
(setq-local tabulated-list-entries toc-tablist)
(tabulated-list-print)))
- [elpa] branch externals/doc-toc created (now b4bb748aa3), ELPA Syncer, 2022/09/26
- [elpa] externals/doc-toc 7c4eef518e 02/84: initial upload, ELPA Syncer, 2022/09/26
- [elpa] externals/doc-toc fdb66ff587 04/84: delete old file(name) document-outliner, ELPA Syncer, 2022/09/26
- [elpa] externals/doc-toc 4c98932c65 05/84: create first version README, ELPA Syncer, 2022/09/26
- [elpa] externals/doc-toc 32803571a6 06/84: delete README.md, ELPA Syncer, 2022/09/26
- [elpa] externals/doc-toc bcf2348d28 03/84: rename file to toc-mode, ELPA Syncer, 2022/09/26
- [elpa] externals/doc-toc 34d16c6c06 07/84: implement pdf navigation from TOC-tabular-mode,
ELPA Syncer <=
- [elpa] externals/doc-toc 56218310ba 08/84: fix funcitons and update docs for djvu, ELPA Syncer, 2022/09/26
- [elpa] externals/doc-toc b869d9c888 14/84: Update README with tesseract ocr info, ELPA Syncer, 2022/09/26
- [elpa] externals/doc-toc f7aacf7e77 25/84: Set encoding and cleanup linefeeds, ELPA Syncer, 2022/09/26
- [elpa] externals/doc-toc d1cc2e950c 26/84: UPDATE README add extract screencast, ELPA Syncer, 2022/09/26
- [elpa] externals/doc-toc b22f6f0a2d 28/84: add golden-ratio-mode to toc-tablist, ELPA Syncer, 2022/09/26
- [elpa] externals/doc-toc caa066b67d 29/84: Add spell check and correct start pagenumber, ELPA Syncer, 2022/09/26
- [elpa] externals/doc-toc 81f58d0871 35/84: Fix double-dash function names, ELPA Syncer, 2022/09/26
- [elpa] externals/doc-toc 36b7f88d6a 39/84: Declare more functions (for MELPA), ELPA Syncer, 2022/09/26
- [elpa] externals/doc-toc 7208f4a987 40/84: Add featurep checks for publish on MELPA, ELPA Syncer, 2022/09/26
- [elpa] externals/doc-toc 3c7efe78d2 61/84: Implement pdf.tocgen functionality, ELPA Syncer, 2022/09/26