eq
returns nil, even though magit-save-repository-buffers
is set to dontask
https://github.com/magit/magit/blob/12cd9bf1a095f526237ef1cb1b6b3fa54df83abc/lisp/magit-mode.el#L1169
magit-save-repository-buffers
?
(debug)
before the linked eq
above, evaluating (type-of magit-save-repository-buffers)
says it is a cons
, where as doing the same in ielm
results in symbol
(eq magit-save-repository-buffers 'dontask)
is nil
(car magit-save-repository-buffers)
returns quote
Debugger entered--killing local value of magit-save-repository-buffers in buffer magit: ars:
debug--implement-debug-watch(magit-save-repository-buffers nil makunbound #<buffer magit: ars>)
kill-all-local-variables()
special-mode()
magit-section-mode()
magit-mode()
magit-status-mode()
Debugger entered--setting magit-save-repository-buffers in buffer magit: ars to 'dontask:
debug--implement-debug-watch(magit-save-repository-buffers 'dontask set #<buffer magit: ars>)
hack-one-local-variable(magit-save-repository-buffers 'dontask)
hack-local-variables-apply()
hack-dir-local-variables-non-file-buffer()
magit-status-mode()
magit-setup-buffer-internal(magit-status-mode nil ((magit-buffer-diff-args ("--no-ext-diff")) (magit-buffer-diff-files nil) (magit-buffer-log-args ("-n256" "--decorate")) (magit-buffer-log-files nil)))
(magit-save-repository-buffers . 'dontask)
in there, and I guess the quote is wrong
Hi! Sorry for the repost, but I still haven't figured this out:
Quick question (hopefully): when global-magit-file-mode is t (the default), does one still need to
(require 'magit)
in their init file in order to enable magit-file-mode bindings?
My .emacs does not(require 'magit)
ATM andC-x g
and other shortcuts do not seem to work until I manually callM-x magit-status
once. Adding(require 'magit)
in the init file fixes this. Is this expected?
The installation node in the manual explicitly says to(require 'magit)
when installing from the Git repository, but no such step is mentioned in "Installing from Melpa" nor in "Post-Installation Tasks".
(Tested with Emacs 28)
(My curiosity was renewed by Stefan's recent message on emacs-devel explaining why one shouldn't, in principle, (require 'foo)
in their init file)
@rgrinberg
For example, I'd like to add the diff stat to the current log with -s
Butting in without having read the rest; does L -s g
in a log buffer do what you want?
@tarsius I'd appreciate it if you could weigh in on my question above; tl;dr must a user add (require 'magit)
to their init file to make C-x g
work without first running magit-status
, even though global-magit-file-mode
is t
?
It's not terribly important so no rush though. I don't know if Gitter is the best place to ask; my impression is that this is too trivial to warrant a Github issue or a post on StackExchange…
transient-append-suffix
and it does what I want. But I can't figure out how to set the default value of a switch (also of existing switches). The docs I found only talk about magit-popup
. I did see there's :value
in define-transient-command
, but can I set that for an existing transient command?