Re: [O] org-agenda-filter-effort and "invalid face reference"

2017-01-04 Thread yanmcbe
Wow, this issue comes very close to something I struggled for hours with
(3h42') last year.

It finally boiled down to this: sorting by effort in the agenda view only
works (correctly) when org-agenda-remove-tags is t. Here's the (edited) ECM
I created for IRC and eventually the list: http://paste.lisp.org/+7723

Is that still expected behaviour? Lack of documentation? The updated
org-agenda-compare-effort Nicolas provided doesn't solve this, at least.

Thanks
Yan

On Wed, Jan 4, 2017 at 10:10 PM, wtm  wrote:

> After some additional testing, I was able to isolate the problem:
> org-agenda-filter-by-effort only filtered entries that had no tags or
> tag inheritance.  This leads me to believe that I just don't
> understand how this command, org-agenda-filter-by-effort, is actually
> supposed to work.  If I have an entry like this:
>
> * TODO task 1  :tag:
> :PROPERTIES:
> :Effort: 0:30
> :END:
>
> And one like this:
>
> * TODO task 2
> :PROPERTIES:
> :Effort: 0:30
> :END:
>
> And I've added the org file to the agenda list and created the
> appropriate org-global-properties:
>
> (setq org-global-properties
>   '(("Effort_ALL". "0 0:10 0:30 1:00 2:00 3:00 4:00")))
>
> Shouldn't org-agenda-filter-by-effort set to = "0:30" show both of
> those tasks?  In my case, I'm only seeing this one:
>
> * TODO task 2
> :PROPERTIES:
> :Effort: 0:30
> :END:
>
> On Tue, Jan 3, 2017 at 3:50 PM, wtm  wrote:
> > Thanks, Nicolas.  After adding that code to my config, I tried it
> > again and although the message "invalid face reference" no longer
> > displays, I'm still unable to see any of the entries
> >
> > I also tried it without any custom configuration except the addition
> > of the code you sent.  I had the same result:  no more "invalid face
> > reference" but no display of expected entries after filtering for
> > effort.
> >
> > Perhaps I'm missing something very simple?  If you have any
> > suggestions, I'd love to try them.
> >
> > On Tue, Jan 3, 2017 at 3:29 PM, Nicolas Goaziou 
> wrote:
> >> wtm  writes:
> >>
> >>> I'm installing org-mode from elpa.  Until that update is available
> >>> would using the "org-faces.el" file in the latest git commit
> >>> (http://orgmode.org/w/org-mode.git?p=org-mode.git;a=commit;
> h=3bba31ff44033e895fedd99857363dd5b0586b41)
> >>> work?
> >>
> >> Meanwhile, you only need to put the following somewhere in your config:
> >>
> >>   (defface org-agenda-filter-effort '((t :inherit mode-line))
> >> "Face for effort in the mode-line when filtering the agenda."
> >> :group 'org-faces)
> >>
> >>
> >> Regards,
>
>


Re: [O] speeding up Babel Gnuplot

2017-01-04 Thread Charles C. Berry

On Wed, 4 Jan 2017, Achim Gratz wrote:


Thierry Banel writes:

There is no way to ensure a single call to
(org-babel-gnuplot-process-vars) without modifying ob-core.el. I don't
want to do that because I would have to change a lot of babel backends.


But that is the right fix to apply, unless there is a reason for the
input vars to be processed multiple times.  I haven't looked at the
Babel code in the last two years, but generally I'd suggest that each
argument should only be processed once per Babel block since the second
processing could have unwanted side-effects.



I'm late to this party, but AFAICS input vars are processed just once.

Running this:

#+BEGIN_SRC emacs-lisp :var a=(setq runvar (+ 1 runvar))
a
#+END_SRC

increments runvar by one each time it is run.

So this seems not to be a general babel issue.

??

Chuck



Re: [O] search not found leaves you in target buffer

2017-01-04 Thread Samuel Wales
On 1/4/17, Nicolas Goaziou  wrote:
>> can org be made to stay at the link if the link is broken?
>
> It is not clear to me that would be the best possible behaviour.

example is broken file links.

perhaps following a link could set the org mark so that
org-mark-ring-goto could return?

-- 
The Kafka Pandemic: http://thekafkapandemic.blogspot.com

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

Denmark: free Karina Hansen NOW.
  UPDATE 2016-10: home, but not fully free



Re: [O] Problem with Org-capture mode

2017-01-04 Thread Doyley, Marvin M.
Thanks,
The problem is now solved
It turns out that the problem was yasnippet.
Cheers,
M
On Jan 4, 2017, at 2:30 PM, Kaushal Modi 
> wrote:

You seem to have mixed installations.

org-set-local has been deprecated for a while now.

What are your org and emacs versions?

On Wed, Jan 4, 2017 at 2:23 PM Doyley, Marvin M. 
> wrote:
Hi there,

Org capture template is not working.

I get the following message when I try to use it. Does anybody know how to fix 
this ?

Thanks
M


For information about GNU Emacs and the GNU system, type C-h C-a.
Problems while trying to load feature ‘org-mac-message’
File mode specification error: (void-function org-set-local)
Capture abort: (void-function org-set-local)







--

Kaushal Modi



Re: [O] [PATCH] ox-koma-letter.el: Add support for fromurl variable

2017-01-04 Thread Nicolas Goaziou
Hello,

Grant Rettke  writes:

> The next change that I want to make is to include the description for
> the fromurl like this:
>
> \setkomavar{fromurl}[description]{content}
>
> I haven't figured out how to do that yet.

What is "description" supposed to do?

> Subject: [PATCH] ox-koma-letter.el: Add support for fromurl variable

Thank you.

You need to add :inbuffer-url and :inbuffer-with-url keywords.  See,
e.g., `:inbuffer-phone-number' and `:inbuffer-with-phone'.


Regards,

-- 
Nicolas Goaziou



Re: [O] org-agenda-filter-effort and "invalid face reference"

2017-01-04 Thread wtm
Works perfectly.  Thank you, Nicolas!

On Wed, Jan 4, 2017 at 4:40 PM, Nicolas Goaziou  wrote:
> wtm  writes:
>
>> Wonderful!  Is there any elisp that I could add to my config to test
>> it?  I would love have this capability.
>
> You need to eval
>
>   (defun org-agenda-compare-effort (op value)
> "Compare the effort of the current line with VALUE, using OP.
>   If the line does not have an effort defined, return nil."
> (let ((effort (get-text-property 0 'effort-minutes (org-get-at-bol 
> 'txt
>   (funcall op
>(or effort (if org-sort-agenda-noeffort-is-high 32767 -1))
>value)))
>
> Regards,



Re: [O] org-agenda-filter-effort and "invalid face reference"

2017-01-04 Thread Nicolas Goaziou
wtm  writes:

> Wonderful!  Is there any elisp that I could add to my config to test
> it?  I would love have this capability.

You need to eval

  (defun org-agenda-compare-effort (op value)
"Compare the effort of the current line with VALUE, using OP.
  If the line does not have an effort defined, return nil."
(let ((effort (get-text-property 0 'effort-minutes (org-get-at-bol 'txt
  (funcall op
   (or effort (if org-sort-agenda-noeffort-is-high 32767 -1))
   value)))

Regards,



Re: [O] search not found leaves you in target buffer

2017-01-04 Thread Nicolas Goaziou
Hello,

Samuel Wales  writes:

> when links are followed,

What links? Do you have an example?

> and search not found, you are left at the top
> of the target file.  this makes sense if you intend to search
> manually, but you still have to go back to fix the link.

Or you could want to create the missing link in the target file.

> can org be made to stay at the link if the link is broken?

It is not clear to me that would be the best possible behaviour.

Regards,

-- 
Nicolas Goaziou



Re: [O] org-agenda-filter-effort and "invalid face reference"

2017-01-04 Thread wtm
Wonderful!  Is there any elisp that I could add to my config to test
it?  I would love have this capability.

On Wed, Jan 4, 2017 at 4:31 PM, Nicolas Goaziou  wrote:
> Hello,
>
> wtm  writes:
>
>> After some additional testing, I was able to isolate the problem:
>> org-agenda-filter-by-effort only filtered entries that had no tags or
>> tag inheritance.  This leads me to believe that I just don't
>> understand how this command, org-agenda-filter-by-effort, is actually
>> supposed to work.  If I have an entry like this:
>>
>> * TODO task 1  :tag:
>> :PROPERTIES:
>> :Effort: 0:30
>> :END:
>>
>> And one like this:
>>
>> * TODO task 2
>> :PROPERTIES:
>> :Effort: 0:30
>> :END:
>>
>> And I've added the org file to the agenda list and created the
>> appropriate org-global-properties:
>>
>> (setq org-global-properties
>>   '(("Effort_ALL". "0 0:10 0:30 1:00 2:00 3:00 4:00")))
>>
>> Shouldn't org-agenda-filter-by-effort set to = "0:30" show both of
>> those tasks?  In my case, I'm only seeing this one:
>>
>> * TODO task 2
>> :PROPERTIES:
>> :Effort: 0:30
>> :END:
>
> Good catch. There was an issue in "org-agenda.el". It is now fixed.
> Thank you.
>
> Regards,
>
> --
> Nicolas Goaziou



Re: [O] speeding up Babel Gnuplot

2017-01-04 Thread Nicolas Goaziou
Hello,

Thierry Banel  writes:

>>> (car pair) ;; variable name
>>> -   (let* ((val (cdr pair)) ;; variable value
>>> -  (lp  (listp val)))
>>> - (if lp
>>> +   (let ((val (cdr pair))) ;; variable value
>>> + (if (not (listp val))
>>> + val
>>> +   (let ((temp-file (org-babel-temp-file "gnuplot-"))
>>> + (first  (car val)))
>>> + (setcdr pair temp-file) ;; <-- caching here

[...]

> Your proposal provides an additional benefit: caching file generation
> between several invocations of Babel. (The cache in my patch is intended
> to be used within a single Babel invocation, and is then garbage
> collected.). The drawback is that we need to go through all rows of the
> table, compute the hash, just to discover that the hash was already
> known. The purpose of the cache was precisely to avoid going through the
> table again.

I'm not sure to understand.

I suggest to compute the hash of VAL before it is sent through
`org-babel-gnuplot-table-to-data', i.e., before `orgtbl-to-generic' is
called. There's no "going through the table" involved, is it?

Regards,

-- 
Nicolas Goaziou



Re: [O] editing scheme fragments

2017-01-04 Thread Marco Wahl
Roger Mason  writes:

> Hello Nick,
>
> Nick Dokos  writes:
>
>> Try with a minimal init file, avoiding all your customizations (other than 
>> loadin
>> org and enabling scheme):
>>
>>  emacs -q -l /path/to/minimal/init/file
>>
>> Does it still fail?
>
> Yes, but in trying this out I discovered that the keybinding I read as
> "C-c `" (i.e. backtick) should be "C-c '" (i.e. apostrophe).  When I use
> the correct keybinding it works as advertised.  Gosh.

Haha.

> I apologise for wasting the time of those who read my post and offered
> their suggestions.  Maybe I'm just too old and stunned and in need of
> new spectacles.

You showed at least one reader the C-c ` binding.  How could this be a
waste of time?

AFAICS the C-c ` binding is only useful on tables.  I think I will add a
respective check to help avoid confusion with C-c '.


Best regards




Re: [O] org-agenda-filter-effort and "invalid face reference"

2017-01-04 Thread Nicolas Goaziou
Hello,

wtm  writes:

> After some additional testing, I was able to isolate the problem:
> org-agenda-filter-by-effort only filtered entries that had no tags or
> tag inheritance.  This leads me to believe that I just don't
> understand how this command, org-agenda-filter-by-effort, is actually
> supposed to work.  If I have an entry like this:
>
> * TODO task 1  :tag:
> :PROPERTIES:
> :Effort: 0:30
> :END:
>
> And one like this:
>
> * TODO task 2
> :PROPERTIES:
> :Effort: 0:30
> :END:
>
> And I've added the org file to the agenda list and created the
> appropriate org-global-properties:
>
> (setq org-global-properties
>   '(("Effort_ALL". "0 0:10 0:30 1:00 2:00 3:00 4:00")))
>
> Shouldn't org-agenda-filter-by-effort set to = "0:30" show both of
> those tasks?  In my case, I'm only seeing this one:
>
> * TODO task 2
> :PROPERTIES:
> :Effort: 0:30
> :END:

Good catch. There was an issue in "org-agenda.el". It is now fixed.
Thank you.

Regards,

-- 
Nicolas Goaziou



[O] [PATCH] ox-koma-letter.el: Add support for fromurl variable

2017-01-04 Thread Grant Rettke
Good morning,

I want to use the fromurl variable in KOMA so I copied how the phone
variable works.

The next change that I want to make is to include the description for
the fromurl like this:

\setkomavar{fromurl}[description]{content}

I haven't figured out how to do that yet.

Maybe the simplest thing is to let the user define it as a list with
url and description like this:

#+URL (url description)

The code can check if it a list or not when it generates the LaTeX code.

If this patch is accepted then I will figure out how to update Worg
with the fromurl variable.


0001-ox-koma-letter.el-Add-support-for-fromurl-variable.patch
Description: Binary data


Re: [O] org-agenda-filter-effort and "invalid face reference"

2017-01-04 Thread wtm
After some additional testing, I was able to isolate the problem:
org-agenda-filter-by-effort only filtered entries that had no tags or
tag inheritance.  This leads me to believe that I just don't
understand how this command, org-agenda-filter-by-effort, is actually
supposed to work.  If I have an entry like this:

* TODO task 1  :tag:
:PROPERTIES:
:Effort: 0:30
:END:

And one like this:

* TODO task 2
:PROPERTIES:
:Effort: 0:30
:END:

And I've added the org file to the agenda list and created the
appropriate org-global-properties:

(setq org-global-properties
  '(("Effort_ALL". "0 0:10 0:30 1:00 2:00 3:00 4:00")))

Shouldn't org-agenda-filter-by-effort set to = "0:30" show both of
those tasks?  In my case, I'm only seeing this one:

* TODO task 2
:PROPERTIES:
:Effort: 0:30
:END:

On Tue, Jan 3, 2017 at 3:50 PM, wtm  wrote:
> Thanks, Nicolas.  After adding that code to my config, I tried it
> again and although the message "invalid face reference" no longer
> displays, I'm still unable to see any of the entries
>
> I also tried it without any custom configuration except the addition
> of the code you sent.  I had the same result:  no more "invalid face
> reference" but no display of expected entries after filtering for
> effort.
>
> Perhaps I'm missing something very simple?  If you have any
> suggestions, I'd love to try them.
>
> On Tue, Jan 3, 2017 at 3:29 PM, Nicolas Goaziou  
> wrote:
>> wtm  writes:
>>
>>> I'm installing org-mode from elpa.  Until that update is available
>>> would using the "org-faces.el" file in the latest git commit
>>> (http://orgmode.org/w/org-mode.git?p=org-mode.git;a=commit;h=3bba31ff44033e895fedd99857363dd5b0586b41)
>>> work?
>>
>> Meanwhile, you only need to put the following somewhere in your config:
>>
>>   (defface org-agenda-filter-effort '((t :inherit mode-line))
>> "Face for effort in the mode-line when filtering the agenda."
>> :group 'org-faces)
>>
>>
>> Regards,



Re: [O] speeding up Babel Gnuplot

2017-01-04 Thread Thierry Banel
Le 04/01/2017 18:32, Achim Gratz a écrit :
> Thierry Banel writes:
>> There is no way to ensure a single call to
>> (org-babel-gnuplot-process-vars) without modifying ob-core.el. I don't
>> want to do that because I would have to change a lot of babel backends.
> But that is the right fix to apply, unless there is a reason for the
> input vars to be processed multiple times.  I haven't looked at the
> Babel code in the last two years, but generally I'd suggest that each
> argument should only be processed once per Babel block since the second
> processing could have unwanted side-effects.
>
>

Absolutely! But not so easy.

Here is a simplified version of the involved functions:

#+BEGIN_SRC elisp
(defun org-babel-expand-body:gnuplot (body params)
   (let ((vars (org-babel-gnuplot-process-vars params))) ;; <-- 1st call
   (org-babel-variable-assignments:gnuplot params)))

(defun org-babel-variable-assignments:gnuplot (params)
   (org-babel-gnuplot-process-vars params))  ;; <-- 2nd call

(defun org-babel-gnuplot-process-vars (params)
  (... generate temp file ...))
#+END_SRC

Following the flow of calls, we can see that starting from
(org-babel-expand-body:gnuplot), the function
(org-babel-gnuplot-process-vars) is called twice.

I would like to pass `vars' around (which is the result of the first
call) to avoid the second call. To do that I need to add a parameter
`vars' to (org-babel-variable-assignments:gnuplot). Unfortunately I
cannot because the parameter of this function (and all functions
matching (org-babel-variable-assignments:*)) is enforced by the Babel core.

Therefore to pass information around, the only channel is the `params'
parameter. I use it as a cache in my patch.

Moreover, the above simplified ELisp sketch is not the whole story.
There is also the (org-babel-prep-session:gnuplot) function involved. I
have not yet investigated that. But, the `params' cache trick takes care
of this flow without having to understand it.

To sum-up: yes, ob-gnuplot.el is doing the double `params' processing.
But to avoid that without the cache trick, ob-core.el should be changed,
as well as all dependent ob-*.el backends. Lot of work. Or I may be
missing something...

Regards
Thierry




Re: [O] Problem with Org-capture mode

2017-01-04 Thread Doyley, Marvin M.
Here is the backtrace
Debugger entered--Lisp error: (void-function org-set-local)
  (org-set-local (quote yas/trigger-key) [tab])
  (lambda nil (org-set-local (quote yas/trigger-key) [tab]) (define-key 
yas/keymap [tab] (quote yas/next-field-or-maybe-expand)))()
  run-hooks(change-major-mode-after-body-hook text-mode-hook outline-mode-hook 
org-mode-hook)
  apply(run-hooks (change-major-mode-after-body-hook text-mode-hook 
outline-mode-hook org-mode-hook))
  run-mode-hooks(org-mode-hook)
  org-mode()
  set-auto-mode-0(org-mode nil)
  set-auto-mode()
  normal-mode(t)
  after-find-file(nil t)
  find-file-noselect-1(# 
"~/Org-files/General/Master-todo.org" nil nil 
"~/Dropbox/Filing_Cabinet/O/Org-files/General/Master-todo.org" (31210154 
16777218))
  find-file-noselect("/Users/doyley/Org-files/General/Master-todo.org")
  org-capture-target-buffer("~/Org-files/General/Master-todo.org")
  org-capture-set-target-location()
  org-capture(nil "t")
  (lambda (template-shortcut) (org-capture nil template-shortcut))("t")
  helm-execute-selection-action-1()
  helm-execute-selection-action()
  #[0 "\311\211\211\211\305\206\n

Re: [O] Problem with Org-capture mode

2017-01-04 Thread Kaushal Modi
You seem to have mixed installations.

org-set-local has been deprecated for a while now.

What are your org and emacs versions?

On Wed, Jan 4, 2017 at 2:23 PM Doyley, Marvin M. 
wrote:

> Hi there,
>
> Org capture template is not working.
>
> I get the following message when I try to use it. Does anybody know how to
> fix this ?
>
> Thanks
> M
>
>
> For information about GNU Emacs and the GNU system, type C-h C-a.
> Problems while trying to load feature ‘org-mac-message’
> File mode specification error: (void-function org-set-local)
> Capture abort: (void-function org-set-local)
>
>
>
>
>
>
>
> --

Kaushal Modi


[O] Problem with Org-capture mode

2017-01-04 Thread Doyley, Marvin M.
Hi there,

Org capture template is not working.

I get the following message when I try to use it. Does anybody know how to fix 
this ?

Thanks
M


For information about GNU Emacs and the GNU system, type C-h C-a.
Problems while trying to load feature ‘org-mac-message’
File mode specification error: (void-function org-set-local)
Capture abort: (void-function org-set-local)









signature.asc
Description: Message signed with OpenPGP using GPGMail


Re: [O] editing scheme fragments

2017-01-04 Thread Roger Mason
Hello Nick,

Nick Dokos  writes:

> Try with a minimal init file, avoiding all your customizations (other than 
> loadin
> org and enabling scheme):
>
>  emacs -q -l /path/to/minimal/init/file
>
> Does it still fail?

Yes, but in trying this out I discovered that the keybinding I read as
"C-c `" (i.e. backtick) should be "C-c '" (i.e. apostrophe).  When I use
the correct keybinding it works as advertised.  Gosh.

I apologise for wasting the time of those who read my post and offered
their suggestions.  Maybe I'm just too old and stunned and in need of
new spectacles.

Thanks for your help,
Roger



Re: [O] editing scheme fragments

2017-01-04 Thread Nick Dokos
Roger Mason  writes:

> Hello Marco,
>
> Marco Wahl  writes:
>
>> Guess: You should add scheme to org-babel-load-languages.  E.g. use M-x
>> customize-variable.
>
> Sorry, i should have mentioned that I tried that customisation without
> success.
>
> Cheers,
> Roger
>
>
Try with a minimal init file, avoiding all your customizations (other than 
loadin
org and enabling scheme):

 emacs -q -l /path/to/minimal/init/file

Does it still fail?

-- 
Nick




Re: [O] editing scheme fragments

2017-01-04 Thread Roger Mason
Hi Eric,

Eric S Fraga  writes:

> Works fine for me with later version of org (and emacs).

Unfortunately, updating to Org mode version 9.0.3
(release_9.0.3-170-gfed1cf) did not make any difference.

Cheers,
Roger



Re: [O] mark as done on a previous date?

2017-01-04 Thread Marco Wahl
> Interesting. I couldn't get yours to work as I expected either, and
> decided to try =org-todo-yesterday=, and couldn't get _that_ to work as
> I expected either, which I thought was strange so I dug a bit deeper. I
> tested with =emacs -q foo.org= and added the following entry (I did this
> on the 30th of December):
>
> ,
> | * TODO Testing 123
> |   SCHEDULED: <2016-12-27 Tue .+1m>
> |   :PROPERTIES:
> |   :STYLE:habit
> |   :END:
> `
>
> After using =org-todo-yesterday= I ended up with:
>
> ,
> | * TODO Testing 123
> |   SCHEDULED: <2017-01-29 Sun .+1m>
> |   - State "DONE"   from "TODO"   [2016-12-30 Fri 16:29]
> |   :PROPERTIES:
> |   :STYLE:habit
> |   :LAST_REPEAT: [2016-12-30 Fri 16:29]
> |   :END:
> `
>
> I now see (finally!) that the *re-scheduling* works as I would expect,
> but the LAST_REPEAT and state change logging still uses the actual time.
> I would have expected both those to use the 29th rather than the 30th as
> well. Perhaps this is just my expectation that needs adjusting, but this
> breaks org-habit's graphing of my consistency. Perhaps I just have to
> get in the habit of ticking stuff off on the day I do them... :-)

Hi Stig,

I think your expectation is right.  There is another thread in this
mailing list about the same topic AFAICT.  Hopefully something reliable
will emerge.


Ciao




Re: [O] editing scheme fragments

2017-01-04 Thread Roger Mason
Hello Marco,

Marco Wahl  writes:

> Guess: You should add scheme to org-babel-load-languages.  E.g. use M-x
> customize-variable.

Sorry, i should have mentioned that I tried that customisation without
success.

Cheers,
Roger



Re: [O] editing scheme fragments

2017-01-04 Thread Roger Mason
Hello John,

John Kitchin  writes:

> I can't reproduce that. I wonder if you should try running 
> org-element-cache-reset Sometimes I
> have seen org get confused when the cache is out of date. this usually 
> happens when I have code
> that generates parts of the file.

Thanks for the suggestion.  Unfortunately there is no change after
running that command.

Cheers,
Roger



Re: [O] speeding up Babel Gnuplot

2017-01-04 Thread Achim Gratz
Thierry Banel writes:
> There is no way to ensure a single call to
> (org-babel-gnuplot-process-vars) without modifying ob-core.el. I don't
> want to do that because I would have to change a lot of babel backends.

But that is the right fix to apply, unless there is a reason for the
input vars to be processed multiple times.  I haven't looked at the
Babel code in the last two years, but generally I'd suggest that each
argument should only be processed once per Babel block since the second
processing could have unwanted side-effects.


Regards,
Achim.
-- 
+<[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]>+

Factory and User Sound Singles for Waldorf rackAttack:
http://Synth.Stromeko.net/Downloads.html#WaldorfSounds




[O] automatically updating a table (including adding rows)

2017-01-04 Thread yanmcbe
Hi

I have a bit of a rambling question. I'd like to have a table to which I
can decide to have a row added which contains a value computed from a
columnview table (the ratio of time logged over the total amount of
Effort). That's the main goal, but since it doesn't work like I want, I'm
looking for some general advice as well (e.g. on TBLFM lines using lisp
forms).

I have created a MCE at http://paste.lisp.org/+771D

Hopefully some of the gotchas I encountered are clearly explained there.
Please let me know if you read all of this and didn't understand what I'm
asking for specifically!

Thanks!

Kind regards
Yan


Re: [O] Slow usage of capture templates

2017-01-04 Thread Nick Dokos
Johan Ekh  writes:

> Hi all
>
> I'm on Windows 10 with Cygwin-X and running Emacs 25.1.1 installed with 
> Cygwin installer. Org-mode version is 9.0 installed from Elpa.
>
> I am experiencing very slow usage of my capture templates. When I hit C-c c 
> my different templates show up but when I select one of them nothing happens 
> for a long time then after 30-60
> seconds it suddenly works as usual. This happens every time regardless of 
> which template I select.
>
> When I start emacs without X, i.e. with the -nw flag, my capture templates 
> works fast as usual.
>
> Does anyone know what I need to do?
>
> BR / Johan
>

First step is to probably profile org and see where time is spent:

M-x elp-instrument package RET org RET
... then try a capture ...
M-x elp-results

Second step is to bring up a terminal and run htop in it, then try a capture 
and see if
some process (maybe emacs, maybe something else) jumps up in CPU usage.

Also try with a minimal org file and no other customizations: it may be that 
something
in your configuration causes it (unless others can see the same slowness on 
similar systems).

This kind of problem may take a long time to debug, so it's important not to 
get discouraged.

-- 
Nick




Re: [O] Avoid add-to-list on local variables

2017-01-04 Thread Kyle Meyer
Hello,

Kaushal Modi  writes:

> Hi all,
>
> I just noticed this commit on emacs master branch:

[...]

> So I believe that these changes should be back-ported into the master
> branch of org too?

Thanks for the heads up.  Those changes should be considered.

I backport Org-related changes from the Emacs repo on a regular basis.
Because I do these checks weekly rather daily, I'd appreciate if you'd
wait some time before reporting changes that should be backported but
haven't.

--
Kyle



Re: [O] Org-mode and/or org-ref citation formats

2017-01-04 Thread John Kitchin

Gerald Wildgruber writes:

> Hi,
>
> I'm about to migrate my entire LaTeX document setup to Org-mode and the
> one point in this process that is more complicated than every other is
> the bibliography system.
>
> In LaTeX I was using BibTeX/biblatex with lots of coomands like:
>
> \cite[PAGENUM]{MYREF} or \footcite[PRENOTE][POSTNOTE]{MYREF}
>
> What would be a convenient way to migrate documents containing such
> references to something more native within Org-mode?
>
> If I understood correctly there is still no real native Org-mode
> citation syntax; is that true?
>
> So the alternative would be
>
> 1) using raw inline LaTeX Code in Org-mode with RefTeX
> 2) using John Kitchin's org-ref package
>
> I tried org-ref and indeed it looks very promising with lots of extra
> features like mouse-over resolution of references and so on, -- but I
> fail to understand the syntax of org-ref formatted links.
>
> A simple link would be of the form "cite:MYREF" or "citep:MYREF"; but if
> I want to add a page number to this reference, the syntax of the link
> seems to be very different, like so: "[[citep:MYREF][PAGENUM]]" or
> [[citep:MYREF][::PAGENUM]].

That is correct. Basically it is [[cite:key][pre text::post text]]
>
>
> 1) is this in fact the correct format in org-ref, where is this
> documented?

You can run M-x org-ref-help to get the manual for org-ref. It is
described near the end in this section:

https://github.com/jkitchin/org-ref/blob/master/org-ref.org#citations


> 2) how can I insert links like that in an org-mode buffer (other than
> manually)?

You can type C-c C-l, select the link type, then the bibtex key, then
type in the description. There is no way to do it through helm-bibtex though.

> 3) do they export correctly to other formats (like docx)?

Probably not to docx. There are exports defined for ’html, ’latex,
’ascii, ’org, ’md, and ’pandoc.  HTML works pretty well, LaTeX works, 

> 4) is there a way to convert LaTeX code to the org-ref citation
> format?

Not that I know of. 

>
> Thanks
>
> Gerald


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



[O] Org-mode and/or org-ref citation formats

2017-01-04 Thread Gerald Wildgruber

Hi,

I'm about to migrate my entire LaTeX document setup to Org-mode and the
one point in this process that is more complicated than every other is
the bibliography system.

In LaTeX I was using BibTeX/biblatex with lots of coomands like:

\cite[PAGENUM]{MYREF} or \footcite[PRENOTE][POSTNOTE]{MYREF}

What would be a convenient way to migrate documents containing such
references to something more native within Org-mode?

If I understood correctly there is still no real native Org-mode
citation syntax; is that true?

So the alternative would be

1) using raw inline LaTeX Code in Org-mode with RefTeX
2) using John Kitchin's org-ref package

I tried org-ref and indeed it looks very promising with lots of extra
features like mouse-over resolution of references and so on, -- but I
fail to understand the syntax of org-ref formatted links.

A simple link would be of the form "cite:MYREF" or "citep:MYREF"; but if
I want to add a page number to this reference, the syntax of the link
seems to be very different, like so: "[[citep:MYREF][PAGENUM]]" or
[[citep:MYREF][::PAGENUM]].


1) is this in fact the correct format in org-ref, where is this documented?
2) how can I insert links like that in an org-mode buffer (other than manually)?
3) do they export correctly to other formats (like docx)?
4) is there a way to convert LaTeX code to the org-ref citation format?

Thanks

Gerald



Re: [O] editing scheme fragments

2017-01-04 Thread Marco Wahl
Hello!

> When I try to edit a scheme fragment such this
>
> Header:
>
> #+BEGIN_SRC scheme :tangle "header.skb" 
> (document :title [A First Skribilo Block]
>   :author [Roger Mason]
> #+END_SRC
>
> using C-c ', org thinks it is an org table.

Here org thinks it's scheme.

> [...]
> Any help in tracking this down would be much appreciated.

Guess: You should add scheme to org-babel-load-languages.  E.g. use M-x
customize-variable.


HTH




Re: [O] editing scheme fragments

2017-01-04 Thread John Kitchin
I can't reproduce that. I wonder if you should try running
org-element-cache-reset Sometimes I have seen org get confused when the
cache is out of date. this usually happens when I have code that generates
parts of the file.


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 Wed, Jan 4, 2017 at 8:11 AM, Roger Mason  wrote:

> Hello,
>
> When I try to edit a scheme fragment such this
>
> Header:
> #+BEGIN_SRC scheme :tangle "header.skb"
> (document :title [A First Skribilo Block]
>   :author [Roger Mason]
> #+END_SRC
>
> using C-c ', org thinks it is an org table.
>
> I am using GNU Emacs 25.1.1 (i386-portbld-freebsd10.1, GTK+ Version
> 2.24.29) of 2016-11-04 and Org mode version 9.0.1
> (release_9.0.1-47-gb06259)
>
> Any help in tracking this down would be much appreciated.
>
> Thanks,
> Roger
>
>


[O] Avoid add-to-list on local variables

2017-01-04 Thread Kaushal Modi
Hi all,

I just noticed this commit on emacs master branch:

http://git.savannah.gnu.org/cgit/emacs.git/commit/?id=2ec41c415f39990561cc9da4c9bad0b69bfad489

The commit touches these parts of org:

Avoid add-to-list on local variables
* lisp/org/org-archive.el (org-all-archive-files): * lisp/org/org-agenda.el
(org-agenda-get-restriction-and-command): Avoid add-to-list on local
variables. * lisp/org/ox-publish.el (org-publish--run-functions): New
function. (org-publish-projects): Use it to avoid run-hooks on a local
variable. (org-publish-cache-file-needs-publishing): Avoid add-to-list on
local variables.

So I believe that these changes should be back-ported into the master
branch of org too?
-- 

Kaushal Modi


Re: [O] editing scheme fragments

2017-01-04 Thread Eric S Fraga
On Wednesday,  4 Jan 2017 at 13:11, Roger Mason wrote:
> Hello,
>
> When I try to edit a scheme fragment such this
>
> Header:
>
> #+BEGIN_SRC scheme :tangle "header.skb" 
> (document :title [A First Skribilo Block]
>   :author [Roger Mason]
> #+END_SRC
>
> using C-c ', org thinks it is an org table.

Works fine for me with later version of org (and emacs).

-- 
: Eric S Fraga (0xFFFCF67D), Emacs 26.0.50.1, Org release_9.0.2-104-gf5b7de


signature.asc
Description: PGP signature


[O] editing scheme fragments

2017-01-04 Thread Roger Mason
Hello,

When I try to edit a scheme fragment such this

Header:
#+BEGIN_SRC scheme :tangle "header.skb" 
(document :title [A First Skribilo Block]
  :author [Roger Mason]
#+END_SRC

using C-c ', org thinks it is an org table.

I am using GNU Emacs 25.1.1 (i386-portbld-freebsd10.1, GTK+ Version
2.24.29) of 2016-11-04 and Org mode version 9.0.1
(release_9.0.1-47-gb06259)

Any help in tracking this down would be much appreciated.

Thanks,
Roger



Re: [O] doing something yesterday?

2017-01-04 Thread Marco Wahl
Hi!

> I have a number of habits I keep track of in Org, with repeat TODO:s.
> They should be done every day.
>
> Quite often I want to change the "DONE" date from today to yesterday.
>
> As it is now, I manually change the done date and the next date.
>
> Can I achive this automatically somehow, by advicing some function
> perhaps?

There has been a similar question a few days ago and I did some
research...

There is already `org-todo-yesterday'.  Unfortunately the function does
not care about property LAST_REPEAT which is relevant for tracking
habits.  Further note that `org-todo-yesterday' relies on variable
`org-extend-today-until'.

Another approach is to advice `current-time' to use a certain time.
This looks promising AFAICS.

The setting of property LAST_REPEAT is not dependend on `current-time'
yet, though.  This coulb be changed in the Org sources e.g. like:

#+begin_src diff
modified   lisp/org.el
@@ -13220,7 +13220,8 @@ This function is run automatically after each state 
change to a DONE state."
(org-todo to-state))
   (when (or org-log-repeat (org-entry-get nil "CLOCK"))
(org-entry-put nil "LAST_REPEAT" (format-time-string
- (org-time-stamp-format t t
+ (org-time-stamp-format t t)
+ (current-time
   (when org-log-repeat
(if (or (memq 'org-add-log-note (default-value 'post-command-hook))
(memq 'org-add-log-note post-command-hook))
#+end_src

The interface could be set and unset the advice for `current-time'.

E.g.

;; #+BEGIN_SRC emacs-lisp
(let (freeze-time-day)
  (defun freeze-time-adviser (x)
(append (date-to-time (concat freeze-time-day " 11:55")) (list 0 0)))

  (defun freeze-time-unfreeze ()
(interactive)
(if (advice-member-p #'freeze-time-adviser #'current-time)
(advice-remove #'current-time #'freeze-time-adviser)))

  (defun freeze-time-to (-mm-dd-date-string)
"Advice `current-time' to return time -MM-DD-DATE-STRING at 11:55am."
(interactive (list (org-read-date)))
(freeze-time-unfreeze)
(setf freeze-time-day -mm-dd-date-string)
(advice-add #'current-time :filter-return #'freeze-time-adviser)))
;; #+END_SRC

(From https://github.com/marcowahl/little-helpers/blob/master/little-helpers.el)

Does this sound reasonable?


Best regards

   Marco




[O] doing something yesterday?

2017-01-04 Thread joakim
Hello,

I have a number of habits I keep track of in Org, with repeat TODO:s.
They should be done every day.

Quite often I want to change the "DONE" date from today to yesterday.

As it is now, I manually change the done date and the next date.

Can I achive this automatically somehow, by advicing some function
perhaps?


-- 
Joakim Verona
joa...@verona.se




[O] Slow usage of capture templates

2017-01-04 Thread Johan Ekh
Hi all

I'm on Windows 10 with Cygwin-X and running Emacs 25.1.1 installed with
Cygwin installer. Org-mode version is 9.0 installed from Elpa.

I am experiencing very slow usage of my capture templates. When I hit C-c c
my different templates show up but when I select one of them nothing
happens for a long time then after 30-60 seconds it suddenly works as
usual. This happens every time regardless of which template I select.

When I start emacs without X, i.e. with the -nw flag, my capture templates
works fast as usual.

Does anyone know what I need to do?

BR / Johan