Variable: dtrt-indent-max-merge-deviation

dtrt-indent-max-merge-deviation is a customizable variable defined in dtrt-indent.el.

Value

20.0

Documentation

*Minimum difference between offsets divisible without remainder.

The percentage of difference in the number of lines that are matched by two guessed offsets where the larger offset is divisible by the smaller without remainder for the smaller offset to be discarded.

This setting is in place because without it, in a file with 1000 lines matching an offset of 4, all of those 1000 lines are also matching an offset of 2 and a number of stray lines whose offset is divisible by 2 but not by 4 would confuse dtrt-indent to treat the smaller offset as the better guess. By discarding the smaller offset with some tolerance, this problem is avoided.

If you notice that often, sub-offsets are wrongly guessed (e.g. 8 would be the proper offset but 4 is guessed, or 6 would be correct but 3 is guessed) you might want to decrease this setting. On the other hand, if super-offsets are guessed (e.g. 4 would be appropriate, but 8 is guessed) you might want to increase it.

Source Code

;; Defined in /nix/store/xl774j723v677bsfsybzln3vi6w0fpm3-emacs-packages-deps/share/emacs/site-lisp/elpa/dtrt-indent-20260709.2011/dtrt-indent.el
(defcustom dtrt-indent-max-merge-deviation 20.0
  "*Minimum difference between offsets divisible without remainder.

The percentage of difference in the number of lines that are
matched by two guessed offsets where the larger offset is
divisible by the smaller without remainder for the smaller offset
to be discarded.

This setting is in place because without it, in a file with 1000
lines matching an offset of 4, all of those 1000 lines are also
matching an offset of 2 and a number of stray lines whose offset
is divisible by 2 but not by 4 would confuse dtrt-indent to treat
the smaller offset as the better guess.  By discarding the
smaller offset with some tolerance, this problem is avoided.

If you notice that often, sub-offsets are wrongly guessed (e.g. 8
would be the proper offset but 4 is guessed, or 6 would be
correct but 3 is guessed) you might want to decrease this
setting.  On the other hand, if super-offsets are guessed (e.g. 4
would be appropriate, but 8 is guessed) you might want to
increase it."
  :type 'float
  :tag "Maximum Deviation For Sub-Offset Merging"
  :group 'dtrt-indent)