[O] [PATCH] Make `org-tags-view' stop setting globally `org--matcher-tags-todo-only'

2017-01-18 Thread Samuel Loury
Dear all,

I would like to propose a patch for `org-tags-view' to make it stop
setting globally `org--matcher-tags-todo-only'

Setting `org--matcher-tags-todo-only' has side effects on other
commands. For instance, the following clock table changes its behavior
whether `org--matcher-tags-todo-only' is nil or '(4)

--8<---cut here---start->8---
#+BEGIN: clocktable :tags "-perso" :fileskip0 :stepskip0 :link t :maxlevel 5 
:emphasize t :link t :block today-1 :scope agenda :inherit-props t
--8<---cut here---end--->8---

I did not have time to investigate why the behavior of the clock table
is impacted by `org--matcher-tags-todo-only'. I quickly feel lost in
this code.

From c5c763a9aca8cfd8a707b0d7e814bc37f5eeafa1 Mon Sep 17 00:00:00 2001
From: Samuel Loury 
Date: Thu, 19 Jan 2017 08:39:50 +0100
Subject: [PATCH] Make `org-tags-view' stop setting globally
 `org--matcher-tags-todo-only'

`org--matcher-tags-todo-only' is used at several places in the
code.

The first call of `org-tags-view' that changes its value, like C-u
M-x org-tags-view has the side effect of making all other commands
that don't set this value explicitely rely on this value.

* lisp/org-agenda.el (org-tags-view): Add the declaration of
  `org--matcher-tags-todo-only' in the let form
---
 lisp/org-agenda.el | 1 +
 1 file changed, 1 insertion(+)

diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el
index 737e1841f..ac4bde389 100644
--- a/lisp/org-agenda.el
+++ b/lisp/org-agenda.el
@@ -4681,6 +4681,7 @@ The prefix arg TODO-ONLY limits the search to TODO entries."
 	  org-tags-match-list-sublevels)
 	 (completion-ignore-case t)
 	 rtn rtnall files file pos matcher
+	 org--matcher-tags-todo-only
 	 buffer)
 (when (and (stringp match) (not (string-match "\\S-" match)))
   (setq match nil))
-- 
2.11.0


-- 
Konubinix
GPG Key: 7439106A
Fingerprint: 5993 BE7A DA65 E2D9 06CE  5C36 75D2 3CED 7439 106A


signature.asc
Description: PGP signature


[O] How to pass table to SRC block as strings only?

2017-01-18 Thread Sébastien Brisard
Hello all,
here is a MWE

=BEGIN MWE=

#+NAME: table20170119
| col1 | col2   |
|--+|
| row1 | 1234567890 |
| row2 | a  |
| row3 | b  |
| row4 | c  |

#+BEGIN_SRC emacs-lisp :var table=table20170119 :colnames yes :results output
  (print (map 'list (lambda (row) (nth 1 row)) table))
#+END_SRC

#+RESULTS:
:
: (1234567890.0 "a" "b" "c")

=END MWE=

As you can see, col #1, row #1 is parsed as a float. I would like it
to be parsed as a string. In other words, the expected RESULTS are

=BEGIN EXPECTED RESULT=

#+RESULTS:
:
: ("1234567890" "a" "b" "c")

=END EXPECTED RESULT=

Is there an option to prevent org from interpreting the cell values? I
noticed that org-table-to-lisp returns all cells as strings. That's
the functionality I am looking for, in header arguments.

Thanks for your help,
Sébastien




[O] org-stuck-projects confuses a "Next" heading with the NEXT keyword

2017-01-18 Thread Guy Mayraz
I want every project to have a NEXT or WAIT keyword, and have defined
org-stuck-projects as follows:

(setq org-stuck-projects '("+LEVEL=2/-INACTIVE-DONE" ("NEXT" "WAIT") nil
""))

It mostly works, but it does not identify as stuck a project that has a
"Next items" subheading and no NEXT keyword.

In case this is relevant, I have org-occur-case-fold-search set to 'smart,
and this setting works as expected for org-occur, but not for
org-stuck-projects.

Thanks!!

Guy


[O] bug#25466: 25.1.91; hs-show-all broken

2017-01-18 Thread Andreas Röhler



On 17.01.2017 20:29, Glenn Morris wrote:

Andreas Röhler wrote:


With org-mode, hs-minor-mode: hs-show-all has no effect, but"Showing
all blocks ... done" is messaged.

BTW M-x show-all RET works as expected.

I don't think hideshow has ever done anything useful in Org mode, which
is Outline-based. Perhaps you are asking for a new feature of some kind.


Thanks, that seems the case. ;)
Close?





[O] Bug: "#+BEGIN_EXPORT html" not processed when generating HTML output [8.2.10 (release_8.2.10 @ /usr/local/Cellar/emacs/25.1/share/emacs/25.1/lisp/org/)]

2017-01-18 Thread Carlo Pinciroli
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.


I ran this test after launching "emacs -Q":

#+OPTIONS: toc:nil title:nil
#+BEGIN_EXPORT html
ciao
#+END_EXPORT html

Then, I exported the buffer to an html buffer (C-c e H h) and obtained
this:

=== OMITTED DEFAULT HEADER

#+BEGINEXPORT html
ciao
#+ENDEXPORT html

=== OMITTED DEFAULT FOOTER

I was expecting this instead:

=== OMITTED DEFAULT HEADER
ciao
=== OMITTED DEFAULT FOOTER

Thanks in advance for any help you can provide.






Emacs  : GNU Emacs 25.1.1 (x86_64-apple-darwin14.5.0, NS
appkit-1348.17 Version 10.10.5 (Build 14F2109))
 of 2017-01-17
Package: Org-mode version 8.2.10 (release_8.2.10 @
/usr/local/Cellar/emacs/25.1/share/emacs/25.1/lisp/org/)

current state:
==
(setq
 org-tab-first-hook '(org-hide-block-toggle-maybe
 org-src-native-tab-command-maybe
 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-html-format-drawer-function '(lambda (name contents) contents)
 org-latex-format-inlinetask-function 'ignore
 org-confirm-shell-link-function 'yes-or-no-p
 org-ascii-format-inlinetask-function 'org-ascii-format-inlinetask-default
 org-latex-format-headline-function 'org-latex-format-headline-default-function
 org-after-todo-state-change-hook '(org-clock-out-if-current)
 org-latex-format-drawer-function '(lambda (name contents) contents)
 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 '(#[nil "\300\301\302\303\304$\207"
  [org-add-hook change-major-mode-hook org-show-block-all
   append local]
  5]
#[nil "\300\301\302\303\304$\207"
  [org-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-ascii-format-drawer-function '(lambda (name contents width) contents)
 org-ctrl-c-ctrl-c-hook '(org-babel-hash-at-point
 org-babel-execute-safely-maybe)
 org-cycle-hook '(org-cycle-hide-archived-subtrees org-cycle-hide-drawers
 org-cycle-hide-inline-tasks 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-html-format-headline-function 'ignore
 org-html-format-inlinetask-function 'ignore
 org-clock-out-hook '(org-clock-remove-empty-clock-drawer)
 )



Re: [O] Org release_9.0 hangs

2017-01-18 Thread Martin Zuther

Hi!

My message from two weeks ago ("[O] Possible bug: Emacs hangs on 
(require 'org)") seems to have missed attention, so here it is again.


About every third time I start Emacs, I also experience a very slow 
startup with org-mode 9.0.3 enabled. I run "GNU Emacs 24.5.1 
(x86_64-pc-linux-gnu, GTK+ Version 3.18.9) of 2016-04-17 on lgw01-04, 
modified by Debian" on Linux Mint 18.1 Cinnamon.


Here is my minimal setup:

  ;;; Minimal setup to load latest 'org-mode'

  ;; activate debugging
  (setq debug-on-error t
debug-on-signal nil
debug-on-quit nil)

  ;; add latest org-mode to load path
  (add-to-list 'load-path "~/.emacs.d/elisp/org_9.0.3/lisp")
  (require 'org)

Adding

  Possible bug: Emacs hangs on (require 'org)

to the end of this setup file doesn't change anything.

This bug is solved by disabling my network, but in contrast to Luke , I 
have access to a fast and stable network.


Normal startup time is below one second. When the bug hits, it is around 
2 minutes and 7 seconds, which to me looks suspiciously like a typical 
network timeout of 120 seconds.


Martin



Re: [O] [PATCH] Support time units in est+

2017-01-18 Thread Malcolm Matalka
Den 18 jan. 2017 22:19 skrev "Nick Dokos" :

Malcolm Matalka  writes:

> Hey, this is my first elisp programming so I'm quite certain this is a
> big hack.  I just stole elements from elsewhere in the file.  I'm hoping
> this is good enough to get accepted then perhaps someone with more taste
> would be able to refactor it to be a bit better.
>
> Let me know if I need to change anything.
>

Yes, indeed: the first thing you should do is explain what you are
trying to do.  E.g. what does "est+" mean? Once you have explained
*what* you are trying to do, then somebody might be able to suggest
*how* to do it better (if it is a worthwhile thing to do in the first
place).


I'm not sure I understand your question.  est+ is an existing functionality
in columnview that is documented. I've brought it closer to the regular
effort functionality by supporting time units.


> From 1167bd20e042ad2ae3f2712f596d76ad8b230336 Mon Sep 17 00:00:00 2001
> From: orbitz 
> Date: Wed, 18 Jan 2017 21:18:23 +0100
> Subject: [PATCH] org-colview.el: Add support for time units to est+
>
> * lisp/org-colview.el: Add support for time units in est+.  Ranges are
interpreted just like non-range estimates.
>
> TINYCHANGE
> ---
> lisp/org-colview.el | 44 
> 1 file changed, 32 insertions(+), 12 deletions(-)
>
> diff --git a/lisp/org-colview.el b/lisp/org-colview.el
> index 45c71a028..2a5c067ac 100644
> --- a/lisp/org-colview.el
> +++ b/lisp/org-colview.el
> @@ -1288,23 +1288,43 @@ When PRINTF is non-nil, use it to format the
result."
> (/ (apply #'+ (mapcar #'org-columns--age-to-seconds ages))
>(float (length ages)
>
> -(defun org-columns--summary-estimate (estimates printf)
> +(defun org-columns--summary-estimate (estimates _)
>"Combine a list of estimates, using mean and variance.
> The mean and variance of the result will be the sum of the means
>  and variances (respectively) of the individual estimates."
>(let ((mean 0)
> -(var 0))
> +(var 0)
> +(hms-flag nil)
> +(duration-flag nil))
>  (dolist (e estimates)
> -  (pcase (mapcar #'string-to-number (split-string e "-"))
> -(`(,low ,high)
> - (let ((m (/ (+ low high) 2.0)))
> -   (cl-incf mean m)
> -   (cl-incf var (- (/ (+ (* low low) (* high high)) 2.0) (* m m)
> -(`(,value) (cl-incf mean value
> -(let ((sd (sqrt var)))
> -  (format "%s-%s"
> -  (format (or printf "%.0f") (- mean sd))
> -  (format (or printf "%.0f") (+ mean sd))
> +  (pcase (split-string e "-")
> +(`(,low ,high)
> + (dolist (time (list high low))
> +   (cond
> +(duration-flag)
> +((string-match-p org-columns--duration-re time)
> + (setq duration-flag t))
> +(hms-flag)
> +((string-match-p "\\`[0-9]+:[0-9]+:[0-9]+\\'" time)
> + (setq hms-flag t
> + (let* ((low-sec (org-columns--time-to-seconds low))
> +(high-sec (org-columns--time-to-seconds high))
> +(m (/ (+ low-sec high-sec) 2.0)))
> +   (cl-incf mean m)
> +   (cl-incf var (- (/ (+ (* low-sec low-sec) (* high-sec
high-sec)) 2.0) (* m m)
> +(`(,value) (cl-incf mean (org-columns--time-to-seconds value)
> +(let* ((sd (sqrt var))
> +   (low-second (truncate (- mean sd)))
> +   (high-second (truncate (+ mean sd)))
> +   (low
> +(cond (duration-flag (org-minutes-to-clocksum-string (/
low-second 60.0)))
> +  (hms-flag (format-seconds "%h:%.2m:%.2s" low-second))
> +  (t (format-seconds "%h:%.2m" low-second
> +   (high
> +(cond (duration-flag (org-minutes-to-clocksum-string (/
high-second 60.0)))
> +  (hms-flag (format-seconds "%h:%.2m:%.2s" high-second))
> +  (t (format-seconds "%h:%.2m" high-second)
> +  (format "%s-%s" low high

--
Nick


Re: [O] Latex export error: There's no line here to end, with an image with a caption

2017-01-18 Thread Takeshi Teshima

Hello Mr. Goaziou,
Thank you for the reply!

Wow, thank you. It worked. The problem seems to stem from my own config. 
It worked as I turned my personal settings off.


Best,
Takeshi

On 2017/01/19 7:38, Nicolas Goaziou wrote:

Hello,

Takeshi Teshima  writes:


When I try to export an org-mode file **that contains a figure with
a caption** with `#+OPTIONS: \n:t`, (See minimal example files)

to a pdf via latex-export, the exported latex file doesn't compile and
I get the following error:

```

LaTeX Error: There's no line here to end.

```

in the `*Org PDF LaTeX Output*` buffer. Thus this is an error from the
command line.

## [2]

So I go to the line of the .tex file that's specified in the error,
and the line always says:

``` latex

\end{figure}\\

```

It is fixed. Could you confirm it behaves as expected in non-trivial
cases?

Regards,






Re: [O] org-get-heading and COMMENT

2017-01-18 Thread Matt Price
:-) I look forward to seeing the improved version -- mine felt very
cumbersome!

On Wed, Jan 18, 2017 at 6:31 PM, Nicolas Goaziou 
wrote:

> Hello,
>
> Matt Price  writes:
>
> > Sorry for the delay. I am very slow with regexps!
>
> No problem. I refactored your patch and pushed it.
>
> Thank you.
>
> Regards,
>
> --
> Nicolas Goaziou
>


Re: [O] Emacs hangs sometimes for no reason

2017-01-18 Thread Eric S Fraga
On Wednesday, 18 Jan 2017 at 14:12, Samuel Loury wrote:
> For what it's worth, when this happens, I generally pkill -SIGUSR2

Thanks, this is useful.  I usually try INT, USR1, KILL but never USR2.

-- 
: Eric S Fraga (0xFFFCF67D), Emacs 26.0.50.1, Org release_9.0.3-241-gc3d67b


signature.asc
Description: PGP signature


Re: [O] org-get-heading and COMMENT

2017-01-18 Thread Nicolas Goaziou
Hello,

Matt Price  writes:

> Sorry for the delay. I am very slow with regexps!

No problem. I refactored your patch and pushed it.

Thank you.

Regards,

-- 
Nicolas Goaziou



[O] exporting columnview with properties and text

2017-01-18 Thread David Bremner

I have some 40 files like the following. I would like to export them in
some more friendly to read form without losing either properties or the
comments in between the headlines. Any ideas?

Please CC, I'm not subscribed to the list.

#+COLUMNS: %ITEM %SCORE(score){+}
* total
** Q1
*** a 
:PROPERTIES:
:score:0
:END:
- this answer is completely off base
*** b
:PROPERTIES:
:score:1.5
:END:
 - seems to be a mostly correct (if not very efficient) algorithm for
   the incorrect definition above.
*** c
:PROPERTIES:
:score:0
:END:
- blank



Re: [O] Latex export error: There's no line here to end, with an image with a caption

2017-01-18 Thread Nicolas Goaziou
Hello,

Takeshi Teshima  writes:

> When I try to export an org-mode file **that contains a figure with
> a caption** with `#+OPTIONS: \n:t`, (See minimal example files)
>
> to a pdf via latex-export, the exported latex file doesn't compile and
> I get the following error:
>
> ```
>
> LaTeX Error: There's no line here to end.
>
> ```
>
> in the `*Org PDF LaTeX Output*` buffer. Thus this is an error from the
> command line.
>
> ## [2]
>
> So I go to the line of the .tex file that's specified in the error,
> and the line always says:
>
> ``` latex
>
> \end{figure}\\
>
> ```

It is fixed. Could you confirm it behaves as expected in non-trivial
cases?

Regards,

-- 
Nicolas Goaziou



[O] Bug: clock comments [9.0.2 (9.0.2-elpaplus @ c:/USR/FJM/APP/.emacs.d/elpa/org-plus-contrib-20161214/)] {response to question}

2017-01-18 Thread Francis J. Monari, Esquire
Thank you for the prompt response

I would like all "clock" entries - with associated notes - in the CLOCK
drawer.  With org version 9 time goes to the CLOCK drawer, note goes to
the LOGBOOK drawer.

I would like all other "logbook" entries - separate entries are possible
- in the LOGBOOK drawer.

Segregating the "clock" and "logbook" entries makes drawer easier to
read for my purposes.

In version 8 org behaved in this manner.

Is it possible to retain this behavior?

Regards,

Frank.

On 1/18/2017 4:39 PM, Nicolas Goaziou wrote:
> Hello,
> 
> "Francis J. Monari, Esquire"  writes:
> 
>> Using Clock Mode to track time.
>> Org Mode starts and stops clock.  Clock entry redirected to CLOCK
>> drawer.
>> I expect to see the clock entry (time & note) appear in CLOCK drawer.
>> What happens is that clock time goes to CLOCK drawer, clock note goes to
>> LOGBOOK drawer.
>> This allocation does not make sense.  Time is properly tracked, but no
>> ability to identify activity.
>> org mode clock variables follow:
>> ;;;Org clock settings
>> (add-hook 'org-clock-in-prepare-hook 'org-resolve-clocks)
>> (setq org-clock-history-length 32)
>> (setq org-clock-idle-time 20)
>> (setq org-clock-in-resume t)
>> (setq org-clock-into-drawer "CLOCK")
> 
> Why do you specify a different drawer name if you want notes and clocks
> in the same one?
> 
> Regards,
> 



[O] [parser] feature request: column and row numbers available for table-cell elements

2017-01-18 Thread Eric S Fraga
Hello,

I have been writing a derived backend for LaTeX export which outputs the
formulae used in a table.  This is for teaching purposes where I
currently use an external spreadsheet to illustrate some simple
modelling concepts.  I would prefer to use org (as my slides are
generated by org via beamer) and am able to output a formatted table of
the formulae used in a table.

However, due to various possible hidden rows and columns that do not
appear in the exported table, the row and column references are not
easily usable directly to identify the reference entries in the table.

Would it be possible to extend the table-cell element in the parser to
add :row and :column attributes that have the internal org values, as
used by the formulae?

An example table that I have been using to test my derived backend and
which illustrates the issue is:

#+begin_src org
  |   | Strategy | Average performance |
  |---+--+-|
  | / |  |8.69 |
  | / |  |9.72 |
  | / |  |9.03 |
  |---+--+-|
  |   |1 |9.15 |
  |---+--+-|
  | / |  |9.15 |
  | / |  |7.60 |
  | / |  |7.46 |
  |---+--+-|
  |   |2 |8.07 |
  |---+--+-|
  ,#+TBLFM: @5$3=vmean(@-I..@-II);%.2f::@9$3=vmean(@-I..@-II);%.2f
#+end_src

This table does not export the first column nor any of the rows with /
in the first column.  So, in the exported table, there are only 3 rows
and 2 columns but the formulae refer to, e.g. column 3 and row 9.  I
would like to be able to annotate the output with the org row and column
numbers so need access to these data.

A screenshot of what the derived backend generates currently is attached.

thanks,
eric

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


signature.asc
Description: PGP signature


Re: [O] Bug: clock comments [9.0.2 (9.0.2-elpaplus @ c:/USR/FJM/APP/.emacs.d/elpa/org-plus-contrib-20161214/)]

2017-01-18 Thread Nicolas Goaziou
Hello,

"Francis J. Monari, Esquire"  writes:

> Using Clock Mode to track time.
> Org Mode starts and stops clock.  Clock entry redirected to CLOCK
> drawer.
> I expect to see the clock entry (time & note) appear in CLOCK drawer.
> What happens is that clock time goes to CLOCK drawer, clock note goes to
> LOGBOOK drawer.
> This allocation does not make sense.  Time is properly tracked, but no
> ability to identify activity.
> org mode clock variables follow:
> ;;;Org clock settings
> (add-hook 'org-clock-in-prepare-hook 'org-resolve-clocks)
> (setq org-clock-history-length 32)
> (setq org-clock-idle-time 20)
> (setq org-clock-in-resume t)
> (setq org-clock-into-drawer "CLOCK")

Why do you specify a different drawer name if you want notes and clocks
in the same one?

Regards,

-- 
Nicolas Goaziou



Re: [O] [PATCH] Support time units in est+

2017-01-18 Thread Nick Dokos
Malcolm Matalka  writes:

> Hey, this is my first elisp programming so I'm quite certain this is a
> big hack.  I just stole elements from elsewhere in the file.  I'm hoping
> this is good enough to get accepted then perhaps someone with more taste
> would be able to refactor it to be a bit better.
>
> Let me know if I need to change anything.
>

Yes, indeed: the first thing you should do is explain what you are
trying to do.  E.g. what does "est+" mean? Once you have explained
*what* you are trying to do, then somebody might be able to suggest
*how* to do it better (if it is a worthwhile thing to do in the first place).

> From 1167bd20e042ad2ae3f2712f596d76ad8b230336 Mon Sep 17 00:00:00 2001
> From: orbitz 
> Date: Wed, 18 Jan 2017 21:18:23 +0100
> Subject: [PATCH] org-colview.el: Add support for time units to est+
>
> * lisp/org-colview.el: Add support for time units in est+.  Ranges are 
> interpreted just like non-range estimates.
>
> TINYCHANGE
> ---
> lisp/org-colview.el | 44 
> 1 file changed, 32 insertions(+), 12 deletions(-)
>
> diff --git a/lisp/org-colview.el b/lisp/org-colview.el
> index 45c71a028..2a5c067ac 100644
> --- a/lisp/org-colview.el
> +++ b/lisp/org-colview.el
> @@ -1288,23 +1288,43 @@ When PRINTF is non-nil, use it to format the result."
> (/ (apply #'+ (mapcar #'org-columns--age-to-seconds ages))
>(float (length ages)
>  
> -(defun org-columns--summary-estimate (estimates printf)
> +(defun org-columns--summary-estimate (estimates _)
>"Combine a list of estimates, using mean and variance.
> The mean and variance of the result will be the sum of the means
>  and variances (respectively) of the individual estimates."
>(let ((mean 0)
> -(var 0))
> +(var 0)
> +(hms-flag nil)
> +(duration-flag nil))
>  (dolist (e estimates)
> -  (pcase (mapcar #'string-to-number (split-string e "-"))
> -(`(,low ,high)
> - (let ((m (/ (+ low high) 2.0)))
> -   (cl-incf mean m)
> -   (cl-incf var (- (/ (+ (* low low) (* high high)) 2.0) (* m m)
> -(`(,value) (cl-incf mean value
> -(let ((sd (sqrt var)))
> -  (format "%s-%s"
> -  (format (or printf "%.0f") (- mean sd))
> -  (format (or printf "%.0f") (+ mean sd))
> +  (pcase (split-string e "-")
> +(`(,low ,high)
> + (dolist (time (list high low))
> +   (cond
> +(duration-flag)
> +((string-match-p org-columns--duration-re time)
> + (setq duration-flag t))
> +(hms-flag)
> +((string-match-p "\\`[0-9]+:[0-9]+:[0-9]+\\'" time)
> + (setq hms-flag t
> + (let* ((low-sec (org-columns--time-to-seconds low))
> +(high-sec (org-columns--time-to-seconds high))
> +(m (/ (+ low-sec high-sec) 2.0)))
> +   (cl-incf mean m)
> +   (cl-incf var (- (/ (+ (* low-sec low-sec) (* high-sec high-sec)) 
> 2.0) (* m m)
> +(`(,value) (cl-incf mean (org-columns--time-to-seconds value)
> +(let* ((sd (sqrt var))
> +   (low-second (truncate (- mean sd)))
> +   (high-second (truncate (+ mean sd)))
> +   (low
> +(cond (duration-flag (org-minutes-to-clocksum-string (/ 
> low-second 60.0)))
> +  (hms-flag (format-seconds "%h:%.2m:%.2s" low-second))
> +  (t (format-seconds "%h:%.2m" low-second
> +   (high
> +(cond (duration-flag (org-minutes-to-clocksum-string (/  
> high-second 60.0)))
> +  (hms-flag (format-seconds "%h:%.2m:%.2s" high-second))
> +  (t (format-seconds "%h:%.2m" high-second)
> +  (format "%s-%s" low high

-- 
Nick




Re: [O] Latex Preview Fragment is not working on org 9.0.3 from elpa

2017-01-18 Thread Charles C. Berry

On Wed, 18 Jan 2017, Young-whan wrote:


I've installed the emacs-app via port, and there was no problem with Latex
Preview Fragment in a buffer at all.

Now, using the M-x package-list-packages, I've installed the latest org
9.0.3, then the latex preview is not working at all.

It comes with following error:

org-create-formula--latex-header: Symbol’s function definition is void:
org-export-get-backendError during redisplay: (eval (mode-line-mode-name))
signaled (void-function mode-line-mode-name)


That is because `org-export-get-backend' is not loaded (nor autoloaded).

You can type C-c C-e q to force loading of the org-export-* functions. Or 
put (require 'ox) in your init file.


I don't see why `org-export-get-backend' is lacking an autoload directive.

Bug??

Chuck


[O] [PATCH] Support time units in est+

2017-01-18 Thread Malcolm Matalka
Hey, this is my first elisp programming so I'm quite certain this is a
big hack.  I just stole elements from elsewhere in the file.  I'm hoping
this is good enough to get accepted then perhaps someone with more taste
would be able to refactor it to be a bit better.

Let me know if I need to change anything.

>From 1167bd20e042ad2ae3f2712f596d76ad8b230336 Mon Sep 17 00:00:00 2001
From: orbitz 
Date: Wed, 18 Jan 2017 21:18:23 +0100
Subject: [PATCH] org-colview.el: Add support for time units to est+

* lisp/org-colview.el: Add support for time units in est+.  Ranges are 
interpreted just like non-range estimates.

TINYCHANGE
---
lisp/org-colview.el | 44 
1 file changed, 32 insertions(+), 12 deletions(-)

diff --git a/lisp/org-colview.el b/lisp/org-colview.el
index 45c71a028..2a5c067ac 100644
--- a/lisp/org-colview.el
+++ b/lisp/org-colview.el
@@ -1288,23 +1288,43 @@ When PRINTF is non-nil, use it to format the result."
(/ (apply #'+ (mapcar #'org-columns--age-to-seconds ages))
   (float (length ages)
 
-(defun org-columns--summary-estimate (estimates printf)
+(defun org-columns--summary-estimate (estimates _)
   "Combine a list of estimates, using mean and variance.
The mean and variance of the result will be the sum of the means
 and variances (respectively) of the individual estimates."
   (let ((mean 0)
-(var 0))
+(var 0)
+(hms-flag nil)
+(duration-flag nil))
 (dolist (e estimates)
-  (pcase (mapcar #'string-to-number (split-string e "-"))
-(`(,low ,high)
- (let ((m (/ (+ low high) 2.0)))
-   (cl-incf mean m)
-   (cl-incf var (- (/ (+ (* low low) (* high high)) 2.0) (* m m)
-(`(,value) (cl-incf mean value
-(let ((sd (sqrt var)))
-  (format "%s-%s"
-  (format (or printf "%.0f") (- mean sd))
-  (format (or printf "%.0f") (+ mean sd))
+  (pcase (split-string e "-")
+(`(,low ,high)
+ (dolist (time (list high low))
+   (cond
+(duration-flag)
+((string-match-p org-columns--duration-re time)
+ (setq duration-flag t))
+(hms-flag)
+((string-match-p "\\`[0-9]+:[0-9]+:[0-9]+\\'" time)
+ (setq hms-flag t
+ (let* ((low-sec (org-columns--time-to-seconds low))
+(high-sec (org-columns--time-to-seconds high))
+(m (/ (+ low-sec high-sec) 2.0)))
+   (cl-incf mean m)
+   (cl-incf var (- (/ (+ (* low-sec low-sec) (* high-sec high-sec)) 
2.0) (* m m)
+(`(,value) (cl-incf mean (org-columns--time-to-seconds value)
+(let* ((sd (sqrt var))
+   (low-second (truncate (- mean sd)))
+   (high-second (truncate (+ mean sd)))
+   (low
+(cond (duration-flag (org-minutes-to-clocksum-string (/ low-second 
60.0)))
+  (hms-flag (format-seconds "%h:%.2m:%.2s" low-second))
+  (t (format-seconds "%h:%.2m" low-second
+   (high
+(cond (duration-flag (org-minutes-to-clocksum-string (/  
high-second 60.0)))
+  (hms-flag (format-seconds "%h:%.2m:%.2s" high-second))
+  (t (format-seconds "%h:%.2m" high-second)
+  (format "%s-%s" low high
 
 
 
-- 
2.11.0




Re: [O] Allowing multiple date trees in a single file

2017-01-18 Thread Samuel Wales
as an aside, just wanted to point out an alternative that i use
exclusively instead of date trees.  of course it is not for everybody
and i do not want to hijack the thread, so followups should have a
different header.

  * CONVERSATION [2017-01-15 Sun 14:09] talked with carsten

i sort these in the outline.  they are always visible at the bottom of
every subtree, in time order.  i can follow a thread by just reading
the headers.  i can quickly do a binary search to find a date.  i can
select a region without selecting parents.  they show up nicely in the
agenda.  i sort them in the agenda also.  links to them work fine.
the date information i need is there without changing visibility, yet
unobtrusive.

it might sound silly to bring it up, but everybody i have told to this
has had an aha moment and been enthusiastic.

just as an aside.

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

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

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



[O] Latex Preview Fragment is not working on org 9.0.3 from elpa

2017-01-18 Thread Young-whan
I've installed the emacs-app via port, and there was no problem with Latex
Preview Fragment in a buffer at all.

Now, using the M-x package-list-packages, I've installed the latest org
9.0.3, then the latex preview is not working at all.

It comes with following error:

org-create-formula--latex-header: Symbol’s function definition is void:
org-export-get-backendError during redisplay: (eval (mode-line-mode-name))
signaled (void-function mode-line-mode-name)

The version I'm working on is like this:

Org mode version 9.0.3 (9.0.3-elpa @
/Users/ysong/.emacs.d/elpa/org-20161224/)

GNU Emacs 25.1.1 (x86_64-apple-darwin16.5.0, NS appkit-1504.82 Version
10.12.4 (Build 16E138)) of 2017-01-09

Is this known bug or is there something I need to do more?


[O] bug#25473: 26.0.50; org-agenda tries to invoke insert-diary-entry, which does not exist

2017-01-18 Thread Glenn Morris
Kyle Meyer wrote:

> 685d3ba4a (Replace obsolete aliases of calendar functions, 2014-11-15)
> in the Org mode repo switched the commands over to the diary prefix.

There is a clear problem if Org changes aren't being synced to Emacs for
over 2 years.





[O] Bug: clock comments [9.0.2 (9.0.2-elpaplus @ c:/USR/FJM/APP/.emacs.d/elpa/org-plus-contrib-20161214/)]

2017-01-18 Thread Francis J. Monari, Esquire
List:

Using:
Emacs  : GNU Emacs 24.5.1 (i686-pc-mingw32)
 of 2015-04-11 on LEG570
Package: Org mode version 9.0.2 (9.0.2-elpaplus @
c:/USR/FJM/APP/.emacs.d/elpa/org-plus-contrib-20161214/)

Using Clock Mode to track time.
Org Mode starts and stops clock.  Clock entry redirected to CLOCK
drawer.
I expect to see the clock entry (time & note) appear in CLOCK drawer.
What happens is that clock time goes to CLOCK drawer, clock note goes to
LOGBOOK drawer.
This allocation does not make sense.  Time is properly tracked, but no
ability to identify activity.
org mode clock variables follow:
;;;Org clock settings
(add-hook 'org-clock-in-prepare-hook 'org-resolve-clocks)
(setq org-clock-history-length 32)
(setq org-clock-idle-time 20)
(setq org-clock-in-resume t)
(setq org-clock-into-drawer "CLOCK")
(setq org-clock-mode-line-total 'today)
(setq org-clock-rounding-minutes '(0 15))
(setq org-clock-sound t) ;can take file name
(setq org-clock-out-remove-zero-time-clocks nil)
(setq org-clock-out-when-done t)
(setq org-clock-persist t)
(setq org-clock-persist-query-resume t)
(org-clock-persistence-insinuate)

Any help appreciated.

Thank you

Frank.



Re: [O] Emacs-orgmode Digest, Vol 131, Issue 15

2017-01-18 Thread NULL
emacs-orgmode-requ...@gnu.org writes:

>
> Message: 1
> Date: Thu, 12 Jan 2017 18:58:16 +
> From: Kaushal Modi 
> To: emacs-org list , Bastien Guerry
>   
> Subject: [O] Hopes of making orgmanual.org the official manual?
> Message-ID:
>   
> Content-Type: text/plain; charset="utf-8"
>
> Hello all,
>
> Are there plans to have the orgmanual.org (
> http://orgmode.org/cgit.cgi/org-mode.git/tree/contrib/orgmanual.org)
> completely replace the texinfo version at some point?
>
> I believe that orgmanual.org was synchronized with the texinfo version when
> it was checked in. But I fear that if this switching to org manual step is
> delayed, there might not be enough motivation to keep orgmanual.org
> maintained.
>
> -- 
>
> Kaushal Modi
> -- next part --
> An HTML attachment was scrubbed...
> URL: 
> 
>
> --
>
> Message: 2
> Date: Thu, 12 Jan 2017 20:51:57 +0100
> From: Nicolas Goaziou 
> To: Kaushal Modi 
> Cc: emacs-org list ,  Bastien Guerry
>   
> Subject: Re: [O] Hopes of making orgmanual.org the official manual?
> Message-ID: <87eg08awf6@nicolasgoaziou.fr>
> Content-Type: text/plain
>
> Hello,
>
> Kaushal Modi  writes:
>
>> Are there plans to have the orgmanual.org (
>> http://orgmode.org/cgit.cgi/org-mode.git/tree/contrib/orgmanual.org)
>> completely replace the texinfo version at some point?
>
> The first step is to have orgmanual.org generate org.texi. We're not
> there yet because there is no 1:1 correspondence between constructs used
> in org.texi and Org syntax.
>
>> I believe that orgmanual.org was synchronized with the texinfo version
>> when it was checked in.
>
> No, it wasn't even compiling when it landed in contrib/. Now, it exports
> correctly. The process is slow, though, due to the sheer number of
> macros (900+) and some code blocks at the end that can be removed.
>
>> But I fear that if this switching to org manual step is
>> delayed, there might not be enough motivation to keep orgmanual.org
>> maintained.
>
> Note that orgmanual.org is not maintained so far. A starting point would
> be to try to update a small part of the manual and report what is
> missing in "ox-texinfo.el".
>
> As a side note, I think we could use some free (i.e., noop in
> "ox-texinfo.el") emphasis markers, e.g. "+...+", for additional syntax,
> e.g., @key{...}, or @kbd{...}.
>
> Regards,
>
> -- 
> Nicolas Goaziou
>

would love orgmode.org as manual. org manual in org!!


-- 
~nullx002 (somewhere on pale blue dot)
github.com/nullx002
bitbucket.org/nullx002
twitter.com/nullx002



Re: [O] Emacs hangs sometimes for no reason

2017-01-18 Thread Samuel Loury
For what it's worth, when this happens, I generally pkill -SIGUSR2
emacs. emacs reacts to the USR2 signal by stopping everything and start
a lisp debugging session. From there, I reset all the org caches with
this command:

--8<---cut here---start->8---
(defun konix/org-element-cache-reset-all ()
  (interactive)
  (mapc
   (lambda (file)
 (save-window-excursion
   (save-excursion
 (find-file file)
 (org-element-cache-reset)
 )
   )
 )
   (org-agenda-files)
   )
  )
--8<---cut here---end--->8---

Finally, I quit the debugging session and reset the debug on quit with
(toggle-debug-on-quit) and everything comes back to normal.

My two cents,
-- 
Konubinix
GPG Key: 7439106A
Fingerprint: 5993 BE7A DA65 E2D9 06CE  5C36 75D2 3CED 7439 106A


signature.asc
Description: PGP signature


Re: [O] org-capture-templates with multi charachter keys

2017-01-18 Thread Marco Wahl
Hi,

Roland Everaert  writes:

> Is there somewhere in the org documentation or on the internet a complete
> example of using multi-character keys in org-capture.
>
> This excerpt from the documentation is not clear to me :/
>
> "The keys that will select the template, as a string, characters only, for
> example "a" for a template to be selected with a single key, or "bt" for
> selection with two keys. When using several keys, keys using the same
> prefix key must be sequential in the list and preceded by a 2-element entry
> explaining the prefix key, for example
>
>("b" "Templates for marking stuff to buy")
>
> Moreover, can a prefix be composed of multiple characters or only one?

The following example might help you understand.  It's cut and paste
from a customize buffer for org-capture-templates.

With this customization one can use the keys x t p to get to the "tree poem"
capture.  (Tree and poem is completely artificial.)  And in the same way x t n
brings up the capture for "tree new".


#v+
For help using this buffer, see Easy Customization in the Emacs manual.

Operate on all settings in this buffer:
 Revert...   Apply   Apply and Save 

Hide Org Capture Templates:
INS DEL Choice: Value Menu Multikey description:
Keys   : x
Description: my multikeys starting with x
INS DEL Choice: Value Menu Multikey description:
Keys   : xt
Description: my submultikeys starting with xt (trees)
INS DEL Choice: Value Menu Template entry:
Keys   : xtp
Description: tree poem
Capture Type   : Value Menu Org entry
Target location: Value Menu File:
Filename   : Value Menu Literal: ~/org/refile.org
Template   : Value Menu String: 
Plist:
[ ] Key: :prepend t
[ ] Key: :immediate-finish t
[ ] Key: :jump-to-captured t
[ ] Key: :empty-lines 1
[ ] Key: :empty-lines-before 1
[ ] Key: :empty-lines-after 1
[ ] Key: :clock-in t
[ ] Key: :clock-keep t
[ ] Key: :clock-resume t
[ ] Key: :unnarrowed t
[ ] Key: :table-line-pos t
[ ] Key: :kill-buffer t
INS
INS DEL Choice: Value Menu Template entry:
Keys   : xtn
Description: new tree
Capture Type   : Value Menu Org entry
Target location: Value Menu File:
Filename   : Value Menu Literal: ~/org/refile.org
...
#v-


HTH,  Marco




[O] org-capture-templates with multi charachter keys

2017-01-18 Thread Roland Everaert
Hello,

Is there somewhere in the org documentation or on the internet a complete
example of using multi-character keys in org-capture.

This excerpt from the documentation is not clear to me :/

"The keys that will select the template, as a string, characters only, for
example "a" for a template to be selected with a single key, or "bt" for
selection with two keys. When using several keys, keys using the same
prefix key must be sequential in the list and preceded by a 2-element entry
explaining the prefix key, for example

   ("b" "Templates for marking stuff to buy")

"

Moreover, can a prefix be composed of multiple characters or only one?

Thanks for your help.


Re: [O] Allowing multiple date trees in a single file

2017-01-18 Thread Nicolas Goaziou
Hello,

Carsten Dominik  writes:

> I meant
>
> :DATE_TREE: my_diary
> :DATE_TREE: food_and_health
> :DATE_TREE: movies watched

It sounds less useful because we already have ways to identify uniquely
a heading.

> Another thing I was thinking is a way to force prompting for a date, for
> example through a prefix argument, so that a single capture template could
> be used for using the current date and optionally a set one.

It is nice, too. It would reduce the number of new capture target types
required.

Regards,

-- 
Nicolas Goaziou



Re: [O] Bug: org-clone-subtree-with-time-shift not asking for time-shift

2017-01-18 Thread Nicolas Goaziou
Hello,

Kyle Meyer  writes:

> Yes, c31462f33 resolved the issue.  That commit also introduced a
> regression: a blank string passed as the SHIFT argument causes an error.
> I've followed up with 1fbc7a424 to restore the previous behavior.

Indeed. Thank you.

Regards,

-- 
Nicolas Goaziou



[O] How to specify APPT_WARNTIME for entire files?

2017-01-18 Thread Jorge Morais Neto
Hi.  I have set appt-message-warning-time to 10.  However, there are two
files where I would like the warning time to be 0.  Is there a quick way to
do it?  Which?  I do not want to add APPT_WARNTIME properties to each entry
because, if I did that, then:
1. Every time I added a new entry to one of the affected files, I would need
   to remember setting APPT_WARNTIME to the correct value.
2. To later change the warning time for the affected files, I would need to
   change APPT_WARNTIME in each of their entries.
3. There are many such entries, so it would be space-inefficient to have
   APPT_WARNTIME in each.

I have tried to specify "#+PROPERTY: APPT_WARNTIME 5" and enable inheritance
of it through org-use-property-inheritance, but it did not work.  I have
also searched the web and the Org mailing list archives.

I am using Org mode version
9.0.3 (9.0.3-elpaplus @ /home/jorge/.emacs.d/elpa/org-plus-contrib-20161224/)
on GNU Emacs
25.1.91.1 (x86_64-unknown-linux-gnu, GTK+ Version 3.18.9) of 2016-12-31

Regards
-- 
• I am Brazilian.  I hope my English is correct and I welcome corrections.
• Please adopt free formats like PDF, ODF, Org, LaTeX, Opus, WebM and 7z.
• Free (as in free speech) software for Android: https://f-droid.org/