contrib/gadict.el
changeset 453 ad2b19c9d05d
parent 448 a61c140a4b6f
child 457 970931b7ca37
equal deleted inserted replaced
452:5a9b828f8de7 453:ad2b19c9d05d
   174 (defun gadict-search (headword)
   174 (defun gadict-search (headword)
   175   "Move to HEADWORD definition or place on posiiton for new corresponding
   175   "Move to HEADWORD definition or place on posiiton for new corresponding
   176 definition. Check for headwords ordering during search."
   176 definition. Check for headwords ordering during search."
   177   (interactive (list (read-string "Headword: ")))
   177   (interactive (list (read-string "Headword: ")))
   178   (gadict-search-floor headword)
   178   (gadict-search-floor headword)
   179   (recenter-top-bottom))
   179   (recenter))
   180 
   180 
   181 (defun gadict-insert-template-in-order (headword)
   181 (defun gadict-insert-template-in-order (headword)
   182   "Insert new article template with respect of headword order."
   182   "Insert new article template with respect of headword order."
   183   (interactive (list (read-string "Headword: ")))
   183   (interactive (list (read-string "Headword: ")))
   184   (unless (gadict-search-floor headword)
   184   (unless (gadict-search-floor headword)
   185     (gadict-insert-template headword))
   185     (gadict-insert-template headword))
   186   (recenter-top-bottom))
   186   (recenter))
   187 
   187 
   188 (defun gadict-setup-keymap ()
   188 (defun gadict-setup-keymap ()
   189   "Setup gadict keymap."
   189   "Setup gadict keymap."
   190   (define-key (current-local-map) [S-return] 'gadict-search)
   190   (define-key (current-local-map) [S-return] 'gadict-search)
   191   (define-key (current-local-map) [C-return] 'gadict-insert-template-in-order))
   191   (define-key (current-local-map) [C-return] 'gadict-insert-template-in-order))