{"id":34885098,"url":"https://github.com/huangfeiyu/eldoc-mouse","last_synced_at":"2026-03-04T11:06:21.224Z","repository":{"id":315364945,"uuid":"1059173146","full_name":"huangfeiyu/eldoc-mouse","owner":"huangfeiyu","description":"Show document for mouse hover utilizing eldoc and posframe","archived":false,"fork":false,"pushed_at":"2026-01-30T13:54:16.000Z","size":141,"stargazers_count":65,"open_issues_count":1,"forks_count":8,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-02-26T17:14:33.917Z","etag":null,"topics":["document","eglot","eldoc","hover","mouse","posframe"],"latest_commit_sha":null,"homepage":"","language":"Emacs Lisp","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/huangfeiyu.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-09-18T05:13:04.000Z","updated_at":"2026-02-24T03:24:31.000Z","dependencies_parsed_at":"2025-09-18T07:34:50.065Z","dependency_job_id":"2cb3ca75-5b84-4b4d-b3db-8694eae219a2","html_url":"https://github.com/huangfeiyu/eldoc-mouse","commit_stats":null,"previous_names":["huangfeiyu/eldoc-mouse"],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/huangfeiyu/eldoc-mouse","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/huangfeiyu%2Feldoc-mouse","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/huangfeiyu%2Feldoc-mouse/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/huangfeiyu%2Feldoc-mouse/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/huangfeiyu%2Feldoc-mouse/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/huangfeiyu","download_url":"https://codeload.github.com/huangfeiyu/eldoc-mouse/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/huangfeiyu%2Feldoc-mouse/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30078501,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-04T08:01:56.766Z","status":"ssl_error","status_checked_at":"2026-03-04T08:00:42.919Z","response_time":59,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["document","eglot","eldoc","hover","mouse","posframe"],"created_at":"2025-12-26T03:36:30.875Z","updated_at":"2026-03-04T11:06:21.209Z","avatar_url":"https://github.com/huangfeiyu.png","language":"Emacs Lisp","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![NonGNU ELPA](https://elpa.nongnu.org/nongnu/eldoc-mouse.svg)](https://elpa.nongnu.org/nongnu/eldoc-mouse.html)\n[![melpa badge][melpa-badge]][melpa-link]\n\n# eldoc-mouse\n\n`eldoc-mouse` is an Emacs package that enhances the `eldoc` functionality by displaying documentation in a popup at the mouse point using [posframe](https://github.com/tumashu/posframe) when the mouse hovers over a symbol. It integrates with `posframe` to provide popping up documentation.\n#### Demo for Emacs Lisp\n\u003cvideo src=\"https://github.com/user-attachments/assets/c937bbd5-5da1-4c3d-8a4f-42929392604c\" controls\u003e\u003c/video\u003e\n#### Demo for Eglot Managed Buffer\n\u003cvideo src=\"https://github.com/user-attachments/assets/c7b1294c-333e-4115-b18e-4ded0a6ac6ec\" controls\u003e\u003c/video\u003e\n\n## Features\n- **It is specifically designed for mouse hover interactions and has a small codebase**.\n- Displays documentation in a popup when hovering over symbols.\n- Integrates with `posframe` for popup documentation.\n- Support moving mouse to the popup by move mouse on it and click.\n- Automatically hide the popup when mouse moved away from the symbol, also supoort pressing `C-g` to hide the popup.\n- The following enhancements are made for eglot managed buffers.\n   - Removed the unnecessary signatures from the document to make doucment more clear.\n   - Still keep highlighting the symbol under the cursor.\n- An interactive command to pop up document at cursor `eldoc-mouse-pop-doc-at-cursor`, this is helpful when you don't bother to move mouse, but want to check document. I bind it to key sequence `F1 F1`, press Ctrl-G or moving cursor away from the current symbol to close the popup.\n- More modes can be easily supported by extends `eldoc-mouse`.\n- So far, `eldoc-mouse` works only for GUI Emacs.\n\n## Installation\n\n`eldoc-mouse` is available on both [NonGNU ELPA](https://elpa.nongnu.org/nongnu/eldoc-mouse.html) and  [MELPA](https://melpa.org/)\n\nYou can install `eldoc-mouse` with the following command.\n\n\u003ckbd\u003eM-x package-install [RET] eldoc-mouse [RET]\u003c/kbd\u003e\n\n## Usage\n### Enable eldoc-mouse:\nAdd the following in your Emacs configuration:\n\n``` elisp\n(use-package eldoc-mouse :ensure t\n  ;; replace \u003cf1\u003e \u003cf1\u003e to a key you like, \"C-h .\" maybe. Displaying document on a popup when you press a key.\n  :bind (:map eldoc-mouse-mode-map\n         (\"\u003cf1\u003e \u003cf1\u003e\" . eldoc-mouse-pop-doc-at-cursor)) ;; optional\n  ;; enable mouse hover for eglot managed buffers, and emacs lisp buffers. ;; optional\n  :hook (eglot-managed-mode emacs-lisp-mode))\n```\nOr if you simply want to enable mouse hover to all buffers where eldoc is available as a minor mode\n\n``` elisp\n(use-package eldoc-mouse :ensure t\n  ;; replace \u003cf1\u003e \u003cf1\u003e to a key you like, \"C-h .\" maybe. Displaying document on a popup when you press a key.\n  :bind (:map eldoc-mouse-mode-map\n         (\"\u003cf1\u003e \u003cf1\u003e\" . eldoc-mouse-pop-doc-at-cursor)) ;; optional\n  :hook eldoc-mode)\n```\n\nOr if you want to show document only when you press a key, and don't want to enable mouse hover, then:\n\n``` elisp\n(use-package eldoc :ensure t)\n(use-package eglot :ensure t)\n;; if you use the eglot, elodc package from elpa, the above two lines to ensure them be loaded\n;; before loading eldoc-mouse to avoid recursive load error.\n(use-package eldoc-mouse :ensure t)\n;; replace \u003cf1\u003e \u003cf1\u003e to a key you like.  Displaying document on a popup when you press a key.\n(global-set-key (kbd \"\u003cf1\u003e \u003cf1\u003e\") 'eldoc-mouse-pop-doc-at-cursor)\n```\n### Supported modes\n* eglot-managed-mode\n* emacs-lisp-mode\n## Customization\n\nYou can customize the behavior of eldoc-mouse by adjusting the variables. For instance, you can adjust the delay time between mouse hover and displaying the documentation by changing the eldoc-mouse-mouse-timer settings.\n\n## Extend (Add new mode)\n`eldoc-mouse` can be easily extended to support more major/minor modes, finish the following 3 steps to extend it to support a new mode.\n\n1. write an impementation of `eldoc-documentation-functions`. see https://www.gnu.org/software/emacs/manual/html_node/emacs/Programming-Language-Doc.html#index-eldoc_002ddocumentation_002dfunctions. Here's an example implementation for `emacs-lisp-mode`\n   ```elisp\n    (defun eldoc-mouse--elisp-eldoc-documentation-function (_cb)\n      \"The `eldoc-documentation-functions' implementation for elisp.\"\n      (if (eq major-mode 'emacs-lisp-mode)\n          (let ((sym (symbol-at-point)))\n            (cond\n             ;; If the symbol is a function\n             ((and sym (fboundp sym))\n              (documentation sym))\n             ;; If the symbol is a variable\n             ((and sym (boundp sym))\n              (let ((doc (documentation-property sym 'variable-documentation)))\n                (if doc\n                    doc\n                  nil)))\n             ;; If no symbol or not a function/variable\n             (t nil)))\n        nil)) ;; if the expected mode is not available, nil should be returned.\n   ```\n2. add the function name to the `eldoc-mouse` variable `eldoc-mouse--eldoc-documentation-functions`. for example:\n   ```elisp\n   (defvar-local eldoc-mouse-eldoc-documentation-functions\n    (list #'eldoc-mouse--eglot-eldoc-documentation-function #'eldoc-mouse--elisp-eldoc-documentation-function)\n   \"The `eldoc-documentation-functions' for `eldoc-mouse-mode'.\")\n   ```\n3. submit a pull request. I'd love to merge it.\n4. For modes that is not part of Emacs, pull request is not a choice, instead, you can add your customized function as hook by the following:\n   ```elisp\n   (add-hook 'eldoc-mouse-eldoc-documentation-functions #'your-customized-eldoc-documentation-function nil t)\n   ```\n   For example: [Eldoc-mouse-nov.el](https://github.com/huangfeiyu/eldoc-mouse-nov)\n\n## Requirements\n\n    Emacs 27.1 or higher\n    posframe version 1.4.0 or higher\n    eglot version 1.8 or higher\n\n## License\n\nThis package is licensed under the GNU General Public License v3 (GPL-3.0-or-later). See the LICENSE file for details.\nContributing\n\n## Contribution\nFeel free to open issues and pull requests for improvements. If you encounter any bugs or have feature requests, please create an issue on the GitHub Issues page.\n## TODO \n* make moving mouse to the posframe easier, currently, it requires moving mouse quickly and with a click.\n* *(done)* make showing document for mouse hover more generic, not only for eglot managed buffers,  but also for buffers that it makes sense to show something on a posframe for mouse hover. (truly lives up to its name)\n* *(done)* an interactive command to popup document on a posframe for the symbol of the cursor.\n\n## Acknowledgments\n\n    lsp-ui: inspiration, the most mouse friendly tool in Emacs.\n    eldoc-box: inspiration, the first package for display eglot-eldoc-document to a child frame.\n    posframe: for popup document in beautiful child frame. \n    eglot: for offering Language Server Protocol (LSP) support in Emacs.\n    Emacs: for being an amazing, extensible text editor.\n\nAuthor\n\nHuang Feiyu sibadake1@163.com\n\n[melpa-link]: https://melpa.org/#/eldoc-mouse\n[melpa-badge]: https://melpa.org/packages/eldoc-mouse-badge.svg\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhuangfeiyu%2Feldoc-mouse","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhuangfeiyu%2Feldoc-mouse","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhuangfeiyu%2Feldoc-mouse/lists"}