Skip to content

Commit

Permalink
Add feedback to dtrt-indent-set
Browse files Browse the repository at this point in the history
  • Loading branch information
ramnes authored and rrthomas committed Jun 23, 2024
1 parent 8451d1d commit 2b0bcf6
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion dtrt-indent.el
Original file line number Diff line number Diff line change
Expand Up @@ -1045,6 +1045,8 @@ Indentation offset set with file variable; not adjusted")
(interactive "nIndentation offset: ")
(let ((language-and-variable (cdr (dtrt-indent--search-hook-mapping major-mode))))
(when language-and-variable
(when (string= (car language-and-variable) "default")
(error "Unsupported mode: %s" major-mode))
(let* ((indent-offset-mode-variables
(let ((v (nth 1 language-and-variable)))
(if (listp v) v (list v))))
Expand All @@ -1067,7 +1069,11 @@ Indentation offset set with file variable; not adjusted")
indent-offset-variables))
(dolist (x indent-offset-variables)
(set (make-local-variable x)
indent))))))
indent))
(when (>= dtrt-indent-verbosity 1)
(message "%s set to %d"
(mapconcat 'symbol-name indent-offset-variables ", ")
indent))))))

(defun dtrt-indent-adapt ()
"Try adjusting indentation settings for the current buffer."
Expand Down

0 comments on commit 2b0bcf6

Please sign in to comment.