emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Nicolas Goaziou <n.goaziou@gmail.com>
To: "Thomas S. Dye" <tsd@tsdye.com>
Cc: Org-mode <emacs-orgmode@gnu.org>,
	Carsten Dominik <carsten.dominik@gmail.com>
Subject: Re: [PATCH] Longtable continuation strings customizable
Date: Thu, 31 Oct 2013 11:19:17 +0100	[thread overview]
Message-ID: <87habxagka.fsf@gmail.com> (raw)
In-Reply-To: <m1d2mmyauy.fsf@tsdye.com> (Thomas S. Dye's message of "Wed, 30 Oct 2013 06:36:21 -1000")

Hello,

tsd@tsdye.com (Thomas S. Dye) writes:

> I have this, based on the example above:
>
>
> #+name: tsd-continuation-strings
> #+begin_src emacs-lisp
>
>   (defun my-personal-table-continuation-strings (row backend info)
>     (when (org-export-derived-backend-p 'latex)
>       (replace-regexp-in-string
>        "multicolumn{[0-9]+}{l}{\\(.*\\)}" "\\ldots\\ continued from previous page"
>        row nil nil 1)
>        (replace-regexp-in-string
>         "multicolumn{[0-9]+}{r}{\\(.*\\)}" "continued on next page \\ldots"
>        row nil nil 1)))
>   (add-to-list 'org-export-filter-table-row-functions
>                'my-personal-table-continuation-strings)
> #+end_src
>
> I also tried 'org-export-filter-table-functions without success.  I
> always get the default continuation strings.  I've looked around for an
> error message, but there doesn't appear to be one, at least that I can
> find. The asynchronous export runs through to completion.

The first `replace-regexp-in-string' has to be applied to the return
value of the second one. IOW they have to be nested.

Also, you need to double again backslashes in replacement string, or use
a non-nil LITERAL argument in `replace-regexp-in-string'.

Eventually, I made a typo in my suggestion: the second line should be:

  (org-export-derived-backend-p backend 'latex)

In a nutshell:

  (defun my-personal-table-continuation-strings (row backend info)
    (when (org-export-derived-backend-p backend 'latex)
      (replace-regexp-in-string
       "multicolumn{[0-9]+}{l}{\\(.*\\)}" "\\ldots\\ continued from previous page"
       (replace-regexp-in-string
        "multicolumn{[0-9]+}{r}{\\(.*\\)}" "continued on next page \\ldots"
        row nil t 1) nil t 1)))


Regards,

-- 
Nicolas Goaziou

  reply	other threads:[~2013-10-31 11:10 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-27  0:42 [PATCH] Longtable continuation strings customizable Thomas S. Dye
2013-10-27  8:05 ` Nicolas Goaziou
2013-10-27  8:07   ` Carsten Dominik
2013-10-27 16:52     ` Thomas S. Dye
2013-10-28  9:28       ` Nicolas Goaziou
2013-10-28 14:55         ` Thomas S. Dye
2013-10-28 17:27           ` Nicolas Goaziou
2013-10-28 19:15             ` Thomas S. Dye
2013-10-29 14:40               ` Nicolas Goaziou
2013-10-30 16:36             ` Thomas S. Dye
2013-10-31 10:19               ` Nicolas Goaziou [this message]
2013-10-31 21:25                 ` Thomas S. Dye

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=87habxagka.fsf@gmail.com \
    --to=n.goaziou@gmail.com \
    --cc=carsten.dominik@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=tsd@tsdye.com \
    /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).