@@ -42,6 +42,7 @@ You can generate a PDF or an HTML copy of this guide using
42
42
* [ Anonymous (lambda) functions] ( #anonymous-lambda-functions )
43
43
* [ Comments] ( #comments )
44
44
* [ Comment Annotations] ( #comment-annotations )
45
+ * [ Docstrings] ( #docstrings )
45
46
* [ Existential] ( #existential )
46
47
47
48
## Source Code Layout & Organization
@@ -502,6 +503,26 @@ at all.
502
503
* Use other custom annotation keywords if it feels appropriate, but be
503
504
sure to document them in your project's `README` or similar.
504
505
506
+ ### Docstrings
507
+
508
+ Emacs is famous for the breadth, depth, and ubiquity of its
509
+ documentation. By taking the time to write docstrings in your package,
510
+ you are helping to continue that tradition!
511
+
512
+ * Begin with a terse, complete sentence. Use imperative language. For
513
+ example, prefer "Verify" over "Verifies", and "Check" over "Checks".
514
+
515
+ * When a function takes arguments, mention what the arguments do,
516
+ whether they are required, and so on. Describe the arguments in
517
+ UPCASE, and order them as they are used.
518
+
519
+ * Always capitalize "Emacs".
520
+
521
+ * Emacs' built-in utility, Checkdoc, can automatically check
522
+ docstrings for adherence to coding conventions with the built-in
523
+ Checkdoc utility. Many in the Emacs community use Checkdoc by way of
524
+ [Flycheck](http://flycheck.readthedocs.org/en/latest/).
525
+
505
526
## Existential
506
527
507
528
* Be consistent. In an ideal world, be consistent with these guidelines.
0 commit comments