I am using a mode that has the following construct:
(defun robot-indent()
"Returns the string used in indation.
Set indent-tabs-mode to non-nil to use tabs in indentation. If indent-tabs-mode is
set to nil c-basic-offset defines how many spaces are used for indentation. If c-basic-offset is
not set 4 spaces are used.
"
(if indent-tabs-mode
"\t"
(make-string (if (boundp 'c-basic-offset)
c-basic-offset 4)
?\ )
)
)
The attempt to use c-basic-offset
if it is defined (bound?) fails. Evaluating c-basic-offset
return set-from-style
instead of 4.
I've tried to replace it with (symbol-value c-basic-offset)
, but it didn't change anything.
I've read about style variables, but didn't get everything. I set c-basic-offset
only in custom C style definitions in my init file.
Several questions:
- How do I fix it?
- Is this something that worked in older versions of emacs?
Emacs 24.5.1