Recenter screen to article on search request.
--- 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