@@ -638,6 +638,14 @@ point) to check."
638638 (replace-match (clojure-docstring-fill-prefix))))
639639 (lisp-indent-line )))
640640
641+ (defun clojure--symbol-get (function-name property )
642+ " Return the symbol PROPERTY for the symbol named FUNCTION-NAME.
643+ FUNCTION-NAME is a string. If it contains a `/' , also try only the part after the `/' ."
644+ (or (get (intern-soft function-name) property)
645+ (and (string-match " /\\ ([^/]+\\ )\\ '" function-name)
646+ (get (intern-soft (match-string 1 function-name))
647+ property))))
648+
641649(defun clojure-indent-function (indent-point state )
642650 " When indenting a line within a function call, indent properly.
643651
@@ -687,13 +695,8 @@ This function also returns nil meaning don't specify the indentation."
687695 (let* ((function (buffer-substring (point )
688696 (progn (forward-sexp 1 ) (point ))))
689697 (open-paren (elt state 1 ))
690- (method nil )
691698 (forward-sexp-function #'clojure-forward-logical-sexp )
692- (function-tail (car
693- (reverse
694- (split-string (substring-no-properties function) " /" )))))
695- (setq method (or (get (intern-soft function) 'clojure-indent-function )
696- (get (intern-soft function-tail) 'clojure-indent-function )))
699+ (method (clojure--symbol-get function 'clojure-indent-function )))
697700 ; ; Maps, sets, vectors and reader conditionals.
698701 (cond ((or (member (char-after open-paren) '(?\[ ?\{ ))
699702 (ignore-errors
@@ -734,15 +737,15 @@ move upwards in an sexp to check for contextual indenting."
734737 (when (looking-at " \\ sw\\ |\\ s_" )
735738 (let* ((start (point ))
736739 (fn (buffer-substring start (progn (forward-sexp 1 ) (point ))))
737- (meth (get ( intern-soft fn) 'clojure-backtracking-indent )))
740+ (meth (clojure--symbol- get fn 'clojure-backtracking-indent )))
738741 (let ((n 0 ))
739742 (when (< (point ) indent-point)
740743 (condition-case ()
741744 (progn
742745 (forward-sexp 1 )
743746 (while (< (point ) indent-point)
744747 (parse-partial-sexp (point ) indent-point 1 t )
745- (incf n)
748+ (cl- incf n)
746749 (forward-sexp 1 )))
747750 (error nil )))
748751 (push n path))
@@ -762,7 +765,7 @@ move upwards in an sexp to check for contextual indenting."
762765 (condition-case ()
763766 (progn
764767 (backward-up-list 1 )
765- (incf depth))
768+ (cl- incf depth))
766769 (error (setq depth clojure-max-backtracking)))))
767770 indent))
768771
0 commit comments