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

2017-06-24 Thread Nicolas Goaziou
Hello,

Uwe Brauer  writes:

> > Hello,
> > Uwe Brauer  writes:
>
>
> > What is true column hiding? What is the question you are referring to?
>
> Most of the spreadsheet application I know allow you 
>
> -  to mark a column 
>
> -  and to hide it (it is still there and can be displayed of course)
>
> That question was asked for example in
> https://www.reddit.com/r/emacs/comments/2blff3/is_it_possible_to_hide_some_columns_from_an_org

I toyed with the idea, and came up with a proof-of-concept, attached to
this message. 

Basically, it defines two user-facing functions: `org-table-hide-column'
and `org-table-show-column'. Whenever the contents of an hidden column
is changed by the user, the column is shown automatically.

It is probably full of bugs, and I'm not sure it's really worth it, but
here we go. Note that the implementation uses overlays rather than text
properties, so hidden columns are not preserved upon closing and opening
a document.

Feedback welcome.

Regards,

-- 
Nicolas Goaziou
>From f1c858cad711d367e43ba118dc6e3d111705a6d1 Mon Sep 17 00:00:00 2001
From: Nicolas Goaziou 
Date: Sat, 24 Jun 2017 10:37:39 +0200
Subject: [PATCH] org-table: Implement hidden columns

* lisp/org-table.el (org-table-with-hidden-columns): New macro.
(org-table--hidden-field):
(org-table--list-hidden-columns):
(org-table--hide-field):
(org-table--show-field):
(org-table-hide-column):
(org-table-show-column): New functions.

(org-table-align): Use new macro.

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

(org-table-kill-row): Tiny refactoring.

(org-table-overlay-coordinates): Skip hidden columns when displaying
coordinates.
---
 lisp/org-table.el | 650 ++
 1 file changed, 407 insertions(+), 243 deletions(-)

diff --git a/lisp/org-table.el b/lisp/org-table.el
index 595c4e9e1..092754502 100644
--- a/lisp/org-table.el
+++ b/lisp/org-table.el
@@ -510,6 +510,18 @@ Field is restored even in case of abnormal exit."
 	 (org-table-goto-column ,column)
 	 (set-marker ,line nil)
 
+(defmacro org-table-with-hidden-columns (&rest body)
+  "Show all columns before executing BODY, then restore them."
+  (declare (debug (body)))
+  (org-with-gensyms (hidden-columns begin)
+`(let ((,hidden-columns (org-table--list-hidden-columns))
+	   (,begin (org-table-begin)))
+   (org-table-show-column 'all)
+   ,@body
+   (save-excursion
+	 (goto-char ,begin)
+	 (mapc #'org-table-hide-column ,hidden-columns)
+
 ;;;###autoload
 (defun org-table-create-with-table.el ()
   "Use the table.el package to insert a new table.
@@ -758,163 +770,164 @@ 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
-(org-table-save-field
- ;; Make sure invisible characters in the table are at the right
- ;; place since column widths take them into account.
- (font-lock-fontify-region beg end)
- (move-marker org-table-aligned-begin-marker beg)
- (move-marker org-table-aligned-end-marker end)
- (goto-char beg)
- (let* ((indent (progn (looking-at "[ \t]*") (match-string 0)))
-;; Table's rows.  Separators are replaced by nil.  Trailing
-;; spaces are also removed.
-(lines (mapcar (lambda (l)
- (and (not (string-match-p "\\`[ \t]*|-" l))
-  (let ((l (org-trim l)))
-(remove-text-properties
- 0 (length l) '(display t org-cwidth t) l)
-l)))
-   (org-split-string (buffer-substring beg end) "\n")))
-;; Get the data fields by splitting the lines.
-(fields (mapcar (lambda (l) (org-split-string l " *| *"))
-(remq nil lines)))
-;; Compute number of fields in the longest line.  If the
-;; table contains no field, create a default table.
-(maxfields (if fields (apply #'max (mapcar #'length fields))
- (kill-region beg end)
- (org-table-create org-table-default-size)
- (user-error "Empty table - created default table")))
-;; A list of empty strings to fill any short rows on output.
-(emptycells (make-list maxfields ""))
-lengths typenums)
-   ;; Check for special formatting.
-   (dotimes (i maxfields)
- (let ((column (mapcar (lambda (x) (or (nth i x) "")) fields))
-   fmax falign)
-   ;; Look for an explicit width or alignment.
-   (when (save-excursion
-   (or (re-search-forward "| *<[lrc][0-9]*> *\\(|\

Re: [O] [PATCH] doc/Makefile: Auto-generate org-version.tex for orgcard

2017-06-24 Thread Bastien Guerry
Hi Kyle,

Kyle Meyer  writes:

> It seems that the only place where we hardcode the Org version is
> orgcard.tex.  Any objections to auto-generating this as well?

None from me, thanks for this.

-- 
 Bastien



Re: [O] Moving and resetting attachments

2017-06-24 Thread Nicolas Goaziou
Hello,

Florian Lindner  writes:

> Ok, so it's basically a conversion to bool.

Correct.

> That I'm not so sure of. I try to get myself aquainted to ert, but my elisp 
> knowledge, you surely know, is very limited.

I think you're doing well so far.

> Do I understand correctly, that there is no test for any org-attach stuff so 
> far? I've found lisp/test-org-attach-annex.el, but that's for git-annex
> stuff.

That's correct. Anyway, tests can be postponed to a later patch. It can
be cumbersome to play with temporary files without clobbering the
repository.

However, I think tests are important in this case, considering we're
moving user's data around.


Regards,

-- 
Nicolas Goaziou



Re: [O] problem with babel call with post action

2017-06-24 Thread Nicolas Goaziou
Hello,

Eric S Fraga  writes:

> I'm not au fait with using edebug.  Will try to learn it (about time,
> probably).  In the meantime, here is an ECM which definitely fails for
> me with my normal configuration but which almost works with emacs
> -Q.  The almost is that the final output looks like this:
>
> #+begin_src org
>   ,#+RESULTS:
>   ,#+BEGIN_src dot
>   [[file:dependency-graph.pdf]]
>   ,#+END_src
> #+end_src
>
> where I did not expect the wrapping within a src block.
>
> The error using my configuration is
>
> : org-indent-add-properties: Wrong type argument: arrayp, nil

I think this was fixed recently. Could you confirm it?

Regards,

-- 
Nicolas Goaziou



Re: [O] [bug?] org-inside-latex-fragment-p broken?

2017-06-24 Thread Rasmus
Nicolas Goaziou  writes:

> Hello,
>
> Carsten Dominik  writes:
>
>> Yes, these can be used in partially written fragments.
>
> OK. Does it make sense to use them outside of any fragment? For example,
> you don't need to be in a LaTeX fragment to insert \alpha.

First, we have to be careful because the cdlatex keys occupy a precious
key.

Second, it depends on the cdlatex function in question.
cdlatex-math-symbol-alist already works outside of fragments and it
probably should as it can be used to insert entities, such as "β".

On the other hand, cdlatex-math-modify probably only makes sense inside
fragments.  It is used to change characteristics of already inserted
entity, e.g. make a character bold.  That typically only makes sense
inside a math environment of some sort.  Add to this, that something like
"\mathbf{x}" isn’t "correctly" exported via ox, (it should then produce
"$\mathbf{x}$").  So cdlatex-math-modify should only work inside latex
fragments IMO.

-- 
m-mm-mmm- bacon!



Re: [O] :noweb from external file

2017-06-24 Thread edgar

On 2017-06-22 22:08, ed...@openmail.cc wrote:


Right now, I can only do it like this:

../dir2/file3.org
==
#+INCLUDE: ../dir1/file1.org::py-numpy
#+NAME: py-noweb
#+CAPTION: Loading Numpy and Matplotlib onto Python.
#+BEGIN_SRC python :results none :noweb yes
<>
#+END_SRC
==



I'm sorry. This is not working either. I am not trying to waste your 
time, I promise: it was working at some point.


Thanks again.

-

ONLY AT VFEmail! - Use our Metadata Mitigator to keep your email out of the 
NSA's hands!
$24.95 ONETIME Lifetime accounts with Privacy Features!  
15GB disk! No bandwidth quotas!
Commercial and Bulk Mail Options!  



[O] exporting org to docx

2017-06-24 Thread Doyley, Marvin M.
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 asynchronous export 
process") (current-message)) (unwind-protect (progn (if with-temp-message 
(progn (setq current-message (current-message)) (message "%s" 
with-temp-message))) (let ((--copy-fun (org-export--generate-copy-script ...)) 
(--temp-file (make-temp-file "org-export-process")) (--coding 
buffer-file-coding-system)) (let ((temp-file --temp-file) (temp-buffer ...)) 
(unwind-protect (prog1 ... ...) (and ... ...))) (let* ((process-connection-type 
nil) (--proc-buffer ...) (--process ...)) (org-export-add-to-stack (get-buffer 
--proc-buffer) nil --process) (let (...) (set-process-sentinel --process 
...) (and with-temp-message (if current-message (message "%s" 
current-message) (message nil) (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 (...) (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)))
  (let ((ext-plist (org-combine-plists (list (quote :output-file) file) 
ext-plist)) (encoding (or org-export-coding-system buffer-file-coding-system))) 
(if async (let ((with-temp-message "Initializing asynchronous export process") 
(current-message)) (unwind-protect (progn (if with-temp-message (progn (setq 
current-message ...) (message "%s" with-temp-message))) (let ((--copy-fun ...) 
(--temp-file ...) (--coding buffer-file-coding-system)) (let (... ...) 
(unwind-protect ... ...)) (let* (... ... ...) (org-export-add-to-stack ... nil 
--process) (let ... ... (and with-temp-message (if current-message (message 
"%s" current-message) (message nil) (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 ... ...)) (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 (not (file-writable-p file)) (error "Output file not writable") (let 
((ext-plist (org-combine-plists (list (quote :output-file) file) ext-plist)) 
(encoding (or org-export-coding-system buffer-file-coding-system))) (if async 
(let ((with-temp-message "Initializing asynchronous export process") 
(current-message)) (unwind-protect (progn (if with-temp-message (progn ... 
...)) (let (... ... ...) (let ... ...) (let* ... ... ...))) (and 
with-temp-message (if current-message (message "%s" current-message) (message 
nil) (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 ... ...) 
(and ... ... (

Re: [O] exporting org to docx

2017-06-24 Thread John Kitchin
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 asynchronous export 
> process") (current-message)) (unwind-protect (progn (if with-temp-message 
> (progn (setq current-message (current-message)) (message "%s" 
> with-temp-message))) (let ((--copy-fun (org-export--generate-copy-script 
> ...)) (--temp-file (make-temp-file "org-export-process")) (--coding 
> buffer-file-coding-system)) (let ((temp-file --temp-file) (temp-buffer ...)) 
> (unwind-protect (prog1 ... ...) (and ... ...))) (let* 
> ((process-connection-type nil) (--proc-buffer ...) (--process ...)) 
> (org-export-add-to-stack (get-buffer --proc-buffer) nil --process) (let (...) 
> (set-process-sentinel --process ...) (and with-temp-message (if 
> current-message (message "%s" current-message) (message nil) (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 (...) 
> (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)))
>   (let ((ext-plist (org-combine-plists (list (quote :output-file) file) 
> ext-plist)) (encoding (or org-export-coding-system 
> buffer-file-coding-system))) (if async (let ((with-temp-message "Initializing 
> asynchronous export process") (current-message)) (unwind-protect (progn (if 
> with-temp-message (progn (setq current-message ...) (message "%s" 
> with-temp-message))) (let ((--copy-fun ...) (--temp-file ...) (--coding 
> buffer-file-coding-system)) (let (... ...) (unwind-protect ... ...)) (let* 
> (... ... ...) (org-export-add-to-stack ... nil --process) (let ... ... 
> (and with-temp-message (if current-message (message "%s" current-message) 
> (message nil) (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 ... ...)) (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 (not (file-writable-p file)) (error "Output file not writable") (let 
> ((ext-plist (org-combine-plists (list (quote :output-file) file) ext-plist)) 
> (encoding (or org-export-coding-system buffer-file-coding-system))) (if async 
> (let ((with-temp-message "Initializing asynchronous export process") 
> (current-message)) (unwind-protect (progn (if with-temp-message (progn ... 
> ...)) (let (... ... ...) (let ... ...) (let* ... ... ...))) (and 

Re: [O] exporting org to docx

2017-06-24 Thread Doyley, Marvin M.
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 asynchronous export 
>> process") (current-message)) (unwind-protect (progn (if with-temp-message 
>> (progn (setq current-message (current-message)) (message "%s" 
>> with-temp-message))) (let ((--copy-fun (org-export--generate-copy-scr

[O] Refile with ido matching only beginning of header

2017-06-24 Thread Jason Dunsmore
Hello,

I used to be able to match any part of the header when refiling using the
ido interface, but now it only matches the very beginning of the header
text.

For example, if I have a file like:

* Foo bar
* Baz

Then visit Baz and type "C-c C-w bar" there are no matches.

I've fiddled with several ido and related org-* variables to no avail.
Here's what I currently have:

(setq ido-enable-flex-matching t)
(setq ido-everywhere t)
(ido-mode 1)
(setq org-completion-use-ido t)
(setq org-refile-use-outline-path nil)
(setq org-outline-path-complete-in-steps nil)

I'm using Org 9.0.9.

Any idea how I can configure Org refile with ido to match any part of the
header?

Thanks,
Jason


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

2017-06-24 Thread Uwe Brauer

   > Hello,
   > Uwe Brauer  writes:


   > I toyed with the idea, and came up with a proof-of-concept, attached to
   > this message. 

   > Basically, it defines two user-facing functions: `org-table-hide-column'
   > and `org-table-show-column'. Whenever the contents of an hidden column
   > is changed by the user, the column is shown automatically.

Great thanks I will test this now, I presume this patch is against the
latest stable version?




[O] Bug: Does HEADER_LATEX_EXTRA work in org 9.0? [9.0.9 (9.0.9-elpaplus @ ~/.emacs.d/elpa/org-plus-contrib-20170622/)]

2017-06-24 Thread Mario Román
I have tried to use #+latex_header_extra on org 9.0.9, using an empty Emacs
configuration file. The following fragment

#+LATEX_HEADER_EXTRA: \newcommand{\test}{testing}
$\test$

creates an image with the text "testing". It seems that it is using the
command inside the preview; but I would expect it to give me an error (a
blank image), as \test should not be defined in latex preview. I don't know
if this is a bug or if I am missing something.

Expected behaviour: error on the latex preview.
Actual behaviour: the latex preview works using the command defined on the
extra header, that should not be used in latex preview.

Emacs  : GNU Emacs 26.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version
3.22.12)
 of 2017-04-28
Package: Org mode version 9.0.9 (9.0.9-elpaplus @
~/.emacs.d/elpa/org-plus-contrib-20170622/)


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

2017-06-24 Thread Nicolas Goaziou
Hello,

Uwe Brauer  writes:

> Great thanks I will test this now, I presume this patch is against the
> latest stable version?

No, it is against development version, aka "master" branch.

Regards,

-- 
Nicolas Goaziou



[O] Export results of code literal blocks (Jekyll directory structure) xpost emacs.stackexchange

2017-06-24 Thread Jeremy Reeve
Org-mode newbie here.  Please be gentle.  Posted on Stack Exchange
before I found the official list.

I'm trying to follow the recipe for exporting Org-mode documents for
processing by Jekyll. My publishing org-publish-project-alist is
configured to place exported html in my _posts directory and take
images and place them in _posts/assets with org-publish-attachment.
This modification of directory structure seems to be the root of the
problem.

#+BEGIN_SRC python :results value file
  import numpy as np
  import matplotlib.pyplot as plt

  from mpl_toolkits.mplot3d import Axes3D

  p1 = np.array([0,4,4])
  p2 = np.array([4,-4,4])
  p3 = np.array([2,2,-4])

  fig = plt.figure()
  ax = fig.gca(projection='3d')
  ax.set_aspect("equal")

  #draw the arrow
  ax.quiver(p1[0],p1[1],p1[2],p2[0],p2[1],p2[2],length=1.0)
  ax.quiver(p1[0],p1[1],p1[2],p3[0],p3[1],p3[2],length=1.0)

  ax.set_xlim([-5, 5])
  ax.set_ylim([-5, 5])
  ax.set_zlim([-5, 5])

  plt.savefig('../images/hw1-p3.png')
  return '../images/hw1-p3.png'
#+END_SRC

#+RESULTS:
[[file:../images/hw1-p3.png]]


#+BEGIN_EXPORT html

  
  Problem 3 visualisation

#+END_EXPORT html

The end result I would like is to have the link to the result of the
literal code block automatically generated either such that it is not
exported as an inline image (as the relative path is incorrect) and be
forced to manually add a correct link for HTML export or have the
inline image link transformed such that it is correct.

Suggestions like "Don't use Jekyll" are fine so long as it is
accompanied with an alternative and explanation as to why.  I see some
people have written custom Org-mode Jekyll plugins like
https://github.com/eggcaker/jekyll-org and am wondering if these are a
better route.

Also, the above snippet exports everything including the "BEGIN
export" which I think shouldn't happen but I'll examine that
separately.

Regards...Jeremy

Org mode version 9.0.5 (9.0.5-elpa @ /Users/xxx/.emacs.d/elpa/org-20170210/)
GNU Emacs 25.1.1 (x86_64-apple-darwin13.4.0, NS appkit-1265.21 Version
10.9.5 (Build 13F1911)) of 2016-09-18



[O] Fwd: Re: How to export LaTeX amsmath align bmatrix to ODT?

2017-06-24 Thread edgar

I forgot to send this to the list. Sorry.

 Original Message 
Subject: Re: How to export LaTeX amsmath align bmatrix to ODT?
Date: 2017-06-15 22:57
From: ed...@openmail.cc
To: Nicolas Goaziou 

Hello Nicolas,

Thank you for your help. My comments are under each block:

On 2017-06-14 14:10, Nicolas Goaziou wrote:

Hello,



On 2017-06-10 05:13, edgar wrote:

On 2017-06-10 04:54, edgar wrote:

Hello,

I have been making progress with my export procedure to ODT. I would
like to know if someone knows how to export the following LaTeX 
block

to ODT correctly:

\[\begin{align} \begin{bmatrix} a = 1 & b=2 \\ c=3 & d = 4
\end{bmatrix} \end{align}\]
https://www.vfemail.net/roundcube/?_task=mail&_action=compose&_id=289067995593b7fd683a1f#
\[\begin{align}  a = & 1 + 2 + 3 + 4 \\ c = &  4 \end{bmatrix}
\end{align}\]


I'm a bit lost here. In particular, I'm able to export the example 
above

out-of-the-box, provided I add "#+options: tex:dvipng" or some such in
the document.



Yes, indeed, without modifying any variable, the code exports correctly, 
but I had modified org-preview-latex-process-alist to include my 
symbols.tex file like this:


On 2017-06-05 07:00, edgar wrote:

I managed to get the special symbols by

1. M-x customize-variable org-preview-latex-process-alist
2. Doing [Ins] into the dvipng (or imagemagick) section
3. typing :latex-header in the Key: field
4. typing "\\input{./symbols.tex}" in the Value: field

After I did that, some symbols would export correctly, but others would 
not. I was not importing any LaTeX packages within that file. I use this 
file to export PDF (through LaTeX: C-c C-e l p). One of the things that 
did not work was the matrix environment. I thought that it was better to 
start a new question regarding the matrix, because I thought it was 
independent of the symbols.


This is related to the following:


For the record, I had modified org-preview-latex-process-alist to get
custom symbols, and this got in the way of the LaTeX bmatrix
environment (I don't know how; I was loading a file with
with :latex-header as "\\input{preamble.tex}").

My partial answer (it is partial, because the \tensor preview renders
in a different color than the rest of symbols): Instead of modifying
org-preview-latex-process-alist, the answer I modified
org-format-tex-header. I added the following at the end of M-x
customize-variable org-format-tex-header (I leave it here for
posterity; I added some symbols: tensor, derivative, vector, Roman
numeral, etc.)


I don't think you need to modify `org-format-latex-header' at all. 
There

is `org-latex-packages-alist' for that.
I don't really know how to modify org-latex-packages-alist to have a 
latex command like this in my tex file:


\newcommmand{\mysymbol}[1]{\mathrm{my_{#1}}}

I do have a bunch of packages with custom options over there :P !



So, is there a bug in the ODT export back-end? If so, could you post an
ECM? Loads of LaTeX code doesn't help understanding the issue.

I think that the only bug is that I don't know how to use it very well 
;) . I don't know what a ECM is :S , sorry. I typed ECM emacs on a web 
search engine, and only got ECB. Is it the same? If you are willing to 
tell me how to get one, I'll do my best.


Right now, I am having a glitch on the screen. I get some of my custom 
symbols in black (all the others are in light gray) on a black 
background (my screen has a black background; see attached picture: 
there is an I with two tildes underneath next to the p). I would like to 
know if you or someone else can help me to get a light gray on that 
symbol too. I suspect that it may have to do with the stackengine 
(LaTeX) package, because all of my other symbols are doing well. This is 
the snippet of code that I have in org-format-latex-header to define the 
\tensor symbol


\newcommand{\tensor}[1]{
  
\stackunder[0pt]{\stackunder[1pt]{#1}{\scriptscriptstyle\sim}}{\scriptscriptstyle\sim}}


I also opened a new emacs with -Q, did a (require 'org), yanked my 
configuration of org-format-latex-header and created a new Org file. 
Then, changed the theme to a dark one and I typed $\tensor{F}$ $a$. For 
the $\tensor{F}$ I get a white square with a black font face. For the 
$a$ I get the same set of colors as the theme (dark background, 
light-gray font face).


Thank you a lot for you time!


Edgar

-

ONLY AT VFEmail! - Use our Metadata Mitigator to keep your email out of the 
NSA's hands!
$24.95 ONETIME Lifetime accounts with Privacy Features!  
15GB disk! No bandwidth quotas!

Commercial and Bulk Mail Options!  

org-ltximg_968041b7b2f6ea14aa6a6df6b779409cb85988b9.png
Description: Binary data


Re: [O] exporting LaTeX to ODT with custom symbols

2017-06-24 Thread edgar

On 2017-06-05 07:00, ed...@openmail.cc wrote:

On 2017-06-04 09:36, Nicolas Goaziou wrote:

You may want to try tweaking `org-preview-latex-process-alist'.


Thanks. This helped!

I leave this in case that it may be useful to others (one thing
worked, the other didn't):

I managed to get the special symbols by

1. M-x customize-variable org-preview-latex-process-alist
2. Doing [Ins] into the dvipng (or imagemagick) section
3. typing :latex-header in the Key: field
4. typing "\\input{./symbols.tex}" in the Value: field

I can also change the resolution of the pictures, if I manually set
the density in the :image-converter option, but the size changes. To
fix it, I tried by

1. adding -scale 50\% at the end of the imagemagick (convert) string
2. modifying the value of :image-size-adjust, and
3. changing the scale in org-format-latex-options

, but that did not help. I don't care too much about the resolution. I
can live with the output of dvipng.

Thanks again!


For posterity (read only if you are looking for a custom answer):

I noticed that using the :latex-header option in 
org-preview-latex-process-alist, disables the regular heading (created 
through org-format-latex-header, may be?). It replaces the heading 
(document class, packages, etc.) with whatever the :latex-header line 
states. This possibly means that one could create a custom _full_ header 
(with document class, any other package and customisation), and load it 
by means of :latex-header to see previews and exporting to ODT. This is 
just an idea. I hope it helps someone.


-

ONLY AT VFEmail! - Use our Metadata Mitigator to keep your email out of the 
NSA's hands!
$24.95 ONETIME Lifetime accounts with Privacy Features!  
15GB disk! No bandwidth quotas!
Commercial and Bulk Mail Options!  



[O] [PATCH] org-protocol: fixes open-source and extends rewriting of URLs

2017-06-24 Thread Mario Martelli
Hi list,Doing the tests for the documentation I encountered some issues with org-protocol.[0001-url-is-sanitized-before-processing]I’ve got trouble to get sub-protocol “open-source” working in some cases. By sanitising the URL it works for me in all cases.

0001-url-is-sanitized-before-processing.patch
Description: Binary data
[0002-tests-open-source-uri-against-uri-and-not-filename]This changes the test of the URI which was tested against the resulting filename. It’s now tested against the base-url.I’m still unsure with this because the code is there for more than seven years. Maybe I’m not seeing something obvious here. But all tests I made so far are succeeding with this change.

0002-tests-open-source-uri-against-uri-and-not-filename.patch
Description: Binary data
[0003-org-protocol-open-source-can-open-hugo-sources-with-date-url]Enables “open-source” to open hugo sources from a blog which is using date URLs like:https://cool-blog.com/2017/05/20/cool-post/WDYT of this?Kind regardsMario—