diff options
author | Sean Whitton <spwhitton@spwhitton.name> | 2021-04-05 11:09:27 -0700 |
---|---|---|
committer | Sean Whitton <spwhitton@spwhitton.name> | 2021-04-05 11:14:26 -0700 |
commit | 0bd224a99b0e64cf038971817e297fede117a40c (patch) | |
tree | 324da33f98d222e124a8a5cb60e9118bc7146461 /src/property.lisp | |
parent | 93b9dc32bd0585e58de69a3428f17879a55bbc0b (diff) | |
download | consfigurator-0bd224a99b0e64cf038971817e297fede117a40c.tar.gz |
avoid generating indentation information for unexported symbols
Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
Diffstat (limited to 'src/property.lisp')
-rw-r--r-- | src/property.lisp | 54 |
1 files changed, 30 insertions, 24 deletions
diff --git a/src/property.lisp b/src/property.lisp index 44fbd17..34e06b0 100644 --- a/src/property.lisp +++ b/src/property.lisp @@ -157,30 +157,36 @@ see MAP-PROPSPEC-PROPAPPS for how they are used.") (defun store-indentation-info-for-emacs (sym args &optional info) (unless (string-prefix-p "%" (symbol-name sym)) - (let* ((package-short-name - (lastcar (split-string (package-name *package*) :separator "."))) - (short-name - (if (string= package-short-name "CONSFIGURATOR") - (symbol-name sym) - (strcat package-short-name ":" (symbol-name sym)))) - (dotted-name (strcat short-name ".")) - indent) - (cond - (info - (push (cons short-name info) indent) - (push (cons dotted-name info) indent)) - ((not (find '&key args)) - (let ((n (1- (loop with n = 0 - for arg in args - if (member arg '(&rest &body &aux)) - return (1+ n) - unless (eq arg '&optional) - do (incf n) - finally (return n))))) - (when (plusp n) - (push (cons dotted-name n) indent))))) - (when indent - (setf (get sym 'indent) indent))))) + (let* ((package-short-name + (lastcar (split-string (package-name *package*) :separator "."))) + (short-name + (if (string= package-short-name "CONSFIGURATOR") + (symbol-name sym) + (strcat package-short-name ":" (symbol-name sym)))) + (dotted-name (strcat short-name ".")) + (dotted-exported + (eql :external (nth-value + 1 + (find-symbol (strcat (symbol-name sym) ".") + (symbol-package sym))))) + indent) + (cond + (info + (push (cons short-name info) indent) + (when dotted-exported + (push (cons dotted-name info) indent))) + ((and dotted-exported (not (find '&key args))) + (let ((n (1- (loop with n = 0 + for arg in args + if (member arg '(&rest &body &aux)) + return (1+ n) + unless (eq arg '&optional) + do (incf n) + finally (return n))))) + (when (plusp n) + (push (cons dotted-name n) indent))))) + (when indent + (setf (get sym 'indent) indent))))) (defmacro define-dotted-property-macro (name args &aux (whole (gensym))) "Affix a period to the end of NAME and define a macro expanding into a |