I have just started to customize the emacs. If I want to enable some mode (globally) in emacs, I need to put some code in the .emacs file. For visual mode the code will be (global-visual-line-mode t). But the same syntax doesn't work for something like show-paren-mode. So is there any way to recognise the syntax has to be used for globally enabling a mode? Or is it something which has to be known?
Use the Emacs help system:
M-x describe-function RET show-paren-mode RET
...or use the 'Help' menu in the menu bar:
Help => Describe => Describe Function... show-paren-mode RET
,,,or the keyboard binding:
C-h f describe-function RET show-paren-mode RET
Finally, consider using the Emacs 'custom' package (M-x customize RET) which will maintain many settings in your .emacs file for you. Or for a specific option, from the menu bar:
Options => Customize Emacs => Specific Option...
Also, while typing in the minibuffer, entering zero or more characters followed by TAB will offer completion options.
The generally helpful answer is to use customize. They you don't have to know the exact syntax (or even in fact any Elisp at all); just tick the checkbox and enable for all sessions.
If you really care about the Elisp, there are regrettably three different conventions.
(activate-mode) or (name-of-mode t).(toggle-mode -1) to turn on unconditionally.(setq mode-variable t) and the mode would know to activate itself. This is a marginal case.If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With