("q" . "queue")))
#+END_SRC
-You can also configure aliases per-file by setting ~nameless-aliases~ as a file-local variable.
+You can also configure aliases per-file by setting ~nameless-aliases~
+as a file-local variable.
#+BEGIN_SRC emacs-lisp
;; Local Variables:
-;; nameless-aliases: (quote (("c" . "cider")))
+;; nameless-aliases: (("c" . "cider"))
;; End:
#+END_SRC
-Or you can configure it for a whole project, by setting it as a dir-local variable.
+/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.
** Indentation and paragraph filling
Hiding parts of symbols could affect the way Emacs indents your code
it with the full name for that alias.
#+END_SRC
-To change this behavior, configure the variable ~nameless-affect-indentation-and-filling~.
+To change this behavior, configure the variable
+~nameless-affect-indentation-and-filling~.
those in `nameless-global-aliases'.
This variable is designed to be used as a file-local or dir-local
variable.")
+(put 'nameless-aliases 'safe-local-variable
+ (lambda (x) (ignore-errors
+ (let ((safe t))
+ (mapc (lambda (cell)
+ (unless (and (stringp (car cell))
+ (stringp (cdr cell)))
+ (setq safe nil)))
+ x)
+ safe))))
(defface nameless-face
'((t :inherit font-lock-type-face))
\f
;;; Name and regexp
(defvar-local nameless-current-name nil)
+(put 'nameless-current-name 'safe-local-variable #'stringp)
(defun nameless--in-arglist-p ()
"Is point inside an arglist?"
(setq nameless-current-name nil)
(nameless--remove-keywords)))
+;;;###autoload
+(defun nameless-mode-from-hook ()
+ "Turn on `nameless-mode'.
+Designed to be added to `emacs-lisp-mode-hook'.
+Interactively, just invoke `nameless-mode' directly."
+ (add-hook 'find-file-hook #'nameless-mode nil 'local))
+
(provide 'nameless)
;;; nameless.el ends here