all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#23887: 25.1.50; Detect aliases to built-in functions
@ 2016-07-03  9:13 Tino Calancha
  2016-07-04 16:39 ` Glenn Morris
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Tino Calancha @ 2016-07-03  9:13 UTC (permalink / raw)
  To: 23887


emacs -Q

F1 f search-forward-regexp RET
;; First line don't mention that the func is an alias
;; Compare, for instance, with
F1 f chmod RET


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
From 48dcc336e96bbd22250eaee7e3a46c91b7ede1a1 Mon Sep 17 00:00:00 2001
From: Tino Calancha <tino.calancha@gmail.com>
Date: Sun, 3 Jul 2016 18:01:24 +0900
Subject: [PATCH] Detect aliases to built-in functions

* lisp/help-fns.el (describe-function-1): Check for aliases
defined with (defalias alias (symbol-function built-in)) (Bug#23887).
---
  lisp/help-fns.el | 16 ++++++++++------
  1 file changed, 10 insertions(+), 6 deletions(-)

diff --git a/lisp/help-fns.el b/lisp/help-fns.el
index 9464c0b..e4e2333 100644
--- a/lisp/help-fns.el
+++ b/lisp/help-fns.el
@@ -572,13 +572,17 @@ describe-function-1
  	 (aliased (or (symbolp def)
  		      ;; Advised & aliased function.
  		      (and advised (symbolp real-function)
-			   (not (eq 'autoload (car-safe def))))))
+			   (not (eq 'autoload (car-safe def))))
+                      (and (subrp def)
+                           (not (string= (subr-name def)
+                                         (symbol-name function))))))
  	 (real-def (cond
-		    (aliased (let ((f real-function))
-			       (while (and (fboundp f)
-					   (symbolp (symbol-function f)))
-				 (setq f (symbol-function f)))
-			       f))
+                    ((and aliased (not (subrp def)))
+                     (let ((f real-function))
+                       (while (and (fboundp f)
+                                   (symbolp (symbol-function f)))
+                         (setq f (symbol-function f)))
+                       f))
  		    ((subrp def) (intern (subr-name def)))
  		    (t def)))
  	 (sig-key (if (subrp def)
-- 
2.8.1



In GNU Emacs 25.1.50.1 (x86_64-pc-linux-gnu, GTK+ Version 3.20.6)
of 2016-07-03 built
Repository revision: 08974112ae68aefba658a8516c8faa3374edc924






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

* bug#23887: 25.1.50; Detect aliases to built-in functions
  2016-07-03  9:13 bug#23887: 25.1.50; Detect aliases to built-in functions Tino Calancha
@ 2016-07-04 16:39 ` Glenn Morris
  2016-07-05  7:24   ` Tino Calancha
  2016-07-09 10:50 ` Eli Zaretskii
  2016-07-09 14:03 ` bug#23887: (no subject) Tino Calancha
  2 siblings, 1 reply; 7+ messages in thread
From: Glenn Morris @ 2016-07-04 16:39 UTC (permalink / raw)
  To: Tino Calancha; +Cc: 23887


Describe-function really needs some ert test writing IMO, because these
cases that it gets wrong keep cropping up.





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

* bug#23887: 25.1.50; Detect aliases to built-in functions
  2016-07-04 16:39 ` Glenn Morris
@ 2016-07-05  7:24   ` Tino Calancha
  2016-07-05 15:53     ` Glenn Morris
  0 siblings, 1 reply; 7+ messages in thread
From: Tino Calancha @ 2016-07-05  7:24 UTC (permalink / raw)
  To: Glenn Morris; +Cc: Tino Calancha, 23887



On Mon, 4 Jul 2016, Glenn Morris wrote:

>
> Describe-function really needs some ert test writing IMO, because these
> cases that it gets wrong keep cropping up.
I have added several tests to describe-function in
test/lisp/help-fns-tests.el





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

* bug#23887: 25.1.50; Detect aliases to built-in functions
  2016-07-05  7:24   ` Tino Calancha
@ 2016-07-05 15:53     ` Glenn Morris
  2016-07-05 16:13       ` Tino Calancha
  0 siblings, 1 reply; 7+ messages in thread
From: Glenn Morris @ 2016-07-05 15:53 UTC (permalink / raw)
  To: Tino Calancha; +Cc: 23887

Tino Calancha wrote:

> I have added several tests to describe-function in
> test/lisp/help-fns-tests.el

Thank you. I see you added one for this current case too?
Personally I don't like to add failing tests, since it causes stuff like

http://lists.gnu.org/archive/html/emacs-buildstatus/2016-07/msg00005.html

which can mask unexpected failures.

You could either have left it commented out till this issue was fixed,
or given it ":expected-result :failed", which would prompt us to change
it when this issue is fixed.





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

* bug#23887: 25.1.50; Detect aliases to built-in functions
  2016-07-05 15:53     ` Glenn Morris
@ 2016-07-05 16:13       ` Tino Calancha
  0 siblings, 0 replies; 7+ messages in thread
From: Tino Calancha @ 2016-07-05 16:13 UTC (permalink / raw)
  To: Glenn Morris; +Cc: Tino Calancha, 23887

> Thank you. I see you added one for this current case too?
> Personally I don't like to add failing tests, since it causes stuff like
>
> http://lists.gnu.org/archive/html/emacs-buildstatus/2016-07/msg00005.html
>
> which can mask unexpected failures.
Opps! Very sorry about that :-S

> You could either have left it commented out till this issue was fixed,
> or given it ":expected-result :failed", which would prompt us to change
> it when this issue is fixed.
I have chosen the second option, addding
":expected-result :failed"

Sorry for the inconvenients.
Tino





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

* bug#23887: 25.1.50; Detect aliases to built-in functions
  2016-07-03  9:13 bug#23887: 25.1.50; Detect aliases to built-in functions Tino Calancha
  2016-07-04 16:39 ` Glenn Morris
@ 2016-07-09 10:50 ` Eli Zaretskii
  2016-07-09 14:03 ` bug#23887: (no subject) Tino Calancha
  2 siblings, 0 replies; 7+ messages in thread
From: Eli Zaretskii @ 2016-07-09 10:50 UTC (permalink / raw)
  To: Tino Calancha; +Cc: 23887

> From: Tino Calancha <tino.calancha@gmail.com>
> Date: Sun, 3 Jul 2016 18:13:02 +0900 (JST)
> 
> emacs -Q
> 
> F1 f search-forward-regexp RET
> ;; First line don't mention that the func is an alias
> ;; Compare, for instance, with
> F1 f chmod RET
> 
> 
> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
> >From 48dcc336e96bbd22250eaee7e3a46c91b7ede1a1 Mon Sep 17 00:00:00 2001
> From: Tino Calancha <tino.calancha@gmail.com>
> Date: Sun, 3 Jul 2016 18:01:24 +0900
> Subject: [PATCH] Detect aliases to built-in functions
> 
> * lisp/help-fns.el (describe-function-1): Check for aliases
> defined with (defalias alias (symbol-function built-in)) (Bug#23887).

Thanks, please push to master (and uncomment the test that presently
fails).





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

* bug#23887: (no subject)
  2016-07-03  9:13 bug#23887: 25.1.50; Detect aliases to built-in functions Tino Calancha
  2016-07-04 16:39 ` Glenn Morris
  2016-07-09 10:50 ` Eli Zaretskii
@ 2016-07-09 14:03 ` Tino Calancha
  2 siblings, 0 replies; 7+ messages in thread
From: Tino Calancha @ 2016-07-09 14:03 UTC (permalink / raw)
  To: 23887-done

Fixed in master branch





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

end of thread, other threads:[~2016-07-09 14:03 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-07-03  9:13 bug#23887: 25.1.50; Detect aliases to built-in functions Tino Calancha
2016-07-04 16:39 ` Glenn Morris
2016-07-05  7:24   ` Tino Calancha
2016-07-05 15:53     ` Glenn Morris
2016-07-05 16:13       ` Tino Calancha
2016-07-09 10:50 ` Eli Zaretskii
2016-07-09 14:03 ` bug#23887: (no subject) Tino Calancha

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.