[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Footnote-mode]: alignment option [CODE included]
From: |
Boruch Baum |
Subject: |
Re: [Footnote-mode]: alignment option [CODE included] |
Date: |
Sun, 17 Dec 2017 19:13:06 -0500 |
User-agent: |
NeoMutt/20171208 |
On 2017-12-16 10:05, Stefan Monnier wrote:
> Have you seen my reply last week in emacs-devel?
No. Thanks for contacting me off-list about it.
>> The attached code allows one to left-justify footnote text from the
>> first column of text, instead of from the left margin. I find this
>> aesthetically preferable, especially when I have long footnotes.
> Could you give some example of the difference?
Sure. The current behavior is:
[1] Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Donec
hendrerit tempor tellus. Donec pretium posuere tellus. Proin quam nisl,
The proposed optional alternative is:
[1] Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Donec
hendrerit tempor tellus. Donec pretium posuere tellus. Proin quam
>> Of course, if one has visual-line-mode enabled, the auto-fill acts
>> automatically.
> Hmm... how does visual-line-mode pay attention to
> Footnote-align-to-fn-text (and know if it's inside a footnote)?
I double-checked, and I wrote incorrectly.
> Some comments about the code:
>
> body-auto-fill-prefix is just a var into which we temporarily save
> the normal fill-prefix. So this should be named with a "[Ff]ootnote-"
> prefix (arguably with a "--" somewhere to make it clear it's an
> internal variable), and it should be made buffer-local (so there's no
> cross-buffer pollution).
Done. Note that the file `footnote.el' currently has all its `Private
variables' labeled without the "--" convention.
> The more serious problem is that `fill-prefix' is set with no guarantee
> it will be reset to its proper value later. E.g. if the user returns to
> the body "manually" rather than via Footnote-back-to-message.
Yes. Corrected.
> I suggest you make this into a minor mode:
Why a minor mode just for a small option of another minor mode?
>> (defadvice Footnote-add-footnote (around abort-when-in-fn-area activate)
> I don't see how this relates to this new alignment feature.
You're correct. It was part of my personal configuration to address a
bug that I had neglected to report, now emacs-bug#29756.
UPDATE:
=======
The updated code is attached, in two forms: 1) As a patch to the 25.2
version of footnote.el (ie. fully integrated into footnote mode without
any need for advising, and; 2) As a snippet, with the feature's
functions advised around the mode's current functions.
--
hkp://keys.gnupg.net
CA45 09B5 5351 7C11 A9D1 7286 0036 9E45 1595 8BC0
footnote.patch
Description: Text Data
footnote-snippet.el
Description: Text document