How can I get Emacs to revert all unchanged buffers when switching branches in git?
Perhaps you’d like the global auto-revert mode. Try running global-auto-revert-mode and if you like it you can add (global-auto-revert-mode) to your ~/.emacs file.
Perhaps you’d like the global auto-revert mode. Try running global-auto-revert-mode and if you like it you can add (global-auto-revert-mode) to your ~/.emacs file.
You can use (concat “foo” “bar”) rather than (concatenate ‘string “foo” “bar”). Both work, but of course the former is shorter.
It isn’t that bad. The main problems can appear with ‘free variables’ in functions. (defun foo (a) (* a b)) In above function a is a local variable. b is a free variable. In a system with dynamic binding like Emacs Lisp, b will be looked up at runtime. There are now three cases: b … Read more
Is there a problem with that? (defun buffer-mode (buffer-or-string) “Returns the major mode associated with a buffer.” (with-current-buffer buffer-or-string major-mode)) with-current-buffer will restore your buffer when it returns.
Based on this question: REPL on console emacs, you can use M-x ielm (inferior emacs lisp mode).
The debugger (edebug) is pretty straight forward to use. Go to the definition of the function, and type M-x edebug-defun. The next time it is called, you’ll be able to step through the code as with every other debugger. Type ? for the list of keybindings, or check out the documentation for edebug.
Reading through the manual for Directory Names, you’ll find the answer: Given a directory name, you can combine it with a relative file name using concat: (concat dirname relfile) Be sure to verify that the file name is relative before doing that. If you use an absolute file name, the results could be syntactically invalid … Read more
You can use the touch command: M-! touch __init__.py RET
try file-exists-p “Return t if file filename exists (whether or not you can read it.)”. Note that it’s not spesific to files and works for directories too.
You can select a region and type `C-u M-| command RET’, and it replaces the region with the command output in the same buffer due to the interactive prefix argument of shell-command-on-region.