[gnus git] branch master updated: m0-1-94-g6c131a3 =1= * gnus-compat.el: Make `help-function-arglist' be compatible on Emacs 23.1.

Lars Ingebrigtsen <[email protected]>
Newsgroups gmane.emacs.gnus.cvs
Message-ID <[email protected]>
       via  6c131a3af3eb29c1139390ba2cb598a88f6077bc (commit)
      from  27be7188277b9c570a69abe3183718c4b8b6f460 (commit)


- Log -----------------------------------------------------------------
commit 6c131a3af3eb29c1139390ba2cb598a88f6077bc
Author: Lars Ingebrigtsen <[email protected]>
Date:   Tue Feb 7 22:37:47 2012 +0100

    * gnus-compat.el: Make `help-function-arglist' be compatible on Emacs 23.1.

diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 13a5048..e7fcc60 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,8 @@
+2012-02-07  Lars Ingebrigtsen  <[email protected]>
+
+	* gnus-compat.el: Make `help-function-arglist' be compatible on Emacs
+	23.1.
+
 2012-02-07  Katsumi Yamaoka  <[email protected]>
 
 	* gnus-sum.el (gnus-summary-show-thread): Revert last two changes.
diff --git a/lisp/gnus-compat.el b/lisp/gnus-compat.el
index 2cca394..ea8dd4d 100644
--- a/lisp/gnus-compat.el
+++ b/lisp/gnus-compat.el
@@ -33,6 +33,7 @@
 (ignore-errors
   (require 'help-fns))
 
+;; XEmacs doesn't have this function.
 (when (and (not (fboundp 'help-function-arglist))
 	   (fboundp 'function-arglist))
   (defun help-function-arglist (def &optional preserve-names)
@@ -40,6 +41,24 @@
 PRESERVE-NAMES is ignored."
     (cdr (car (read-from-string (downcase (function-arglist def)))))))
 
+;; Modify this function on Emacs 23.1 and earlier to always return the
+;; right answer.
+(when (and (fboundp 'help-function-arglist)
+	   (eq (help-function-arglist 'car) t))
+  (defvar gnus-compat-original-help-function-arglist
+    (symbol-function 'help-function-arglist))
+  (defun help-function-arglist (def &optional preserve-names)
+    "Return a formal argument list for the function DEF.
+PRESERVE-NAMES is ignored."
+    (let ((orig (funcall gnus-compat-original-help-function-arglist def)))
+      (if (not (eq orig t))
+	  orig
+	;; Built-in subrs have the arglist hidden in the doc string.
+	(let ((doc (documentation def)))
+	  (when (and doc
+		     (string-match "\n\n\\((fn\\( .*\\)?)\\)\\'" doc))
+	    (cdr (car (read-from-string (downcase (match-string 1 doc)))))))))))
+
 (when (= (length (help-function-arglist 'delete-directory)) 1)
   (defvar gnus-compat-original-delete-directory
     (symbol-function 'delete-directory))

-----------------------------------------------------------------------
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we listed those
revisions in full, above.

Summary of changes:
 lisp/ChangeLog      |    5 +++++
 lisp/gnus-compat.el |   19 +++++++++++++++++++
 2 files changed, 24 insertions(+), 0 deletions(-)

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Gnus Project".

The branch, master has been updated


hooks/post-receive
-- 
Gnus Project
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.