aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Kangas2020-10-21 01:50:50 +0200
committerStefan Kangas2020-10-22 20:28:59 +0200
commit8b87ea6844036c168c9ec67dd318ee3ba8dab5ae (patch)
tree36b5b60b4ffd731762d1253511a222495b5bafc9
parente29cace60afdab04ff20c4f4043a3ee64ec9d01d (diff)
downloademacs-8b87ea6844036c168c9ec67dd318ee3ba8dab5ae.tar.gz
emacs-8b87ea6844036c168c9ec67dd318ee3ba8dab5ae.zip
Recommend lexical-binding in Coding Conventions
* doc/lispref/tips.texi (Coding Conventions, Library Headers): Recommend using lexical-binding.
-rw-r--r--doc/lispref/tips.texi17
1 files changed, 11 insertions, 6 deletions
diff --git a/doc/lispref/tips.texi b/doc/lispref/tips.texi
index 5b09b2ccea6..4d6dcb9f834 100644
--- a/doc/lispref/tips.texi
+++ b/doc/lispref/tips.texi
@@ -95,6 +95,11 @@ If one prefix is insufficient, your package can use two or three
95alternative common prefixes, so long as they make sense. 95alternative common prefixes, so long as they make sense.
96 96
97@item 97@item
98We recommend enabling @code{lexical-binding} in new code, and
99converting existing Emacs Lisp code to enable @code{lexical-binding}
100if it doesn't already. @xref{Using Lexical Binding}.
101
102@item
98Put a call to @code{provide} at the end of each separate Lisp file. 103Put a call to @code{provide} at the end of each separate Lisp file.
99@xref{Named Features}. 104@xref{Named Features}.
100 105
@@ -963,7 +968,7 @@ explains these conventions, starting with an example:
963 968
964@smallexample 969@smallexample
965@group 970@group
966;;; foo.el --- Support for the Foo programming language 971;;; foo.el --- Support for the Foo programming language -*- lexical-binding: t; -*-
967 972
968;; Copyright (C) 2010-2020 Your Name 973;; Copyright (C) 2010-2020 Your Name
969@end group 974@end group
@@ -986,14 +991,14 @@ explains these conventions, starting with an example:
986 The very first line should have this format: 991 The very first line should have this format:
987 992
988@example 993@example
989;;; @var{filename} --- @var{description} 994;;; @var{filename} --- @var{description} -*- lexical-binding: t; -*-
990@end example 995@end example
991 996
992@noindent 997@noindent
993The description should be contained in one line. If the file 998The description should be contained in one line. If the file needs to
994needs a @samp{-*-} specification, put it after @var{description}. 999set more variables in the @samp{-*-} specification, add it after
995If this would make the first line too long, use a Local Variables 1000@code{lexical-binding}. If this would make the first line too long, use
996section at the end of the file. 1001a Local Variables section at the end of the file.
997 1002
998 The copyright notice usually lists your name (if you wrote the 1003 The copyright notice usually lists your name (if you wrote the
999file). If you have an employer who claims copyright on your work, you 1004file). If you have an employer who claims copyright on your work, you