Re: [O] babel header argument :var is not expanded when tangling

2017-12-27 Thread Grant Rettke
They work differently. Try this example:

#+BEGIN_SRC emacs-lisp :var x="hi"
(message x)
#+END_SRC

tangles to

(let ((x (quote "hi")))
(message x))

but this

#+NAME: x
#+BEGIN_SRC emacs-lisp
"hi"
#+END_SRC

#+BEGIN_SRC emacs-lisp
(message «x»)
#+END_SRC

tangles to this

(message "hi"


Sincerely,

Grant Rettke

On Mon, Dec 25, 2017 at 6:45 AM, numbch...@gmail.com 
wrote:

>
> I see. I will use noweb style for now.
> But should tangle expand :var variables when tangling? I think this is the
> correct behaviour.
>
> [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 Sun, Dec 24, 2017 at 11:40 PM, Grant Rettke 
> wrote:
>
>> > Here is a quick test:
>> >
>> > * Test tangle will auto expand and substitute :var
>> >
>> > #+begin_src js :tangle kk.js
>> > console.log("hello, world!");
>> > #+end_src
>> >
>> > #+begin_src js :var name="chris" :tangle require-kk.js
>> > // require("kk.js");
>> > console.log("Hi, ", name);
>> > #+end_src
>> >
>> > #+RESULTS:
>> > : Hi,  chris
>> >
>> > #+NAME: check whether tangle expand and substitute :var
>> > #+begin_src shell
>> > cat require-kk.js
>> > #+end_src
>> >
>> > #+RESULTS: check whether tangle expand and substitute :var
>> > : var name="chris";
>> > : console.log("Hi, ", name);
>> >
>> > The upper result should be: ~console.log("Hi, ", "chris");~.
>>
>> Here are your two source blocks. They each do literate programming,
>> one with Variable style and the other with Noweb style. When you
>> evaluate them you get an identical result. When you tangle them you
>> get two different pieces of code, that generate the same result. You
>> can peek at what the tangled code will look like by calling
>> org-babel-expand-src-block inside the source block. That is how it
>> will look in the tangled file. I think that want Noweb style.
>>
>> When I use the Variable approach like this
>>
>> #+begin_src js :var name="chris" :tangle kk.js
>> console.log("Hi, ", name);
>> #+end_src
>>
>> I get this in the tangled output file
>>
>> var name="chris";
>> console.log("Hi, ", name);
>>
>> When I use the the Noweb approach like this
>>
>> #+NAME: name
>> #+BEGIN_SRC emacs-lisp
>> chris
>> #+END_SRC
>>
>> #+NAME: org_gcr_2017-12-23_mara_3D887FDD-163D-4BE1-80E8-464BF29DABEA
>> #+BEGIN_SRC js :tangle noweb-kk.js :comments no
>> console.log("Hi, ", "«name»");
>> #+END_SRC
>>
>> I get this in the tangled  output file
>>
>> console.log("Hi, ", "chris");
>>
>> WDYT?
>>
>
>


Re: [O] BUG: TODO statistics in parent heading prevent evaluation of TODOs with TRIGGER property

2017-12-27 Thread Nicolas Goaziou
Hello,

Adrian Bradd  writes:

> Just wanted to bump this.
>
> Let me know if there is a preferred/better way to attack this issue and
> I can give it a shot.

Oops, this was falling through the cracks.

I applied your initial patch. Thank you.

Regards,

-- 
Nicolas Goaziou



Re: [O] Preventing noweb substitution during export

2017-12-27 Thread Samuel W. Flint
Nicolas, my apologies for sending this twice.
> Nicolas Goaziou writes:

NG> Hello, swfl...@flintfam.org (Samuel W. Flint) writes:

>> I used to be able to prevent noweb substitution during export by
>> setting noweb to tangle, now it's only a yes/no option.  When was
>> this feature removed, and what can I do to get it back?

NG> I don't think that was intended. Would you have an ECM
NG> demonstrating the issue?

It didn't get removed, though no-export is now the correct value.
Neither, however, are currently documented in the manual.

NG> Regards,

NG> -- Nicolas Goaziou

And the following should demonstrate how they currently behave:

#+BEGIN_EXAMPLE
#+PROPERTY: :noweb tangle

#+name: a
#+begin_src python
  def foo():
  print "foo"
#+end_src

#+name: b
#+begin_src python

  <>

  foo()
#+end_src

#+name: c
#+begin_src python :tangle "test.py"

  import bar
  <>
#+end_src
#+END_EXAMPLE

The file 'test.py' will contain:

import bar
<>

foo()

If noweb is set to no-export, the <> will be resolved.  However, with
tangle, the block is included during export.

HTH,

Sam

-- 
Samuel W. Flint
4096R/266596F4
  (9477 D23E 389E 40C5 2F10  DE19 68E5 318E 2665 96F4)
λs.(s s) λs.(s s)



Re: [O] Bug: Caching org-publish-find-date [8.2.10 (release_8.2.10 @ /opt/emacs/lisp/org/)]

2017-12-27 Thread Nicolas Goaziou
Hello,

Lorenzo Bolla  writes:

> When using `org-publish-project` I noticed that generating a sitemap
> sorted (anti-)chronologically is very slow. It turns out that the
> slowness is due to the sorting of sitemap entries, which calls
> `org-publish-find-date` during the comparison. But
> `org-publish-find-date` is not cached therefore it is called over and
> over for each file during the sorting process.
> By contrast, `org-publish-find-title` is cached and sorting
> alphabetically is faster.
>
> To test this assumption, I've modified `ox-publish.el` to cache
>`org-publish-find-date`, too, obtaining a substantial speed-up:
>
>(defun org-publish-find-date (file)
>  (or
>   (org-publish-cache-get-file-property file :date nil t)
>   (let ((date (org-publish-find-date-uncached file)))
> (org-publish-cache-set-file-property file :date date)
> date)))
>
>(defun org-publish-find-date-uncached (file)
>  "Find the date of FILE in project.
>This function assumes FILE is either a directory or an Org file.
>If FILE is an Org file and provides a DATE keyword use it.  In
>any other case use the file system's modification time.  Return
>time in `current-time' format."
>...
>
> Is there a reason why we should not cache the date of a file, in the
> same way as we cache its title?

That's post-mature optimization. When only cache results of a function
when it is reported as horribly slow.

I added a cache for `org-publish-find-date' in master branch. Thank you.

Regards,

-- 
Nicolas Goaziou



Re: [O] Preventing noweb substitution during export

2017-12-27 Thread Nicolas Goaziou
Hello,

swfl...@flintfam.org (Samuel W. Flint) writes:

> I used to be able to prevent noweb substitution during export by setting
> noweb to tangle, now it's only a yes/no option.  When was this feature
> removed, and what can I do to get it back?

I don't think that was intended. Would you have an ECM demonstrating the
issue?

Regards,

-- 
Nicolas Goaziou



Re: [O] Bug: org-insert-link doesn't work for URL links [9.1.4 (9.1.4-13-g84cb63-elpaplus @ /Users/ag.ibragimov/.emacs.d/elpa/26.0/develop/org-plus-contrib-20171218/)]

2017-12-27 Thread Nicolas Goaziou
Hello,

Ag Ibragimov  writes:

> # Description:
> After you store a link to a heading that itself contains a URL link,
> and then insert that stored link to another .org document - it mangles the 
> link.
>
> # To reproduce
>
> 1) In a document A:
>  create a heading, make the title of the heading a link, eg.
>
> * [[https://www.google.com/][google]]
>
> 2) Store the link to the heading: `M-x org-store-link`
> 3) Insert the link in a document B: `M-x org-insert-last-stored-link`
> 4) Examine the inserted item, see that the URL is encoded and jumping
> back to the heading in document A doesn't work

Fixed. Thank you.

Regards,

-- 
Nicolas Goaziou



[O] Preventing noweb substitution during export

2017-12-27 Thread Samuel W. Flint
I used to be able to prevent noweb substitution during export by setting
noweb to tangle, now it's only a yes/no option.  When was this feature
removed, and what can I do to get it back?

Thanks,

Sam

-- 
Samuel W. Flint
4096R/266596F4
  (9477 D23E 389E 40C5 2F10  DE19 68E5 318E 2665 96F4)
λs.(s s) λs.(s s)



Re: [O] Bug: List does not fold correctly with inline tasks in the middle [9.1.4 (9.1.4-13-g84cb63-elpa @ /home/yantar92/.emacs.d/elpa/org-20171218/)]

2017-12-27 Thread Nicolas Goaziou
Hello,

'Ihor Radchenko'  writes:

> 1. Create the following same org file:
> * Test
>   - blah
> - a
> - b
> - c
> *** List folding stops here
>  :PROPERTIES:
>  :ID:   27eb85b6-114f-437f-9424-b28d400f6aa9
>  :END:
> *** END
> - everything here and below folds on tab at =**...END=
> - f
>
> 2. Try to fold at =-blah=. Everything started from inline task is not
> folded, while should.
>
> 3. Try to fold at =*... END=. Everything below *is* folded, while should
> not.

Confirmed.

This is related to:

commit a426abffa55f3b74d0c5fb09e148c1dd0d2a0e7a
Author: Marco Wahl 
Date:   Fri Dec 4 19:25:36 2015 +0100

org-inlinetask: Fix folding inlinetask children

* org-inlinetask.el(org-inlinetask-goto-end): Position point just at the
  end.  Do not forward-line.

Fixes org-cycle for state CHILDREN when the children are inlinetasks
which have immediate neigbors.

Marco, I think there is something wrong in the patch above.
`org-inlinetask-goto-end' should move point to the beginning of the next
line, not to the end of the last one. IOW, it should something like this:

(defun org-inlinetask-goto-end ()
  "Go to the end of the inline task at point.
Return point."
  (save-match-data
(beginning-of-line)
(let* ((case-fold-search t)
   (inlinetask-re (org-inlinetask-outline-regexp))
   (task-end-re (concat inlinetask-re "END[ \t]*$")))
  (cond
   ((looking-at-p task-end-re)
(forward-line))
   ((looking-at-p inlinetask-re)
(forward-line)
(cond
 ((looking-at-p task-end-re) (forward-line))
 ((looking-at-p inlinetask-re))
 ((org-inlinetask-in-task-p)
  (re-search-forward inlinetask-re nil t)
  (forward-line))
 (t nil)))
   (t
(re-search-forward inlinetask-re nil t)
(forward-line)
  (point))

The bug your patch is fixing probably lies in `org-cycle'.

WDYT?

Regards,

-- 
Nicolas Goaziou



Re: [O] Add contents-begin and contents-end to src-block in org-element.el

2017-12-27 Thread Somelauw .
2017-12-25 23:42 GMT+01:00 Nicolas Goaziou :
> I suggest the following.
>
> For contents begin:
>
> (save-excursion
>   (goto-char (org-element-property :post-affiliated element))
>   (line-beginning-position 2))
>
> For contents end:
>
> (save-excursion
>   (goto-char (org-element-property :end element))
>   (skip-chars-backward " \t\n")
>   (line-beginning-position))
>

Thanks, your code works as long as the element at point is some kind
of block element.
I have identified the following block elements:
- all elements that end with "-block
- latex-export/environment
- diary
- drawer
- export
- fixed_width

However, I'm trying to write something that works on all elements and
I want my code to continue working even if new elements are added to
org-mode.
It would be ideal if elements had the following additional properties:

- :value-begin
- :value-end

Unfortunately, they don't.

I have come to the following hackish solution:

#+BEGIN_SRC emacs-lisp
(defun org-select-inner-element ()
  "Select inner-element.
Return begin and end of inner contents of org-element at point."

  (let* ((element (org-element-context)))

;; Element has a value
(if-let ((value (org-element-property :value element)))

;; Try to return begin and end of :value property
(let ((lines (remove "" (split-string value "[\n\r]"
  (list (save-excursion
  (goto-char (org-element-property :post-affiliated element))
  (search-forward (first lines))
  (match-beginning 0))
(save-excursion
  (goto-char (org-element-property :end element))
  (search-backward (car (last lines)))
  (match-end 0

  ;; Check if element has :contents-begin and contents-end
  (if (org-element-property :contents-begin element)
  (list (org-element-property :contents-begin element)
(org-element-property :contents-end element))

;; Otherwise select the whole element
(list (org-element-property :begin element)
  (org-element-property :end element)))
  )))
#+END_SRC



[O] Bug: org-table-separator-space breaks alignment of existing tables [9.1.5 (9.1.5-1-gb3ddb0-elpaplus @ /home/il/.emacs.d/elpa/org-plus-contrib-20171225/)]

2017-12-27 Thread Ingo Lohmar

Here's a simple table example that breaks (info and columns lost etc) on
`org-table-align`.  I traced it down to org-table-separator-space ---
setting it to a plain " " (effectively the situation before the last
9.1.5 commit) works for me, but I do not understand why the change
breaks that.  Or is this "breakage" expected?

| No | Name| cpr1 | drv1 | ?ch1 | fla1 | xt12 | enh   | pit1 | 
mtd1 | dly1 | xt11 | xt1 (2) | Amp [sd0 but def.3]  | Cab   
   |   Rev | Comment|| WIP/TODO 
 |
|| |  |  |  |  |  | rt/ph/trm |  |  
|  |  | |  |
  |   |||   
|
|+-+--+--+--+--+--+---+--+--+--+--+-+--+--+---+++---|
|  0 | JC 120  |4 |  |8 |2 |  |   |  |  
  4 |2 | DlyIn 30-100% | | brt m10  | 94 2x12 slv 
alnico   |   sm room | 102bpm; orig ~CE-1 (more shimmer etc) || 
  |

I have removed a few confidential settings, none of which I believe
could have anything to do with this issue.  I have a feeling it might
have something to do with org-indent-mode (would not be the first
time)...

Thanks for the ongoing work on org-mode!

Regards,
Ingo



Emacs  : GNU Emacs 27.0.50 (build 3, x86_64-pc-linux-gnu, GTK+ Version 3.22.24)
 of 2017-12-27
Package: Org mode version 9.1.5 (9.1.5-1-gb3ddb0-elpaplus @ 
/home/il/.emacs.d/elpa/org-plus-contrib-20171225/)

current state:
==
(setq
 org-clock-persist-query-save t
 org-src-mode-hook '(org-src-babel-configure-edit-buffer 
org-src-mode-configure-edit-buffer)
 org-agenda-scheduled-leaders '("" "%3d*")
 org-after-todo-state-change-hook '(my/org-prune-logbook-entries 
org-clock-out-if-current org-checklist)
 org-agenda-tags-column 78
 org-agenda-skip-scheduled-if-deadline-is-shown 'not-today
 org-blank-before-new-entry '((heading) (plain-list-item))
 org-babel-after-execute-hook '(my/org-babel-post-execute)
 org-metadown-hook '(org-babel-pop-to-session-maybe)
 org-clock-out-hook '(org-clock-remove-empty-clock-drawer)
 org-html-format-inlinetask-function 
'org-html-format-inlinetask-default-function
 org-archive-save-context-info '(time olpath category itags ltags)
 org-src-tab-acts-natively t
 org-odt-format-headline-function 'org-odt-format-headline-default-function
 org-special-ctrl-a/e t
 org-notmuch-open-function 'org-notmuch-follow-link
 org-agenda-files '("~/Documents/personal.org" "~/Documents/contacts.org" 
"~/Documents/collect.org")
 org-ascii-format-inlinetask-function 'org-ascii-format-inlinetask-default
 org-tag-alist '(("computer" . 99) ("phone" . 112) ("read" . 114) (:startgroup) 
("@context" . 64) (:grouptags) ("@home" . 104)
 ("@work" . 119) ("@errand" . 101) (:endgroup))
 org-modules '(org-bibtex org-docview org-id org-info org-habit org-irc 
org-protocol org-indent org-checklist org-notmuch org-man
   org-contacts)
 org-startup-folded 'content
 org-cycle-include-plain-lists nil
 org-id-link-to-org-use-id 'use-existing
 org-mode-hook '(org-clock-load #[0 "\300\301!\207" [goto-address-mode -1] 2] 
#[0 "\301\211\207" [truncate-lines t] 2]
 er/add-org-mode-expansions
 #[0 "\300\301\302\303\304$\207" [add-hook 
change-major-mode-hook org-show-block-all append local] 5]
 #[0 "\300\301\302\303\304$\207" [add-hook 
change-major-mode-hook org-babel-show-result-all append local] 5]
 org-babel-result-hide-spec org-babel-hide-all-hashes 
org-eldoc-load)
 org-clock-persist 'history
 org-odt-format-drawer-function #[514 "\207" [] 3 "\n\n(fn NAME CONTENTS)"]
 org-outline-path-complete-in-steps nil
 org-archive-hook '(org-attach-archive-delete-maybe)
 org-confirm-elisp-link-function 'yes-or-no-p
 org-startup-indented t
 org-startup-with-inline-images t
 org-tag-persistent-alist '(("REFILE" . 82))
 org-agenda-skip-timestamp-if-done t
 org-todo-repeat-to-state "NEXT"
 org-agenda-before-write-hook '(org-agenda-add-entry-text)
 org-metaup-hook '(org-babel-load-in-session-maybe)
 org-bibtex-headline-format-function #[257 "\300\236A\207" [:title] 3 "\n\n(fn 
ENTRY)"]
 org-latex-format-drawer-function #[514 "\207" [] 3 "\n\n(fn _ CONTENTS)"]
 org-contacts-matcher "Email<>\"\"|Birthday<>\"\"|Phone<>\"\"|Mobile<>\"\""
 org-agenda-deadline-faces '((1.0 . org-warning) (0.5 . org-upcoming-deadline) 
(0.0 . org-scheduled))
 org-contacts-files '("~/Documents/contacts.org")
 org-notmuch-search-open-function 'org-notmuch-search-follow-link
 org-babel-pre-tangle-hook '(save-buffer)
 org-file-apps '((directory lambda (file 

[O] Bug: org-insert-link doesn't work for URL links [9.1.4 (9.1.4-13-g84cb63-elpaplus @ /Users/ag.ibragimov/.emacs.d/elpa/26.0/develop/org-plus-contrib-20171218/)]

2017-12-27 Thread Ag Ibragimov

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

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

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


# Description:
After you store a link to a heading that itself contains a URL link,
and then insert that stored link to another .org document - it mangles the link.

# To reproduce

1) In a document A:
 create a heading, make the title of the heading a link, eg.

* [[https://www.google.com/][google]]

2) Store the link to the heading: `M-x org-store-link`
3) Insert the link in a document B: `M-x org-insert-last-stored-link`
4) Examine the inserted item, see that the URL is encoded and jumping
back to the heading in document A doesn't work

Emacs  : GNU Emacs 26.0.90 (build 1, x86_64-apple-darwin16.7.0, NS 
appkit-1504.83 Version 10.12.6 (Build 16G29))
 of 2017-12-19
Package: Org mode version 9.1.4 (9.1.4-13-g84cb63-elpaplus @ 
/Users/ag.ibragimov/.emacs.d/elpa/26.0/develop/org-plus-contrib-20171218/)

current state:
==
(setq
 org-src-mode-hook '(org-src-babel-configure-edit-buffer 
org-src-mode-configure-edit-buffer)
 org-after-todo-state-change-hook '(org-clock-out-if-current)
 org-blank-before-new-entry nil
 org-babel-after-execute-hook '(spacemacs/ob-fix-inline-images)
 org-twbs-format-inlinetask-function 'ignore
 org-metadown-hook '(org-babel-pop-to-session-maybe)
 org-clock-out-hook '(org-clock-remove-empty-clock-drawer)
 org-refile-targets '((nil :maxlevel . 3) (org-agenda-files :maxlevel . 3))
 org-html-format-inlinetask-function 
'org-html-format-inlinetask-default-function
 org-enforce-todo-dependencies t
 org-src-tab-acts-natively t
 org-odt-format-headline-function 'org-odt-format-headline-default-function
 org-imenu-depth 8
 org-download-annotate-function 'org-download-annotate-default
 org-agenda-files "~/Dropbox/org/.agenda-files"
 org-ascii-format-inlinetask-function 'org-ascii-format-inlinetask-default
 org-clock-report-include-clocking-task t
 org-blocker-hook '(org-block-todo-from-checkboxes 
org-block-todo-from-children-or-siblings-or-parent)
 org-mode-hook '(er/add-org-mode-expansions abbrev-mode 
spacemacs/toggle-visual-line-navigation-on ag/org-mode-hook
 org-clock-load
 #[0 "\300\301\302\303\304$\207" [add-hook 
change-major-mode-hook org-show-block-all append local] 5]
 #[0 "\300\301\302\303\304$\207"
   [add-hook change-major-mode-hook org-babel-show-result-all 
append local] 5]
 org-babel-result-hide-spec org-babel-hide-all-hashes 
spacemacs/load-yasnippet toc-org-enable
 org-download-enable org-bullets-mode 
dotspacemacs//prettify-spacemacs-docs
 spacemacs//org-babel-do-load-languages flyspell-mode 
spacemacs/add-org-surrounds
 spacemacs//evil-org-mode 
spacemacs/delay-emoji-cheat-sheet-hook org-eldoc-load
 spacemacs//init-company-org-mode company-mode)
 org-clock-persist t
 org-odt-format-drawer-function #[514 "\207" [] 3 "\n\n(fn NAME CONTENTS)"]
 org-archive-hook '(org-attach-archive-delete-maybe)
 org-agenda-restore-windows-after-quit t
 org-confirm-elisp-link-function 'yes-or-no-p
 org-src-fontify-natively nil
 org-startup-with-inline-images t
 org-reverse-note-order t
 org-timer-done-hook '((lambda nil (hs-alert "-- timer done! --")))
 org-agenda-before-write-hook '(org-agenda-add-entry-text)
 org-metaup-hook '(org-babel-load-in-session-maybe)
 org-bibtex-headline-format-function #[257 "\300.\236A\207" [:title] 3 "\n\n(fn 
ENTRY)"]
 org-from-is-user-regexp "\\\\|\\"
 org-latex-format-drawer-function #[514 "\207" [] 3 "\n\n(fn _ CONTENTS)"]
 org-babel-pre-tangle-hook '(save-buffer)
 org-tab-first-hook '(org-babel-hide-result-toggle-maybe 
org-babel-header-arg-expand)
 org-babel-load-languages '((emacs-lisp . t) (shell . t) (js . t) (clojure . t) 
(ruby . t))
 org-log-done 'time
 org-babel-post-tangle-hook '(ag/set-tangled-file-permissions)
 org-ascii-format-drawer-function #[771 ".\207" [] 4 "\n\n(fn NAME CONTENTS 
WIDTH)"]
 org-ellipsis " ↴"
 org-list-demote-modify-bullet '(("+" . "-") ("-" . "+") ("*" . "+"))
 org-agenda-span 3
 org-fast-tag-selection-single-key t
 org-src-lang-modes '(("http" . "ob-http") ("ocaml" . tuareg) ("elisp" . 
emacs-lisp) ("ditaa" . artist)
  ("asymptote" . asy) ("dot" . fundamental) ("sqlite" . 
sql) ("calc" . fundamental) ("C" . c)
  ("cpp" . c++) ("C++" . c++) ("screen" . shell-script) 
("shell" . sh) ("bash" . sh))
 org-catch-invisible-edits 'smart
 org-occur-hook '(org-first-headline-recenter)
 org-log-into-drawer t
 org-enforce-todo-checkbox-dependencies t
 org-structure-template-alist '(("n" "#+begin_notes\n?\n#+end_notes") ("s" 
"#+begin_src ?\n\n#+end_src")
 

[O] Bug: Caching org-publish-find-date [8.2.10 (release_8.2.10 @ /opt/emacs/lisp/org/)]

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

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

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


When using `org-publish-project` I noticed that generating a sitemap
sorted (anti-)chronologically is very slow. It turns out that the
slowness is due to the sorting of sitemap entries, which calls
`org-publish-find-date` during the comparison. But
`org-publish-find-date` is not cached therefore it is called over and
over for each file during the sorting process.
By contrast, `org-publish-find-title` is cached and sorting
alphabetically is faster.

To test this assumption, I've modified `ox-publish.el` to cache
   `org-publish-find-date`, too, obtaining a substantial speed-up:

   (defun org-publish-find-date (file)
 (or
  (org-publish-cache-get-file-property file :date nil t)
  (let ((date (org-publish-find-date-uncached file)))
(org-publish-cache-set-file-property file :date date)
date)))

   (defun org-publish-find-date-uncached (file)
 "Find the date of FILE in project.
   This function assumes FILE is either a directory or an Org file.
   If FILE is an Org file and provides a DATE keyword use it.  In
   any other case use the file system's modification time.  Return
   time in `current-time' format."
   ...

Is there a reason why we should not cache the date of a file, in the
same way as we cache its title?

Thanks,
Lorenzo

Emacs  : GNU Emacs 25.1.1 (x86_64-unknown-linux-gnu, GTK+ Version 2.24.23)
 of 2016-11-01
Package: Org-mode version 8.2.10 (release_8.2.10 @ /opt/emacs/lisp/org/)