General refactor of modules

General code and comment improvements.

Also, removed the :desc's for csv-mode because map! is currently unable
to set which-key descriptions mode-locally, and should be avoided for
anything but global keybinds. This will be fixed when General is
introduced into Doom.
This commit is contained in:
Henrik Lissner 2018-09-07 22:08:11 -04:00
parent 89b83f2457
commit c58077810d
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395
15 changed files with 59 additions and 57 deletions

View file

@ -27,14 +27,14 @@
;;;###autoload
(defun +cc-c++-lineup-inclass (langelem)
"Indent inclass lines one level further than access modifier keywords."
(when (and (eq major-mode 'c++-mode)
(or (assoc 'access-label c-syntactic-context)
(save-excursion
(save-match-data
(re-search-backward
"\\(?:p\\(?:ublic\\|r\\(?:otected\\|ivate\\)\\)\\)"
(c-langelem-pos langelem) t)))))
'++))
(and (eq major-mode 'c++-mode)
(or (assoc 'access-label c-syntactic-context)
(save-excursion
(save-match-data
(re-search-backward
"\\(?:p\\(?:ublic\\|r\\(?:otected\\|ivate\\)\\)\\)"
(c-langelem-pos langelem) t))))
'++))
;;;###autoload
(defun +cc-lineup-arglist-close (langlem)
@ -55,10 +55,9 @@ preceded by the opening brace or a comma (disregarding whitespace in between)."
(re-search-forward regexp magic-mode-regexp-match-limit t)))))
;;;###autoload
(defun +cc-c-c++-objc-mode (&optional file)
(defun +cc-c-c++-objc-mode ()
"Sets either `c-mode', `objc-mode' or `c++-mode', whichever is appropriate."
(let ((base (file-name-sans-extension buffer-file-name))
file)
(let ((base (file-name-sans-extension (buffer-file-name (buffer-base-buffer)))))
(cond ((file-exists-p! (or (concat base ".cpp")
(concat base ".cc")))
(c++-mode))
@ -83,6 +82,8 @@ preceded by the opening brace or a comma (disregarding whitespace in between)."
"\\|" "#include" ws-maybe "<\\(?:string\\|iostream\\|map\\)>"
"\\)")))
(c++-mode))
((functionp +cc-default-header-file-mode)
(funcall +cc-default-header-file-mode))
((c-mode)))))