aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGlenn Morris2014-05-05 17:33:07 -0400
committerGlenn Morris2014-05-05 17:33:07 -0400
commit6da8d069757fd26ee537704a9f0dea24dc5e00b8 (patch)
treeced4c72417f00aac34d6e40a8da67cfe07acf1ef
parente6025d7240197bfd47cf649c5976533da6869a6e (diff)
downloademacs-6da8d069757fd26ee537704a9f0dea24dc5e00b8.tar.gz
emacs-6da8d069757fd26ee537704a9f0dea24dc5e00b8.zip
* 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 @@
12014-05-05 Glenn Morris <rgm@gnu.org>
2
3 * help-fns.el (describe-function-1): Test for an autoload before a
4 macro, since `macrop' works on autoloads. (Bug#17410)
5
12014-05-05 Stefan Monnier <monnier@iro.umontreal.ca> 62014-05-05 Stefan Monnier <monnier@iro.umontreal.ca>
2 7
3 * electric.el (electric-indent-functions-without-reindent): Add yaml. 8 * 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 @@
1;;; help-fns.el --- Complex help functions -*- lexical-binding: t -*- 1;;; help-fns.el --- Complex help functions -*- lexical-binding: t -*-
2 2
3;; Copyright (C) 1985-1986, 1993-1994, 1998-2014 Free Software 3;; Copyright (C) 1985-1986, 1993-1994, 1998-2014 Free Software Foundation, Inc.
4;; Foundation, Inc.
5 4
6;; Maintainer: emacs-devel@gnu.org 5;; Maintainer: emacs-devel@gnu.org
7;; Keywords: help, internal 6;; Keywords: help, internal
@@ -479,6 +478,11 @@ FILE is the file where FUNCTION was probably defined."
479 ;; aliases before functions. 478 ;; aliases before functions.
480 (aliased 479 (aliased
481 (format "an alias for `%s'" real-def)) 480 (format "an alias for `%s'" real-def))
481 ((autoloadp def)
482 (format "%s autoloaded %s"
483 (if (commandp def) "an interactive" "an")
484 (if (eq (nth 4 def) 'keymap) "keymap"
485 (if (nth 4 def) "Lisp macro" "Lisp function"))))
482 ((or (eq (car-safe def) 'macro) 486 ((or (eq (car-safe def) 'macro)
483 ;; For advised macros, def is a lambda 487 ;; For advised macros, def is a lambda
484 ;; expression or a byte-code-function-p, so we 488 ;; expression or a byte-code-function-p, so we
@@ -491,11 +495,6 @@ FILE is the file where FUNCTION was probably defined."
491 (concat beg "Lisp function")) 495 (concat beg "Lisp function"))
492 ((eq (car-safe def) 'closure) 496 ((eq (car-safe def) 'closure)
493 (concat beg "Lisp closure")) 497 (concat beg "Lisp closure"))
494 ((autoloadp def)
495 (format "%s autoloaded %s"
496 (if (commandp def) "an interactive" "an")
497 (if (eq (nth 4 def) 'keymap) "keymap"
498 (if (nth 4 def) "Lisp macro" "Lisp function"))))
499 ((keymapp def) 498 ((keymapp def)
500 (let ((is-full nil) 499 (let ((is-full nil)
501 (elts (cdr-safe def))) 500 (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 @@
12014-05-05 Glenn Morris <rgm@gnu.org>
2
3 * automated/help-fns.el: New file.
4
12014-04-25 Michael Albinus <michael.albinus@gmx.de> 52014-04-25 Michael Albinus <michael.albinus@gmx.de>
2 6
3 * automated/tramp-tests.el (top): 7 * 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 @@
1;;; help-fns.el --- tests for help-fns.el
2
3;; Copyright (C) 2014 Free Software Foundation, Inc.
4
5;; Maintainer: emacs-devel@gnu.org
6
7;; This file is part of GNU Emacs.
8
9;; GNU Emacs is free software: you can redistribute it and/or modify
10;; it under the terms of the GNU General Public License as published by
11;; the Free Software Foundation, either version 3 of the License, or
12;; (at your option) any later version.
13
14;; GNU Emacs is distributed in the hope that it will be useful,
15;; but WITHOUT ANY WARRANTY; without even the implied warranty of
16;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17;; GNU General Public License for more details.
18
19;; You should have received a copy of the GNU General Public License
20;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
21
22;;; Commentary:
23
24;;; Code:
25
26(require 'ert)
27
28(autoload 'help-fns-test--macro "help-fns" nil nil t)
29
30(ert-deftest help-fns-test-bug17410 ()
31 "Test for http://debbugs.gnu.org/17410 ."
32 (describe-function 'help-fns-test--macro)
33 (with-current-buffer "*Help*"
34 (goto-char (point-min))
35 (should (search-forward "autoloaded Lisp macro" (line-end-position)))))
36
37;;; help-fns.el ends here