Re: [O] API for manipulating #+PROPERTY entries?

2019-03-04 Thread Nicolas Goaziou
Hello,

Nik Clayton  writes:

> Is there an API for manipulating properties that are set in #+PROPERTY
> lines before the first headline of a file (i.e., not in a property
> drawer)?

There is no API for keywords.

> Using org-entry-put when point is before the first headline throws a
> "Before first headline" error (when when the #+PROPERTY line already exists
> and I want to update an existing entry).

`org-entry-put' is for node properties. Those do not necessary have
a keyword equivalent. Reciprocally, some keywords cannot be translated
into node properties.

Regards,

-- 
Nicolas Goaziou



[O] API for manipulating #+PROPERTY entries?

2019-03-04 Thread Nik Clayton
Hoi,

Is there an API for manipulating properties that are set in #+PROPERTY
lines before the first headline of a file (i.e., not in a property drawer)?

I've got some properties that (a) make sense when set for the whole file,
and (b) the file contains multiple first level headings (which isn't going
to change).

Using org-entry-put when point is before the first headline throws a
"Before first headline" error (when when the #+PROPERTY line already exists
and I want to update an existing entry).

N


[O] [Discuss] make :tangle header argument respect :dir could save info typing

2019-03-04 Thread stardiviner


I realized one thing, the combination of ~:mkdir~, ~:dir~, and ~:tangle~ does 
not work
good enough. Can make ~:tangle~ respect ~:dir~ too. WDYT?

Here is an example:

#+begin_src clojure :mkdirp yes :dir "data/code/clj-crawler-demo" :tangle 
"src/clj_crawler_demo/core.clj"
(ns clj-crawler-demo.core
  (:require [clj-http.client :as http])
  (:require [net.cgrand.enlive-html :as html]))

(html/select
 (-> (http/get "https://www.baidu.com;)
 :body
 html/html-snippet)
 [:div])
#+end_src

Why need this? If ~:tangle~ respect ~:dir~, it will don't need the complete 
path to
tangled file. And when the source block has other header argument need dir like
~:file~, this will make ~:tangle~ and other related header arguments shorter.

If ~:tangle~ does not respect ~:dir~, user need to repeat the path:

#+begin_src clojure :mkdirp yes :dir "data/code/clj-crawler-demo" :tangle 
"data/code/clj-crawler-demo/src/clj_crawler_demo/core.clj"
(ns clj-crawler-demo.core
  (:require [clj-http.client :as http])
  (:require [net.cgrand.enlive-html :as html]))

(html/select
 (-> (http/get "https://www.baidu.com;)
 :body
 html/html-snippet)
 [:div])
#+end_src

This is long, I know there is ~#+headers:~ for source block. But reduce info 
would
be better. I also consider the disadvantage of this change. Some user's existing
source block might be broken.

Let's level this change for discussion.

-- 
[ stardiviner ]
   I try to make every word tell the meaning what I want to express.

   Blog: https://stardiviner.github.io/
   IRC(freenode): stardiviner, Matrix: stardiviner
   GPG: F09F650D7D674819892591401B5DF1C95AE89AC3
  



Re: [O] [FEATURE] Make header argument :mkdirp yes work for other header arguments not just :tangle

2019-03-04 Thread stardiviner


Nicolas Goaziou  writes:

> Hello,
>
> stardiviner  writes:
>
>> New patch in attachment.
>
> Thank you.
>
>> From aafdd41f7ae5f6218a2be890f58d45be443de4a9 Mon Sep 17 00:00:00 2001
>> From: stardiviner 
>> Date: Sat, 2 Mar 2019 12:11:47 +0800
>> Subject: [PATCH] ob-core.el: Make :mkdirp work for :dir too
>>
>> * lisp/ob-core.el (org-babel-execute-src-block): make directory if :dir
>>   path does not exist when :mkdirp yes exist.
>>
>> * doc/org-manualo.rg (mkdirp): declare new change in manual.
>>
>> * etc/ORG-NEWS: declare changes in ORG-NEWS.
>
> No need to declare changes in changes file. This could end up in an
> infloop.
>
>> +   (or (and dir
>> +;; Possibly create the parent directories for file.
>> +(let ((fnd (file-name-as-directory 
>> (expand-file-name dir
>> +  (cond
>> +   ((member mkdirp '("yes" "t")) (make-directory 
>> fnd 'parents))
>> +   ((member mkdirp '("no" "nil")) nil)
>> +   (t (make-directory fnd 'parents)
>> default-directory))
>
> I used:
>
>  (or (and dir
>   (not (member mkdirp '("no" "nil" nil)))
>   (progn
> (let ((d (file-name-as-directory
>   (expand-file-name dir
>   (make-directory d 'parents)
>   d)))

I indeed have this thought of code too. But later changed still. I'm not good at
Elisp yet, so hard to figure out which style code is better. I will keep
learning. Thanks for your advice and teaching.

> Do we need to make a case when dir is a remote?

Absolutely, some people use remote dir very often, myself too. I use literate
programming in Org Mode, so TRAMP etc support is very necessary. But I don't
know how to support for remote dir.

>
>> +(ert-deftest test-ob-core/dir-mkdirp ()
>> +  (org-test-with-temp-text
>> +   "#+begin_src sh :mkdirp yes :dir \"data/code\"
>> +pwd
>> +#+end_src"
>> +   (org-babel-execute-src-block))
>> +  (should (file-directory-p "data/code")))
>> +
>
> I meant (should (org-test-with-temp-text "..." ... (file-directory-p 
> "data/code")))

Learned. I will check out to learn a bit of ert testing framework in recently.

>
> I applied your patch with the changes above.
>
> Regards,

Thanks as always.

-- 
[ stardiviner ]
   I try to make every word tell the meaning what I want to express.

   Blog: https://stardiviner.github.io/
   IRC(freenode): stardiviner, Matrix: stardiviner
   GPG: F09F650D7D674819892591401B5DF1C95AE89AC3
  



Re: [O] manual: stale bindings for org-clock-report and org-columns-insert-dblock

2019-03-04 Thread Nikolay Kudryavtsev

I don't use Icicles, but I cannot reproduce it. What are the exact steps
to do so?

Sorry, it's not clear whether you use Icicles. At the moment the recipe is:

1. Install icicles as described here 
. Enable it by 
doing icy-mode.


2. Do org-clock-report.

I'll try to see whether there's some other way this odd behavior shows 
itself, that can be seen without using Icicles. At the moment, do you 
see anything in that commit that made this command, let's say abnormal?



I don't see the need for that. You can, however, bind `C-c C-x C-r' to
`org-clock-report' in your config.
Minor thing, but I still see this as a regression, without a good 
reason, but it's your call...



You seem to have a mixed installation. This function only exists in
development branch, i.e., Org 9.3, not ELPA.

I'll double check and report.


Note you can insert source blocks with 'C-c C-,`

Didn't knew that, thanks.


Drop the "g". The relative commit is "029cf6".

Thanks.

--
Best Regards,
Nikolay Kudryavtsev



Re: [O] Bug: clocktable error in org-agenda [9.2.2 (release_9.2.2-245-g9d7b1e @ /home/dortmann/src/git-org-mode/lisp/)]

2019-03-04 Thread Bernt Hansen
Actually I think it is a bug.  This weird behaviour has been around for
a very long time (years probably).

I have noticed similar behaviour with log mode, and clock check mode as
well.

I can reproduce the issue at with the following recipe:

C-c a a (start org agenda)
j -3 RET (go back 3 days although any number of days probably works)
l (turn on log mode) or R for clock report
. (go to today)
l (wont' turn off log mode anymore)

Workaround:

j -3 RET (go back 3 days again)
l (turn log mode off) or R for clock report
.  (works normally again)

I run into this regularly when I'm checking clock reports in the agenda
for the past week (jump to the past, turn clock reports or logging on)
then move forwards again and you can't turn it off.

HTH.

Regards,
Bernt

Daniel Ortmann  writes:

> This is crazy!  After months of problems, I myself no longer can
> reproduce this issue!  :-/
>
> Comments welcome (Please!) ... but this issue no longer is actually a bug. 
>
> On 3/4/19 3:22 PM, Daniel Ortmann wrote:
>> Remember to cover the basics, that is, what you expected to happen and
>> what in fact did happen.  You don't know how to make a good report?  See
>>
>>  
>> https://urldefense.proofpoint.com/v2/url?u=https-3A__orgmode.org_manual_Feedback.html-23Feedback=DwIGaQ=RoP1YumCXCgaWHvlZYR8PZh8Bv7qIrMUB65eapI_JnE=Dkq-B4wf3U4UeyggH34kSw8HWPy7CqI3u3RwPXz2f5o=4fSQsyYOysB0leNb80s58m3u_JCrMhGMzVXrgGispfw=_u3sTu0de7IKTb2RsyImTOaTAqX4pl-EiuT_gDXAtXA=
>>
>> Your bug report will be posted to the Org mailing list.
>> 
>>
>> Since this problem has been occurring for a few months now, it's got to
>> be something wrong in my configuration.
>>
>> In the org agenda, pressing R activates the clock report but pressing it
>> again does not turn it off.  The same behavior occurs through the menu;
>> clicking the view clock report checkbox turns the checkbox on and the
>> clock report appears in the agenda ... but clicking it again does not
>> turn the clock report off; it stays visible.
>>
>> To log the bug report I started with
>> emacs -Q -l ~/minimal-org.el
>> then ran M-x org-agenda followed by a and then R.
>> The following debug trace immediately occurred.
>>
>> Please clue in the clueless.
>> Thank you!
>>
>> Debugger entered--Lisp error: (wrong-type-argument stringp nil)
>>   file-exists-p(nil)
>>   org-check-agenda-file(nil)
>>   org-agenda-prepare-buffers((nil))
>>   org-dblock-write:clocktable((:name "clocktable" :link t :maxlevel 2
>> :tstart 737122 :tend 737123 :scope agenda :indentation-column 0 :content
>> "\n"))
>>   org-update-dblock()
>>   org-clock-get-clocktable(:link t :maxlevel 2 :tstart 737122 :tend
>> 737123 :scope agenda)
>>   apply(org-clock-get-clocktable (:link t :maxlevel 2 :tstart 737122
>> :tend 737123 :scope agenda))
>>   org-agenda-list(nil 737122 day nil)
>>   (let nil (org-agenda-list 'nil 737122 'day nil))
>>   eval((let nil (org-agenda-list 'nil 737122 'day nil)))
>>   org-let(nil (org-agenda-list 'nil 737122 'day nil))
>>   org-agenda-redo()
>>   org-agenda-clockreport-mode()
>>   funcall-interactively(org-agenda-clockreport-mode)
>>   call-interactively(org-agenda-clockreport-mode nil nil)
>>   command-execute(org-agenda-clockreport-mode)
>>
>>
>> Emacs  : GNU Emacs 27.0.50 (build 3, x86_64-pc-linux-gnu, X toolkit,
>> Xaw3d scroll bars)
>>  of 2019-03-04
>> Package: Org mode version 9.2.2 (release_9.2.2-245-g9d7b1e @
>> /home/dortmann/src/git-org-mode/lisp/)
>>
>> current state:
>> ==
>> (setq
>>  org-src-mode-hook '(org-src-babel-configure-edit-buffer
>>          org-src-mode-configure-edit-buffer)
>>  org-metadown-hook '(org-babel-pop-to-session-maybe)
>>  org-clock-out-hook '(org-clock-remove-empty-clock-drawer)
>>  org-mode-hook '(#[0 "\300\301\302\303\304$\207"
>>            [add-hook change-major-mode-hook org-show-all append local]
>>            5]
>>          #[0 "\300\301\302\303\304$\207"
>>            [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-archive-hook '(org-attach-archive-delete-maybe)
>>  org-confirm-elisp-link-function 'yes-or-no-p
>>  org-agenda-before-write-hook '(org-agenda-add-entry-text)
>>  org-metaup-hook '(org-babel-load-in-session-maybe)
>>  org-bibtex-headline-format-function #[257 "\300\236A\207" [:title] 3
>> "\n\n(fn ENTRY)"]
>>  org-babel-pre-tangle-hook '(save-buffer)
>>  org-tab-first-hook '(org-babel-hide-result-toggle-maybe
>>           org-babel-header-arg-expand)
>>  org-occur-hook '(org-first-headline-recenter)
>>  org-cycle-hook '(org-cycle-hide-archived-subtrees
>> org-cycle-show-empty-lines
>>           org-optimize-window-after-visibility-change)
>>  org-speed-command-hook '(org-speed-command-activate
>>               org-babel-speed-command-activate)
>>  org-dynamic-block-alist '(("columnview" . org-columns-insert-dblock)
>> 

Re: [O] [RFC] Fixing link encoding once and for all

2019-03-04 Thread Nicolas Goaziou
Hello,

Neil Jerram  writes:

> On Fri, 1 Mar 2019 at 08:14, Nicolas Goaziou  wrote:

>> The regexp for bracket links could be, in its simple (!) form:
>>
>>   \[\[\(.*?[^\\]\(?:\\\)*\)\]\(?:\[\([^\000]+?\)\]\)?\]
>
> [then a bit later]
>> Small update, in its string form now:
>>
>>   
>> "\\[\\[\\([^\000]*?[^\\]\\(\\)*\\)\\]\\(?:\\[\\([^\000]+?\\)\\]\\)?\\]"
>
> Is [^\000] the only (or best) way of saying "any character, including
> newlines"?

There is also "\(.\|\n\)", or "[[:ascii:][:nonascii:]]".

> Could there be actual NUL characters in the document?

Good question. I used [^\000] out of habit. You are right, "\(.\|\n\)"
is more robust.

So, the new challenger is:


"\\[\\[\\(\\(?:.\\|\n\\)*?[^\\]\\(\\)*\\)\\]\\(?:\\[\\(\\(?:.\\|\n\\)+?\\)\\]\\)?\\]"

Beautiful.

The commented rx equivalent would be:

(seq "["
 ;; URI part: match group 1.
 "["
 (group
  (*? anything)
  ;; Allow an even number of backslashes before the closing bracket.
  (not (any "\\"))
  (zero-or-more (group "")))
 "]"
 ;; Description (optional): match group 2.
 (opt "[" (group (+? anything)) "]")
 "]")

> \(# begin group 3
> ? # don't understand
> :\[   # literal :[

[...]

> but there's at least a ? that I don't understand, and I'm afraid I'm
> not seeing how it's useful.

\(?: ... \) is a shy group.

> If you think it works, I'm happy to defer to your judgement on that!
> Although I suggested the idea, I don't know Org nearly well enough to
> be sure that I haven't missed problems;

We are solving the problem with a regexp. What bad things could happen? ;)

Regards,

-- 
Nicolas Goaziou



Re: [O] [RFC] Fixing link encoding once and for all

2019-03-04 Thread Neil Jerram
On Fri, 1 Mar 2019 at 08:14, Nicolas Goaziou  wrote:
>
> Hello,
>
> Neil Jerram  writes:
>
> > Do you mean Windows file names in existing Org files?  I.e. the
> > back-compatibility concern?
> >
> > If so, yes, I confess I didn't think at all about back-compatibility,
> > with my suggestion above.  So perhaps that rules my idea out.
> >
> > If we were starting from scratch, however,
> > - I believe it would technically be fine; i.e. it's a complete and
> > unambiguous encoding
> > - it might be considered awkward for Windows users to have to write
> > c:\\system32\\mydoc.txt instead of c:\system32\mydoc.txt, but I don't
> > know how big a concern that would be.
>
> Thinking a bit more about it, we don't need to escape /all/ square
> brackets, only "]]" and "][" constructs. Therefore, we don't need to
> escape every backslash either.

Agreed.

> The regexp for bracket links could be, in its simple (!) form:
>
>   \[\[\(.*?[^\\]\(?:\\\)*\)\]\(?:\[\([^\000]+?\)\]\)?\]

[then a bit later]
> Small update, in its string form now:
>
>   
> "\\[\\[\\([^\000]*?[^\\]\\(\\)*\\)\\]\\(?:\\[\\([^\000]+?\\)\\]\\)?\\]"

Is [^\000] the only (or best) way of saying "any character, including
newlines"?  Could there be actual NUL characters in the document?

More generally I'm not sure I'm fully understanding the regex.  I
_think_ it breaks down like this:

\[\[  # literal [[
\(# begin group 1
[^\000]*? # non-greedy any characters (0 or more)
[^\]  # something not a backslash
\(# begin group 2
  # literal \\
\)*   # end group 2, and allow 0 or more of it
\)# end group 1
\]# literal ]
\(# begin group 3
? # don't understand
:\[   # literal :[
\(# begin group 4
[^\000]+? # non-greedy any characters (1 or more)
\)# end group 4
\]# literal ]
\)?   # end group 3, and allow 0 or 1 or it
\]# literal ]

but there's at least a ? that I don't understand, and I'm afraid I'm
not seeing how it's useful.

> Most links would need no change.  I see one notable exception:
> directories in Windows:
>
>   [[c:\system32\\]] for "c:\system32\"

But I guess it would be unusual to write a trailing backslash like that.

> Some further notes:
>
> 1. Macros already use backslashes to escape commas in arguments, so it
>is at least consistent with this part of Org.
>
> 2. The description part of the link, like most parts of Org, does not
>use backslash escaping. If needed, we can implement an entity for
>a square bracket.
>
> 3. There will be some backward compatibility issues. We can add
>a checker in Org Lint to catch most of those. For example, we could
>look at URI where every percent is followed only by 25, 5B, and 5D.
>
> WDYT?

If you think it works, I'm happy to defer to your judgement on that!
Although I suggested the idea, I don't know Org nearly well enough to
be sure that I haven't missed problems; but I guess that you would
know that.

Best wishes,
  Neil



Re: [O] [FEATURE] Make header argument :mkdirp yes work for other header arguments not just :tangle

2019-03-04 Thread Nicolas Goaziou
Hello,

stardiviner  writes:

> New patch in attachment.

Thank you.

> From aafdd41f7ae5f6218a2be890f58d45be443de4a9 Mon Sep 17 00:00:00 2001
> From: stardiviner 
> Date: Sat, 2 Mar 2019 12:11:47 +0800
> Subject: [PATCH] ob-core.el: Make :mkdirp work for :dir too
>
> * lisp/ob-core.el (org-babel-execute-src-block): make directory if :dir
>   path does not exist when :mkdirp yes exist.
>
> * doc/org-manualo.rg (mkdirp): declare new change in manual.
>
> * etc/ORG-NEWS: declare changes in ORG-NEWS.

No need to declare changes in changes file. This could end up in an
infloop.

> +(or (and dir
> + ;; Possibly create the parent directories for file.
> + (let ((fnd (file-name-as-directory 
> (expand-file-name dir
> +   (cond
> +((member mkdirp '("yes" "t")) (make-directory 
> fnd 'parents))
> +((member mkdirp '("no" "nil")) nil)
> +(t (make-directory fnd 'parents)
>  default-directory))

I used:

   (or (and dir
(not (member mkdirp '("no" "nil" nil)))
(progn
  (let ((d (file-name-as-directory
(expand-file-name dir
(make-directory d 'parents)
d)))

Do we need to make a case when dir is a remote?

> +(ert-deftest test-ob-core/dir-mkdirp ()
> +  (org-test-with-temp-text
> +   "#+begin_src sh :mkdirp yes :dir \"data/code\"
> +pwd
> +#+end_src"
> +   (org-babel-execute-src-block))
> +  (should (file-directory-p "data/code")))
> +

I meant (should (org-test-with-temp-text "..." ... (file-directory-p 
"data/code")))

I applied your patch with the changes above.

Regards,

-- 
Nicolas Goaziou



Re: [O] Bug: clocktable error in org-agenda [9.2.2 (release_9.2.2-245-g9d7b1e @ /home/dortmann/src/git-org-mode/lisp/)]

2019-03-04 Thread Daniel Ortmann
This is crazy!  After months of problems, I myself no longer can
reproduce this issue!  :-/

Comments welcome (Please!) ... but this issue no longer is actually a bug. 

On 3/4/19 3:22 PM, Daniel Ortmann wrote:
> Remember to cover the basics, that is, what you expected to happen and
> what in fact did happen.  You don't know how to make a good report?  See
>
>  
> https://urldefense.proofpoint.com/v2/url?u=https-3A__orgmode.org_manual_Feedback.html-23Feedback=DwIGaQ=RoP1YumCXCgaWHvlZYR8PZh8Bv7qIrMUB65eapI_JnE=Dkq-B4wf3U4UeyggH34kSw8HWPy7CqI3u3RwPXz2f5o=4fSQsyYOysB0leNb80s58m3u_JCrMhGMzVXrgGispfw=_u3sTu0de7IKTb2RsyImTOaTAqX4pl-EiuT_gDXAtXA=
>
> Your bug report will be posted to the Org mailing list.
> 
>
> Since this problem has been occurring for a few months now, it's got to
> be something wrong in my configuration.
>
> In the org agenda, pressing R activates the clock report but pressing it
> again does not turn it off.  The same behavior occurs through the menu;
> clicking the view clock report checkbox turns the checkbox on and the
> clock report appears in the agenda ... but clicking it again does not
> turn the clock report off; it stays visible.
>
> To log the bug report I started with
> emacs -Q -l ~/minimal-org.el
> then ran M-x org-agenda followed by a and then R.
> The following debug trace immediately occurred.
>
> Please clue in the clueless.
> Thank you!
>
> Debugger entered--Lisp error: (wrong-type-argument stringp nil)
>   file-exists-p(nil)
>   org-check-agenda-file(nil)
>   org-agenda-prepare-buffers((nil))
>   org-dblock-write:clocktable((:name "clocktable" :link t :maxlevel 2
> :tstart 737122 :tend 737123 :scope agenda :indentation-column 0 :content
> "\n"))
>   org-update-dblock()
>   org-clock-get-clocktable(:link t :maxlevel 2 :tstart 737122 :tend
> 737123 :scope agenda)
>   apply(org-clock-get-clocktable (:link t :maxlevel 2 :tstart 737122
> :tend 737123 :scope agenda))
>   org-agenda-list(nil 737122 day nil)
>   (let nil (org-agenda-list 'nil 737122 'day nil))
>   eval((let nil (org-agenda-list 'nil 737122 'day nil)))
>   org-let(nil (org-agenda-list 'nil 737122 'day nil))
>   org-agenda-redo()
>   org-agenda-clockreport-mode()
>   funcall-interactively(org-agenda-clockreport-mode)
>   call-interactively(org-agenda-clockreport-mode nil nil)
>   command-execute(org-agenda-clockreport-mode)
>
>
> Emacs  : GNU Emacs 27.0.50 (build 3, x86_64-pc-linux-gnu, X toolkit,
> Xaw3d scroll bars)
>  of 2019-03-04
> Package: Org mode version 9.2.2 (release_9.2.2-245-g9d7b1e @
> /home/dortmann/src/git-org-mode/lisp/)
>
> current state:
> ==
> (setq
>  org-src-mode-hook '(org-src-babel-configure-edit-buffer
>          org-src-mode-configure-edit-buffer)
>  org-metadown-hook '(org-babel-pop-to-session-maybe)
>  org-clock-out-hook '(org-clock-remove-empty-clock-drawer)
>  org-mode-hook '(#[0 "\300\301\302\303\304$\207"
>            [add-hook change-major-mode-hook org-show-all append local]
>            5]
>          #[0 "\300\301\302\303\304$\207"
>            [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-archive-hook '(org-attach-archive-delete-maybe)
>  org-confirm-elisp-link-function 'yes-or-no-p
>  org-agenda-before-write-hook '(org-agenda-add-entry-text)
>  org-metaup-hook '(org-babel-load-in-session-maybe)
>  org-bibtex-headline-format-function #[257 "\300\236A\207" [:title] 3
> "\n\n(fn ENTRY)"]
>  org-babel-pre-tangle-hook '(save-buffer)
>  org-tab-first-hook '(org-babel-hide-result-toggle-maybe
>           org-babel-header-arg-expand)
>  org-occur-hook '(org-first-headline-recenter)
>  org-cycle-hook '(org-cycle-hide-archived-subtrees
> org-cycle-show-empty-lines
>           org-optimize-window-after-visibility-change)
>  org-speed-command-hook '(org-speed-command-activate
>               org-babel-speed-command-activate)
>  org-dynamic-block-alist '(("columnview" . org-columns-insert-dblock)
>                ("clocktable" . org-clock-report))
>  org-confirm-shell-link-function 'yes-or-no-p
>  org-link-parameters '(("id" :follow org-id-open)
>            ("eww" :follow eww :store org-eww-store-link)
>            ("rmail" :follow org-rmail-open :store
>             org-rmail-store-link)
>            ("mhe" :follow org-mhe-open :store org-mhe-store-link)
>            ("irc" :follow org-irc-visit :store org-irc-store-link
>             :export org-irc-export)
>            ("info" :follow org-info-open :export org-info-export
>             :store org-info-store-link)
>            ("gnus" :follow org-gnus-open :store org-gnus-store-link)
>            ("docview" :follow org-docview-open :export
>             org-docview-export :store org-docview-store-link)
>            ("bibtex" :follow org-bibtex-open :store
>             

[O] Bug: clocktable error in org-agenda [9.2.2 (release_9.2.2-245-g9d7b1e @ /home/dortmann/src/git-org-mode/lisp/)]

2019-03-04 Thread Daniel Ortmann

Remember to cover the basics, that is, what you expected to happen and
what in fact did happen.  You don't know how to make a good report?  See

 https://orgmode.org/manual/Feedback.html#Feedback

Your bug report will be posted to the Org mailing list.


Since this problem has been occurring for a few months now, it's got to
be something wrong in my configuration.

In the org agenda, pressing R activates the clock report but pressing it
again does not turn it off.  The same behavior occurs through the menu;
clicking the view clock report checkbox turns the checkbox on and the
clock report appears in the agenda ... but clicking it again does not
turn the clock report off; it stays visible.

To log the bug report I started with
emacs -Q -l ~/minimal-org.el
then ran M-x org-agenda followed by a and then R.
The following debug trace immediately occurred.

Please clue in the clueless.
Thank you!

Debugger entered--Lisp error: (wrong-type-argument stringp nil)
  file-exists-p(nil)
  org-check-agenda-file(nil)
  org-agenda-prepare-buffers((nil))
  org-dblock-write:clocktable((:name "clocktable" :link t :maxlevel 2
:tstart 737122 :tend 737123 :scope agenda :indentation-column 0 :content
"\n"))
  org-update-dblock()
  org-clock-get-clocktable(:link t :maxlevel 2 :tstart 737122 :tend
737123 :scope agenda)
  apply(org-clock-get-clocktable (:link t :maxlevel 2 :tstart 737122
:tend 737123 :scope agenda))
  org-agenda-list(nil 737122 day nil)
  (let nil (org-agenda-list 'nil 737122 'day nil))
  eval((let nil (org-agenda-list 'nil 737122 'day nil)))
  org-let(nil (org-agenda-list 'nil 737122 'day nil))
  org-agenda-redo()
  org-agenda-clockreport-mode()
  funcall-interactively(org-agenda-clockreport-mode)
  call-interactively(org-agenda-clockreport-mode nil nil)
  command-execute(org-agenda-clockreport-mode)


Emacs  : GNU Emacs 27.0.50 (build 3, x86_64-pc-linux-gnu, X toolkit,
Xaw3d scroll bars)
 of 2019-03-04
Package: Org mode version 9.2.2 (release_9.2.2-245-g9d7b1e @
/home/dortmann/src/git-org-mode/lisp/)

current state:
==
(setq
 org-src-mode-hook '(org-src-babel-configure-edit-buffer
         org-src-mode-configure-edit-buffer)
 org-metadown-hook '(org-babel-pop-to-session-maybe)
 org-clock-out-hook '(org-clock-remove-empty-clock-drawer)
 org-mode-hook '(#[0 "\300\301\302\303\304$\207"
           [add-hook change-major-mode-hook org-show-all append local]
           5]
         #[0 "\300\301\302\303\304$\207"
           [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-archive-hook '(org-attach-archive-delete-maybe)
 org-confirm-elisp-link-function 'yes-or-no-p
 org-agenda-before-write-hook '(org-agenda-add-entry-text)
 org-metaup-hook '(org-babel-load-in-session-maybe)
 org-bibtex-headline-format-function #[257 "\300\236A\207" [:title] 3
"\n\n(fn ENTRY)"]
 org-babel-pre-tangle-hook '(save-buffer)
 org-tab-first-hook '(org-babel-hide-result-toggle-maybe
          org-babel-header-arg-expand)
 org-occur-hook '(org-first-headline-recenter)
 org-cycle-hook '(org-cycle-hide-archived-subtrees
org-cycle-show-empty-lines
          org-optimize-window-after-visibility-change)
 org-speed-command-hook '(org-speed-command-activate
              org-babel-speed-command-activate)
 org-dynamic-block-alist '(("columnview" . org-columns-insert-dblock)
               ("clocktable" . org-clock-report))
 org-confirm-shell-link-function 'yes-or-no-p
 org-link-parameters '(("id" :follow org-id-open)
           ("eww" :follow eww :store org-eww-store-link)
           ("rmail" :follow org-rmail-open :store
            org-rmail-store-link)
           ("mhe" :follow org-mhe-open :store org-mhe-store-link)
           ("irc" :follow org-irc-visit :store org-irc-store-link
            :export org-irc-export)
           ("info" :follow org-info-open :export org-info-export
            :store org-info-store-link)
           ("gnus" :follow org-gnus-open :store org-gnus-store-link)
           ("docview" :follow org-docview-open :export
            org-docview-export :store org-docview-store-link)
           ("bibtex" :follow org-bibtex-open :store
            org-bibtex-store-link)
           ("bbdb" :follow org-bbdb-open :export org-bbdb-export
            :complete org-bbdb-complete-link :store
            org-bbdb-store-link)
           ("w3m" :store org-w3m-store-link) ("file+sys")
           ("file+emacs") ("doi" :follow org--open-doi-link)
           ("elisp" :follow org--open-elisp-link)
           ("file" :complete org-file-complete-link)
           ("ftp" :follow
            (lambda (path) (browse-url (concat "ftp:" path
           ("help" :follow org--open-help-link)
           ("http" :follow
            (lambda (path) (browse-url (concat "http:" path
 

Re: [O] ob-core, org-outline-overlay-data error and byte-compile warning

2019-03-04 Thread Tim Cross


I strongly suspect that part of your issue is that you have a 'mixed'
installation - part of 9.1 and part of 9.2 being rolled up together when
everything is compiled.

It is *CRITICAL* that no org functionality is loaded when you install
org from ELPA. For this reason, I only ever update the org package from
the org repo in a fresh Emacs session and ensure that nothing is loading
any org functionality until after all the elpa install stuff has
completed.

Make sure nothing directly or indirectly loads org in your init before
your package.el and elpa section. Remove the existing elpa/org or
org-plus-contrib directory and try again in a fresh emacs session.

Tim

zimoun  writes:

> Dear,
>
> First of all, thank you for this awesome tool !!
>
>
> I am a bit confused and I should have something twisted with my config
> but I am not able to find what. If someone has an explanation...
> Or maybe it is well-known.
>
> Well, I am running Emacs from Guix and the version is:
>GNU Emacs 26.1 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.0)
> of 2018-11-14.
>
> and it comes from Org 9.1:
>Org mode version 9.1.9 (release_9.1.9-65-g5e4542
>@ 
> /gnu/stor/vsiqlxhj7lnydhhi85jc1pg0xzhcfdny-emacs-26.1/share/emacs/26.1/lisp/org/)
>
> Because I prefer a more up-to-date version of Org, say 9.2, I have in
> my init.el:
>
> (add-to-list 'package-archives
>  '("org" . "http://orgmode.org/elpa/;))
> (package-initialize)
> (use-package org
>   :ensure org-plus-contrib)
>
> Then the version 9.2 lives locally:
>Org mode version 9.2.2 (9.2.2-elpaplus
>@ /home/simon/.emacs.d/elpa/org-plus-contrib-20190304/)
>
>
> The issue is when I evaluate `org-babel-execute-buffer', then it fails
> with the error:
>Symbol’s function definition is void: org-outline-overlay-data
>
> Hum? there is an incompatible change documented [1] in the Changes but
> it should not interfere, right?
> Well, if I find-grep in my ~/.emacs.d/ for `org-outline-overlay-data'
> then nothing if found.
> (and neither in the site-lisp/ from "system install")
>
>
> So, I manually remove the byte-compiled file `ob-core.elc', and I
> reload everything and now it works as expected. Hum?!
> Then I again byte-compile the file `ob-core.el' with
>emacs -batch -f batch-byte-compile ob-core.el
> then it warns:
>
> In end of data:
> ob-core.el:3149:1:Warning: the following functions are not known to be
> defined: org-remove-indentation, org-completing-read, org-trim,
> org-outline-overlay-data, org-set-outline-overlay-data, org-in-regexp,
> proper-list-p
>
> and after reloaded everything, it fails with the message "Symbol [...]
> void: org-outline-overlay-data".
>
>
> I think I miss something about the byte-compiling stuff.
> Now, I am using the `ob-core.el' file and not the byte-compiled one,
> but I would like to understand what is wrong; if it is not a bug.
>
>
> Thank you in advance for in pointer and/or insights.
>
>
> All the best,
> simon
>
>
> [1] https://orgmode.org/Changes.html


-- 
Tim Cross



Re: [O] manual: stale bindings for org-clock-report and org-columns-insert-dblock

2019-03-04 Thread Nick Dokos
Nikolay Kudryavtsev  writes:

> ...
> Also can someone explain how do I get from org elpa version to the git
> commit it's based on? E. g., in org-version.el I have
> "9.2.1-33-g029cf6-elpaplus" but g029cf6 does not seem like a real
> commit in the git repo.

Try it without the 'g': that's just a prefix. The commit is 029cf6.

-- 
Nick

"There are only two hard problems in computer science: cache
invalidation, naming things, and off-by-one errors." -Martin Fowler




Re: [O] manual: stale bindings for org-clock-report and org-columns-insert-dblock

2019-03-04 Thread Nicolas Goaziou
Hello,

Nikolay Kudryavtsev  writes:

> The first is that drop in clock reports now use :scope file by
> default, instead of :scope subtree.

Indeed. This is because clocktable default properties include :scope
property. I removed it. Thank you.

> The second is that the clock report function is set up in some weird
> way that it gets broken if you use icicles. Gonna look into it
> further, not sure whether org or icicles is the bad actor here. The
> behavior I'm seeing is as follows:
>
> The command spawns empty table with :scope file, asks for a file, when
> I select that file, it asks for a function and I have no idea which
> function should I choose here.

I don't use Icicles, but I cannot reproduce it. What are the exact steps
to do so?

> The third is the removal of C-c C-x C-r. I've read the discussion
> there, but it seems like nobody really wanted it removed, this is just
> a  consequence of refactoring. So, can we get C-c C-x C-r
> org-clock-report back, if only as a closure over
> org-dynamic-block-insert-dblock?

I don't see the need for that. You can, however, bind `C-c C-x C-r' to
`org-clock-report' in your config.

> Also, ever since that Stardiviner's commit the dynamic reloading of
> org seems to be broken on master. When I try to I get:
>
> Symbol’s function definition is void: org-dynamic-block-define

You seem to have a mixed installation. This function only exists in
development branch, i.e., Org 9.3, not ELPA.

> Another thing, since org is moving towards unifying dynamic blocks,
> maybe the next step is to add begin_src blocks into the mix in
> org-dynamic-block-insert-dblock? It seems that they historically have
> different syntax, but are in practice the same thing. That's actually
> one place where I could use a wizard.

My practice differs. I don't see them as the same thing. Their syntax is
vaguely related, but that's all.

Note you can insert source blocks with 'C-c C-,`

> And why the function is called org-dynamic-block-insert-dblock and not
> org-insert-dblock? Seems redundant to me.

Hysterical raisins, I assume.

> Also can someone explain how do I get from org elpa version to the git
> commit it's based on? E. g., in org-version.el I have
> "9.2.1-33-g029cf6-elpaplus" but g029cf6 does not seem like a real
> commit in the git repo.

Drop the "g". The relative commit is "029cf6".

Regards,

-- 
Nicolas Goaziou



Re: [O] manual: stale bindings for org-clock-report and org-columns-insert-dblock

2019-03-04 Thread Nikolay Kudryavtsev

Thanks for the tip.

After reading that discussion and a few hours of research, there are 
actually three different problems I have with org-clock-report.


The first is that drop in clock reports now use :scope file by default, 
instead of :scope subtree.


The second is that the clock report function is set up in some weird way 
that it gets broken if you use icicles. Gonna look into it further, not 
sure whether org or icicles is the bad actor here. The behavior I'm 
seeing is as follows:


The command spawns empty table with :scope file, asks for a file, when I 
select that file, it asks for a function and I have no idea which 
function should I choose here.


For those two problems I've bisected the offending commit to 1a5151c51.

The third is the removal of C-c C-x C-r. I've read the discussion there, 
but it seems like nobody really wanted it removed, this is just a  
consequence of refactoring. So, can we get C-c C-x C-r org-clock-report 
back, if only as a closure over org-dynamic-block-insert-dblock?


Also, ever since that Stardiviner's commit the dynamic reloading of org 
seems to be broken on master. When I try to I get:


Symbol’s function definition is void: org-dynamic-block-define

Another thing, since org is moving towards unifying dynamic blocks, 
maybe the next step is to add begin_src blocks into the mix in 
org-dynamic-block-insert-dblock? It seems that they historically have 
different syntax, but are in practice the same thing. That's actually 
one place where I could use a wizard.


And why the function is called org-dynamic-block-insert-dblock and not 
org-insert-dblock? Seems redundant to me.


Also can someone explain how do I get from org elpa version to the git 
commit it's based on? E. g., in org-version.el I have 
"9.2.1-33-g029cf6-elpaplus" but g029cf6 does not seem like a real commit 
in the git repo.


--
Best Regards,
Nikolay Kudryavtsev




Re: [O] manual: stale bindings for org-clock-report and org-columns-insert-dblock

2019-03-04 Thread stardiviner


Nikolay Kudryavtsev  writes:

> Am I reading it correctly that C-c C-x C-r is no longer a valid keybinding? Is
> this the reason why it now behaves so stupidly, creating a block with :scope
> file and asking for that file? Can someone point me to a discussion of that
> change? Manual is still not updated about it and nothing in ORG-NEWS.
>
> Quickly using that key was quite useful to pop a clock report for a task and I
> really don't see why would anyone want to remove that.

I only added dispatcher for commands, but not modify command functions itself.
If I remember correctly, that commit indeed added changes in ORG-NEWS. So...

That's all I can say. I suggestion you check out Git log history with blame, to
figure what change that command behavior.

And don't be rude to people.

-- 
[ stardiviner ]
   I try to make every word tell the meaning what I want to express.

   Blog: https://stardiviner.github.io/
   IRC(freenode): stardiviner, Matrix: stardiviner
   GPG: F09F650D7D674819892591401B5DF1C95AE89AC3
  



[O] ob-core, org-outline-overlay-data error and byte-compile warning

2019-03-04 Thread zimoun
Dear,

First of all, thank you for this awesome tool !!


I am a bit confused and I should have something twisted with my config
but I am not able to find what. If someone has an explanation...
Or maybe it is well-known.

Well, I am running Emacs from Guix and the version is:
   GNU Emacs 26.1 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.0)
of 2018-11-14.

and it comes from Org 9.1:
   Org mode version 9.1.9 (release_9.1.9-65-g5e4542
   @ 
/gnu/stor/vsiqlxhj7lnydhhi85jc1pg0xzhcfdny-emacs-26.1/share/emacs/26.1/lisp/org/)

Because I prefer a more up-to-date version of Org, say 9.2, I have in
my init.el:

(add-to-list 'package-archives
 '("org" . "http://orgmode.org/elpa/;))
(package-initialize)
(use-package org
  :ensure org-plus-contrib)

Then the version 9.2 lives locally:
   Org mode version 9.2.2 (9.2.2-elpaplus
   @ /home/simon/.emacs.d/elpa/org-plus-contrib-20190304/)


The issue is when I evaluate `org-babel-execute-buffer', then it fails
with the error:
   Symbol’s function definition is void: org-outline-overlay-data

Hum? there is an incompatible change documented [1] in the Changes but
it should not interfere, right?
Well, if I find-grep in my ~/.emacs.d/ for `org-outline-overlay-data'
then nothing if found.
(and neither in the site-lisp/ from "system install")


So, I manually remove the byte-compiled file `ob-core.elc', and I
reload everything and now it works as expected. Hum?!
Then I again byte-compile the file `ob-core.el' with
   emacs -batch -f batch-byte-compile ob-core.el
then it warns:

In end of data:
ob-core.el:3149:1:Warning: the following functions are not known to be
defined: org-remove-indentation, org-completing-read, org-trim,
org-outline-overlay-data, org-set-outline-overlay-data, org-in-regexp,
proper-list-p

and after reloaded everything, it fails with the message "Symbol [...]
void: org-outline-overlay-data".


I think I miss something about the byte-compiling stuff.
Now, I am using the `ob-core.el' file and not the byte-compiled one,
but I would like to understand what is wrong; if it is not a bug.


Thank you in advance for in pointer and/or insights.


All the best,
simon


[1] https://orgmode.org/Changes.html



Re: [O] New bug in org-agenda?

2019-03-04 Thread Bastien
Hi Roland and Nicolas,

Nicolas Goaziou  writes:

> I think it already is. Otherwise, it should happen today: IIRC, Org is
> automatically updated every Monday.

the process is kinda broken right now, I have to do this manually.
It's probably just a permission issue, I'll fix it ASAP.

> Anyway, it is time for an Org 9.2.2 release. I'm Cc'ing Bastien about
> it.

Done.  Thanks for the heads up and all the work.

-- 
 Bastien



Re: [O] New bug in org-agenda?

2019-03-04 Thread Roland Everaert
Thanks, then I will try it later today.

Regards,

Roland.
Nicolas Goaziou writes:

> Hello,
>
> Roland Everaert  writes:
>
>> I am facing the same issue with that version on emacs 25.2.2 (Ubuntu
>> 18.04.2 LTS).
>>
>>
>> When will it be available throu the Org Mode ELPA repo?
>
> I think it already is. Otherwise, it should happen today: IIRC, Org is
> automatically updated every Monday.
>
> Anyway, it is time for an Org 9.2.2 release. I'm Cc'ing Bastien about
> it.
>
> Bastien, WDYT?
>
> Regards,


-- 
Luke, use the FOSS

Sent from Emacs



Re: [O] New bug in org-agenda?

2019-03-04 Thread Nicolas Goaziou
Hello,

Roland Everaert  writes:

> I am facing the same issue with that version on emacs 25.2.2 (Ubuntu
> 18.04.2 LTS).
>
>
> When will it be available throu the Org Mode ELPA repo?

I think it already is. Otherwise, it should happen today: IIRC, Org is
automatically updated every Monday.

Anyway, it is time for an Org 9.2.2 release. I'm Cc'ing Bastien about
it.

Bastien, WDYT?

Regards,

-- 
Nicolas Goaziou



Re: [O] New bug in org-agenda?

2019-03-04 Thread Joost Kremers



On Mon, Mar 04 2019, Roland Everaert wrote:
I am facing the same issue with that version on emacs 25.2.2 
(Ubuntu

18.04.2 LTS).


When will it be available throu the Org Mode ELPA repo?


I got the update this morning (finally...)

--
Joost Kremers
Life has its moments



Re: [O] New bug in org-agenda?

2019-03-04 Thread Roland Everaert
Hi,

I am facing the same issue with that version on emacs 25.2.2 (Ubuntu
18.04.2 LTS).


When will it be available throu the Org Mode ELPA repo?

Regards,

Roland.


Nicolas Goaziou writes:

> Hello,
>
> Richard Stanton  writes:
>
>> Using Org mode version 9.2.1 (9.2.1-33-g029cf6-elpaplus), I get an error 
>> message when I run org-agenda:
>>
>> Debugger entered--Lisp error: (error "Wrong number of arguments")
>>   propertize("WAITING" nil face org-warning)
>>   org-agenda-get-restriction-and-command(nil)
>>   org-agenda(nil)
>>   funcall-interactively(org-agenda nil)
>>   call-interactively(org-agenda record nil)
>>   command-execute(org-agenda record)
>>   execute-extended-command(nil "org-agenda" #("org-agenda"
>> 0 1 (fontified t) 1 2 (fontified t) 2 3 (fontified t) 3 4 (fontified
>> t) 4 5 (fontified t) 5 6 (fontified t) 6 7 (fontified t)
>> 7 8 (fontified t) 8 9 (fontified t) 9 10 (fontified nil)))
>>   funcall-interactively(execute-extended-command nil "org-agenda"
>> #("org-agenda" 0 1 (fontified t) 1 2 (fontified t) 2 3 (fontified t)
>> 3 4 (fontified t) 4 5 (fontified t) 5 6 (fontified t) 6 7 (fontified
>> t) 7 8 (fontified t) 8 9 (fontified t) 9 10 (fontified nil)))
>>   call-interactively(execute-extended-command nil nil)
>>   command-execute(execute-extended-command)
>>
>> This has only started in the last few days and my init.el file has not
>> changed, so it seems to be something in the latest update.
>
> This was fixed a few days ago.
>
> Regards,


-- 
Luke, use the FOSS

Sent from Emacs



Re: [O] Mutually-exclusive Org tags still inherit each other

2019-03-04 Thread Nicolas Goaziou
Hello,

Tina Russell  writes:

> Well, I think it’s unreasonable to ask users to reinforce manually and
> continuously something they’ve already specified in their settings.
> Besides, my example was intentionally trivial—imagine managing a large
> tree and having to remember which tags are mutually exclusive to what,
> all the time.
>
> But, no matter! I have created a patch! It works great, even for edge
> cases like when an entry has two tags that are set as mutually
> exclusive to each other.

Thank you for the patch.

Unfortunately, I think we are miscommunicating, because we are thinking
at different levels of abstraction. Le me clarify this.

Org syntax supports colons-wrapped cookies at the end of a headline,
called tags. That's about it. Of course, you can extend those cookies to
support, e.g., inheritance, groups, mutual exclusion, and whatnot. But
at the lowest level, there are only cookies at the end of a headline.

The function `org-get-tags' was implemented to get those, possibly with
inheritance. Most, if not all, of its callers in the code base do not
care about groups, or mutual exclusion. Also, most, if not all, callers
care about internal tags. Not that some internal tags are automatically
inherited, hence support for this mechanism in `org-get-tags'.

You apparently have a need for user-defined tags, with all bells and
whistles. However, IIUC, you don't really need to list them, but
ultimately do a tag search on them. 

There are advanced functions for tag searches: `org-make-tags-matcher'
and `org-scan-tags'. My point is that you should first check if they
already do what you want, and patch them otherwise, instead of changing
`org-get-tags', which has a clear scope.

WDYT?

Regards,

-- 
Nicolas Goaziou