emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] master c3223dd: Detect aliases to built-in functions


From: Tino Calancha
Subject: [Emacs-diffs] master c3223dd: Detect aliases to built-in functions
Date: Sat, 9 Jul 2016 14:01:16 +0000 (UTC)

branch: master
commit c3223dd505ba0ecde57371eae7e9a59637a852e4
Author: Tino Calancha <address@hidden>
Commit: Tino Calancha <address@hidden>

    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).
    
    * test/lisp/help-fns-tests.el (help-fns-test-bug23887): Untag as
    failing this test.
---
 lisp/help-fns.el            |   16 ++++++++++------
 test/lisp/help-fns-tests.el |    1 -
 2 files changed, 10 insertions(+), 7 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 @@ FILE is the file where FUNCTION was probably defined."
         (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)
diff --git a/test/lisp/help-fns-tests.el b/test/lisp/help-fns-tests.el
index 4239a2a..ba0d8ed 100644
--- a/test/lisp/help-fns-tests.el
+++ b/test/lisp/help-fns-tests.el
@@ -77,7 +77,6 @@ Return first line of the output of (describe-function-1 
FUNC)."
 
 (ert-deftest help-fns-test-bug23887 ()
   "Test for http://debbugs.gnu.org/23887 ."
-  :expected-result :failed
   (let ((regexp "an alias for .re-search-forward. in .subr\.el")
         (result (help-fns-tests--describe-function 'search-forward-regexp)))
     (should (string-match regexp result))))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]