emacs-elpa-diffs
[Top][All Lists]
Advanced

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

[elpa] externals/nameless 79d7ba8 4/7: Merge pull request #22 from eigen


From: Stefan Monnier
Subject: [elpa] externals/nameless 79d7ba8 4/7: Merge pull request #22 from eigengrau/master
Date: Fri, 26 Mar 2021 22:42:48 -0400 (EDT)

branch: externals/nameless
commit 79d7ba8e9b8f3093e93172bdb4c5a4d31b0fa3e0
Merge: 108f16e 9755032
Author: Artur Malabarba <Malabarba@users.noreply.github.com>
Commit: GitHub <noreply@github.com>

    Merge pull request #22 from eigengrau/master
    
    Allow using a separate prefix string for private symbols
---
 nameless.el | 17 ++++++++++++-----
 1 file changed, 12 insertions(+), 5 deletions(-)

diff --git a/nameless.el b/nameless.el
index 9f34f32..3052b05 100644
--- a/nameless.el
+++ b/nameless.el
@@ -108,10 +108,15 @@ for it to take effect."
 (put 'nameless-current-name 'safe-local-variable #'symbolp)
 
 (defcustom nameless-private-prefix nil
-  "If non-nil, private symbols are displayed with a double prefix.
-For instance, the function `foobar--internal-impl' will be
-displayed as `::internal-impl', instead of `:-internal-impl'."
-  :type 'boolean)
+  "If non-nil, handle private symbols specially.
+
+When t, display private symbols with a double prefix. For
+instance, the function `foobar--internal-impl' will be displayed
+as `::internal-impl', instead of `:-internal-impl'.
+
+When set to a string, use this string as a prefix for private
+symbols instead of `nameless-prefix'."
+  :type '(choice boolean string))
 
 (defcustom nameless-separator "-"
   "Separator used between package prefix and rest of symbol.
@@ -148,7 +153,9 @@ Value can also be nil, in which case the separator is never 
hidden."
       (when private-prefix
         (setq beg (match-beginning 0))
         (setq end (match-end 0))
-        (setq dis (concat dis nameless-prefix)))
+        (setq dis (if (stringp nameless-private-prefix)
+                      (concat display nameless-private-prefix)
+                    (concat dis nameless-prefix))))
       (if compose
           (compose-region beg end (nameless--make-composition dis))
         (add-text-properties beg end (list 'display dis)))



reply via email to

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