Closed QiangF closed 8 months ago
This might be an issue for all windows that has a non-english system language. The solution is just remove (coding-system-for-write 'no-conversion) in org-odt-zip.
The zip
uses call-process
, and if I understand correctly it is very much like running a shell command but without any shell quoting. So, I believe that coding-sytem-for-write
may affect what gets displayed in *Messages*
buffer, but not the ODT file itself.
Could you please attach a OK zip file, and a not OK zip file ....
I remember reading somewhere that the FILE NAMEs themselves uses a specific encoding, do a M-x apropos-variable file-name-coding-system
... I believe the files themselves may be encoded right (using utf-8
) but the file names within the zip
file, and the name of the zip
file itself, uses an improper coding system for file name, and that screws up things.
Try enclosing the problem zip file, and give the values of various coding systems that you use on the system.
If you are adventurous, You can also add a debug
before the call-process
, and when the Emacs is suspended get in to the CLI shell and do the following two commands to zip up the file as odt
. This way you can see if zipping up with call-process
gives different results from zipping up with manually running commands.
(cmds `(("zip" "-mX0" ,target-name "mimetype")
("zip" "-rmTq" ,target-name ".")))
I need more information, before I can understand what the problem is. My gut feeling is the coding-system-for-write
may not be a problem, but your file name coding system could be a problem.
I just filtered on variables in Emacs
manual that have the string coding
in them
(
buffer-file-coding-system
coding-system-for-read
coding-system-for-write
coding-system-require-warning
default-process-coding-system
file-coding-system-alist
file-name-coding-system
last-coding-system-used
locale-coding-system
mode-line-coding-system-map
network-coding-system-alist
process-coding-system-alist
save-buffer-coding-system
select-safe-coding-system-accept-default-p
select-safe-coding-system-function
selection-coding-system
)
I suggest that you focus on values of coding system vars which have file-name
or process
in them. I think coding-system-for-write
is the wrong coding system to look at
I also suggest that you do describe-coding-system
in Windows machines that have problems and do not have problems. Just run a diff
on these outputs.
file-name-coding-system is a variable defined in ‘C source code’.
Its value is nil
Coding system for encoding file names.
If it is nil, ‘default-file-name-coding-system’ (which see) is used.
On MS-Windows, the value of this variable is largely ignored if
‘w32-unicode-filenames’ (which see) is non-nil. Emacs on Windows
behaves as if file names were encoded in ‘utf-8’.
Probably introduced at or before Emacs version 20.1.
[back]
See if the value of w32-unicode-filenames
has any effect
It is important which process is displaying the output of the zip file. If LO is reporting corrupted file, then the zip
is invoked with wrong process
coding system (may be)
If its emacs archive-mode
that zips and unzips the file, then all the coding systems may come in to play.
In other words, experiment and see if you can get better handle on the problem.
Your issue itself says it is issue with file names
, and NOT the issue with encoding of the file
-s themselves. So, focus on file name
encoding and not file
encoding. There are good Chinese hackers; before you start describing the problem they will know where the fix may lie. Just put the question or describe your problem on Emacs China may be.
(I don't have Windows machines, and even if I change the system locale of my debian machine to Chinese, and I would have no clue to make a head or tail ... So I would appreciate the Chinese speakers are better equipped to experiment and figure where the problem is and how the fix may look like.
I don't have the windows computer on hand. I already have this setting.
(set-language-environment "UTF-8")
(setq w32-unicode-filenames '())
(set-file-name-coding-system 'gbk-dos)
(modify-coding-system-alist 'process "*" '(utf-8 . gbk-dos))
Exactly the issue is the filename. If I keep (coding-system-for-write 'no-conversion) in org-odt-zip, file name is screwed up. And the exportor complains that the file can't be found. Actually it is there but a name that not in utf-8 encoding.
I want to collect as much info as possible ...
zip
you are using.system-type
and system-configuration
M-x describe-coding-system
M-x describe-language-environment
coding-system
specific values that you set explicitly in your init
file (set-language-environment "UTF-8")
(setq w32-unicode-filenames '())
(set-file-name-coding-system 'gbk-dos)
(modify-coding-system-alist 'process "*" '(utf-8 . gbk-dos))
See if changing the file name with recode-file-name
helps
recode-file-name is an interactive byte-compiled Lisp function in files.el
.
(recode-file-name FILE CODING NEW-CODING &optional
OK-IF-ALREADY-EXISTS)
Change the encoding of FILE’s name from CODING to NEW-CODING.
The value is a new name of FILE.
Signals a file-already-exists
error if a file of the new name
already exists unless optional fourth argument OK-IF-ALREADY-EXISTS
is non-nil. A number as fourth arg means request confirmation if
the new name already exists. This is what happens in interactive
use with M-x.
Probably introduced at or before Emacs version 22.1.
[back]
As a Chinese user, you can experiment with following complex scenarios,
ODT_STYLES_FILE
, ODT_CONTENT_TEMPLATE_FILE
, and ODT_EXTRA_IMAGES
. Note that the ODT_STYLES_FILE
can specify header/footer images file names to be extracted out of a odt
file. So give "complicated" chinese names to the image file names that needs to be pulled away from an existing ott
file.unzip
a odt
file created by exporter using dired
and see if browsing the file names within the odt
archive creates issues.zip
file created by odt
exporter in LibreOffice.IIUC, the problem is with the name of the odt
file created with call-process
on zip
. (I have reasons to believe that coding-system-for-write
may influence how the arguments to the zip
program (note that, one of the arguments is the name of the odt
file) could be encoded on its way to the zip
program.
Now that we know that coding-system-for-write
can include file name encoding / decoding, we know that there are many places--particularly where the "standard" content.xml, styles.xml are produced the coding-system-for-write
is set to utf-8
. I hope these make-shift bindings doesn't clobber up the file name
themselves.
Since this is a file name encoding / decoding issue, there are multiple file names involved ....
odt
fileodt
file, like content.xm
, meta.xml
etc etc. I don't know if these ASCII file names content.xml
, meta.xml
, style.xml
, manifest.xml
, mimetype
etc create issues with non-ASCII systems like Chinese. _(The only case where files with probematic names may end up in the odt
zip archive is when ODT_EXTRAIMAGES get used)zip
and unzip
program (as invoked by archive-mode
) when they pack and unpack odt
files using dired
commands.ODT_STYLES_FILE
(this can specify header images to be extracted from a template file, and be included in the odt
file created by the exporter) and ODT_CONTENT_TEMPLATE_FILE
Not a solution but some remarks for future reference ...
I believe there are too many moving parts ... I was wondering how coding-system-for-write
affects file name encodings. This comment by Eli and a cursory look at the C-code for call-process
suggests that the value of coding-system-for-write
can influence the value that goes in to argument-coding
which gets subsequently used as part of encode-coding-string
. The presence of [find-operation-coding-system
for call-process
] suggests that the enter for the process (zip
in our case) and (git
in the afore-mentioned issue with magit
particularly this remark about why rg
has "strange" process encodings) will also influence how args
to call-process
gets encoded.
find-operation-coding-system is a built-in function in src/coding.c
.
(find-operation-coding-system OPERATION ARGUMENTS...)
Choose a coding system for an operation based on the target name. The value names a pair of coding systems: (DECODING-SYSTEM . ENCODING-SYSTEM). DECODING-SYSTEM is the coding system to use for decoding (in case OPERATION does decoding), and ENCODING-SYSTEM is the coding system for encoding (in case OPERATION does encoding).
The first argument OPERATION specifies an I/O primitive: For file I/O, insert-file-contents
or write-region
. For process I/O, call-process
, call-process-region
, or start-process
. For network I/O, open-network-stream
.
The remaining arguments should be the same arguments that were passed to the primitive. Depending on which primitive, one of those arguments is selected as the TARGET. For example, if OPERATION does file I/O, whichever argument specifies the file name is TARGET.
TARGET has a meaning which depends on OPERATION: For file I/O, TARGET is a file name (except for the special case below). For process I/O, TARGET is a process name. For network I/O, TARGET is a service name or a port number.
This function looks up what is specified for TARGET in file-coding-system-alist
, process-coding-system-alist
, or network-coding-system-alist
depending on OPERATION. They may specify a coding system, a cons of coding systems, or a function symbol to call. In the last case, we call the function with one argument, which is a list of all the arguments given to this function. If the function can’t decide a coding system, it can return undecided
so that the normal code-detection is performed.
If OPERATION is insert-file-contents
, the argument corresponding to TARGET may be a cons (FILENAME . BUFFER). In that case, FILENAME is a file name to look up, and BUFFER is a buffer that contains the file’s contents (not yet decoded). If file-coding-system-alist
specifies a function to call for FILENAME, that function should examine the contents of BUFFER instead of reading the file.
Probably introduced at or before Emacs version 22.1.
[back]
M-x man
on zip
has the following remarks
Unicode. Though the zip standard requires storing paths in an
archive using a specific character set, in practice zips have
stored paths in archives in whatever the local character set is.
This creates problems when an archive is created or updated on a
system using one character set and then extracted on another
system using a different character set. When compiled with
Unicode support enabled on platforms that support wide
characters, zip now stores, in addition to the standard local
path for backward compatibility, the UTF-8 translation of the
path. This provides a common universal character set for storing
paths that allows these paths to be fully extracted on other
systems that support Unicode and to match as close as possible on
systems that don't.
On Win32 systems where paths are internally stored as Unicode but
represented in the local character set, it's possible that some
paths will be skipped during a local character set directory
scan. zip with Unicode support now can read and store these
paths. Note that Win 9x systems and FAT file systems don't fully
support Unicode.
Be aware that console windows on Win32 and Unix, for example,
sometimes don't accurately show all characters due to how each
operating system switches in character sets for display.
However, directory navigation tools should show the correct paths
if the needed fonts are loaded.
This issue Proper encoding for file names in zip archives created in Windows and unpacked in linux - Super User suggests that there different zip
programs behave differently when it comes to encoding file name within the archive. There is also bug#52480: 28.0.60; Emacs Zip-Archive open inside image file does not di which talk about how zip
programs encode file names within the zip
archive.
I know for a fact that @PierreTechoueyres at one point in time, in his own for of org-mode-ox-odt
had a non-submitted patch for issues with FILE-NAME-ENCODING. Pierre never brought it to my attention; But as an author who was curious about what various people who fork my repo do, I noted this local change. Unfortunately, I don't see his change any longer. And I believe he is working around this issue by choosing a ASCII-like file name for his ODT files.
I will be happy if @PierreTechoueyres is kind enough to comment on what his original problem was, and his experiences navigating it.
@QiangF, rememeber to upload screenshots and the problematic and good odt
file. This way we will have some notes to consult if we run in to this or similar issue in distant future.
I wonder whether the ODT exporter has any problems reading / writing the linked files -- which could be Image Files, or any other file link inserted with org
link.
What am I saying is this ...The current problem might only be a tip of the iceberg, and we can use these issue as an excuse for testing / confirming if other FILE-NAME encoding things aren't broken.
Needless to say, we don't have much expertise to understand happens at Emacs or OS layers. Atleast we can cook up some unit test cases to ensure that there aren't more problems hidden elsewhere.
Thank you sir. I will send you a detailed report when I get back to my friends computer. After reading your analysis, I think Emacs lisp has good support for all these coding systems, the problem is mainly with zip and unzip. Actually, I have learn from emacs-china.org that there is a function to adjust the encoding and decoding setting for a process by the executable name, I will try this:
(modify-coding-system-alist 'process "zip" '(gbk-dos . gbk-dos))
(modify-coding-system-alist 'process "unzip" '(gbk-dos . gbk-dos))
In case it works, I think overriding the (coding-system-for-write 'no-conversion) in org-odt-zip is still problematic. I think @PierreTechoueyres has his change here: https://github.com/PierreTechoueyres/org-mode-ox-odt/commit/da57da77dfc22d343aeeee1e88d737a5afb7a9e5
I don't use Emacs on windows, but if we can solve this problem, many non-english users of windows will benefit. I will get back to you later.
@kjambunathan I still update my branch from time to time. I don't know if all files linked in odt have issues or not, BUT what I am sure of is that when an org file has accented characters in its path, I fail exporting it . This is the reason for my branch and commit 6a5616b7 Commits above this are convenience ones. One for the version keyword (and I admit I didn't search hard if there is another way to achieve it) and the last for a warning with Org 9.6.
I think the minimal reproducer should be something like : 1) Create an temp file in c:/Somewhere/AvecDesCaractèresAccentués/myFile.org 2) wrote anything inside it 3) try to export and open (this part is important) it.
And I know this doesn't happen on GNU/Linux.
If you need I could try to create a more detailed reproducer.
I could also try something with the idea from @QiangF comments (but I'm not confident this will help as my patch work with shell command an not with processes).
I think there could be many config combinations, a one solution for all probably doesn't exist. To proper address the unicode char in file names, we should let the user decide. We should not override coding-system-for-write, during setting the zip file name in org-odt-zip. When the name is save in one coding format and fed into zip with another coding format, file does not exist behaviour is unavoidable. Without that line I have no issues what ever I put Chinese character in the file path, either odt filename, or style file name or in a dir name. The relevant information is:
What is the version of zip you are using:
zip -h Copyright (c) 1990-2006 Info-ZIP - Type 'zip "-L"' for software license. Zip 2.32 (June 19th 2006).
What is system-type and system-configuration:
system-type value is ‘windows-nt’
system-configuration is "x86_64-w64-mingw32"
The output of M-x describe-current-coding-system:
Coding system for saving this buffer: Not set locally, use the default. Default coding system (for new files): c -- chinese-gbk-dos (alias: gbk-dos cp936-dos windows-936-dos)
Coding system for keyboard input: U -- utf-8-unix (alias: mule-utf-8-unix cp65001-unix)
Coding system for terminal output: U -- utf-8 (alias: mule-utf-8 cp65001)
Coding system for inter-client cut and paste: U -- utf-16le-dos
Defaults for subprocess I/O: decoding: c -- chinese-gbk-dos (alias: gbk-dos cp936-dos windows-936-dos)
encoding: c -- chinese-gbk-unix (alias: gbk-unix cp936-unix windows-936-unix)
Priority order for recognizing coding systems when reading files:
undecided
Other coding systems cannot be distinguished automatically from these, and therefore cannot be recognized automatically with the present coding system priorities.
Particular coding systems specified for certain file names:
OPERATION TARGET PATTERN CODING SYSTEM(s)
File I/O "\.\(arc\|zip\|lzh\|lha\|zoo\|[jew]ar\|xpi\|rar\|7z\|squashfs\|ARC\|ZIP\|LZH\|LHA\|ZOO\|[JEW]AR\|XPI\|RAR\|7Z\|SQUASHFS\)\'" no-conversion-multibyte "\.\(exe\|EXE\)\'" no-conversion "\.\(sx[dmicw]\|odt\|tar\|t[bg]z\)\'" no-conversion "\.\(gz\|Z\|bz\|bz2\|xz\|gpg\)\'" no-conversion "\.\(jpe?g\|png\|gif\|tiff?\|p[bpgn]m\)\'" no-conversion "\.pdf\'" no-conversion "/#[^/]+#\'" utf-8-emacs-unix "\.tzst\'" (no-conversion . no-conversion) "\.zst\'" (no-conversion . no-conversion) "\.dz\'" (no-conversion . no-conversion) "\.txz\'" (no-conversion . no-conversion) "\.xz\'" (no-conversion . no-conversion) "\.lzma\'" (no-conversion . no-conversion) "\.lz\'" (no-conversion . no-conversion) "\.g?z\'" (no-conversion . no-conversion) "\.\(?:tgz\|svgz\|sifz\)\'" (no-conversion . no-conversion) "\.tbz2?\'" (no-conversion . no-conversion) "\.bz2\'" (no-conversion . no-conversion) "\.Z\'" (no-conversion . no-conversion) "\.elc\'" utf-8-emacs "\.el\'" prefer-utf-8 "\.utf\(-8\)?\'" utf-8 "\.xml\'" xml-find-file-coding-system "\(\`\|/\)loaddefs.el\'" (raw-text . raw-text-unix) "\.tar\'" (no-conversion . no-conversion) "\.po[tx]?\'\|\.po\." po-find-file-coding-system "\.\(tex\|ltx\|dtx\|drv\)\'" latexenc-find-file-coding-system "" (undecided) Process I/O "*" (utf-8 . gbk-dos) "[pP][lL][iI][nN][kK]" (undecided-dos . undecided-dos) "[cC][mM][dD][pP][rR][oO][xX][yY]" (undecided-dos . undecided-dos) Network I/O nothing specified
The output of M-x describe-language-environment:
Chinese-GBK language environment
Support for Chinese GBK character set.
Sample text: Chinese (中文,普通话,汉语) 妳好
Input methods (default chinese-py-punct) chinese-py-punct ("拼符" in mode line)
Character sets: chinese-gbk: GBK Chinese simplified.
Coding systems: chinese-gbk (‘c’ in mode line): GBK encoding for Chinese (MIME:GBK). (alias: chinese-gbk gbk cp936 windows-936)
The different coding-system specific values that you set explicitly in your init file
(set-language-environment "Chinese-GBK") (setq w32-unicode-filenames '()) (set-file-name-coding-system 'gbk-dos) (modify-coding-system-alist 'process "zip" '(utf-8 . gbk-dos))
We should not override coding-system-for-write, during setting the zip file name in org-odt-zip
I have made this commit. Just to be sure, check the output file format to docx
so that there are known issues with how LO'ssoffice
is invoked.
@PierreTechoueyres could you please check if commit https://github.com/kjambunathan/org-mode-ox-odt/commit/a40d2acad2339ff85cc44dccfda95d96570a6cbc fixes your original issue.
I have a gut feeling that Emacs already does the right thing for argument encoding ... I think it was the spurious coding-system-for-write
being forced to no-conversion
which was causing an issue in your case as well.
For informational purpose, please dump these values on your problem machine ....
I want to collect as much info as possible ...
What is the version of zip you are using.
What is system-type and system-configuration
The output of M-x describe-coding-system
The output of M-x describe-language-environment
The different coding-system specific values that you set explicitly in your init file
@PierreTechoueyres could you please check if commit a40d2ac fixes your original issue.
Ensure that you unapply your local changes before testing this. (This is because Emacs already has built-in heuristics and does argument encoding by default)
5. (setq w32-unicode-filenames '())
When I look at an overview of how the Windows build supports file names that cannot be encoded by the current system codepage, there is a remark @L1583 which says
The UTF-8 encoded file names cannot be passed to system APIs, as Windows does not support that. Therefore, they are converted either to UTF-16 or to the ANSI codepage, depending on the value of
w32-unicode-filenames
, before calling any system APIs or CRT library functions. The default value of that variable is determined by the OS on which Emacs runs:nil
on Windows 9X andt
otherwise, but the user can change that default (although I don't see why would she want to)
So, my question to is why are you overriding the recommended value of w32-unicode-filenames
(modify-coding-system-alist 'process "zip" '(utf-8 . gbk-dos))
Dump the value of default value of process encoding system too .... It is a good idea to experiment if the value influences argument encoding in any way
File I/O ".(arc|zip|lzh|lha|zoo|[jew]ar|xpi|rar|7z|squashfs|ARC|ZIP|LZH|LHA|ZOO|[JEW]AR|XPI|RAR|7Z|SQUASHFS)\'" no-conversion-multibyte
How does the above entry for zip
related to the below config entry
(modify-coding-system-alist 'process "zip" '(utf-8 . gbk-dos))
Make sure that the ODT export works for emacs -q
as well
It looks like M-x describe-coding-system
doesn't seem to report about file name coding ....
(I don't understand the issue well, so the above questions are meant to get more understanding of the issue)
Try executing the execute-this
block in the attached org
file ... it collects all variables that has coding
in them. I don't know if it is important, but no harm in collecting it for both with emacs -Q
and emacs
.
@kjambunathan With your latest fix I'm now unable to reproduce the problem with accentuated files. Everything work as expected.
FYI I've used the following file named c:\Temp\accentué.org
with the following content:
# accentué.org -- -*- coding: utf-8 -*-
#+setupfile: ~/.emacs.d/themes/betomorrow-theme/theme-readtheorg.setup
#+title:accentué
#+version: 1.0
#+LANGUAGE: fr
#+OPTIONS: tex:nil ^:{} html-postamble:nil ':t toc:4
#+STARTUP: align nolatexpreview nofold hideblocks
#+PAGEBREAK:
* Setup
#+begin_src elisp
(w32-register-hot-key [h-])
(let ((libre-office-path "C:/Program Files/LibreOffice/program"))
(setenv "PATH" (concat libre-office-path ";" (getenv "PATH")))
(add-to-list 'exec-path libre-office-path))
(custom-set-variables
'(w32-apps-modifier 'super)
'(w32-pass-apps-to-system nil)
'(package-archives '(("gnu" . "https://elpa.gnu.org/packages/")
("nongnu" . "https://elpa.nongnu.org/nongnu/")
("ox-odt" . "https://kjambunathan.github.io/elpa/")))
'(org-odt-convert-process "LibreOffice")
'(org-odt-preferred-output-format "docx")
'(org-odt-transform-processes
'(("Optimize Column Width of all Tables"
"soffice" "--norestore" "--invisible" "--headless"
"macro:///OrgMode.Utilities.OptimizeColumnWidth(%I)")
("Update All"
"soffice" "--norestore" "--invisible" "--headless"
"macro:///OrgMode.Utilities.UpdateAll(%I)")
("Reload"
"soffice" "--norestore" "--invisible" "--headless"
"macro:///OrgMode.Utilities.Reload(%I)")))
(set-fontset-font t 'emoji "Segoe UI Emoji" nil 'prepend)
)
(set-fontset-font t 'emoji "Segoe UI Emoji" nil 'prepend)
(prefer-coding-system 'utf-8)
(set-default-coding-systems 'utf-8-unix)
(package-refresh-contents)
(package-install 'ox-odt)
(windmove-default-keybindings 'super)
#+end_src
#+RESULTS:
* Object
Just test with accents and emoji
Pierre Téchoueyres
🥳🧁🍰🎁🎂🎈🎺🎉🎊📧〽️🧿🌶️🔋😂❤️😍🤣😊🥺🙏💕😭😘👍
# Fin du fichier accentué
Some part aren't necessary for the current problem BUT I've tried with a setup as close as possible as my one.
P.S. Would you mind to make a new release of ox-odt with the latest change ? Extra-bonus : would you mind to include the two other commits from my branch ?
Everything work as expected.
I think this means ALL the 3 things below
zip
workssoffice
converstion to docx
workssoffice
macro for Optimizing Column Width of tables etc works
would you mind to include the two other commits from my branch ?
Do you mean
Add version keyword
and fix-org-9.6-deprecation
(1) is already supported, see Add macro keyword-to-documentproperty and keyword ODT_DOCUMENT_PROPERTIES. Just define version
a document property, and you will be all set. If that feature is incomplete, head over to #117.
(2) is probably minor. The warnings are annoying for me to. But I have left it alone, just in case there are people interested in using my exporter with old Emacs-en or old Org.
Would you mind to make a new release of ox-odt with the latest change ?
No issues ... This once you confirm all the 3 zip
and soffice
issues are resolved.
Would you mind to make a new release of ox-odt with the latest change ?
No issues ... This once you confirm all the 3
zip
andsoffice
issues are resolved. I confirm, for my usage, that everything is working as expected. Thanks in advance
@kjambunathan Sorry I missed this when I try to byte compile the file
Compiling file ~/Projects/Divers/org-mode-ox-odt/lisp/ox-odt.el at Thu Dec 28 15:05:34 2023 ox-odt.el:2759:20: Error: Wrong number of arguments: (2 . 2), 1
Compiling file ~/Projects/Divers/org-mode-ox-odt/lisp/ox-odt.el at Thu Dec 28 15:05:34 2023 ox-odt.el:2759:20: Error: Wrong number of arguments: (2 . 2), 1
I think that is the line
(pcase-let* (((odt-map :soffice-executable-signature) org-odt-custom-desktop-file-options)) and the odt-map
is defined in odt.el
and pcase-defmacro
is auto-loaded
Ofcourse, I run Emacs from master and I updated only very recently
~/src1/org-mode-ox-odt-pristine$ emacs --fingerprint
3b2a84f2f1842767edbd58e6151aba3a1c3a6b934274adbc7bdfd2d0104623f7
~/src1/org-mode-ox-odt-pristine$ emacs --version
GNU Emacs 30.0.50
Development version 8f571769e155 on master branch; build date 2023-12-28.
Copyright (C) 2023 Free Software Foundation, Inc.
GNU Emacs comes with ABSOLUTELY NO WARRANTY.
You may redistribute copies of GNU Emacs
under the terms of the GNU General Public License.
For more information about these matters, see the file named COPYING.
May be pcase-defmacro
is not loaded in your case ... I am running it out of ideas Try to narrow it further. Btw, for compiling ox-ods
, peg
may be needed. You can download it from GNU ELPA. And I compile ox-ods
with
ELPA_DIR_FOR_ODT=~/src/nongnu-elpa/packages make
and ~/src/nongnu-elpa/packages
is essentially my elpa dir and has a peg
subdir.
So, I a anticipate some issues with ox-ods
but not ox-odt
.
For me compilation goes through fine at the following commit ...
commit 2f824e71882d7d18dd4a3fabb94b6e3d38df9510 (HEAD -> master, origin/master, origin/HEAD)
Merge: a40d2acad 58c91cbf9
Author: Jambunathan K <kjambunathan@gmail.com>
Date: Thu Dec 28 17:44:07 2023 +0530
Merge tag 'release_9.6.14'
Release 9.6.14
@kjambunathan
With the following modifications on file odt.el
I was able to compile everything :
@@ -26,9 +26,20 @@
;;; Code:
(require 'dom)
+(require 'map)
;;;; Misc. Helpers
+(unless (fboundp 'map--pcase-map-elt)
+ (defmacro map--pcase-map-elt (key default map)
+ "A macro to make MAP the last argument to `map-elt'.
+
+This allows using default values for `map-elt', which can't be
+done using `pcase--flip'.
+
+KEY is the key sought in the map. DEFAULT is the default value."
+ `(map-elt ,map ,key ,default)))
+
(defun odt-map--make-pcase-bindings (args)
(thread-last args
(seq-map
I've stolen the defmacro on map.el wich is provided on master branch of Emacs.
(require 'map)
This may be the only thing required if you could upgrade map
using GNU ELPA. This require
is only needed only if somehow pcase
doesn't load map
somewhere else ...
Would you like to try the upgrade?
I've stolen the defmacro on map.el wich is provided on master branch of Emacs.
Instead of doing this, can you install map.el
from GNU ELPA, and the version there seems to offer map--make-pcase-bindings
(require 'map)
This may be the only thing required if you could upgrade
map
using GNU ELPA. Thisrequire
is only needed only if somehowpcase
doesn't loadmap
somewhere else ...
This is essentially the native compiler which complained about missing function definitions.
This also remind me that the ox-odt-pkg.el
file need some upgrades:
Would you like to try the upgrade?
I tried with no result. See bellow.
I've stolen the defmacro on map.el wich is provided on master branch of Emacs.
Instead of doing this, can you install
map.el
from GNU ELPA, and the version there seems to offermap--make-pcase-bindings
The version of map available on GNU ELPA is the same that's shipped with my Emacs 29.1 and for now the one in the git repository is only available in master.
Package | Version | Status | Archive | Description |
---|---|---|---|---|
map | 3.3.1 | available | gnu | Map manipulation functions |
map | 3.3.1 | built-in | Map manipulation functions |
I've stolen the defmacro on map.el wich is provided on master branch of Emacs.
I have introduced pcase--flip-3ary
. When I introduced as cl-macrolet', I couldn't get the compilation to pass. So, I have introduced a global macro. (I need to think about why
cl-macrolet` wouldn't work)
Instead of doing this, can you install
map.el
from GNU ELPA, and the version there seems to offermap--make-pcase-bindings
The version of map available on GNU ELPA is the same that's shipped with my Emacs 29.1 and for now the one in the git repository is only available in master.
Use gnu-devel
... if I set package-archives
to
`(("gnu-devel" . "https://elpa.gnu.org/devel/")
("gnu" . "https://elpa.gnu.org/packages/")
("nongnu" . "https://elpa.nongnu.org/nongnu/")
("melpa" . "https://melpa.org/packages/")
("ox-odt" . "https://kjambunathan.github.io/elpa/"))
I see this
map 3.3.1 available gnu Map manipulation functions
map 3.3.1.0.20230… available gnu-dev… Map manipulation functions
So, installing from gnu-devel
is a good idea. I hope the 4th decimals in the version are significant.
This is essentially the native compiler which complained about missing function definitions. This also remind me that the ox-odt-pkg.el file need some upgrades:
add requirements for peg, fix the local variable block to avoid byte compilation maybe add informations like commit, author and url
The folks that regularly who use the exporter can be counted in fingers of my hand. They are comfortable building from git
checkout. I make releases only when someone requests it. The earlier release was almost an year ago, things have moved quite a bit both on ODT and ODS side. I will ensure that the items you are flagged addressed (whenever I happen to make the release)
Please pull and let me know what you find.
I've stolen the defmacro on map.el wich is provided on master branch of Emacs.
I have introduced
pcase--flip-3ary
. When I introduced ascl-macrolet', I couldn't get the compilation to pass. So, I have introduced a global macro. (I need to think about why
cl-macrolet` wouldn't work)
It works !
… Use
gnu-devel
... if I setpackage-archives
to … I see thismap 3.3.1 available gnu Map manipulation functions map 3.3.1.0.20230… available gnu-dev… Map manipulation functions
So, installing from
gnu-devel
is a good idea. I hope the 4th decimals in the version are significant.
I didn't need it to compile successfully.
… The folks that regularly who use the exporter can be counted in fingers of my hand. They are comfortable building from
git
checkout. I make releases only when someone requests it. The earlier release was almost an year ago, things have moved quite a bit both on ODT and ODS side. I will ensure that the items you are flagged addressed (whenever I happen to make the release)
I can do that too, but I'm lazy in following your developments, so if you publish a release from times to times it will help me keep up with you.
Anyway, thanks for your GREAT work on this exporter. This really makes my life easier (as in the past).
Please pull and let me know what you find.
For now everything I'm using is working.
This might be an issue for all windows that has a non-english system language. The solution is just remove (coding-system-for-write 'no-conversion) in org-odt-zip.