diff options
Diffstat (limited to 'lib/texi-docstring-magic.el')
-rw-r--r-- | lib/texi-docstring-magic.el | 40 |
1 files changed, 29 insertions, 11 deletions
diff --git a/lib/texi-docstring-magic.el b/lib/texi-docstring-magic.el index 6e8c8e49..e39ee51a 100644 --- a/lib/texi-docstring-magic.el +++ b/lib/texi-docstring-magic.el @@ -1,16 +1,24 @@ -;; texi-docstring-magic.el --- munge internal docstrings into texi -;; -;; Keywords: lisp, docs, tex +;;; texi-docstring-magic.el --- munge internal docstrings into texi + +;; This file is part of Proof General. + +;; Portions © Copyright 1994-2012 David Aspinall and University of Edinburgh +;; Portions © Copyright 2003, 2012, 2014 Free Software Foundation, Inc. +;; Portions © Copyright 2001-2017 Pierre Courtieu +;; Portions © Copyright 2010, 2016 Erik Martin-Dorel +;; Portions © Copyright 2011-2013, 2016-2017 Hendrik Tews +;; Portions © Copyright 2015-2017 Clément Pit-Claudel + ;; Author: David Aspinall <David.Aspinall@ed.ac.uk> -;; Copyright (C) 1998 David Aspinall +;; Keywords: lisp, docs, tex + ;; License: GPL (GNU GENERAL PUBLIC LICENSE) -;; -;; $Id$ -;; + ;; This file is distributed under the terms of the GNU General Public ;; License, Version 2. Find a copy of the GPL with your version of ;; GNU Emacs or Texinfo. -;; + +;;; Commentary: ;; ;; This package generates Texinfo source fragments from Emacs ;; docstrings. This avoids documenting functions and variables in @@ -82,11 +90,16 @@ ;; ;; +;;; Code: + (eval-when-compile (require 'cl)) (defun texi-docstring-magic-find-face (face) - ;; Compatibility between FSF Emacs and XEmacs + "Return non-nil if FACE is a face name; nil otherwise. +A face name can be a string or a symbol. + +Compatibility between FSF Emacs and XEmacs." (or (facep face) (and (fboundp 'find-face) (find-face face)))) @@ -192,13 +205,14 @@ including any whitespace included to delimit matches.") (defun texi-docstring-magic-untabify (string) "Convert tabs in STRING into multiple spaces." - (with-temp-buffer + (with-temp-buffer (insert string) (untabify (point-min) (point-max)) (buffer-string))) (defun texi-docstring-magic-munge-docstring (docstring args) "Markup DOCSTRING for texi according to regexp matches." + ;; FIXME(EMD): seems buggy as ARGS is not used (let ((case-fold-search nil)) (setq docstring (texi-docstring-magic-untabify docstring)) (dolist (test texi-docstring-magic-munge-table) @@ -251,7 +265,7 @@ including any whitespace included to delimit matches.") (defun texi-docstring-magic-format-default (default) "Make a default value string for the value DEFAULT. -Markup as @code{stuff} or @lisp stuff @end lisp." +Markup as @code{stuff} or @lisp stuff @end Lisp." ;; NB: might be nice to use a 'default-value-description ;; property here, in case the default value is computed. (let ((text (format "%S" default))) @@ -399,3 +413,7 @@ With prefix arg, no errors on unknown symbols. (This results in (provide 'texi-docstring-magic) + +(provide 'texi-docstring-magic) + +;;; texi-docstring-magic.el ends here |