aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xmnpgr.tl22
1 files changed, 21 insertions, 1 deletions
diff --git a/mnpgr.tl b/mnpgr.tl
index 8aaa6ab..1d9d0ec 100755
--- a/mnpgr.tl
+++ b/mnpgr.tl
@@ -34,6 +34,22 @@
"map b \002\r"
"map <space> \006")))
+(defun grave-accent (x)
+ (casequal x
+ ("a" "à")
+ ("e" "è")
+ ("u" "ù")
+ ("A" "À")
+ ("E" "È")
+ ("U" "Ù")
+ (t x)))
+
+(defun acute-accent (x)
+ (casequal x
+ ("e" "é")
+ ("E" "É")
+ (t x)))
+
(defun make-overstrike-filter (put-string-fn)
(let ((cur-mode :norm)
(closer ""))
@@ -50,16 +66,20 @@
(:norm (set closer ""))))
[put-string-fn str]))
(lambda (line)
- (each ((tok (tok #/.\b.(\b.)?/ t line)))
+ (each ((tok (tok #/.\b.(\b.)?(\b.)?/ t line)))
(match-case tok
("")
(`@{x #/ +/}` (output-text x cur-mode))
+ (`@{x #/[eE]/}\b@x\b´\b´` (output-text (acute-accent x) :bold))
+ (`@{x #/[aAeEuU]/}\b@x\b\`\b\`` (output-text (grave-accent x) :bold))
(`_\b@x\b@x` (output-text x :bital))
(`_\b_` (output-text "_"
(if (meq cur-mode :bital :ital)
:ital
:bold)))
(`_\b@x` (output-text x :ital))
+ (`@{x #/[eE]/}\b´` (output-text (acute-accent x) cur-mode))
+ (`@{x #/[aAeEuU]/}\b\`` (output-text (grave-accent x) cur-mode))
(`@x\b@x` (output-text x :bold))
(@else (output-text else :norm))))
(output-text "\n" :norm)))))