[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#35433: 27.0.50; 'function' docstring: tell more about advantages?

From: Michael Heerdegen
Subject: bug#35433: 27.0.50; 'function' docstring: tell more about advantages?
Date: Thu, 23 May 2019 01:39:49 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)

Eli Zaretskii <address@hidden> writes:

> Fine with me (but you probably meant "byte compiler", not "by
> compiler").

Ehm - maybe.

Ok, is this ok and are all conventions respected?

From 5ac1f0de47720a19225d71e83b906192940a6917 Mon Sep 17 00:00:00 2001
From: Michael Heerdegen <address@hidden>
Date: Sat, 27 Apr 2019 09:40:10 +0200
Subject: [PATCH] Improve documentation of the 'function' special form

Point out that 'function' quoting is beneficial also for symbols.

* src/eval.c (function): Enhance docstring.
* doc/lispref/functions.texi (Anonymous Functions): Improve
 doc/lispref/functions.texi | 4 ++++
 src/eval.c                 | 4 ++--
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/doc/lispref/functions.texi b/doc/lispref/functions.texi
index 97f7fb9f79..09844318d9 100644
--- a/doc/lispref/functions.texi
+++ b/doc/lispref/functions.texi
@@ -1122,6 +1122,10 @@ Anonymous Functions
 When lexical binding is enabled, @var{function-object} is converted
 into a closure.  @xref{Closures}.
 @end itemize
+When @var{function-object} is a symbol and the code is byte compiled,
+the byte-compiler will warn should that function be undefined or may
+be unknown at run-time.
 @end defspec

 @cindex @samp{#'} syntax
diff --git a/src/eval.c b/src/eval.c
index 567c32e0d7..5bba876637 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -544,8 +544,8 @@ usage: (quote ARG)  */)

 DEFUN ("function", Ffunction, Sfunction, 1, UNEVALLED, 0,
        doc: /* Like `quote', but preferred for objects which are functions.
-In byte compilation, `function' causes its argument to be compiled.
-`quote' cannot do that.
+In byte compilation, `function' causes its argument to be handled by
+the byte compiler.  `quote' cannot do that.
 usage: (function ARG)  */)
   (Lisp_Object args)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]