-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathdiogenes-legacy.el
52 lines (43 loc) · 1.61 KB
/
diogenes-legacy.el
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
;;; diogenes-legacy.el --- Lisp utilities for diogenes.el -*- lexical-binding: t -*-
;; Copyright (C) 2024 Michael Neidhart
;;
;; Author: Michael Neidhart <[email protected]>
;; Keywords: classics, tools, philology, humanities
;;; Commentary:
;; Some legacy post-processing functions
;;; Code:
;;;###autoload
(defun diogenes-delete-line-numbers ()
"Delete line numbers, starting at point"
(interactive)
(save-excursion
(let ((start (progn
(unless
(re-search-backward
"\([[:digit:]][[:digit:]][[:digit:]][[:digit:]]: [[:digit:]][[:digit:]][[:digit:]]\)"
nil t)
(re-search-forward
"\([[:digit:]][[:digit:]][[:digit:]][[:digit:]]: [[:digit:]][[:digit:]][[:digit:]]\)"))
(re-search-forward "^$")
(point)))
(end (progn
;; (goto-char (point-max))
(unless
(re-search-forward "diogenes-browse finished" nil t)
(goto-char (point-max)))
(re-search-backward "[Α‐ω]")
(beginning-of-line)
(forward-char 14)
(point))))
(delete-rectangle start end))))
;;;###autoload
(defun diogenes-tidy-up-search-results ()
"Post-processes search results of diogenes"
(interactive)
(save-excursion
(goto-char (point-min))
(diogenes-unhyphen-greek)
(goto-char (point-min))
(replace-regexp "->\\([[:alpha:]]*\\)<-\\([[:alpha:]]*\\)" "-> \\1\\2 -<")))
(provide 'diogenes-legacy)
;;; diogenes-legacy.el ends here