summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGlenn Morris <rgm@gnu.org>2014-05-05 17:33:07 -0400
committerGlenn Morris <rgm@gnu.org>2014-05-05 17:33:07 -0400
commit6da8d069757fd26ee537704a9f0dea24dc5e00b8 (patch)
treeced4c72417f00aac34d6e40a8da67cfe07acf1ef
parente6025d7240197bfd47cf649c5976533da6869a6e (diff)
downloademacs-6da8d069757fd26ee537704a9f0dea24dc5e00b8.tar.gz
* lisp/help-fns.el (describe-function-1): Test for an autoload before a macro
since `macrop' works on autoloads. * test/automated/help-fns.el: New file. Fixes: debbugs:17410
-rw-r--r--lisp/ChangeLog5
-rw-r--r--lisp/help-fns.el13
-rw-r--r--test/ChangeLog4
-rw-r--r--test/automated/help-fns.el37
4 files changed, 52 insertions, 7 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 9b21fd8cd66..3bbacb85e97 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,8 @@
+2014-05-05 Glenn Morris <rgm@gnu.org>
+
+ * help-fns.el (describe-function-1): Test for an autoload before a
+ macro, since `macrop' works on autoloads. (Bug#17410)
+
2014-05-05 Stefan Monnier <monnier@iro.umontreal.ca>
* electric.el (electric-indent-functions-without-reindent): Add yaml.
diff --git a/lisp/help-fns.el b/lisp/help-fns.el
index a186254123d..5b0739ed9ae 100644
--- a/lisp/help-fns.el
+++ b/lisp/help-fns.el
@@ -1,7 +1,6 @@
;;; help-fns.el --- Complex help functions -*- lexical-binding: t -*-
-;; Copyright (C) 1985-1986, 1993-1994, 1998-2014 Free Software
-;; Foundation, Inc.
+;; Copyright (C) 1985-1986, 1993-1994, 1998-2014 Free Software Foundation, Inc.
;; Maintainer: emacs-devel@gnu.org
;; Keywords: help, internal
@@ -479,6 +478,11 @@ FILE is the file where FUNCTION was probably defined."
;; aliases before functions.
(aliased
(format "an alias for `%s'" real-def))
+ ((autoloadp def)
+ (format "%s autoloaded %s"
+ (if (commandp def) "an interactive" "an")
+ (if (eq (nth 4 def) 'keymap) "keymap"
+ (if (nth 4 def) "Lisp macro" "Lisp function"))))
((or (eq (car-safe def) 'macro)
;; For advised macros, def is a lambda
;; expression or a byte-code-function-p, so we
@@ -491,11 +495,6 @@ FILE is the file where FUNCTION was probably defined."
(concat beg "Lisp function"))
((eq (car-safe def) 'closure)
(concat beg "Lisp closure"))
- ((autoloadp def)
- (format "%s autoloaded %s"
- (if (commandp def) "an interactive" "an")
- (if (eq (nth 4 def) 'keymap) "keymap"
- (if (nth 4 def) "Lisp macro" "Lisp function"))))
((keymapp def)
(let ((is-full nil)
(elts (cdr-safe def)))
diff --git a/test/ChangeLog b/test/ChangeLog
index 7d4e9d5e687..a02b8e80395 100644
--- a/test/ChangeLog
+++ b/test/ChangeLog
@@ -1,3 +1,7 @@
+2014-05-05 Glenn Morris <rgm@gnu.org>
+
+ * automated/help-fns.el: New file.
+
2014-04-25 Michael Albinus <michael.albinus@gmx.de>
* automated/tramp-tests.el (top):
diff --git a/test/automated/help-fns.el b/test/automated/help-fns.el
new file mode 100644
index 00000000000..153de7f9e30
--- /dev/null
+++ b/test/automated/help-fns.el
@@ -0,0 +1,37 @@
+;;; help-fns.el --- tests for help-fns.el
+
+;; Copyright (C) 2014 Free Software Foundation, Inc.
+
+;; Maintainer: emacs-devel@gnu.org
+
+;; This file is part of GNU Emacs.
+
+;; GNU Emacs is free software: you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
+
+;; GNU Emacs is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
+
+;;; Commentary:
+
+;;; Code:
+
+(require 'ert)
+
+(autoload 'help-fns-test--macro "help-fns" nil nil t)
+
+(ert-deftest help-fns-test-bug17410 ()
+ "Test for http://debbugs.gnu.org/17410 ."
+ (describe-function 'help-fns-test--macro)
+ (with-current-buffer "*Help*"
+ (goto-char (point-min))
+ (should (search-forward "autoloaded Lisp macro" (line-end-position)))))
+
+;;; help-fns.el ends here