From mboxrd@z Thu Jan 1 00:00:00 1970 From: Aaron Ecay Subject: Re: [FR] fill caption Date: Sat, 14 Jun 2014 18:34:09 -0400 Message-ID: <87zjhf6rz2.fsf@gmail.com> References: <539C84B3.9060302@toel.it> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:39412) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WvwWe-0006Lj-UE for emacs-orgmode@gnu.org; Sat, 14 Jun 2014 18:34:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WvwWd-0006Oq-SU for emacs-orgmode@gnu.org; Sat, 14 Jun 2014 18:34:16 -0400 Received: from mail-qa0-x234.google.com ([2607:f8b0:400d:c00::234]:62489) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WvwWd-0006Oj-NX for emacs-orgmode@gnu.org; Sat, 14 Jun 2014 18:34:15 -0400 Received: by mail-qa0-f52.google.com with SMTP id w8so5480479qac.39 for ; Sat, 14 Jun 2014 15:34:14 -0700 (PDT) In-Reply-To: <539C84B3.9060302@toel.it> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Daniele Pizzolli , emacs-orgmode Hi Daniele, 2014ko ekainak 14an, Daniele Pizzolli-ek idatzi zuen: >=20 > Hello @ll, >=20 > I noticed that multi line caption works as expected, but there is no > way to fill it (at least to my knowledge). >=20 > I added a test case that should speak by itself. >=20 > I do not know a lot of elisp, but if you have some pointer I could try > to implement it by myself. >=20 > 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 to fill caption keywords properly (it doesn=E2=80=99t handle the case of short capt= ions, since these are complicated, as Nicolas points out in his reply). There=E2=80=99s a warning in the Org manual about using filladapt with org,= but I=E2=80=99ve never noticed any problems. If you use ispell=E2=80=99s facility for adding to LocalWords (pressing A (i.e. shift+a) at the spelling correction prompt, or =E2=80=9CAccept (buffe= r)=E2=80=9D in the context menu), it will handle breaking the LocalWords lines for you. Hope this is useful, --=20 Aaron Ecay