Note that there’s no ~quote~ before ~((c~!\\
You can also configure it for a whole project, by setting it as a dir-local variable.
+** Private symbols
+
+Private symbols in elisp are written with an extra dash after the
+prefix (e.g., ~foobar--indent-impl~). With Nameless, these are usually
+displayed as ~:-indent-impl~, but you can also make them be displayed
+as ~::indent-impl~ by setting
+
+#+BEGIN_SRC emacs-lisp
+(setq nameless-private-prefix t)
+#+END_SRC
+
** 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
(const :tag "Don't affect indentation" nil)
(const :tag "Only outside strings" 'outside-strings)))
+(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)
+
\f
;;; Font-locking
(defun nameless--make-composition (s)
(not (nth 3 (syntax-ppss)))))))
(dis (concat display nameless-prefix)))
(when compose
- (compose-region (match-beginning 1)
- (match-end 1)
- (nameless--make-composition dis)))
+ (if (and nameless-private-prefix
+ (equal "-" (substring (match-string 0) -1)))
+ (compose-region (match-beginning 0)
+ (match-end 0)
+ (nameless--make-composition (concat dis nameless-prefix)))
+ (compose-region (match-beginning 1)
+ (match-end 1)
+ (nameless--make-composition dis))))
`(face nameless-face ,@(unless compose (list 'display dis))))))
(defvar-local nameless--font-lock-keywords nil)
"Return a regexp of the current name."
(concat "\\_<@?\\(" (regexp-quote name) "-\\)\\(\\s_\\|\\sw\\)"))
+(defun nameless--private-name-regexp (name)
+ "Return a regexp of the current private name."
+ (concat "\\_<@?\\(" (regexp-quote name) "--\\)\\(\\s_\\|\\sw\\)"))
+
(defun nameless--filter-string (s)
"Remove from string S any disply or composition properties.
Return S."