Featured post
emacs public/protected/private label indentation of C++ header file not working for zero offset -
i cannot 0 offset things c++ header files in emacs if have defined in .emacs file.
the header file below shows class definition inside 2 namespaces , importantly public keyword have 0 offset below.
namespace n1 { namespace n2 // no offset { class someclass // no offset namespace open curly { public: // line 0 offset someclass(); // offset 4 ... }; inline someclass::someclass() // no offset { } } // n2 } // n2
in .emacs file have added label this:
(c-set-offset 'label 0)
i used ctrl-c ctrl-s find out modify. other offsets have defined in .emacs file working fine , values other 0 work label.
when set offset 0 label turns out 1 when hitting tab line. strange , looks else overriding or adding minimum of 1.
can explain how can achieve want , maybe explanation happening currently?
phew, first question here. :)
update:
thanks answers have been able bit farther, still no solution overall, because changing things necessary total offset 0 accessors result in other things don't want. thsi i'm currently:
(c-set-offset 'access-label 0)
i needed .h file understoor c++, added:
(add-to-list 'auto-mode-alist '("\\.h\\'" . c++-mode))
this alone not removing 1 offset seeing, seems there inclass accessor. setting 0 results in total 0 offset.
(c-set-offset 'inclass 0)
problem other things such members total of 0 below:
class foo { public: foo(); ~foo();
to remedy changed topmost-intro offset 4
(c-set-offset 'topmost-intro 4)
which in turn resulted in other changes e.g. inline function declarations in same file. in all, i'm not sure how tweak way want it.
update2:
added inline declaration of someclass ctor no offset.
i believe want access-label instead of label. see here.
- Get link
- X
- Other Apps
Comments
Post a Comment