Position view for the best article visibility in the buffer.
--- a/misc/gadict.el Thu Apr 01 23:13:47 2021 +0300
+++ b/misc/gadict.el Fri Apr 02 18:05:36 2021 +0300
@@ -320,7 +320,8 @@
definition. Check for headwords ordering during search."
(interactive (list (read-string "Headword: " nil 'gadict--headword-history)))
(gadict-search-floor headword)
- (recenter))
+ ;; Position view for the best article visibility in the buffer.
+ (recenter 1))
(defun gadict-insert-article-in-order ()
"Insert new article template with respect of headword order."
@@ -329,8 +330,9 @@
(setq headword (read-string "Headword: " nil 'gadict--headword-history))
(unless (gadict-search-floor headword)
(setq pos (completing-read "POS: " gadict--pos nil t nil 'gadict--pos-history))
- (gadict-insert-article headword pos)
- (recenter))))
+ (gadict-insert-article headword pos))
+ ;; Position view for the best article visibility in the buffer.
+ (recenter (+ scroll-margin 2))))
(defun gadict--find-headword-end ()
(save-excursion