From a2835ab38edcbd583f87998813ebf36abe110165 Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Wed, 21 Oct 2020 01:50:50 +0200 Subject: [PATCH] Recommend lexical-binding in Coding Conventions * doc/lispref/tips.texi (Coding Conventions, Library Headers): Recommend using lexical-binding. --- doc/lispref/tips.texi | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/doc/lispref/tips.texi b/doc/lispref/tips.texi index 5b09b2ccea..6bed53f263 100644 --- a/doc/lispref/tips.texi +++ b/doc/lispref/tips.texi @@ -94,6 +94,11 @@ Coding Conventions If one prefix is insufficient, your package can use two or three alternative common prefixes, so long as they make sense. +@item +We recommended to enable @code{lexical-binding} in new code, and to +convert existing Emacs Lisp code to use lexical binding if it doesn't +already. @xref{Using Lexical Binding}. + @item Put a call to @code{provide} at the end of each separate Lisp file. @xref{Named Features}. @@ -963,7 +968,7 @@ Library Headers @smallexample @group -;;; foo.el --- Support for the Foo programming language +;;; foo.el --- Support for the Foo programming language -*- lexical-binding: t; -*- ;; Copyright (C) 2010-2020 Your Name @end group @@ -986,14 +991,14 @@ Library Headers The very first line should have this format: @example -;;; @var{filename} --- @var{description} +;;; @var{filename} --- @var{description} -*- lexical-binding: t; -*- @end example @noindent -The description should be contained in one line. If the file -needs a @samp{-*-} specification, put it after @var{description}. -If this would make the first line too long, use a Local Variables -section at the end of the file. +The description should be contained in one line. If the file needs to +set more variables in the @samp{-*-} specification, add it after +@code{lexical-binding}. If this would make the first line too long, use +a Local Variables section at the end of the file. The copyright notice usually lists your name (if you wrote the file). If you have an employer who claims copyright on your work, you -- 2.28.0