Format codes and comments.

This commit is contained in:
Vincent Zhang 2018-11-29 02:34:58 +08:00
parent fac54da782
commit 5b507e4b98

View file

@ -323,7 +323,6 @@ active.")
(defun doom-modeline-def-modeline (name lhs &optional rhs) (defun doom-modeline-def-modeline (name lhs &optional rhs)
"Defines a modeline format and byte-compiles it. "Defines a modeline format and byte-compiles it.
NAME is a symbol to identify it (used by `doom-modeline' for retrieval). NAME is a symbol to identify it (used by `doom-modeline' for retrieval).
LHS and RHS are lists of symbols of modeline segments defined with LHS and RHS are lists of symbols of modeline segments defined with
`doom-modeline-def-segment'. `doom-modeline-def-segment'.
@ -352,7 +351,6 @@ active.")
(defun doom-modeline (key) (defun doom-modeline (key)
"Return a mode-line configuration associated with KEY (a symbol). "Return a mode-line configuration associated with KEY (a symbol).
Throws an error if it doesn't exist." Throws an error if it doesn't exist."
(let ((fn (intern-soft (format "doom-modeline-format--%s" key)))) (let ((fn (intern-soft (format "doom-modeline-format--%s" key))))
(when (functionp fn) (when (functionp fn)
@ -360,7 +358,6 @@ active.")
(defun doom-modeline-set-modeline (key &optional default) (defun doom-modeline-set-modeline (key &optional default)
"Set the modeline format. Does nothing if the modeline KEY doesn't exist. "Set the modeline format. Does nothing if the modeline KEY doesn't exist.
If DEFAULT is non-nil, set the default mode-line for all buffers." If DEFAULT is non-nil, set the default mode-line for all buffers."
(when-let ((modeline (doom-modeline key))) (when-let ((modeline (doom-modeline key)))
(setf (if default (setf (if default
@ -613,7 +610,6 @@ If TRUNCATE-TAIL is t also truncate the parent directory of the file."
(defun doom-modeline--buffer-file-name (file-path _true-file-path &optional truncate-project-root-parent truncate-project-relative-path hide-project-root-parent) (defun doom-modeline--buffer-file-name (file-path _true-file-path &optional truncate-project-root-parent truncate-project-relative-path hide-project-root-parent)
"Propertized variable `buffer-file-name' given by FILE-PATH. "Propertized variable `buffer-file-name' given by FILE-PATH.
If TRUNCATE-PROJECT-ROOT-PARENT is non-nil will be saved by truncating project If TRUNCATE-PROJECT-ROOT-PARENT is non-nil will be saved by truncating project
root parent down fish-shell style. root parent down fish-shell style.
@ -755,7 +751,6 @@ buffer where knowing the current project directory is important."
(defun doom-modeline-fix-buffer-file-name () (defun doom-modeline-fix-buffer-file-name ()
"Fix buffer file name in mode-line. "Fix buffer file name in mode-line.
Show buffer name if it doesn't equal the file name. Show buffer name if it doesn't equal the file name.
Format: \"buffer-file-name[buffer-name]\". Format: \"buffer-file-name[buffer-name]\".
Except the same buffer names in different directories." Except the same buffer names in different directories."
@ -1115,8 +1110,10 @@ Requires `anzu', also `evil-anzu' if using `evil-mode' for compatibility with
(doom-modeline-def-segment matches (doom-modeline-def-segment matches
"Displays: 1. the currently recording macro, 2. A current/total for the "Displays: 1. the currently recording macro, 2. A current/total for the
current search term (with anzu), 3. The number of substitutions being conducted current search term (with `anzu'), 3. The number of substitutions being conducted
with `evil-ex-substitute', and/or 4. The number of active `iedit' regions." with `evil-ex-substitute', and/or 4. The number of active `iedit' regions,
5. The current/total for the highlight term (with `symbol-overlay'), 6. The number
of active `multiple-cursors'."
(let ((meta (concat (doom-modeline--macro-recording) (let ((meta (concat (doom-modeline--macro-recording)
(doom-modeline--anzu) (doom-modeline--anzu)
(doom-modeline--evil-substitute) (doom-modeline--evil-substitute)
@ -1181,7 +1178,6 @@ with `evil-ex-substitute', and/or 4. The number of active `iedit' regions."
;; HACK: `ace-window-display-mode' should respect the ignore buffers. ;; HACK: `ace-window-display-mode' should respect the ignore buffers.
(defun doom-modeline-aw-update () (defun doom-modeline-aw-update ()
"Update ace-window-path window parameter for all windows. "Update ace-window-path window parameter for all windows.
Ensure all windows are labeled so the user can select a specific Ensure all windows are labeled so the user can select a specific
one. The ignored buffers are excluded unless `aw-ignore-on' is nil." one. The ignored buffers are excluded unless `aw-ignore-on' is nil."
(let ((ignore-window-parameters t)) (let ((ignore-window-parameters t))
@ -1227,8 +1223,8 @@ one. The ignored buffers are excluded unless `aw-ignore-on' is nil."
;; ;;
(doom-modeline-def-segment workspace-number (doom-modeline-def-segment workspace-number
"The current workspace name or number. Requires `eyebrowse-mode' to be "The current workspace name or number.
enabled." Requires `eyebrowse-mode' to be enabled."
(if (and (bound-and-true-p eyebrowse-mode) (if (and (bound-and-true-p eyebrowse-mode)
(< 1 (length (eyebrowse--get 'window-configs)))) (< 1 (length (eyebrowse--get 'window-configs))))
(let* ((num (eyebrowse--get 'current-slot)) (let* ((num (eyebrowse--get 'current-slot))