GNU bug report logs - #35433
27.0.50; 'function' docstring: tell more about advantages?

Previous Next

Package: emacs;

Reported by: Michael Heerdegen <michael_heerdegen <at> web.de>

Date: Fri, 26 Apr 2019 03:41:01 UTC

Severity: wishlist

Found in version 27.0.50

Done: Michael Heerdegen <michael_heerdegen <at> web.de>

Bug is archived. No further changes may be made.

Full log


Message #17 received at 35433 <at> debbugs.gnu.org (full text, mbox):

From: Michael Heerdegen <michael_heerdegen <at> web.de>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 35433 <at> debbugs.gnu.org
Subject: Re: bug#35433: 27.0.50;
 'function' docstring: tell more about advantages?
Date: Thu, 23 May 2019 01:39:49 +0200
[Message part 1 (text/plain, inline)]
Eli Zaretskii <eliz <at> gnu.org> writes:

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

Ehm - maybe.

Ok, is this ok and are all conventions respected?

[0001-Improve-documentation-of-the-function-special-form.patch (text/x-diff, inline)]
From 5ac1f0de47720a19225d71e83b906192940a6917 Mon Sep 17 00:00:00 2001
From: Michael Heerdegen <michael_heerdegen <at> web.de>
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
documentation.
---
 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)
 {
--
2.20.1

[Message part 3 (text/plain, inline)]

Thanks,

Michael.

This bug report was last modified 6 years ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.