[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/doc-toc c86a72abda 12/84: Implement replace original or
From: |
ELPA Syncer |
Subject: |
[elpa] externals/doc-toc c86a72abda 12/84: Implement replace original or ad toc to copy of pdf |
Date: |
Mon, 26 Sep 2022 13:58:34 -0400 (EDT) |
branch: externals/doc-toc
commit c86a72abda454a998d999b0da22435d2a78e6752
Author: Daniel Nicolai <dalanicolai@gmail.com>
Commit: Daniel Nicolai <dalanicolai@gmail.com>
Implement replace original or ad toc to copy of pdf
---
README.org | 9 ++++++---
toc-mode.el | 20 ++++++++++++++++----
2 files changed, 22 insertions(+), 7 deletions(-)
diff --git a/README.org b/README.org
index 413f316a51..598540dabf 100644
--- a/README.org
+++ b/README.org
@@ -72,7 +72,7 @@ contain a structure like
1 Chapter 1 1
Section 1 2
#+END_SRC
-Here the indentation can be set with ~M-x replace-regexp~ ~^[^0-9]~ -> ~\&~
(where
+Here the indentation can be set with =M-x replace-regexp= ~^[^0-9]~ -> ~\&~
(where
there is a space character before the ~\&~).
Type =C-c C-c= when finished
@@ -96,5 +96,8 @@ to (for pdf's a copy of) the original document. Final
adjusments can be done but
should not be necessary. For pdf just type =C-c C-c= for adding the contents
to the
document. For djvu type =M-x toc-add-to-djvu=.
-For pdf the a file =pdfwithtoc.pdf= is created in the same folder as the
original
-pdf. For djvu, the TOC is simply added to the original djvu file.
+By default, the TOC is simply added to the original file. ONLY FOR PDF's, if
the
+(customizable) variable ~toc-replace-original-file~ is ~nil~, then the TOC is
added
+to a copy of the original pdf file with path as defined by the variable
+~toc-destination-file-name~, where either a relative path to the original file
+directory or an absolute path can be given.
diff --git a/toc-mode.el b/toc-mode.el
index 3dc2dba2a2..09947d9e2e 100644
--- a/toc-mode.el
+++ b/toc-mode.el
@@ -24,10 +24,19 @@
;;; Code:
+(defgroup toc-mode nil
+ "Setting for the toc-mode package")
+(defcustom toc-replace-original-file t
+ "For PDF include TOC and replace old PDF file.
+For DJVU the old DJVU file is replaced by default"
+ :type 'boolean
+ :group 'toc-mode)
-(provide 'document-outliner)
-;;; document-outliner.el ends here
+(defcustom toc-destination-file-name "pdfwithtoc.pdf"
+ "Filename for new PDF if toc-replace-original-file is nil"
+ :type 'file
+ :group 'toc-mode)
;;;; toc-extract and cleanup
@@ -385,7 +394,9 @@ Use with the universal argument (C-u) omits cleanup to get
the unprocessed text.
(call-process "pdfoutline" nil "*pdfoutline*" nil
(concat (file-name-sans-extension (buffer-name)) ".pdf")
(buffer-name)
- "pdfwithtoc.pdf"))
+ (if toc-replace-original-file
+ (concat (file-name-sans-extension (buffer-name)) ".pdf")
+ toc-destination-file-name)))
(defun toc-add-to-djvu ()
"combine with add-toc-to-djvu in add-toc-to-document when ready"
@@ -447,5 +458,6 @@ Use with the universal argument (C-u) omits cleanup to get
the unprocessed text.
;; (print (mapcar #'(lambda (region) (pdf-info-gettext page region))
(pdf-info-line-regions regions)))))
;; (mapcar '(lambda (region) (pdf-info-gettext page region)) regions)))
-
+(provide 'toc-mode)
+;;; document-outliner.el ends here
- [elpa] externals/doc-toc 56218310ba 08/84: fix funcitons and update docs for djvu, (continued)
- [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
- [elpa] externals/doc-toc c86a72abda 12/84: Implement replace original or ad toc to copy of pdf,
ELPA Syncer <=
- [elpa] externals/doc-toc 0d5ef18820 01/84: Initial commit, ELPA Syncer, 2022/09/26
- [elpa] externals/doc-toc 22174d1a0f 10/84: Update README, ELPA Syncer, 2022/09/26
- [elpa] externals/doc-toc d0cbefb88b 15/84: Update (OCR) requirements with tesseract, ELPA Syncer, 2022/09/26
- [elpa] externals/doc-toc 4ecb3825b9 16/84: Update README, ELPA Syncer, 2022/09/26
- [elpa] externals/doc-toc 5314cd0b2a 17/84: Update README, ELPA Syncer, 2022/09/26
- [elpa] externals/doc-toc e6e20d2d65 20/84: Implement shift all remaining numbers and follow/preview, ELPA Syncer, 2022/09/26
- [elpa] externals/doc-toc a341a6eddc 21/84: Add autoload magic comments and file-header, ELPA Syncer, 2022/09/26
- [elpa] externals/doc-toc 4c49867186 27/84: Fix TOC-tabular mode name and add page-scroll keybinding, ELPA Syncer, 2022/09/26
- [elpa] externals/doc-toc 31611d6e9f 30/84: Update LICENSE, ELPA Syncer, 2022/09/26
- [elpa] externals/doc-toc 8f14a2928e 31/84: Prepare package for publishing on MELPA, ELPA Syncer, 2022/09/26