[O] access value of an export option

2017-06-27 Thread Matt Price
Hi,

I'm modifying https://github.com/helloyi/ox-hugo/edit/master/ox-hugo.el to
make a few things a little easier. In particular, I'd like to be able to
set the hugo content directory and hugo section paths as export options.
to this end I have defined some new export options:

:options-alist '((
   (:hugo-content-dir  "HUGO_CONTENT_DIR" nil nil)
   (:hugo-section "HUGO_SECTION" "posts" nil)
   (:hugo-static-images "HUGO_STATIC_IMAGES" "image" nil)))

So now I can set these with

#+HUGO_CONTENT_DIR: /home/matt/hugo/content

or

:PROPERTIES:
:HUGO_CONTENT_DIR: /home/matt/hugo/content
:END:

But because these are paths I want to write to, I'd like to be able to
access these settings *before* calling org-export-to-file in a function
like:


(defun org-hugo-export-to-md (&optional async subtreep visible-only)
  "Export current buffer to a Hugo Flavored Markdown file.
 [ snip ]
Return output file's name."
  (interactive)
  (let* ((pub-dir
 (concat (file-name-as-directory
   UM_I_WANT_TO_WRITE_HUGO_CONTENT_DIR
HUGO_SECTION_DIR)))
 (outfile (org-export-output-file-name ".md" subtreep)))
(org-export-to-file 'hugo outfile async subtreep visible-only)))
--

But I'm not sure what to use to access the settings at this stage, since I
don't have the "info" channel available yet. It seems a little silly to
call =org-export--get-export-attributes= here, since it will also be called
by =org-export-to-file=. Is that, in fact, the best thing to do?

As always, thank you!

Matt


Re: [O] exporting org to docx

2017-06-27 Thread John Kitchin
Your file worked approximately right for me. The code block did not render
too well (I set it up to use minted), but everything else did fine I guess.
My tex header is different than yours, but I don't know how much that
matters. The output I got is attached.

I did see two places where delete-file might cause that and have pushed
fixes to scimax for them. They may have been the cause (although I don't
know why mine would have worked, and it didn't for you, the ox-word
versions should have been the same probably).

John

---
Professor John Kitchin
Doherty Hall A207F
Department of Chemical Engineering
Carnegie Mellon University
Pittsburgh, PA 15213
412-268-7803
@johnkitchin
http://kitchingroup.cheme.cmu.edu


On Tue, Jun 27, 2017 at 7:21 PM, Doyley, Marvin M. 
wrote:

> Here is a sample file that I have been using,
>
>
>
> > On Jun 27, 2017, at 10:53 AM, John Kitchin 
> wrote:
> >
> > can you post a small org file that has this problem?
> >
> > Doyley, Marvin M. writes:
> >
> >> Thanks for point this out, which I have now removed, but  I still get
> an error. This time I get
> >>
> >> pandoc: nil: openFile: does not exist (No such file or directory)
> >> helm-M-x: Wrong type argument: stringp, nil
> >>
> >> Thanks,
> >> M
> >> PS here is the back trace
> >> Debugger entered--Lisp error: (wrong-type-argument stringp nil)
> >>  delete-file(nil)
> >>  (let* ((bibfiles (mapcar (quote expand-file-name)
> (org-ref-find-bibliography))) (temp-bib) (bibtex-entries) biboption csl
> (current-file (buffer-file-name)) (basename (file-name-sans-extension
> current-file)) (tex-file (concat basename ".tex")) (docx-file (concat
> basename ".docx"))) (save-buffer) (if bibfiles (progn (setq bibtex-entries
> (let* ((bibtex-files bibfiles) (keys (reverse ...))
> (bibtex-entry-kill-ring-max (length keys)) (bibtex-entry-kill-ring (quote
> nil))) (let ((wconfig ...)) (unwind-protect (progn ...)
> (set-window-configuration wconfig))) (mapconcat (quote identity)
> bibtex-entry-kill-ring "\n\n")) temp-bib (make-temp-file "ox-word-" nil
> ".bib") biboption (format " --bibliography=%s " temp-bib)) (let ((temp-file
> temp-bib) (temp-buffer (get-buffer-create (generate-new-buffer-name " *temp
> file*" (unwind-protect (prog1 (save-current-buffer (set-buffer
> temp-buffer) (insert bibtex-entries)) (save-current-buffer (set-buffer
> temp-buffer) (write-region nil nil temp-file nil 0))) (and (buffer-name
> temp-buffer) (kill-buffer temp-buffer)) (setq csl (cdr (assoc
> "PANDOC-CSL" (org-element-map (org-element-parse-buffer) (quote keyword)
> (function (lambda (key) (cons ... ...))) (if csl (setq csl (format "
> --csl=%s " csl)) (setq csl " ")) (org-latex-export-to-latex async subtreep
> visible-only body-only options) (if (file-exists-p docx-file) (progn
> (delete-file docx-file))) (shell-command (format "pandoc -s -S %s%s\"%s\"
> -o \"%s\"" biboption csl tex-file docx-file)) (delete-file temp-bib)
> (org-open-file docx-file (quote (16
> >>  ox-export-via-latex-pandoc-to-docx-and-open()
> >>  funcall-interactively(ox-export-via-latex-pandoc-to-docx-and-open)
> >>  call-interactively(ox-export-via-latex-pandoc-to-docx-and-open record
> nil)
> >>  command-execute(ox-export-via-latex-pandoc-to-docx-and-open record)
> >>  helm-M-x(nil #("ox-export-via-latex-pandoc-to-docx-and-open" 0 43
> (match-part "ox-export-via-latex-pandoc-to-docx-and-open")))
> >>  funcall-interactively(helm-M-x nil 
> >> #("ox-export-via-latex-pandoc-to-docx-and-open"
> 0 43 (match-part "ox-export-via-latex-pandoc-to-docx-and-open")))
> >>  call-interactively(helm-M-x nil nil)
> >>  command-execute(helm-M-x)
> >>
> >>
> >>
> >>
> >>> On Jun 24, 2017, at 1:07 PM, John Kitchin 
> wrote:
> >>>
> >>> what is this function: my-other-delete-trailing-blank-lines
> >>>
> >>> it appears it is not defined. but is getting called in a
> before-save-hook.
> >>>
> >>> Doyley, Marvin M. writes:
> >>>
>  Hi there,
> 
>  I am play with John’s ox-word.el function, which us pandoc to convert
> org via latex to docx. However, when I try to use it, I get  the following
> error
> 
>  helm-M-x: Wrong type argument: stringp, nil
> 
> 
>  Any suggestion on how to resolve this issue.
> 
>  Cheers,
>  M
> 
>  Ps Here is the backtrace
> 
>  Debugger entered--Lisp error: (void-function my-other-delete-trailing-
> blank-lines)
>  my-other-delete-trailing-blank-lines()
>  run-hooks(before-save-hook)
>  basic-save-buffer(nil)
>  save-buffer()
>  write-file("./test.tex.tex")
>  (let ((coding-system-for-write encoding)) (write-file file))
>  (progn (insert output) (let ((coding-system-for-write encoding))
> (write-file file)))
>  (unwind-protect (progn (insert output) (let ((coding-system-for-write
> encoding)) (write-file file))) (and (buffer-name temp-buffer) (kill-buffer
> temp-buffer)))
>  (save-current-buffer (set-buffer temp-buffer) (unwind-protect (progn
>

Re: [O] exporting org to docx

2017-06-27 Thread Doyley, Marvin M.
Here is a sample file that I have been using,



simple_test.org
Description: Binary data


simple_test.tex
Description: TeX document

> On Jun 27, 2017, at 10:53 AM, John Kitchin  wrote:
> 
> can you post a small org file that has this problem?
> 
> Doyley, Marvin M. writes:
> 
>> Thanks for point this out, which I have now removed, but  I still get an 
>> error. This time I get
>> 
>> pandoc: nil: openFile: does not exist (No such file or directory)
>> helm-M-x: Wrong type argument: stringp, nil
>> 
>> Thanks,
>> M
>> PS here is the back trace
>> Debugger entered--Lisp error: (wrong-type-argument stringp nil)
>>  delete-file(nil)
>>  (let* ((bibfiles (mapcar (quote expand-file-name) 
>> (org-ref-find-bibliography))) (temp-bib) (bibtex-entries) biboption csl 
>> (current-file (buffer-file-name)) (basename (file-name-sans-extension 
>> current-file)) (tex-file (concat basename ".tex")) (docx-file (concat 
>> basename ".docx"))) (save-buffer) (if bibfiles (progn (setq bibtex-entries 
>> (let* ((bibtex-files bibfiles) (keys (reverse ...)) 
>> (bibtex-entry-kill-ring-max (length keys)) (bibtex-entry-kill-ring (quote 
>> nil))) (let ((wconfig ...)) (unwind-protect (progn ...) 
>> (set-window-configuration wconfig))) (mapconcat (quote identity) 
>> bibtex-entry-kill-ring "\n\n")) temp-bib (make-temp-file "ox-word-" nil 
>> ".bib") biboption (format " --bibliography=%s " temp-bib)) (let ((temp-file 
>> temp-bib) (temp-buffer (get-buffer-create (generate-new-buffer-name " *temp 
>> file*" (unwind-protect (prog1 (save-current-buffer (set-buffer 
>> temp-buffer) (insert bibtex-entries)) (save-current-buffer (set-buffer 
>> temp-buffer) (write-region nil nil temp-file nil 0))) (and (buffer-name 
>> temp-buffer) (kill-buffer temp-buffer)) (setq csl (cdr (assoc 
>> "PANDOC-CSL" (org-element-map (org-element-parse-buffer) (quote keyword) 
>> (function (lambda (key) (cons ... ...))) (if csl (setq csl (format " 
>> --csl=%s " csl)) (setq csl " ")) (org-latex-export-to-latex async subtreep 
>> visible-only body-only options) (if (file-exists-p docx-file) (progn 
>> (delete-file docx-file))) (shell-command (format "pandoc -s -S %s%s\"%s\" -o 
>> \"%s\"" biboption csl tex-file docx-file)) (delete-file temp-bib) 
>> (org-open-file docx-file (quote (16
>>  ox-export-via-latex-pandoc-to-docx-and-open()
>>  funcall-interactively(ox-export-via-latex-pandoc-to-docx-and-open)
>>  call-interactively(ox-export-via-latex-pandoc-to-docx-and-open record nil)
>>  command-execute(ox-export-via-latex-pandoc-to-docx-and-open record)
>>  helm-M-x(nil #("ox-export-via-latex-pandoc-to-docx-and-open" 0 43 
>> (match-part "ox-export-via-latex-pandoc-to-docx-and-open")))
>>  funcall-interactively(helm-M-x nil 
>> #("ox-export-via-latex-pandoc-to-docx-and-open" 0 43 (match-part 
>> "ox-export-via-latex-pandoc-to-docx-and-open")))
>>  call-interactively(helm-M-x nil nil)
>>  command-execute(helm-M-x)
>> 
>> 
>> 
>> 
>>> On Jun 24, 2017, at 1:07 PM, John Kitchin  wrote:
>>> 
>>> what is this function: my-other-delete-trailing-blank-lines
>>> 
>>> it appears it is not defined. but is getting called in a before-save-hook.
>>> 
>>> Doyley, Marvin M. writes:
>>> 
 Hi there,
 
 I am play with John’s ox-word.el function, which us pandoc to convert org 
 via latex to docx. However, when I try to use it, I get  the following 
 error
 
 helm-M-x: Wrong type argument: stringp, nil
 
 
 Any suggestion on how to resolve this issue.
 
 Cheers,
 M
 
 Ps Here is the backtrace
 
 Debugger entered--Lisp error: (void-function 
 my-other-delete-trailing-blank-lines)
 my-other-delete-trailing-blank-lines()
 run-hooks(before-save-hook)
 basic-save-buffer(nil)
 save-buffer()
 write-file("./test.tex.tex")
 (let ((coding-system-for-write encoding)) (write-file file))
 (progn (insert output) (let ((coding-system-for-write encoding)) 
 (write-file file)))
 (unwind-protect (progn (insert output) (let ((coding-system-for-write 
 encoding)) (write-file file))) (and (buffer-name temp-buffer) (kill-buffer 
 temp-buffer)))
 (save-current-buffer (set-buffer temp-buffer) (unwind-protect (progn 
 (insert output) (let ((coding-system-for-write encoding)) (write-file 
 file))) (and (buffer-name temp-buffer) (kill-buffer temp-buffer
 (let ((temp-buffer (generate-new-buffer " *temp*"))) (save-current-buffer 
 (set-buffer temp-buffer) (unwind-protect (progn (insert output) (let 
 ((coding-system-for-write encoding)) (write-file file))) (and (buffer-name 
 temp-buffer) (kill-buffer temp-buffer)
 (let ((output (org-export-as backend subtreep visible-only body-only 
 ext-plist))) (let ((temp-buffer (generate-new-buffer " *temp*"))) 
 (save-current-buffer (set-buffer temp-buffer) (unwind-protect (progn 
 (insert output) (let ((coding-system-for-write encoding)) (write-file 
 file))) (and (buffer-name temp-b

Re: [O] org table toggle narrowing and true column hiding

2017-06-27 Thread Nicolas Goaziou
Hello,

Uwe Brauer  writes:

> Here are my impressions.
>
>
> -  (org-table-hide-column nil) works nicely! I can hide several columns: I
>start with the first, hide it,  move to the second hide etc
>
> -  however (org-table-hide-column 1) etc did not work as expected,
>the first column was hidden but when I called
>(org-table-hide-column 2) that column  was not hidden! Then I
>found out the culprit. I had the cursor on a different column. So
>(org-table-hide-column 1) seems to work best if the cursor is not
>on the table!
>
> -  would it be possible to hide various column on the fly. Either by
>marking them or running (org-table-hide-column 1 2 3) or
>something like this.
>
> Thanks very much for this, I would it very useful and think it should be
> included at some point in master.

I toyed a bit further with the idea, and re-designed the whole thing.

The new implementation provides a single user-facing function:
`org-table-toggle-column-visibility'. Here is its docstring:

Shrink or expand current column in an Org table.

When optional argument ARG is a string, use it as white space
separated list of column ranges.  A column range can be one of
the following patterns:

  Ncolumn N only
  N-M  every column between N and M (both inclusive)
  N-   every column between N (inclusive) and the last column
  -M   every column between the first one and M (inclusive)
  -every column

When called with `C-u' prefix, ask for the range specification.

When called with `C-u C-u' prefix, expand all columns.

In particular, when called with a prefix argument, it allows you to
type, e.g., "1-3 5 6-" and have columns 1, 2, 3, 5, 6 and onward shrunk
or expanded, according to their current state. I find it quite
efficient.

I imagine it can be useful when handling wide tables, but so can ""
cookies.

Anyway, feedback welcome.

Regards,

-- 
Nicolas Goaziou
>From 893393d728b0d6bf90a1e01a0a699b0dec7051c2 Mon Sep 17 00:00:00 2001
From: Nicolas Goaziou 
Date: Tue, 27 Jun 2017 23:06:02 +0200
Subject: [PATCH] org-table: Implement shrunk columns

* lisp/org-table.el (org-table-shrunk-column-display): New variable.
(org-table-with-shrunk-columns): New macro.
(org-table--shrunk-field):
(org-table--list-shrunk-columns):
(org-table--shrink-field):
(org-table--read-column-selection):
(org-table--expand-all-columns):
(org-table-toggle-column-visibility): New functions.

(org-table-align):
(org-table-get-field):
(org-table-insert-column):
(org-table-delete-column):
(org-table-move-column):
(org-table-move-row):
(org-table-insert-row):
(org-table-insert-hline): Use new functions.

(org-table-kill-row):
(org-table-overlay-coordinates):
(org-table-toggle-coordinate-overlays): Tiny refactoring.
---
 lisp/org-table.el | 777 +-
 1 file changed, 530 insertions(+), 247 deletions(-)

diff --git a/lisp/org-table.el b/lisp/org-table.el
index 595c4e9e1..818917c79 100644
--- a/lisp/org-table.el
+++ b/lisp/org-table.el
@@ -423,6 +423,14 @@ prevents it from hanging emacs."
   :version "26.1"
   :package-version '(Org . "8.3"))
 
+(defcustom org-table-shrunk-column-display "…"
+  "String used to display a shrunk column."
+  :group 'org-table-import-export
+  :type 'string
+  :version "26.1"
+  :package-version '(Org . "9.1")
+  :safe (lambda (v) (and (stringp v) (not (equal v "")
+
 (defconst org-table-auto-recalculate-regexp "^[ \t]*| *# *\\(|\\|$\\)"
   "Regexp matching a line marked for automatic recalculation.")
 
@@ -510,6 +518,20 @@ Field is restored even in case of abnormal exit."
 	 (org-table-goto-column ,column)
 	 (set-marker ,line nil)
 
+(defmacro org-table-with-shrunk-columns (&rest body)
+  "Expand all columns before executing BODY, then shrink them again."
+  (declare (debug (body)))
+  (org-with-gensyms (shrunk-columns begin end)
+`(let ((,begin (copy-marker (org-table-begin)))
+	   (,end (copy-marker (org-table-end) t))
+	   (,shrunk-columns (org-table--list-shrunk-columns)))
+   (org-with-point-at ,begin (org-table--expand-all-columns ,begin ,end))
+   (unwind-protect
+	   (progn ,@body)
+	 (org-table--shrink-columns ,shrunk-columns ,begin ,end)
+	 (set-marker ,begin nil)
+	 (set-marker ,end nil)
+
 ;;;###autoload
 (defun org-table-create-with-table.el ()
   "Use the table.el package to insert a new table.
@@ -758,8 +780,8 @@ When nil, simply write \"#ERROR\" in corrupted fields.")
 (defun org-table-align ()
   "Align the table at point by aligning all vertical bars."
   (interactive)
-  (let* ((beg (org-table-begin))
- (end (copy-marker (org-table-end
+  (let ((beg (org-table-begin))
+	(end (copy-marker (org-table-end
 (org-table-save-field
  ;; Make sure invisible characters in the table are at the right
  ;; place since column widths take them into account.
@@ -767,154 +789,155 @@ When nil, simply write 

Re: [O] After Gmane shutdown: how can I read/write to the org-mode mailing list online

2017-06-27 Thread Eric S Fraga
On Tuesday, 27 Jun 2017 at 16:51, M wrote:

[...]

> @Eric:
> does MUA mean mail software (mail user agent)?!

Yes, sorry.  Too many TLAs (three letter acronyms ;-)).

> If I'm away from home, I can only use the web page of my mail provider
> to read/reply to the list, but as my mail account is limited in the
> number of emails which can be stored, I'm deleting mails on the mail
> server regularly and don't have access to all the mail history, if I'm
> not at home.

Why not use a free email account (google et al.) just for this purpose
(assuming you don't want to use one for other purposes)?  I doubt you
would exceed the storage allocated by those free services with just the
org mailing list!

I have several emails account for similar purposes (not for org, mind
you).

-- 
: Eric S Fraga via Emacs 26.0.50, Org release_9.0.9-551-g92e8c8


signature.asc
Description: PGP signature


Re: [O] After Gmane shutdown: how can I read/write to the org-mode mailing list online

2017-06-27 Thread Uwe Brauer
>>> "M" == M   writes:

   > @ Uwe Brauer: 

   > I was using the gmane web page to read and reply to this mailing
   > list and if I try to open the link from the org-mode website
   > http://news.gmane.org/gmane.emacs.orgmode , I get "Page not found".


Right this is down for some time.


   > @Eric:

   > does MUA mean mail software (mail user agent)?! At home, I'm using
   > my mail sofware (currently Entourage on MacOS X) to read/reply to
   > the group.

   > If I'm away from home, I can only use the web page of my mail
   > provider to read/reply to the list, but as my mail account is
   > limited in the number of emails which can be stored, I'm deleting
   > mails on the mail server regularly and don't have access to all the
   > mail history, if I'm not at home.

   > That's, why it was nice to be able to read and post online on a web page
   > without having to log in to a private mail account.

There is another way, either using emacs or say thunderbird, you open a
new account but specify the newserver (port 119 if I am not mistaken),
this way you don't have to rely on you private email.




Re: [O] After Gmane shutdown: how can I read/write to the org-mode mailing list online

2017-06-27 Thread Nick Dokos
Eric S Fraga  writes:

> On Tuesday, 27 Jun 2017 at 12:56, Uwe Brauer wrote:
>> Ooh, what makes you say gmane was shut down? right now I am using gmane
>> to read this message and to reply.
>
> I think the OP means a web interface to gmane which I think no longer
> exists?  I assume you are using an MUA to access gmane lists?

The NNTP interface works and so you can use Gnus to read (and reply
to) the mailing list.  The setup is


--8<---cut here---start->8---
(setq gnus-select-method
 '(nntp "news.gmane.org"
 (nntp-open-connection-function nntp-open-tls-stream)
 (nntp-port-number 563)
 (nnir-search-engine gmane)
 ))
--8<---cut here---end--->8---

[The following is completely optional, separate and unrelated - but it
is convenient.]

If you want to use Gnus for reading email as well, you can add your email
source(s) as secondary select methods:


--8<---cut here---start->8---
(require 'nnir)

(setq gnus-secondary-select-methods nil)
(add-to-list 'gnus-secondary-select-methods
 '(nnimap "GMail"
  (nnimap-address "imap.gmail.com")
  (nnimap-port 587)
  (nnimap-stream ssl)
  (nnimap-records-commands t)
  (nnir-search-enging imap)))

(add-to-list 'gnus-secondary-select-methods
 '(nnimap "Ohter email service
  (nnimap-address "imap.some-mail-service.com")
  (... other setup ...)
  (nnimap-stream ssl)
  (nnimap-record-commands t)))
--8<---cut here---end--->8---

This takes care of incoming mail.

There is also outgoing mail to worry about, but that's not a Gnus
problem: you have to set up a couple of things in the smtpmail
library (C-h i smtp RET): the sending method, the server, and the port.
I use my localhost at port 25 as my mail server and run postfix to
forward the mail to my "real" relay:

(setq send-mail-function (quote smtpmail-send-it))
(setq smtpmail-smtp-server "localhost")
(setq smtpmail-smtp-service 25)

The postfix set-up is left as an exercise, but there are plenty
of tutorials on the interwebs.
-- 
Nick




[O] import excel files into org

2017-06-27 Thread Uwe Brauer

Hi

Maybe the following is helpful:


(defun org-table-import-xlsx-to-csv-org () 
  (interactive)
  (let* ((source-file  (file-name-sans-extension (buffer-file-name 
(current-buffer
 (xlsx-file (concat source-file ".xlsx"))
 (csv-file (concat source-file ".csv")))
(org-odt-convert xlsx-file "csv")
(org-table-import csv-file  nil)))


(defun org-table-import-xlsx-file-to-csv-org (file) 
  (interactive "f")
  (let* ((source-file  (file-name-sans-extension (buffer-file-name 
(current-buffer
 (xlsx-file (concat source-file ".xlsx"))
 (csv-file (concat source-file ".csv")))
(org-odt-convert file "csv")
(org-table-import csv-file  nil)))




Re: [O] segfault when org-ellipsis is empty

2017-06-27 Thread Kaushal Modi
Just for the record, this bug was fixed in
http://git.savannah.gnu.org/cgit/emacs.git/commit/?id=4a5653cd2859308ada4bbf5ffc9fb9b283eef31a

And here's the bug report:
https://debbugs.gnu.org/cgi/bugreport.cgi?bug=27504

On Mon, Jun 26, 2017 at 6:48 PM Michael Ax  wrote:

> cool compromise; covers my use-cases. tks!
>
> But that would still allow the user to use setq to set that variable.
>
> True, but can we always prevent them from shooting themselves in the
> foot?
>
>
>
> --

Kaushal Modi


Re: [O] After Gmane shutdown: how can I read/write to the org-mode mailing list online

2017-06-27 Thread M

@ Uwe Brauer: 
I was using the gmane web page to read and reply to this mailing list and if
I try to open the link from the org-mode website
http://news.gmane.org/gmane.emacs.orgmode , I get "Page not found".

@Eric:
does MUA mean mail software (mail user agent)?!
At home, I'm using my mail sofware (currently Entourage on MacOS X) to
read/reply to the group.

If I'm away from home, I can only use the web page of my mail provider to
read/reply to the list, but as my mail account is limited in the number of
emails which can be stored, I'm deleting mails on the mail server regularly
and don't have access to all the mail history, if I'm not at home.

That's, why it was nice to be able to read and post online on a web page
without having to log in to a private mail account.

Kind regards

Martin 


> Von: Eric S Fraga 
> Organisation: On the Interweb somewhere
> Antworten an: Eric S Fraga 
> Datum: Tue, 27 Jun 2017 15:15:56 +0100
> An: 
> Betreff: Re: [O] After Gmane shutdown: how can I read/write to the org-mode
> mailing list online
> 
> On Tuesday, 27 Jun 2017 at 12:56, Uwe Brauer wrote:
>> Ooh, what makes you say gmane was shut down? right now I am using gmane
>> to read this message and to reply.
> 
> I think the OP means a web interface to gmane which I think no longer
> exists?  I assume you are using an MUA to access gmane lists?
> -- 
> : Eric S Fraga via Emacs 26.0.50, Org release_9.0.9-551-g92e8c8





Re: [O] exporting org to docx

2017-06-27 Thread John Kitchin
can you post a small org file that has this problem?

Doyley, Marvin M. writes:

> Thanks for point this out, which I have now removed, but  I still get an 
> error. This time I get
>
> pandoc: nil: openFile: does not exist (No such file or directory)
> helm-M-x: Wrong type argument: stringp, nil
>
> Thanks,
> M
> PS here is the back trace
> Debugger entered--Lisp error: (wrong-type-argument stringp nil)
>   delete-file(nil)
>   (let* ((bibfiles (mapcar (quote expand-file-name) 
> (org-ref-find-bibliography))) (temp-bib) (bibtex-entries) biboption csl 
> (current-file (buffer-file-name)) (basename (file-name-sans-extension 
> current-file)) (tex-file (concat basename ".tex")) (docx-file (concat 
> basename ".docx"))) (save-buffer) (if bibfiles (progn (setq bibtex-entries 
> (let* ((bibtex-files bibfiles) (keys (reverse ...)) 
> (bibtex-entry-kill-ring-max (length keys)) (bibtex-entry-kill-ring (quote 
> nil))) (let ((wconfig ...)) (unwind-protect (progn ...) 
> (set-window-configuration wconfig))) (mapconcat (quote identity) 
> bibtex-entry-kill-ring "\n\n")) temp-bib (make-temp-file "ox-word-" nil 
> ".bib") biboption (format " --bibliography=%s " temp-bib)) (let ((temp-file 
> temp-bib) (temp-buffer (get-buffer-create (generate-new-buffer-name " *temp 
> file*" (unwind-protect (prog1 (save-current-buffer (set-buffer 
> temp-buffer) (insert bibtex-entries)) (save-current-buffer (set-buffer 
> temp-buffer) (write-region nil nil temp-file nil 0))) (and (buffer-name 
> temp-buffer) (kill-buffer temp-buffer)) (setq csl (cdr (assoc 
> "PANDOC-CSL" (org-element-map (org-element-parse-buffer) (quote keyword) 
> (function (lambda (key) (cons ... ...))) (if csl (setq csl (format " 
> --csl=%s " csl)) (setq csl " ")) (org-latex-export-to-latex async subtreep 
> visible-only body-only options) (if (file-exists-p docx-file) (progn 
> (delete-file docx-file))) (shell-command (format "pandoc -s -S %s%s\"%s\" -o 
> \"%s\"" biboption csl tex-file docx-file)) (delete-file temp-bib) 
> (org-open-file docx-file (quote (16
>   ox-export-via-latex-pandoc-to-docx-and-open()
>   funcall-interactively(ox-export-via-latex-pandoc-to-docx-and-open)
>   call-interactively(ox-export-via-latex-pandoc-to-docx-and-open record nil)
>   command-execute(ox-export-via-latex-pandoc-to-docx-and-open record)
>   helm-M-x(nil #("ox-export-via-latex-pandoc-to-docx-and-open" 0 43 
> (match-part "ox-export-via-latex-pandoc-to-docx-and-open")))
>   funcall-interactively(helm-M-x nil 
> #("ox-export-via-latex-pandoc-to-docx-and-open" 0 43 (match-part 
> "ox-export-via-latex-pandoc-to-docx-and-open")))
>   call-interactively(helm-M-x nil nil)
>   command-execute(helm-M-x)
>
>
>
>
>> On Jun 24, 2017, at 1:07 PM, John Kitchin  wrote:
>> 
>> what is this function: my-other-delete-trailing-blank-lines
>> 
>> it appears it is not defined. but is getting called in a before-save-hook.
>> 
>> Doyley, Marvin M. writes:
>> 
>>> Hi there,
>>> 
>>> I am play with John’s ox-word.el function, which us pandoc to convert org 
>>> via latex to docx. However, when I try to use it, I get  the following error
>>> 
>>> helm-M-x: Wrong type argument: stringp, nil
>>> 
>>> 
>>> Any suggestion on how to resolve this issue.
>>> 
>>> Cheers,
>>> M
>>> 
>>> Ps Here is the backtrace
>>> 
>>> Debugger entered--Lisp error: (void-function 
>>> my-other-delete-trailing-blank-lines)
>>>  my-other-delete-trailing-blank-lines()
>>>  run-hooks(before-save-hook)
>>>  basic-save-buffer(nil)
>>>  save-buffer()
>>>  write-file("./test.tex.tex")
>>>  (let ((coding-system-for-write encoding)) (write-file file))
>>>  (progn (insert output) (let ((coding-system-for-write encoding)) 
>>> (write-file file)))
>>>  (unwind-protect (progn (insert output) (let ((coding-system-for-write 
>>> encoding)) (write-file file))) (and (buffer-name temp-buffer) (kill-buffer 
>>> temp-buffer)))
>>>  (save-current-buffer (set-buffer temp-buffer) (unwind-protect (progn 
>>> (insert output) (let ((coding-system-for-write encoding)) (write-file 
>>> file))) (and (buffer-name temp-buffer) (kill-buffer temp-buffer
>>>  (let ((temp-buffer (generate-new-buffer " *temp*"))) (save-current-buffer 
>>> (set-buffer temp-buffer) (unwind-protect (progn (insert output) (let 
>>> ((coding-system-for-write encoding)) (write-file file))) (and (buffer-name 
>>> temp-buffer) (kill-buffer temp-buffer)
>>>  (let ((output (org-export-as backend subtreep visible-only body-only 
>>> ext-plist))) (let ((temp-buffer (generate-new-buffer " *temp*"))) 
>>> (save-current-buffer (set-buffer temp-buffer) (unwind-protect (progn 
>>> (insert output) (let ((coding-system-for-write encoding)) (write-file 
>>> file))) (and (buffer-name temp-buffer) (kill-buffer temp-buffer) (if 
>>> (and (org-export--copy-to-kill-ring-p) (org-string-nw-p output)) (progn 
>>> (org-kill-new output))) (or (and (functionp post-process) (funcall 
>>> post-process file)) file))
>>>  (if async (let ((with-temp-message "Initializing asynchronou

Re: [O] After Gmane shutdown: how can I read/write to the org-mode mailing list online

2017-06-27 Thread Eric S Fraga
On Tuesday, 27 Jun 2017 at 12:56, Uwe Brauer wrote:
> Ooh, what makes you say gmane was shut down? right now I am using gmane
> to read this message and to reply.

I think the OP means a web interface to gmane which I think no longer
exists?  I assume you are using an MUA to access gmane lists?
-- 
: Eric S Fraga via Emacs 26.0.50, Org release_9.0.9-551-g92e8c8


signature.asc
Description: PGP signature


Re: [O] After Gmane shutdown: how can I read/write to the org-mode mailing list online

2017-06-27 Thread Uwe Brauer
>>> "Elwood151" == Elwood151   writes:

   > Hi,

   > since gmane was shut down, I'm missing the possibility to post,
   > read and reply to the org-mode mailing list online without having
   > to use my mail account.
 
Ooh, what makes you say gmane was shut down? right now I am using gmane
to read this message and to reply.




Re: [O] Replace macros on tangle

2017-06-27 Thread Giacomo M

Dear Nicolas and Chuck,

thanks for pointing me in the right direction. I never thought that 
macros were actually just an export feature, and that noweb replacements 
could be used as macros!


I am experiencing a little quirk though. Since I often edit this org 
file under Windows, the tangled files have Windows new lines, and 
(cygwin or any) bash doesn't like it. So I added a 
org-babel-post-tangle-hook that set-buffer-file-coding-system to unix. 
But the scripts that I tangle with a noweb ref end up with a weird ^M 
after each end of line. It seems this happens after the post-tangle 
hook. How could I take care of those ^M?


Thanks a lot,

Giacomo


Il 6/26/2017 7:06 PM, Charles C. Berry ha scritto:

On Mon, 26 Jun 2017, Nicolas Goaziou wrote:


Hello,

Giacomo M  writes:


Dear all,
how can I add macro replacement support when a source block is being
tangled?


I don't think so. Macro replacement is an export feature.


If Giacomo's macros operate outside of src blocks, he could export 
using `org-org-export-to-org', then tangle the resulting file.


Giacomo, if you want something to operate inside of src blocks you can 
use noweb replacements that execute code as outlined in


(info "(org) Noweb reference syntax")

In a way these are like macros.

HTH,

Chuck





[O] After Gmane shutdown: how can I read/write to the org-mode mailing list online

2017-06-27 Thread Elwood151
Hi,

 

since gmane was shut down, I'm missing the possibility to post, read and reply to the org-mode mailing list online without having to use my mail account.

 

Is there another way to achieve that?

 

I only found the Gnu archives, but they seem to be read only - no way to post questions or reply:

https://lists.gnu.org/archive/cgi-bin/namazu.cgi?query=frame&submit=Search&idxname=emacs-orgmode

 

Kind regards

 

Martin