5
5
6
6
<p align =" right" >
7
7
8
- Revision 1.23
8
+ Revision 1.28
9
9
</p >
10
10
11
11
@@ -665,16 +665,35 @@ Robert Brown
665
665
<p >
666
666
Indent your code the way a properly configured GNU Emacs does.
667
667
</p >
668
+ <p >
669
+ Maintain a consistent indentation style throughout a project.
670
+ </p >
668
671
<p >
669
672
Indent carefully to make the code easier to understand.
670
673
</p >
671
674
</SUMMARY >
672
675
<BODY >
673
676
<p >
674
- By default, GNU Emacs does an excellent job indenting Common Lisp code.
675
- It can be taught how to indent new defining forms
676
- and special rules for domain specific languages.
677
- Each project may have some file to customize indentation; use it.
677
+ Common Lisp indentation in Emacs is provided by the cl-indent library.
678
+ The latest version of cl-indent is packaged with
679
+ <a HREF =" http://www.common-lisp.net/project/slime/" >SLIME</a >
680
+ (under contrib/slime-cl-indent.el). After installing SLIME, set up Emacs
681
+ to load SLIME automatically using
682
+ <a HREF =" http://www.common-lisp.net/project/slime/doc/html/Loading-Contribs.html" >these instructions</a >, adding slime-indentation to the list of
683
+ contrib libraries to be loaded in the call to slime-setup.
684
+ </p >
685
+ <p >
686
+ Ideally, use the default indentation settings provided by
687
+ slime-indentation. If necessary, customize indentation parameters to
688
+ maintain a consistent indentation style throughout an existing project.
689
+ Parameters can be customized using the :variables setting in
690
+ define-common-lisp-style. Indentation of specific forms can be
691
+ customized using the :indentation setting of define-common-lisp-style.
692
+ This is particularly useful when creating forms that behave like macros
693
+ or special operators that are indented differently than standard
694
+ function calls (e.g. defun, labels, or let). Add a
695
+ <a HREF =" http://www.gnu.org/software/emacs/manual/html_node/emacs/Hooks.html" >hook</a > to 'lisp-mode-hook that calls common-lisp-set-style to set
696
+ the appropriate style automatically.
678
697
</p >
679
698
680
699
@@ -728,27 +747,25 @@ Robert Brown
728
747
that is not covered by an <code >ASDF</code > <code >:around-compile</code > hook.
729
748
</p >
730
749
<CODE_SNIPPET >
731
- ;;;; Author: brown (Robert Brown)
732
-
733
750
;;;; Variable length encoding for integers and floating point numbers.
734
751
735
752
(in-package #:varint)
736
753
(declaim #.*optimize-default*)
737
754
</CODE_SNIPPET >
738
755
<p >
739
- You should not include authorship information at the top of a file,
740
- that information is available from version control and
741
- <code >OWNERS</code >.
756
+ You should not include authorship information at the top of a file:
757
+ better information is available from version control,
758
+ and such a mention will only cause confusion and grief.
759
+ Indeed, whoever was the main author at the time such a mention was included
760
+ might not be who eventually made the most significant contributions to the file,
761
+ and even less who is responsible for the file at the moment.
762
+
742
763
</p >
743
764
<p >
744
765
You should not include copyright information in individual source code files.
745
766
An exception is made for files meant to be disseminated as standalone.
746
767
</p >
747
- <p >
748
- Each project or library has a single file specifying its license.
749
- Absence of a <tt >LICENSE</tt > or <tt >COPYING</tt > file
750
- means the project is proprietary code.
751
- </p >
768
+
752
769
753
770
</BODY >
754
771
</STYLEPOINT >
@@ -1109,12 +1126,19 @@ Robert Brown
1109
1126
</p >
1110
1127
<p >
1111
1128
The comments begin with <code >TODO</code > in all capital letters,
1112
- followed by your email address or other identifier in parentheses,
1113
- followed by a colon, a space, and
1114
- an explanation of what additional work is desirable or required.
1115
- The user name included in the comment is that
1116
- of a person who understands the deficiency.
1117
- A TODO comment is not a commitment to fix the problem.
1129
+ followed by the
1130
+
1131
+ name, e-mail address, or other identifier
1132
+ of the person
1133
+ with the best context about the problem referenced by the <code >TODO</code >.
1134
+ The main purpose is to have a consistent <code >TODO</code > that
1135
+ can be searched to find out how to get more details upon
1136
+ request. A <code >TODO</code > is not a commitment that the
1137
+ person referenced will fix the problem. Thus when you create
1138
+ a <code >TODO</code >,
1139
+ it is almost always your
1140
+ name
1141
+ that is given.
1118
1142
</p >
1119
1143
<p >
1120
1144
When signing comments,
@@ -1128,10 +1152,13 @@ Robert Brown
1128
1152
</CODE_SNIPPET >
1129
1153
<p >
1130
1154
Be specific when indicating times or software releases
1131
- in a TODO comment:
1155
+ in a TODO comment and use
1156
+ <a HREF =" http://www.w3.org/TR/NOTE-datetime" >YYYY-MM-DD</a >
1157
+ format for dates to make automated processing of such dates easier,
1158
+ e.g., 2038-01-20 for the end of the 32-bit signed <code >time_t</code >.
1132
1159
</p >
1133
1160
<CODE_SNIPPET >
1134
- ;;--- TODO(brown): Remove this code after release 1.7 or before November, 2012.
1161
+ ;;--- TODO(brown): Remove this code after release 1.7 or before 2012-11-30 .
1135
1162
</CODE_SNIPPET >
1136
1163
<p >
1137
1164
For code that uses unobvious forms to accomplish a task, you must include a comment
@@ -3674,7 +3701,7 @@ Robert Brown
3674
3701
which matters a lot on non-Unix platforms
3675
3702
(and even on some Unix implementations).
3676
3703
You probably should be using
3677
- <code >UIOP:MERGE-PATHNAMES*</code >
3704
+ <code >UIOP:MERGE-PATHNAMES*</code > or < code >UIOP:SUBPATHNAME</ code >
3678
3705
instead of <code >MERGE-PATHNAMES</code >,
3679
3706
especially if your expectations for relative pathnames
3680
3707
are informed by the way they work in Unix or Windows;
@@ -3690,7 +3717,10 @@ Robert Brown
3690
3717
is not portable across implementations
3691
3718
in how it handles wildcards, sub-directories, symlinks, etc.
3692
3719
There again, <code >UIOP</code > provides several
3693
- common abstractions to deal with pathnames.
3720
+ common abstractions to deal with pathnames,
3721
+ but only does so good a job.
3722
+ For a complete portable solution, use IOLib —
3723
+ though its Windows support lags behind.
3694
3724
</p >
3695
3725
<p >
3696
3726
<code >LOGICAL-PATHNAME</code >s are not a portable abstraction,
@@ -3716,7 +3746,7 @@ Robert Brown
3716
3746
to forget irrelevant build-time paths and
3717
3747
reinitialize any search path from current environment variables.
3718
3748
<code >ASDF</code > for instance requires you to reset its paths
3719
- with <code >ASDF :CLEAR-CONFIGURATION</code >.
3749
+ with <code >UIOP :CLEAR-CONFIGURATION</code >.
3720
3750
<code >UIOP</code > provides hooks
3721
3751
to call functions before an image is dumped,
3722
3752
from which to reset or <code >makunbound</code > relevant variables.
@@ -3840,7 +3870,7 @@ Robert Brown
3840
3870
</small >
3841
3871
3842
3872
<p align =" right" >
3843
- Revision 1.23
3873
+ Revision 1.28
3844
3874
</p >
3845
3875
3846
3876
0 commit comments