aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar David Aspinall <da@inf.ed.ac.uk>1999-11-19 17:45:59 +0000
committerGravatar David Aspinall <da@inf.ed.ac.uk>1999-11-19 17:45:59 +0000
commitc79f6552b85ae2b46b529ae180bb0cec469e0ee3 (patch)
treece83a8876144b753b63e70aa73390ab35f56f562
parent3e4d8f2122521c1d26c5601586b6a5ff6b0ab770 (diff)
Added texi-docstring-magic-untabify to fix tabs in docstrings.
-rw-r--r--generic/texi-docstring-magic.el15
1 files changed, 14 insertions, 1 deletions
diff --git a/generic/texi-docstring-magic.el b/generic/texi-docstring-magic.el
index 7c381f66..ae2c2d16 100644
--- a/generic/texi-docstring-magic.el
+++ b/generic/texi-docstring-magic.el
@@ -177,9 +177,20 @@ The replacement must cover the whole match (match string 0),
including any whitespace included to delimit matches.")
+(defun texi-docstring-magic-untabify (string)
+ "Convert tabs in STRING into multiple spaces."
+ (save-excursion
+ (set-buffer
+ (get-buffer-create " texi-docstring-magic-untabify"))
+ (insert string)
+ (untabify (point-min) (point-max))
+ (prog1 (buffer-substring)
+ (kill-buffer (current-buffer)))))
+
(defun texi-docstring-magic-munge-docstring (docstring args)
"Markup DOCSTRING for texi according to regexp matches."
(let ((case-fold-search nil))
+ (setq docstring (texi-docstring-magic-untabify docstring))
(dolist (test texi-docstring-magic-munge-table docstring)
(let ((regexp (nth 0 test))
(predicate (nth 1 test))
@@ -296,6 +307,8 @@ Markup as @code{stuff} or @lisp stuff @end lisp."
"@c TEXI DOCSTRING MAGIC:"
"Magic string in a texi buffer expanded into @defopt, or @deffn.")
+
+
(defun texi-docstring-magic ()
"Update all texi docstring magic annotations in buffer."
(interactive)
@@ -317,7 +330,7 @@ Markup as @code{stuff} or @lisp stuff @end lisp."
(progn
(forward-line)
(delete-region p (point))))
- (insert
+ (insert
(texi-docstring-magic-texi-for symbol))))))
(defun texi-docstring-magic-face-at-point ()