Re: [O] [PATCH] Fix the single quote printed in the message printed by org-table-edit-formulas

2016-03-10 Thread Paul Eggert

On 03/10/2016 07:33 AM, Kaushal Modi wrote:


Shouldn't this be handled by `substitute-command-keys' already?
The fix
looks like a hack.


I don't think this has anything to do with substitute-command-keys. 
That function simply returns a string.


Right, 'message' and 'substitute-command-keys' both turn apostrophe into 
right single quote, so if you really want an apostrophe you need to 
escape it, as Kashal's patch does.


You need to escape the output of substitute-command-keys anyway, in case 
it returns a string containing '%', which 'message' would incorrectly 
interpret as a format specifier.




Re: [O] org export to latex tables, with hlines and |

2016-03-10 Thread Uwe Brauer

   > Hello,
   > Uwe Brauer  writes:


   > IIUC you want to put a rule after every row in the table? If that's the
   > case, the straightforward way to do it is to explicitly put the rule in
   > your table:

   >   |/|<>|
   >   | |  |
   >   |-+--|

   > Otherwise you can use a filter, e.g.,
   > `org-export-filter-table-row-functions' and append "\\hine" there in
   > LaTeX-related back-ends.

I got this to work:


(defun my-latex-insert-hline-always (row backend info)
   "Add a hline to every row when exporting to  LaTeX."
   (when (org-export-derived-backend-p backend 'latex)
 (replace-regexp-in-string "" " hline" row)))

(add-to-list 'org-export-filter-table-row-functions 
'my-latex-insert-hline-always)


Is this what you meant?




Re: [O] [PATCH] Fix the single quote printed in the message printed by org-table-edit-formulas

2016-03-10 Thread Kyle Meyer
Kaushal Modi  writes:

[...]

> -  (message
> +  (message "%s"
>  (substitute-command-keys "\\\
>  Edit formulas, finish with `\\[org-ctrl-c-ctrl-c]' or
> `\\[org-edit-special]'.  \
>  See menu for more commands.")

There are a few other places in Org that call
"(message (substitute-command-keys ...))".  I'd prefer this patch to
take of them all in one go.

--
Kyle



Re: [O] [PATCH] Fix the single quote printed in the message printed by org-table-edit-formulas

2016-03-10 Thread Kaushal Modi
Good point.

I will submit a new patch later today.

On Thursday, March 10, 2016, Kyle Meyer  wrote:

> Kaushal Modi > writes:
>
> [...]
>
> > -  (message
> > +  (message "%s"
> >  (substitute-command-keys "\\\
> >  Edit formulas, finish with `\\[org-ctrl-c-ctrl-c]' or
> > `\\[org-edit-special]'.  \
> >  See menu for more commands.")
>
> There are a few other places in Org that call
> "(message (substitute-command-keys ...))".  I'd prefer this patch to
> take of them all in one go.
>
> --
> Kyle
>


-- 

--
Kaushal Modi


Re: [O] Org-crypt encrypting PROPERTIES?

2016-03-10 Thread Nicolas Goaziou
Hello,

"Daniel E. Doherty"  writes:

> I am trying to use org-crypt to encrypt certain headings, but when I invoke
> org-crypt-entry on an entry with properties, it encrypts the properties as
> well.  From the manual, "Org-crypt will encrypt the text of an entry, but not
> the headline, or properties" it would appear that its not supposed to do that.
>
> It causes a problem if the file is synced with org-caldav, which adds an UID
> property if one does not exist.  To it, an encrypted entry always looks like
> the property does not exist, so it always adds a new one, resulting in a
> series of nested encryptions.  I can recover the original only by decrypting,
> deleting the PROPERTIES drawer, and repeating until the clear text appears.
>
> For example, with this entry:
>
> =
> * Test this with Crypt
> :PROPERTIES:
> :JUNK: Nothing
> :END:
>
> Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
> tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
> quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
> consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
> cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
> proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
>
> =
>
> After I run org-encrypt-entry on the headline, I get this:
>
> =
> * Test this with Crypt
>
>
> =
>
> Notice that the property drawer got encrypted.  Am I reading the manual right,
> that this should not happen?

Fixed. Thank you.


Regards,

-- 
Nicolas Goaziou



Re: [O] "atomic knowledge" modeling tool

2016-03-10 Thread Samuel Loury
Eric S Fraga  writes:

> On Sunday,  6 Mar 2016 at 20:26, Samuel Loury wrote:
>> Samuel Loury  writes:
>>
>> [...]
>>
>>> I will clean the *elc files and send another report. I will also
>>> deactivate the advises not to pollute the results.
>>
>> Actually, profiler reports don't look really easy to read. I provide one
>> in here but I don't know if it is helpful.
>
> Your previous profiler report was easier to read... what did you do
> differently this time?

Hmmm... Honestly, I don't know. I am not sure how the profiler works and
what is THE way to share reports.

I will investigate the topic and share a more readable report if I find
some time.

IMHO, it is less (but still) annoying to wait a minute for the data to
be processed than having to use the emacs interface to access the
data. In that sense, I am spending more efforts in finding a way to
control emacs with another user interface (most likely using Kivy for
the UI and pymacs for the interaction with emacs) than in finding a way
to make org mode more efficient.

My best,
-- 
Konubinix
GPG Key: 7439106A
Fingerprint: 5993 BE7A DA65 E2D9 06CE  5C36 75D2 3CED 7439 106A


signature.asc
Description: PGP signature


Re: [O] org-agenda error

2016-03-10 Thread Nicolas Goaziou
Hello,

Peter Salazar  writes:

> Any thoughts on that? I'm not sure if it's related, but I also get errors
> when I try to call helm-org-in-buffer-headings. Somehow the backtrace gets
> immediately erased, so here's a screenshot:
> http://i.imgur.com/FoTiwoq.png

>From the above, it looks like `helm-org--get-candidate-in-file' is
erroneously called from a non-Org buffer (here, "*Backtrace*").  Outside
Org, `org-complex-heading-regexp' is nil, hence the result.

Regards,

-- 
Nicolas Goaziou



Re: [O] org export to latex tables, with hlines and |

2016-03-10 Thread Nicolas Goaziou
Hello,

Uwe Brauer  writes:

> When I use
> orgtab radio tables in latex files with orgtbl minor mode enabled
> the following template
>
>
>
>  '(orgtbl-radio-table-templates
>(quote
> ((latex-mode "% BEGIN RECEIVE ORGTBL %n
> % END RECEIVE ORGTBL %n
> \\begin{comment}
> #+ORGTBL: SEND %n orgtbl-to-latex  :lend \" hline\" :environment 
> tabular
> |/|<>|
> | |  |
> \\end{comment}
> ")
>
>
> Does precisely what I want. Now I want the same behavior if I edit a
> table in a org buffer and export it to latex.
>
> Which variable needs to be set and how?

IIUC you want to put a rule after every row in the table? If that's the
case, the straightforward way to do it is to explicitly put the rule in
your table:

  |/|<>|
  | |  |
  |-+--|

Otherwise you can use a filter, e.g.,
`org-export-filter-table-row-functions' and append "\\hine" there in
LaTeX-related back-ends.

Regards,

-- 
Nicolas Goaziou



Re: [O] Org is exporting to tex an asterisk between "section" and "{"

2016-03-10 Thread Nicolas Goaziou
Hello,

Eduardo Mercovich  writes:

> Being a total newbie I can't say that the resulting syntax is incorrect
> (is it?), but at least in the case of latex, *not expressing this
> specific option creates a non-functional latex file*. 
>
> Shouldn't the exporter take care of this? Or at least, never export the
> asterisk between the "section" and the brace (just in case, "{" since
> I'm not an English native speaker).

By default, no asterisk is inserted (see
`org-export-with-section-numbers'). Something in your config is doing
it.

Regards,

-- 
Nicolas Goaziou



Re: [O] Bug: Smart quotes for LaTeX export broken in tables [8.3.4 (8.3.4-9-gfda14f-elpa @ elpa/org-20160307/)]

2016-03-10 Thread Nicolas Goaziou
Hello,

Philipp Middendorf  writes:

> I noticed that when exporting to LaTeX using smart quotes, the smart
> quotes will be inserted in normal paragraphs but not inside tables. A
> minimal example is as follows:
>
>   #+LANGUAGE: de
>   #+OPTIONS: ':t
>   #+LATEX_HEADER: \usepackage[german]{babel}
>
>   foo "bar"
>
>   | foo | bar   |
>   | bar | foo "qux" bar |
>
> This will be exported as follows (relevant snippet):
>
>   foo "`bar"'
>
>   \begin{center}
>   \begin{tabular}{ll}
>   foo & bar\\
>   bar & foo "qux" bar\\
>   \end{tabular}

Fixed. Thank you.

Regards,

-- 
Nicolas Goaziou



Re: [O] [PATCH] Fix the single quote printed in the message printed by org-table-edit-formulas

2016-03-10 Thread Nicolas Goaziou
Hello,

Kaushal Modi  writes:

> Can someone please review and commit this patch.
>
> It basically prints the "C-c '" binding correctly in the echo area, using
> straight quote instead of curly quote (matters in emacs 25.x). The details
> are in the commit log below.

Thank you for the patch.

> Fix the quote style when in the "C-c '" key-binding that is printed in the
> echo via the substitute-command-keys function. In emacs 25.x, a straight
> quote is rendered as a right-curly quote by default.

Shouldn't this be handled by `substitute-command-keys' already? The fix
looks like a hack.

> -  (message
> +  (message "%s"
>  (substitute-command-keys "\\\
>  Edit formulas, finish with `\\[org-ctrl-c-ctrl-c]' or
> `\\[org-edit-special]'.  \
>  See menu for more commands.")

Shouldn't ` and ' also be dropped around \\[command]?

Regards,

-- 
Nicolas Goaziou



[O] Bug: can not evaluate any code blocks after enabling additional languages [8.3.4 (release_8.3.4-639-gd5a603 @ /Users/rainerkrug/.emacs.d/elpa/25.0/org-20151005/)]

2016-03-10 Thread Rainer M Krug

* Configuration
Org-mode version 8.3.4 (release_8.3.4-639-gd5a603 @ 
/Users/rainerkrug/.emacs.d/elpa/25.0/org-20151005/)
GNU Emacs 25.0.92.1 (x86_64-apple-darwin15.3.0, NS appkit-1404.34 Version 
10.11.3 (Build 15D21)) of 2016-03-07

init.el:

,
| (setq package-user-dir (concat "~/.emacs.d/elpa/"
|;; if we use emacs-version we get a
|;; LOT of pre-release directories.
|(int-to-string emacs-major-version)
|"."
|(int-to-string emacs-minor-version)))
| (add-to-list 'Info-default-directory-list "~/.emacs.d/ess/doc")
| (add-to-list 'Info-default-directory-list "~/.emacs.d/org-mode/doc")
| (defadvice desktop-restore-file-buffer
| (around my-desktop-restore-file-buffer-advice)
|   "Be non-interactive while starting a daemon."
|   (if (and (daemonp)
|(not server-process))
|   (let ((noninteractive t))
| ad-do-it)
| ad-do-it))
| (ad-activate 'desktop-restore-file-buffer)
| 
| 
| (add-to-list 'load-path "~/.emacs.d/org-mode/lisp")
| (add-to-list 'load-path "~/.emacs.d/org-mode/contrib/lisp")
| (require 'org)
| 
| (setq package-archives '(
|  ("ELPA" . "http://tromey.com/elpa/;)
|  ("Melpa" . "http://melpa.org/packages/;)
|  ("org" . "http://orgmode.org/elpa/;)
|  ("gnu" . "http://elpa.gnu.org/packages/;)))
| 
| (require 'package)
| (package-initialize)
| 
| (unless (package-installed-p 'use-package)
|   (package-refresh-contents)
|   (package-install 'use-package))
| (setq use-package-verbose t)
| (require 'use-package)
| (setq use-package-verbose t)
`

* The problem
This works:

#+begin_src emacs-lisp 
(message "4") 
#+end_src

#+RESULTS:
: 4

Let's enable some more languages:

#+begin_src emacs-lisp 
(org-babel-do-load-languages
  'org-babel-load-languages
  '((emacs-lisp . nil)
(R . t)
(sh . t)))
#+end_src

#+RESULTS:

And try again:

#+begin_src emacs-lisp 
(message "4") 
#+end_src

Debugger message:

Debugger entered--Lisp error: (void-function org-babel-get-header)
  org-babel-get-header(((:colname-names) (:rowname-names) (:result-params 
"replace" "replace") (:result-type . value) (:comments . "") (:shebang . "") 
(:cache . "no") (:padline . "") (:noweb . "no") (:tangle . "no") (:exports . 
"code") (:results . "replace") (:session . "none") (:hlines . "no")) :var)
  org-babel-variable-assignments:sh(((:colname-names) (:rowname-names) 
(:result-params "replace" "replace") (:result-type . value) (:comments . "") 
(:shebang . "") (:cache . "no") (:padline . "") (:noweb . "no") (:tangle . 
"no") (:exports . "code") (:results . "replace") (:session . "none") (:hlines . 
"no")))
  org-babel-execute:sh("echo 4" ((:colname-names) (:rowname-names) 
(:result-params "replace" "replace") (:result-type . value) (:comments . "") 
(:shebang . "") (:cache . "no") (:padline . "") (:noweb . "no") (:tangle . 
"no") (:exports . "code") (:results . "replace") (:session . "none") (:hlines . 
"no")))
  funcall(org-babel-execute:sh "echo 4" ((:colname-names) (:rowname-names) 
(:result-params "replace" "replace") (:result-type . value) (:comments . "") 
(:shebang . "") (:cache . "no") (:padline . "") (:noweb . "no") (:tangle . 
"no") (:exports . "code") (:results . "replace") (:session . "none") (:hlines . 
"no")))
  (let ((result (funcall cmd body params))) (if (and (eq (cdr (assoc 
:result-type params)) (quote value)) (or (member "vector" result-params) 
(member "table" result-params)) (not (listp result))) (list (list result)) 
result))
  (setq result (let ((result (funcall cmd body params))) (if (and (eq (cdr 
(assoc :result-type params)) (quote value)) (or (member "vector" result-params) 
(member "table" result-params)) (not (listp result))) (list (list result)) 
result)))
  (if (member "none" result-params) (progn (funcall cmd body params) (message 
"result silenced") (setq result nil)) (setq result (let ((result (funcall cmd 
body params))) (if (and (eq (cdr (assoc :result-type params)) (quote value)) 
(or (member "vector" result-params) (member "table" result-params)) (not (listp 
result))) (list (list result)) result))) (if (cdr (assoc :file params)) (progn 
(if result (progn (let ((temp-file ...) (temp-buffer ...)) (unwind-protect 
(prog1 ... ...) (and ... ...) (setq result (cdr (assoc :file params) 
(if (cdr (assoc :post params)) (progn (let ((*this* (if (cdr ...) 
(org-babel-result-to-file ... ...) result))) (setq result 
(org-babel-ref-resolve (cdr (assoc :post params (if (cdr (assoc :file 
params)) (progn (setq result-params (remove "file" result-params))) 
(org-babel-insert-result result result-params info new-hash lang))
  (let* ((lang (nth 0 info)) (result-params (cdr (assoc :result-params 
params))) (body (let* ((c (nthcdr 1 info))) (setcar c (if (org-babel-noweb-p 
params :eval) 

Re: [O] Bug: Bulk reschedule with reschedule logging on fails [8.3.4 (8.3.4-5-gdc68d2-elpaplus @ /home/tyria/.emacs.d/elpa/org-plus-contrib-20160229/)]

2016-03-10 Thread Nicolas Goaziou
Hello,

Allen Li  writes:

> When bulk rescheduling TODO items with org-log-reschedule set to 'note,
> only the first marked item will get rescheduled.  I have reproduced this
> on a fresh clone of the Git repo with a minimal config.
>
> Here is the *Messages* snippet:
>
>   Org-mode version 8.3.4 (release_8.3.4-635-g268486 @ 
> //org-mode/lisp/)
>   Press key for agenda command (unrestricted):
>   1 entries marked for bulk action
>   2 entries marked for bulk action
>   Bulk: [$]arch [A]rch->sib [t]odo [+/-]tag [s]chd [d]eadline [r]efile 
> [S]catter [f]unction
>   Scheduled to <2016-03-09 Wed> [2 times]
>   Skipping removed entry at # test.org>
>   Acted on 1 entries, skipped 1 (disappeared before their turn)
>   Note store
>
> Here is the config:
>
>   (add-to-list 'load-path (expand-file-name "~//org-mode/lisp"))
>   (add-to-list 'auto-mode-alist '("\\.\\(org\\  |org_archive\\|txt\\)$" . 
> org-mode))
>   (setq org-agenda-files '("/tmp/test.org"))
>   (require 'org-install)
>   (require 'org-habit)
>
>   (global-set-key "\C-cl" 'org-store-link)
>   (global-set-key "\C-ca" 'org-agenda)
>   (global-set-key "\C-cb" 'org-iswitchb)
>
>   (setq org-log-reschedule 'note)

I cannot reproduce it with the following "test.org":

 * TODO A
 * TODO B

Could you also provide the "test.org" you are using? Thank you.


Regards,

-- 
Nicolas Goaziou



Re: [O] org-babel C math.h issue

2016-03-10 Thread Nicolas Goaziou
Hello,

Oz Ben-Ami  writes:

> A minimal working example, attached, includes the following snippet:
>
> #+BEGIN_SRC C :includes '( ) :flags -lm
> int i=9;
> printf("%d\n",(int)sqrt(i));
> #+END_SRC

FWIW, I get

  #+BEGIN_SRC C :includes '( ) :flags -lm
  int i=9;
  printf("%d\n",(int)sqrt(i));
  #+END_SRC

  #+RESULTS:
  : 3

without any error.


Regards,

-- 
Nicolas Goaziou



Re: [O] Org is exporting to tex an asterisk between "section" and "{"

2016-03-10 Thread Eric S Fraga
On Tuesday,  8 Mar 2016 at 09:30, Eduardo Mercovich wrote:

[...]

> Being a total newbie I can't say that the resulting syntax is incorrect
> (is it?), but at least in the case of latex, *not expressing this
> specific option creates a non-functional latex file*. 
>
> Shouldn't the exporter take care of this? Or at least, never export the
> asterisk between the "section" and the brace (just in case, "{" since
> I'm not an English native speaker).

The * between section and the brace indicates an unnumbered section
heading and is perfectly valid LaTeX syntax for the article class.  I am
not sure why you think the syntax is incorrect.

num:t tells org to export numbered headlines so the * won't be there in
that case.

-- 
: Eric S Fraga (0xFFFCF67D), Emacs 25.0.90.1, Org release_8.3.3-535-g7213aa



Re: [O] Best way to create blog for company web site with Orgmode

2016-03-10 Thread Eric S Fraga
On Thursday, 10 Mar 2016 at 08:37, Alan Schmitt wrote:

[...]

> Note that I suck at design and CSS, but I think this is orthogonal to
> the matter at hand ;)

Orthogonal but key: I use org to generate a static web site which
includes a quasi-blog.  The org side is all about content and meaning
and I let the CSS be responsible for the look and feel of the actual
site.

-- 
: Eric S Fraga (0xFFFCF67D), Emacs 25.0.90.1, Org release_8.3.3-535-g7213aa



Re: [O] Org-crypt encrypting PROPERTIES?

2016-03-10 Thread Eric S Fraga
On Wednesday,  9 Mar 2016 at 09:35, Bingo wrote:
>I can confirm this (tried in org 8.3.0 many months ago). For me,
> org-mobile-push and pull were adding properties every time. I'd love a
> resolution too.

I gave up on this and pulled all encrypted entries out of my normal
agenda/notes files and put them in a separate file which doesn't get
exported.  I couldn't read them on my mobile devices in any case :-Q.
-- 
: Eric S Fraga (0xFFFCF67D), Emacs 25.0.90.1, Org release_8.3.3-535-g7213aa



Re: [O] Bug: Exception when trying to export inlined-code [8.3.4 (8.3.4-9-gfda14f-elpa @ ~/.emacs.d/elpa/org-20160307/)]

2016-03-10 Thread Nicolas Goaziou
Hello,

Shlomi Vaknin  writes:

> I managed to make another non-working example (should I make
> a gif showing what I see?):
>
> ---
>  - src_elisp{3} {{{results(=3=)}}}
>
> * B
>   - src_elisp{3} {{{results(=3=)}}}
>   -
>   -
>   -
>   - src_elisp{3} {{{results(=3=)}}}
>   - src_elisp{2} {{{results(=2=)}}}
>   - {{{results(=2=)}}}
> ---
>
> again, removing any line from this makes export work again. Otherwise I get
> =org-element--current-element: Wrong type argument: integer-or-marker-p,
> nil=

I cannot reproduce the problem. Could you send a complete backtrace with
un-compiled Org?

Also, could you try setting `org-element-use-cache' to nil?

Regards,

-- 
Nicolas Goaziou



Re: [O] C-c ! org-time-stamp-inactive ?

2016-03-10 Thread Nicolas Goaziou
Hello,

K  writes:

> Kyle Meyer  kyleam.com> writes:
>
>> 
>> Hello,
>> 
>> Luke Crook  balooga.com> writes:
>> 
>> > For me, C-c ! has suddenly become unbound and no longer inserts 
>> > an inactive timestamp.  Has this changed in the base org-mode, or 
>> > most likely is this an issue with my setup?
>> 
>> The default binding hasn't been changed in Org.
>> 
>
> I've run into the same problem, with both Org 8.3.4 and MELPA version
> 20160307, the usual C-c ! doesn't work anymore for inserting inactive
> timestamp.  If there's been no change to the default binding, any
> suggestions on how to debug this please?  Thanks!

What's the output of C-h c C-c ! in an Org buffer?

Could you try with a minimal init file, just loading Org 8.3.4?

Regards,

-- 
Nicolas Goaziou



Re: [O] Bug: can not evaluate any code blocks after enabling additional languages [8.3.4 (release_8.3.4-639-gd5a603 @ /Users/rainerkrug/.emacs.d/elpa/25.0/org-20151005/)]

2016-03-10 Thread Rainer M Krug
Sorry for tp:

Additional info:

Works under Org-mode version 8.3.4 (8.3.4-dist @ 
/Users/rainerkrug/.emacs.d/elpa/25.0/org-20151005/)

Rainer M Krug  writes:

> * Configuration
> Org-mode version 8.3.4 (release_8.3.4-639-gd5a603 @ 
> /Users/rainerkrug/.emacs.d/elpa/25.0/org-20151005/)
> GNU Emacs 25.0.92.1 (x86_64-apple-darwin15.3.0, NS appkit-1404.34 Version 
> 10.11.3 (Build 15D21)) of 2016-03-07
>
> init.el:
>
> ,
> | (setq package-user-dir (concat "~/.emacs.d/elpa/"
> |;; if we use emacs-version we get a
> |;; LOT of pre-release directories.
> |(int-to-string emacs-major-version)
> |"."
> |(int-to-string emacs-minor-version)))
> | (add-to-list 'Info-default-directory-list "~/.emacs.d/ess/doc")
> | (add-to-list 'Info-default-directory-list "~/.emacs.d/org-mode/doc")
> | (defadvice desktop-restore-file-buffer
> | (around my-desktop-restore-file-buffer-advice)
> |   "Be non-interactive while starting a daemon."
> |   (if (and (daemonp)
> |(not server-process))
> |   (let ((noninteractive t))
> | ad-do-it)
> | ad-do-it))
> | (ad-activate 'desktop-restore-file-buffer)
> | 
> | 
> | (add-to-list 'load-path "~/.emacs.d/org-mode/lisp")
> | (add-to-list 'load-path "~/.emacs.d/org-mode/contrib/lisp")
> | (require 'org)
> | 
> | (setq package-archives '(
> |  ("ELPA" . "http://tromey.com/elpa/;)
> |  ("Melpa" . "http://melpa.org/packages/;)
> |  ("org" . "http://orgmode.org/elpa/;)
> |  ("gnu" . "http://elpa.gnu.org/packages/;)))
> | 
> | (require 'package)
> | (package-initialize)
> | 
> | (unless (package-installed-p 'use-package)
> |   (package-refresh-contents)
> |   (package-install 'use-package))
> | (setq use-package-verbose t)
> | (require 'use-package)
> | (setq use-package-verbose t)
> `
>
> * The problem
> This works:
>
> #+begin_src emacs-lisp 
> (message "4") 
> #+end_src
>
> #+RESULTS:
> : 4
>
> Let's enable some more languages:
>
> #+begin_src emacs-lisp 
> (org-babel-do-load-languages
>   'org-babel-load-languages
>   '((emacs-lisp . nil)
> (R . t)
> (sh . t)))
> #+end_src
>
> #+RESULTS:
>
> And try again:
>
> #+begin_src emacs-lisp 
> (message "4") 
> #+end_src
>
> Debugger message:
>
> Debugger entered--Lisp error: (void-function org-babel-get-header)
>   org-babel-get-header(((:colname-names) (:rowname-names) (:result-params 
> "replace" "replace") (:result-type . value) (:comments . "") (:shebang . "") 
> (:cache . "no") (:padline . "") (:noweb . "no") (:tangle . "no") (:exports . 
> "code") (:results . "replace") (:session . "none") (:hlines . "no")) :var)
>   org-babel-variable-assignments:sh(((:colname-names) (:rowname-names) 
> (:result-params "replace" "replace") (:result-type . value) (:comments . "") 
> (:shebang . "") (:cache . "no") (:padline . "") (:noweb . "no") (:tangle . 
> "no") (:exports . "code") (:results . "replace") (:session . "none") (:hlines 
> . "no")))
>   org-babel-execute:sh("echo 4" ((:colname-names) (:rowname-names) 
> (:result-params "replace" "replace") (:result-type . value) (:comments . "") 
> (:shebang . "") (:cache . "no") (:padline . "") (:noweb . "no") (:tangle . 
> "no") (:exports . "code") (:results . "replace") (:session . "none") (:hlines 
> . "no")))
>   funcall(org-babel-execute:sh "echo 4" ((:colname-names) (:rowname-names) 
> (:result-params "replace" "replace") (:result-type . value) (:comments . "") 
> (:shebang . "") (:cache . "no") (:padline . "") (:noweb . "no") (:tangle . 
> "no") (:exports . "code") (:results . "replace") (:session . "none") (:hlines 
> . "no")))
>   (let ((result (funcall cmd body params))) (if (and (eq (cdr (assoc 
> :result-type params)) (quote value)) (or (member "vector" result-params) 
> (member "table" result-params)) (not (listp result))) (list (list result)) 
> result))
>   (setq result (let ((result (funcall cmd body params))) (if (and (eq (cdr 
> (assoc :result-type params)) (quote value)) (or (member "vector" 
> result-params) (member "table" result-params)) (not (listp result))) (list 
> (list result)) result)))
>   (if (member "none" result-params) (progn (funcall cmd body params) (message 
> "result silenced") (setq result nil)) (setq result (let ((result (funcall cmd 
> body params))) (if (and (eq (cdr (assoc :result-type params)) (quote value)) 
> (or (member "vector" result-params) (member "table" result-params)) (not 
> (listp result))) (list (list result)) result))) (if (cdr (assoc :file 
> params)) (progn (if result (progn (let ((temp-file ...) (temp-buffer ...)) 
> (unwind-protect (prog1 ... ...) (and ... ...) (setq result (cdr (assoc 
> :file params) (if (cdr (assoc :post params)) (progn (let ((*this* (if 
> (cdr ...) (org-babel-result-to-file ... ...) result))) 

Re: [O] org export to latex tables, with hlines and |

2016-03-10 Thread Uwe Brauer

> Hello,
> Uwe Brauer  writes:


> IIUC you want to put a rule after every row in the table? If that's the
> case, the straightforward way to do it is to explicitly put the rule in
> your table:

>   |/|<>|
>   | |  |
>   |-+--|

Thanks, right, but then I have to insert a hline for every line.

> Otherwise you can use a filter, e.g.,
> `org-export-filter-table-row-functions' and append "\\hine" there in
> LaTeX-related back-ends.

That is more what I am looking for. But

org-export-filter-table-row-functions is nil.

So what do I have to set it to?

BTW I just realized that I wanted a similar functionality for the HTML
export, and in org version 7.8, this was controlled by


 '(org-export-html-table-tag
   "")


But this variable does not exist any more so the same question arises
how can I obtain that behavior for html export?

Thanks

Uwe Brauer 




Re: [O] Bug: can not evaluate any code blocks after enabling additional languages [8.3.4 (release_8.3.4-639-gd5a603 @ /Users/rainerkrug/.emacs.d/elpa/25.0/org-20151005/)]

2016-03-10 Thread Nicolas Goaziou
Hello,

Rainer M Krug  writes:

> Debugger entered--Lisp error: (void-function org-babel-get-header)

This looks like a mixed installation. This function was removed in
development version and code base doesn't use it anymore.

It was still called in a few Babel libraries within contrib/, but I just
fixed them.


Regards,

-- 
Nicolas Goaziou



Re: [O] Bug: can not evaluate any code blocks after enabling additional languages [8.3.4 (release_8.3.4-639-gd5a603 @ /Users/rainerkrug/.emacs.d/elpa/25.0/org-20151005/)]

2016-03-10 Thread Rainer M Krug
Nicolas Goaziou  writes:

> Hello,
>
> Rainer M Krug  writes:
>
>> Debugger entered--Lisp error: (void-function org-babel-get-header)
>
> This looks like a mixed installation. This function was removed in
> development version and code base doesn't use it anymore.

I don't think so - I use org from git uncompiled and, as you can see int
the init.el, initialize it (require 'org) before calling (package-initialize).

For some unknown reasons, the function
org-babel-execute-src-block(nil) (in the org-git directory) calls
org-babel-execute:sh in the installation directory of emacs.

So wy is this the case? I see that the file ob.sh.el seems to be renamed
in ob-shell.el - is this the case? Do I have to change the language sh
to shell?


>
> It was still called in a few Babel libraries within contrib/, but I just
> fixed them.
>
>
> Regards,

-- 
Rainer M. Krug
email: Rainerkrugsde
PGP: 0x0F52F982


signature.asc
Description: PGP signature


Re: [O] org-babel C math.h issue

2016-03-10 Thread Anssi Saari
Oz Ben-Ami  writes:

> A minimal working example, attached, includes the following snippet:
>
> #+BEGIN_SRC C :includes '( ) :flags -lm
> int i=9;
> printf("%d\n",(int)sqrt(i));
> #+END_SRC

I get the same problem, Ubuntu 14.04.3 LTS, GNU Emacs 24.3.1, Org-mode
version 8.2.10. So maybe it got fixed at some point since these versions
are about two years old?




Re: [O] [PATCH] Fix the single quote printed in the message printed by org-table-edit-formulas

2016-03-10 Thread Kaushal Modi
Here's the updated patch (MINUS the help-echo fix):

>From 238ccdfc8bbdeb53196392a4dff96478a19cb5a5 Mon Sep 17 00:00:00 2001
From: Kaushal Modi 
Date: Wed, 9 Mar 2016 01:18:58 -0500
Subject: [PATCH] Fix the single quote printed in the message
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Display quotes in key-bindings as straight quotes

* lisp/org-agenda.el (org-agenda-show-the-flagging-note):
* lisp/org-footnote.el (org-footnote-goto-definition):
* lisp/org-table.el (org-table-edit-formulas): Straight quote fix

* lisp/org-protocol.el (org-protocol-create-for-org):
* lisp/org-table.el (org-table-sum): Minor reformatting

Fix the quote style displayed when key-bindings are shown in
the echo via (message .. (substitute-command-keys ..)).

Starting from emacs 25.1, a straight quote is rendered as a right-curly
quote by default.

So below will render that single quote as curly.

(message "C-c '")

The fix is to print that quote verbatim using the "%s" modifier:

(message "%s" "C-c '")

Below is how this commit changes the message echoed in the
org-table-edit-formulas function.

Earlier:

  Edit formulas, finish with ‘C-c C-c’ or ‘C-c ’’.  See menu for more
commands.

After fix:

  Edit formulas, finish with ‘C-c C-c’ or ‘C-c '’.  See menu for more
commands.

Note the difference in the single quote style in "C-c '".
---
 lisp/org-agenda.el   |  5 +++--
 lisp/org-footnote.el |  7 +++
 lisp/org-protocol.el |  2 +-
 lisp/org-table.el| 11 +--
 4 files changed, 12 insertions(+), 13 deletions(-)

diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el
index 876ea44..cd69c74 100644
--- a/lisp/org-agenda.el
+++ b/lisp/org-agenda.el
@@ -10107,8 +10107,9 @@ tag and (if present) the flagging note."
  (replace-match "\n" t t))
   (goto-char (point-min))
   (select-window win)
-  (message (substitute-command-keys "Flagging note pushed to kill
ring.  \
-Press \\[org-agenda-show-the-flagging-note] again to remove tag and
note")
+  (message "%s" (substitute-command-keys "Flagging note pushed to \
+kill ring.  Press \\[org-agenda-show-the-flagging-note] again to remove \
+tag and note")

 (defun org-agenda-remove-flag (marker)
   "Remove the FLAGGED tag and any flagging note in the entry."
diff --git a/lisp/org-footnote.el b/lisp/org-footnote.el
index e80685a..a847326 100644
--- a/lisp/org-footnote.el
+++ b/lisp/org-footnote.el
@@ -531,10 +531,9 @@ value if point was successfully moved."
 (goto-char (match-end 0))
 (org-show-context 'link-search)
 (when (derived-mode-p 'org-mode)
-  (message
-   (substitute-command-keys
- "Edit definition and go back with `\\[org-mark-ring-goto]' or, if \
-unique, with `\\[org-ctrl-c-ctrl-c]'.")))
+  (message "%s" (substitute-command-keys
+ "Edit definition and go back with \
+`\\[org-mark-ring-goto]' or, if unique, with `\\[org-ctrl-c-ctrl-c]'.")))
 t))

 (defun org-footnote-goto-previous-reference (label)
diff --git a/lisp/org-protocol.el b/lisp/org-protocol.el
index a249c9e..6510733 100644
--- a/lisp/org-protocol.el
+++ b/lisp/org-protocol.el
@@ -669,7 +669,7 @@ delegates most of the work to `org-protocol-create'."
   (require 'org-publish)
   (let ((all (or (org-publish-get-project-from-filename
buffer-file-name
 (if all (org-protocol-create (cdr all))
-  (message "Not in an org-project.  Did mean %s?"
+  (message "Not in an org-project.  Did you mean `%s'?"
(substitute-command-keys"\\[org-protocol-create]")

 (defun org-protocol-create ( project-plist)
diff --git a/lisp/org-table.el b/lisp/org-table.el
index 488c912..0b7d413 100644
--- a/lisp/org-table.el
+++ b/lisp/org-table.el
@@ -2136,11 +2136,10 @@ If NLAST is a number, only the NLAST fields will
actually be summed."
s diff)
  (format "%.0f:%02.0f:%02.0f" h m s
  (kill-new sres)
- (if (org-called-interactively-p 'interactive)
-(message "%s"
- (substitute-command-keys
-  (format "Sum of %d items: %-20s (\\[yank] will insert result
into buffer)"
-  (length numbers) sres
+ (when (org-called-interactively-p 'interactive)
+(message "%s" (substitute-command-keys
+   (format "Sum of %d items: %-20s \
+(\\[yank] will insert result into buffer)" (length numbers) sres
  sres

 (defun org-table-get-number-for-summing (s)
@@ -3591,7 +3590,7 @@ Parameters get priority."
   (when (eq org-table-use-standard-references t)
  (org-table-fedit-toggle-ref-type))
   (org-goto-line startline)
-  (message
+  (message "%s"
(substitute-command-keys "\\\
 Edit formulas, finish with `\\[org-ctrl-c-ctrl-c]' or
`\\[org-edit-special]'.  \
 See menu for more commands.")
-- 
2.6.0.rc0.24.gec371ff


Re: [O] [PATCH] Fix the single quote printed in the message printed by org-table-edit-formulas

2016-03-10 Thread Kaushal Modi
I am unable to figure out how to escape the ` and ' in the help-echo text
property.

I tried the below:

diff --git a/lisp/org-table.el b/lisp/org-table.el
index 0a25772..749baca 100644
--- a/lisp/org-table.el
+++ b/lisp/org-table.el
@@ -794,10 +794,10 @@ When nil, simply write \"#ERROR\" in corrupted
fields.")
  (when (> (org-string-width x) fmax)
(org-add-props x nil
  'help-echo
- (concat
+ (format "%s\n%s"
   (substitute-command-keys
"Clipped table field, use \\[org-table-edit-field]
to \
-edit.  Full value is:\n")
+edit.  Full value is:")
   (substring-no-properties x)))
(let ((l (length x))
  (f1 (min fmax


But that did not help.

Here is a test snippet to show the problem:

(let* ((str1 "\nHi1")
   (str2 "\nHi2")
   (echo-str1 "`without format'")
   (echo-str2 (format "%s" "`with format'"))
   ov)
  (let* ((b (+ 1 (point)))
 (e (+ b (string-width str1
(insert str1)
(setq ov (make-overlay b e)))
  (overlay-put ov 'help-echo echo-str1)
  (let* ((b (+ 1 (point)))
 (e (+ b (string-width str2
(insert str2)
(setq ov (make-overlay b e)))
  (overlay-put ov 'help-echo echo-str2))

How can I make the help-echo property display the ` and ' verbatim, without
curving them?


Re: [O] org-babel C math.h issue

2016-03-10 Thread Nick Dokos
Oz Ben-Ami  writes:

> Hi,
>
> I'm a new org user, and I'm sorry if I'm missing something obvious. When 
> executing a C code snippet with
> org-babel, that contains a math function, I get the famous "undefined 
> reference" errors. I tried adding
> ":flags -lm", but that doesn't help. Looking at the code, it seems the -lm 
> flag is inserted in the wrong
> place, before the source file. An easy change would be in line 147 of ob-C.el 
> version 8.3.4-634, moving
> "flags" to after the source file. This seems to work, but I don't know if it 
> would break anything else.
>
> A minimal working example, attached, includes the following snippet:
>
> #+BEGIN_SRC C :includes '( ) :flags -lm
> int i=9;
> printf("%d\n",(int)sqrt(i));
> #+END_SRC
>
> Note the issue disappears if constants are directly used rather than 
> variables, presumably because the
> function call is optimized away entirely.
>
> Any thoughts are appreciated.
>

I can't reproduce it either (with fairly recent emacs and bleeding-edge
org-mode, but the code in question has not changed since 8.2.7 or so).

The command that is executed looks like this:

  gcc -o /tmp/babel-212464kj/C-bin-21246R6L -lm 
/tmp/babel-212464kj/C-src-21246EwF.c

and that should work fine for gcc: you don't need to have the -lm after the
source file.

You can test that that's the case: put your program into a file, say foo.c, and
execute

  gcc -o foo.out -lm foo.c

Does that give you undefined references?

--
Nick






Re: [O] org export to latex tables, with hlines and |

2016-03-10 Thread Nicolas Goaziou
Hello,

Uwe Brauer  writes:

>> Hello,
>> Uwe Brauer  writes:
>
>
>> IIUC you want to put a rule after every row in the table? If that's the
>> case, the straightforward way to do it is to explicitly put the rule in
>> your table:
>
>>   |/|<>|
>>   | |  |
>>   |-+--|
>
>> Otherwise you can use a filter, e.g.,
>> `org-export-filter-table-row-functions' and append "\\hine" there in
>> LaTeX-related back-ends.
>
> I got this to work:
>
>
> (defun my-latex-insert-hline-always (row backend info)
>"Add a hline to every row when exporting to  LaTeX."
>(when (org-export-derived-backend-p backend 'latex)
>(replace-regexp-in-string "" " hline" row)))
>
> (add-to-list 'org-export-filter-table-row-functions 
> 'my-latex-insert-hline-always)
>
>
> Is this what you meant?

Something like that, yes.

Regards, 

-- 
Nicolas Goaziou



Re: [O] Bug: can not evaluate any code blocks after enabling additional languages [8.3.4 (release_8.3.4-639-gd5a603 @ /Users/rainerkrug/.emacs.d/elpa/25.0/org-20151005/)]

2016-03-10 Thread Rainer M Krug
Kyle Meyer  writes:

> Rainer M Krug  writes:
>
>> Nicolas Goaziou  writes:
>>
>>> Hello,
>>>
>>> Rainer M Krug  writes:
>>>
 Debugger entered--Lisp error: (void-function org-babel-get-header)
>>>
>>> This looks like a mixed installation. This function was removed in
>>> development version and code base doesn't use it anymore.
>>
>> I don't think so - I use org from git uncompiled and, as you can see int
>> the init.el, initialize it (require 'org) before calling 
>> (package-initialize).
>>
>> For some unknown reasons, the function
>> org-babel-execute-src-block(nil) (in the org-git directory) calls
>> org-babel-execute:sh in the installation directory of emacs.
>>
>> So wy is this the case? I see that the file ob.sh.el seems to be renamed
>> in ob-shell.el - is this the case? Do I have to change the language sh
>> to shell?
>
> This has been reported on the list a few times.  See
> http://thread.gmane.org/gmane.emacs.orgmode/102877/focus=102882.

OK - thanks. This is solved now. But now I am stuck with the following,
where again, org-element-cache-reset is in the emacs packed org-mode,
while orgmode() is in the git version, and the changed org-set-local()
causes an error. Any suggestions?

,
| Debugger entered--Lisp error: (void-function org-set-local)
|   org-set-local(org-element--cache [cl-struct-avl-tree- [nil nil nil 0] 
org-element--cache-compare])
|   org-element-cache-reset()
|   (let ((delay-mode-hooks t)) (outline-mode) (setq major-mode (quote 
org-mode)) (setq mode-name "Org") (progn (if (get (quote outline-mode) (quote 
mode-class)) (put (quote org-mode) (quote mode-class) (get (quote outline-mode) 
(quote mode-class (if (keymap-parent org-mode-map) nil (set-keymap-parent 
org-mode-map (current-local-map))) (let ((parent (char-table-parent 
org-mode-syntax-table))) (if (and parent (not (eq parent 
(standard-syntax-table nil (set-char-table-parent org-mode-syntax-table 
(syntax-table (if (or (abbrev-table-get org-mode-abbrev-table :parents) (eq 
org-mode-abbrev-table local-abbrev-table)) nil (abbrev-table-put 
org-mode-abbrev-table :parents (list local-abbrev-table (use-local-map 
org-mode-map) (set-syntax-table org-mode-syntax-table) (setq local-abbrev-table 
org-mode-abbrev-table) (if (featurep (quote xemacs)) (if (boundp (quote 
outline-mode-menu-heading)) (progn (easy-menu-remove outline-mode-menu-heading) 
(easy-menu-remove outline-mode-menu-show) (easy-menu-remove 
outline-mode-menu-hide))) (define-key org-mode-map [menu-bar headings] (quote 
undefined)) (define-key org-mode-map [menu-bar hide] (quote undefined)) 
(define-key org-mode-map [menu-bar show] (quote undefined))) 
(org-load-modules-maybe) (if (featurep (quote xemacs)) (progn (easy-menu-add 
org-org-menu) (easy-menu-add org-tbl-menu))) (org-install-agenda-files-menu) 
(if org-descriptive-links (progn (add-to-invisibility-spec (quote 
(org-link) (add-to-invisibility-spec (quote (org-cwidth))) 
(add-to-invisibility-spec (quote (org-hide-block . t))) (if (featurep (quote 
xemacs)) (progn (set (make-local-variable (quote line-move-ignore-invisible)) 
t))) (set (make-local-variable (quote outline-regexp)) org-outline-regexp) (set 
(make-local-variable (quote outline-level)) (quote org-outline-level)) (setq 
bidi-paragraph-direction (quote left-to-right)) (if (and org-ellipsis (fboundp 
(quote set-display-table-slot)) (boundp (quote buffer-display-table)) (fboundp 
(quote make-glyph-code))) (progn (if org-display-table nil (setq 
org-display-table (make-display-table))) (set-display-table-slot 
org-display-table 4 (vconcat (mapcar (function (lambda ... ...)) (if (stringp 
org-ellipsis) org-ellipsis "..." (setq buffer-display-table 
org-display-table))) (org-set-regexps-and-options) (org-set-font-lock-defaults) 
(if (and org-tag-faces (not org-tags-special-faces-re)) (progn 
(org-set-tag-faces (quote org-tag-faces) org-tag-faces))) (set 
(make-local-variable (quote calc-embedded-open-mode)) "# ") 
(modify-syntax-entry 64 "w") (modify-syntax-entry 34 "\"") (modify-syntax-entry 
92 "_") (modify-syntax-entry 126 "_") (set (make-local-variable (quote 
font-lock-unfontify-region-function)) (quote org-unfontify-region)) (set 
(make-local-variable (quote org-table-may-need-update)) t) (org-add-hook (quote 
before-change-functions) (quote org-before-change-function) nil (quote local)) 
(org-add-hook (quote kill-buffer-hook) (quote org-check-running-clock) nil 
(quote local)) (org-macro-initialize-templates) 
(org-update-radio-target-regexp) (set (make-local-variable (quote 
indent-line-function)) (quote org-indent-line)) (set (make-local-variable 
(quote indent-region-function)) (quote org-indent-region)) (org-setup-filling) 
(org-setup-comments-handling) (org-element-cache-reset) (set 
(make-local-variable (quote beginning-of-defun-function)) (quote 
org-backward-element)) (set (make-local-variable (quote end-of-defun-function)) 

Re: [O] C-c ! org-time-stamp-inactive ?

2016-03-10 Thread K
Nicolas Goaziou  nicolasgoaziou.fr> writes:

> 
> Hello,
> 
> K  limist.com> writes:
> 
> > Kyle Meyer  kyleam.com> writes:
> >
> >> 
> >> Hello,
> >> 
> >> Luke Crook  balooga.com> writes:
> >> 
> >> > For me, C-c ! has suddenly become unbound and no longer inserts 
> >> > an inactive timestamp.  Has this changed in the base org-mode, or 
> >> > most likely is this an issue with my setup?
> >> 
> >> The default binding hasn't been changed in Org.
> >> 
> >
> > I've run into the same problem, with both Org 8.3.4 and MELPA version
> > 20160307, the usual C-c ! doesn't work anymore for inserting inactive
> > timestamp.  If there's been no change to the default binding, any
> > suggestions on how to debug this please?  Thanks!
> 
> What's the output of C-h c C-c ! in an Org buffer?
> 
> Could you try with a minimal init file, just loading Org 8.3.4?
> 
> Regards,
> 

Hi Nicolas,

Thanks for the suggestion.  When I type C-h c C-c ! what I see is that it
expects another character to be typed, it doesn't recognize C-c ! as
complete/anything by itself.  If I hit ENTER at that point, it shows, "C-c !
RET (translated from C-c ! ) is undefined"

I tried starting Emacs with the -Q option, and of course C-c ! works as usual.

I tried adding this line at the end of my personal customizations file:
(define-key org-mode-map (kbd "C-c !") 'org-time-stamp-inactive)
...but it has no effect.

What did work: C-h m and then search for !, showed that Flycheck mode uses
that as its command prefix.  Problem mostly solved, :-)

K







Re: [O] org export to latex tables, with hlines and |

2016-03-10 Thread Uwe Brauer

   > Hello,
   > Uwe Brauer  writes:


   > IIUC you want to put a rule after every row in the table? If that's the
   > case, the straightforward way to do it is to explicitly put the rule in
   > your table:

   >   |/|<>|
   >   | |  |
   >   |-+--|

   > Otherwise you can use a filter, e.g.,
   > `org-export-filter-table-row-functions' and append "\\hine" there in
   > LaTeX-related back-ends.


Hm it seems that the following works for html support



| <>   | <>   |
| this | that |
|  |  |
#+ATTR_HTML: border="2" rules="all" frame="border"


But unfortunately this


| \ | <>   | <>   | <> |
|   | this | that ||
|   |  |  ||
#+ATTR_LATEX: :environment tabular :lend " \\hline"


Does not work.

Uwe Brauer 




Re: [O] org-babel C math.h issue

2016-03-10 Thread John Kitchin
I get the right answer on a Mac with org-mode version 8.2.10


Anssi Saari writes:

> Oz Ben-Ami  writes:
>
>> A minimal working example, attached, includes the following snippet:
>>
>> #+BEGIN_SRC C :includes '( ) :flags -lm
>> int i=9;
>> printf("%d\n",(int)sqrt(i));
>> #+END_SRC
>
> I get the same problem, Ubuntu 14.04.3 LTS, GNU Emacs 24.3.1, Org-mode
> version 8.2.10. So maybe it got fixed at some point since these versions
> are about two years old?


--
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



Re: [O] Bug: can not evaluate any code blocks after enabling additional languages [8.3.4 (release_8.3.4-639-gd5a603 @ /Users/rainerkrug/.emacs.d/elpa/25.0/org-20151005/)]

2016-03-10 Thread Kyle Meyer
Rainer M Krug  writes:

> Nicolas Goaziou  writes:
>
>> Hello,
>>
>> Rainer M Krug  writes:
>>
>>> Debugger entered--Lisp error: (void-function org-babel-get-header)
>>
>> This looks like a mixed installation. This function was removed in
>> development version and code base doesn't use it anymore.
>
> I don't think so - I use org from git uncompiled and, as you can see int
> the init.el, initialize it (require 'org) before calling (package-initialize).
>
> For some unknown reasons, the function
> org-babel-execute-src-block(nil) (in the org-git directory) calls
> org-babel-execute:sh in the installation directory of emacs.
>
> So wy is this the case? I see that the file ob.sh.el seems to be renamed
> in ob-shell.el - is this the case? Do I have to change the language sh
> to shell?

This has been reported on the list a few times.  See
http://thread.gmane.org/gmane.emacs.orgmode/102877/focus=102882.

-- 
Kyle



Re: [O] [PATCH] Fix the single quote printed in the message printed by org-table-edit-formulas

2016-03-10 Thread Kyle Meyer
Nicolas Goaziou  writes:

>> Fix the quote style when in the "C-c '" key-binding that is printed in the
>> echo via the substitute-command-keys function. In emacs 25.x, a straight
>> quote is rendered as a right-curly quote by default.
>
> Shouldn't this be handled by `substitute-command-keys' already? The fix
> looks like a hack.

message will still try to apply its quoting changes to the output of
substitute-command-keys.

While it does look like a hack, I think it's the easiest way to fix it
and consistent with how it's been handled on Emacs's side (see, e.g.,
Emacs's 6cd2629 and Org's d77a52a).

--
Kyle



Re: [O] [PATCH] Fix the single quote printed in the message printed by org-table-edit-formulas

2016-03-10 Thread Kaushal Modi
>
> Shouldn't this be handled by `substitute-command-keys' already? The fix
> looks like a hack.


I don't think this has anything to do with substitute-command-keys. That
function simply returns a string.

So the below 2 forms display the exact same thing: "C-c ’" (note the curved
right quote) by default in emacs 25.0.92:

(with-temp-buffer
  (org-mode)
  (message (substitute-command-keys "\\[org-edit-special]")))

(message "C-c '")

So the way to get the straight quotes printed as they are without getting
converted to curved quotes is by using

(message "%s" STRING)

Reference:
https://lists.gnu.org/archive/html/bug-gnu-emacs/2015-10/msg00234.html
@Paul: Please correct me if that's wrong.

Now both of the below forms echo "C-c '" (with straight quote):

(with-temp-buffer
  (org-mode)
  (message "%s" (substitute-command-keys "\\[org-edit-special]")))

(message "%s" "C-c '")


Shouldn't ` and ' also be dropped around \\[command]?


It looks like this convention is used at many other places in org (and many
mores places in emacs elisp source):

org-gnus.el:287:  "Like `\\[gnus]' but doesn't check for new news."
org-id.el:105:  a link to it, using `\\[org-insert-link]' first.
org-footnote.el:536: "Edit definition and go back with
`\\[org-mark-ring-goto]' or, if \
org-footnote.el:537:unique, with `\\[org-ctrl-c-ctrl-c]'.")))
org-footnote.el:903: "\\`\\[fn:\\(.*?\\)\\]" new stored nil nil 1)))
org-lint.el:450:  (and h (org-string-match-p "\\`\\[.*\\]\\'" h)))
org-colview.el:524:  (if (string-match "\\`\\[[ xX-]\\]\\'"
org-src.el:737:   (progn (string-match (if inline "\\`\\[fn:.*?:"
"\\`.*?\\]") c)
ox-beamer.el:210:  ((string-match "\\`\\[<.*>\\]\\'" argument) argument)
ox-beamer.el:213:  ((string-match "\\`\\[\\(.*\\)\\]\\'" argument)
ox-beamer.el:216:  (option (if (string-match "\\`\\[.*\\]\\'" argument)
argument
ox-beamer.el:426:   ((string-match "\\`\\[.*\\]\\'" action )
ox-beamer.el:567: ((string-match "\\`\\[.*\\]\\'" action)
ox-beamer.el:613: (if (string-match "\\`\\[.*\\]\\'" overlay) 'defaction
org-clock.el:104:`\\[org-clock-out]', or until the clock is started in a
different item.
ox-latex.el:2274:(if (not (string-match "\\`\\[\\(.*\\)\\]\\'" opt)) opt
org-table.el:3596:Edit formulas, finish with `\\[org-ctrl-c-ctrl-c]' or
`\\[org-edit-special]'.  \
org-agenda.el:1302:`\\[universal-argument] \\[org-agenda-log-mode]' in
org-agenda.el:1989:\\`\\[org-agenda-filter-by-tag]
RET'.
org-agenda.el:4697:Press `\\[org-agenda-manipulate-query-add]', \
org-agenda.el:4698:`\\[org-agenda-manipulate-query-subtract]' to add/sub
word, \
org-agenda.el:4699:`\\[org-agenda-manipulate-query-add-re]', \
org-agenda.el:4700:`\\[org-agenda-manipulate-query-subtract-re]' to add/sub
regexp, \
org-agenda.el:4701:`\\[universal-argument] \\[org-agenda-redo]' to edit\n"))
org-agenda.el:4897:   "Press `\\[universal-argument] \\[org-agenda-redo]' \
org-agenda.el:7320:So this is just a shortcut for
\\`\\[org-agenda]', available
org.el:868:`\\[org-todo]' and `\\[org-priority]' \
org.el:870:`\\[universal-argument] \\[universal-argument] \\[org-todo]' \
org.el:872:`\\[org-ctrl-c-minus]' to cycle item bullet types,
org.el:1670:When nil, `\\[org-ctrl-c-ctrl-c]' needs to be used \
org.el:1673:`\\[org-toggle-latex-fragment]' to be removed."
org.el:2431:`\\[universal-argument] \\[universal-argument]
\\[universal-argument] \
org.el:2614:with a prefix argument,  i.e. `\\[universal-argument]
\\[org-todo]' \
org.el:2616:`\\[universal-argument] t' in an agenda buffer.
org.el:3093:`\\[org-time-stamp]' or `\\[org-time-stamp-inactive],
org.el:3823:commands `org-search-view' (`\\[org-agenda] s') \

As this was a cosmetic thing, I decided to keep that unchanged. Personally
I also prefer to not have any quotes around the key-bindings. The patch I
submitted merely makes the displayed key-binding less confusing; we have a
straight-quote key on the keyboard, not a curved quote key :)


Re: [O] [PATCH] Fix the single quote printed in the message printed by org-table-edit-formulas

2016-03-10 Thread Paul Eggert

On 03/10/2016 09:47 AM, Kaushal Modi wrote:


How can I make the help-echo property display the ` and ' verbatim, 
without curving them?


Help strings are considered documentation, so you need to escape special 
characters in help-echo property strings the same way you'd escape them 
in doc strings. Something like this:


(let* ((str1 "\nhello")
   (echo-str1 "left single quote (`) right single quote (') grave 
accent (\\=`) apostrophe (\\=') kill-region (\\[kill-region])")

   ov)
  (let* ((b (+ 1 (point)))
 (e (+ b (string-width str1
(insert str1)
(setq ov (make-overlay b e)))
  (overlay-put ov 'help-echo echo-str1))




Re: [O] org-export-babel-evaluate and header arguments

2016-03-10 Thread Anthony Cowley

Charles C. Berry writes:

> On Wed, 9 Mar 2016, Anthony Cowley wrote:
>
>>
>> If I have org-export-babel-evaluate set to nil, source blocks are not 
>> evaluated on export. However, if a source block has a :var header 
>> argument that calls another source block, I am prompted if the callee 
>> should be evaluated.
>>
>> Given that the caller is not to be evaluated, I'm not sure I see a 
>> reason for the :var to be evaluated.
>
> What gives here is that `org-babel-get-src-block-info' needs to develop 
> all the header arguments regardless of evaluation of the code block, so 
> :var gets handled.
>
>> Is there a way I can disable this argument evaluation?
>
> Something like:
>
>   :var a=(and org-export-babel-evaluate (org-sbe "abc"))
>
>
> See C-h f org-sbe RET
>
> HTH,
>
> Chuck

Thanks for the tip, Chuck!

This works out very well with one minor caveat:

Setting org-export-babel-evaluate to nil means that C-c C-c no longer properly 
evaluates a block with such a header. This means that exporting must be enabled 
during development.

Other than that little quibble, I've gotten this to work in both tiny tests and 
with complicated, slow to evaluate documents, so I'm pleased.

A minor note about org-sbe documentation is that header arguments need not be 
in a table, but should simply be passed as a single string as the first 
argument to org-sbe. This is inferable from the documentation, but a bit 
oblique.

Anthony






Re: [O] [PATCH] Fix the single quote printed in the message printed by org-table-edit-formulas

2016-03-10 Thread Kyle Meyer
Kaushal Modi  writes:

> Below is now the latest patch = previous patch + help-echo straight quote
> fix.

Thanks for expanding this to the other cases.  I'm not having any luck
getting this to apply to maint.  Could you send it either as an
attachment or directly with git send-email?

> From a897b6e37708cd836ea9576b43006075af80e062 Mon Sep 17 00:00:00 2001
> From: Kaushal Modi 
> Date: Thu, 10 Mar 2016 22:12:44 -0500
> Subject: [PATCH] Display quotes in key-bindings as straight quotes
>
> * lisp/org-agenda.el (org-agenda-show-the-flagging-note):
> * lisp/org-footnote.el (org-footnote-goto-definition):
> * lisp/org-table.el (org-table-edit-formulas):
> (org-table-align): Straight quote fix
>
> * lisp/org-protocol.el (org-protocol-create-for-org):
> * lisp/org-table.el (org-table-sum): Minor reformatting

Please end your ChangeLog descriptions with a period.  For the first
one, I'd prefer it as a full sentence.

Based on your commits in the Emacs repo, it seems you've signed
copyright papers.  I'll update
http://orgmode.org/worg/org-contribute.html

--
Kyle



Re: [O] [PATCH] Fix the single quote printed in the message printed by org-table-edit-formulas

2016-03-10 Thread Kaushal Modi
On Thu, Mar 10, 2016 at 8:39 PM, Paul Eggert  wrote:

> Help strings are considered documentation, so you need to escape special
> characters in help-echo property strings the same way you'd escape them in
> doc strings. Something like this:
>
> (let* ((str1 "\nhello")
>(echo-str1 "left single quote (`) right single quote (') grave
> accent (\\=`) apostrophe (\\=') kill-region (\\[kill-region])")
>ov)
>   (let* ((b (+ 1 (point)))
>  (e (+ b (string-width str1
> (insert str1)
> (setq ov (make-overlay b e)))
>   (overlay-put ov 'help-echo echo-str1))
>

Thanks Paul. That was very educational. So it turns out that we do not need
substitute-command-keys at all for help-echo text.

Below is now the latest patch = previous patch + help-echo straight quote
fix.

>From a897b6e37708cd836ea9576b43006075af80e062 Mon Sep 17 00:00:00 2001
From: Kaushal Modi 
Date: Thu, 10 Mar 2016 22:12:44 -0500
Subject: [PATCH] Display quotes in key-bindings as straight quotes

* lisp/org-agenda.el (org-agenda-show-the-flagging-note):
* lisp/org-footnote.el (org-footnote-goto-definition):
* lisp/org-table.el (org-table-edit-formulas):
(org-table-align): Straight quote fix

* lisp/org-protocol.el (org-protocol-create-for-org):
* lisp/org-table.el (org-table-sum): Minor reformatting

http://thread.gmane.org/gmane.emacs.orgmode/105594

Fix the quote style displayed when key-bindings are shown in
the echo via (message .. (substitute-command-keys ..)).

Starting from emacs 25.1, a straight quote is rendered as a right-curly
quote by default.

So below will render that single quote as curly.

(message "C-c '")

The fix is to print that quote verbatim using the "%s" modifier:

(message "%s" "C-c '")

Also an help-echo text property value was fixed in org-table-align.
substitute-command-keys should not be used in that. Instead \\[COMMAND]
should be used directly in the string.
---
 lisp/org-agenda.el   |  5 +++--
 lisp/org-footnote.el |  7 +++
 lisp/org-protocol.el |  2 +-
 lisp/org-table.el| 17 +++--
 4 files changed, 14 insertions(+), 17 deletions(-)

diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el
index 876ea44..cd69c74 100644
--- a/lisp/org-agenda.el
+++ b/lisp/org-agenda.el
@@ -10107,8 +10107,9 @@ tag and (if present) the flagging note."
  (replace-match "\n" t t))
   (goto-char (point-min))
   (select-window win)
-  (message (substitute-command-keys "Flagging note pushed to kill
ring.  \
-Press \\[org-agenda-show-the-flagging-note] again to remove tag and
note")
+  (message "%s" (substitute-command-keys "Flagging note pushed to \
+kill ring.  Press \\[org-agenda-show-the-flagging-note] again to remove \
+tag and note")

 (defun org-agenda-remove-flag (marker)
   "Remove the FLAGGED tag and any flagging note in the entry."
diff --git a/lisp/org-footnote.el b/lisp/org-footnote.el
index e80685a..a847326 100644
--- a/lisp/org-footnote.el
+++ b/lisp/org-footnote.el
@@ -531,10 +531,9 @@ value if point was successfully moved."
 (goto-char (match-end 0))
 (org-show-context 'link-search)
 (when (derived-mode-p 'org-mode)
-  (message
-   (substitute-command-keys
- "Edit definition and go back with `\\[org-mark-ring-goto]' or, if \
-unique, with `\\[org-ctrl-c-ctrl-c]'.")))
+  (message "%s" (substitute-command-keys
+ "Edit definition and go back with \
+`\\[org-mark-ring-goto]' or, if unique, with `\\[org-ctrl-c-ctrl-c]'.")))
 t))

 (defun org-footnote-goto-previous-reference (label)
diff --git a/lisp/org-protocol.el b/lisp/org-protocol.el
index a249c9e..6510733 100644
--- a/lisp/org-protocol.el
+++ b/lisp/org-protocol.el
@@ -669,7 +669,7 @@ delegates most of the work to `org-protocol-create'."
   (require 'org-publish)
   (let ((all (or (org-publish-get-project-from-filename
buffer-file-name
 (if all (org-protocol-create (cdr all))
-  (message "Not in an org-project.  Did mean %s?"
+  (message "Not in an org-project.  Did you mean `%s'?"
(substitute-command-keys"\\[org-protocol-create]")

 (defun org-protocol-create ( project-plist)
diff --git a/lisp/org-table.el b/lisp/org-table.el
index 488c912..df81944 100644
--- a/lisp/org-table.el
+++ b/lisp/org-table.el
@@ -795,9 +795,8 @@ When nil, simply write \"#ERROR\" in corrupted fields.")
(org-add-props x nil
  'help-echo
  (concat
-  (substitute-command-keys
-   "Clipped table field, use \\[org-table-edit-field]
to \
-edit.  Full value is:\n")
+ "Clipped table field, use \\[org-table-edit-field] \
+to edit.  Full value is:\n"
   (substring-no-properties x)))
(let ((l (length x))
  (f1 (min fmax
@@ -2136,11 +2135,10 @@ If NLAST is a number, only the NLAST fields will
actually be summed."
s diff)
  (format "%.0f:%02.0f:%02.0f" h m 

Re: [O] org-export-babel-evaluate and header arguments

2016-03-10 Thread Charles C. Berry

On Thu, 10 Mar 2016, Anthony Cowley wrote:



Charles C. Berry writes:


On Wed, 9 Mar 2016, Anthony Cowley wrote:



If I have org-export-babel-evaluate set to nil, source blocks are not
evaluated on export. However, if a source block has a :var header
argument that calls another source block, I am prompted if the callee
should be evaluated.

[snip]



Is there a way I can disable this argument evaluation?


Something like:

:var a=(and org-export-babel-evaluate (org-sbe "abc"))


[snip]



This works out very well with one minor caveat:

Setting org-export-babel-evaluate to nil means that C-c C-c no longer 
properly evaluates a block with such a header. This means that exporting 
must be enabled during development.




Maybe you can get what you want by setting `:eval never-exports' for the 
buffer. See


(info "(org) exports")

(info "(org) Header arguments in Org mode properties")

HTH,

Chuck



Re: [O] Bug: can not evaluate any code blocks after enabling additional languages [8.3.4 (release_8.3.4-639-gd5a603 @ /Users/rainerkrug/.emacs.d/elpa/25.0/org-20151005/)]

2016-03-10 Thread Kyle Meyer
Rainer M Krug  writes:

> OK - thanks. This is solved now. But now I am stuck with the following,
> where again, org-element-cache-reset is in the emacs packed org-mode,
> while orgmode() is in the git version, and the changed org-set-local()
> causes an error. Any suggestions?

As you mention, the org-element-cache-reset being called belongs to a
version older than the current master because org-set-local is no longer
used.  But I'm pretty sure it's not from the Org that comes with Emacs,
because I think 8.2.10 predates org-element-cache-reset.

So maint must somehow be getting loaded, perhaps from stale *.elc files
in the repo or from an ELPA install.

-- 
Kyle



Re: [O] [PATCH] Fix the single quote printed in the message printed by org-table-edit-formulas

2016-03-10 Thread Kaushal Modi
I'll try to provide a working patch tomorrow. Yes, my FSF copyright
assignment is on file.

About the periods after commit descriptions, I will ensure that all
sentences other than the summary line end with a period.

About the patch not merging, I am surprised why that happened because I
first rebased to
http://orgmode.org/cgit.cgi/org-mode.git/commit/?id=e69e18dd71bdf0c9bae9546bf026a1123b9a8c53
and then created the patch. I redo the steps using git send-email tomorrow
and understand the difference.

About the org-contribute page, it is pointing to a different version of
emacs CONTRIBUTE, different from the one on emacs-25 branch (
http://git.savannah.gnu.org/cgit/emacs.git/tree/CONTRIBUTE ). Can you
please review that?

Thanks.

--
Kaushal Modi


Re: [O] [PATCH] Fix the single quote printed in the message printed by org-table-edit-formulas

2016-03-10 Thread Kyle Meyer
Kaushal Modi  writes:

> About the patch not merging, I am surprised why that happened because I
> first rebased to
> http://orgmode.org/cgit.cgi/org-mode.git/commit/?id=e69e18dd71bdf0c9bae9546bf026a1123b9a8c53
> and then created the patch. I redo the steps using git send-email tomorrow
> and understand the difference.

Please make the patch against the maint branch (currently 5a735b0b8)
rather than master.  Also, you don't need to bother configuring git
send-email; an attachment with the output of git format-patch is OK too.

> About the org-contribute page, it is pointing to a different version of
> emacs CONTRIBUTE, different from the one on emacs-25 branch (
> http://git.savannah.gnu.org/cgit/emacs.git/tree/CONTRIBUTE ). Can you
> please review that?

Thanks for pointing that out.  I'll update the link.

-- 
Kyle



Re: [O] Bug: Bulk reschedule with reschedule logging on fails [8.3.4 (8.3.4-5-gdc68d2-elpaplus @ /home/tyria/.emacs.d/elpa/org-plus-contrib-20160229/)]

2016-03-10 Thread Allen Li

The TODO items need to be scheduled first (since it's the REschedule
that is causing it).  Can you try:

* TODO A
SCHEDULED: <2016-01-01 Mon>
* TODO B
SCHEDULED: <2016-01-01 Mon>

Nicolas Goaziou  writes:

> Hello,
>
> Allen Li  writes:
>
>> When bulk rescheduling TODO items with org-log-reschedule set to 'note,
>> only the first marked item will get rescheduled.  I have reproduced this
>> on a fresh clone of the Git repo with a minimal config.
>>
>> Here is the *Messages* snippet:
>>
>>   Org-mode version 8.3.4 (release_8.3.4-635-g268486 @ 
>> //org-mode/lisp/)
>>   Press key for agenda command (unrestricted):
>>   1 entries marked for bulk action
>>   2 entries marked for bulk action
>>   Bulk: [$]arch [A]rch->sib [t]odo [+/-]tag [s]chd [d]eadline [r]efile 
>> [S]catter [f]unction
>>   Scheduled to <2016-03-09 Wed> [2 times]
>>   Skipping removed entry at #> test.org>
>>   Acted on 1 entries, skipped 1 (disappeared before their turn)
>>   Note store
>>
>> Here is the config:
>>
>>   (add-to-list 'load-path (expand-file-name "~//org-mode/lisp"))
>>   (add-to-list 'auto-mode-alist '("\\.\\(org\\  |org_archive\\|txt\\)$" . 
>> org-mode))
>>   (setq org-agenda-files '("/tmp/test.org"))
>>   (require 'org-install)
>>   (require 'org-habit)
>>
>>   (global-set-key "\C-cl" 'org-store-link)
>>   (global-set-key "\C-ca" 'org-agenda)
>>   (global-set-key "\C-cb" 'org-iswitchb)
>>
>>   (setq org-log-reschedule 'note)
>
> I cannot reproduce it with the following "test.org":
>
>  * TODO A
>  * TODO B
>
> Could you also provide the "test.org" you are using? Thank you.
>
>
> Regards,



signature.asc
Description: PGP signature


Re: [O] org-babel C math.h issue

2016-03-10 Thread Anssi Saari
Nick Dokos  writes:

> You can test that that's the case: put your program into a file, say foo.c, 
> and
> execute
>
>   gcc -o foo.out -lm foo.c
>
> Does that give you undefined references?

Does for me. gcc --version says
gcc (Ubuntu 4.8.4-2ubuntu1~14.04) 4.8.4

So is it gcc that has changed then?