[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: footnote-style latin doesn't renumber
From: |
Andreas Roehler |
Subject: |
Re: footnote-style latin doesn't renumber |
Date: |
Fri, 13 Apr 2007 14:11:53 +0200 |
User-agent: |
Thunderbird 1.5.0.4 (X11/20060516) |
Thanks.
Autoload seems a good idea, but didn't help in that
case.
(`footnote-numeric-regexp' needed an autoload too... )
;;;;;;;;
`footnote-mode' isn't able to read in existing
footnotes.
AFAIS `footnote-pointer-marker-alist' and
`footnote-text-marker-alist' must be set in order to
enable this.
See a first draft (working, but still unfinished,
hardcoded simply "[0-9]+") of a `footnote-init' below.
In order to set mentioned marker lists, `footnote-init'
must know about the footnote style/regexp.
So far
Andreas Roehler
;;;;;;;;;
(defun footnote-init ()
" "
(interactive)
(save-excursion
(let (last-pos)
(let ((count 0))
(goto-char (point-min))
(while (and
(re-search-forward (concat footnote-start-tag "[0-9]+"
footnote-end-tag) nil t 1)
(progn
(goto-char (match-beginning 0))
(save-match-data
(re-search-forward (regexp-quote footnote-start-tag) nil t 1))
(setq count (1+ count))
(eq count
;; number-at-point seems defective at the moment
(string-to-number
(buffer-substring-no-properties (point) (progn
(skip-chars-forward "[0-9]")(point)))))))
(setq last-pos (point))
(Footnote-insert-pointer-marker count (point))))
;; now init footnote-text-marker-alist
(goto-char last-pos)
(let ((count 0))
(while (and
(re-search-forward (concat footnote-start-tag "[0-9]+"
footnote-end-tag) nil t 1)
(progn
(save-excursion
(goto-char (match-beginning 0))
(save-match-data
(re-search-forward (regexp-quote footnote-start-tag) nil t
1))
(setq count (1+ count))
(eq count
;; number-at-point seems defective at the moment
(string-to-number
(buffer-substring-no-properties (point) (progn
(skip-chars-forward "[0-9]")(point))))))))
(Footnote-insert-text-marker count (point)))))))
- Re: footnote-style latin doesn't renumber, (continued)
- Re: footnote-style latin doesn't renumber, Andreas Roehler, 2007/04/18
- Re: footnote-style latin doesn't renumber, Stephen J. Turnbull, 2007/04/18
- Re: footnote-style latin doesn't renumber, Andreas Roehler, 2007/04/18
- Re: footnote-style latin doesn't renumber, Stephen J. Turnbull, 2007/04/12
- Re: footnote-style latin doesn't renumber, Andreas Roehler, 2007/04/13
- Re: footnote-style latin doesn't renumber, Richard Stallman, 2007/04/12
- Re: footnote-style latin doesn't renumber,
Andreas Roehler <=
- Re: footnote-style latin doesn't renumber, Stefan Monnier, 2007/04/13