[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/doc-toc b1a843fd6f 57/84: Implement roman-to-arabic and
From: |
ELPA Syncer |
Subject: |
[elpa] externals/doc-toc b1a843fd6f 57/84: Implement roman-to-arabic and add pdf djvu keybindings |
Date: |
Mon, 26 Sep 2022 13:58:38 -0400 (EDT) |
branch: externals/doc-toc
commit b1a843fd6f8406c2f24f957182f9d79537fc84f9
Author: Daniel Nicolai <dalanicolai@gmail.com>
Commit: Daniel Nicolai <dalanicolai@gmail.com>
Implement roman-to-arabic and add pdf djvu keybindings
---
toc-mode.el | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)
diff --git a/toc-mode.el b/toc-mode.el
index 50d8c7409f..fc75873842 100644
--- a/toc-mode.el
+++ b/toc-mode.el
@@ -164,6 +164,7 @@
(require 'djvu nil t)
(require 'evil nil t)
(require 'seq)
+(require 'rst)
;; List of declarations to eliminate byte-compile errors
(defvar djvu-doc-image)
@@ -261,6 +262,18 @@ Like `toc--cleanup-dots' but more suited for use after OCR"
(goto-char (point-min))
(flush-lines "^ *$"))
+(defun toc--roman-to-arabic (count)
+ (interactive "p")
+ (dotimes (_x count)
+ (move-end-of-line 1)
+ (let ((latin (number-to-string
+ (rst-roman-to-arabic
+ (thing-at-point 'word t)))))
+ (backward-word)
+ (kill-word 1)
+ (insert latin)
+ (forward-line))))
+
(defun toc--join-next-unnumbered-lines ()
"Search from point for first occurence of line not ending with Western
numerals."
(interactive)
@@ -480,10 +493,16 @@ Prompt for startpage and endpage and print OCR output to
new buffer."
;;;; toc major modes
+(define-key pdf-view-mode-map (kbd "C-c C-e") 'toc-extract-pages)
+(define-key djvu-read-mode-map (kbd "C-c C-e") 'toc-extract-pages)
+(define-key pdf-view-mode-map (kbd "C-c e") 'toc-extract-pages-ocr)
+(define-key djvu-read-mode-map (kbd "C-c e") 'toc-extract-pages-ocr)
+
(defvar toc-cleanup-mode-map
(let ((map (make-sparse-keymap)))
(define-key map "\C-c\C-c" #'toc--create-tablist-buffer)
(define-key map "\C-c\C-j" #'toc--join-next-unnumbered-lines)
+ (define-key map "\C-c\C-s" #'toc--roman-to-arabic)
map))
(define-derived-mode toc-cleanup-mode
- [elpa] externals/doc-toc c521029525 36/84: Change (beginning-og-buffer) to (goto-char (point-min)) for MELPA, (continued)
- [elpa] externals/doc-toc c521029525 36/84: Change (beginning-og-buffer) to (goto-char (point-min)) for MELPA, ELPA Syncer, 2022/09/26
- [elpa] externals/doc-toc a1d26eceb5 37/84: Add defvar and declare-function to avoid warning MELPA, ELPA Syncer, 2022/09/26
- [elpa] externals/doc-toc 05cd1287f1 42/84: Fix toc--add-to-djvu. Don't ask save location., ELPA Syncer, 2022/09/26
- [elpa] externals/doc-toc f430243a88 43/84: Add version: 0 header, ELPA Syncer, 2022/09/26
- [elpa] externals/doc-toc 59f4471e6a 50/84: Update README.org, ELPA Syncer, 2022/09/26
- [elpa] externals/doc-toc 2d95c466a3 48/84: Add MELPA and GPL3 badges, ELPA Syncer, 2022/09/26
- [elpa] externals/doc-toc 734043bdc7 47/84: Improve documentation in toc-mode.el, ELPA Syncer, 2022/09/26
- [elpa] externals/doc-toc ae455b4863 52/84: Implement language customization for OCR, ELPA Syncer, 2022/09/26
- [elpa] externals/doc-toc 23e1fb2fde 54/84: Implement HandyOutliner option, ELPA Syncer, 2022/09/26
- [elpa] externals/doc-toc b45b78102c 55/84: Update README, add extract-only documentation, ELPA Syncer, 2022/09/26
- [elpa] externals/doc-toc b1a843fd6f 57/84: Implement roman-to-arabic and add pdf djvu keybindings,
ELPA Syncer <=
- [elpa] externals/doc-toc 719f6a03a7 64/84: Return page text when pdfxmeta fails, ELPA Syncer, 2022/09/26
- [elpa] externals/doc-toc dd1dfd83ac 63/84: Fix docstrings and warnings for MELPA, ELPA Syncer, 2022/09/26
- [elpa] externals/doc-toc 7e2e6be947 69/84: Update/improve README, ELPA Syncer, 2022/09/26
- [elpa] externals/doc-toc 782d0cd6b5 80/84: Update README.org, ELPA Syncer, 2022/09/26
- [elpa] externals/doc-toc 977bec00d8 74/84: Tiny bug fix in toc--tablist-to-handyoutliner, ELPA Syncer, 2022/09/26
- [elpa] externals/doc-toc 448a0ac00c 82/84: Small fixes before release on ELPA (fix compiler warnings), ELPA Syncer, 2022/09/26