equal
deleted
inserted
replaced
72 (setq font-lock-end (point)) |
72 (setq font-lock-end (point)) |
73 ) |
73 ) |
74 t) |
74 t) |
75 (t nil) )) |
75 (t nil) )) |
76 |
76 |
|
77 (defvar-local gadict-tr nil |
|
78 "Translation markers as string separated by comma. Define own |
|
79 values in .dir-local.el or as -*- gadict-tr: \"...\" -*- file prelude") |
|
80 |
77 (defun gadict-new-entry () |
81 (defun gadict-new-entry () |
78 "Insert new entry template." |
82 "Insert new entry template." |
79 (interactive) |
83 (interactive) |
80 (if (re-search-forward "^__" nil t) |
84 (if (re-search-forward "^__" nil t) |
81 (beginning-of-line) |
85 (beginning-of-line) |
83 (while (eq (char-before) ?\n) |
87 (while (eq (char-before) ?\n) |
84 (delete-backward-char 1)) |
88 (delete-backward-char 1)) |
85 (insert-char ?\n) |
89 (insert-char ?\n) |
86 (insert-char ?_ 2) |
90 (insert-char ?_ 2) |
87 (insert-char ?\n 3) |
91 (insert-char ?\n 3) |
|
92 (when (stringp gadict-tr) |
|
93 (mapc (lambda (tr) |
|
94 (insert-char ?\n) |
|
95 (insert tr) |
|
96 (insert ": ")) |
|
97 (split-string gadict-tr ",")) |
|
98 (insert-char ?\n) |
|
99 (re-search-backward "^$")) |
88 (backward-char)) |
100 (backward-char)) |
89 |
101 |
90 (defun gadict-setup-keymap () |
102 (defun gadict-setup-keymap () |
91 (define-key gadict-mode-map [C-return] 'gadict-new-entry)) |
103 (define-key gadict-mode-map [C-return] 'gadict-new-entry)) |
92 |
104 |