diff --git a/gdscript-customization.el b/gdscript-customization.el index 853a3e1..e4841ed 100644 --- a/gdscript-customization.el +++ b/gdscript-customization.el @@ -58,19 +58,6 @@ :type 'integer :safe 'integerp) -(defcustom gdscript-indent-guess-indent-offset - t "If t, tells GDScript mode to guess `gdscript-indent-offset' value." - :type 'boolean - :group 'gdscript - :safe 'booleanp) - -(defcustom gdscript-indent-guess-indent-offset-verbose - t "If t, emit a warning when guessing indentation fails." - :version "25.1" - :type 'boolean - :group 'gdscript - :safe 'booleanp) - (defcustom gdscript-indent-trigger-commands '(indent-for-tab-command yas-expand yas/expand) "Commands that might trigger a `gdscript-indent-line' call." :type '(repeat symbol):group'gdscript) diff --git a/gdscript-indent-and-nav.el b/gdscript-indent-and-nav.el index 848c71a..4f04e50 100644 --- a/gdscript-indent-and-nav.el +++ b/gdscript-indent-and-nav.el @@ -45,45 +45,6 @@ The name of the defun should be grouped so it can be retrieved via `match-string'.") -;;; Indentation -(defun gdscript-indent-guess-indent-offset () - "Guess and set `gdscript-indent-offset' for the current buffer." - (interactive) - (save-excursion - (save-restriction - (widen) - (goto-char (point-min)) - (let ((block-end)) - (while (and (not block-end) - (re-search-forward - (gdscript-rx line-start block-start) nil t)) - (when (and - (not (gdscript-syntax-context-type)) - (progn - (goto-char (line-end-position)) - (gdscript--util-forward-comment -1) - (if (equal (char-before) ?:) - t - (forward-line 1) - (when (gdscript-info-block-continuation-line-p) - (while (and (gdscript-info-continuation-line-p) - (not (eobp))) - (forward-line 1)) - (gdscript--util-forward-comment -1) - (when (equal (char-before) ?:) - t))))) - (setq block-end (point-marker)))) - (let ((indentation - (when block-end - (goto-char block-end) - (gdscript--util-forward-comment) - (current-indentation)))) - (if (and indentation (not (zerop indentation))) - (set (make-local-variable 'gdscript-indent-offset) indentation) - (when gdscript-indent-guess-indent-offset-verbose - (message "Can't guess gdscript-indent-offset, using defaults: %s" - gdscript-indent-offset)))))))) - (defun gdscript-indent-context () "Get information about the current indentation context. Context is returned in a cons with the form (STATUS . START). diff --git a/gdscript-mode.el b/gdscript-mode.el index b5e76a6..610301f 100644 --- a/gdscript-mode.el +++ b/gdscript-mode.el @@ -181,10 +181,7 @@ the last command event was a string delimiter." (setq-local outline-level #'(lambda () "`outline-level' function for gdscript mode." - (1+ (/ (current-indentation) gdscript-indent-offset)))) - - (when gdscript-indent-guess-indent-offset - (gdscript-indent-guess-indent-offset))) + (1+ (/ (current-indentation) gdscript-indent-offset))))) (provide 'gdscript-mode) diff --git a/gdscript-tests.el b/gdscript-tests.el index d3fa6a4..cef5154 100644 --- a/gdscript-tests.el +++ b/gdscript-tests.el @@ -44,7 +44,7 @@ BODY is code to be executed within the temp buffer. Point is always located at the beginning of buffer." (declare (indent 1) (debug t)) `(with-temp-buffer - (let ((gdscript-indent-guess-indent-offset nil)) + (let () (gdscript-mode) (insert ,contents) (goto-char (point-min))