GNU bug report logs - #23887
25.1.50; Detect aliases to built-in functions

Previous Next

Package: emacs;

Reported by: Tino Calancha <tino.calancha <at> gmail.com>

Date: Sun, 3 Jul 2016 09:14:01 UTC

Severity: normal

Found in version 25.1.50

Done: Tino Calancha <tino.calancha <at> gmail.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 23887 in the body.
You can then email your comments to 23887 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#23887; Package emacs. (Sun, 03 Jul 2016 09:14:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Tino Calancha <tino.calancha <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sun, 03 Jul 2016 09:14:02 GMT) Full text and rfc822 format available.

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

From: Tino Calancha <tino.calancha <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 25.1.50; Detect aliases to built-in functions
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 <at> 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





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#23887; Package emacs. (Mon, 04 Jul 2016 16:41:02 GMT) Full text and rfc822 format available.

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

From: Glenn Morris <rgm <at> gnu.org>
To: Tino Calancha <tino.calancha <at> gmail.com>
Cc: 23887 <at> debbugs.gnu.org
Subject: Re: bug#23887: 25.1.50; Detect aliases to built-in functions
Date: Mon, 04 Jul 2016 12:39:52 -0400
Describe-function really needs some ert test writing IMO, because these
cases that it gets wrong keep cropping up.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#23887; Package emacs. (Tue, 05 Jul 2016 07:26:02 GMT) Full text and rfc822 format available.

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

From: Tino Calancha <tino.calancha <at> gmail.com>
To: Glenn Morris <rgm <at> gnu.org>
Cc: 23887 <at> debbugs.gnu.org, Tino Calancha <tino.calancha <at> gmail.com>
Subject: Re: bug#23887: 25.1.50; Detect aliases to built-in functions
Date: Tue, 5 Jul 2016 16:24:58 +0900 (JST)

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




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#23887; Package emacs. (Tue, 05 Jul 2016 15:54:01 GMT) Full text and rfc822 format available.

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

From: Glenn Morris <rgm <at> gnu.org>
To: Tino Calancha <tino.calancha <at> gmail.com>
Cc: 23887 <at> debbugs.gnu.org
Subject: Re: bug#23887: 25.1.50; Detect aliases to built-in functions
Date: Tue, 05 Jul 2016 11:53:36 -0400
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.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#23887; Package emacs. (Tue, 05 Jul 2016 16:14:01 GMT) Full text and rfc822 format available.

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

From: Tino Calancha <tino.calancha <at> gmail.com>
To: Glenn Morris <rgm <at> gnu.org>
Cc: 23887 <at> debbugs.gnu.org, Tino Calancha <tino.calancha <at> gmail.com>
Subject: Re: bug#23887: 25.1.50; Detect aliases to built-in functions
Date: Wed, 6 Jul 2016 01:13:42 +0900 (JST)
> 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




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#23887; Package emacs. (Sat, 09 Jul 2016 10:51:02 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Tino Calancha <tino.calancha <at> gmail.com>
Cc: 23887 <at> debbugs.gnu.org
Subject: Re: bug#23887: 25.1.50; Detect aliases to built-in functions
Date: Sat, 09 Jul 2016 13:50:36 +0300
> From: Tino Calancha <tino.calancha <at> 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 <at> 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).




Reply sent to Tino Calancha <tino.calancha <at> gmail.com>:
You have taken responsibility. (Sat, 09 Jul 2016 14:04:02 GMT) Full text and rfc822 format available.

Notification sent to Tino Calancha <tino.calancha <at> gmail.com>:
bug acknowledged by developer. (Sat, 09 Jul 2016 14:04:02 GMT) Full text and rfc822 format available.

Message #25 received at 23887-done <at> debbugs.gnu.org (full text, mbox):

From: Tino Calancha <tino.calancha <at> gmail.com>
To: 23887-done <at> debbugs.gnu.org
Date: Sat, 9 Jul 2016 23:03:04 +0900 (JST)
Fixed in master branch




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sun, 07 Aug 2016 11:24:03 GMT) Full text and rfc822 format available.

This bug report was last modified 7 years and 267 days ago.

Previous Next


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