[O] [PATCH] Re: links-9.0 v3

2016-08-05 Thread Matt Lundin
Thanks, John, for improving link functionality in org-mode!

I just discovered that this change breaks the contrib files that use
org-store-link-functions and org-add-link-type.

I'm not familiar enough with the details of org-link-set-parameters to
fix all of the contrib files, but I am including a simple patch to
update a contrib file that I use regularly: org-eww.el.

Thanks,
Matt

>From d473260956493dafd1e37c5f3680813fbf63434e Mon Sep 17 00:00:00 2001
From: Matt Lundin 
Date: Fri, 5 Aug 2016 20:07:40 -0500
Subject: [PATCH] Update org-eww to use new link api

* contrib/lisp/org-eww.el: org-store-link-functions: Remove obsolete
  hook.
  (org-link-set-parameters) Use new api for links.
---
 contrib/lisp/org-eww.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/contrib/lisp/org-eww.el b/contrib/lisp/org-eww.el
index 11ccb68..a443255 100644
--- a/contrib/lisp/org-eww.el
+++ b/contrib/lisp/org-eww.el
@@ -48,7 +48,7 @@
 
 
 ;; Store Org-link in eww-mode buffer
-(add-hook 'org-store-link-functions 'org-eww-store-link)
+(org-link-set-parameters "eww" :store #'org-eww-store-link)
 (defun org-eww-store-link ()
   "Store a link to the url of a eww buffer."
   (when (eq major-mode 'eww-mode)
-- 
2.9.2



[O] Documentclass for latex preview images

2016-08-05 Thread Maik Schünemann
Hi,

Is there an option to set the documentclass that is used in temporary files
to create latex preview images?

I am writing math texts with org mode and am using amsthm for theorems etc
and let them be counted by chapter:

#+LATEX_HEADER: \usepackage{amsthm}
#+LATEX_HEADER: \newtheorem{thm}{Theorem}[chapter]
#+LATEX_HEADER: \newtheorem{defn}{Definition}[chapter]
#+LATEX_HEADER: \newtheorem{prop}{Proposition}[chapter]

After I put these lines in my .org file, latex preview images stopped
working although latex export still did. The problem is that in the
temporary files used to generate the preview images, the documentclass
article is used which doesn't define the counter chapter.

I managed to resolve this issue for me by checking for presence of the
counter.
#+LATEX_HEADER: \makeatletter
#+LATEX_HEADER: \newcommand\ifcounter[3]{\@ifundefined{c@#1}{#3}{#2}}
#+LATEX_HEADER: \makeatother
#+LATEX_HEADER: \ifcounter{chapter}{
#+LATEX_HEADER: \newtheorem{thm}{Theorem}[chapter]
#+LATEX_HEADER: \newtheorem{defn}{Definition}[chapter]
#+LATEX_HEADER: \newtheorem{prop}{Proposition}[chapter]
#+LATEX_HEADER: }{}


Is there a downside to using the same document class as the org file
specifies for export to create the preview images?

Thanks,
Maik


[O] odt macro export

2016-08-05 Thread Ken Mankoff
Hi Org List,

I'm trying to style some ODT exports and having trouble. I'm following the 
examples here: 
http://orgmode.org/manual/Creating-one_002doff-styles.html#Creating-one_002doff-styles

This works:

#+BEGIN_ODT

This paragraph is specially formatted and uses bold text.

#+END_ODT

But this does not. Should it?

#+MACRO: BEGIN_RC @@odt:@@
#+MACRO: END_RC @@odt:@@
{{{BEGIN_RC}}}
This paragraph is specially formatted and uses bold text.
{{{END_RC}}}

The text between the macros does not appear to be exported at all.

Thanks,

  -k.



Re: [O] Bug: org-agenda-list fails with "wrong-type-argument stringp nil" from org-agenda-skip [8.3.5 (8.3.5-elpaplus @ $HOME/.emacs.d/elpa/org-plus-contrib-20160801/)]

2016-08-05 Thread Robert Irelan
Trying again since it wasn't received the first time.

On Tue, Aug 2, 2016 at 12:02 PM Robert Irelan  wrote:

> Ever since updating to 20160801, I've encountered the following error
> whenever trying to run org-agenda-list:
>
> Debugger entered--Lisp error: (wrong-type-argument stringp nil)
>   looking-at(nil)
>   org-agenda-skip()
>   org-agenda-get-deadlines()
>   org-agenda-get-day-entries("/path/to/todo.org" (8 2 2016)
> :deadline :scheduled :timestamp :sexp)
>   apply(org-agenda-get-day-entries "/path/to/todo.org" (8 2 2016)
> (:deadline :scheduled :timestamp :sexp))
>   org-agenda-list(nil)
>   funcall-interactively(org-agenda-list nil)
>   call-interactively(org-agenda-list record nil)
>   command-execute(org-agenda-list record)
>   helm-M-x(nil "org-agenda-list")
>   funcall-interactively(helm-M-x nil "org-agenda-list")
>   call-interactively(helm-M-x nil nil)
>   command-execute(helm-M-x)
>
>
>
> Emacs  : GNU Emacs 25.1.1 (x86_64-pc-linux-gnu, GTK+ Version 3.10.8),
> modified by Debian
> Package: Org-mode version 8.3.5 (8.3.5-elpaplus @
> $HOME/.emacs.d/elpa/org-plus-contrib-20160801/)
>
> current state:
> ==
> (setq
>  org-tab-first-hook '(org-hide-block-toggle-maybe
> org-babel-hide-result-toggle-maybe org-babel-header-arg-expand)
>  org-speed-command-hook '(org-speed-command-default-hook
> org-babel-speed-command-hook)
>  org-occur-hook '(org-first-headline-recenter)
>  org-clock-in-prepare-hook '(my-org-mode-ask-effort)
>  org-metaup-hook '(org-babel-load-in-session-maybe)
>  org-agenda-start-on-weekday nil
>  org-confirm-shell-link-function 'yes-or-no-p
>  org-columns-default-format "%60ITEM(Task) %10Effort(Effort){:}
> %10CLOCKSUM %10CLOCKSUM_T"
>  org-clock-idle-time 15
>  org-startup-folded nil
>  org-list-allow-alphabetical t
>  org-pretty-entities t
>  org-agenda-todo-ignore-scheduled 'future
>  org-agenda-skip-scheduled-if-done t
>  org-agenda-custom-commands '(("n" "Agenda and all TODOs" ((agenda "")
> (alltodo)))
>   ("u" "Unscheduled TODOs" todo ""
>((org-agenda-skip-function
>  (quote (org-agenda-skip-entry-if
> (quote scheduled) (quote deadline) (quote regexp) "\n]+>")))
> (org-agenda-overriding-header
> "Unscheduled TODO entries: "))
>)
>   ("Q" . "Custom queries")
>   ("Q/" "Archive occur"
>(lambda (unused)
> (let*
>  ((tmp (if (boundp
> org-agenda-text-search-extra-files) org-agenda-text-search-extra-files
> (quote nil)))
>   (org-agenda-text-search-extra-files
> (cons (quote agenda-archives) tmp)))
>  (call-interactively (quote
> org-occur-in-agenda-files)))
> )
>"")
>   )
>  org-use-sub-superscripts '{}
>  org-todo-keyword-faces '(("TODO" :foreground "red" :weight bold)
> ("NEXT" :foreground "blue" :weight bold)
>   ("DONE" :foreground "forest green" :weight
> bold) ("WAITING" :foreground "orange" :weight bold)
>   ("HOLD" :foreground "magenta" :weight bold)
> ("CANCELLED" :foreground "forest green" :weight bold)
>   ("MEETING" :foreground "forest green"
> :weight bold) ("PHONE" :foreground "forest green" :weight bold))
>  org-after-todo-state-change-hook '(org-clock-out-if-current)
>  org-clock-x11idle-program-name "/usr/bin/xprintidle"
>  org-from-is-user-regexp "\\"
>  org-src-mode-hook '(org-src-babel-configure-edit-buffer
> org-src-mode-configure-edit-buffer)
>  org-agenda-before-write-hook '(org-agenda-add-entry-text)
>  org-babel-pre-tangle-hook '(save-buffer)
>  org-font-lock-set-keywords-hook '(org-drill-add-cloze-fontification)
>  org-global-properties '(("Effort_ALL" . "0:15 0:30 0:45 1:00 2:00
> 3:00 4:00 5:00 6:00 8:00") ("SYTLE_ALL" . "habit"))
>  org-mode-hook '(#[nil "\300\301\302\303\304$\207" [org-add-hook
> change-major-mode-hook org-show-block-all append local] 5]
>  #[nil "\300\301\302\303\304$\207" [org-add-hook
> change-major-mode-hook org-babel-show-result-all append local] 5]
>  org-babel-result-hide-spec org-babel-hide-all-hashes
> org-eldoc-load)
>  org-refile-targets '((nil :maxlevel . 9) (org-agenda-files :maxlevel . 9))
>  org-outline-path-complete-in-steps nil
>  org-todo-state-tags-triggers '(("CANCELLED" ("CANCELLED" . t))
> ("WAITING" ("WAITING" . t)) ("HOLD" ("WAITING") ("HOLD" . t))
> (done ("WAITING") ("HOLD")) ("TODO"
> ("WAITING") ("CANCELLED") ("HOLD"))
> ("NEXT" ("WAITING") ("CANCELLED")
> ("HOLD")) ("DONE" ("WAITING") ("CANCELLED") ("HOLD")))
>  org

[O] Bug: org-agenda-list fails with "wrong-type-argument stringp nil" from org-agenda-skip [8.3.5 (8.3.5-elpaplus @ $HOME/.emacs.d/elpa/org-plus-contrib-20160801/)]

2016-08-05 Thread Robert Irelan
Ever since updating to 20160801, I've encountered the following error
whenever trying to run org-agenda-list:

Debugger entered--Lisp error: (wrong-type-argument stringp nil)
  looking-at(nil)
  org-agenda-skip()
  org-agenda-get-deadlines()
  org-agenda-get-day-entries("/path/to/todo.org" (8 2 2016)
:deadline :scheduled :timestamp :sexp)
  apply(org-agenda-get-day-entries "/path/to/todo.org" (8 2 2016)
(:deadline :scheduled :timestamp :sexp))
  org-agenda-list(nil)
  funcall-interactively(org-agenda-list nil)
  call-interactively(org-agenda-list record nil)
  command-execute(org-agenda-list record)
  helm-M-x(nil "org-agenda-list")
  funcall-interactively(helm-M-x nil "org-agenda-list")
  call-interactively(helm-M-x nil nil)
  command-execute(helm-M-x)



Emacs  : GNU Emacs 25.1.1 (x86_64-pc-linux-gnu, GTK+ Version 3.10.8),
modified by Debian
Package: Org-mode version 8.3.5 (8.3.5-elpaplus @
$HOME/.emacs.d/elpa/org-plus-contrib-20160801/)

current state:
==
(setq
 org-tab-first-hook '(org-hide-block-toggle-maybe
org-babel-hide-result-toggle-maybe org-babel-header-arg-expand)
 org-speed-command-hook '(org-speed-command-default-hook
org-babel-speed-command-hook)
 org-occur-hook '(org-first-headline-recenter)
 org-clock-in-prepare-hook '(my-org-mode-ask-effort)
 org-metaup-hook '(org-babel-load-in-session-maybe)
 org-agenda-start-on-weekday nil
 org-confirm-shell-link-function 'yes-or-no-p
 org-columns-default-format "%60ITEM(Task) %10Effort(Effort){:}
%10CLOCKSUM %10CLOCKSUM_T"
 org-clock-idle-time 15
 org-startup-folded nil
 org-list-allow-alphabetical t
 org-pretty-entities t
 org-agenda-todo-ignore-scheduled 'future
 org-agenda-skip-scheduled-if-done t
 org-agenda-custom-commands '(("n" "Agenda and all TODOs" ((agenda "")
(alltodo)))
  ("u" "Unscheduled TODOs" todo ""
   ((org-agenda-skip-function
 (quote (org-agenda-skip-entry-if
(quote scheduled) (quote deadline) (quote regexp) "\n]+>")))
(org-agenda-overriding-header
"Unscheduled TODO entries: "))
   )
  ("Q" . "Custom queries")
  ("Q/" "Archive occur"
   (lambda (unused)
(let*
 ((tmp (if (boundp
org-agenda-text-search-extra-files) org-agenda-text-search-extra-files
(quote nil)))
  (org-agenda-text-search-extra-files
(cons (quote agenda-archives) tmp)))
 (call-interactively (quote
org-occur-in-agenda-files)))
)
   "")
  )
 org-use-sub-superscripts '{}
 org-todo-keyword-faces '(("TODO" :foreground "red" :weight bold)
("NEXT" :foreground "blue" :weight bold)
  ("DONE" :foreground "forest green" :weight
bold) ("WAITING" :foreground "orange" :weight bold)
  ("HOLD" :foreground "magenta" :weight bold)
("CANCELLED" :foreground "forest green" :weight bold)
  ("MEETING" :foreground "forest green"
:weight bold) ("PHONE" :foreground "forest green" :weight bold))
 org-after-todo-state-change-hook '(org-clock-out-if-current)
 org-clock-x11idle-program-name "/usr/bin/xprintidle"
 org-from-is-user-regexp "\\"
 org-src-mode-hook '(org-src-babel-configure-edit-buffer
org-src-mode-configure-edit-buffer)
 org-agenda-before-write-hook '(org-agenda-add-entry-text)
 org-babel-pre-tangle-hook '(save-buffer)
 org-font-lock-set-keywords-hook '(org-drill-add-cloze-fontification)
 org-global-properties '(("Effort_ALL" . "0:15 0:30 0:45 1:00 2:00
3:00 4:00 5:00 6:00 8:00") ("SYTLE_ALL" . "habit"))
 org-mode-hook '(#[nil "\300\301\302\303\304$\207" [org-add-hook
change-major-mode-hook org-show-block-all append local] 5]
 #[nil "\300\301\302\303\304$\207" [org-add-hook
change-major-mode-hook org-babel-show-result-all append local] 5]
 org-babel-result-hide-spec org-babel-hide-all-hashes
org-eldoc-load)
 org-refile-targets '((nil :maxlevel . 9) (org-agenda-files :maxlevel . 9))
 org-outline-path-complete-in-steps nil
 org-todo-state-tags-triggers '(("CANCELLED" ("CANCELLED" . t))
("WAITING" ("WAITING" . t)) ("HOLD" ("WAITING") ("HOLD" . t))
(done ("WAITING") ("HOLD")) ("TODO"
("WAITING") ("CANCELLED") ("HOLD"))
("NEXT" ("WAITING") ("CANCELLED")
("HOLD")) ("DONE" ("WAITING") ("CANCELLED") ("HOLD")))
 org-archive-hook '(org-attach-archive-delete-maybe)
 org-ctrl-c-ctrl-c-hook '(org-babel-hash-at-point
org-babel-execute-safely-maybe)
 org-refile-use-outline-path t
 org-cycle-hook '(org-cycle-hide-archived-subtrees
org-cycle-hide-drawers org-cycle-show-empty-lines
  org-optimize-window-after-visibi

[O] Error with inline image resizing

2016-08-05 Thread Takeshi Teshima
Hi all,

When I try to show inline images automatically resized in an org-mode
buffer, the thumbnail doesn't show (a big blank box shows where the resized
image should be) and the following errors are echoed in the "*Messages*"
buffer.

```
ImageMagick error: no decode delegate for this image format `JPEG' @
error/constitute.c/ReadImage/504
```

The image types I have tried are JPG and PNG.
When tried with a PNG file, the error message changes to
```
ImageMagick error: no decode delegate for this image format `PNG' @
error/constitute.c/ReadImage/504
```

* [Related settings]:

** init.el

`(setq org-image-actual-width nil)`

** the org-mode file

```

#+ATTR_LATEX: :width 300pt

[[file:20160802-142357_2016-08-02_13.35.28-1.jpg]]

```

I tried this with Emacs running in the safe mode, i.e. running with "-q"
option.

The inline image shows correctly (with the original size) until I set
`org-image-actual-width` to `nil`, after which I don't see the image in the
buffer

 (A big blank box appears where the image should be. I also see the errors
mentioned above in the "*Messages*" buffer.).

* [Current workaround I use]:
It doesn't occur when I use the snippet in this SO answer.
http://stackoverflow.com/questions/17637685/configuring-emacs-for-showing-fixed-width-inline-images
It basically rewrites org-display-inline-images function.

* [Environmental information]:
** (i) I built my Emacs using the following tool:
https://github.com/renard/emacs-build-macosx
by running `./build-emacs emacs-24.5`.
It was built with ImageMagick, and I can correctly export LaTeX formula
with it.
Also it works fine when I don't use the resize feature, i.e.
`org-image-actual-width` is set to `t`.

** (ii) Versions
*** Emacs:  emacs-24.5.50.1
*** Mac OS X: El Capitan 10.11.6(15G31).

*** $ convert --version

Version: ImageMagick 6.9.5-1 Q16 x86_64 2016-07-15
http://www.imagemagick.org

Copyright: Copyright (C) 1999-2016 ImageMagick Studio LLC

License: http://www.imagemagick.org/script/license.php

Features: Cipher DPC Modules

Delegates (built-in): bzlib freetype jng jpeg ltdl lzma png tiff webp xml
zlib


Thank you very much in advance.

diadochos