Dash Docs opens with desired function scrolled off screen
- Dominant language
- Emacs Lisp
- Stars
- 22.7k
- Forks
- 3.1k
- Avg merge
- 10h 46m
- Merged PRs (30d)
- 4
Description
### I confirm that...
- [X] I have searched the [issue tracker](https://github.com/doomemacs/doomemacs/issues), [documentation](https://docs.doomemacs.org), [FAQ](https://docs.doomemacs.org/-/faq), [Discourse](https://discourse.doomemacs.org), and [Google](https://google.com), in case this issue has already been reported/resolved.
- [X] I have read "[How to Debug Issues](https://doomemacs.org/d/how2debug)", and will use it to provide as much information about this issue as possible.
- [X] The issue can be reproduced on the **latest** available commit of Doom.
- [X] The issue can be reproduced on a stable release of Emacs, such as 27 or 28. *(Doom does not support development builds like 29+ or any version ending in .50 or .9x)*
### Expected behavior
When opening documentation, it should be visible without having to scroll down. I worked around it my config by adding:
```
(defun my/scroll-to-top ()
"scroll buffer to cursor at top"
(recenter 0))
(setq eww-after-render-hook #'my/scroll-to-top)
```
maybe an eww-after-render-hook could be added to docsets.el
### Current behavior
Doom's integration with dash docsets is great, there is just one quirk I found. When looking up documentation for a function, eww is opened with the cursor at the bottom, above the function I looked up, so I see documentation for whatever function comes before it in the documentation, and have to page down to see the function I actually looked up.
This is consistent is consistent with various docsets I've used across python, rust, clojure, common lisp, and doom usage on multiple computers (different distros and installations of emacs)
### Steps to reproduce
Here I do `SPC s k` (+lookup/in-docsets) to lookup `mapv` function in clojure, it opens in eww with the cursor at the bottom of the screen, above the mapv documentation, with documentation of the previous function visible:

After paging down, now the documentation I wanted is shown:

### System Information
https://gist.github.com/bo-tato/5c721d7b472a987784d661719e3a980b
Contributor guide
Research direction
Start with the Dash docsets integration in docsets.el and reproduce the issue through SPC s k (+lookup/in-docsets) using the reported mapv lookup. Compare the initial eww position with the position after paging down; done means the requested function is visible when the documentation opens, without requiring manual scrolling.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- emacs-lisp
- Domain
- documentation
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100