* Feature request: filling of long captions @ 2014-02-06 7:46 Andreas Leha 2014-02-06 8:43 ` Bastien 0 siblings, 1 reply; 18+ messages in thread From: Andreas Leha @ 2014-02-06 7:46 UTC (permalink / raw) To: emacs-orgmode Hi all, a currently active thread about filling (http://permalink.gmane.org/gmane.emacs.orgmode/77700) reminded me of a long standing wish of mine: Filling of captions. Would it be possible to have filling of captions? Ideally that would mean at least two things: auto-fill and M-q working on long captions. Example: --8<---------------cut here---------------start------------->8--- #+name: test #+begin_src R :results graphics :file tettr.png plot(1:10, 1:10) #+end_src #+results: test [[file:tettr.png]] #+caption: A very long long long long long long long long long long long long long long long long long long long long long long long long long long caption. [[file:tettr.png]] It would be very convenient if that could be automatically broken to #+caption: A very long long long long long long long long long long long long long long #+caption: long long long long long long long long long long long long caption. [[file:tettr.png]] --8<---------------cut here---------------end--------------->8--- Regards, Andreas ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: Feature request: filling of long captions 2014-02-06 7:46 Feature request: filling of long captions Andreas Leha @ 2014-02-06 8:43 ` Bastien 2014-02-06 10:20 ` Andreas Leha ` (2 more replies) 0 siblings, 3 replies; 18+ messages in thread From: Bastien @ 2014-02-06 8:43 UTC (permalink / raw) To: Andreas Leha; +Cc: emacs-orgmode Hi Andreas, Andreas Leha <andreas.leha@med.uni-goettingen.de> writes: > Would it be possible to have filling of captions? I guess so. > Ideally that would mean at least two things: auto-fill and M-q > working on long captions. Yes. Could you list other options that are good candidates for such auto-filling fonctionality? We'd better implement them all at once. Thanks, -- Bastien ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: Feature request: filling of long captions 2014-02-06 8:43 ` Bastien @ 2014-02-06 10:20 ` Andreas Leha 2014-02-06 10:40 ` Bastien 2014-02-06 17:26 ` Scott Randby 2014-02-06 22:08 ` Andrea Rossetti 2 siblings, 1 reply; 18+ messages in thread From: Andreas Leha @ 2014-02-06 10:20 UTC (permalink / raw) To: emacs-orgmode Hi Bastien, Bastien <bzg@gnu.org> writes: > Hi Andreas, > > Andreas Leha <andreas.leha@med.uni-goettingen.de> writes: > >> Would it be possible to have filling of captions? > > I guess so. > Thanks for the good news! Now I am waiting for christmas ;-) >> Ideally that would mean at least two things: auto-fill and M-q >> working on long captions. > > Yes. > > Could you list other options that are good candidates for such > auto-filling fonctionality? We'd better implement them all at > once. > Do you mean (1) other places in org files (other than #+caption) or (2) other functionality that should be supported at #+caption filling? If (2) than the only other functionality that comes to my mind is M-^ (delete-indentation), which could remove the #+caption on joining with the previous line. If (1) than I can't think of anything too obvious. Other candidates such as '#+header[s]:' or '#+latex_header[_extra]:' might benefit from some level of additional support, but autofill is not suitable here. Regards, Andreas ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: Feature request: filling of long captions 2014-02-06 10:20 ` Andreas Leha @ 2014-02-06 10:40 ` Bastien 2014-02-06 11:14 ` Andreas Leha 0 siblings, 1 reply; 18+ messages in thread From: Bastien @ 2014-02-06 10:40 UTC (permalink / raw) To: Andreas Leha; +Cc: emacs-orgmode Andreas Leha <andreas.leha@med.uni-goettingen.de> writes: > Do you mean (1) other places in org files (other than #+caption) or > (2) other functionality that should be supported at #+caption > filling? Normally lines matching the regexp ^#\+\S-+ (like #+CAPTION) should not be filled. We would introduce an exception where successive #+CAPTION lines are correctly parsed by Org -- so the question is how many of such options should fill like #+CAPTION will do (maybe before Christmas.) -- Bastien ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: Feature request: filling of long captions 2014-02-06 10:40 ` Bastien @ 2014-02-06 11:14 ` Andreas Leha 2014-02-06 11:40 ` Thomas Holst 0 siblings, 1 reply; 18+ messages in thread From: Andreas Leha @ 2014-02-06 11:14 UTC (permalink / raw) To: emacs-orgmode Hi Bastien, Bastien <bzg@gnu.org> writes: > Andreas Leha <andreas.leha@med.uni-goettingen.de> writes: > >> Do you mean (1) other places in org files (other than #+caption) or >> (2) other functionality that should be supported at #+caption >> filling? > > Normally lines matching the regexp ^#\+\S-+ (like #+CAPTION) should > not be filled. We would introduce an exception where successive > #+CAPTION lines are correctly parsed by Org -- so the question is > how many of such options should fill like #+CAPTION will do (maybe > before Christmas.) Well, I am not sure that I understand this. #+CAPTION lines are IMO parsed correctly by Org -- just the filling is missing. I do not (at the moment) see other 'options' like #+CAPTION that are missing auto-fill capabilities. Regards, Andreas ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: Feature request: filling of long captions 2014-02-06 11:14 ` Andreas Leha @ 2014-02-06 11:40 ` Thomas Holst 0 siblings, 0 replies; 18+ messages in thread From: Thomas Holst @ 2014-02-06 11:40 UTC (permalink / raw) To: emacs-orgmode@gnu.org Hi, · Andreas Leha <andreas.leha@med.uni-goettingen.de> wrote: > Hi Bastien, > > Bastien <bzg@gnu.org> writes: > >> Andreas Leha <andreas.leha@med.uni-goettingen.de> writes: >> >>> Do you mean (1) other places in org files (other than #+caption) or >>> (2) other functionality that should be supported at #+caption >>> filling? >> >> Normally lines matching the regexp ^#\+\S-+ (like #+CAPTION) should >> not be filled. We would introduce an exception where successive >> #+CAPTION lines are correctly parsed by Org -- so the question is >> how many of such options should fill like #+CAPTION will do (maybe >> before Christmas.) > > Well, I am not sure that I understand this. #+CAPTION lines are IMO > parsed correctly by Org -- just the filling is missing. > > I do not (at the moment) see other 'options' like #+CAPTION that are > missing auto-fill capabilities. what about #+HEADER: for source code blocks. Filling might be difficult since I don't know if something like: #+HEADER: :var foo= #+HEADER: "bar" is handled correctly by babel parser. The same holds true for #+ATTR_LATEX: -- Mit freundlichen Grüßen / Best regards Thomas Holst DGS-EC/ESE4 Tel. +49 (711) 811-40681 PC-Fax +49 (711) 811-5182208 ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: Feature request: filling of long captions 2014-02-06 8:43 ` Bastien 2014-02-06 10:20 ` Andreas Leha @ 2014-02-06 17:26 ` Scott Randby 2014-02-06 22:08 ` Andrea Rossetti 2 siblings, 0 replies; 18+ messages in thread From: Scott Randby @ 2014-02-06 17:26 UTC (permalink / raw) To: emacs-orgmode On Thu, Feb 6, 2014 at 3:43 AM, Bastien <bzg@gnu.org> wrote: > Hi Andreas, > > Andreas Leha <andreas.leha@med.uni-goettingen.de> writes: > >> Would it be possible to have filling of captions? > > I guess so. > >> Ideally that would mean at least two things: auto-fill and M-q >> working on long captions. > > Yes. > > Could you list other options that are good candidates for such > auto-filling fonctionality? We'd better implement them all at > once. Filling of table formulas would be nice. Scott Randby > > Thanks, > > -- > Bastien > ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: Feature request: filling of long captions 2014-02-06 8:43 ` Bastien 2014-02-06 10:20 ` Andreas Leha 2014-02-06 17:26 ` Scott Randby @ 2014-02-06 22:08 ` Andrea Rossetti 2014-02-07 2:18 ` Eric Schulte 2 siblings, 1 reply; 18+ messages in thread From: Andrea Rossetti @ 2014-02-06 22:08 UTC (permalink / raw) To: Bastien; +Cc: Andreas Leha, emacs-orgmode Hello Bastien and everyone reading, Bastien <bzg@gnu.org> writes: > Could you list other options that are good candidates for such > auto-filling fonctionality? We'd better implement them all at > once. I'd suggest to split the wish-list in two buckets, i.e. 1) some "#+..." commands would benefit of a line-continuation mechanism (like the backslash at EOL in a multilined C/C++ #define macro) 2) some line-continuation-aware "#+..." commands (thanks to implementations for step 1) would benefit of auto-filling To me #+TBLFM seems to fit into bucket 1, #+CAPTION into bucket 2. My Christmas wish is #+MACRO into bucket 1. Kindest regards, Andrea ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: Feature request: filling of long captions 2014-02-06 22:08 ` Andrea Rossetti @ 2014-02-07 2:18 ` Eric Schulte 2014-02-07 7:36 ` Andreas Leha 2014-02-07 8:37 ` Nicolas Goaziou 0 siblings, 2 replies; 18+ messages in thread From: Eric Schulte @ 2014-02-07 2:18 UTC (permalink / raw) To: Andrea Rossetti; +Cc: Bastien, Andreas Leha, emacs-orgmode Andrea Rossetti <andrea.rossetti@gmail.com> writes: > Hello Bastien and everyone reading, > > Bastien <bzg@gnu.org> writes: >> Could you list other options that are good candidates for such >> auto-filling fonctionality? We'd better implement them all at >> once. > > I'd suggest to split the wish-list in two buckets, i.e. > > 1) some "#+..." commands would benefit of a line-continuation > mechanism (like the backslash at EOL in a multilined C/C++ > #define macro) > > 2) some line-continuation-aware "#+..." commands (thanks to > implementations for step 1) would benefit of auto-filling > > To me #+TBLFM seems to fit into bucket 1, #+CAPTION into > bucket 2. My Christmas wish is #+MACRO into bucket 1. > > Kindest regards, > > Andrea > For a while now I've been wishing that keywords (namely #+Caption:) could be equivalently specified as blocks (e.g., #+begin/end_Caption:). Would that be another possible solution here? Best, -- Eric Schulte https://cs.unm.edu/~eschulte PGP: 0x614CA05D ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: Feature request: filling of long captions 2014-02-07 2:18 ` Eric Schulte @ 2014-02-07 7:36 ` Andreas Leha 2014-02-07 8:37 ` Nicolas Goaziou 1 sibling, 0 replies; 18+ messages in thread From: Andreas Leha @ 2014-02-07 7:36 UTC (permalink / raw) To: emacs-orgmode Eric Schulte <schulte.eric@gmail.com> writes: > Andrea Rossetti <andrea.rossetti@gmail.com> writes: > >> Hello Bastien and everyone reading, >> >> Bastien <bzg@gnu.org> writes: >>> Could you list other options that are good candidates for such >>> auto-filling fonctionality? We'd better implement them all at >>> once. >> >> I'd suggest to split the wish-list in two buckets, i.e. >> >> 1) some "#+..." commands would benefit of a line-continuation >> mechanism (like the backslash at EOL in a multilined C/C++ >> #define macro) >> >> 2) some line-continuation-aware "#+..." commands (thanks to >> implementations for step 1) would benefit of auto-filling >> >> To me #+TBLFM seems to fit into bucket 1, #+CAPTION into >> bucket 2. My Christmas wish is #+MACRO into bucket 1. >> >> Kindest regards, >> >> Andrea >> > > For a while now I've been wishing that keywords (namely #+Caption:) > could be equivalently specified as blocks (e.g., #+begin/end_Caption:). > > Would that be another possible solution here? I can not think of any downside, so I guess it would work at least as well for me. It might be harder to implement, since multiple caption lines are already parsed correctly by Org. The begin/end_caption blocks would have their advantages in terms of syntax highlighting / readability of the Org buffer. Regards, Andreas ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: Feature request: filling of long captions 2014-02-07 2:18 ` Eric Schulte 2014-02-07 7:36 ` Andreas Leha @ 2014-02-07 8:37 ` Nicolas Goaziou 2014-02-07 8:47 ` Bastien 1 sibling, 1 reply; 18+ messages in thread From: Nicolas Goaziou @ 2014-02-07 8:37 UTC (permalink / raw) To: Eric Schulte; +Cc: Bastien, Andrea Rossetti, emacs-orgmode, Andreas Leha Hello, Eric Schulte <schulte.eric@gmail.com> writes: > For a while now I've been wishing that keywords (namely #+Caption:) > could be equivalently specified as blocks (e.g., #+begin/end_Caption:). > > Would that be another possible solution here? That would defeat the purpose of the distinction between a block and an affiliated keyword (i.e., a property added to that block). Besides the change of paradigm, it would introduce a lot of problems (handle syntax limitation in such block, for example, since I assume plain lists would be forbidden). Also, current syntax also handles short captions, so you would have to rely on another trick for them. I'm sure this idea wouldn't be a net benefit for Org syntax clarity, even for the occasional three lines caption need. Regards, -- Nicolas Goaziou ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: Feature request: filling of long captions 2014-02-07 8:37 ` Nicolas Goaziou @ 2014-02-07 8:47 ` Bastien 2014-02-07 9:56 ` Nicolas Goaziou 2014-02-07 16:49 ` Eric Schulte 0 siblings, 2 replies; 18+ messages in thread From: Bastien @ 2014-02-07 8:47 UTC (permalink / raw) To: Nicolas Goaziou Cc: Andrea Rossetti, emacs-orgmode, Andreas Leha, Eric Schulte Hi all, Nicolas Goaziou <n.goaziou@gmail.com> writes: > I'm sure this idea wouldn't be a net benefit for Org syntax clarity, > even for the occasional three lines caption need. I agree. Nicolas, what do you think of enhancing the auto-filling (and delete-indentation) capabilities for some affiliated keywords? #+CAPTION: #+HEADER: #+TBLFM: The last two would require special auto-filling functions, but at least for #+TBLFM I see the point of enabling this. Thanks, -- Bastien ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: Feature request: filling of long captions 2014-02-07 8:47 ` Bastien @ 2014-02-07 9:56 ` Nicolas Goaziou 2014-02-07 10:12 ` Andreas Leha 2014-02-07 16:49 ` Eric Schulte 1 sibling, 1 reply; 18+ messages in thread From: Nicolas Goaziou @ 2014-02-07 9:56 UTC (permalink / raw) To: Bastien; +Cc: Andrea Rossetti, emacs-orgmode, Andreas Leha, Eric Schulte Hello, > Nicolas, what do you think of enhancing the auto-filling (and > delete-indentation) capabilities for some affiliated keywords? > > #+CAPTION: > #+HEADER: > #+TBLFM: Not that it matters much, but "TBLFM" is not an affiliated keyword per se, it belongs to the table syntax. OTOH, you can have "CAPTION" and "HEADER" keywords on top of almost any element type. Anyway, the three keywords are very different. To start with the one I know the most, CAPTION can have an optional value, and multiple caption lines can have as many optional values. #+CAPTION[short caption]: long caption #+CAPTION[short caption, continued]: long caption, continued. Therefore, filling it can be tricky since you have to pay attention to both values. Moreover, if the "short" caption is too long to fit on one line, that line still needs to end with "]:" to be valid. #+CAPTION[very very ... long "short" caption]: #+CAPTION[continued even here]: long caption #+CAPTION: long caption continued. The difficulty lies elsewhere for "HEADER" and "TBLFM". The question is: can we split a HEADER or TBLFM line anywhere, e.g., in the between a keyword and its value (or at a space in the middle of a value) for the former, and in the middle of a formula in the latter? It depends on how "org-table.el" and "ob.el" read these keywords. I didn't check. Also, please bear in mind that filling functions have unit tests, so any new feature ought to be also tested. Regards, -- Nicolas Goaziou ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: Feature request: filling of long captions 2014-02-07 9:56 ` Nicolas Goaziou @ 2014-02-07 10:12 ` Andreas Leha 2014-02-07 10:28 ` Bastien 0 siblings, 1 reply; 18+ messages in thread From: Andreas Leha @ 2014-02-07 10:12 UTC (permalink / raw) To: emacs-orgmode Hello, Nicolas Goaziou <n.goaziou@gmail.com> writes: > Hello, > >> Nicolas, what do you think of enhancing the auto-filling (and >> delete-indentation) capabilities for some affiliated keywords? >> >> #+CAPTION: >> #+HEADER: >> #+TBLFM: > > Not that it matters much, but "TBLFM" is not an affiliated keyword per > se, it belongs to the table syntax. OTOH, you can have "CAPTION" and > "HEADER" keywords on top of almost any element type. > > Anyway, the three keywords are very different. > > To start with the one I know the most, CAPTION can have an optional > value, and multiple caption lines can have as many optional values. > > #+CAPTION[short caption]: long caption > #+CAPTION[short caption, continued]: long caption, continued. > > Therefore, filling it can be tricky since you have to pay attention to > both values. > > Moreover, if the "short" caption is too long to fit on one line, that > line still needs to end with "]:" to be valid. > > #+CAPTION[very very ... long "short" caption]: > #+CAPTION[continued even here]: long caption > #+CAPTION: long caption continued. > This is something, that I had not thought about when I expressed my wish. I did not even know, that consecutive #+CAPTION lines could also have consecutive short captions. I see the difficulty here. Usually, my votes are in favour of backwards compatibility. So, I am not too sure about this suggestion myself: But here an obvious 'solution' would be to move the short caption to #+SHORT_CAPTION. I see that such change would bring its own difficulties besides breaking the backwards compatibility. Like what to do when there is a short caption but no 'long' caption. I am just continuing this discussion, as I do not have 'the occasional three lines caption need' but the 'always multi-lines caption need'. In my opinion, images in an article/paper/thesis/... should tell their story independently of the text referring to them. So, my captions tend to be (too?) long. So, I would benefit a lot from whatever filling mechanism might get implemented. [...] Regards, Andreas ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: Feature request: filling of long captions 2014-02-07 10:12 ` Andreas Leha @ 2014-02-07 10:28 ` Bastien 2014-02-07 10:30 ` Nicolas Goaziou 0 siblings, 1 reply; 18+ messages in thread From: Bastien @ 2014-02-07 10:28 UTC (permalink / raw) To: Andreas Leha; +Cc: emacs-orgmode Andreas Leha <andreas.leha@med.uni-goettingen.de> writes: > But here an obvious > 'solution' would be to move the short caption to #+SHORT_CAPTION. Yes. #+CAPTION[...]: is clumsy. -- Bastien ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: Feature request: filling of long captions 2014-02-07 10:28 ` Bastien @ 2014-02-07 10:30 ` Nicolas Goaziou 2014-02-07 10:35 ` Bastien 0 siblings, 1 reply; 18+ messages in thread From: Nicolas Goaziou @ 2014-02-07 10:30 UTC (permalink / raw) To: Bastien; +Cc: Andreas Leha, emacs-orgmode Bastien <bzg@gnu.org> writes: > Yes. #+CAPTION[...]: is clumsy. It follows #+RESULTS[...]: model. -- Nicolas Goaziou ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: Feature request: filling of long captions 2014-02-07 10:30 ` Nicolas Goaziou @ 2014-02-07 10:35 ` Bastien 0 siblings, 0 replies; 18+ messages in thread From: Bastien @ 2014-02-07 10:35 UTC (permalink / raw) To: Nicolas Goaziou; +Cc: Andreas Leha, emacs-orgmode Nicolas Goaziou <n.goaziou@gmail.com> writes: > Bastien <bzg@gnu.org> writes: > >> Yes. #+CAPTION[...]: is clumsy. > > It follows #+RESULTS[...]: model. Which I feel clumsy too :) No offense to either Eric or you. The important difference is that #+RESULTS[...] is generated, while #+CAPTION[...] is manually entered. As a user, I'm more tolerant to generated clumsy syntax than to the one I need to *learn*. Anyway, that's kinda bikeshed for now. -- Bastien ^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: Feature request: filling of long captions 2014-02-07 8:47 ` Bastien 2014-02-07 9:56 ` Nicolas Goaziou @ 2014-02-07 16:49 ` Eric Schulte 1 sibling, 0 replies; 18+ messages in thread From: Eric Schulte @ 2014-02-07 16:49 UTC (permalink / raw) To: Bastien; +Cc: emacs-orgmode, Andrea Rossetti, Nicolas Goaziou, Andreas Leha Bastien <bzg@gnu.org> writes: > Hi all, > > Nicolas Goaziou <n.goaziou@gmail.com> writes: > >> I'm sure this idea wouldn't be a net benefit for Org syntax clarity, >> even for the occasional three lines caption need. > > I agree. > > Nicolas, what do you think of enhancing the auto-filling (and > delete-indentation) capabilities for some affiliated keywords? > I did not realize that consecutive caption lines would be merged. This largely addresses my problem (no more Org-mode files going to column 600). If Org-mode had been thoughtful enough to autofill my #+Column lines as they got too long then I would have been completely satisfied. Thanks, > > #+CAPTION: > #+HEADER: > #+TBLFM: > > The last two would require special auto-filling functions, > but at least for #+TBLFM I see the point of enabling this. > > Thanks, -- Eric Schulte https://cs.unm.edu/~eschulte PGP: 0x614CA05D ^ permalink raw reply [flat|nested] 18+ messages in thread
end of thread, other threads:[~2014-02-07 16:56 UTC | newest] Thread overview: 18+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2014-02-06 7:46 Feature request: filling of long captions Andreas Leha 2014-02-06 8:43 ` Bastien 2014-02-06 10:20 ` Andreas Leha 2014-02-06 10:40 ` Bastien 2014-02-06 11:14 ` Andreas Leha 2014-02-06 11:40 ` Thomas Holst 2014-02-06 17:26 ` Scott Randby 2014-02-06 22:08 ` Andrea Rossetti 2014-02-07 2:18 ` Eric Schulte 2014-02-07 7:36 ` Andreas Leha 2014-02-07 8:37 ` Nicolas Goaziou 2014-02-07 8:47 ` Bastien 2014-02-07 9:56 ` Nicolas Goaziou 2014-02-07 10:12 ` Andreas Leha 2014-02-07 10:28 ` Bastien 2014-02-07 10:30 ` Nicolas Goaziou 2014-02-07 10:35 ` Bastien 2014-02-07 16:49 ` Eric Schulte
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).