devdocs.el icon indicating copy to clipboard operation
devdocs.el copied to clipboard

New completion annotations and a minor improvement to aesthetics

Open emreyolcu opened this issue 5 months ago • 3 comments

Hey Augusto, thanks for developing this excellent package! I've made some additions to completion annotations, along with a minor improvement (in my opinion) to aesthetics.

Changes:

  • When displaying document names to the user in contexts such as completions or minibuffer messages, we now use document titles instead of slugs. Thus, instead of "python~3.13" as a completion candidate, we have "Python 3.13".
  • devdocs--read-entry previously displayed document annotations in a manner similar to Marginalia without actually using Marginalia's facilities. This is not a problem when using Vertico, but it causes misalignment in annotations when using Emacs' built-in completion buffer. I replaced the existing annotation function with two separate ones, for built-in completion and Marginalia. The built-in completion uses a newly introduced variable devdocs-annotation-separator (default: ———) to separate annotations from completion candidates.
  • devdocs--read-document now displays detailed version information as annotations for documents. Previously, without such annotations, for some documents it was not possible to know (without going to the DevDocs webpage or downloading the document) the exact versions that were being used. Similar to the above, these annotations support both the built-in completion and Marginalia. If the detailed version information is already present in the document title, we do not display it again as an annotation. Thus, "Python 3.13" has the annotation "3.13.5", but "PyTorch 2.7" has no annotation because the version and release fields in its metadata are both "2.7".

Here are two screenshots showing the new annotations:

emreyolcu avatar Aug 07 '25 03:08 emreyolcu

Hi, thanks for the PR and sorry for the late reply. As a first check that I can accept this change, have you signed the FSF copyright papers (cf. https://github.com/astoff/devdocs.el?tab=readme-ov-file#contributing)?

astoff avatar Aug 27 '25 16:08 astoff

I've started the process; currently waiting for a disclaimer from my university.

emreyolcu avatar Aug 27 '25 17:08 emreyolcu

Sorry for the long delay. I've finally signed the FSF copyright papers.

emreyolcu avatar Dec 05 '25 01:12 emreyolcu