[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master e4087c6 06/12: [Fix #9] Customizable separator
From: |
Artur Malabarba |
Subject: |
[elpa] master e4087c6 06/12: [Fix #9] Customizable separator |
Date: |
Wed, 14 Oct 2015 11:49:14 +0000 |
branch: master
commit e4087c64989522e7fce9cb69866c369cdc73c430
Author: Artur Malabarba <address@hidden>
Commit: Artur Malabarba <address@hidden>
[Fix #9] Customizable separator
---
nameless.el | 18 +++++++++++++++---
1 files changed, 15 insertions(+), 3 deletions(-)
diff --git a/nameless.el b/nameless.el
index e971afb..ee857b1 100644
--- a/nameless.el
+++ b/nameless.el
@@ -112,6 +112,17 @@ For instance, the function `foobar--internal-impl' will be
displayed as `::internal-impl', instead of `:-internal-impl'."
:type 'boolean)
+(defcustom nameless-separator "-"
+ "Separator used between package prefix and rest of symbol.
+The separator is hidden along with the package name. For
+instance, setting it to \"/\" means that `init/bio' will be
+displayed as `:bio' (assuming `nameless-current-name' is
+\"init\"). The default is \"-\", since this is the
+separator recommended by the Elisp manual.
+
+Value can also be nil, in which case the separator is never hidden."
+ :type '(choice string (constant nil)))
+
;;; Font-locking
(defun nameless--make-composition (s)
@@ -132,7 +143,7 @@ displayed as `::internal-impl', instead of
`:-internal-impl'."
(beg (match-beginning 1))
(end (match-end 1))
(private-prefix (and nameless-private-prefix
- (equal "-" (substring (match-string 0) -1)))))
+ (equal nameless-separator (substring
(match-string 0) -1)))))
(when private-prefix
(setq beg (match-beginning 0))
(setq end (match-end 0))
@@ -211,7 +222,7 @@ 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 "-")
+ (progn (insert nameless-current-name nameless-separator)
t)
(unless noerror
(user-error "No name for current buffer, see
`nameless-current-name'")))))
@@ -234,7 +245,8 @@ configured, or if `nameless-current-name' is nil."
(defun nameless--name-regexp (name)
"Return a regexp of the current name."
- (concat "\\_<@?\\(" (regexp-quote name) "-\\)\\(\\s_\\|\\sw\\)"))
+ (concat "\\_<@?\\(" (regexp-quote name)
+ nameless-separator "\\)\\(\\s_\\|\\sw\\)"))
(defun nameless--filter-string (s)
"Remove from string S any disply or composition properties.
- [elpa] master 9e84a66 09/12: Style changes, (continued)
- [elpa] master 9e84a66 09/12: Style changes, Artur Malabarba, 2015/10/14
- [elpa] master d481765 02/12: [Fix #2 again] Private prefixes with the display property, Artur Malabarba, 2015/10/14
- [elpa] master f2b7501 07/12: Document new features, Artur Malabarba, 2015/10/14
- [elpa] master 005cb1f 01/12: Fix :type for nameless-affect-indentation-and-filling, Artur Malabarba, 2015/10/14
- [elpa] master 7ac7d99 08/12: Prepend the nameless face, Artur Malabarba, 2015/10/14
- [elpa] master a3dfd7e 10/12: Add url, Artur Malabarba, 2015/10/14
- [elpa] master 074c4d8 05/12: Merge pull request #11 from TheBB/optional-current-name, Artur Malabarba, 2015/10/15
- [elpa] master 7252f2e 03/12: Mark nameless-affect-indentation-and-filling as safe local, Artur Malabarba, 2015/10/15
- [elpa] master 40f43e6 04/12: Make discovery of current name optional, Artur Malabarba, 2015/10/15
- [elpa] master 48a3fe4 11/12: Merge commit '9e84a66b07700bebb73592fe320c19794c206ce3', Artur Malabarba, 2015/10/15
- [elpa] master e4087c6 06/12: [Fix #9] Customizable separator,
Artur Malabarba <=
- [elpa] master 1254161 12/12: Merge commit 'a3dfd7ecf9c58898241c8d1145eb8e0c875f5448', Artur Malabarba, 2015/10/15