emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Aaron Ecay <aaronecay@gmail.com>
To: Daniele Pizzolli <dan@toel.it>, emacs-orgmode <emacs-orgmode@gnu.org>
Subject: Re: [FR] fill caption
Date: Sat, 14 Jun 2014 18:34:09 -0400	[thread overview]
Message-ID: <87zjhf6rz2.fsf@gmail.com> (raw)
In-Reply-To: <539C84B3.9060302@toel.it>

Hi Daniele,

2014ko ekainak 14an, Daniele Pizzolli-ek idatzi zuen:
> 
> Hello @ll,
> 
> I noticed that multi line caption works as expected, but there is no
> way to fill it (at least to my knowledge).
> 
> I added a test case that should speak by itself.
> 
> I do not know a lot of elisp, but if you have some pointer I could try
> to implement it by myself.
> 
> Maybe this could be extended to handle also OPTIONS and LocalWords
> and others.

I have the following function in my org-mode-hook:

(defun awe-org-setup-fill-hook ()
  (make-local-variable 'filladapt-token-table)
  (make-local-variable 'filladapt-token-match-table)
  (make-local-variable 'filladapt-token-conversion-table)
  (cl-pushnew `(,(rx "#+" (or "caption" "CAPTION") ": ") org-caption)
              filladapt-token-table :test #'equal)
  (cl-pushnew '(org-caption org-caption)
              filladapt-token-match-table :test #'equal)
  (cl-pushnew '(org-caption . exact)
              filladapt-token-conversion-table :test #'equal))

It uses filladapt <http://www.emacswiki.org/emacs/FillAdapt> to fill
caption keywords properly (it doesn’t handle the case of short captions,
since these are complicated, as Nicolas points out in his reply).

There’s a warning in the Org manual about using filladapt with org, but
I’ve never noticed any problems.

If you use ispell’s facility for adding to LocalWords (pressing A
(i.e. shift+a) at the spelling correction prompt, or “Accept (buffer)”
in the context menu), it will handle breaking the LocalWords lines for
you.

Hope this is useful,

-- 
Aaron Ecay

  parent reply	other threads:[~2014-06-14 22:34 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-14 17:21 [FR] fill caption Daniele Pizzolli
2014-06-14 18:04 ` Nicolas Goaziou
2014-06-15 18:15   ` Daniele Pizzolli
2014-06-14 22:34 ` Aaron Ecay [this message]
2014-06-15 18:17   ` Daniele Pizzolli
2014-06-19 23:52     ` Aaron Ecay
2014-07-27 17:24   ` Bastien
2014-08-06  3:55     ` Aaron Ecay

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87zjhf6rz2.fsf@gmail.com \
    --to=aaronecay@gmail.com \
    --cc=dan@toel.it \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).