3
You are right in assuming that the location is wrong. Emacs does not know about your niranjan directory. You assume that ~/.emacs.d/elpa/ is a special location and that emacs automatically knows how to add packages installed in there.
If you look at the contents of the variable load-path, you'll see that is not the case. Every package that has been ...
3
I think it's a bug.
If you don't use that alist as the KEYMAP arg, but instead you create a keymap, assign it to a variable, use define-key with (kbd "C-n") etc., and use that variable as the KEYMAP arg, then it works.
Please consider using M-x report-emacs-bug, to report this.
(setq toto-map (make-sparse-keymap))
(defun foo () "..." (...
3
Almost every mode puts some kind of text in the mode line, which is the line of text at the bottom of every buffer. You can also type C-h m (or M-x describe-mode)to get long-form documentation about every mode that is currently active. This includes their names as well as all of their keybindings.
2
As xuchunyang noted in comments, your shouldn't use prose-mode to name a function that doesn't define a mode, so you could define your function like this:
(defun sixter-olivetti-mode-setup()
"Load additional stuff with olivetti-mode."
(display-line-numbers-mode 'toggle)
(variable-pitch-mode)
)
Note that display-line-numbers-mode, accepts an optional ...
2
minor-mode-map-alist is a variable defined in `C source code'.
Documentation:
Alist of keymaps to use for minor modes.
Each element looks like (VARIABLE . KEYMAP); KEYMAP is used to read
key sequences and look up bindings if VARIABLE's value is non-nil.
If two active keymaps bind the same key, the keymap appearing earlier
in the list takes precedence.
...
2
You can use a source block with a self-defined major mode.
It is easy to define a customized major mode with helper functions like define-derived-mode.
Let us name your new major mode myorg-mode. Then the name of the function executed on C-c C-c is org-babel-execute:myorg.
It is called with two arguments. The first arg is the content of the source block as a ...
2
There's M-x describe-mode, which is bound to C-h m by default. It shows the current major mode, as well as all current minor modes.
If you want to jump directly to the description of your current major mode, then either evaluate (describe-function major-mode) (via M-:) or bind it to a key, for example:
(defun my/describe-current-major-mode ()
"...
2
Refer to the manual:
C-hig (elisp)Properties in Mode
Or in the online manual (which is always for the most recent stable release of Emacs): https://www.gnu.org/software/emacs/manual/html_node/elisp/Properties-in-Mode.html
I think there's no point in quoting an excerpt here -- you need to read the whole page.
1
Attempting answering my own question:
Try 1: partially works, but as per comments below doesn't seem reliable
Create a wrapper global mode, that is selective about when it enables.
(define-global-minor-mode my-global-selectrum-mode selectrum-mode
(lambda ()
(when (not (memq major-mode
(list 'shell-mode)))
(selectrum-mode))))
...
1
See C-hf kill-local-variable for reverting a buffer-local variable to the global state.
If you just set the buffer-local value to the variable's current default value, then it's still a buffer-local value (i.e. it won't reflect future changes to the default).
1
Minor modes are toggles. Defining a minor mode also creates a variabel with the same name. This variable is toggled when enabling/disabling the minor mode.
So following code works:
(define-minor-mode margin-mode
(if (not margin-mode)
(setq left-margin-width 3)
(setq left-margin-width (default-value 'left-margin-width))))
Elisp is a Lisp-n type ...
1
All you have to do is replace the set-buffer-major-mode call which sets the buffer to a default mode (fundamental mode in this case) with a couple of calls to set the modes you want.
org-mode is a major mode, so you set it by calling the function that implements it, with no arguments, in the buffer whose mode you want to set:
(set-buffer <some buffer>)
...
1
Do you have either a (require 'move-dup) or a use-package declaration for move-dup? If not, that is likely your problem.
1
If you are ready for a more radical change in your default modeline setting, doom-modeline has a nice indicator to show whether you are in god mode or not.
1
Just following up I ended up going with a simplified version of the example code (https://github.com/emacsorphanage/god-mode#change-modeline-color) and adding cursor change:
;; Update cursor
(defun my-god-mode-update-cursor ()
(setq cursor-type (if (or god-local-mode buffer-read-only)
'box
'bar)))
(add-hook ...
1
I tested the (mapcar #'car minor-mode-alist) solution, but its length doesn't change after I disable a minor mode (while M-x describe-mode reflects this). Moreover, it seems inaccurate as I can't find some minor-modes listed by M-x describe-mode.
I tried the package manage-minor-mode which allows users to enable/disable a minor-mode through an interface. ...
1
If you don't want to do diminish/delight on every package. You could try minions it will hide all minor mode and can be toggled using mouse. Or you can use awesome-tray which you can use to refine what to show in modeline.
Only top voted, non community-wiki answers of a minimum length are eligible
Related Tags
minor-mode × 133major-mode × 19
key-bindings × 17
hooks × 16
org-mode × 8
keymap × 8
customize × 5
init-file × 4
buffers × 4
help × 4
buffer-local × 4
spacemacs × 3
mode-line × 3
text-properties × 3
scrolling × 3
python × 2
debugging × 2
window × 2
faces × 2
font-lock × 2
syntax-highlighting × 2
auto-complete-mode × 2
directory-local-variables × 2
linum-mode × 2
file-local-variables × 2