[O] org-open-at-point calls visit-tags-table ?!?

2019-01-17 Thread David Masterson
I have various Org files with internal hyperlinks of the form
[[#mylink][My Link]] that should point to a header with the appropriate
CUSTOM_ID property that I've setup.  For some reason that I can't figure
out, when I call org-open-at-point (C-c C-o) on the link, it tries to
open a tags table (visit-tags-table) which is not what I expected.  Does
anyone know why?  I'm suspicious that I have a conflicting MELPA package
for Org of some sort, but I don't know where to start to debug this.
What's the safest way of turning off the packages in .emacs.d/elpa?  Can
I just move the elpa directory for testing purposes and then move it
back later?

--
David



Re: [O] open link in source code block

2019-01-17 Thread Win Treese



> On Jan 17, 2019, at 1:38 PM, Berry, Charles  wrote:
> 
> TL;DR: "org-open-at-point calls org-babel-open-src-block-result first thing" 
> is not true.
> 
> The `unless' COND argument starting around line 5 of the code of 
> `org-open-at-point' runs the hooks in `org-open-at-point-functions'. 
> 
> If any hook returns a non-nil then `run-hook-with-args-until-success' returns 
> the value and the BODY forms will not be run.
> 
> For example, this: 
> 
>   ((eq type 'src-block) (org-babel-open-src-block-result))
> 
> is part of a BODY form and can only run if all those hooks return nil (or if 
> there is no hook).
> 
> The code I provided works as advertised.
> 
> HTH,
> 
> Chuck
> 
> p.s. I am using Org mode version 9.2 (release_9.2-193-ge7901c...

Chuck,

Thanks for the help. I seem to have had a problem that crept into the code 
sometime in the past month or so, was true at least as of version 9.1.14, but 
now works as you described in version 9.2, which I have now installed. I had 
thought I was working with the current released version, but I was apparently 
wrong about that.

I appreciate the help, and sorry for the trouble.

Best,

Win




Re: [O] Bug: org-capture with template for a table

2019-01-17 Thread Thomas Holst
Hello,

· Nicolas Goaziou  wrote:

> Thomas Holst  writes:
>
>> recently I encountered a bug with capturing table lines. Here is a ECM
>> to reproduce it:
>>
> [...]
>
> Fixed. Thank you.

thank you! Works perfectly again.

-- 
Bis neulich ...
  Thomas



Re: [O] open link in source code block

2019-01-17 Thread Berry, Charles


> On Jan 16, 2019, at 3:43 PM, Win Treese  wrote:
> 
> [Quoting trimmed for the most relevant context.]
> 
>> On Jan 11, 2019, at 7:12 PM, Berry, Charles  wrote:
>> 
>>> On Jan 5, 2019, at 7:41 AM, Win Treese  wrote:
>>> 
 On Jan 5, 2019, at 5:25 AM, Eric S Fraga  wrote:
 
 On Friday,  4 Jan 2019 at 19:38, Win Treese wrote:
> Suppose I have the following Org file contents:
> 
> * test
> 
> #+BEGIN_SRC emacs-lisp
> (setq yyy 3)
> ;; See https://www.gnu.org
> #+END_SRC
> 
> The URL for gnu.org is highlighted as a clickable link. But if I click
> it, the source block is evaluated. This seems rather unexpected,
> especially since my intention was to open the link.
 
 Probably expected albeit maybe not your preferred behaviour; all about
 precedence.  In any case, I would suggest that the easy solution would
 be to move such links out of the src block. 
> 
>>> This seems like a slightly bigger problem, though: clicking on a highlighted
>>> link doesn’t just fail to open the link, it executes the source block, 
>>> which can
>>> have very unintended side effects.
>>> 
>>> I wonder if the issue is an artifact of implementation rather than 
>>> intentional
>>> design: org-open-at-mouse sets point to the location of the click and then
>>> calls org-open-at-point. The documentation at points says that C-c C-o in 
>>> a source block opens the results of evaluation (fair enough, although the
>>> docstring does not).
>>> 
>>> So the problem seems to be about the mouse click behavior, not the basic
>>> function of org-open-at-point.
>> 
>> AFAICS, the issue is with org-open-at-point.
>> 
>> If you really want to `fix' this, there is a hook that allows customization 
>> of the behavior of org-open-at-point.
>> 
>> This snippet will add a function to that hook that will attempt to follow a 
>> link, when you click on a link in a src-block:
> 
> [Example code with function added to org-open-at-point-functions elided.]
> 
> Chuck,
> 
> Thanks for the code. You’re right—the proximate problem is in 
> org-open-at-point.
> Unfortunately, org-open-at-point calls org-babel-open-src-block-result first 
> thing,
> wrapped by unless, before it gets to running the hook.


TL;DR: "org-open-at-point calls org-babel-open-src-block-result first thing" is 
not true.

The `unless' COND argument starting around line 5 of the code of 
`org-open-at-point' runs the hooks in `org-open-at-point-functions'. 

If any hook returns a non-nil then `run-hook-with-args-until-success' returns 
the value and the BODY forms will not be run.

For example, this: 

((eq type 'src-block) (org-babel-open-src-block-result))

is part of a BODY form and can only run if all those hooks return nil (or if 
there is no hook).

The code I provided works as advertised.

HTH,

Chuck

p.s. I am using Org mode version 9.2 (release_9.2-193-ge7901c...

Re: [O] org-mime-htmlize ignores org-mime-export-options

2019-01-17 Thread Uwe Brauer
>>> "UB" == Uwe Brauer  writes:

   > Please look at the following

   > * Lisp :noexport:
   >(setq org-mime-export-options '(:section-numbers nil
   >:with-author nil
   >:with-toc nil))


This is a typo :with-toc t

Is what I have set and it does not work

Uwe Brauer 


smime.p7s
Description: S/MIME cryptographic signature


[O] org-mime-htmlize ignores org-mime-export-options

2019-01-17 Thread Uwe Brauer


Please look at the following

* Lisp :noexport:
   (setq org-mime-export-options '(:section-numbers nil
   :with-author nil
   :with-toc nil))

* Test 

Bblabla

When I run org-mime-htmlize then *no* toc is generated, contrary to the
setting.

Anybody has tried that out?

Regards

Uwe Brauer 




Re: [O] recent org-mode changes: completion of repeated tasks reports "10 repeater intervals were not enough to shift date past today"

2019-01-17 Thread Daniel Ortmann
Another task which gives the same message with SCHEDULED instead of
DEADLINE; this one also uses "++" to repeat dates but with no "-0d". 
The result looks correct; only the message is bothersome.

I replied to the message 'y' twice and then 'n' to test the resulting
change.  Changes look fine:





>From *Messages*:
10 repeater intervals were not enough to shift date past today. 
Continue? (y or n) y [2 times]
10 repeater intervals were not enough to shift date past today. 
Continue? (y or n) n
And later
Entry repeats: SCHEDULED: <2019-01-17 Thu 07:50 .+1d> Plain: [2019-01-17
Thu 07:50 .+1d] Plain: [2019-01-17 Thu 07:50 .+1d]


Here is the task:

** TODO one-on-one   :meeting:
   SCHEDULED: <2019-01-23 Wed 13:30-14:00 ++1w>
   :PROPERTIES:
   :LAST_REPEAT: [2019-01-17 Thu 10:39]
   :END:
   :LOGBOOK:
   - State "CANCELED"   from "TODO"   [2019-01-17 Thu 10:39]
   - State "DONE"   from "TODO"   [2019-01-09 Wed 14:14]
...
   :END:


On 1/15/19 8:43 AM, Bernt Hansen wrote:
> Daniel Ortmann  writes:
>
>> No other tasks.  Here is the complete text with only one url removed:
>>
>> * TODO [#C] p6 time entry
>>   DEADLINE: <2019-01-18 Fri ++1w -0d>
>>   :PROPERTIES:
>>   :LAST_REPEAT: [2019-01-11 Fri 17:03]
>>   :END:
>>   :LOGBOOK:
>>
> 
>
>> On 1/13/19 10:12 AM, Bernt Hansen wrote:
>>
>> Daniel Ortmann  writes:
>>
>> I have a weekly scheduled task with ...
>>   DEADLINE: <2019-01-18 Fri ++1w -0d>
>> 
>> Recently, when I complete the task it reports the following:
>> 
>> Clock stopped at [2019-01-11 Fri 17:03] after 0:05
>> 10 repeater intervals were not enough to shift date past today. 
>> Continue? (y or n) n
>> 
>> Thoughts?
>> 
>> Hi Daniel,
>> 
>> Do you have some other repeating timestamp buried somewhere in that
>> task?  It is probably moving that one forward and it is the one that
>> needs more than 10 repeats to become current.
>> 
>> There was a recent change that updates all repeating timestamps in the
>> task.
>> 
>> Regards,
>> Bernt
> Sorry I can't reproduce what you are seeing.
>
> Regards,
> Bernt
>
>



Re: [O] Bug: org-capture with template for a table

2019-01-17 Thread Nicolas Goaziou
Hello,

Thomas Holst  writes:

> recently I encountered a bug with capturing table lines. Here is a ECM
> to reproduce it:
>
> - org-mode file (testing.org):
>
> #+begin_src org
> * Headline
> |---+--+|
> |   | Name | Amount |
> |---+--+|
> |---+--+|
> |   |  ||
> |---+--+|
> #+TBLFM: @2$3=vsum(@-II..@-I);%.2f
> #+end_src

[...]

> When I evaluate capture template I get following result:
>
> #+begin_src org
> * Headline
> |---+--+|
> |   | Name | Amount |
> |---+--+|
> | # |  |  33.00 |
>
> |---+---+---|
> |   |   |   |
> |---+---+---|
> #+TBLFM: @2$3=vsum(@-II..@-I);%.2f
> #+end_src

Fixed. Thank you.

Regards,

-- 
Nicolas Goaziou



Re: [O] How to get ordinal of an element in the subtree when exporting?

2019-01-17 Thread Kaushal Modi
On Thu, Jan 17, 2019 at 8:21 AM mgcyung  wrote:

>
> The function "org-export-get-ordinal" returns the ordinal of an element
> in the whole file. How to get ordinal of an element in the subtree when
> exporting?
>

Do you mean you want the ordinal counting to reset when the subtree begins?
In that case, export with the subtree scope: C-c C-e C-s ..


[O] How to get ordinal of an element in the subtree when exporting?

2019-01-17 Thread mgcyung


The function "org-export-get-ordinal" returns the ordinal of an element
in the whole file. How to get ordinal of an element in the subtree when
exporting?


--
mgcyung