# HG changeset patch # User Oleksandr Gavenko # Date 1460914322 -10800 # Node ID a61c140a4b6f3eb8b341aa9bac8881db7d8f9e09 # Parent e72fc3940606521d6378c79d6137f9aa8ebd5ec8 Recenter screen to article on search request. diff -r e72fc3940606 -r a61c140a4b6f contrib/gadict.el --- a/contrib/gadict.el Fri Apr 15 21:38:18 2016 +0300 +++ b/contrib/gadict.el Sun Apr 17 20:32:02 2016 +0300 @@ -143,7 +143,6 @@ definition. Check for headwords ordering during search. Return `t' if definition found, `nil' if no such headword." - (interactive (list (read-string "Headword: "))) (let ( prev curr ) (catch 'exit (goto-char (point-min)) @@ -172,6 +171,13 @@ (throw 'exit nil)) (setq prev curr)) ))) +(defun gadict-search (headword) + "Move to HEADWORD definition or place on posiiton for new corresponding +definition. Check for headwords ordering during search." + (interactive (list (read-string "Headword: "))) + (gadict-search-floor headword) + (recenter-top-bottom)) + (defun gadict-insert-template-in-order (headword) "Insert new article template with respect of headword order." (interactive (list (read-string "Headword: "))) @@ -181,7 +187,7 @@ (defun gadict-setup-keymap () "Setup gadict keymap." - (define-key (current-local-map) [S-return] 'gadict-search-floor) + (define-key (current-local-map) [S-return] 'gadict-search) (define-key (current-local-map) [C-return] 'gadict-insert-template-in-order)) ;;;###autoload