equal
deleted
inserted
replaced
134 (re-search-backward "^$")) |
134 (re-search-backward "^$")) |
135 (backward-char) |
135 (backward-char) |
136 (when headword |
136 (when headword |
137 (insert headword) |
137 (insert headword) |
138 (insert "\n []") |
138 (insert "\n []") |
139 (backward-char)) |
139 (backward-char))) |
140 (recenter-top-bottom)) |
|
141 |
140 |
142 (defun gadict-search-floor (headword) |
141 (defun gadict-search-floor (headword) |
143 "Move to HEADWORD definition or place before definition should |
142 "Move to HEADWORD definition or place before definition should |
144 be placed. Check for headwords ordering during search. |
143 be placed. Check for headwords ordering during search. |
145 |
144 |
174 |
173 |
175 (defun gadict-insert-template-in-order (headword) |
174 (defun gadict-insert-template-in-order (headword) |
176 "Insert new article template with respect of headword order." |
175 "Insert new article template with respect of headword order." |
177 (interactive (list (read-string "Headword: "))) |
176 (interactive (list (read-string "Headword: "))) |
178 (unless (gadict-search-floor headword) |
177 (unless (gadict-search-floor headword) |
179 (gadict-insert-template headword))) |
178 (gadict-insert-template headword)) |
|
179 (recenter-top-bottom)) |
180 |
180 |
181 (defun gadict-setup-keymap () |
181 (defun gadict-setup-keymap () |
182 "Setup gadict keymap." |
182 "Setup gadict keymap." |
183 (define-key (current-local-map) [S-return] 'gadict-search-floor) |
183 (define-key (current-local-map) [S-return] 'gadict-search-floor) |
184 (define-key (current-local-map) [C-return] 'gadict-insert-template-in-order)) |
184 (define-key (current-local-map) [C-return] 'gadict-insert-template-in-order)) |