unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#19118: 25.0.50; [patch] Change the argument names of function-put (currently: "ARG1 ARG2 ARG3")
@ 2014-11-20 11:33 Nicolas Richard
  2014-11-20 16:34 ` Eli Zaretskii
  2014-11-21  2:56 ` Stefan Monnier
  0 siblings, 2 replies; 5+ messages in thread
From: Nicolas Richard @ 2014-11-20 11:33 UTC (permalink / raw)
  To: 19118

Hello,

From -Q,

C-h f function-put RET gives:
> (function-put ARG1 ARG2 ARG3)

> Set function F's property PROP to VALUE.
> The namespace for PROP is shared with symbols.
> So far, F can only be a symbol, not a lambda expression.

I have the following patch -- is it ok to apply ?

From 189ed20be419f0fb7edf0fd103e9df1d408136b9 Mon Sep 17 00:00:00 2001
From: Nicolas Richard <theonewiththeevillook@yahoo.fr>
Date: Thu, 20 Nov 2014 12:09:30 +0100
Subject: [PATCH] byte-run.el (function-put): Match argument names to
 docstring.

---
 lisp/ChangeLog              | 5 +++++
 lisp/emacs-lisp/byte-run.el | 8 +++++---
 2 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 6fa23de..ba0ca35 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,8 @@
+2014-11-20  Nicolas Richard  <theonewiththeevillook@yahoo.fr>
+
+	* emacs-lisp/byte-run.el (function-put): Match argument names to
+	docstring.
+
 2014-11-19  Lars Magne Ingebrigtsen  <larsi@gnus.org>
 
 	* net/eww.el (eww-render): Remove a no-op :title setting.
diff --git a/lisp/emacs-lisp/byte-run.el b/lisp/emacs-lisp/byte-run.el
index 1f8b04e..4481f00 100644
--- a/lisp/emacs-lisp/byte-run.el
+++ b/lisp/emacs-lisp/byte-run.el
@@ -34,10 +34,12 @@
   ;; We don't want people to just use `put' because we can't conveniently
   ;; hook into `put' to remap old properties to new ones.  But for now, there's
   ;; no such remapping, so we just call `put'.
-  #'(lambda (f prop value) (put f prop value))
-  "Set function F's property PROP to VALUE.
+  #'(lambda (function prop value) (put function prop value))
+  "Set function FUNCTION's property PROP to VALUE.
 The namespace for PROP is shared with symbols.
-So far, F can only be a symbol, not a lambda expression.")
+So far, FUNCTION can only be a symbol, not a lambda expression.
+
+\(fn FUNCTION PROP VALUE)")
 (function-put 'defmacro 'doc-string-elt 3)
 (function-put 'defmacro 'lisp-indent-function 2)
 
-- 
2.0.4

-- 
Nicolas Richard





^ permalink raw reply related	[flat|nested] 5+ messages in thread

* bug#19118: 25.0.50; [patch] Change the argument names of function-put (currently: "ARG1 ARG2 ARG3")
  2014-11-20 11:33 bug#19118: 25.0.50; [patch] Change the argument names of function-put (currently: "ARG1 ARG2 ARG3") Nicolas Richard
@ 2014-11-20 16:34 ` Eli Zaretskii
  2014-11-20 20:12   ` Nicolas Richard
  2014-11-21  2:56 ` Stefan Monnier
  1 sibling, 1 reply; 5+ messages in thread
From: Eli Zaretskii @ 2014-11-20 16:34 UTC (permalink / raw)
  To: Nicolas Richard; +Cc: 19118

> From: Nicolas Richard <theonewiththeevillook@yahoo.fr>
> Date: Thu, 20 Nov 2014 12:33:01 +0100
> 
> -  #'(lambda (f prop value) (put f prop value))
> -  "Set function F's property PROP to VALUE.
> +  #'(lambda (function prop value) (put function prop value))
> +  "Set function FUNCTION's property PROP to VALUE.
>  The namespace for PROP is shared with symbols.
> -So far, F can only be a symbol, not a lambda expression.")
> +So far, FUNCTION can only be a symbol, not a lambda expression.

Stylistically, "function FUNCTION" is tautology.  How about this
variant:

  Set FUNCTION's property PROP to VALUE.
  So far, FUNCTION can only be a function symbol, not a lambda expression.





^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#19118: 25.0.50; [patch] Change the argument names of function-put (currently: "ARG1 ARG2 ARG3")
  2014-11-20 16:34 ` Eli Zaretskii
@ 2014-11-20 20:12   ` Nicolas Richard
  0 siblings, 0 replies; 5+ messages in thread
From: Nicolas Richard @ 2014-11-20 20:12 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: Nicolas Richard, 19118

Eli Zaretskii <eliz@gnu.org> writes:
>> From: Nicolas Richard <theonewiththeevillook@yahoo.fr>
>> Date: Thu, 20 Nov 2014 12:33:01 +0100
>> 
>> -  #'(lambda (f prop value) (put f prop value))
>> -  "Set function F's property PROP to VALUE.
>> +  #'(lambda (function prop value) (put function prop value))
>> +  "Set function FUNCTION's property PROP to VALUE.
>>  The namespace for PROP is shared with symbols.
>> -So far, F can only be a symbol, not a lambda expression.")
>> +So far, FUNCTION can only be a symbol, not a lambda expression.
>
> Stylistically, "function FUNCTION" is tautology.  How about this
> variant:
>
>   Set FUNCTION's property PROP to VALUE.
>   So far, FUNCTION can only be a function symbol, not a lambda
> expression.

Thanks.

Are you suggesting that "The namespace for PROP is shared with symbols."
should be removed ? Btw, is that a fancy way of saying "PROP is a
symbol" ?

-- 
Nicolas





^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#19118: 25.0.50; [patch] Change the argument names of function-put (currently: "ARG1 ARG2 ARG3")
  2014-11-20 11:33 bug#19118: 25.0.50; [patch] Change the argument names of function-put (currently: "ARG1 ARG2 ARG3") Nicolas Richard
  2014-11-20 16:34 ` Eli Zaretskii
@ 2014-11-21  2:56 ` Stefan Monnier
  2014-11-25 12:57   ` Nicolas Richard
  1 sibling, 1 reply; 5+ messages in thread
From: Stefan Monnier @ 2014-11-21  2:56 UTC (permalink / raw)
  To: Nicolas Richard; +Cc: 19118

> +
> +\(fn FUNCTION PROP VALUE)")

I think that the better way to get the right args, is to use a normal
docstring, as in the patch below.  I can't remember why I used
a "defalias docstring" instead.


        Stefan


diff --git a/lisp/emacs-lisp/byte-run.el b/lisp/emacs-lisp/byte-run.el
index 1f8b04e..b1cc0f6 100644
--- a/lisp/emacs-lisp/byte-run.el
+++ b/lisp/emacs-lisp/byte-run.el
@@ -34,10 +34,11 @@
   ;; We don't want people to just use `put' because we can't conveniently
   ;; hook into `put' to remap old properties to new ones.  But for now, there's
   ;; no such remapping, so we just call `put'.
-  #'(lambda (f prop value) (put f prop value))
-  "Set function F's property PROP to VALUE.
+  #'(lambda (f prop value)
+      "Set function F's property PROP to VALUE.
 The namespace for PROP is shared with symbols.
-So far, F can only be a symbol, not a lambda expression.")
+So far, F can only be a symbol, not a lambda expression."
+      (put f prop value)))
 (function-put 'defmacro 'doc-string-elt 3)
 (function-put 'defmacro 'lisp-indent-function 2)
 





^ permalink raw reply related	[flat|nested] 5+ messages in thread

* bug#19118: 25.0.50; [patch] Change the argument names of function-put (currently: "ARG1 ARG2 ARG3")
  2014-11-21  2:56 ` Stefan Monnier
@ 2014-11-25 12:57   ` Nicolas Richard
  0 siblings, 0 replies; 5+ messages in thread
From: Nicolas Richard @ 2014-11-25 12:57 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: 19118-done

Le 21/11/2014 03:56, Stefan Monnier a écrit :>> +
>> +\(fn FUNCTION PROP VALUE)")
> 
> I think that the better way to get the right args, is to use a normal
> docstring, as in the patch below.  I can't remember why I used
> a "defalias docstring" instead.

Ok, I pushed

commit 8be099a2c10ce4718e6630cef6b6ca1983617264
Author: Nicolas Richard <theonewiththeevillook@yahoo.fr>
Date:   Thu Nov 20 12:09:30 2014 +0100

    byte-run.el (function-put): Match argument names to docstring (bug#19118).

to master. Closing the bug (and crossing my fingers I did not mess up anything).


-- 
Nico.






^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2014-11-25 12:57 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-11-20 11:33 bug#19118: 25.0.50; [patch] Change the argument names of function-put (currently: "ARG1 ARG2 ARG3") Nicolas Richard
2014-11-20 16:34 ` Eli Zaretskii
2014-11-20 20:12   ` Nicolas Richard
2014-11-21  2:56 ` Stefan Monnier
2014-11-25 12:57   ` Nicolas Richard

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).