One way of achieving this behavior is to disable org-indent-mode and set org-adapt-indentation to t. The side effect of this configuration is that spaces will be added to Org file, where org-indent-mode only acts at render time.
electric-indent-mode is enabled by default.
You can turn it off via (electric-indent-mode -1) in your ~/.emacs, but if you want to only disable it for a particular char (e.g. () in a particular major mode, the normal way could look like:
(delq ?\( ...
C-hk( tells us:
( runs the command c-electric-paren (found in c-mode-map), which
is an interactive compiled Lisp function in ‘cc-cmds.el’.
It is bound to ), (.
(define-key c-mode-map (kbd "(") #'self-insert-command)
(define-key c-mode-map (kbd ")") #'self-insert-command))
Is python-indent-guess-indent-offset set to t? If so, then it's probably looking at your file and deciding to set the python-indent-offset to some other value. Try setting it to nil in the :init for the package. You could also check to see what the value of python-indent-offset is after you've opened the file using C-h v python-indent-offset.
I just ...
Okay, so I got in contact with the maintainers/developers of CC-Mode and it turns out that this is bug. They also took care of it:
In the correspondence you find a patch in text form. To apply the patch, copy the text to a file e.g. patchfile.txt
$ mv patchfile.txt path/to/emacs/share/../lisp/...
(lambda () (setq standard-indent 2)))
99% of all modes define at least one hook variable. Hook variables just hold a list of functions that will be called in the case of some event, usually upon entering some specific mode. Any time you want something to happen when a mode is activated, you want to add it to a hook ...