Subject: bug#23887: closed ()

From: [email-masked] (GNU bug Tracking System)
Date: Sat, 09 Jul 2016 14:04:02 +0000

Your bug report

#23887: 25.1.50; Detect aliases to built-in functions

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
23887: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=23887
GNU Bug Tracking System
Contact [email-masked] with problems

From: Tino Calancha <[email-masked]>
To: [email-masked]
Date: Sat, 9 Jul 2016 23:03:04 +0900 (JST)
List-Id: <debbugs-submit.debbugs.gnu.org>

Fixed in master branch

Subject: 25.1.50; Detect aliases to built-in functions
From: Tino Calancha <[email-masked]>
To: [email-masked]
Date: Sun, 3 Jul 2016 18:13:02 +0900 (JST)
List-Id: <debbugs-submit.debbugs.gnu.org>

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 <[email-masked]>
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