Re: [O] [PATCH] org-agenda: Store stuck project redo command

2017-04-20 Thread Samuel Wales
maybe i got that backward.

my note is: "fixme bug in org: either if you do g, it will ignore restriction
lock or you have to manually remove restriction lock.  the best
would be for g to preserve the restriction lock even though it
has been removed."

On 4/20/17, Samuel Wales  wrote:
> in case it isn't already considered, i think storing the conditions of
> the original call applies to many agenda calls.  i run into this issue
> with the following old code.  i set a restriction lock, and run
> agenda, but g runs agenda without the restriction lock.
>
> (defun alpha-org-agenda-subtree ( _arg)
>   "Show agenda for all tasks in subtree.
>
> ===
>
> You can get a fast sorted view with this command.  In this
> example, the agenda will show tasks under my subtree.
>
>   * top level 1 -- not shown
> * my subtree -- shown
>   * TODO a
>   * some other headline | (<- point is here)
> * TODO [#A] b
>   * top level 2 -- not shown
>
> If you sort by priority, b will sort above a.
>
> ===
>
> This allows you to organize nodes hierarchically instead of
> keeping things at the same level merely to allow sorting.
> "
>   (interactive "P")
>
>   (org-agenda-set-restriction-lock 'subtree)
>   (let ((org-agenda-sorting-strategy '(user-defined-up category-up))
> (org-agenda-text-search-extra-files)
> (org-agenda-show-inherited-tags))
> (org-tags-view nil "LEVEL>0")
> (setq-local org-agenda-sorting-strategy
> org-agenda-sorting-strategy)))
>
> --
> The Kafka Pandemic: 
>
> The disease DOES progress. MANY people have died from it. And ANYBODY
> can get it at any time.
>
> "You’ve really gotta quit this and get moving, because this is murder
> by neglect." ---
> .
>


-- 
The Kafka Pandemic: 

The disease DOES progress. MANY people have died from it. And ANYBODY
can get it at any time.

"You’ve really gotta quit this and get moving, because this is murder
by neglect." ---
.



Re: [O] [PATCH] org-agenda: Store stuck project redo command

2017-04-20 Thread Samuel Wales
in case it isn't already considered, i think storing the conditions of
the original call applies to many agenda calls.  i run into this issue
with the following old code.  i set a restriction lock, and run
agenda, but g runs agenda without the restriction lock.

(defun alpha-org-agenda-subtree ( _arg)
  "Show agenda for all tasks in subtree.

===

You can get a fast sorted view with this command.  In this
example, the agenda will show tasks under my subtree.

  * top level 1 -- not shown
* my subtree -- shown
  * TODO a
  * some other headline | (<- point is here)
* TODO [#A] b
  * top level 2 -- not shown

If you sort by priority, b will sort above a.

===

This allows you to organize nodes hierarchically instead of
keeping things at the same level merely to allow sorting.
"
  (interactive "P")

  (org-agenda-set-restriction-lock 'subtree)
  (let ((org-agenda-sorting-strategy '(user-defined-up category-up))
(org-agenda-text-search-extra-files)
(org-agenda-show-inherited-tags))
(org-tags-view nil "LEVEL>0")
(setq-local org-agenda-sorting-strategy
org-agenda-sorting-strategy)))

-- 
The Kafka Pandemic: 

The disease DOES progress. MANY people have died from it. And ANYBODY
can get it at any time.

"You’ve really gotta quit this and get moving, because this is murder
by neglect." ---
.



Re: [O] Bug: link beginning with parenthesis doesn't work [9.0.5 (release_9.0.5-474-g942b62 @ /home/joe/org-mode/lisp/)]

2017-04-20 Thread Joe Corneli
The (xxx) form for a link target, especially one outside of a block,
doesn't seem to have meaning within the document model that Org
understands.  So, yes, this explains *why* I am seeing the error
described above.  But I still think there is a legitimate bug report
here, since the behaviour is not likely to be expected by the user.
Someone in my position has no interest in code refs, I was only trying
to link to a bit of text in the buffer.  Saying "oh but you can't link
to this *one* kind of text" is perhaps a fair move.  On the other
hand, given that "following a link" just means "run a search process",
that search process *could* be smart enough to notice that "no coderef
was found, maybe the user meant to link to some plain text in
parentheses".  Then I wouldn't see an error.

On Thu, Apr 20, 2017 at 11:12 PM, Nicolas Goaziou
 wrote:
> Joe Corneli  writes:
>
>> In my opinion, capture and/or search should do something different for
>> text beginning "(" and ending with ")",  when this text is a link
>> target that is not within a code block.
>
> See below.
>
>> The docs say:
>>
>> "In literal examples, Org will interpret strings like ‘(ref:name)’ as
>> labels"
>>
>> But the text (like this) in my example wasn't inside of a code block,
>> nor was it presented as (ref:like this).
>
> There are two syntaxs: the one within the code block, which is (ref:xxx)
> by default and can be changed, and the one outside the block, which is
> (xxx), and cannot be changed. See the following example from the manual:
>
>  #+BEGIN_SRC emacs-lisp -n -r
>  (save-excursion  (ref:sc)
> (goto-char (point-min)))  (ref:jump)
>  #+END_SRC
>  In line [[(sc)]] we remember the current position.  [[(jump)][Line 
> (jump)]]
>  jumps to point-min.
>
> Regards,



Re: [O] Bug: link beginning with parenthesis doesn't work [9.0.5 (release_9.0.5-474-g942b62 @ /home/joe/org-mode/lisp/)]

2017-04-20 Thread Nicolas Goaziou
Joe Corneli  writes:

> In my opinion, capture and/or search should do something different for
> text beginning "(" and ending with ")",  when this text is a link
> target that is not within a code block.

See below.

> The docs say:
>
> "In literal examples, Org will interpret strings like ‘(ref:name)’ as
> labels"
>
> But the text (like this) in my example wasn't inside of a code block,
> nor was it presented as (ref:like this).

There are two syntaxs: the one within the code block, which is (ref:xxx)
by default and can be changed, and the one outside the block, which is
(xxx), and cannot be changed. See the following example from the manual:

 #+BEGIN_SRC emacs-lisp -n -r
 (save-excursion  (ref:sc)
(goto-char (point-min)))  (ref:jump)
 #+END_SRC
 In line [[(sc)]] we remember the current position.  [[(jump)][Line (jump)]]
 jumps to point-min.

Regards,



Re: [O] Bug: entering range of times [9.0.5 (release_9.0.5-474-g942b62 @ /home/joe/org-mode/lisp/)]

2017-04-20 Thread Joe Corneli
Yeah the problem has been resolved after restarting Emacs.  I think
the old version had new files but not everything had been loaded, so
it was indeed mixed.



Re: [O] Bug: link beginning with parenthesis doesn't work [9.0.5 (release_9.0.5-474-g942b62 @ /home/joe/org-mode/lisp/)]

2017-04-20 Thread Joe Corneli
On Thu, Apr 20, 2017 at 8:35 PM, Nicolas Goaziou
> Joe Corneli  writes:
>> Debugger entered--Lisp error: (error "No match for coderef: like this")
>
> The error message should give you the answer. Links within parenthesis
> denote "coderefs". See (info "(org) Literal examples").
>
> [[file:~/test.tex::(like%20this)]] means to refer to a coderef (like
> this) in the file "test.tex".

In my opinion, capture and/or search should do something different for
text beginning "(" and ending with ")",  when this text is a link
target that is not within a code block.

The docs say:

"In literal examples, Org will interpret strings like ‘(ref:name)’ as labels"

But the text (like this) in my example wasn't inside of a code block,
nor was it presented as (ref:like this).

Joe



Re: [O] Bug: link beginning with parenthesis doesn't work [9.0.5 (release_9.0.5-474-g942b62 @ /home/joe/org-mode/lisp/)]

2017-04-20 Thread Nicolas Goaziou
Hello,

Joe Corneli  writes:

> I've noticed a problem with the link system.
>
> Reproduction steps.
>
> 1. Find any text in a file, surrounded by parentheses (like this).
>
> 2. org-capture the region in parentheses to come up with, e.g.,
>
> ** TODO This is a problem
>(like this)
>[[file:~/test.tex::(like%20this)]]
>
> 3. Now try to follow the file:... link with org-open-at-point.
>
> This triggers an error, with a backtrace as follows (between ~~~'s).
>
> If you remove the leading parenthesis so that the link looks like this 
> instead:
>
>  [[file:~/test.tex::like%20this)]]
>
> you can then jump to the captured text in the file, as expected.
>
> ~~~
> Debugger entered--Lisp error: (error "No match for coderef: like this")

The error message should give you the answer. Links within parenthesis
denote "coderefs". See (info "(org) Literal examples").

[[file:~/test.tex::(like%20this)]] means to refer to a coderef (like
this) in the file "test.tex".

Regards,

-- 
Nicolas Goaziou



Re: [O] Bug: Canceling a TODO state change does not revert the heading [9.0.5 (9.0.5-elpa @ /home/laurence/.emacs.d/elpa/org-20170210/)]

2017-04-20 Thread Nicolas Goaziou
Hello,

Laurence Rochfort  writes:

> If you change the TODO state with org-todo and it accepts a message, but
> you then cancel the message with C-c C-k, org does not revert the TODO
> heading to its previous state.
>
> For instance:
>
> Heading is TODO
> C-c C-t -> Set to WORKING
> Prompted for message
> Cancel with C-c C-k
> TODO heading still says working; it has not reverted to TODO.
>
> I would expect cancelling the message to revert the TODO heading, but
> instead I have to "undo" with C-/.

I disagree. You may want to cancel the message because this change
doesn't require one, but, yet, want the todo state change.

Having to undo one more time seems a satisfying solution.

Regards,

-- 
Nicolas Goaziou



[O] elisp call dot babel doesn't work on Org mode 9

2017-04-20 Thread wang jinjian
Hi,

I like generating simple process diagrams using dot and tables
 tutorial!
It works fine on Org mode 8 but doesn't work on Org mode 9.0.5.

The reason is the params variable not accessible! below error message
displayed:

let: Symbol’s value as variable is void: params

What's the right steps to run dot code in elisp code block in Org mode 9?

BRs
J.J. Wang


[O] org-src--contents-for-write-back : preserve original major-mode, and avoid mixing tabs and spaces in org-mode buffers

2017-04-20 Thread Brent Goodrick
Hi,

I found a bug in org-mode where emacs-lisp code that is in a
already-indented source block in an org-mode buffer is improperly
indented when editing it via C-c '. Take the following contrived
example emacs-lisp source code:

 1. Here is a list item with a emacs-lisp source block:
#+BEGIN_SRC emacs-lisp :results value
  (let ((uuid "c2327c73-6da3-4421-8bda-194783a00e8f"))
(progn
  (let ((xxx 'yyy))
(let ((xxx 'yyy))
  (while t
(message "infinite loop"))
#+END_SRC

After C-c ', indenting it, and C-c ' again, it renders as
follows (tabs converted to spaces for this email, since I have
`indent-tabs-mode' set to t in my emacs-lisp mode, which
is the Emacs default):

 1. Here is a list item with a emacs-lisp source block:
#+BEGIN_SRC emacs-lisp :results value
  (let ((uuid "c2327c73-6da3-4421-8bda-194783a00e8f"))
(progn
  (let ((xxx 'yyy))
(let ((xxx 'yyy))
  (while t
(message "infinite loop"))
#+END_SRC

Notice how the indentation looks bad due to the mixture of tabs
and spaces.

The bug is in the `org-src--contents-for-write-back' function. It
uses a temp buffer. The temp buffer's major-mode is left to be
the default, which is fundamental-mode, which knows nothing about
how to indent lisp code properly. So in the fix below, I run the
major-mode function from the original buffer. But even with that
fix, the indentation must also use spaces in order to avoid
mixing tabs and spaces in the resulting Org buffer.  My fix,
shown below, is to initialize the major-mode, and set
`indent-tabs-mode' to nil, before it runs the `write-back'
code.

See "CHANGE" comments for the changes made:

(defun org-src--contents-for-write-back ()
  "Return buffer contents in a format appropriate for write back.
Assume point is in the corresponding edit buffer."
  (let ((indentation (or org-src--block-indentation 0))
(preserve-indentation org-src--preserve-indentation)
(contents (org-with-wide-buffer (buffer-string)))
(write-back org-src--allow-write-back))
;; CHANGE: Save off the original mode into orig-major-mode:
(let ((orig-major-mode major-mode))
  (with-temp-buffer
(insert (org-no-properties contents))
;; CHANGE: Switch to the original mode to obtain mode-specific
indentation behavior:
(funcall orig-major-mode)
;; CHANGE: Do not mix tabs and spaces during indentation:
(setq indent-tabs-mode nil)
(goto-char (point-min))
(when (functionp write-back) (funcall write-back))
(unless (or preserve-indentation (= indentation 0))
  (let ((ind (make-string indentation ?\s)))
(goto-char (point-min))
(while (not (eobp))
  (when (looking-at-p "[ \t]*\\S-") (insert ind))
  (forward-line
(buffer-string)

If the above change seems correct, can someone apply it to org-mode?

Thanks,
Brent Goodrick


[O] Bug: Incomplete header-args parsing [9.0.5 (9.0.5-elpa @ ~/.emacs.d/elpa/org-20170210/)]

2017-04-20 Thread Moritz Heidkamp
org-babel-parse-header-arguments stops parsing arguments after an
argument with a string value containing unbalanced parentheses. For
example:

  ELISP> (org-babel-parse-header-arguments ":foo \"(foo\" :bar 123")
  ((:foo . "(foo"))

Whereas with balanced parentheses:

  ELISP> (org-babel-parse-header-arguments ":foo \"(foo)\" :bar 123")
  ((:foo . "(foo)")
   (:bar . 123))

Oddly, the same is true when wrapping the string in a progn form:

  ELISP> (org-babel-parse-header-arguments ":foo (progn \"(foo\") :bar 123")
  ((:foo . "(foo"))


Emacs  : GNU Emacs 25.1.1 (x86_64-unknown-linux-gnu, GTK+ Version 3.22.8)
 of 2017-02-28
Package: Org mode version 9.0.5 (9.0.5-elpa @ ~/.emacs.d/elpa/org-20170210/)

current state:
==
(setq
 org-hide-leading-stars t
 org-tab-first-hook '(org-babel-hide-result-toggle-maybe 
org-babel-header-arg-expand)
 org-speed-command-hook '(org-speed-command-default-hook 
org-babel-speed-command-hook)
 org-occur-hook '(org-first-headline-recenter)
 org-metaup-hook '(org-babel-load-in-session-maybe)
 org-html-format-drawer-function #[514 "\207" [] 3 "\n\n(fn NAME CONTENTS)"]
 org-latex-format-inlinetask-function 
'org-latex-format-inlinetask-default-function
 org-clock-mode-line-total 'today
 org-confirm-shell-link-function 'yes-or-no-p
 org-ascii-format-inlinetask-function 'org-ascii-format-inlinetask-default
 org-latex-format-headline-function 'org-latex-format-headline-default-function
 org-default-notes-file "notes.org"
 org-after-todo-state-change-hook '(org-clock-out-if-current)
 org-latex-format-drawer-function #[514 "\207" [] 3 "\n\n(fn _ CONTENTS)"]
 org-odt-format-headline-function 'org-odt-format-headline-default-function
 org-from-is-user-regexp "\\"
 org-src-mode-hook '(org-src-babel-configure-edit-buffer 
org-src-mode-configure-edit-buffer)
 org-agenda-before-write-hook '(org-agenda-add-entry-text)
 org-babel-pre-tangle-hook '(save-buffer)
 org-mode-hook '(#[0 "\300\301\302\303\304$\207" [add-hook 
change-major-mode-hook org-show-block-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-ascii-format-drawer-function #[771 "\207" [] 4 "\n\n(fn NAME CONTENTS 
WIDTH)"]
 org-odt-format-inlinetask-function 'org-odt-format-inlinetask-default-function
 org-cycle-hook '(org-cycle-hide-archived-subtrees org-cycle-hide-drawers 
org-cycle-show-empty-lines
 org-optimize-window-after-visibility-change)
 org-babel-tangle-lang-exts '(("clojure" . "clj") ("emacs-lisp" . "el") 
("elisp" . "el"))
 org-confirm-elisp-link-function 'yes-or-no-p
 org-metadown-hook '(org-babel-pop-to-session-maybe)
 org-odt-format-drawer-function #[514 "\207" [] 3 "\n\n(fn NAME CONTENTS)"]
 org-html-format-headline-function 'org-html-format-headline-default-function
 org-link-parameters '(("id" :follow org-id-open) ("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)
   ("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
   ("https" :follow (lambda (path) (browse-url (concat 
"https:" path
   ("mailto" :follow (lambda (path) (browse-url (concat 
"mailto:; path
   ("message" :follow (lambda (path) (browse-url (concat 
"message:" path
   ("news" :follow (lambda (path) (browse-url (concat 
"news:; path
   ("shell" :follow org--open-shell-link))
 org-babel-load-languages '((clojure . t))
 org-html-format-inlinetask-function 
'org-html-format-inlinetask-default-function
 org-clock-out-hook '(org-clock-remove-empty-clock-drawer)
 )



[O] Bug: Canceling a TODO state change does not revert the heading [9.0.5 (9.0.5-elpa @ /home/laurence/.emacs.d/elpa/org-20170210/)]

2017-04-20 Thread Laurence Rochfort

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

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

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


If you change the TODO state with org-todo and it accepts a message, but
you then cancel the message with C-c C-k, org does not revert the TODO
heading to its previous state.

For instance:

Heading is TODO
C-c C-t -> Set to WORKING
Prompted for message
Cancel with C-c C-k
TODO heading still says working; it has not reverted to TODO.

I would expect cancelling the message to revert the TODO heading, but
instead I have to "undo" with C-/.


Emacs  : GNU Emacs 25.1.1 (x86_64-redhat-linux-gnu, GTK+ Version 3.20.9)
 of 2016-10-13
Package: Org mode version 9.0.5 (9.0.5-elpa @ 
/home/laurence/.emacs.d/elpa/org-20170210/)

current state:
==
(setq
 org-hide-leading-stars t
 org-tab-first-hook '(org-babel-hide-result-toggle-maybe 
org-babel-header-arg-expand)
 org-speed-command-hook '(org-speed-command-default-hook 
org-babel-speed-command-hook)
 org-occur-hook '(org-first-headline-recenter)
 org-metaup-hook '(org-babel-load-in-session-maybe)
 org-confirm-shell-link-function 'yes-or-no-p
 org-finalize-agenda-hook '(org-agenda-property-add-properties)
 org-default-notes-file "/home/laurence/Documents/org-mode/notes.org"
 org-capture-templates '(("b" "Bugs")
 ("bc" "Customer bugs" entry (file+headline 
"/home/laurence/Documents/org-mode/work.org" "Customer Bugs") "* TODO %^L %^C 
%^g %?")
 ("bi" "Internal bugs" entry (file+headline 
"/home/laurence/Documents/org-mode/work.org" "Internal Bugs") "* TODO %^L %^C 
%^g %?"))
 org-startup-indented t
 org-after-todo-state-change-hook '(org-clock-out-if-current)
 org-from-is-user-regexp "\\"
 org-src-mode-hook '(org-src-babel-configure-edit-buffer 
org-src-mode-configure-edit-buffer)
 org-agenda-before-write-hook '(org-agenda-add-entry-text)
 org-babel-pre-tangle-hook '(save-buffer)
 org-mode-hook '(#[0 "\300\301\302\303\304$\207" [add-hook 
change-major-mode-hook org-show-block-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 (closure (t) nil (org-bullets-mode 
1)) (closure (t) nil (flyspell-mode)))
 org-archive-hook '(org-attach-archive-delete-maybe)
 org-enforce-todo-dependencies t
 org-cycle-hook '(org-cycle-hide-archived-subtrees org-cycle-hide-drawers 
org-cycle-show-empty-lines org-optimize-window-after-visibility-change)
 org-agenda-finalize-hook '(org-agenda-property-add-properties)
 org-todo-keywords '((sequence "TODO(t/!)" "IN-PROGRESS(p/!)" "WAITING ON 
CUSTOMER(w@/@)" "READY FOR QA(r/!)" "SUBMITTED FOR QA(q/!)" "|" "ON-HOLD(h/@)"
  "DONE(d/!)" "CANCELLED(c/@)" "CLOSED(l/@)" "NOT A 
BUG(n/@)" "DUPLICATE BUG(u@/!)" "SUBMITTED FOR RELEASE(b@/!)" "DELIVERED(v/!)"
  "PR ACCEPTED(a@/!)")
 )
 org-modules '(org-bbdb org-bibtex org-docview org-gnus org-info org-irc 
org-mhe org-rmail org-w3m org-mac-iCal org-mac-link)
 org-confirm-elisp-link-function 'yes-or-no-p
 org-metadown-hook '(org-babel-pop-to-session-maybe)
 org-log-into-drawer t
 org-blocker-hook '(org-block-todo-from-children-or-siblings-or-parent)
 org-link-parameters '(("id" :follow org-id-open) ("x-devonthink-item" :follow 
org-devonthink-item-open)
   ("mac-evernote" :follow org-mac-evernote-note-open) 
("mac-outlook" :follow org-mac-outlook-message-open)
   ("acrobat" :follow org-mac-acrobat-open) ("skim" :follow 
org-mac-skim-open) ("addressbook" :follow org-mac-addressbook-item-open)
   ("x-together-item" :follow org-mac-together-item-open) 
("w3m" :store org-w3m-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)
   ("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)
   ("mu4e" :follow org-mu4e-open :store 
org-mu4e-store-link) ("file+sys") ("file+emacs") ("doi" :follow 
org--open-doi-link)
   ("elisp" :follow org--open-elisp-link) ("file" :complete 

Re: [O] How to obtain the headline level from org-element-at-point

2017-04-20 Thread Jeremie Juste
Hello,

Thanks for the reply.
> what do you mean it only considers level 1 headlines? It seems to work on all 
> headlines for me.
I mean that interleave-mode doesn't find the pdf path if I use the
following configuration. That is property at level 2 headline.

 * Literature  
 ** Notes for CS103
:PROPERTIES:
:INTERLEAVE_PDF: cs103.pdf
:END:


> The email subject doesn't seem related to the body you can get the level like 
> this.
I was thinking that the function looks at the property of level 1 level
only. am I wrong ? I filed an issue
https://github.com/rudolfochrist/interleave/issues/44  and the
maintainer seems to have confirmed it.

> (org-element-property :level (org-element-at-point))
Thanks for the command. I was hoping to understand more this issue with
it. Will post a reply if I find anything interesting.

Bests regards,

Jeremie







>

>

>
> John
>
> ---
> Professor John Kitchin 
> Doherty Hall A207F
> Department of Chemical Engineering
> Carnegie Mellon University
> Pittsburgh, PA 15213
> 412-268-7803
> @johnkitchin
> http://kitchingroup.cheme.cmu.edu
>
> On Sat, Apr 8, 2017 at 10:17 AM, Jeremie Juste  wrote:
>
> Hello,
>
> Interleave-mode https://github.com/rudolfochrist/interleave, is a very 
> convenient tool for writing notes in associated
> with pdf. It uses org-mode for this purpose.
>
> I recently noticed that in the case where I want to write notes for
> multiple pdf in a singlie org file, I have to use the level 1 headline
>
> * Notes for CS103
>   :PROPERTIES:
>   :INTERLEAVE_PDF: cs103.pdf
>   :END:
>
> I would like to have the possibility of using any headline level for
> this purpose but my org-fu is weak.
>
> I think it boils down to this function in interleave-mode mode where
> (org-element-type headline) checks only for level 1 headline.
>
> #+BEGIN_SRC elisp
> (defun interleave--headline-pdf-path (buffer)
>   "Return the INTERLEAVE_PDF property of the current headline in BUFFER."
> (with-current-buffer buffer
>   (save-excursion
>     (let ((headline (org-element-at-point)))
>       (when (and (equal (org-element-type headline) 'headline)
>                  (org-entry-get nil interleave--pdf-prop))
>         (setq interleave-multi-pdf-notes-file t)
>         (org-entry-get nil interleave--pdf-prop))
>
> #+END_SRC
>
> Can anyone see a way around it ?
>
> Best regards,
>
> Jeremie



[O] No explicit way to add blank lines to the beginning or end of example or source blocks

2017-04-20 Thread Li DebugFan
No explicit way to add blank lines to the beginning or end of example or
source blocks.
For example: describing HTTP header:
---
HTTP header consists of colon-separated name-value pairs,
and terminated by a CRLF character sequence, e.g.:
#+BEGIN_EXAMPLE
GET / HTTP/1.1
Host: www.example.com

#+END_EXAMPLE
This is line break at the end of HTTP header.
---
But the blank line at end of example block is not exported, and neither in
src block,
I check the source, and found it maybe because of the function
`org-split-string',
its description as follow:
(defun org-split-string (string  separators)
  "Splits STRING into substrings at SEPARATORS.
No empty strings are returned if there are matches at the beginning
and end of string."
  ...)
It means `org-split-string' will ignore all blank lines at the beginning
and the end,
but what if I need some blank lines in the beginning or the end?


Re: [O] Bug: entering range of times [9.0.5 (release_9.0.5-474-g942b62 @ /home/joe/org-mode/lisp/)]

2017-04-20 Thread Kyle Meyer
Joe Corneli  writes:

> As I understand it I should be able to enter a range of times using
> either of the following formats:
>
> ** TODO time range <2017-04-21 Fri 15:45-16:45>
> ** TODO time+date range <2017-04-21 Fri 15:45>--<2017-04-22 Sat 15:45>
>
> Docs: http://orgmode.org/manual/Timestamps.html
>
> However, using the formats above triggers errors when I try to display
> the agenda (org-agenda) or todo list (org-todo-list).

[...]

> ~~~
> Debugger entered--Lisp error: (void-function org-hh:mm-string-to-minutes)
>
> Emacs  : GNU Emacs 25.1.50.2 (x86_64-unknown-linux-gnu, GTK+ Version 3.14.13)
>  of 2016-08-15
> Package: Org mode version 9.0.5 (release_9.0.5-474-g942b62 @ 
> /home/joe/org-mode/lisp/)

Based on your version information, you're on the master branch.
org-hh:mm-string-to-minutes is no longer used in this branch; there's a
compatibility alias, but no calls to it:

$ git describe
release_9.0.5-474-g942b6267a
$ git grep org-hh:mm-string-to-minutes
etc/ORG-NEWS:*** ~org-hh:mm-string-to-minutes~ is obsolete
lisp/org-compat.el:(define-obsolete-function-alias 
'org-hh:mm-string-to-minutes

So, in order to get the void function error above, older Org files that
call org-hh:mm-string-to-minutes must be getting loaded at some point.
And I suppose master's org-compat.el must not be getting loaded because
the alias isn't defined.

Perhaps the mixed-install FAQ section will help you track down the
issue: http://orgmode.org/worg/org-faq.html#mixed-install

-- 
Kyle



[O] Bug: entering range of times [9.0.5 (release_9.0.5-474-g942b62 @ /home/joe/org-mode/lisp/)]

2017-04-20 Thread Joe Corneli
As I understand it I should be able to enter a range of times using
either of the following formats:

** TODO time range <2017-04-21 Fri 15:45-16:45>
** TODO time+date range <2017-04-21 Fri 15:45>--<2017-04-22 Sat 15:45>

Docs: http://orgmode.org/manual/Timestamps.html

However, using the formats above triggers errors when I try to display
the agenda (org-agenda) or todo list (org-todo-list).

Note that a single date with a colon-separated time and no range is OK
(no error).

** TODO This is a date with a colon <2017-04-20 Tue 15:45>

~~~
Debugger entered--Lisp error: (void-function org-hh:mm-string-to-minutes)
  org-hh:mm-string-to-minutes("16:45")
  org-agenda-format-item(nil #("TODO This is a time range <2017-04-21 Fri 
15:45-16:45>" 0 4 (org-category "blotter" fontified t face (:foreground "black" 
:background "snow" :weight bold :box (:line-width -1))) 4 25 (org-category 
"blotter" fontified t face org-level-2) 25 26 (org-category "blotter" fontified 
t face org-level-2) 26 53 (fontified t org-category "blotter" face org-date 
mouse-face highlight keymap (keymap (follow-link . mouse-face) (mouse-3 . 
org-find-file-at-mouse) (mouse-2 . org-open-at-mouse))) 53 54 (fontified t 
rear-nonsticky (mouse-face highlight keymap invisible intangible help-echo 
org-linked-text htmlize-link) org-category "blotter" face org-date mouse-face 
highlight keymap (keymap (follow-link . mouse-face) (mouse-3 . 
org-find-file-at-mouse) (mouse-2 . org-open-at-mouse "  " "blotter" nil 
#("<2017-04-21 Fri 15:45-16:45>" 0 27 (keymap (keymap (follow-link . 
mouse-face) (mouse-3 . org-find-file-at-mouse) (mouse-2 . org-open-at-mouse)) 
mouse-face highlight face org-date org-category "blotter" fontified t) 27 28 
(keymap (keymap (follow-link . mouse-face) (mouse-3 . org-find-file-at-mouse) 
(mouse-2 . org-open-at-mouse)) mouse-face highlight face org-date org-category 
"blotter" rear-nonsticky (mouse-face highlight keymap invisible intangible 
help-echo org-linked-text htmlize-link) fontified t)) 
"<\\([0-9]\\{4\\}-[0-9]\\{2\\}-[0-9]\\{2\\} ?[^\n>]*?\\)>" nil)
  org-agenda-get-timestamps(nil)
  org-agenda-get-day-entries("/home/joe/postdoc.git/org/blotter.org" (4 21 
2017) :scheduled :timestamp :sexp)
  apply(org-agenda-get-day-entries "/home/joe/postdoc.git/org/blotter.org" (4 
21 2017) (:scheduled :timestamp :sexp))
  org-agenda-list(nil)
  (let ((org-agenda-include-diary t) (org-agenda-remove-tags t)) 
(org-agenda-list current-prefix-arg))
  eval((let ((org-agenda-include-diary t) (org-agenda-remove-tags t)) 
(org-agenda-list current-prefix-arg)))
  org-let(((org-agenda-include-diary t) (org-agenda-remove-tags t)) 
(org-agenda-list current-prefix-arg))
  org-agenda(nil)
  funcall-interactively(org-agenda nil)
  call-interactively(org-agenda nil nil)
  command-execute(org-agenda)
~~~

Emacs  : GNU Emacs 25.1.50.2 (x86_64-unknown-linux-gnu, GTK+ Version 3.14.13)
 of 2016-08-15
Package: Org mode version 9.0.5 (release_9.0.5-474-g942b62 @ 
/home/joe/org-mode/lisp/)

current state:
==
(setq
 org-tree-slide-mode-hook '(toggle-org-cloaking)
 org-tab-first-hook '(org-babel-hide-result-toggle-maybe 
org-babel-header-arg-expand)
 org-speed-command-hook '(org-speed-command-activate 
org-babel-speed-command-activate)
 org-agenda-diary-file "~/postdoc.git/org/work.org"
 org-occur-hook '(org-first-headline-recenter)
 org-use-fast-todo-selection 'prefix
 org-clock-in-prepare-hook '((lambda nil
  (if (not pomodoro-is-active)
   (let ((minutes (read-number "Start timer: " 90)))
(when org-timer-current-timer (org-timer-stop))
(org-timer-set-timer minutes) (pomodoro-mode))
   )
  )
 )
 org-metaup-hook '(org-babel-load-in-session-maybe)
 org-html-format-drawer-function #[514 "\207" [] 3 "\n\n(fn NAME CONTENTS)"]
 org-log-done 'note
 org-latex-format-inlinetask-function 
'org-latex-format-inlinetask-default-function
 org-confirm-shell-link-function 'yes-or-no-p
 org-image-actual-width nil
 org-finalize-agenda-hook '(remove-todo-and-cookies place-agenda-tags)
 org-ascii-format-inlinetask-function 'org-ascii-format-inlinetask-default
 org-startup-folded nil
 org-latex-pdf-process '("latexmk -pdflatex='pdflatex -interaction nonstopmode' 
-pdf -bibtex -f  %f")
 org-agenda-prefix-format '((agenda . " %i %-10:c%?-12t% s") (timeline . "  % 
s")
(todo . " %i %-12:c") (tags . " %i %-12:c") (search 
. " %i %-12:c"))
 org-agenda-custom-commands '(("a" "" agenda ""
   ((org-agenda-include-diary t) 
(org-agenda-remove-tags t)))
  )
 org-latex-format-headline-function 'org-latex-format-headline-default-function
 org-default-notes-file "~/postdoc.git/org/blotter.org"
 org-todo-keyword-faces '(("META" :foreground "darkgreen" :background "snow" 
:box

[O] Bug: link beginning with parenthesis doesn't work [9.0.5 (release_9.0.5-474-g942b62 @ /home/joe/org-mode/lisp/)]

2017-04-20 Thread Joe Corneli
Hello,

I've noticed a problem with the link system.

Reproduction steps.

1. Find any text in a file, surrounded by parentheses (like this).

2. org-capture the region in parentheses to come up with, e.g.,

** TODO This is a problem
   (like this)
   [[file:~/test.tex::(like%20this)]]

3. Now try to follow the file:... link with org-open-at-point.

This triggers an error, with a backtrace as follows (between ~~~'s).

If you remove the leading parenthesis so that the link looks like this instead:

 [[file:~/test.tex::like%20this)]]

you can then jump to the captured text in the file, as expected.

~~~
Debugger entered--Lisp error: (error "No match for coderef: like this")
  signal(error ("No match for coderef: like this"))
  error("No match for coderef: like this")
  (condition-case err (org-link-search search) (error (funcall 
save-position-maybe) (error (nth 1 err
  (cond (line (org-goto-line line) (if (derived-mode-p (quote org-mode)) (progn 
(org-reveal (search (condition-case err (org-link-search search) (error 
(funcall save-position-maybe) (error (nth 1 err))
  (cond ((and (stringp cmd) (not (string-match "^\\s-*$" cmd))) (while 
(string-match "['\"]%s['\"]" cmd) (setq cmd (replace-match "%s" t t cmd))) 
(setq cmd (replace-regexp-in-string "%s" (shell-quote-argument 
(convert-standard-filename file)) cmd nil t)) (let ((save-match-data-internal 
(match-data))) (unwind-protect (progn (let ((match-index 1) (number-of-groups 
...)) (set-match-data link-match-data) (while (<= match-index number-of-groups) 
(let ... ...) (setq match-index ... (set-match-data 
save-match-data-internal (quote evaporate (let ((wconfig 
(current-window-configuration))) (unwind-protect (progn (message "Running 
%s...done" cmd) (start-process-shell-command cmd nil cmd) (and (boundp (quote 
org-wait)) (numberp org-wait) (sit-for org-wait))) (set-window-configuration 
wconfig ((or (stringp cmd) (eq cmd (quote emacs))) (funcall (cdr (assq 
(quote file) org-link-frame-setup)) file) (widen) (cond (line (org-goto-line 
line) (if (derived-mode-p (quote org-mode)) (progn (org-reveal (search 
(condition-case err (org-link-search search) (error (funcall 
save-position-maybe) (error (nth 1 err))) ((functionp cmd) (let 
((save-match-data-internal (match-data))) (unwind-protect (progn 
(set-match-data link-match-data) (condition-case nil (funcall cmd file link) 
((debug wrong-number-of-arguments wrong-type-argument invalid-function) 
(user-error "Please see Org News for version 9.0 about `org-file-apps'--Lisp 
error: %S" cmd (set-match-data save-match-data-internal (quote 
evaporate) ((consp cmd) (user-error "Please see Org News for version 9.0 
about `org-file-apps'--Error: Deprecated usage of %S" cmd)) (t (funcall (cdr 
(assq (quote file) org-link-frame-setup)) file)))
  (let* ((file (if (equal path "") buffer-file-name (substitute-in-file-name 
(expand-file-name path (file-apps (append org-file-apps 
(org-default-apps))) (apps (cl-remove-if (quote 
org-file-apps-entry-match-against-dlink-p) file-apps)) (apps-dlink 
(cl-remove-if-not (quote org-file-apps-entry-match-against-dlink-p) file-apps)) 
(remp (and (assq (quote remote) apps) (org-file-remote-p file))) (dirp (if remp 
nil (file-directory-p file))) (file (if (and dirp 
org-open-directory-means-index-dot-org) (concat (file-name-as-directory file) 
"index.org") file)) (a-m-a-p (assq (quote auto-mode) apps)) (dfile (downcase 
file)) (link (cond (line (concat file "::" (number-to-string line))) (search 
(concat file "::" search)) (t file))) (dlink (downcase link)) (ext (and 
(string-match "\\`.*?\\.\\([a-zA-Z0-9]+\\(\\.gz\\)?\\)\\'" dfile) (match-string 
1 dfile))) (save-position-maybe (let ((old-buffer (current-buffer)) (old-pos 
(point)) (old-mode major-mode)) (function (lambda nil (and (derived-mode-p ...) 
(eq old-mode ...) (or ... ...) (org-mark-ring-push old-pos old-buffer)) cmd 
link-match-data) (cond ((member in-emacs (quote ((16) system))) (setq cmd (cdr 
(assq (quote system) apps (in-emacs (setq cmd (quote emacs))) (t (setq cmd 
(or (and remp (cdr (assq ... apps))) (and dirp (cdr (assq ... apps))) (let 
((match ...)) (if match (progn ... match) (progn ... nil))) (assoc-default 
dfile (org-apps-regexp-alist apps a-m-a-p) (quote string-match)) (cdr (assoc 
ext apps)) (cdr (assq t apps)) (if (eq cmd (quote system)) (progn (setq cmd 
(cdr (assq (quote system) apps) (if (eq cmd (quote default)) (progn (setq 
cmd (cdr (assoc t apps) (if (eq cmd (quote mailcap)) (progn (require (quote 
mailcap)) (mailcap-parse-mailcaps) (let* ((mime-type (mailcap-extension-to-mime 
(or ext ""))) (command (mailcap-mime-info mime-type))) (if (stringp command) 
(setq cmd command) (setq cmd (quote emacs)) (if (and (not (eq cmd (quote 
emacs))) (not (file-exists-p file)) (not org-open-non-existing-files)) (progn 
(user-error "No such file: %s" file))) (cond ((and (stringp cmd) (not 
(string-match "^\\s-*$" cmd))) (while (string-match 

Re: [O] Export in Foswiki format?

2017-04-20 Thread Loris Bennett
"Loris Bennett"  writes:

> Hi,
>
> I'm interested in exporting from Org to Foswiki format.  Is
> org-export-generic.el still the way to go or has this been superseded by
> something else?

Nevermind, I found this:

  https://github.com/dfeich/org8-wikiexporters

also available via MELPA.

Cheers,

Loris

-- 
This signature is currently under construction.




[O] Export in Foswiki format?

2017-04-20 Thread Loris Bennett
Hi,

I'm interested in exporting from Org to Foswiki format.  Is
org-export-generic.el still the way to go or has this been superseded by
something else?

Cheers,

Loris

-- 
This signature is currently under construction.




Re: [O] [babel] Working dir incorrect

2017-04-20 Thread Loris Bennett
Hi,

"Loris Bennett"  writes:

> Hi John,
>
> John Hendy  writes:
>
>> On Mon, Mar 13, 2017 at 9:32 AM, Loris Bennett
>>  wrote:
>>> Hi,
>>>
>>> In a file that used to work, when I now try to run some R code which
>>> generates an image, I get the error:
>>>
>>>   cannot open file './usage_users_historical_facet.pdf'
>>>
>>> If I check the working directory for the R session I see
>>>
>>>   getwd()
>>>   [1] "/usr/share/emacs/site-lisp/ess"
>>>
>>> instead of the directory in which my org file is located.
>>>
>>> I am now running Org 9.0.5 on Emacs 25.1.1.  The last time things worked
>>> I was definitely using an older version of Org and possibly Emacs 24.
>>>
>>> Any thoughts?
>>
>> I agree with Nick on an ECM. Just to start the ball rolling:
>>
[snip (54 lines)]
>>
>> How does this go for you?
>
> Thanks for doing most of the work for me.  Unfortunately for me, the ECM
> works fine, so I'm going to have to do some work myself and debug my
> crufty old .emacs.

I finally got round to bisecting my .emacs and worked out the sequence
of events which lead me to shooting myself in the foot:

1. Installed Emacs 25 under /usr/local
2. Discovered that Emacs 25 couldn't find the ESS stuff
3. Defined a variable 'ess-directory' to be "/usr/share/emacs/site-lisp/ess/"
4. Used the variable in a function to add ESS to the load-path 

It turns out that variable 'ess-directory' already exists and is, according
to the documentation, "the directory ESS is run from".

Thus renaming the variable 'ess-directory' to
'non-in-the-foot-shooting-ess-directory' solves the problem.

Cheers,

Loris

-- 
This signature is currently under construction.




Re: [O] inline markup within quote

2017-04-20 Thread Saša Janiška
Rasmus  writes:

> AFAIK the quote block is irrelevant here.  Perhaps you could customize
> org-emphasis-regexp-components (this will only work if Hugo uses Emacs to
> generate html).

IIRC, Hugo uses native parser for org-mode:

https://github.com/chaseadamsio/goorgeous

> There’s also a thorough  explanation here:
>
> https://emacs.stackexchange.com/a/13828

Thanks a lot for the reference.

> Hope it helps,

Yes, although it seems I might just use AsciiDoc(tor) markup for my
content.


Sincerely,
Gour

-- 
The humble sages, by virtue of true knowledge, see with equal
vision a learned and gentle brāhmana, a cow, an elephant, a dog
and a dog-eater.