Uwe Brauer wrote:
>>>>> "Andreas" == Andreas Roehler
<andreas.roehler(a)online.de> writes:
> ...
>>> variables. However in code files such as lisp or say Matlab,
>>> inserting footnotes plainly for this purpose is not a very good
>>> idea that is why I suggest to include the comment syntax if
>>> needed.
>>>
>>> Uwe
> When realised via syntax, a lot of bugs may come from IMHO.
First of all I would like to emphasise that I am thinking only about
simple non nested comments like ; in lisp or
% in latex or matlab.
> With modes where comment-end is a string, you may write something like
> (insert " ")
> (backward-char)
> (comment-region (point) (1+ point))
> Footnote-add
I thought of a simple
(indent-for-comment)
(Footnote-add)
You are right. Thats the path...
but since you also the author of newcomment.el I take your
recommendation.
Now I should also specify in more detail what I want.
I want to insert the footnote-mark, say [1] and the Footnote-text in
such a way that it is ignored by the mayor-mode I use, but, and this is
very important, Footnote should be able to recognised still the footnotes
surrounded by a comment syntax.
Your code would lead to %[2] instead of [2, so far so good.
But the Footnote-text itself %[2]
Footnotes:
[2]
would not be changed to
% Footnotes:
% [2]
Of course that I could simple do this myself but footnote.el will then
not recognise it as a footnote.
footnote-section-tag must be changed with, so it don't
start with beginning of line.
This should work:
(defun add-commented-footnote ()
"Put added footnotes and textes inside a comment. "
(interactive "*")
;; if it proves valid, we should make user options from
(unless (string= footnote-section-tag ";; Footnotes:")
(setq footnote-section-tag ";; Footnotes:"))
(unless (string= footnote-section-tag-regexp ".*Footnotes\\(\\[.\\]\\)?:")
(setq footnote-section-tag-regexp (concat ".*"
footnote-section-tag-regexp)))
(indent-for-comment)
(my-Footnote-add-footnote)
(save-excursion
(of (functionp 'comment-plain-lor)
(comment-plain-lor)
(comment-region (line-beginning-position) (line-end-position))
(forward-line -1))))
;; slightly shortened
(defun my-Footnote-add-footnote ()
"Add footnote at point, update footnodes. "
(interactive "*")
(footnote-init)
(Footnote-add-footnote))
Andreas
I think this can only be achieved by introducing a variable, say
(defvar footnote-use-comment-syntax)
and generalise the relevant code when the variable is t.
Uwe
_______________________________________________
XEmacs-Beta mailing list
XEmacs-Beta(a)xemacs.org
http://calypso.tux.org/cgi-bin/mailman/listinfo/xemacs-beta