emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Nicolas Goaziou <mail@nicolasgoaziou.fr>
To: "Pierre Téchoueyres" <pierre.techoueyres@free.fr>
Cc: org-mode <emacs-orgmode@gnu.org>
Subject: Re: [PATCH] Add new keyword :coding for #+include directive
Date: Mon, 23 Apr 2018 12:27:45 +0200	[thread overview]
Message-ID: <87zi1uqkta.fsf@nicolasgoaziou.fr> (raw)
In-Reply-To: <87in8lh3xk.fsf@killashandra.ballybran.fr> ("Pierre Téchoueyres"'s message of "Sat, 21 Apr 2018 01:08:07 +0200")

Hello,

pierre.techoueyres@free.fr (Pierre Téchoueyres) writes:

> I did my homework : found a fix for a) and rebased previous patch on
> master.

Thank you. Some comments follow.

> * lisp/ox.el (org-export-expand-include-keyword): Add new keyword
>   `:coding' for specify the file encoding whith the `#+include:'
>   directive.
>
> This allow to use somting like :
>   #+include: "./myfile" :coding cp850-dos
> when your org-file is encoded in utf-8 for example.

Nitpick: Org file

>  ** New features
> +*** New keyword for ~#+include:~ directive
> +Add ~:coding "codign-system"~ keyword to allow include of files from

=~:coding coding-system=

> +different codign system than the main org-file.

Org file.

> +For example:
> +#+begin_example
> +,#+INCLUDE: "myfile.cmd" src cmd :coding cp850-dos
> +#+end_example

Note that we are freezing Org 9.2 right now. This will go into master
once 9.2 is out.

> +		   (coding
> +		    (intern (or (and (string-match
> +				      ":coding +\\<\\([a-z0-9\\-]+\\)\\>" value)
> +				     (prog1 (match-string 1 value)
> +				       (setq value (replace-match "" nil nil value))))
> +				(symbol-name coding-system-for-read))))

                   (coding
		    (or (and (string-match ":coding +\\([a-z0-9\\-]+\\)" value)
                             (prog1 (intern (match-string 1 value))
                               (setq value (replace-match "" nil nil value))))
                        coding-system-for-read))

In Lisp, symbol constituents are all words plus $&*+-_<>

We might want to update the regexp accordingly.

> +Subject: [PATCH] Correctly convert encoding of included files
> +
> +* lisp/ox.el (org-export--prepare-file-contents): convert temporary
> +  buffer encoding to org buffer's encoding.

Org buffer's encoding.

Could you send an updated patch?

Regards,

-- 
Nicolas Goaziou                                                0x80A93738

  reply	other threads:[~2018-04-23 10:27 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-16 19:52 [PATCH] Add new keyword :coding for #+include directive Pierre Téchoueyres
2018-04-16 21:30 ` Pierre Téchoueyres
2018-04-17  8:36   ` Nicolas Goaziou
2018-04-18 18:40     ` Pierre Téchoueyres
2018-04-20 23:08       ` Pierre Téchoueyres
2018-04-23 10:27         ` Nicolas Goaziou [this message]
2018-04-23 19:44           ` Pierre Téchoueyres
2018-04-24 21:59             ` Nicolas Goaziou
2018-04-24 22:57               ` Pierre Téchoueyres
2018-05-04 22:41                 ` Pierre Téchoueyres
2018-05-08 17:31                   ` Nicolas Goaziou
2018-05-14 23:44                     ` Pierre Téchoueyres
2018-05-19 13:13                       ` Nicolas Goaziou
2018-05-19 16:09                         ` Pierre Téchoueyres
2018-05-20  7:33                           ` Nicolas Goaziou
2018-05-24 21:29                             ` Pierre Téchoueyres
2018-06-02 10:13                               ` Nicolas Goaziou
2018-06-08 19:21                                 ` Pierre Téchoueyres
2018-06-13 13:39                                   ` Nicolas Goaziou

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=87zi1uqkta.fsf@nicolasgoaziou.fr \
    --to=mail@nicolasgoaziou.fr \
    --cc=emacs-orgmode@gnu.org \
    --cc=pierre.techoueyres@free.fr \
    /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).