Update ASAL functions

This commit is contained in:
trémeur 2023-01-28 13:56:46 +00:00
parent 306c253fff
commit eb5399f8a4
5 changed files with 96 additions and 84 deletions

View file

@ -1,38 +1,50 @@
(defun org-format ()
(interactive)
(goto-char (region-beginning))
(goto-char (point-min))
(while (re-search-forward " -" nil t)
(replace-match " "))
(goto-char (region-beginning))
(goto-char (point-min))
(while (re-search-forward " " nil t)
(replace-match " "))
(goto-char (region-beginning))
(goto-char (point-min))
(while (re-search-forward "/ " nil t)
(replace-match " /"))
(goto-char (region-beginning))
(goto-char (point-min))
(while (re-search-forward " \\.\\.\\." nil t)
(replace-match ""))
(goto-char (region-beginning))
(goto-char (point-min))
(while (re-search-forward "" nil t)
(replace-match " …"))
(goto-char (region-beginning))
(goto-char (point-min))
(while (re-search-forward "'" nil t)
(replace-match ""))
(goto-char (region-beginning))
(goto-char (point-min))
(while (re-search-forward " \n" nil t)
(replace-match "\n"))
(goto-char (region-beginning))
(goto-char (point-min))
(while (re-search-forward "\n\"" nil t)
(replace-match "\n"))
(goto-char (region-beginning))
(goto-char (point-min))
(while (re-search-forward " \"" nil t)
(replace-match ""))
(goto-char (region-beginning))
(goto-char (point-min))
(while (re-search-forward "\"" nil t)
(replace-match ""))
(goto-char (region-beginning))
(goto-char (point-min))
(while (re-search-forward "“/" nil t)
(replace-match "/“"))
(goto-char (region-beginning))
(goto-char (point-min))
(while (re-search-forward "/”" nil t)
(replace-match "”/")))
(replace-match "”/"))
(goto-char (point-min))
(while (re-search-forward "=”" nil t)
(replace-match "=\""))
(goto-char (point-min))
(while (re-search-forward "”>" nil t)
(replace-match "\">"))
(goto-char (point-min))
(while (re-search-forward "”/>" nil t)
(replace-match "\"/>"))
(goto-char (point-min))
(while (re-search-forward "=\"\\([^>]*\\)”" nil t)
(replace-match "=\"\\1\"")))