emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master e96727f0ea0: ; Fix documentation of recent additions to treesit.e


From: Eli Zaretskii
Subject: master e96727f0ea0: ; Fix documentation of recent additions to treesit.el
Date: Wed, 25 Dec 2024 13:54:01 -0500 (EST)

branch: master
commit e96727f0ea0986bffe7ff235e5abc5354e63a64d
Author: Eli Zaretskii <eliz@gnu.org>
Commit: Eli Zaretskii <eliz@gnu.org>

    ; Fix documentation of recent additions to treesit.el
    
    * lisp/treesit.el (treesit-language-display-name-alist)
    (treesit-language-display-name): Doc fixes.
    
    * etc/NEWS: Fix wording of entry announcing the above.
---
 etc/NEWS        |  8 ++++----
 lisp/treesit.el | 15 ++++++++-------
 2 files changed, 12 insertions(+), 11 deletions(-)

diff --git a/etc/NEWS b/etc/NEWS
index ca107bb4938..8adead78a32 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -994,10 +994,10 @@ it uses `forward-sexp-default-function'.
 
 +++
 *** New function 'treesit-language-display-name'.
-New function that returns the display name given the language symbol.
-For example, 'cpp' is translated to "C++".  Also adds a new variable
-'treesit-language-display-name-alist' that the function uses to
-translate display names.
+This new function returns the display name of a language given the
+language symbol.  For example, 'cpp' is translated to "C++".  A new
+variable 'treesit-language-display-name-alist' holds the translations of
+language symbols where that translation is not trivial.
 
 +++
 *** New command 'treesit-explore'
diff --git a/lisp/treesit.el b/lisp/treesit.el
index 2616d16e800..eb3e26fff7e 100644
--- a/lisp/treesit.el
+++ b/lisp/treesit.el
@@ -851,17 +851,18 @@ omitted, default END to BEG."
     )
   "An alist mapping language symbols to their display names.
 
-Used by `treesit-language-display-name'.  If there's no mapping in this
-alist, `treesit-language-display-name' converts the symbol to display
-name by capitalizing the first letter.  So languages like Java,
-Javascript, Rust don't need an entry in this variable.")
+Used by `treesit-language-display-name'.  If there's no mapping for a
+lamguage in this alist, `treesit-language-display-name' converts the
+symbol to the display name by capitalizing the first letter of the
+symbol's name.  Thus, languages like Java, Javascript, Rust don't need
+an entry in this variable.")
 
 (defun treesit-language-display-name (language)
-  "Returns the display name (a string) of LANGUAGE.
+  "Return the display name (a string) of LANGUAGE (a symbol).
 
 If LANGUAGE has an entry in `treesit-language-display-name-alist', use
-the display name in their.  Otherwise, capitalize the first letter of
-LANGUAGE and return the string."
+the display name from there.  Otherwise, capitalize the first letter of
+LANGUAGE's name and return the resulting string."
   (or (alist-get language treesit-language-display-name-alist)
       (capitalize (symbol-name language))))
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]