[O] [PATCH] org-depend: multi-file TRIGGER and BLOCKER tasks

2017-07-27 Thread Adrian Bradd
Adds multi-file TRIGGER and BLOCKER tasks to org-depend by first searching
the current file `org-find-entry-with-id` and then all files visisble
through `org-find-id`.
From d4095a57f1c9c42426d8c0d51ca7f4640f036a3a Mon Sep 17 00:00:00 2001
From: Adrian Bradd 
Date: Thu, 13 Jul 2017 22:49:26 -0400
Subject: [PATCH] org-depend: multi-file TRIGGER and BLOCKER tasks

---
 contrib/lisp/org-depend.el | 26 +-
 1 file changed, 21 insertions(+), 5 deletions(-)

diff --git a/contrib/lisp/org-depend.el b/contrib/lisp/org-depend.el
index d1b98441c..fc7d69d1d 100644
--- a/contrib/lisp/org-depend.el
+++ b/contrib/lisp/org-depend.el
@@ -211,7 +211,7 @@ This does two different kinds of triggers:
 	 (from (plist-get change-plist :from))
 	 (to (plist-get change-plist :to))
 	 (org-log-done nil) ; IMPROTANT!: no logging during automatic trigger!
-	 trigger triggers tr p1 kwd id)
+	 trigger triggers tr p1 p2 kwd id)
 (catch 'return
   (unless (eq type 'todo-state-change)
 	;; We are only handling todo-state-change
@@ -336,11 +336,18 @@ This does two different kinds of triggers:
 	  (setq id (match-string 1 tr)
 		kwd (match-string 2 tr)
 		p1 (org-find-entry-with-id id))
-	  (when p1
+	  ;; first check current buffer, then all files
+	  (if p1
 	;; there is an entry with this ID, mark it TODO
 	(save-excursion
 	  (goto-char p1)
-	  (org-todo kwd
+	  (org-todo kwd))
+	(when (setq p2 (org-id-find id))
+	  (save-excursion
+		(save-window-excursion
+		  (find-file (car p2))
+		  (goto-char (cdr p2))
+		  (org-todo kwd))
  ((string-match "\\`chain-siblings-scheduled\\'" tr)
   (let ((time (org-get-scheduled-time pos)))
 (when time
@@ -362,7 +369,7 @@ this ID property, that entry is also checked."
 	 (from (plist-get change-plist :from))
 	 (to (plist-get change-plist :to))
 	 (org-log-done nil) ; IMPROTANT!: no logging during automatic trigger
-	 blocker blockers bl p1
+	 blocker blockers bl p1 p2
 	 (proceed-p
 	  (catch 'return
 ;; If this is not a todo state change, or if this entry is
@@ -403,7 +410,16 @@ this ID property, that entry is also checked."
 		  (unless (org-entry-is-done-p)
 		;; return nil, to indicate that we block the change!
 		(org-mark-ring-push)
-		(throw 'return nil))
+		(throw 'return nil
+	   
+	   ((setq p2 (org-id-find bl))
+		(save-excursion
+		  (save-window-excursion
+		(find-file (car p2))
+		(goto-char (cdr p2))
+		(unless (org-entry-is-done-p)
+		  (org-mark-ring-push)
+		  (throw 'return nil)))
 	t ; return t to indicate that we are not blocking
 	)))
 (when org-depend-tag-blocked
-- 
2.11.0



[O] org-backward-paragraph probably should *not* signal user-error at start of buffer

2017-07-27 Thread Omar Antolín Camarena
I just noticed that org-backward-paragraph raises a user error if you call
it at the beginning of the buffer. This is not what the general
backward-paragraph command does, nor is it what I remember other Emacs
movement commands doing when the move can't actually be done.

I think consistency with other movement commands is reason enough to change
the behavior of org-backward-paragraph, but here's a potentially more
convincing reason: the function org-inside-LaTeX-fragment-p is supposed to
return nil if point is inside a LaTeX fragment (and a truthy value
otherwise). But since org-inside-LaTeX-fragment-p uses
org-backward-paragraph internally, what actually happens is that it works
as described *unless* you are at the beginning of the buffer in which case
it doesn't return any value at all but instead signals a user-error!

I've worked around this in my own code by changing
(org-inside-LaTeX-fragment-p) to (unless (bobp)
(org-inside-LaTeX-fragment-p)), but it feels like org-backward-paragraph
should be changed instead.

-- 
Omar Antolín Camarena


[O] Adding single cell movement to org-table

2017-07-27 Thread Chris Kauffman
Greetings from a first-time contributor. Another patch contributor, Uwe
Brauer, recruited me after finding some code I had written to move single
org-table cells up/down/left/right.  I found this feature to be useful in
certain kinds of tables so wrote the functions for myself but am told that
others might benefit from it.

I have formalized that code into a git repo with a feature branch on it
which may be found here:
  https://github.com/kauffman77/org-mode/tree/single-cell-table-move

I have included documentation in org-table.el for the new functions and
tests for them.  If further work or documentation needs to be done, please
let me know. I am also not sure if I got the commit messages formatted to
the specification mentioned on the contributing page.  I am happy to
explain more if needed.

I just mailed ass...@gnu.org to get the copyright for the code resolved but
thought I would put up this branch now so others can have a look.

Cheers,
Chris


Re: [O] org-plus-contrib, where is library-of-babel.org?

2017-07-27 Thread Thomas S. Dye
Aloha Rasmus,

I agree, and believe the best course forward is to resolve the licensing
of library-of-babel.org (which appears not to be problematic) and
include the file in the emacs distribution.

When I asked on the list for advice how to install library-of-babel.org
from Worg, there was no response, which suggests to me that few users
actually work out a way to install it from Worg.

All the best,
Tom

Rasmus writes:

> Kyle Meyer  writes:
>
>> Hi Bastien and Rasmus,
>>
>> Any further thoughts on this?  If we're still not sure what to do with
>> the file, I'd vote that we remove it from Emacs for now so that we don't
>> let an unlicensed file sit in the Emacs repo.
>
> If it's to be referred in the manual it should be there IMO.  Otherwise,
> it could be removed from both places.
>
> I personally don’t understand how it would be more convenient to host it
> on Worg.
>
> Nonetheless, I do not feel strongly against removing it.
>
> Rasmus


--
Thomas S. Dye
http://www.tsdye.com



Re: [O] Issue with org-mode latex export captions

2017-07-27 Thread Eric S Fraga
On Thursday, 27 Jul 2017 at 16:16, Tyler Morgan wrote:

[...]

> The resulting LaTeX no longer includes a label attribute, which means
> that all of the references I have made to this figure in the text are
> now undefined. I know that defining a LaTeX caption overwrites the
> org-mode caption field, but I’m not sure why it also removes the
> #+NAME (or #+LABEL, which I have also tried) from the figure.

Because the label is intrinsically associated with the caption (this is
a LaTeX feature and nothing to do with org), not the figure itself.  It
is the caption that creates the number for the reference.  A figure may
contain more than one image, for instance.

Either simply add \label{fig:figure1} to the caption you are specifying
or, if it is that you want to have the table of contents entry, use this
format for the caption:

#+caption[short title]: long caption

which should work, according to the manual (untested).

HTH,
eric

-- 
: Eric S Fraga via Emacs 26.0.50, Org release_9.0.9-573-g09e612


signature.asc
Description: PGP signature


[O] Log change TODO state after clock-out

2017-07-27 Thread Рома Рудаков
Hello,
my minimal configuration:

(setq org-todo-keywords
  '((sequence "TODO(t)" "PROGRESS(p!)" "WAITING(w!)" "|" "DONE(d!)")))

(setq org-clock-persist 'history)
(org-clock-persistence-insinuate)
(setq org-log-into-drawer t)
(setq org-log-done 'time)

(defun rr/set-progress (last)
  "Set PROGRESS state if LAST is different."
  (when (not (string-equal last "PROGRESS"))
  "PROGRESS"))

(setq org-clock-in-switch-to-state 'rr/set-progress)

(defun rr/after-clock-stop (last)
  "Change TASK state after clock stop depends on LAST state."
  (when (not (or (string-equal last "WAITING")
 (string-equal last "DONE")
 (string-equal last "TODO")))
  (if (y-or-n-p "Current task DONE? ")
"DONE"
  "WAITING")))

(setq org-clock-out-switch-to-state 'rr/after-clock-stop)

I have a simple org file:

* TODO task 1
* TODO task 2
* TODO task 3
* TODO task 4

Steps to reproduce my issue:
1. Go to task 1 and clock-in. Result is:

* PROGRESS task 1
  :LOGBOOK:
  - State "PROGRESS"   from "TODO"   [2017-07-26 Wed 15:37]
  CLOCK: [2017-07-26 Wed 15:37]
  :END:
* TODO task 2
* TODO task 3
* TODO task 4

2. Clock-out the task, answer y or n.

Expected result:

* DONE task 1
  CLOSED: [2017-07-26 Wed 15:39]
  :LOGBOOK:
  - State "DONE"   from "PROGRESS"   [2017-07-26 Wed 15:39]
  - State "PROGRESS"   from "TODO"   [2017-07-26 Wed 15:37]
  CLOCK: [2017-07-26 Wed 15:37]--[2017-07-26 Wed 15:38] =>  0:01
  :END:
* TODO task 2
* TODO task 3
* TODO task 4


Actual result:

* DONE task 1
  :LOGBOOK:
  - State "PROGRESS"   from "TODO"   [2017-07-26 Wed 15:37]
  CLOCK: [2017-07-26 Wed 15:37]--[2017-07-26 Wed 15:38] =>  0:01
  :END:
* TODO task 2
* TODO task 3
* TODO task 4

There is no CLOSED log entry and change state from PROGRESS to DONE entry.

Please help me to find proper configuration.
Thank you in advance.


[O] Issue with org-mode latex export captions

2017-07-27 Thread Tyler Morgan
I am running org-version 9.0.9 (9.0.9-54-g16dbf0-elpa) and have run into an 
issue with org-mode’s LaTeX/PDF export function. Everything looks normal when I 
create figure captions using the standard:

#+CAPTION: This is a caption.
#+NAME: fig:figure1
#+ATTR_LATEX: :width 15.0cm
[[/loc/to/figure1.jpg]]

Meaning that the LaTeX that is produced contains the caption, the name as a 
LaTeX label, etc. However, when I define the caption directly in LaTeX in order 
to use some of its added functionality, as in:

#+NAME: fig:figure1
#+ATTR_LATEX: :width 15.0cm :caption \caption[This is a caption.]{This is a 
much longer version of my caption that I don’t want included in my TOC.}
[[/loc/to/figure1.jpg]]

The resulting LaTeX no longer includes a label attribute, which means that all 
of the references I have made to this figure in the text are now undefined. I 
know that defining a LaTeX caption overwrites the org-mode caption field, but 
I’m not sure why it also removes the #+NAME (or #+LABEL, which I have also 
tried) from the figure. This isn’t the end of the world, as I can go through 
the LaTeX at the end in order to manually add the labels back to the figures. 
However, I have many figures in a document that I’m working on at the moment, 
and it would be nice to understand why this is happening.

If anyone has any ideas on why this is happening, or a way that I could deal 
with it, I would greatly appreciate it.

Thank you,
Tyler Morgan


Re: [O] Make org-cycle outline-mode compatible again

2017-07-27 Thread Jonas Bernoulli
> I suggest to use a hook instead (maybe `org-tab-first-hook' or some
> such).

Alright.  I have decided to go with `outline-magic.el'.

After some modernization it seems to work well. I don't remember what
the problem was the last time I tried.  I will probably publish my
updated version eventually, after I have given it some more loving.

  Jonas



Re: [O] Better default for org-texinfo-info-process

2017-07-27 Thread Jonas Bernoulli
>> Please consider making this the default value.
>
> I agree that makes sense. Done.

Thanks!



Re: [O] org-plus-contrib, where is library-of-babel.org?

2017-07-27 Thread Rasmus
Kyle Meyer  writes:

> Hi Bastien and Rasmus,
>
> Any further thoughts on this?  If we're still not sure what to do with
> the file, I'd vote that we remove it from Emacs for now so that we don't
> let an unlicensed file sit in the Emacs repo.

If it's to be referred in the manual it should be there IMO.  Otherwise,
it could be removed from both places.

I personally don’t understand how it would be more convenient to host it
on Worg.

Nonetheless, I do not feel strongly against removing it.

Rasmus

-- 
In theory, practice and theory are the same. In practice they are not




Re: [O] Update to org-protocol-capture-html

2017-07-27 Thread Nikolay Kudryavtsev
My testing had shown that if in org-protocol-check-filename-for-protocol 
we have (server-delete-client _client) instead of (server-edit), the 
client process gets closed fine. May I propose such a change?


--
Best Regards,
Nikolay Kudryavtsev




Re: [O] Update to org-protocol-capture-html

2017-07-27 Thread Nikolay Kudryavtsev
Oh, I see. In org-protocol-protocol-alist you can define protocols with 
:kill-client t and this should close the server buffer for them. And on 
my machine it does it half-way - server-edit no longer pops them, but 
the process still hangs. Normal use of server works fine though - doing 
server-edit on a manually opened client buffer closes the process fine. 
I'll do some more debugging on that.



C-h v org-capture-templates RET

Look for ":immediate-finish"
Thanks. I don't have org-capture required, so I even got confused before 
why that variable documentation is empty. :-)


--
Best Regards,
Nikolay Kudryavtsev




Re: [O] Better default for org-texinfo-info-process

2017-07-27 Thread Nicolas Goaziou
Hello,

Jonas Bernoulli  writes:

> For some reason the authors of `makeinfo' thought it would be a good
> idea to split the generated info file into two files by default once
> its size reaches a certain undocumented threshold.
>
> When that happened to me for the first time I was very surprised and
> thought that "foo-1.info" and "foo-2.info" were some intermediate
> files, added appropriate rules to ".gitignore", and went on shipping
> an outdated "foo.info" for a while.  (Off topic:  I no longer ship
> "*.info" files, just "*.texi".)
>
> Since I have figured out what is going on, I am using this:
>
>   (setq org-texinfo-info-process '("makeinfo --no-split %f"))
>
> Please consider making this the default value.

I agree that makes sense. Done.

Thank you.

Regards,

-- 
Nicolas Goaziou



Re: [O] [RFC] Shrink columns dynamically

2017-07-27 Thread Nicolas Goaziou
Hello,

Rick Frankel  writes:

> Personally, my use of width cookies has been mostly for visual display of
> columns are very long and will wrap in an html or latex table export, but
> would force the display too wide. My ideal default would be to have a setting
> which would shrink tables a reasonable (fill-column?, window-width?) visual
> display, with perhaps a min-column-width option and trying to balance the
> width of each column base on its un-narrowed total width, perhaps trying to
> keep narrow columns as-is in the process. For me this would probably align
> cognitively with how much info is needed to grok the cell contents.

It would be a fun optimization problem to solve, but I doubt it would be
much useful (e.g., pathological cases getting in the way...).

> I like a single cycling command.

[...]

> Wouldn't a min-column-width setting to use when there is no cookie solve the
> the bi- vs tri-state problem (every column has three states)

For the sake of simplicity, I opted for two states cycling in the latest
proof of concept. It means that columns with a width cookie cannot be
narrowed to 1 character, but I assume it is an acceptable restriction
since the width cookie is probably there for a reason.

> P.S. and (somewhat) off topic: The doc string for
> `org-ascii-table-use-ascii-art' is out of date. `ascii-art-to-unicode.el' is
> now in elpa and the url no longer works.

Fixed. Thank you.

Regards,

-- 
Nicolas Goaziou



Re: [O] [RFC] Shrink columns dynamically

2017-07-27 Thread Eric S Fraga
Thanks Nicolas.  Sounds very nice, matching at least my use cases quite
well.  I'll give this a try soon and will get back to you.

-- 
: Eric S Fraga via Emacs 26.0.50, Org release_9.0.9-573-g09e612


signature.asc
Description: PGP signature


Re: [O] [RFC] Shrink columns dynamically

2017-07-27 Thread Nicolas Goaziou
Hello,

bvrag...@iitk.ac.in (B.V. Raghav) writes:

> Can I request/suggest a new feature `#+TABLE_PROPERTIES: ' analogous to
> `#+TBLFM: ' that can save the state for those of us who want to, and the
> others may enjoy the volatileness[?]

Thank you for your suggestion. 

However, I'm looking for something simpler, that doesn't involve
introducing new keywords. See my new implementation explained in the
thread.

Regards,

-- 
Nicolas Goaziou



Re: [O] [RFC] Shrink columns dynamically

2017-07-27 Thread Nicolas Goaziou
Hello,

Eric S Fraga  writes:

> I have two use cases which currently are managed with the width cookies
> and I can see that they probably should be managed differently.  The
> cases are:
>
> 1. a table with wide columns that is used to collect information
>(publications with authors, title, journal, etc. is an example) and
>which I use mostly by looking at it.  That is, I open the document
>and scan down the table or page down or whatever.  I want this table
>displayed initially with columns (e.g. title) narrowed to a specified
>width.
>
> 2. a table with many columns, too many of the screen width even if each
>column may only be a few characters wide, but one which I intend to
>be manipulating extensively.  In this case, I may want to
>shrink/narrow/hide columns to make it easier to edit and do
>calculations.
>
> At present, I use width cookies for both.  They work well for use case
> 1; much less well for use case 2.  For me, these use cases are
> orthogonal.  I would be happy with two different approaches or the same
> approach so long as the latter would retain the ability to save the view
> (for use case 1).

I pushed another take on the problem in "hide-table-column" branch.
Rebasing is required.

There, two commands are defined

  - `org-table-toggle-column-width'

 Shrink or expand column at point. More specifically, if the column
 contains a width cookie, the column is shrunk according to it.
 Otherwise, it is shrunk to 1 character. Here is its docstring:

Shrink or expand current column in an Org table.

If a width cookie specifies a width W for the column, the first
W visible characters are displayed.  Otherwise, the column is
shrunk to a single character.

When optional argument ARG is a string, use it as white space
separated list of column ranges.  A column range can be one of
the following patterns:

  Ncolumn N only
  N-M  every column between N and M (both inclusive)
  N-   every column between N (inclusive) and the last column
  -M   every column between the first one and M (inclusive)
  -every column

When called with `C-u]' prefix, ask for the range specification.

When called with `C-u C-u' prefix, expand all columns.

  - `org-table-shrink'

 Shrink all columns with a width cookie. Other columns are expanded.
 This is morally equivalent to the current behaviour, although it is
 now decoupled from aligning.

Moreover, I added two new STARTUP keywords: "shrink" and "noshrink",
which allow to apply aforementioned `org-table-shrink' command on all
tables upon opening a document. Not that "align" no longer toggle column
width.

Feedback welcome.

Regards,

-- 
Nicolas Goaziou



Re: [O] ANN: org-super-agenda

2017-07-27 Thread Eric S Fraga
Hi Adam,

have now given this a try.  Looks really nice.  Some questions, if I
may.  I would like to have the following sections:

1. items that have deadlines, any deadline for now and in the future,
   whether scheduled or not.
2. items that have a specific TODO type whether scheduled or not.
3. a clock summary (equivalent to what one gets with "v c" in standard
   view) 
4. a clock report at the end (and really the end, after all other items)

Are these possible?

Thanks,
eric

-- 
: Eric S Fraga via Emacs 26.0.50, Org release_9.0.9-573-g09e612


signature.asc
Description: PGP signature