[O] Should org-insert-todo-heading be a state change?

2017-07-13 Thread Allen Li
Org mode allows logging timestamps and making notes when changing to a
TODO keyword:

   TODO(!) | DONE(!)

However, org-insert-todo-heading does not respect this.

I'm wondering whether it should.  For example, given the above
keywords, the intent would most likely be to log when TODO headings
are created and when they are marked finished.

If one were to create a heading and mark it TODO using C-c C-t, then
the state change would be logged.  In other words, making a heading a
TODO entry is considered a state change from " " to "some todo
keyword".

However, if one were to use C-S-RET, the new TODO heading would not
have a timestamp logged.

I can't think of a situation where the current behavior is desirable,
so I am inclined to think that treating the creation of a TODO heading
as a state change from a normal heading to a TODO heading would be
more convenient.



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

2017-07-13 Thread Grant Rettke
On Mon, Jan 9, 2017 at 3:42 AM, Rasmus  wrote:

> The default description is "Url" and it does not have a corresponding
> "symbolicname".
>
> In general, descriptors are used in headers or footers which would
> typically be set up in a separate LCO file, I’d guess.  E.g.
>
>   \ifkomavarempty{fromurl}{}{\usekomavar*{fromurl}\usekomavar{fromurl}}

I set it in the LCO file like this

\setkomavar{fromurl}{\href{the ur}{the description}}

And then enable/disable or override it in the Org document.



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

2017-07-13 Thread Grant Rettke
On Wed, Jan 4, 2017 at 4:57 PM, Nicolas Goaziou  wrote:
> 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'.

Gotcha. Attached.


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


Re: [O] ob-clojure will error result when contains comment

2017-07-13 Thread Tim Cross
Your second block can't run in a repl unless you have additional
definitions you are not showing here. The error messages are complaining
that

1. There is no function called sum. Clojure does not have a sum function
and your not defining one in this block, so that makes perfect sense.

2. The function avg1 is unbound. This also makes perfect sense because the
line where you try to bind avg1 is the same line where the error about sum
is generated, which means that binding failed.

The additional settings you are using might be contributing to your
problems - I don't know I don't have any additional default header args. I
would remove them and only set them once you know you have things working
with normal/standard src block settings.

The fact I cannot reproduce your errors with a stock setup indicates the
problem is still something with your environment.

On 13 July 2017 at 22:23, numbch...@gmail.com  wrote:

> I run the both blocks fine in CIDER REPL, that's weird.
> I have the following special settings for ob-clojure.
> ```elisp
> (add-to-list 'org-babel-default-header-args:clojure
>  '(:eval . "yes"))
> (add-to-list 'org-babel-default-header-args:clojure
>  '(:results . "value pp"))
> (add-to-list 'org-babel-default-header-args:clojure ; for Clojure
> `dotimes' etc.
>  '(:show-process . "no"))
> (add-to-list 'org-babel-default-header-args:clojure
>  '(:noweb . "yes"))
> ```
>
>
> [stardiviner] GPG key ID: 47C32433
> IRC(freeenode): stardiviner Twitter:  @numbchild
> Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
> Blog: http://stardiviner.github.io/
>
> On Thu, Jul 13, 2017 at 4:48 PM, Tim Cross  wrote:
>
>>
>> I think there is something wrong with your environment and your second
>> block is not legal code. If you run your second block directly in a
>> clojure repl, you will get the same errors, which means it isn't an org
>> issue.
>>
>> Executing your examples with org from master branch I get
>>
>> #+BEGIN_SRC clojure
>> (+ 1 1) ;=> 2
>> #+END_SRC
>>
>> #+RESULTS:
>> : 2
>>
>> #+BEGIN_SRC clojure :results value
>> (def sum1 #(reduce + %))
>> (def avg1 #(/ (sum %) (count %)))
>>
>> (defn stats
>>   [numbers]
>>   (map #(% numbers) [sum1 count avg1]))
>>
>> (stats [3 4 10])
>>
>> (stats [80 1 44 13 6])
>>
>> #+END_SRC
>>
>> #+RESULTS:
>> : #'user/sum1#'user/statsclass clojure.lang.Compiler$CompilerExceptionclass
>> java.lang.IllegalStateExceptionclass java.lang.IllegalStateExceptionclass
>> clojure.lang.Compiler$CompilerExceptionclass
>> java.lang.IllegalStateExceptionclass 
>> java.lang.IllegalStateExceptionCompilerException
>> java.lang.RuntimeException: Unable to resolve symbol: sum in this context,
>> compiling:(/tmp/form-init6637865895670060372.clj:2:15)
>> : IllegalStateException Attempting to call unbound fn: #'user/avg1
>> clojure.lang.Var$Unbound.throwArity (Var.java:43)
>> : IllegalStateException Attempting to call unbound fn: #'user/avg1
>> clojure.lang.Var$Unbound.throwArity (Var.java:43)
>>
>> I'm not sure why the version of ob-clojure.el is not yet in the org or
>> org-plus-contrib packages - Does master only become maint after major
>> version releases?
>>
>> Note also, there appears to be an issue with most recent versions of
>> cider when you do cider-jack-in and your not inside a project. The
>> issues seem to relate mainly to clj-refactor, but there could be other
>> problems. Again, highly recommend running your cider inside a clojure
>> project.
>>
>> Tim
>>
>> numbch...@gmail.com writes:
>>
>> > Here is the examples:
>> >
>> > #+BEGIN_SRC clojure
>> > (+ 1 1) ;=> 2
>> > #+END_SRC
>> >
>> > #+RESULTS:
>> > : class clojure.lang.LispReader$ReaderExceptionclass
>> > java.lang.RuntimeExceptionRuntimeException EOF while reading, starting
>> at
>> > line 1  clojure.lang.Util.runtimeException (Util.java:221)
>> >
>> > #+BEGIN_SRC clojure :results value
>> > (def sum1 #(reduce + %))
>> > (def avg1 #(/ (sum %) (count %)))
>> >
>> > (defn stats
>> >   [numbers]
>> >   (map #(% numbers) [sum1 count avg1]))
>> >
>> > (stats [3 4 10])
>> > ;; => (17 3 17/3)
>> >
>> > (stats [80 1 44 13 6])
>> > ;; => (144 5 144/5)
>> > #+END_SRC
>> >
>> > #+RESULTS:
>> > : class clojure.lang.LispReader$ReaderExceptionclass
>> > java.lang.RuntimeExceptionRuntimeException EOF while reading, starting
>> at
>> > line 1  clojure.lang.Util.runtimeException (Util.java:221)
>> >
>> >
>> > [stardiviner] GPG key ID: 47C32433
>> > IRC(freeenode): stardiviner Twitter:  @numbchild
>> > Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
>> > Blog: http://stardiviner.github.io/
>>
>>
>> --
>> Tim Cross
>>
>
>


-- 
regards,

Tim

--
Tim Cross


[O] disable table in EXAMPLE or QUOTE block

2017-07-13 Thread David Rogoff
I’m trying to draw an ASCII picture in a BEGIN_QUOTE block.  However, since it 
contains vertical bars, when I hit return, it formats the whole block as if it 
were a table.  How do I stop this incorrect behavior?  I tried BEGIN_EXAMPLE 
but it acted the same.

I can work around it by using  colon-space at the beginning of each line 
instead of begin/end block but it’s a bit ugly.

Thanks - David


Re: [O] Babel support for Vala

2017-07-13 Thread Christian Garbs

Hi,

Am 11.07.2017 um 10:10 schrieb Nicolas Goaziou:


In the meantime, would you want to sent your library as a patch so that
we can review it?


The patch is prepared but I have one question regarding the copyright 
situation: Looking at the other files[1], I think I should now list the 
FSF as copyright holder.  Can I already do that before the paperwork has 
been completed or do I have to hold the patch back until that time?


And should I send the patch as a reply into this thread or start a new one?

so long
Mitch

[1] `grep Copyright lisp/*.el' shows the FSF as copyright holder for all 
files except `lisp/org-duration.el'.  Is that a bug or intentional?





Re: [O] [PATCH] org-agenda tag completion works with ido

2017-07-13 Thread Kyle Meyer
Nathaniel Flath  writes:

> I suppose so.  I still think this is a correct patch, since it doesn't
> make sense to filter for non-existent tags.

I agreed that require-match should be t earlier in the thread, but it
turns out that that's not the source of your issue.  I took time to
clarify this in order to a) help you solve your ido completion issue
everywhere, not just one specific case in one particular package, and b)
make the description in your commit message accurate, which it currently
isn't.

Feel free to send a new patch with an updated commit message.  Also,
based on the contributor list [*], you should mark it with a TINYCHANGE
cookie.  It looks like you're hitting up against your TINYCHANGE code
limit, so please consider signing FSF copyright papers for future
patches.

[*] http://orgmode.org/worg/org-contribute.html

-- 
Kyle



Re: [O] [PATCH] org-agenda tag completion works with ido

2017-07-13 Thread Nathaniel Flath
I suppose so.  I still think this is a correct patch, since it doesn't
make sense to filter for non-existent tags.

On Thu, Jul 13, 2017 at 12:19 PM, Kyle Meyer  wrote:
> Nathaniel Flath  writes:
>
>> Confirmed it's a difference in ido configuration - I'm using
>> ido-everywhere, not ido-ubiquitous.
>
> OK, thanks.  So you were just seeing the default Emacs completion rather
> than ido's.  My understanding is that ido-everywhere only adds ido for
> buffer/file prompts, and so you'll need to use ido-ubiquitous to get ido
> completion in with Org 9.  (Any package that overrides
> completing-read-function should work, so you can also use helm, ivy,
> etc).
>
> --
> Kyle



Re: [O] [PATCH] org-agenda tag completion works with ido

2017-07-13 Thread Kyle Meyer
Nathaniel Flath  writes:

> Confirmed it's a difference in ido configuration - I'm using
> ido-everywhere, not ido-ubiquitous.

OK, thanks.  So you were just seeing the default Emacs completion rather
than ido's.  My understanding is that ido-everywhere only adds ido for
buffer/file prompts, and so you'll need to use ido-ubiquitous to get ido
completion in with Org 9.  (Any package that overrides
completing-read-function should work, so you can also use helm, ivy,
etc).

-- 
Kyle



Re: [O] [PATCH] org-agenda tag completion works with ido

2017-07-13 Thread Nathaniel Flath
Confirmed it's a difference in ido configuration - I'm using
ido-everywhere, not ido-ubiquitous.

On Thu, Jul 13, 2017 at 11:19 AM, Nathaniel Flath  wrote:
> On Thu, Jul 13, 2017 at 11:02 AM, Kyle Meyer  wrote:
>> Nathaniel Flath  writes:
>>
>> [...]
>>
 I'm not an ido user, but testing with

 (require 'ido-ubiquitous)
 (ido-ubiquitous-mode 1)

 partial completion seems to work fine when I hit tab after calling
 org-agenda-filter-by-tag.  Are you using ido-ubiquitous, or are you
 using some other package to get ido completion for non-file/buffer
 completion?
>>>
>>> The issue is that that 'tab' is required - in the previous version of
>>> org, this was not required and 'enter' would do the completion for
>>> you.
>>
>> I'm only using tab right after calling org-agenda-filter-by-tag to get
>> to the initial tag prompt, following the instructions in the minibuffer.
>> Isn't that always needed?
>>
>> Here is how I'm testing (with emacs -Q):
>>
>>   * list TODOs with the agenda (org-agenda, follow by "t")
>>   * on an entry, hit "/" for org-agenda-filter-by-tag
>>   * hit tab to get to the tag prompt
>>
>> Once in the prompt, I can select a partial completion by just hitting
>> enter.
>
> I follow the same steps:
>  * list TODOs with the agenda (org-agenda, follow by "t")
>  * on an entry, hit "/" for org-agenda-filter-by-tag
>  * hit tab to get to the tag prompt
>  * type 'ho' + enter - this causes everything to disappear, because it
> is trying to filter for 'ho' instead of 'home' ('ho' is not a valid
> tag)
>
> I've upgraded to the lastest version of ido-ubiquitous and this
> behaviour persists.
> (This is also my understanding of what the expected behaviour should
> be, based on testing of completing-read and reading the function
> docs).
>
>>
>> I've executed the above steps with two setups:
>> release_8.3.6/org-completion-use-ido and release_9.0.9/ido-ubiquitous.
>> I couldn't spot any differences.  Hitting enter for partial completion
>> worked in both cases.
>>
 In this particular case, your change looks OK because I think all useful
 values should be in the collection.  But I don't understand why you're
 not able to do partial completion without this change.  Are you running
 into the same issue everywhere else that completing-read is called with
 a nil value for require-match?
>>>
>>> I haven't checked everywhere else - presumably.
>>
>> It'd be good to figure out why you're seeing different behavior than I
>> am.  Perhaps the steps I list above aren't the right steps to trigger
>> it.  Or maybe you have some non-default ido configuration.  Or maybe the
>> difference comes from an ido version mismatch.  (I'm using the ido from
>> Emacs 25.2 and ido-ubiquitous checked out at v3.14-4-ga1c2965.)
>
> I'm on emacs 24.5.1 - I'll try updating, but I suspect the problem will 
> persist.
>>
>> As it stands, I can't reproduce the problem described in your commit
>> message.
>>
>> --
>> Kyle



Re: [O] [PATCH] org-agenda tag completion works with ido

2017-07-13 Thread Nathaniel Flath
On Thu, Jul 13, 2017 at 11:02 AM, Kyle Meyer  wrote:
> Nathaniel Flath  writes:
>
> [...]
>
>>> I'm not an ido user, but testing with
>>>
>>> (require 'ido-ubiquitous)
>>> (ido-ubiquitous-mode 1)
>>>
>>> partial completion seems to work fine when I hit tab after calling
>>> org-agenda-filter-by-tag.  Are you using ido-ubiquitous, or are you
>>> using some other package to get ido completion for non-file/buffer
>>> completion?
>>
>> The issue is that that 'tab' is required - in the previous version of
>> org, this was not required and 'enter' would do the completion for
>> you.
>
> I'm only using tab right after calling org-agenda-filter-by-tag to get
> to the initial tag prompt, following the instructions in the minibuffer.
> Isn't that always needed?
>
> Here is how I'm testing (with emacs -Q):
>
>   * list TODOs with the agenda (org-agenda, follow by "t")
>   * on an entry, hit "/" for org-agenda-filter-by-tag
>   * hit tab to get to the tag prompt
>
> Once in the prompt, I can select a partial completion by just hitting
> enter.

I follow the same steps:
 * list TODOs with the agenda (org-agenda, follow by "t")
 * on an entry, hit "/" for org-agenda-filter-by-tag
 * hit tab to get to the tag prompt
 * type 'ho' + enter - this causes everything to disappear, because it
is trying to filter for 'ho' instead of 'home' ('ho' is not a valid
tag)

I've upgraded to the lastest version of ido-ubiquitous and this
behaviour persists.
(This is also my understanding of what the expected behaviour should
be, based on testing of completing-read and reading the function
docs).

>
> I've executed the above steps with two setups:
> release_8.3.6/org-completion-use-ido and release_9.0.9/ido-ubiquitous.
> I couldn't spot any differences.  Hitting enter for partial completion
> worked in both cases.
>
>>> In this particular case, your change looks OK because I think all useful
>>> values should be in the collection.  But I don't understand why you're
>>> not able to do partial completion without this change.  Are you running
>>> into the same issue everywhere else that completing-read is called with
>>> a nil value for require-match?
>>
>> I haven't checked everywhere else - presumably.
>
> It'd be good to figure out why you're seeing different behavior than I
> am.  Perhaps the steps I list above aren't the right steps to trigger
> it.  Or maybe you have some non-default ido configuration.  Or maybe the
> difference comes from an ido version mismatch.  (I'm using the ido from
> Emacs 25.2 and ido-ubiquitous checked out at v3.14-4-ga1c2965.)

I'm on emacs 24.5.1 - I'll try updating, but I suspect the problem will persist.
>
> As it stands, I can't reproduce the problem described in your commit
> message.
>
> --
> Kyle



Re: [O] [PATCH] org-agenda tag completion works with ido

2017-07-13 Thread Kyle Meyer
Kyle Meyer  writes:

[...]

> Or maybe the difference comes from an ido version mismatch.  (I'm
> using the ido from Emacs 25.2 and ido-ubiquitous checked out at
> v3.14-4-ga1c2965.)
>
> As it stands, I can't reproduce the problem described in your commit
> message.

I upgraded to the latest ido-ubiquitous (v3.16-67-g7b71365).  I'm still
unable to reproduce the issue.

-- 
Kyle



Re: [O] [Patch] Support for dimming local to each agenda

2017-07-13 Thread Yuri Lensky
Thanks. I have attached an updated patch that addresses your points (with
some additional cleanup).

On Thu, Jul 13, 2017 at 5:51 AM, Nicolas Goaziou 
wrote:

> Hello,
>
> Yuri Lensky  writes:
>
> > Composite agenda views can now set org-agenda-dim-blocked-tasks locally.
> > From 52f8bf79a198fa2e7f131c2a015a7c9400a403ac Mon Sep 17 00:00:00 2001
> > From: "Yuri D. Lensky" 
> > Date: Mon, 10 Jul 2017 19:21:39 -0700
> > Subject: [PATCH 2/2] org-agenda.el: Support for dimming local to each
> > agenda.
>
> Thank you. Some comments follow.
>
> > Composite agenda views could not separately specify whether to dim
> > blocked tasks.
>
> The commit message is lacking information about modified and created
> functions, e.g.,
>
> lisp/org-agenda.el (org-agenda-mark-blocked-entry): New function.
> ...
>
Fixed.

>
> > +(defun org-agenda-mark-blocked-entry (entry)
>
> Since this is meant to be an internal function, I suggest to name it
> `org-agenda--mark-blocked-entry'.
>
Fixed.

>
> > +  "Mark a blocked entry in text properties."
>
> The docstring should specifiy what ENTRY is.
>
Fixed.

>
> > +  (when (get-text-property 0 'todo-state entry)
> > +(let ((entry-marker (get-text-property 0 'org-hd-marker entry))
> > +  (org-blocked-by-checkboxes nil)
> > +   ;; Necessary so that org-entry-blocked-p does not change the
> buffer
>
> `org-entry-blocked-p'
>
> Missing full stop, too.
>
Fixed.

>
> > +  (org-depend-tag-blocked nil))
> > +  (let ((blocked
> > +  (with-current-buffer (marker-buffer entry-marker)
> > +(save-mark-and-excursion
>
> Why is `save-mark-and-excursion' needed?
>
Because we are moving point to get to the heading, and in principle hooks
in org-blocker-hook can change point/mark.

>
> > +(when (and org-agenda-dim-blocked-tasks org-blocker-hook)
> > +  (setq list (mapcar 'org-agenda-mark-blocked-entry list)))
>
> Nitpick: (mapcar #'org-agenda-mark-blocked-entry list)
>
Fixed.

>
> Bonus points if you can write tests in test-org-agenda.el.
>
Don't have time at the moment, but as this is a fairly simple feature it is
easy to see if it works.

>
> Regards,
>
> --
> Nicolas Goaziou


0001-org-agenda.el-Support-for-dimming-local-to-each-agen.patch
Description: Binary data


Re: [O] [PATCH] org-agenda tag completion works with ido

2017-07-13 Thread Kyle Meyer
Nathaniel Flath  writes:

[...]

>> I'm not an ido user, but testing with
>>
>> (require 'ido-ubiquitous)
>> (ido-ubiquitous-mode 1)
>>
>> partial completion seems to work fine when I hit tab after calling
>> org-agenda-filter-by-tag.  Are you using ido-ubiquitous, or are you
>> using some other package to get ido completion for non-file/buffer
>> completion?
>
> The issue is that that 'tab' is required - in the previous version of
> org, this was not required and 'enter' would do the completion for
> you.

I'm only using tab right after calling org-agenda-filter-by-tag to get
to the initial tag prompt, following the instructions in the minibuffer.
Isn't that always needed?

Here is how I'm testing (with emacs -Q):

  * list TODOs with the agenda (org-agenda, follow by "t")
  * on an entry, hit "/" for org-agenda-filter-by-tag
  * hit tab to get to the tag prompt

Once in the prompt, I can select a partial completion by just hitting
enter.

I've executed the above steps with two setups:
release_8.3.6/org-completion-use-ido and release_9.0.9/ido-ubiquitous.
I couldn't spot any differences.  Hitting enter for partial completion
worked in both cases.

>> In this particular case, your change looks OK because I think all useful
>> values should be in the collection.  But I don't understand why you're
>> not able to do partial completion without this change.  Are you running
>> into the same issue everywhere else that completing-read is called with
>> a nil value for require-match?
>
> I haven't checked everywhere else - presumably.

It'd be good to figure out why you're seeing different behavior than I
am.  Perhaps the steps I list above aren't the right steps to trigger
it.  Or maybe you have some non-default ido configuration.  Or maybe the
difference comes from an ido version mismatch.  (I'm using the ido from
Emacs 25.2 and ido-ubiquitous checked out at v3.14-4-ga1c2965.)

As it stands, I can't reproduce the problem described in your commit
message.

-- 
Kyle



Re: [O] [PATCH] org-agenda tag completion works with ido

2017-07-13 Thread Nathaniel Flath
On Wed, Jul 12, 2017 at 9:35 PM, Kyle Meyer  wrote:
> Nathaniel Flath  writes:
>
>> After upgrading to the latest org-mode, tag completion when filtering
>> in the agenda was broken - I had to fully enter the tag, despite using
>> ido  (eg I would have a tag 'home', and 'ho-enter' would not compete).
>
> [...]
>
>> * org-agenda.el (org-agenda-filter-by-tag):
>> (org-agenda-filter-by-tag): pass t to require-match argument of 
>> completing-read.
>
>   ^ repeated function name
>

Removed that in patch attached.

>> This causes ido-mode to complete tags properly when inputting partial 
>> matches, rather
>> that just sending the typed input.
>
> Wouldn't this mean that, in general, ido won't complete partial matches
> properly when require-match is nil?  That doesn't sound right.
>
> I'm not an ido user, but testing with
>
> (require 'ido-ubiquitous)
> (ido-ubiquitous-mode 1)
>
> partial completion seems to work fine when I hit tab after calling
> org-agenda-filter-by-tag.  Are you using ido-ubiquitous, or are you
> using some other package to get ido completion for non-file/buffer
> completion?

The issue is that that 'tab' is required - in the previous version of
org, this was not required and 'enter' would do the completion for
you.

>
> In this particular case, your change looks OK because I think all useful
> values should be in the collection.  But I don't understand why you're
> not able to do partial completion without this change.  Are you running
> into the same issue everywhere else that completing-read is called with
> a nil value for require-match?

I haven't checked everywhere else - presumably.


>
> --
> Kyle


0001-completing-read-in-org-agenda-filter-by-tag-complete.patch
Description: Binary data


Re: [O] %K template escape doesn't link to exact task headline

2017-07-13 Thread Michal Politowski
On Thu, 13 Jul 2017 14:27:11 +0200, Nicolas Goaziou wrote:
> Hello,
> 
> Michal Politowski  writes:
> 
> > Hello everyone and thank you for the fascinating org mode,
> >
> > Is the behaviour of %K a bug in the documentation, in the implementation,
> > or just my unfounded expectation?
> >
> > It is supposed to link "to the currently clocked task" but it is implemented
> > in org-capture.el as
> >
> > (v-K (if (marker-buffer org-clock-marker)
> >   (org-make-link-string
> >(buffer-file-name (marker-buffer org-clock-marker))
> >org-clock-heading)))
> >
> > 
> >
> > which only puts the headline text in the link description,
> > the actual link is just to the task file - not what I would expect.
> 
> Fixed. Thank you.

Thank you. Wouldn't it be better to still have a link description though?
Probably both versions have advantages.

diff --git a/lisp/org-capture.el b/lisp/org-capture.el
index 44dbb7f96..7b880cf9a 100644
--- a/lisp/org-capture.el
+++ b/lisp/org-capture.el
@@ -1613,7 +1613,8 @@ The template may still contain \"%?\" for cursor 
positioning."
  (org-make-link-string
   (format "%s::%s"
   (buffer-file-name (marker-buffer org-clock-marker))
-  (org-no-properties org-clock-heading)))
+  (org-no-properties org-clock-heading))
+  (org-no-properties org-clock-heading))
""))
 (v-f (or (org-capture-get :original-file-nondirectory) ""))
 (v-F (or (org-capture-get :original-file) ""))


-- 
Michał Politowski



Re: [O] why prepend "file://" to abs paths in html output?

2017-07-13 Thread Nicolas Goaziou
Kaushal Modi  writes:

> I meant "Would it be OK to have ox-hugo.el define a link abbreviation like
> `hugo-static:' for the user?" That way, each user of ox-hugo.el does not
> have to do that in their configs.

Anything goes, but I'm quite certain there's a better way.

> For static site generators like Hugo, Nikola, etc. it is conventional to
> dump all "static" attachments like images, code files, etc in a fixed
> "static/" (or something like that) in the blog structure.

Then you could implement a function that detects static attachments
(e.g., per extension, or using a user-provided function), intercepts
links to such files, and rewrites them to the fixed "static/" directory.

Regards,



Re: [O] why prepend "file://" to abs paths in html output?

2017-07-13 Thread Kaushal Modi
On Thu, Jul 13, 2017 at 8:55 AM Nicolas Goaziou 
wrote:

> Kaushal Modi  writes:
>
> > Hmm. Thanks for that hint. Would it be OK to define backend-specific link
> > abbreviations?
>
> I don't think so.
>
> Back-end are able to manipulate links the way they want without Org core
> interfering. IOW, this black magick should operate whitin "ox-hugo.el"
> itself, IMO.
>

I meant "Would it be OK to have ox-hugo.el define a link abbreviation like
`hugo-static:' for the user?" That way, each user of ox-hugo.el does not
have to do that in their configs.


> BTW, I still don't understand why an export back-end (unlike an user)
> would need to use link abbreviations.


For static site generators like Hugo, Nikola, etc. it is conventional to
dump all "static" attachments like images, code files, etc in a fixed
"static/" (or something like that) in the blog structure.

So it is very common to have all static links begin with
"/path/to/blog/root/static/" for a blog. (That's exactly the
#+HTML_LINK_ROOT I mentioned earlier.)
-- 

Kaushal Modi


Re: [O] why prepend "file://" to abs paths in html output?

2017-07-13 Thread Nicolas Goaziou
Kaushal Modi  writes:

> Hmm. Thanks for that hint. Would it be OK to define backend-specific link
> abbreviations?

I don't think so. 

Back-end are able to manipulate links the way they want without Org core
interfering. IOW, this black magick should operate whitin "ox-hugo.el"
itself, IMO.

BTW, I still don't understand why an export back-end (unlike an user)
would need to use link abbreviations.

Regards,

-- 
Nicolas Goaziou



Re: [O] [Patch] Support for dimming local to each agenda

2017-07-13 Thread Nicolas Goaziou
Hello,

Yuri Lensky  writes:

> Composite agenda views can now set org-agenda-dim-blocked-tasks locally.
> From 52f8bf79a198fa2e7f131c2a015a7c9400a403ac Mon Sep 17 00:00:00 2001
> From: "Yuri D. Lensky" 
> Date: Mon, 10 Jul 2017 19:21:39 -0700
> Subject: [PATCH 2/2] org-agenda.el: Support for dimming local to each
> agenda.

Thank you. Some comments follow.

> Composite agenda views could not separately specify whether to dim
> blocked tasks.

The commit message is lacking information about modified and created
functions, e.g.,

lisp/org-agenda.el (org-agenda-mark-blocked-entry): New function.
...

> +(defun org-agenda-mark-blocked-entry (entry)

Since this is meant to be an internal function, I suggest to name it
`org-agenda--mark-blocked-entry'.

> +  "Mark a blocked entry in text properties."

The docstring should specifiy what ENTRY is.

> +  (when (get-text-property 0 'todo-state entry)
> +(let ((entry-marker (get-text-property 0 'org-hd-marker entry))
> +  (org-blocked-by-checkboxes nil)
> +   ;; Necessary so that org-entry-blocked-p does not change the buffer

`org-entry-blocked-p'

Missing full stop, too.

> +  (org-depend-tag-blocked nil))
> +  (let ((blocked
> +  (with-current-buffer (marker-buffer entry-marker)
> +(save-mark-and-excursion

Why is `save-mark-and-excursion' needed?

> +(when (and org-agenda-dim-blocked-tasks org-blocker-hook)
> +  (setq list (mapcar 'org-agenda-mark-blocked-entry list)))

Nitpick: (mapcar #'org-agenda-mark-blocked-entry list)

Bonus points if you can write tests in test-org-agenda.el.

Regards,

-- 
Nicolas Goaziou



Re: [O] why prepend "file://" to abs paths in html output?

2017-07-13 Thread Kaushal Modi
On Thu, Jul 13, 2017 at 8:39 AM Nicolas Goaziou 
wrote:

>
> There is only one possible interpretation of this: look for the file at
> "/images/image.png", which probably doesn't exist.
>

I agree. It's definitely less confusing to an unknowing user with that
strict definition.

ISTM you are looking after link abbreviations.
>

Hmm. Thanks for that hint. Would it be OK to define backend-specific link
abbreviations?

I'd like to eventually merge ox-hugo[1] into Org. So would like to stay in
line with the conventions.

[1]: https://github.com/kaushalmodi/ox-hugo
-- 

Kaushal Modi


Re: [O] why prepend "file://" to abs paths in html output?

2017-07-13 Thread Nicolas Goaziou
Hello,

Brett Viren  writes:

> Nikola source wants this layout:
>
>   /path/to/my/nikola/posts/my-blog-post.org
>   /path/to/my/nikola/images/unicorn.jpg
>
> The Org source generates to HTML which will be found at this URL path:
>
>   /mysiteroot/posts/my-blog-post/index.html
>
> So, right now, either the Org link to the image must be written to be
> invalid (for Org):
>
>   [[../../images/unicorn.jpg]]

Your examples do not apply here, as we are talking about absolute file
names. 

Relative links are exported as relative URL, which is good in most
cases. The remaining cases can be dealt with filters or some such or by
back-end themselves.

Regards,

-- 
Nicolas Goaziou



Re: [O] why prepend "file://" to abs paths in html output?

2017-07-13 Thread Nicolas Goaziou
Hello,

Kaushal Modi  writes:

> #+HTML_LINK_ROOT: /tmp/site/static/
>
> An =image.png= exists as =/tmp/site/static/images/image.png=.
>
> * This is how the image links should have worked with the link root already
> specified
> [[/images/image.png]]

There is only one possible interpretation of this: look for the file at
"/images/image.png", which probably doesn't exist.

> - The =HTML_LINK_ROOT= should to appended to the front of the above link if
> that
>   concatenated path is a valid one.
> - Would also like =C-x C-o=, inline image display, etc. to work.
> - So a thought.. should the link root specification be made exporter
> agnostic?
> * This works after adding support for =HTML_LINK_ROOT= ..
> .. but
> - The link path becomes too long.
> - Need to hard-code the full path to the site/blog root directory before
> each of
>   such links.
> [[file:/tmp/site/static/images/image.png]]

ISTM you are looking after link abbreviations.

Regards,

-- 
Nicolas Goaziou



Re: [O] [PATCH] Refactor org-set-tags arguments for clarity

2017-07-13 Thread Kaushal Modi
On Thu, Jul 13, 2017 at 8:32 AM Nicolas Goaziou 
wrote:

> Kaushal Modi  writes:
>
> > Correct. I was just extrapolating based on that, that people could be
> > making similar uses in their configs and packages.
> >
> > A search like this (
> >
> https://github.com/search?utf8=%E2%9C%93&q=%22org-set-tags+nil%22+language%3A%22Emacs+Lisp%22&type=Code
> > )
> > shows that (org-set-tags nil t) is pretty viral in one org-settings.el
> out
> > there.
>
> Then what about something like this
>
>   (defun org-set-tags (&optional align-all align-current)
> "...
>   ...
>   ALIGN-CURRENT is obsolete and should not be used. When non-nil,
>   set ALIGN-ALL to `current'."
> (let ((align-all (if (null align-current) align-all
>(warn "Deprecated call to `org-set-tags', which
> see")
>'current)))
>  ...))
>

That will work. Good idea!

I'll first patch maint, and then this in master.
-- 

Kaushal Modi


Re: [O] [PATCH] Refactor org-set-tags arguments for clarity

2017-07-13 Thread Kaushal Modi
On Thu, Jul 13, 2017 at 8:37 AM Kaushal Modi  wrote:

>   (defun org-set-tags (&optional align-all align-current)
>> "...
>>   ...
>>   ALIGN-CURRENT is obsolete and should not be used. When non-nil,
>>   set ALIGN-ALL to `current'."
>> (let ((align-all (if (null align-current) align-all
>>(warn "Deprecated call to `org-set-tags', which
>> see")
>>'current)))
>>  ...))
>>
>
> That will work. Good idea!
>
> I'll first patch maint, and then this in master.
>

And then.. ALIGN-ALL can become JUST-ALIGN in master :P
-- 

Kaushal Modi


Re: [O] [PATCH] Refactor org-set-tags arguments for clarity

2017-07-13 Thread Nicolas Goaziou
Kaushal Modi  writes:

> Correct. I was just extrapolating based on that, that people could be
> making similar uses in their configs and packages.
>
> A search like this (
> https://github.com/search?utf8=%E2%9C%93&q=%22org-set-tags+nil%22+language%3A%22Emacs+Lisp%22&type=Code
> )
> shows that (org-set-tags nil t) is pretty viral in one org-settings.el out
> there.

Then what about something like this

  (defun org-set-tags (&optional align-all align-current)
"...
  ...
  ALIGN-CURRENT is obsolete and should not be used. When non-nil,
  set ALIGN-ALL to `current'."
(let ((align-all (if (null align-current) align-all
   (warn "Deprecated call to `org-set-tags', which see")
   'current)))
 ...))


Regards,



Re: [O] %K template escape doesn't link to exact task headline

2017-07-13 Thread Nicolas Goaziou
Hello,

Michal Politowski  writes:

> Hello everyone and thank you for the fascinating org mode,
>
> Is the behaviour of %K a bug in the documentation, in the implementation,
> or just my unfounded expectation?
>
> It is supposed to link "to the currently clocked task" but it is implemented
> in org-capture.el as
>
> (v-K (if (marker-buffer org-clock-marker)
> (org-make-link-string
>  (buffer-file-name (marker-buffer org-clock-marker))
>  org-clock-heading)))
>
> 
>
> which only puts the headline text in the link description,
> the actual link is just to the task file - not what I would expect.

Fixed. Thank you.

Regards,

-- 
Nicolas Goaziou



Re: [O] ob-clojure will error result when contains comment

2017-07-13 Thread numbch...@gmail.com
I run the both blocks fine in CIDER REPL, that's weird.
I have the following special settings for ob-clojure.
```elisp
(add-to-list 'org-babel-default-header-args:clojure
 '(:eval . "yes"))
(add-to-list 'org-babel-default-header-args:clojure
 '(:results . "value pp"))
(add-to-list 'org-babel-default-header-args:clojure ; for Clojure `dotimes'
etc.
 '(:show-process . "no"))
(add-to-list 'org-babel-default-header-args:clojure
 '(:noweb . "yes"))
```


[stardiviner] GPG key ID: 47C32433
IRC(freeenode): stardiviner Twitter:  @numbchild
Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/

On Thu, Jul 13, 2017 at 4:48 PM, Tim Cross  wrote:

>
> I think there is something wrong with your environment and your second
> block is not legal code. If you run your second block directly in a
> clojure repl, you will get the same errors, which means it isn't an org
> issue.
>
> Executing your examples with org from master branch I get
>
> #+BEGIN_SRC clojure
> (+ 1 1) ;=> 2
> #+END_SRC
>
> #+RESULTS:
> : 2
>
> #+BEGIN_SRC clojure :results value
> (def sum1 #(reduce + %))
> (def avg1 #(/ (sum %) (count %)))
>
> (defn stats
>   [numbers]
>   (map #(% numbers) [sum1 count avg1]))
>
> (stats [3 4 10])
>
> (stats [80 1 44 13 6])
>
> #+END_SRC
>
> #+RESULTS:
> : #'user/sum1#'user/statsclass clojure.lang.Compiler$CompilerExceptionclass
> java.lang.IllegalStateExceptionclass java.lang.IllegalStateExceptionclass
> clojure.lang.Compiler$CompilerExceptionclass 
> java.lang.IllegalStateExceptionclass
> java.lang.IllegalStateExceptionCompilerException
> java.lang.RuntimeException: Unable to resolve symbol: sum in this context,
> compiling:(/tmp/form-init6637865895670060372.clj:2:15)
> : IllegalStateException Attempting to call unbound fn: #'user/avg1
> clojure.lang.Var$Unbound.throwArity (Var.java:43)
> : IllegalStateException Attempting to call unbound fn: #'user/avg1
> clojure.lang.Var$Unbound.throwArity (Var.java:43)
>
> I'm not sure why the version of ob-clojure.el is not yet in the org or
> org-plus-contrib packages - Does master only become maint after major
> version releases?
>
> Note also, there appears to be an issue with most recent versions of
> cider when you do cider-jack-in and your not inside a project. The
> issues seem to relate mainly to clj-refactor, but there could be other
> problems. Again, highly recommend running your cider inside a clojure
> project.
>
> Tim
>
> numbch...@gmail.com writes:
>
> > Here is the examples:
> >
> > #+BEGIN_SRC clojure
> > (+ 1 1) ;=> 2
> > #+END_SRC
> >
> > #+RESULTS:
> > : class clojure.lang.LispReader$ReaderExceptionclass
> > java.lang.RuntimeExceptionRuntimeException EOF while reading, starting
> at
> > line 1  clojure.lang.Util.runtimeException (Util.java:221)
> >
> > #+BEGIN_SRC clojure :results value
> > (def sum1 #(reduce + %))
> > (def avg1 #(/ (sum %) (count %)))
> >
> > (defn stats
> >   [numbers]
> >   (map #(% numbers) [sum1 count avg1]))
> >
> > (stats [3 4 10])
> > ;; => (17 3 17/3)
> >
> > (stats [80 1 44 13 6])
> > ;; => (144 5 144/5)
> > #+END_SRC
> >
> > #+RESULTS:
> > : class clojure.lang.LispReader$ReaderExceptionclass
> > java.lang.RuntimeExceptionRuntimeException EOF while reading, starting
> at
> > line 1  clojure.lang.Util.runtimeException (Util.java:221)
> >
> >
> > [stardiviner] GPG key ID: 47C32433
> > IRC(freeenode): stardiviner Twitter:  @numbchild
> > Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
> > Blog: http://stardiviner.github.io/
>
>
> --
> Tim Cross
>


Re: [O] [PATCH] Refactor org-set-tags arguments for clarity

2017-07-13 Thread Kaushal Modi
On Thu, Jul 13, 2017 at 7:58 AM Nicolas Goaziou 
wrote:

>
> Calls in code base do not matter, since we can change them. The above
> Sexp would be equivalent to
>
>   (org-set-tags 'current)
>

Correct. I was just extrapolating based on that, that people could be
making similar uses in their configs and packages.

A search like this (
https://github.com/search?utf8=%E2%9C%93&q=%22org-set-tags+nil%22+language%3A%22Emacs+Lisp%22&type=Code
)
shows that (org-set-tags nil t) is pretty viral in one org-settings.el out
there.


> > instances in the Org source itself. I though just created a wrapper in my
> > personal config to do ALIGN-ONLY-CURRENT when prefix is C-u C-u.
>
> I don't think an user needs to distinguish between aligning all and
> aligning only current. I think this is just confusing.
>

That's alright. I can see that it might not be that useful as org-set-tags
anyways aligns the tags. (I am just used to abusing the free C-u C-u in my
config :))


> > PS: Also, in addition, was thinking of calling JUST-ALIGN ALIGN-ALL
> > instead.
>
> Sounds good.
>

Thanks.


> > With:
> >
> > (defun org-set-tags (&optional ALIGN-ALL ALIGN-ONLY-CURRENT) ..
> >
> > it will be more apparent that they are mutually exclusive args.
>
> It still bugs me because (org-set-tags t t) doesn't make any sense.
>

Same sentiments here (I even fixed one case of (org-set-tags t t) in that
patch).


> WDYT?
>

The only concern is the one I presented above; doing this will break many
personal configs.
-- 

Kaushal Modi


Re: [O] [PATCH] Refactor org-set-tags arguments for clarity

2017-07-13 Thread Nicolas Goaziou
Kaushal Modi  writes:

> I was itching to do that. But there are dozens of (org-set-tags nil t)

Calls in code base do not matter, since we can change them. The above
Sexp would be equivalent to 

  (org-set-tags 'current)

> instances in the Org source itself. I though just created a wrapper in my
> personal config to do ALIGN-ONLY-CURRENT when prefix is C-u C-u.

I don't think an user needs to distinguish between aligning all and
aligning only current. I think this is just confusing.

> PS: Also, in addition, was thinking of calling JUST-ALIGN ALIGN-ALL
> instead.

Sounds good.

> With:
>
> (defun org-set-tags (&optional ALIGN-ALL ALIGN-ONLY-CURRENT) ..
>
> it will be more apparent that they are mutually exclusive args.

It still bugs me because (org-set-tags t t) doesn't make any sense.

WDYT?

Regards,



[O] %K template escape doesn't link to exact task headline

2017-07-13 Thread Michal Politowski
Hello everyone and thank you for the fascinating org mode,

Is the behaviour of %K a bug in the documentation, in the implementation,
or just my unfounded expectation?

It is supposed to link "to the currently clocked task" but it is implemented
in org-capture.el as

(v-K (if (marker-buffer org-clock-marker)
  (org-make-link-string
   (buffer-file-name (marker-buffer org-clock-marker))
   org-clock-heading)))



which only puts the headline text in the link description,
the actual link is just to the task file - not what I would expect.

-- 
Michał Politowski



Re: [O] [PATCH] Refactor org-set-tags arguments for clarity

2017-07-13 Thread Kaushal Modi
On Thu, Jul 13, 2017, 3:54 AM Nicolas Goaziou 
wrote:

> Thank you. LGTM!
>

Thanks.

Actually, I think ALIGN-ONLY-CURRENT could be merged with JUST-ALIGN,
> which would have three cases (e.g., t, nil, `current'). Perhaps

 the
> incompatibility it introduces is not acceptable though.
>

I was itching to do that. But there are dozens of (org-set-tags nil t)
instances in the Org source itself. I though just created a wrapper in my
personal config to do ALIGN-ONLY-CURRENT when prefix is C-u C-u.

I can do the same in the source too, while keeping the argument order as it
is. I can use current-prefix-arg to override the value of JUST-ALIGN to nil
and ALIGN-ONLY-CURRENT to t internally for interactive use. The elisp use
of this function will stay unchanged. I'll apply this piece just to the
master if you like.

While you're at it, what about throwing in some test in
> "test-org/set-tags"? ;)
>

Will do.

PS: Also, in addition, was thinking of calling JUST-ALIGN ALIGN-ALL
instead.

With:

(defun org-set-tags (&optional ALIGN-ALL ALIGN-ONLY-CURRENT) ..

it will be more apparent that they are mutually exclusive args.

WDYT?
-- 

Kaushal Modi


Re: [O] MWE for BibLaTex and org-ref?

2017-07-13 Thread Loris Bennett
Hi Detlef,

Thanks for the information.  After removing the bibliography and
bibliographystyle, everything seems to work.  I think I was confused by
the following line from the org-ref manual:

  For LaTeX export a bibliography and bibliographystyle link is /required/.

Are they only required if I am *not* using biblatex, or, if I *am* using
biblatex, are some org-ref goodies not going to work if I don't have
them?

Cheers,

Loris

Detlef Steuer  writes:

> Hi!
>
> Look here:
> https://tex.stackexchange.com/questions/5091/what-to-do-to-switch-to-biblatex
>
> In short \bibliographystyle and biblatex don't match.
>
> Hope that helps
>
> Detlef
>
> Am Thu, 13 Jul 2017 08:27:17 +0200
> schrieb "Loris Bennett" :
>
>> Hi John,
>> 
>> Thanks for the pointer.  I think some of the errors I was getting were
>> due having old temporary files (aux, bcf, ...) lying around and then
>> switching between natbib and biblatex.
>> 
>> Following the org-ref manual I now have
>> 
>>   #+LATEX_HEADER:
>> \usepackage[citestyle=authoryear-icomp,bibstyle=authoryear,
>> hyperref=true,backref=true,maxcitenames=3,url=true,backend=biber,natbib=true]
>> {biblatex}
>> 
>> and then use
>> 
>>   bibliographystyle:authoryear
>> 
>> I'm now just getting the following error:
>> 
>>   ! Package biblatex Error: '\bibliographystyle' invalid.
>> 
>> Any ideas what I'm doing wrong?
>> 
>> Cheers,
>> 
>> Loris
>> 
>> John Kitchin  writes:
>> 
>> > org-ref should work fine for biblatex, but the setup for biblatex in
>> > the org file is a bit different than for bibtex.
>> >
>> > The org-ref manual can be opened by running M-x org-ref-help. Go to
>> > the ** biblatex users heading. Hopefully that is clear enough to
>> > help. If not, let me know what is missing.
>> >
>> > Best wishes,
>> >
>> > 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, Jul 12, 2017 at 9:59 AM, Loris Bennett
>> >  wrote:
>> >
>> >  Hi,
>> >
>> >  Does org-ref work with BibLaTeX?
>> >
>> >  With org-ref, I have an MWE using natbib that works:
>> >
>> >  #+LATEX_CLASS_OPTIONS: [a4paper, 11pt]
>> >  #+LATEX_HEADER: \usepackage{natbib}
>> >
>> >  #+TITLE: MWE
>> >
>> >  * Introduction
>> >
>> >  This MWE was found on the internet (see cite:Botha).
>> >
>> >  bibliographystyle:abbrvnat
>> >  bibliography:file.bib
>> >
>> >  with 'file.bib' being
>> >
>> >  @Online{Botha,
>> >  author = {Charl Botha},
>> >  title = {From org file with local bibtex to LaTeX and PDF},
>> >  date = {2017-02-20},
>> >  url =
>> > {https://vxlabs.com/2017/02/20/from-org-file-with-local-bibtex-to-latex-and-pdf/},
>> >  }
>> >
>> >  For org-latex-pdf-process, I'm using the following:
>> >
>> >  ("latexmk -g -pdf -pdflatex=\"%latex\" -shell-escape -outdir=%o
>> > %f")
>> >
>> >  However, if I try to replace natbib by BibLaTeX via
>> >
>> >  #+LATEX_HEADER: \usepackage{biblatex}
>> >  #+LATEX_HEADER: \addbibresource{file.bib}
>> >
>> >  bibliographystyle:alphabetic
>> >  bibliography:file.bib
>> >
>> >  I get errors about the style being invalid and the \bibliography
>> > only being allowed in the preamble.
>> >
>> >  So if it should work, does anyone have a MWE for org-ref with
>> > BibLaTeX?
>> >
>> >  Cheers,
>> >
>> >  Loris
>> >
>> >  --
>> >  This signature is currently under construction.
>> >
>> >  
>> 

-- 
Dr. Loris Bennett (Mr.)
ZEDAT, Freie Universität Berlin Email loris.benn...@fu-berlin.de




Re: [O] ob-clojure will error result when contains comment

2017-07-13 Thread Tim Cross

I think there is something wrong with your environment and your second
block is not legal code. If you run your second block directly in a
clojure repl, you will get the same errors, which means it isn't an org issue.

Executing your examples with org from master branch I get

#+BEGIN_SRC clojure
(+ 1 1) ;=> 2
#+END_SRC

#+RESULTS:
: 2

#+BEGIN_SRC clojure :results value
(def sum1 #(reduce + %))
(def avg1 #(/ (sum %) (count %)))

(defn stats
  [numbers]
  (map #(% numbers) [sum1 count avg1]))

(stats [3 4 10])

(stats [80 1 44 13 6])

#+END_SRC

#+RESULTS:
: #'user/sum1#'user/statsclass clojure.lang.Compiler$CompilerExceptionclass 
java.lang.IllegalStateExceptionclass java.lang.IllegalStateExceptionclass 
clojure.lang.Compiler$CompilerExceptionclass 
java.lang.IllegalStateExceptionclass 
java.lang.IllegalStateExceptionCompilerException java.lang.RuntimeException: 
Unable to resolve symbol: sum in this context, 
compiling:(/tmp/form-init6637865895670060372.clj:2:15) 
: IllegalStateException Attempting to call unbound fn: #'user/avg1  
clojure.lang.Var$Unbound.throwArity (Var.java:43)
: IllegalStateException Attempting to call unbound fn: #'user/avg1  
clojure.lang.Var$Unbound.throwArity (Var.java:43)

I'm not sure why the version of ob-clojure.el is not yet in the org or
org-plus-contrib packages - Does master only become maint after major
version releases?

Note also, there appears to be an issue with most recent versions of
cider when you do cider-jack-in and your not inside a project. The
issues seem to relate mainly to clj-refactor, but there could be other
problems. Again, highly recommend running your cider inside a clojure
project.

Tim

numbch...@gmail.com writes:

> Here is the examples:
>
> #+BEGIN_SRC clojure
> (+ 1 1) ;=> 2
> #+END_SRC
>
> #+RESULTS:
> : class clojure.lang.LispReader$ReaderExceptionclass
> java.lang.RuntimeExceptionRuntimeException EOF while reading, starting at
> line 1  clojure.lang.Util.runtimeException (Util.java:221)
>
> #+BEGIN_SRC clojure :results value
> (def sum1 #(reduce + %))
> (def avg1 #(/ (sum %) (count %)))
>
> (defn stats
>   [numbers]
>   (map #(% numbers) [sum1 count avg1]))
>
> (stats [3 4 10])
> ;; => (17 3 17/3)
>
> (stats [80 1 44 13 6])
> ;; => (144 5 144/5)
> #+END_SRC
>
> #+RESULTS:
> : class clojure.lang.LispReader$ReaderExceptionclass
> java.lang.RuntimeExceptionRuntimeException EOF while reading, starting at
> line 1  clojure.lang.Util.runtimeException (Util.java:221)
>
>
> [stardiviner] GPG key ID: 47C32433
> IRC(freeenode): stardiviner Twitter:  @numbchild
> Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
> Blog: http://stardiviner.github.io/


-- 
Tim Cross



Re: [O] MWE for BibLaTex and org-ref?

2017-07-13 Thread Detlef Steuer
Hi!

Look here:
https://tex.stackexchange.com/questions/5091/what-to-do-to-switch-to-biblatex

In short \bibliographystyle and biblatex don't match.

Hope that helps

Detlef

Am Thu, 13 Jul 2017 08:27:17 +0200
schrieb "Loris Bennett" :

> Hi John,
> 
> Thanks for the pointer.  I think some of the errors I was getting were
> due having old temporary files (aux, bcf, ...) lying around and then
> switching between natbib and biblatex.
> 
> Following the org-ref manual I now have
> 
>   #+LATEX_HEADER:
> \usepackage[citestyle=authoryear-icomp,bibstyle=authoryear,
> hyperref=true,backref=true,maxcitenames=3,url=true,backend=biber,natbib=true]
> {biblatex}
> 
> and then use
> 
>   bibliographystyle:authoryear
> 
> I'm now just getting the following error:
> 
>   ! Package biblatex Error: '\bibliographystyle' invalid.
> 
> Any ideas what I'm doing wrong?
> 
> Cheers,
> 
> Loris
> 
> John Kitchin  writes:
> 
> > org-ref should work fine for biblatex, but the setup for biblatex in
> > the org file is a bit different than for bibtex.
> >
> > The org-ref manual can be opened by running M-x org-ref-help. Go to
> > the ** biblatex users heading. Hopefully that is clear enough to
> > help. If not, let me know what is missing.
> >
> > Best wishes,
> >
> > 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, Jul 12, 2017 at 9:59 AM, Loris Bennett
> >  wrote:
> >
> >  Hi,
> >
> >  Does org-ref work with BibLaTeX?
> >
> >  With org-ref, I have an MWE using natbib that works:
> >
> >  #+LATEX_CLASS_OPTIONS: [a4paper, 11pt]
> >  #+LATEX_HEADER: \usepackage{natbib}
> >
> >  #+TITLE: MWE
> >
> >  * Introduction
> >
> >  This MWE was found on the internet (see cite:Botha).
> >
> >  bibliographystyle:abbrvnat
> >  bibliography:file.bib
> >
> >  with 'file.bib' being
> >
> >  @Online{Botha,
> >  author = {Charl Botha},
> >  title = {From org file with local bibtex to LaTeX and PDF},
> >  date = {2017-02-20},
> >  url =
> > {https://vxlabs.com/2017/02/20/from-org-file-with-local-bibtex-to-latex-and-pdf/},
> >  }
> >
> >  For org-latex-pdf-process, I'm using the following:
> >
> >  ("latexmk -g -pdf -pdflatex=\"%latex\" -shell-escape -outdir=%o
> > %f")
> >
> >  However, if I try to replace natbib by BibLaTeX via
> >
> >  #+LATEX_HEADER: \usepackage{biblatex}
> >  #+LATEX_HEADER: \addbibresource{file.bib}
> >
> >  bibliographystyle:alphabetic
> >  bibliography:file.bib
> >
> >  I get errors about the style being invalid and the \bibliography
> > only being allowed in the preamble.
> >
> >  So if it should work, does anyone have a MWE for org-ref with
> > BibLaTeX?
> >
> >  Cheers,
> >
> >  Loris
> >
> >  --
> >  This signature is currently under construction.
> >
> >  
> 



-- 

"Wisely and slow. Those stumble that run fast."
Shakespeare -- Romeo and Juliet

Dr. Detlef Steuer
Helmut-Schmidt-Universität
Fakultät WiSo
Holstenhofweg 85
22043 Hamburg

Tel:  040/6541-2819
mail: ste...@hsu-hh.de





Re: [O] [PATCH] * doc/library-of-babel.org: Replace non-existent with-temp-filebuffer.

2017-07-13 Thread Nicolas Goaziou
Hello,

Chunyang Xu  writes:

> TINYCHANGE
> ---
>  doc/library-of-babel.org | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/doc/library-of-babel.org b/doc/library-of-babel.org
> index 0098e7263..b6c90c763 100644
> --- a/doc/library-of-babel.org
> +++ b/doc/library-of-babel.org
> @@ -73,7 +73,7 @@ Read local or remote file in [[http://www.json.org/][json]] 
> format into emacs-li
>(require 'json)
>(cond
> (file
> -(with-temp-filebuffer file
> +(org-babel-with-temp-filebuffer file
>(goto-char (point-min))
>(json-read)))
> (url

Applied. Thank you.

Regards,

-- 
Nicolas Goaziou



Re: [O] command org-clock-select-task seems does not work

2017-07-13 Thread Nicolas Goaziou
Hello,

"numbch...@gmail.com"  writes:

> I want to clock-in recent tasks in Org-mode. but after I select first task
> with by pressing "1", but it does not clock-in that task.

FWIW, I cannot reproduce the problem. Could you send an ECM?

Regards,

-- 
Nicolas Goaziou



Re: [O] [PATCH] Refactor org-set-tags arguments for clarity

2017-07-13 Thread Nicolas Goaziou
Hello,

Kaushal Modi  writes:

> I recently started looking at the org-set-tags function in org.el, but then
> quickly got confused with the doc-string.
>
>   "Set the tags for the current headline.
> With prefix ARG, realign all tags in headings in the current buffer.
> When JUST-ALIGN is non-nil, only align tags."
>
> The purpose of ARG and JUST-ALIGN seems to be the exact same from the
> doc-string. On reading the code, I realized that actually ARG should have
> been called JUST-ALIGN and the JUST-ALIGN should have been called
> ALIGN-ONLY-CURRENT.
>
> The attached patch contains the updated doc-string, refactoring of the
> argument names, and renaming of the argument symbol to :align-only-current
> from 'align and 'ignore-column in org-set-tag calls. I have left most of
> the org-set-tags calls untouched where the argument values are simply t
> instead of descriptive 'align or 'ignore-column.
>
> As the patch introduces no functional changes, I have based it off maint.
> "make test" is still passing with these changes.
>
> Can you please review the patch and let me know if it's good for
> committing?

Thank you. LGTM!

Actually, I think ALIGN-ONLY-CURRENT could be merged with JUST-ALIGN,
which would have three cases (e.g., t, nil, `current'). Perhaps the
incompatibility it introduces is not acceptable though.

While you're at it, what about throwing in some test in
"test-org/set-tags"? ;)

Regards,

-- 
Nicolas Goaziou



[O] [PATCH] * doc/library-of-babel.org: Replace non-existent with-temp-filebuffer.

2017-07-13 Thread Chunyang Xu
TINYCHANGE
---
 doc/library-of-babel.org | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/doc/library-of-babel.org b/doc/library-of-babel.org
index 0098e7263..b6c90c763 100644
--- a/doc/library-of-babel.org
+++ b/doc/library-of-babel.org
@@ -73,7 +73,7 @@ Read local or remote file in [[http://www.json.org/][json]] 
format into emacs-li
   (require 'json)
   (cond
(file
-(with-temp-filebuffer file
+(org-babel-with-temp-filebuffer file
   (goto-char (point-min))
   (json-read)))
(url
-- 
2.13.1