emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Daniele Pizzolli <dan@toel.it>
To: emacs-orgmode <emacs-orgmode@gnu.org>
Subject: [FR] fill caption
Date: Sat, 14 Jun 2014 19:21:55 +0200	[thread overview]
Message-ID: <539C84B3.9060302@toel.it> (raw)

[-- Attachment #1: Type: text/plain, Size: 381 bytes --]

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.

Thanks in advance,
Daniele

[-- Attachment #2: fill-caption-test.diff --]
[-- Type: text/x-patch, Size: 779 bytes --]

diff --git a/testing/lisp/test-org.el b/testing/lisp/test-org.el
index 39db5bf..7ebac61 100644
--- a/testing/lisp/test-org.el
+++ b/testing/lisp/test-org.el
@@ -362,6 +362,19 @@
 	      (end-of-line)
 	      (org-auto-fill-function)
 	      (buffer-string))))))
+  ;; Correctly fill the caption.
+  (should
+   (equal "#+CAPTION: this is a very very\n#+CAPTION: long caption"
+	  (org-test-with-temp-text "#+CAPTION: this is a very very long caption"
+	    (let ((fill-column 30))
+	      (org-fill-paragraph)
+	      (buffer-string)))))
+  (should
+   (equal "#+CAPTION: this is a very short caption"
+	  (org-test-with-temp-text #+CAPTION: this is a very \n#+CAPTION: short caption"
+	    (let ((fill-column 80))
+	      (org-fill-paragraph)
+	      (buffer-string)))))
 
 
 \f

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

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-14 17:21 Daniele Pizzolli [this message]
2014-06-14 18:04 ` [FR] fill caption Nicolas Goaziou
2014-06-15 18:15   ` Daniele Pizzolli
2014-06-14 22:34 ` Aaron Ecay
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=539C84B3.9060302@toel.it \
    --to=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).