* 23.0.50; Footnote-add-footnote and more condensed style
@ 2008-01-26 10:55 Christoph Conrad
2008-01-26 15:29 ` martin rudalics
0 siblings, 1 reply; 7+ messages in thread
From: Christoph Conrad @ 2008-01-26 10:55 UTC (permalink / raw)
To: emacs-pretest-bug
In GNU Emacs 23.0.50.6 (i686-pc-linux-gnu, GTK+ Version 2.12.1)
of 2008-01-21 on brabbelbox
Windowing system distributor `The X.Org Foundation', version 11.0.10300000
configured using `configure 'CC=gcc''
It is not possible to configure footnote.el so that a style like
=============
[¹] first fn
[²] second fn
=============
is achieved. The best settings i could get are
(setq footnote-spaced-footnotes nil)
(setq footnote-body-tag-spacing 1)
(setq footnote-style 'latin)
(setq footnote-section-tag "")
resulting in at least two newlines between each footnote:
=============
[¹] first fn
[²] second fn
=============
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: 23.0.50; Footnote-add-footnote and more condensed style
2008-01-26 10:55 23.0.50; Footnote-add-footnote and more condensed style Christoph Conrad
@ 2008-01-26 15:29 ` martin rudalics
2008-01-31 11:39 ` Christoph Conrad
0 siblings, 1 reply; 7+ messages in thread
From: martin rudalics @ 2008-01-26 15:29 UTC (permalink / raw)
To: Christoph Conrad; +Cc: emacs-pretest-bug
> It is not possible to configure footnote.el so that a style like
>
> =============
> [¹] first fn
> [²] second fn
> =============
>
> is achieved. The best settings i could get are
>
> (setq footnote-spaced-footnotes nil)
> (setq footnote-body-tag-spacing 1)
> (setq footnote-style 'latin)
> (setq footnote-section-tag "")
footnote.el seems broken in this regard:
(1) Setting `footnote-section-tag' without simultaneously setting
`footnote-section-regexp' to a value matching `footnote-section-tag'
like you did will give unpredictable results. Probably the option
`footnote-section-regexp' should be removed and `regexp-quote' used
instead.
(2) You can't set `footnote-section-regexp' to match the empty string,
it will always match at eob even when there are footnotes before it.
A separate value would be needed to indicate that a user doesn't
want to set a section tag.
(3) If you don't set a section tag you can't reliably use
`Footnote-narrow-to-footnotes' since this is searching for a section
tag. Also `Footnote-delete-footnote' might fail when all footnotes
have been removed :-(
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: 23.0.50; Footnote-add-footnote and more condensed style
2008-01-26 15:29 ` martin rudalics
@ 2008-01-31 11:39 ` Christoph Conrad
2008-01-31 18:25 ` martin rudalics
0 siblings, 1 reply; 7+ messages in thread
From: Christoph Conrad @ 2008-01-31 11:39 UTC (permalink / raw)
To: emacs-devel; +Cc: emacs-pretest-bug
Hi Martin,
* martin rudalics <rudalics@gmx.at> wrote:
> footnote.el seems broken in this regard:
Thank you, Martin, for that detailed explanation.
With kind regards,
Christoph
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: 23.0.50; Footnote-add-footnote and more condensed style
2008-01-31 11:39 ` Christoph Conrad
@ 2008-01-31 18:25 ` martin rudalics
2008-01-31 20:54 ` Christoph Conrad
0 siblings, 1 reply; 7+ messages in thread
From: martin rudalics @ 2008-01-31 18:25 UTC (permalink / raw)
To: Christoph Conrad; +Cc: emacs-devel
>>footnote.el seems broken in this regard:
If you really feel you need it I can implement it. I'm a bit reluctant
though because IIRC some people wanted `footnote-mode' reread footnotes
from file. Without a recognizable `section-tag' this will get even more
difficult than it is now.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: 23.0.50; Footnote-add-footnote and more condensed style
2008-01-31 18:25 ` martin rudalics
@ 2008-01-31 20:54 ` Christoph Conrad
2008-02-02 19:57 ` martin rudalics
0 siblings, 1 reply; 7+ messages in thread
From: Christoph Conrad @ 2008-01-31 20:54 UTC (permalink / raw)
To: martin rudalics; +Cc: emacs-devel
Hi Martin,
> If you really feel you need it I can implement it.
"Really needed", not in that sense. But it is a lot nicer to have
beautifully condensed footnotes without at least two linefeeds between.
> `footnote-mode' reread footnotes from file.
I do not need that.
With kind regards,
Christoph
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: 23.0.50; Footnote-add-footnote and more condensed style
2008-01-31 20:54 ` Christoph Conrad
@ 2008-02-02 19:57 ` martin rudalics
2008-02-02 20:13 ` Christoph Conrad
0 siblings, 1 reply; 7+ messages in thread
From: martin rudalics @ 2008-02-02 19:57 UTC (permalink / raw)
To: Christoph Conrad; +Cc: emacs-devel
[-- Attachment #1: Type: text/plain, Size: 516 bytes --]
> "Really needed", not in that sense. But it is a lot nicer to have
> beautifully condensed footnotes without at least two linefeeds between.
OK, try the attached patch (against the trunk) and customize
`footnote-section-tag' to nil.
Observe that I can't guarantee for anything here. The footnote code is
hopelessly broken if not used with the default values. Just for fun:
Before applying the patch set `footnote-spaced-footnotes' to nil, add a
footnote, and try to delete it with `footnote-delete-footnote'.
[-- Attachment #2: footnote.patch --]
[-- Type: text/plain, Size: 13186 bytes --]
*** mail/footnote.el Thu Jan 10 19:25:58 2008
--- mail/footnote.el Sat Feb 2 20:43:08 2008
***************
*** 48,68 ****
:group 'message)
(defcustom footnote-mode-line-string " FN"
! "*String to display in modes section of the mode-line."
:group 'footnote)
(defcustom footnote-mode-hook nil
! "*Hook functions run when footnote-mode is activated."
:type 'hook
:group 'footnote)
(defcustom footnote-narrow-to-footnotes-when-editing nil
! "*If set, narrow to footnote text body while editing a footnote."
:type 'boolean
:group 'footnote)
(defcustom footnote-prompt-before-deletion t
! "*If set, prompt before deleting a footnote.
There is currently no way to undo deletions."
:type 'boolean
:group 'footnote)
--- 48,68 ----
:group 'message)
(defcustom footnote-mode-line-string " FN"
! "String to display in modes section of the mode-line."
:group 'footnote)
(defcustom footnote-mode-hook nil
! "Hook functions run when footnote-mode is activated."
:type 'hook
:group 'footnote)
(defcustom footnote-narrow-to-footnotes-when-editing nil
! "If set, narrow to footnote text body while editing a footnote."
:type 'boolean
:group 'footnote)
(defcustom footnote-prompt-before-deletion t
! "If set, prompt before deleting a footnote.
There is currently no way to undo deletions."
:type 'boolean
:group 'footnote)
***************
*** 74,85 ****
:group 'footnote)
(defcustom footnote-use-message-mode t
! "*If non-nil assume Footnoting will be done in message-mode."
:type 'boolean
:group 'footnote)
(defcustom footnote-body-tag-spacing 2
! "*Number of blanks separating a footnote body tag and its text."
:type 'integer
:group 'footnote)
--- 74,85 ----
:group 'footnote)
(defcustom footnote-use-message-mode t
! "If non-nil assume Footnoting will be done in message-mode."
:type 'boolean
:group 'footnote)
(defcustom footnote-body-tag-spacing 2
! "Number of blanks separating a footnote body tag and its text."
:type 'integer
:group 'footnote)
***************
*** 89,120 ****
;;; Interface variables that probably shouldn't be changed
(defcustom footnote-section-tag "Footnotes: "
! "*Tag inserted at beginning of footnote section."
! :version "22.1"
! :type 'string
:group 'footnote)
(defcustom footnote-section-tag-regexp "Footnotes\\(\\[.\\]\\)?: "
! "*Regexp which indicates the start of a footnote section.
! See also `footnote-section-tag'."
:type 'regexp
:group 'footnote)
;; The following three should be consumed by footnote styles.
(defcustom footnote-start-tag "["
! "*String used to denote start of numbered footnote."
:type 'string
:group 'footnote)
(defcustom footnote-end-tag "]"
! "*String used to denote end of numbered footnote."
:type 'string
:group 'footnote)
(defvar footnote-signature-separator (if (boundp 'message-signature-separator)
message-signature-separator
"^-- $")
! "*String used to recognize .signatures.")
;;; Private variables
--- 89,122 ----
;;; Interface variables that probably shouldn't be changed
(defcustom footnote-section-tag "Footnotes: "
! "Tag inserted at beginning of footnote section.
! If you set this to nil no section tag is inserted and the value
! of `footnote-section-tag-regexp' is disregarded."
! :version "23.1"
! :type '(choice (const :tag "None" nil) string)
:group 'footnote)
(defcustom footnote-section-tag-regexp "Footnotes\\(\\[.\\]\\)?: "
! "Regexp which indicates the start of a footnote section.
! This variable is disregarded when `footnote-section-tag' is nil."
:type 'regexp
:group 'footnote)
;; The following three should be consumed by footnote styles.
(defcustom footnote-start-tag "["
! "String used to denote start of numbered footnote."
:type 'string
:group 'footnote)
(defcustom footnote-end-tag "]"
! "String used to denote end of numbered footnote."
:type 'string
:group 'footnote)
(defvar footnote-signature-separator (if (boundp 'message-signature-separator)
message-signature-separator
"^-- $")
! "String used to recognize .signatures.")
;;; Private variables
***************
*** 295,301 ****
exciting styles.")
(defcustom footnote-style 'numeric
! "*Default style used for footnoting.
numeric == 1, 2, 3, ...
english-lower == a, b, c, ...
english-upper == A, B, C, ...
--- 297,303 ----
exciting styles.")
(defcustom footnote-style 'numeric
! "Default style used for footnoting.
numeric == 1, 2, 3, ...
english-lower == a, b, c, ...
english-upper == A, B, C, ...
***************
*** 455,462 ****
(goto-char (point-max))
(when (re-search-backward footnote-signature-separator nil t)
(let ((end (point)))
! (when (re-search-backward (concat "^" footnote-section-tag-regexp) nil t)
! (narrow-to-region (point) end)))))
(defun Footnote-goto-char-point-max ()
"Move to end of buffer or prior to start of .signature."
--- 457,467 ----
(goto-char (point-max))
(when (re-search-backward footnote-signature-separator nil t)
(let ((end (point)))
! (cond
! ((not footnote-section-tag)
! (narrow-to-region (cdar footnote-text-marker-alist) end))
! ((re-search-backward (concat "^" footnote-section-tag-regexp) nil t)
! (narrow-to-region (point) end))))))
(defun Footnote-goto-char-point-max ()
"Move to end of buffer or prior to start of .signature."
***************
*** 465,471 ****
(point)))
(defun Footnote-insert-text-marker (arg locn)
! "Insert a marker pointing to footnote arg, at buffer location locn."
(let ((marker (make-marker)))
(unless (assq arg footnote-text-marker-alist)
(set-marker marker locn)
--- 470,476 ----
(point)))
(defun Footnote-insert-text-marker (arg locn)
! "Insert a marker pointing to footnote ARG, at buffer location LOCN."
(let ((marker (make-marker)))
(unless (assq arg footnote-text-marker-alist)
(set-marker marker locn)
***************
*** 475,481 ****
(Footnote-sort footnote-text-marker-alist)))))
(defun Footnote-insert-pointer-marker (arg locn)
! "Insert a marker pointing to footnote arg, at buffer location locn."
(let ((marker (make-marker))
alist)
(set-marker marker locn)
--- 480,486 ----
(Footnote-sort footnote-text-marker-alist)))))
(defun Footnote-insert-pointer-marker (arg locn)
! "Insert a marker pointing to footnote ARG, at buffer location LOCN."
(let ((marker (make-marker))
alist)
(set-marker marker locn)
***************
*** 488,499 ****
(Footnote-sort footnote-pointer-marker-alist)))))
(defun Footnote-insert-footnote (arg)
! "Insert a footnote numbered arg, at (point)."
(push-mark)
(Footnote-insert-pointer-marker arg (point))
(Footnote-insert-numbered-footnote arg t)
(Footnote-goto-char-point-max)
! (if (re-search-backward (concat "^" footnote-section-tag-regexp) nil t)
(save-restriction
(when footnote-narrow-to-footnotes-when-editing
(Footnote-narrow-to-footnotes))
--- 493,507 ----
(Footnote-sort footnote-pointer-marker-alist)))))
(defun Footnote-insert-footnote (arg)
! "Insert a footnote numbered ARG, at (point)."
(push-mark)
(Footnote-insert-pointer-marker arg (point))
(Footnote-insert-numbered-footnote arg t)
(Footnote-goto-char-point-max)
! (if (cond (footnote-section-tag
! (re-search-backward (concat "^" footnote-section-tag-regexp) nil t))
! (footnote-text-marker-alist
! (goto-char (cdar footnote-text-marker-alist))))
(save-restriction
(when footnote-narrow-to-footnotes-when-editing
(Footnote-narrow-to-footnotes))
***************
*** 511,522 ****
nil t)
(unless (beginning-of-line) t))
(Footnote-goto-char-point-max)
! (re-search-backward (concat "^" footnote-section-tag-regexp) nil t))))
(unless (looking-at "^$")
(insert "\n"))
(when (eobp)
(insert "\n"))
! (insert footnote-section-tag "\n"))
(let ((old-point (point)))
(Footnote-insert-numbered-footnote arg nil)
(Footnote-insert-text-marker arg old-point)))
--- 519,536 ----
nil t)
(unless (beginning-of-line) t))
(Footnote-goto-char-point-max)
! (cond
! (footnote-section-tag
! (re-search-backward
! (concat "^" footnote-section-tag-regexp) nil t))
! (footnote-text-marker-alist
! (goto-char (cdar footnote-text-marker-alist)))))))
(unless (looking-at "^$")
(insert "\n"))
(when (eobp)
(insert "\n"))
! (when footnote-section-tag
! (insert footnote-section-tag "\n")))
(let ((old-point (point)))
(Footnote-insert-numbered-footnote arg nil)
(Footnote-insert-text-marker arg old-point)))
***************
*** 579,585 ****
(setq i (1+ i)))
rc)))
! (defun Footnote-add-footnote (&optional arg)
"Add a numbered footnote.
The number the footnote receives is dependent upon the relative location
of any other previously existing footnotes.
--- 593,599 ----
(setq i (1+ i)))
rc)))
! (defun Footnote-add-footnote (&optional arg) ; what is ARG needed for ???
"Add a numbered footnote.
The number the footnote receives is dependent upon the relative location
of any other previously existing footnotes.
***************
*** 610,616 ****
(defun Footnote-delete-footnote (&optional arg)
"Delete a numbered footnote.
! With no parameter, delete the footnote under (point). With arg specified,
delete the footnote with that number."
(interactive "*P")
(unless arg
--- 624,630 ----
(defun Footnote-delete-footnote (&optional arg)
"Delete a numbered footnote.
! With no parameter, delete the footnote under (point). With ARG specified,
delete the footnote with that number."
(interactive "*P")
(unless arg
***************
*** 629,639 ****
(goto-char (car locn))
(let* ((end (point))
(start (search-backward footnote-start-tag nil t)))
! (kill-region start end)))
(setq locn (cdr locn)))
(save-excursion
(goto-char (cdr alist-txt))
! (kill-region (point) (search-forward "\n\n" nil t)))
(setq footnote-pointer-marker-alist
(delq alist-ptr footnote-pointer-marker-alist))
(setq footnote-text-marker-alist
--- 643,661 ----
(goto-char (car locn))
(let* ((end (point))
(start (search-backward footnote-start-tag nil t)))
! (delete-region start end)))
(setq locn (cdr locn)))
(save-excursion
(goto-char (cdr alist-txt))
! (delete-region
! (point)
! (if footnote-spaced-footnotes
! ;; This might fail miserably when there's no such string.
! (search-forward "\n\n" nil t)
! (save-restriction
! (end-of-line)
! (next-single-char-property-change
! (point) 'footnote-number nil (Footnote-goto-char-point-max))))))
(setq footnote-pointer-marker-alist
(delq alist-ptr footnote-pointer-marker-alist))
(setq footnote-text-marker-alist
***************
*** 642,657 ****
(when (and (null footnote-text-marker-alist)
(null footnote-pointer-marker-alist))
(save-excursion
! (let* ((end (Footnote-goto-char-point-max))
! (start (1- (re-search-backward
! (concat "^" footnote-section-tag-regexp)
! nil t))))
! (forward-line -1)
! (when (looking-at "\n")
! (kill-line))
! (kill-region start (if (< end (point-max))
! end
! (point-max)))))))))
(defun Footnote-renumber-footnotes (&optional arg)
"Renumber footnotes, starting from 1."
--- 664,683 ----
(when (and (null footnote-text-marker-alist)
(null footnote-pointer-marker-alist))
(save-excursion
! (if footnote-section-tag
! (let* ((end (Footnote-goto-char-point-max))
! (start (1- (re-search-backward
! (concat "^" footnote-section-tag-regexp)
! nil t))))
! (forward-line -1)
! (when (looking-at "\n")
! (kill-line))
! (delete-region start (if (< end (point-max))
! end ; ???
! (point-max))))
! (Footnote-goto-char-point-max)
! (when (looking-back "\n\n")
! (kill-line -1))))))))
(defun Footnote-renumber-footnotes (&optional arg)
"Renumber footnotes, starting from 1."
***************
*** 682,689 ****
(if (eq arg 0)
(progn
(goto-char (point-max))
! (re-search-backward (concat "^" footnote-section-tag-regexp))
! (forward-line 1))
(error "I don't see a footnote here")))))
(defun Footnote-back-to-message (&optional arg)
--- 708,718 ----
(if (eq arg 0)
(progn
(goto-char (point-max))
! (cond (footnote-section-tag
! (re-search-backward (concat "^" footnote-section-tag-regexp))
! (forward-line 1))
! (footnote-text-marker-alist
! (goto-char (cdar footnote-text-marker-alist)))))
(error "I don't see a footnote here")))))
(defun Footnote-back-to-message (&optional arg)
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: 23.0.50; Footnote-add-footnote and more condensed style
2008-02-02 19:57 ` martin rudalics
@ 2008-02-02 20:13 ` Christoph Conrad
0 siblings, 0 replies; 7+ messages in thread
From: Christoph Conrad @ 2008-02-02 20:13 UTC (permalink / raw)
To: martin rudalics; +Cc: emacs-devel
Hi Martin,
> try the attached patch (against the trunk) and customize
> `footnote-section-tag' to nil.
Thank you - that works.
> Observe that I can't guarantee for anything here.
Your patch is more than i expected.
With kind regards & freundliche Grüße,
Christoph
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2008-02-02 20:13 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-01-26 10:55 23.0.50; Footnote-add-footnote and more condensed style Christoph Conrad
2008-01-26 15:29 ` martin rudalics
2008-01-31 11:39 ` Christoph Conrad
2008-01-31 18:25 ` martin rudalics
2008-01-31 20:54 ` Christoph Conrad
2008-02-02 19:57 ` martin rudalics
2008-02-02 20:13 ` Christoph Conrad
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.