Re: [O] How about lifting the limit of 35 tasks in org-clock-history?

2018-10-01 Thread Marcin Borkowski

On 2018-09-06, at 16:18, Nicolas Goaziou  wrote:

> Hello,
>
> Marcin Borkowski  writes:
>
>> I decided to put a warning about this in the docstring in my patch.  My
>> assumption was that this is enough.  If a user wants to change the
>> default, he will most probably see the docstring and will have to
>> actively ignore the warning.
>
> I don't think this is enough. As you put it, it instills doubt without
> explaining anything. Why 35? Why "may not work"? What "may not work"?

Agreed.  I attach a patch with a more verbose docstring.

It is perhaps still not ideal - in particular, the warning is not
visible in the Customize interface - but I do not think this is a big
deal.  My line of thinking is that:

- if a user wants to change this setting, they will either look up the
  docstring and understand the limitation (btw, even the built-in way
  works for org-clock-history-length as high as 76 or so, provided you
  have a really high frame), or

- use Customize, which is potentially a trouble - but in that case,
  I would assume that the user fiddles with org-clock-history-length
  because they clock in many tasks, and then they will see that the list
  in the *Clock Task Select* buffer is too long anyway, and dial the
  setting down.

An alternative could be to change the hard-coded 35 in the code into yet
another variable, say, org-clock-history-max-length, and set it to 35.
Still, if a user wants to increase org-clock-history-length beyond 35
(or whatever this could be changed to), it is IMHO the /current/
behavior which is really confusing, and introducing a cap on the cap
would only make things worse.

WDYT?

--
Marcin Borkowski
http://mbork.pl
>From bd5c4b7f3afe6a906b91e7f0bd33e2842fcf8656 Mon Sep 17 00:00:00 2001
From: Marcin Borkowski 
Date: Fri, 31 Aug 2018 07:53:42 +0200
Subject: [PATCH] Lift the artificial limit on the clock history length.

The default limit of 35 was hard-coded, and was especially annoying
when using an alternative way of selecting from history,
e.g. https://github.com/unhammer/org-mru-clock.
---
 lisp/org-clock.el | 7 +--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/lisp/org-clock.el b/lisp/org-clock.el
index 9819fcff2..71ed99f69 100644
--- a/lisp/org-clock.el
+++ b/lisp/org-clock.el
@@ -156,7 +156,10 @@ state to switch it to."
 	  (symbol :tag "Function")))
 
 (defcustom org-clock-history-length 5
-  "Number of clock tasks to remember in history."
+  "Number of clock tasks to remember in history.
+Clocking in using history works best if this is at most 35, in
+which case all digits and capital letters are used up by the
+*Clock Task Select* buffer."
   :group 'org-clock
   :type 'integer)
 
@@ -534,7 +537,7 @@ cannot be translated."
 
 (defun org-clock-history-push (&optional pos buffer)
   "Push a marker to the clock history."
-  (setq org-clock-history-length (max 1 (min 35 org-clock-history-length)))
+  (setq org-clock-history-length (max 1 org-clock-history-length))
   (let ((m (move-marker (make-marker)
 			(or pos (point)) (org-base-buffer
 	  (or buffer (current-buffer)
-- 
2.19.0



[O] Bug: org-insert-structure-template leaves point at inconvenient place [9.1.14 (9.1.14-932-gf82a30-elpaplus @ .emacs.d/elpa/org-plus-contrib-20180923/)]

2018-10-01 Thread Allen Li
org-insert-structure-template (C-c C-,) leaves point at an inconvenient
place (X marks the spot):

#+begin_example
X#+end_example

My expectation is that right after inserting the template, I can start
typing or yank right into it:

#+begin_example
X
#+end_example

Emacs  : GNU Emacs 26.1 (build 1, x86_64-pc-linux-gnu, GTK+ Version
3.22.24), modified by Debian
Package: Org mode version 9.1.14 (9.1.14-932-gf82a30-elpaplus @
/usr/local/google/home/ayatane/.emacs.d/elpa/org-plus-contrib-20180923/)



Re: [O] Emacs-orgmode Digest, Vol 151, Issue 21

2018-10-01 Thread Mario Bermonti Pérez
Help

Cordialmente,
Mario
—
Mario E. Bermonti Pérez, M.A.
Doctoral Student
Department of Psychology
Universidad de Puerto Rico-Río Piedras
Director of Institutional Assessment
Academic Affairs
Ponce Health Sciences University
Research and Statistical Consultant
School of Behavioral and Health Sciences
Ponce Health Sciences University

From: Emacs-orgmode  on 
behalf of emacs-orgmode-requ...@gnu.org 
Sent: Thursday, September 20, 2018 12:00:17 PM
To: emacs-orgmode@gnu.org
Subject: Emacs-orgmode Digest, Vol 151, Issue 21

Send Emacs-orgmode mailing list submissions to
emacs-orgmode@gnu.org

To subscribe or unsubscribe via the World Wide Web, visit
https://lists.gnu.org/mailman/listinfo/emacs-orgmode
or, via email, send a message with subject or body 'help' to
emacs-orgmode-requ...@gnu.org

You can reach the person managing the list at
emacs-orgmode-ow...@gnu.org

When replying, please edit your Subject line so it is more specific
than "Re: Contents of Emacs-orgmode digest..."


Today's Topics:

   1. Re: Difference between documentation and effective syntax for
  anchored images in odt export (Nicolas Goaziou)
   2. Re: "Refiled from..." Notes in LOGBOOK - Feature suggestion
  (Nicolas Goaziou)
   3. org-babel: capturing the output of a shell command that does
  not return (garj...@garjola.net)
   4. bug#32722:  bug#32722: bug#32722: 26.1; Org-publish depend on
  non-free platform ? (Kaushal Modi)
   5. bug#32722:  bug#32722: 26.1; Org-publish depend on non-free
  platform ? (Richard Stallman)
   6. bug#32722: 26.1; Org-publish depend on non-free platform ?
  (Richard Stallman)
   7. bug#32722:  bug#32722: bug#32722: 26.1; Org-publish depend on
  non-free platform ? (Richard Stallman)
   8. bug#32722: 26.1; Org-publish depend on non-free platform ?
  (Eli Zaretskii)
   9. bug#32722:  bug#32722: bug#32722: 26.1; Org-publish depend on
  non-free platform ? (Eli Zaretskii)
  10. Re: bug#32722: 26.1; Org-publish depend on non-free platform
  ? (Adam Porter)
  11. bug#32722:  bug#32722: bug#32722: 26.1; Org-publish depend on
  non-free platform ? (Eli Zaretskii)
  12. bug#32722:  bug#32722:  bug#32722: bug#32722: 26.1;
  Org-publish depend on non-free platform ? (Robert Klein)
  13. [o] org-capture regression? (Thomas Holst)
  14. bug#32722:  bug#32722: bug#32722: bug#32722: 26.1;
  Org-publish depend on non-free platform ? (Joe Corneli)
  15. bug#32722:  bug#32722: 26.1; Org-publish depend on non-free
  platform ? (Nicolas Goaziou)
  16. Re: [o] org-capture regression? (Nicolas Goaziou)
  17. Re: bug#32722:  bug#32722: 26.1; Org-publish depend on
  non-free platform ? (Bingo UV)
  18. Expandin Org Babel snippets (Lorenzo Bolla)
  19. Re: [o] org-capture regression? (Thomas Holst)
  20. Re: Expandin Org Babel snippets (Robert Klein)
  21. bug#32722:  bug#32722: 26.1; Org-publish depend on non-free
  platform ? (Michael Albinus)
  22. bug#32722:  bug#32722:  bug#32722: 26.1; Org-publish depend
  on non-free platform ? (Bingo UV)


--

Message: 1
Date: Wed, 19 Sep 2018 19:37:45 +0200
From: Nicolas Goaziou 
To: Laurent Geneste 
Cc: emacs-orgmode@gnu.org
Subject: Re: [O] Difference between documentation and effective syntax
for anchored images in odt export
Message-ID: <87o9ctie1i@nicolasgoaziou.fr>
Content-Type: text/plain

Hello,

Laurent Geneste  writes:

> I tried to use the following code (as documented in 
> https://orgmode.org/org.html#Images-in-ODT-export) to change the anchor of an 
> image exported with ox-odt:
> #+ATTR_ODT: :anchor "as-char"
> [[./orgmode.png]]
>
> However this does not work in org-mode (9.1.14) and after asking the question 
> to the community (
> https://emacs.stackexchange.com/q/44787/9245), it seems that the quotes 
> should not be present. The following code works as expected;
>
> #+ATTR_ODT: :anchor as-char
> [[./orgmode.png]]
>
> May be the documentation should be updated on this point ?

You are right. Fixed. Thank you.

Regards,

--
Nicolas Goaziou



--

Message: 2
Date: Wed, 19 Sep 2018 19:40:12 +0200
From: Nicolas Goaziou 
To: Stanislav Vlasov 
Cc: emacs-orgmode@gnu.org
Subject: Re: [O] "Refiled from..." Notes in LOGBOOK - Feature
suggestion
Message-ID: <87k1nhidxf@nicolasgoaziou.fr>
Content-Type: text/plain

Hello,

Stanislav Vlasov  writes:

> It could be useful to have a note about the place where the entry was
> refiled from. Like so:
>
> * TODO Note on where the entry was refiled from
> :LOGBOOK:
> - Refiled on [2016-04-04 Mon 00:57] from ~/emacs-tasks.org::*Tasks%20workflow
> - Refiled on [2015-05-15 Fri 13:53] from ~/stuff.org
> - State "TODO"   from ""   [2015-05-15 Fri 13:53]
> :END:
>
> The current options with org-log-refile in only allow to log time of
> refile event or prompt for a note.
>
> The problem is

Re: [O] Concatenating Org property values from parent subtrees

2018-10-01 Thread Kaushal Modi
On Mon, Oct 1, 2018 at 11:50 AM Ihor Radchenko  wrote:

> Hi,
>
> Check out the following code:
>
> 
> (defvar org-concatenated-properties '("AA")
>   "A list of property names (strings), which should be computed via
> concatenation with the parent properties.")
>
> (define-advice org-entry-get (:around (oldfun pom property &optional
> inherit literal-nil) concatenate-parents-maybe)
>

Hello Ihor,

That code is perfect!

I was able to get what I want with minor refactoring. Thanks!

Refactored code:

=
(defvar org-concatenated-properties '("AA")
  "List of property names whose values are allowed to be concatenated.
The list is of type '(PROP1 PROP2 ..) where each element is a string.")

(defvar org-property-concat-string "/"
  "String use to concat the `org-concatenated-properties' properties.")

(defun org-get-parent-property (property inherit literal-nil)
  "Get the value of PROPERTY from the parent relative to current point."
  (org-with-wide-buffer
   (if (org-up-heading-safe)
   (or (org-entry-get nil property inherit literal-nil) "")
 "")))

(defun org/advice-concatenate-properties-maybe (orig-fun &rest args)
  "Concatenate an Org Property value with its inherited value.
The concatenation happens only if the Org Property is in
`org-concatenated-properties' list."
  (let* ((value-orig (apply orig-fun args))
 (property (nth 1 args))
 (dont-concat (not (member property org-concatenated-properties
;; (message "dbg: args:%S value-orig:%S property:%S" args value-orig
property)
(if dont-concat
value-orig
  (let* ((pom (nth 0 args))
 (inherit (nth 2 args))
 (literal-nil (nth 3 args))
 (value-here-no-inherit (apply orig-fun `(,pom ,property nil
,literal-nil)))
 (value-parent (apply #'org-get-parent-property `(,property
,inherit ,literal-nil
;; (message "dbg advice: value-here-no-inherit: %S"
value-here-no-inherit)
(if value-here-no-inherit
(format "%s%s%s"
value-parent
(if (org-string-nw-p value-parent)
org-property-concat-string
  "")
value-orig)
  value-parent)
(advice-add 'org-entry-get :around
#'org/advice-concatenate-properties-maybe)
;; (advice-remove 'org-entry-get #'org/advice-concatenate-properties-maybe)
=

Example Org file:

=

* heading 1
:PROPERTIES:
:FOO:  abc
:END:

asdf
** heading 1
:PROPERTIES:
:FOO: def
:AA: pqr
:END:
*** heading 2
:PROPERTIES:
:FOO: 123
:AA: 456
:END:
 heading 3
=


Re: [O] Visualizing org files

2018-10-01 Thread Samuel Wales
market more :]

or you could convert it to an emacs visualization in the agenda buffer :]



[O] category not updated

2018-10-01 Thread Samuel Wales
this bug reproduces in maint and master, but i have not tried -Q.

i search for a keyword in the agenda
categories show up
i decide to change the name of one of the categories
i refresh
category does not change
i search again
category does not change
i kill buffer and search again
category does not change
i restart emacs
category changes

-- 
The Kafka Pandemic: 

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

"You’ve really gotta quit this and get moving, because this is murder
by neglect." ---
.



Re: [O] Section on #+include keyword is missing quite some info in the org-manual.org

2018-10-01 Thread Kaushal Modi
On Wed, Sep 26, 2018 at 6:47 AM Nicolas Goaziou 
wrote:

>
> This is not intentional. Could you re-introduce the latest revision of
> that section?
>

I was just setting out to fix this in the manual, but I see that you
already did this :)

I was thinking of adding cindices like the ones you added for header
arguments.

#+cindex: @samp{minlevel}, include
#+cindex: @samp{lines}, include
.. etc.

Would that be OK?


Re: [O] HTML Export - Footnotes inconcistency

2018-10-01 Thread Matthias Paulmier
Hello,

Nicolas Goaziou  writes:
> This is intended, in a way, since the inline footnote is not a paragraph
> by itself. It is contained within a paragraph. This explains why you
> cannot have blank lines within an inline footnote.

I think I get the logic behind it. The problem is the inconsistency it
creates for the viewer. Does it really matter for them if I wrote my
footnote inline or not?

Thanks for your answer.
--
Matthias Paulmier



Re: [O] HTML Export - Footnotes inconcistency

2018-10-01 Thread Nicolas Goaziou
Hello,

Matthias Paulmier  writes:

> I came across this problem today (or maybe it is intended but I couldn't
> find any explanation in the docs). There is an inconsistency on how
> inline/anonymous and named footnotes are exported in HTML. For example,
> with the following source:
>
> #+TITLE: Testing footnotes
> #+LANGUAGE: en
>
> Testing[fn::test1] footnotes[fn:2]
>
> [fn:2] test2
>
>
> Exports to this :
>
> Footnotes: 
> 
>
>  href="#fnr.1">1 test1
>
>  href="#fnr.2">2 
> test2 
>
> We can see here that the named footnote creates a paragraph of the same
> class as the parent container "footpara" whereas the inlined one doesn't
> create this.  If this is intended, why?  If not, which is the intended
> one?

This is intended, in a way, since the inline footnote is not a paragraph
by itself. It is contained within a paragraph. This explains why you
cannot have blank lines within an inline footnote. 

OTOH, a footnote definition can contain multiple paragraphs.

I don't know if that's a good thing, but these differences at the Org
level are translated into the HTML output.

Regards,

-- 
Nicolas Goaziou



Re: [O] Calculate differences of remote table numbers

2018-10-01 Thread Nick Dokos
Karl Voit  writes:

> Hi!
>
> I'd like to calculate the differences between rows of numbers of a
> different table.
>
> Here is a minimal example showing the issue:
>
> #+NAME: my-table
> | Numbers |
>
> |-|
> |   1 |
> |   5 |
> |   8 |
> |  12 |
> |  15 |
>
> This is what I expected: "exp. Reference1" and "exp. Reference2" is here only
> to demonstrate that the assumed references are wrong in the third table. "exp.
> Difference" is the column I want to get in the first place. I don't want to 
> see
> Reference 1 or 2 at all in my solution (since I need a couple of those
> difference-columns).
>
> | Line | exp. Reference1 | exp. Reference2 | exp. Difference |
> |--+-+-+-|
> |1 |   0 |   0 |   0 |
> |2 |   5 |   1 |   4 |
> |3 |   8 |   5 |   3 |
> |4 |  12 |   8 |   4 |
> |5 |  15 |  12 |   3 |
>
> This is what I get instead:
>
> | Line | actual Reference1 | actual Reference2 | Difference |
> |--+---+---+|
> |1 | 0 | 0 |  0 |
> |2 | 6 | 1 |  5 |
> |3 |12 | 1 | 11 |
> |4 |20 | 1 | 19 |
> |5 |30 | 1 | 29 |
>
> #+TBLFM: $2=if(2 == @#, 0, remote(my-table,@#$1))::$3=if(2 == @#, 0, 
> remote(my-table,@#-1$1))::$4=if(2 == @#, 0, 
> (remote(my-table,@#$1)-remote(my-table,@#-1$1)))

@# is the row number, so to refer to that row, you need @@#. Something like 
this,
although I didn't test to see if everything gets parsed correctly:

#+TBLFM: $2=if(2 == @#, 0, remote(my-table,@@#$1))::$3=if(2 == @#, 0, 
remote(my-table,@@#-1$1))::$4=if(2 == @#, 0, 
(remote(my-table,@@#$1)-remote(my-table,@@#-1$1)))

Turning on formula debugging with `C-c {' helps.

-- 
Nick

"There are only two hard problems in computer science: cache
invalidation, naming things, and off-by-one errors." -Martin Fowler




Re: [O] [PATCH] doc/org-manual→ Intro→ Activation: add space in the command binding

2018-10-01 Thread Nicolas Goaziou
Hello,

Дилян Палаузов  writes:

> … otherwise emacs 26.1 says “error: C- must prefix a single character”

Fixed. Thank you. I used the `kbd' macro, for clarity.

Regards,

-- 
Nicolas Goaziou



Re: [O] Concatenating Org property values from parent subtrees

2018-10-01 Thread Ihor Radchenko
Hi,

Check out the following code:


(defvar org-concatenated-properties '("AA")
  "A list of property names (strings), which should be computed via 
concatenation with the parent properties.")

(define-advice org-entry-get (:around (oldfun pom property &optional inherit 
literal-nil) concatenate-parents-maybe)
  "Concatenate the PROPERTY value with its parent entries' values if the 
PROPERTY is in `org-concatenated-properties' list."
  (if (not (member property org-concatenated-properties))
  (apply oldfun pom property inherit literal-nil)
(let ((value-here (funcall oldfun pom property nil 't))
  (value (funcall oldfun pom property inherit 't)))
  (if value-here
  (format "%s%s"  (org-with-wide-buffer
   (if (org-up-heading-safe)
   (or (org-entry-get nil property inherit 
literal-nil) "")
 ""))
  (funcall oldfun pom property inherit literal-nil))
(when value
  (org-with-wide-buffer
   (org-up-heading-safe)
   (org-entry-get nil property inherit literal-nil)))


Best,
Ihor


Michael Welle  writes:

> Hello,
>
> Michael Welle  writes:
> [...]
>> (defun hmw/org-prop-append(prop value)
>>   (save-excursion
>>   (org-up-heading-safe)
>>   (format "%s %s" value (cdr (assq prop
>>(car 
>> (org-babel-params-from-properties)))
>>
>> (defalias 'A 'hmw/org-prop-append)
>
> and I just realise that it works with code blocks only. I guess the way
> to get general property values has to be adapted.
>
> Regards
> hmw
>



signature.asc
Description: PGP signature


[O] Calculate differences of remote table numbers

2018-10-01 Thread Karl Voit
Hi!

I'd like to calculate the differences between rows of numbers of a
different table.

Here is a minimal example showing the issue:

#+NAME: my-table
| Numbers |
|-|
|   1 |
|   5 |
|   8 |
|  12 |
|  15 |

This is what I expected: "exp. Reference1" and "exp. Reference2" is here only
to demonstrate that the assumed references are wrong in the third table. "exp.
Difference" is the column I want to get in the first place. I don't want to see
Reference 1 or 2 at all in my solution (since I need a couple of those
difference-columns).

| Line | exp. Reference1 | exp. Reference2 | exp. Difference |
|--+-+-+-|
|1 |   0 |   0 |   0 |
|2 |   5 |   1 |   4 |
|3 |   8 |   5 |   3 |
|4 |  12 |   8 |   4 |
|5 |  15 |  12 |   3 |

This is what I get instead:

| Line | actual Reference1 | actual Reference2 | Difference |
|--+---+---+|
|1 | 0 | 0 |  0 |
|2 | 6 | 1 |  5 |
|3 |12 | 1 | 11 |
|4 |20 | 1 | 19 |
|5 |30 | 1 | 29 |
#+TBLFM: $2=if(2 == @#, 0, remote(my-table,@#$1))::$3=if(2 == @#, 0, 
remote(my-table,@#-1$1))::$4=if(2 == @#, 0, 
(remote(my-table,@#$1)-remote(my-table,@#-1$1)))

As you can see, the "actual Reference1" are not the values from the first
column above (except the first one). "actual Reference2" is not the shifted
column 1 from above (except the first one). I have no clue, what these numbers
are.

Maybe you can help me (1) explaining what the numbers in actual Reference1 and
actual Reference2 are showing and (2) how to get the result ("expected
Difference"; without explicitly generating Reference 1 or 2).

Thanks!


-- 
get mail|git|SVN|photos|postings|SMS|phonecalls|RSS|CSV|XML into Org-mode:
   > get Memacs from https://github.com/novoid/Memacs <
Personal Information Management > http://Karl-Voit.at/tags/pim/
Emacs-related > http://Karl-Voit.at/tags/emacs/




Re: [O] Visualizing org files

2018-10-01 Thread Karl Voit
* Samuel Wales  wrote:
> https://github.com/novoid

https://github.com/novoid/org-du/

Thanks for mentioning. I got the impression, I am the only one who
likes those kind of visualizations ;-)

Even https://github.com/novoid/org-du/graphs/traffic doesn't look
like there is much going on in terms of visitors ...

-- 
get mail|git|SVN|photos|postings|SMS|phonecalls|RSS|CSV|XML into Org-mode:
   > get Memacs from https://github.com/novoid/Memacs <
Personal Information Management > http://Karl-Voit.at/tags/pim/
Emacs-related > http://Karl-Voit.at/tags/emacs/