Dryd’c ruf ed’c tuha

master
trémeur 3 years ago
parent a470a4a297
commit 445ce3d029

@ -0,0 +1,142 @@
(defun replace-pairs-region (Begin End Pairs) ;; modified xah
(let ((case-fold-search nil) ($tempMapPoints nil) ($changeLog nil))
(dotimes (i (length Pairs)) (push (char-to-string (+ #xe000 i)) $tempMapPoints))
(save-excursion
(save-restriction
(narrow-to-region Begin End)
(dotimes (i (length Pairs))
(goto-char (point-min))
(while (search-forward (elt (elt Pairs i) 0) nil t)
(replace-match (elt $tempMapPoints i) t t)))
(dotimes (i (length Pairs))
(goto-char (point-min))
(while (search-forward (elt $tempMapPoints i) nil t)
(push (vector (point)
(elt (elt Pairs i) 0)
(elt (elt Pairs i) 1)) $changeLog)
(replace-match (elt (elt Pairs i) 1) t t)))))
$changeLog))
(defun al-bhed (*begin *end)
(interactive
(if (use-region-p)
(list (region-beginning) (region-end))
(list (line-beginning-position) (line-end-position))))
(replace-pairs-region
*begin
*end
'(
["a" "y"]
["b" "p"]
["c" "l"]
["d" "t"]
["e" "a"]
["f" "v"]
["g" "k"]
["h" "r"]
["i" "e"]
["j" "z"]
["k" "g"]
["l" "m"]
["m" "s"]
["n" "h"]
["o" "u"]
["p" "b"]
["q" "x"]
["r" "n"]
["s" "c"]
["t" "d"]
["u" "i"]
["v" "j"]
["w" "f"]
["x" "q"]
["y" "o"]
["z" "w"]
["A" "Y"]
["B" "P"]
["C" "L"]
["D" "T"]
["E" "A"]
["F" "V"]
["G" "K"]
["H" "R"]
["I" "E"]
["J" "Z"]
["K" "G"]
["L" "M"]
["M" "S"]
["N" "H"]
["O" "U"]
["P" "B"]
["Q" "X"]
["R" "N"]
["S" "C"]
["T" "D"]
["U" "I"]
["V" "J"]
["W" "F"]
["X" "Q"]
["Y" "O"]
["Z" "W"])))
(defun de-al-bhed (*begin *end)
(interactive
(if (use-region-p)
(list (region-beginning) (region-end))
(list (line-beginning-position) (line-end-position))))
(replace-pairs-region
*begin
*end
'(
["y" "a"]
["p" "b"]
["l" "c"]
["t" "d"]
["a" "e"]
["v" "f"]
["k" "g"]
["r" "h"]
["e" "i"]
["z" "j"]
["g" "k"]
["m" "l"]
["s" "m"]
["h" "n"]
["u" "o"]
["b" "p"]
["x" "q"]
["n" "r"]
["c" "s"]
["d" "t"]
["i" "u"]
["j" "v"]
["f" "w"]
["q" "x"]
["o" "y"]
["w" "z"]
["Y" "A"]
["P" "B"]
["L" "C"]
["T" "D"]
["A" "E"]
["V" "F"]
["K" "G"]
["R" "H"]
["E" "I"]
["Z" "J"]
["G" "K"]
["M" "L"]
["S" "M"]
["H" "N"]
["U" "O"]
["B" "P"]
["X" "Q"]
["N" "R"]
["C" "S"]
["D" "T"]
["I" "U"]
["J" "V"]
["F" "W"]
["Q" "X"]
["O" "Y"]
["W" "Z"])))
Loading…
Cancel
Save