Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

google-c-style.el: Fix stylistic issues found by Checkdoc #674

Open
wants to merge 1 commit into
base: gh-pages
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 9 additions & 8 deletions google-c-style.el
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@

;;; Commentary:

;; Provides the google C/C++ coding style. You may wish to add
;; Provides the google C/C++ coding style. You may wish to add
;; `google-set-c-style' to your `c-mode-common-hook' after requiring this
;; file. For example:
;; file. For example:
;;
;; (add-hook 'c-mode-common-hook 'google-set-c-style)
;;
Expand All @@ -35,7 +35,7 @@
;; elegant solution of composing a list of lineup functions or quantities with
;; operators such as "add")
(defun google-c-lineup-expression-plus-4 (langelem)
"Indents to the beginning of the current C expression plus 4 spaces.
"Indent to the beginning of the current C expression plus 4 spaces.

This implements title \"Function Declarations and Definitions\"
of the Google C++ Style Guide for the case where the previous
Expand All @@ -47,7 +47,8 @@ regardless of the number of nested parentheses, but excluding
non-expression material such as \"if(\" and \"for(\" control
structures.

Suitable for inclusion in `c-offsets-alist'."
Suitable for inclusion in `c-offsets-alist'.
See `c-offsets-alist' for a definition of LANGELEM."
(save-excursion
(back-to-indentation)
;; Go to beginning of *previous* line:
Expand Down Expand Up @@ -132,17 +133,17 @@ Suitable for inclusion in `c-offsets-alist'."

;;;###autoload
(defun google-set-c-style ()
"Set the current buffer's c-style to Google C/C++ Programming
Style. Meant to be added to `c-mode-common-hook'."
"Set the current buffer's c-style to Google C/C++ Programming Style.
Meant to be added to `c-mode-common-hook'."
(interactive)
(make-local-variable 'c-tab-always-indent)
(setq c-tab-always-indent t)
(c-add-style "Google" google-c-style t))

;;;###autoload
(defun google-make-newline-indent ()
"Sets up preferred newline behavior. Not set by default. Meant
to be added to `c-mode-common-hook'."
"Set up preferred newline behavior.
Not set by default. Meant to be added to `c-mode-common-hook'."
(interactive)
(define-key c-mode-base-map "\C-m" 'newline-and-indent)
(define-key c-mode-base-map [ret] 'newline-and-indent))
Expand Down