Re: [O] Bug: Clock times not summed correctly between years [9.0.9 (9.0.9-82-gb862c2-elpa @ ~/.emacs.d/elpa/org/)]

2018-01-06 Thread Nicolas Goaziou
Paul Stansell  writes:

> Thanks for that tip, I was totally unaware of that option (it doesn't seem
> to be mentioned in the user documentation, eg, it's not mentioned on
> https://orgmode.org/manual/Clocking-commands.html).

I added a reference to that variable in Org 8.2 manual. Thank you for
the heads up.

> I do wonder why the default range should be set at the current year and not
> simply over the full range of clocked times in a heading.

I don't know, but both make sense. It's only a matter of changing
a defcustom, once you know about it.

Regards,



Re: [O] Bug: Clock times not summed correctly between years [9.0.9 (9.0.9-82-gb862c2-elpa @ ~/.emacs.d/elpa/org/)]

2018-01-06 Thread Samuel Wales
default should perhaps be changed?

On 1/6/18, Paul Stansell  wrote:
> I do wonder why the default range should be set at the current year and not
> simply over the full range of clocked times in a heading.



Re: [O] Bug in Sticky Agendas

2018-01-06 Thread Nicolas Goaziou
Ian Dunn  writes:

> NG> Thank you. It looks good.
>
> NG> Could you send it again with a proper commit message so I can apply 
> it?
>
> This work?

Perfect. Applied, thank you.

Regards,



Re: [O] Bug: Clock times not summed correctly between years [9.0.9 (9.0.9-82-gb862c2-elpa @ ~/.emacs.d/elpa/org/)]

2018-01-06 Thread Paul Stansell
Hello Nicolas,

Thanks for that tip, I was totally unaware of that option (it doesn't seem
to be mentioned in the user documentation, eg, it's not mentioned on
https://orgmode.org/manual/Clocking-commands.html).

I do wonder why the default range should be set at the current year and not
simply over the full range of clocked times in a heading.

Kind regards,

Paul



On 7 January 2018 at 00:32, Nicolas Goaziou  wrote:

> Hello,
>
> Paul Stansell  writes:
>
> > The sum of the clock time seems to be summing just times in the current
> > year.  In the example below typing C-c C-x C-d in the "Example" section
> > displays "1:00" instead of "2:00" on the heading line.  The clocktable
> > computes the sum correctly as "2:00".
>
> See `org-clock-display-default-range'.
>
> Regards,
>
> --
> Nicolas Goaziou
>


Re: [O] Bug: Clock times not summed correctly between years [9.0.9 (9.0.9-82-gb862c2-elpa @ ~/.emacs.d/elpa/org/)]

2018-01-06 Thread Nicolas Goaziou
Hello,

Paul Stansell  writes:

> The sum of the clock time seems to be summing just times in the current
> year.  In the example below typing C-c C-x C-d in the "Example" section
> displays "1:00" instead of "2:00" on the heading line.  The clocktable
> computes the sum correctly as "2:00".

See `org-clock-display-default-range'.

Regards,

-- 
Nicolas Goaziou



Re: [O] Org agenda

2018-01-06 Thread Brett Viren
"M. P."  writes:

> I create a TODO and save the file but I can’t see the todo when I
> select todo view in agenda? What am I doing wrong?

Maybe your file is not in the org-agenda-files list.  If so, a quick
check is to visit the file and do "C-c [" (org-agenda-file-to-front).
Then, recheck your agenda todo view.

-Brett.


signature.asc
Description: PGP signature


Re: [O] Bug in Sticky Agendas

2018-01-06 Thread Ian Dunn

NG> Thank you. It looks good.

NG> Could you send it again with a proper commit message so I can apply it?

This work?

>From df299def392a93a2adf41ae3cd740b54382d64b0 Mon Sep 17 00:00:00 2001
From: Ian Dunn 
Date: Sat, 6 Jan 2018 17:29:11 -0500
Subject: [PATCH] org-agenda: Fix lprops when recreating sticky agendas

* lisp/org-agenda.el (org-agenda-lprops): New variable.
  (org-agenda-local-vars): Add it.
  (org-agenda-prepare): Set lprops from symbol property.
  (org-agenda-redo): Get lprops from variable, not property.
---
 lisp/org-agenda.el | 8 +++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el
index c67f6e024..bf406f193 100644
--- a/lisp/org-agenda.el
+++ b/lisp/org-agenda.el
@@ -2145,6 +2145,7 @@ When nil, `q' will kill the single agenda buffer."
 (defvar org-agenda-this-buffer-is-sticky nil)
 (defvar org-agenda-last-indirect-buffer nil
   "Last buffer loaded by `org-agenda-tree-to-indirect-buffer'.")
+(defvar org-agenda-lprops nil)
 
 (defconst org-agenda-local-vars
   '(org-agenda-this-buffer-name
@@ -2173,6 +2174,7 @@ When nil, `q' will kill the single agenda buffer."
 org-agenda-filtered-by-category
 org-agenda-filter-form
 org-agenda-cycle-counter
+org-agenda-lprops
 org-agenda-last-prefix-arg)
   "Variables that must be local in agenda buffers to allow multiple buffers.")
 
@@ -3752,6 +3754,10 @@ FILTER-ALIST is an alist of filters we need to apply when
 	  (org-uniquify org-done-keywords-for-agenda))
 	(setq org-agenda-last-prefix-arg current-prefix-arg)
 	(setq org-agenda-this-buffer-name org-agenda-buffer-name)
+	;; Don't set these until we know we're in the agenda buffer,
+	;; and we know they're valid.
+	(setq org-agenda-lprops (or org-agenda-lprops
+(get 'org-agenda-redo-command 'org-lprops)))
 	(and name (not org-agenda-name)
 	 (setq-local org-agenda-name name)))
   (setq buffer-read-only nil
@@ -7315,7 +7321,7 @@ in the agenda."
 	 (cols org-agenda-columns-active)
 	 (line (org-current-line))
 	 (window-line (- line (org-current-line (window-start
-	 (lprops (get 'org-agenda-redo-command 'org-lprops))
+	 (lprops org-agenda-lprops)
 	 (redo-cmd (get-text-property p 'org-redo-cmd))
 	 (last-args (get-text-property p 'org-last-args))
 	 (org-agenda-overriding-cmd (get-text-property p 'org-series-cmd))
-- 
2.15.1


-- 
Ian Dunn


[O] Org agenda

2018-01-06 Thread M. P.
I create a TODO and save the file but I can’t see the todo when I select todo 
view in agenda? What am I doing wrong?


[O] Bug: Clock times not summed correctly between years [9.0.9 (9.0.9-82-gb862c2-elpa @ ~/.emacs.d/elpa/org/)]

2018-01-06 Thread Paul Stansell
Hello,

The sum of the clock time seems to be summing just times in the current
year.  In the example below typing C-c C-x C-d in the "Example" section
displays "1:00" instead of "2:00" on the heading line.  The clocktable
computes the sum correctly as "2:00".

Thanks

# Start Example 
#+BEGIN: clocktable :maxlevel 2 :scope file
#+CAPTION: Clock summary at [2018-01-06 Sat 21:57]
| Headline | Time   |
|--+|
| *Total time* | *2:00* |
|--+|
| Example  | 2:00   |
#+END:

* DONE Example
  :END:
  :CLOCK:
  CLOCK: [2018-01-06 Sat 20:00]--[2018-01-06 Sat 20:30] =>  0:30
  CLOCK: [2018-01-06 Sat 19:30]--[2018-01-06 Sat 20:00] =>  0:30
  CLOCK: [2017-01-06 Fri 20:00]--[2017-01-06 Fri 20:30] =>  0:30
  CLOCK: [2017-01-06 Fri 19:30]--[2017-01-06 Fri 20:00] =>  0:30
  :END:

# End Example --




Emacs  : GNU Emacs 24.5.1 (x86_64-redhat-linux-gnu, GTK+ Version 2.24.23)
 of 2015-08-26 on localhost.localdomain
Package: Org mode version 9.0.9 (9.0.9-82-gb862c2-elpa @ ~/.emacs.d/elpa/org/)

current state:
==
(setq
 org-tab-first-hook '(org-babel-hide-result-toggle-maybe
org-babel-header-arg-expand)
 org-speed-command-hook '(org-speed-command-default-hook
org-babel-speed-command-hook)
 org-occur-hook '(org-first-headline-recenter)
 org-metaup-hook '(org-babel-load-in-session-maybe)
 org-confirm-shell-link-function 'yes-or-no-p
 org-after-todo-state-change-hook '(org-clock-out-if-current)
 org-src-mode-hook '(org-src-babel-configure-edit-buffer
org-src-mode-configure-edit-buffer)
 org-agenda-before-write-hook '(org-agenda-add-entry-text)
 org-babel-pre-tangle-hook '(save-buffer)
 org-mode-hook '(#[0 "\300\301\302\303\304$\207"
   [add-hook change-major-mode-hook org-show-block-all append local] 5
   "\n\n(fn)"]
 #[0 "\300\301\302\303\304$\207"
   [add-hook change-major-mode-hook org-babel-show-result-all
append local] 5
   "\n\n(fn)"]
 org-babel-result-hide-spec org-babel-hide-all-hashes)
 org-archive-hook '(org-attach-archive-delete-maybe)
 org-cycle-hook '(org-cycle-hide-archived-subtrees org-cycle-hide-drawers
  org-cycle-show-empty-lines
org-optimize-window-after-visibility-change)
 org-confirm-elisp-link-function 'yes-or-no-p
 org-metadown-hook '(org-babel-pop-to-session-maybe)
 org-link-parameters '(("id" :follow org-id-open)
   ("rmail" :follow org-rmail-open :store org-rmail-store-link)
   ("mhe" :follow org-mhe-open :store org-mhe-store-link)
   ("irc" :follow org-irc-visit :store org-irc-store-link)
   ("info" :follow org-info-open :export org-info-export :store
org-info-store-link)
   ("gnus" :follow org-gnus-open :store org-gnus-store-link)
   ("docview" :follow org-docview-open :export
org-docview-export :store
org-docview-store-link)
   ("bibtex" :follow org-bibtex-open :store org-bibtex-store-link)
   ("bbdb" :follow org-bbdb-open :export org-bbdb-export :complete
org-bbdb-complete-link :store org-bbdb-store-link)
   ("w3m" :store org-w3m-store-link) ("file+sys") ("file+emacs")
   ("doi" :follow org--open-doi-link)
   ("elisp" :follow org--open-elisp-link)
   ("file" :complete org-file-complete-link)
   ("ftp" :follow (lambda (path) (browse-url (concat "ftp:" path
   ("help" :follow org--open-help-link)
   ("http" :follow (lambda (path) (browse-url (concat
"http:" path
   ("https" :follow (lambda (path) (browse-url (concat
"https:" path
   ("mailto" :follow (lambda (path) (browse-url (concat
"mailto:; path
   ("message" :follow
(lambda (path) (browse-url (concat "message:" path
   ("news" :follow (lambda (path) (browse-url (concat
"news:; path
   ("shell" :follow org--open-shell-link))
 org-clock-out-hook '(org-clock-remove-empty-clock-drawer)
 )



[O] clocktable :formula not working for columns > $9

2018-01-06 Thread Brian J Hoskins
org-mode development team,

When generating a clocktable and using the :formula parameter, attempts
to manipulate columns > $9 are unsuccessful.

For example, consider the attached (anonymised) screen-grab of the
output from a clocktable in one of my org files.

As a test, I have used the :formula parameter to create sequential
columns.  It works up to and including column 9, but fails thereafter.
No error is generated.  Here is the generated #+TBLFM line:

#+TBLFM: @1$4 = (4)::@1$5 = (5)::@1$6 = (6)::@1$7 = (7)::@1$8 =
(8)::@1$9 = (9)::@1$10 = (10)::@1$11 = (11)

This formula works fine on tables that I create myself.  It only fails
to work in clocktables.

If this failure can be repeated by other org-mode users, perhaps we
should file a bug report.


-- 
++
| Brian J Hoskins BSc MIET   |
| Electronics Engineer & Computer Programmer |
+--+-+
| WEB: | brianhoskins.uk |
| GIT: | github.com/bh4017   |
| PGP: | keybase.io/bjh  |
+--+-+


Re: [O] problem with empty column

2018-01-06 Thread Eric S Fraga
On Saturday,  6 Jan 2018 at 09:37, Uwe Brauer wrote:
> The column of reference is E1 per default, which is the second one. The

Ah, okay, I understand now.  Thanks.

I see that you have been given a solution elsewhere using vmean but
you could also consider adding "N" to the expression (i.e. after
;E).  This would make the empty entries be treated as having a 0 value
so your check for nan would no longer work but you could always check
for 0...  The following works:

| Name   | E1 | E2 | E3 | E4 | Res |
|+++++-|
| Entry1 |||||  NP |
| Entry2 | 10 | 20 | 30 | 40 |  10 |
| Entry3 | 10 || 20 | 30 |   6 |
#+TBLFM: $6=if("$2" == "(0)" , string("NP"),($2+$3+$4+$5)/10);EN

HTH,
eric

-- 
Eric S Fraga via Emacs 27.0.50, Org release_9.1.6


signature.asc
Description: PGP signature


Re: [O] Equation references in HTML export

2018-01-06 Thread Nicolas Goaziou
Hello,

Thibault Marin  writes:

> From 094df613ec5fd05b6d2124bc45e6f9a8cbef92e5 Mon Sep 17 00:00:00 2001
> From: thibault 
> Date: Thu, 4 Jan 2018 21:23:59 -0600
> Subject: [PATCH] ox-html.el: Add MathJax label and reference to equations in
>  HTML export

Thank you. Some comments follow.

> * lisp/ox-html.el (org-html-format-latex): Add "\label" to latex
> environment as done for latex export.  Add optional input
> `latex-environment' to trigger the insertion.
> (org-html-latex-environment): Pass unprocessed latex-environment to
> `org-html-format-latex' when using MathJax.
> (org-html-link): Replace rendering of link from "" to
> "\ref{}" for equations when using MathJax.

I'm not convinced that inserting label and, more importantly, caption
within the environment is the way to go. For example, that will not work
when `org-html-with-latex' is set `verbatim'. Couldn't we simply wrap
a HTML label and caption above, or below, the whole environment so it
DTRT in all cases?

> * lisp/ox-latex.el (org-latex--label): Abstract code constructing the
> label id into new function.
> (org-latex--label-id): New function to construct the label id (used when
> inserting labels for latex or html export).

If `--' means that the function, or variable, is internal to the library
where it is defined, and should not be used elsewhere. If you intend to
export it into another library, please drop the "--" part.

> (org-latex--insert-environment-label): New function to insert label into
> buffer containing latex environment string (for use in latex and html
> export).

I don't think this function is needed. See below.

> (org-latex-latex-environment): Use new function
> `org-latex--insert-environment-label' to insert environment label.
> ---
>  lisp/ox-html.el  | 66 +++-
>  lisp/ox-latex.el | 70 
> 
>  2 files changed, 85 insertions(+), 51 deletions(-)
>
> diff --git a/lisp/ox-html.el b/lisp/ox-html.el
> index 90a6cede0..b5257653c 100644
> --- a/lisp/ox-html.el
> +++ b/lisp/ox-html.el
> @@ -180,7 +180,9 @@
>  (:creator "CREATOR" nil org-html-creator-string)
>  (:with-latex nil "tex" org-html-with-latex)
>  ;; Retrieve LaTeX header for fragments.
> -(:latex-header "LATEX_HEADER" nil nil newline)))
> +(:latex-header "LATEX_HEADER" nil nil newline)
> +;; Options for LaTeX environments
> +(:latex-caption-above nil nil org-latex-caption-above)))

Do we need to rely on `org-latex-caption-above', which is LaTeX
specific? We could instead extend `org-html-table-caption-above' to
handle LaTeX environments, and rename it `org-html-caption-above'.

WDYT?

>  
>  ;;; Internal Variables
> @@ -2788,14 +2790,23 @@ CONTENTS is nil.  INFO is a plist holding contextual 
> information."
>  
>   Latex Environment
>  
> -(defun org-html-format-latex (latex-frag processing-type info)
> +(defun org-html-format-latex (latex-frag processing-type info
> +   latex-environment)
>"Format a LaTeX fragment LATEX-FRAG into HTML.
>  PROCESSING-TYPE designates the tool used for conversion.  It can
>  be `mathjax', `verbatim', nil, t or symbols in
>  `org-preview-latex-process-alist', e.g., `dvipng', `dvisvgm' or
>  `imagemagick'.  See `org-html-with-latex' for more information.
>  INFO is a plist containing export properties."

LATEX-ARGUMENT needs to be documented in the docstring.

> +  (type (when latex-environment
> +  (org-latex--environment-type latex-environment)))

Nitpick:

  (and latex-environment
   (or-latex--environment-type ...))

> +  (caption-above-p

Nitpick:

  caption-above-p -> caption-above?

Also, instead of (append ... '(math)), use

 (cons 'math ...)

This is strange BTW, because `math' is not a valid value for
`org-latex-caption-above', and when TYPE is not `math', no caption is
defined (per the first `and' branch), so CAPTION-ABOVE? doesn't make any
sense.

> +   (memq type (append (plist-get info :latex-caption-above) '(math
> +  (caption (when (and (eq type 'math)
> +  (eq processing-type 'mathjax))
> + (org-latex--label latex-environment info nil t

  (and (eq type 'math)
   (eq processing-type 'mathjax)
   (org-latex--label ...))

Since CAPTION-ABOVE? depends on CAPTION, I suggest to define them the
other way around:

  (caption (and (eq type 'math)
(eq processing-type 'mathjax)
(org-latex--label ...)))
  (caption-above?
   (and caption
(memq type (cons 'math 
 (plist-get info :latex-caption-above)

>  (with-temp-buffer
>(insert latex-frag)
> +  (when (and latex-environment caption)
> + (org-latex--insert-environment-label caption caption-above-p))

No need for `org-latex--insert-environment-label':

  

Re: [O] [PATCH] documentation fix

2018-01-06 Thread Nicolas Goaziou
Hello,

Alex Branham  writes:

> I tripped myself up by trying to set org-agenda-show-log instead of
> org-agenda-start-with-log, so hopefully this patch will help other
> people down the line.

Applied. Thank you.

Regards,

-- 
Nicolas Goaziou



Re: [O] Bug in Sticky Agendas

2018-01-06 Thread Nicolas Goaziou
Hello,

Ian Dunn  writes:

> I went ahead and looked into this myself. Looks like the issue is that
> the properties (lprops) are set using symbol properties with
> org-agenda-redo-command, which is buffer-local. However, according to
> the elisp manual (at least for the upcoming 26.1 release), symbol
> properties aren't buffer-local; only the value itself is. Thus, lprops
> are overridden by a new agenda.
>
> I've created the following patch to address this. The symbol property
> is used as a temporary variable, but the actual lprops are stored as
> a buffer-local variable to each agenda buffer.

Thank you. It looks good.

Could you send it again with a proper commit message so I can apply it?

Regards,

-- 
Nicolas Goaziou



Re: [O] [PATCH] * contrib/manual.org: Add org-capture-templates to Variable Index

2018-01-06 Thread Nicolas Goaziou
Hello,

Xu Chunyang  writes:

> I notice 'C-h S' ('info-lookup-symbol') can't find
> 'org-capture-templates', adding the variable to (info "(org) Variable
> Index") should fix this issue.

Applied. Thank you.

> I don't know if I should change org.texi instead or both of them.

On master, the primary target for such changes is "manual.org". On
maint, it is still "org.texi".

I propagated your change to "org.texi".

Regards,

-- 
Nicolas Goaziou



Re: [O] problem with empty column

2018-01-06 Thread Uwe Brauer
>>> "Michael" == Michael Brand  writes:

Hi Michael
   >  if(typeof(vmean($1..$7)) == 12, string(""), vmean($1..$7); E

This is precisely what I was looking for, thanks a lot. I meanwhile
circumvent the problem by

| Name   | E1 | E2 | E3 | E4 | Pre | Res |
|+++++-+-|
| Entry1 |||||   0 |  NP |
| Entry2 | 10 | 20 | 30 | 40 | 100 |  10 |
| Entry3 | 10 || 20 | 30 |  60 |   6 |
#+TBLFM: $6=$2+$3+$4+$5::$7=if("$2" == "nan", string("NP"),$6/10);E


But your solution is much more elegant.




Re: [O] problem with empty column

2018-01-06 Thread Uwe Brauer
>>> "Eric" == Eric S Fraga  writes:

   > On Friday,  5 Jan 2018 at 13:44, Uwe Brauer wrote:
   >> What I meant is this.

   > I understood what you meant and your code is working properly.  You
   > are checking the second column which is the column labelled E1, not
   > the one labelled E2 which is actually the third column... change your
   > if statement to check $3, not $2.

Maybe the format of the table was distorted.

| Name   | E1 | E2 | E3 | E4 | Res |
|+++++-|
| Entry1 |||||  NP |
| Entry2 | 10 | 20 | 30 | 40 |  10 |
| Entry3 | 10 || 20 | 30 | nan |
#+TBLFM: $6=if("$2" == "nan" , string("NP"),($2+$3+$4+$5)/10);E

The column of reference is E1 per default, which is the second one. The
row labeled Entry1 gives the expected result, NP, since its E1 entry is
empty but in the row labeled Entry3 E1 is not empty, so the second part
of the statement should be applied resulting in 6, but it does not it
results in nan, which I don't understand. The fact that E2 ($3) is empty
should be irrelevant here, but it is not.

On the other hand

| Name   | E1 | E2 | E3 | E4 | Res |
|+++++-|
| Entry1 |||||  NP |
| Entry2 | 10 | 20 | 30 | 40 |  10 |
| Entry3 | 10 |  0 | 20 | 30 |   6 |
#+TBLFM: $6=if("$2" == "nan" , string("NP"),($2+$3+$4+$5)/10);E

Gives the expected result, that is adding 0 to E2 in row Entry3.

I am puzzled

Uwe