Minor, general refactor & comment revision
This commit is contained in:
parent
33ae889e39
commit
84fd744e3f
5 changed files with 10 additions and 13 deletions
|
@ -174,7 +174,7 @@ markdown and copies it to your clipboard, ready to be pasted into bug reports!"
|
||||||
((suspend-emacs
|
((suspend-emacs
|
||||||
(format "%s %s -nw; fg"
|
(format "%s %s -nw; fg"
|
||||||
(shell-quote-argument (restart-emacs--get-emacs-binary))
|
(shell-quote-argument (restart-emacs--get-emacs-binary))
|
||||||
(string-join (mapcar #'shell-quote-argument args) " ")))))
|
(mapconcat #'shell-quote-argument args " ")))))
|
||||||
(error
|
(error
|
||||||
(delete-file file)
|
(delete-file file)
|
||||||
(signal (car e) (cdr e)))))))
|
(signal (car e) (cdr e)))))))
|
||||||
|
|
|
@ -222,7 +222,7 @@ even if it doesn't need reloading!"
|
||||||
(member-p
|
(member-p
|
||||||
(push sexp forms)))))
|
(push sexp forms)))))
|
||||||
(if forms
|
(if forms
|
||||||
(concat (string-join (mapcar #'prin1-to-string (reverse forms)) "\n")
|
(concat (mapconcat #'prin1-to-string (reverse forms) "\n")
|
||||||
"\n")
|
"\n")
|
||||||
""))))))
|
""))))))
|
||||||
|
|
||||||
|
|
|
@ -101,8 +101,7 @@ order of `doom-env-switches' determines priority."
|
||||||
"#\n"
|
"#\n"
|
||||||
"# It is NOT safe to edit this file. Changes will be overwritten next time\n"
|
"# It is NOT safe to edit this file. Changes will be overwritten next time\n"
|
||||||
"# that `doom env refresh` is executed. Alternatively, create your own env file\n"
|
"# that `doom env refresh` is executed. Alternatively, create your own env file\n"
|
||||||
"# in your DOOMDIR and load it with \n"
|
"# and load it with `(doom-load-env-vars FILE)`.\n"
|
||||||
"# `(doom-load-env-vars (expand-file-name FILE doom-private-dir))`.\n"
|
|
||||||
"#\n"
|
"#\n"
|
||||||
"# To auto-regenerate this file when `doom reload` is run, use `doom env auto'\n"
|
"# To auto-regenerate this file when `doom reload` is run, use `doom env auto'\n"
|
||||||
"# or set DOOMENV=1 in your shell environment/config.\n"
|
"# or set DOOMENV=1 in your shell environment/config.\n"
|
||||||
|
|
|
@ -16,14 +16,14 @@ Irrelevant if you do not have the +onsave flag enabled for this module.")
|
||||||
"If non-nil, the leading indentation is preserved when formatting the whole
|
"If non-nil, the leading indentation is preserved when formatting the whole
|
||||||
buffer. This is particularly useful for partials.
|
buffer. This is particularly useful for partials.
|
||||||
|
|
||||||
Indentation is always preserved when formatting regions. ")
|
Indentation is always preserved when formatting regions.")
|
||||||
|
|
||||||
(defvar-local +format-with nil
|
(defvar-local +format-with nil
|
||||||
"Set this to explicitly use a certain formatter for the current buffer.")
|
"Set this to explicitly use a certain formatter for the current buffer.")
|
||||||
|
|
||||||
|
|
||||||
;;
|
;;
|
||||||
;; Bootstrap
|
;;; Bootstrap
|
||||||
|
|
||||||
(defun +format|enable-on-save-maybe ()
|
(defun +format|enable-on-save-maybe ()
|
||||||
"Enable formatting on save in certain major modes.
|
"Enable formatting on save in certain major modes.
|
||||||
|
@ -43,16 +43,14 @@ This is controlled by `+format-on-save-enabled-modes'."
|
||||||
|
|
||||||
|
|
||||||
;;
|
;;
|
||||||
;; Hacks
|
;;; Hacks
|
||||||
|
|
||||||
;; Allow a specific formatter to be used by setting `+format-with', either
|
;; Allow a specific formatter to be used by setting `+format-with', either
|
||||||
;; buffer-locally or let-bound.
|
;; buffer-locally or let-bound.
|
||||||
(advice-add #'format-all--probe :around #'+format*probe)
|
(advice-add #'format-all--probe :around #'+format*probe)
|
||||||
|
|
||||||
;; Doom uses a modded `format-all-buffer', which
|
;; Doom uses a modded `format-all-buffer', which
|
||||||
;; 1. Doesn't move the cursorafter reformatting,
|
;; 1. Enables partial reformatting (while preserving leading indentation),
|
||||||
;; 2. Can reformat regions, rather than the entire buffer (while preserving
|
;; 2. Applies changes via RCS patch, line by line, to protect buffer markers
|
||||||
;; leading indentation),
|
;; and avoid any jarring cursor+window scrolling.
|
||||||
;; 3. Applies changes via RCS patch, line by line, as not to protect buffer
|
|
||||||
;; markers and avoid any jarring cursor+window scrolling.
|
|
||||||
(advice-add #'format-all-buffer :override #'+format/buffer)
|
(advice-add #'format-all-buffer :override #'+format/buffer)
|
||||||
|
|
|
@ -26,7 +26,7 @@ to the right fringe.")
|
||||||
"Enable `git-gutter-mode' in the current buffer.
|
"Enable `git-gutter-mode' in the current buffer.
|
||||||
|
|
||||||
If the buffer doesn't represent an existing file, `git-gutter-mode's activation
|
If the buffer doesn't represent an existing file, `git-gutter-mode's activation
|
||||||
is deferred until the file is saved."
|
is deferred until the file is saved. Respects `git-gutter:disabled-modes'."
|
||||||
(when (or +vc-gutter-in-remote-files
|
(when (or +vc-gutter-in-remote-files
|
||||||
(not (file-remote-p (or buffer-file-name default-directory))))
|
(not (file-remote-p (or buffer-file-name default-directory))))
|
||||||
(if (not buffer-file-name)
|
(if (not buffer-file-name)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue