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

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

[elpa] externals/nameless 264d58353e 1/2: Fix nameless-separator is comp


From: ELPA Syncer
Subject: [elpa] externals/nameless 264d58353e 1/2: Fix nameless-separator is compared to strings
Date: Wed, 8 Feb 2023 19:57:52 -0500 (EST)

branch: externals/nameless
commit 264d58353efee4094ac989a6bbaefdde602566a6
Author: Spenser Truex <web@spensertruex.com>
Commit: Spenser Truex <web@spensertruex.com>

    Fix nameless-separator is compared to strings
    
    It can be a string or it can be nil.
---
 README.org  | 2 +-
 nameless.el | 7 +++----
 2 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/README.org b/README.org
index 74d56d9426..7d292246f4 100644
--- a/README.org
+++ b/README.org
@@ -103,7 +103,7 @@ you package uses. Most packages use hyphens, but some use 
~/~, ~|~, or
 ~:~.
 
 You can also set it to ~nil~ globally and the separator will never be
-hidden.
+hidden, and will not be inserted with `-name-insert-` functions.
 ** Indentation and paragraph filling
 Hiding parts of symbols could affect the way Emacs indents your code
 and fills your paragraphs. Nameless lets you decide whether you want
diff --git a/nameless.el b/nameless.el
index 98301e988c..0da3c877fe 100644
--- a/nameless.el
+++ b/nameless.el
@@ -149,6 +149,7 @@ Value can also be nil, in which case the separator is never 
hidden."
           (beg (match-beginning 1))
           (end (match-end 1))
           (private-prefix (and nameless-private-prefix
+                               nameless-separator
                                (equal nameless-separator (substring 
(match-string 0) -1)))))
       (when private-prefix
         (setq beg (match-beginning 0))
@@ -232,11 +233,10 @@ configured, or if `nameless-current-name' is nil."
           (unless noerror
             (user-error "No name for alias `%s', see `nameless-aliases'" 
alias))))
     (if nameless-current-name
-        (progn (insert nameless-current-name nameless-separator)
+        (progn (insert nameless-current-name (or nameless-separator ""))
                t)
       (unless noerror
         (user-error "No name for current buffer, see 
`nameless-current-name'")))))
-
 (defun nameless-insert-name-or-self-insert (&optional self-insert)
   "Insert the name of current package, with a hyphen.
 If point is in an argument list, or if we're typing an escaped
@@ -252,13 +252,12 @@ character, insert the current character literally 
instead."
       (delete-region l (point))
       (unless (nameless-insert-name 'noerror)
         (call-interactively #'self-insert-command)))))
-
 (put 'nameless-insert-name-or-self-insert 'delete-selection t)
 
 (defun nameless--name-regexp (name)
   "Return a regexp of the current name."
   (concat "\\_<@?\\(" (regexp-quote name)
-          nameless-separator "\\)\\(\\s_\\|\\sw\\)"))
+          (or nameless-separator "") "\\)\\(\\s_\\|\\sw\\)"))
 
 (defun nameless--filter-string (s)
   "Remove from string S any disply or composition properties.



reply via email to

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