emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [FR] fill caption
@ 2014-06-14 17:21 Daniele Pizzolli
  2014-06-14 18:04 ` Nicolas Goaziou
  2014-06-14 22:34 ` Aaron Ecay
  0 siblings, 2 replies; 8+ messages in thread
From: Daniele Pizzolli @ 2014-06-14 17:21 UTC (permalink / raw)
  To: emacs-orgmode

[-- 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

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2014-08-06  3:55 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
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

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).