equal
deleted
inserted
replaced
1 ;;; gadict-mode.el --- major mode for editing gadict dictionary source files |
1 ;;; gadict-mode.el --- major mode for editing gadict dictionary source files -*- lexical-binding: t -*- |
2 |
2 |
3 ;; Copyright (C) 2016 by Oleksandr Gavenko <gavenkoa@gmail.com> |
3 ;; Copyright (C) 2016 by Oleksandr Gavenko <gavenkoa@gmail.com> |
4 |
4 |
5 ;; You can do anything with this file without any warranty. |
5 ;; You can do anything with this file without any warranty. |
6 |
6 |
61 (forward-line 0) |
61 (forward-line 0) |
62 (goto-char (point-max))) |
62 (goto-char (point-max))) |
63 (exchange-point-and-mark)) |
63 (exchange-point-and-mark)) |
64 |
64 |
65 (defun gadict-setup-expansions () |
65 (defun gadict-setup-expansions () |
66 "Adds gadict-mode specific expansions." |
66 "Add `gadict-mode' specific expansions." |
67 (set (make-local-variable 'er/try-expand-list) (list #'gadict-mark-article))) |
67 (set (make-local-variable 'er/try-expand-list) (list #'gadict-mark-article))) |
68 |
68 |
69 (eval-when-compile |
69 (eval-when-compile |
70 (defvar font-lock-beg) |
70 (defvar font-lock-beg) |
71 (defvar font-lock-end)) |
71 (defvar font-lock-end)) |
97 (interactive) |
97 (interactive) |
98 (if (re-search-forward "^__" nil t) |
98 (if (re-search-forward "^__" nil t) |
99 (beginning-of-line) |
99 (beginning-of-line) |
100 (goto-char (point-max))) |
100 (goto-char (point-max))) |
101 (while (eq (char-before) ?\n) |
101 (while (eq (char-before) ?\n) |
102 (delete-backward-char 1)) |
102 (delete-char -1)) |
103 (insert-char ?\n) |
103 (insert-char ?\n) |
104 (insert-char ?_ 2) |
104 (insert-char ?_ 2) |
105 (insert-char ?\n 3) |
105 (insert-char ?\n 3) |
106 (when (stringp gadict-tr) |
106 (when (stringp gadict-tr) |
107 (mapc (lambda (tr) |
107 (mapc (lambda (tr) |
128 (gadict-setup-expansions) ) |
128 (gadict-setup-expansions) ) |
129 |
129 |
130 (provide 'gadict) |
130 (provide 'gadict) |
131 |
131 |
132 ;;; dict-mode.el ends here |
132 ;;; dict-mode.el ends here |
|
133 |
|
134 (provide 'gadict) |
|
135 |
|
136 ;;; gadict.el ends here |