summaryrefslogtreecommitdiff
path: root/local
diff options
context:
space:
mode:
authorQuentin Aristote <quentin@aristote.fr>2021-11-20 14:46:54 +0100
committerQuentin Aristote <quentin@aristote.fr>2021-11-20 14:46:54 +0100
commitf3b1ec76c7d202bfe1adccfe0ebceed4735cd285 (patch)
treea92072623607f74999ff06d4eb7c1af414ddc0d6 /local
parent0ed4cfd85520cf3e0472ca2726909e2cb2c2e474 (diff)
clean-quote adds a leading 0 to single digit numbers
Diffstat (limited to 'local')
-rw-r--r--local/bibli-paris/bibli-paris.el25
1 files changed, 18 insertions, 7 deletions
diff --git a/local/bibli-paris/bibli-paris.el b/local/bibli-paris/bibli-paris.el
index d7a7e69..27adac2 100644
--- a/local/bibli-paris/bibli-paris.el
+++ b/local/bibli-paris/bibli-paris.el
@@ -174,14 +174,25 @@ date if borrowed and set to the maximum unix date if unavailable."
(org-schedule '(4)))))
-(defun bibli-paris/clean-quote (quote)
+(defun bibli-paris/clean-quote (entry-quote)
"Remove extra whitespace from and uniformizes the quote QUOTE."
- (let ((blank "[[:blank:]\r\n]+"))
- (string-trim (replace-regexp-in-string
- "BD EN RESERVE" "EN RESERVE BD"
- (replace-regexp-in-string blank " " quote t t)
- t t)
- blank blank)))
+ (let ((blank "[[:blank:]\r\n]+")
+ (result entry-quote))
+ (setq result (replace-regexp-in-string blank " " result))
+ (message result)
+ (setq result (string-trim result blank blank))
+ (message result)
+ (setq result (replace-regexp-in-string
+ "BD EN RESERVE"
+ "EN RESERVE BD"
+ result
+ t t))
+ (message result)
+ (setq result (replace-regexp-in-string
+ "\\([^0-9/]\\)\\([0-9]\\)\\($\\|\/\\)"
+ "\\10\\2\\3"
+ result))
+ result))
(defun bibli-paris/update-entry-quote-from (holding)
"Update entry quote according to HOLDING (hash-tbl) the holding data of the