[ANN]: Org-webring

2020-08-20 Thread Brett Gilio
Hello all,

Over the past few days a few friends and I have been working diligently
on creating an Emacs Lisp library which allows for integration of RSS
blog posts in a webring-style format into your Org-generated blog or
website.

I have detailed this exciting adventure on a recent blog post with a
demonstation:
https://brettgilio.ml/posts/2020-08-20-announcing-org-webring.html

You can find the sources, mailing list, and ticket tracker at:
https://sr.ht/~brettgilio/org-webring/

I hope people will find this useful, it seems to be pretty well-received
already! I love reviewing patches as well, so if you see something that
should be changed, or have a suggestion please do not hesitate to
subscribe to our private mailing list for this package!
https://lists.sr.ht/~brettgilio/org-webring

That's all for now!

Brett Gilio



Bug: :results raw replace header args for a code block don't replace [9.3.7 (9.3.7-18-g093b47-elpaplus @ /Users/skoshelev/.emacs.d/elpa/26.2/develop/org-plus-contrib-20200810/)]

2020-08-20 Thread Sergey Koshelev
Hi all!


When a source block (I have tested with python, see below) has `raw`
header arg it ignores `replace` argument. The result instead is prepended.

Example:

#+begin_src python :results output raw replace
  print('This line will be added every time this code runs')
#+end_src

#+RESULTS:
This line will be added every time this code runs
This line will be added every time this code runs
This line will be added every time this code runs
This line will be added every time this code runs

Below is the spacemacs config.

Thank you,
Sergey.

Emacs  : GNU Emacs 26.2 (build 1, x86_64-apple-darwin18.2.0, NS appkit-1671.20 
Version 10.14.3 (Build 18D109))
of 2019-04-12
Package: Org mode version 9.3.7 (9.3.7-18-g093b47-elpaplus @ 
/Users/skoshelev/.emacs.d/elpa/26.2/develop/org-plus-contrib-20200810/)

current state:
==
(setq
org-src-mode-hook '(org-src-babel-configure-edit-buffer 
org-src-mode-configure-edit-buffer)
org-latex-listings 'minted
org-link-shell-confirm-function 'yes-or-no-p
org-babel-after-execute-hook '(spacemacs/ob-fix-inline-images)
org-metadown-hook '(org-babel-pop-to-session-maybe)
org-clock-out-hook '(org-clock-remove-empty-clock-drawer)
org-refile-targets '((org-agenda-files :maxlevel . 3))
org-html-format-inlinetask-function 'org-html-format-inlinetask-default-function
org-enforce-todo-dependencies t
org-src-tab-acts-natively t
org-odt-format-headline-function 'org-odt-format-headline-default-function
org-latex-pdf-process '("pdflatex -shell-escape -interaction nonstopmode 
-output-directory %o %f"
 "pdflatex -shell-escape -interaction nonstopmode 
-output-directory %o %f")
org-imenu-depth 8
org-download-annotate-function 'org-download-annotate-default
org-agenda-files '("~/org/gcal.org" "~/org/Projects.org" "~/org/brain/Brain.org"
"~/org/todo list.org")
org-ascii-format-inlinetask-function 'org-ascii-format-inlinetask-default
org-latex-to-mathml-convert-command "latexmlmath \"%i\" --presentationmathml=%o"
org-reveal-start-hook '(org-decrypt-entry)
org-modules '(org-habit ol-w3m ol-bbdb ol-bibtex ol-docview ol-gnus ol-info 
ol-irc ol-mhe ol-rmail
   ol-eww)
org-blocker-hook '(org-block-todo-from-children-or-siblings-or-parent 
org-edna-blocker-function)
org-archive-location "Archived projects.org::"
org-mode-hook '(org-tempo-setup flyspell-mode spacemacs/org-setup-evil-surround
 spacemacs/load-yasnippet toc-org-enable org-superstar-mode
 #[0 "\301\211\207" [imenu-create-index-function 
org-imenu-get-tree] 2]
 #[0 "\300\301\302\303\304$\207"
   [add-hook change-major-mode-hook org-show-all append local] 
5]
 #[0 "\300\301\302\303\304$\207"
   [add-hook change-major-mode-hook org-babel-show-result-all 
append local] 5]
 org-babel-result-hide-spec org-babel-hide-all-hashes 
org-download-enable
 dotspacemacs//prettify-spacemacs-docs 
spacemacs//org-babel-do-load-languages
 spacemacs//evil-org-mode org-eldoc-load 
spacemacs//init-company-org-mode
 company-mode)
org-odt-format-drawer-function #[514 "\207" [] 3 "\n\n(fn NAME CONTENTS)"]
org-outline-path-complete-in-steps nil
org-archive-hook '(org-attach-archive-delete-maybe)
org-agenda-restore-windows-after-quit t
org-confirm-elisp-link-function 'yes-or-no-p
org-startup-indented t
org-gcal-fetch-file-alist 
'(("srg.koshe...@gmail.com" . "~/org/gcal.org")
 
("lifg1dsiqjkpd3ms7sq3sct...@group.calendar.google.com"
 .
  "~/org/work.org")
 )
org-brain-visualize-sort-function 'org-brain-title<
org-download-file-format-function 'org-download-file-format-default
org-journal-mode-hook '(#[0 "\301\302\303\304$\207"
   [org-journal-encrypt-on add-hook 
org-journal-encryption-hook nil t] 5]
 (lambda nil
  (add-hook org-journal-encrypt-on (quote 
org-journal-encryption-hook) nil t))
 )
org-projectile-per-project-filepath "TODOs.org"
org-agenda-before-write-hook '(org-agenda-add-entry-text)
org-metaup-hook '(org-babel-load-in-session-maybe)
org-bibtex-headline-format-function #[257 "\300\236A\207" [:title] 3 "\n\n(fn 
ENTRY)"]
org-latex-format-drawer-function #[514 "\207" [] 3 "\n\n(fn _ CONTENTS)"]
org-babel-pre-tangle-hook '(save-buffer)
org-tab-first-hook '(org-babel-hide-result-toggle-maybe 
org-babel-header-arg-expand)
org-babel-load-languages '((python . t) (calc . t) (shell . t) (gnuplot . t))
org-log-done 'time
org-journal-date-format "%A, %B %d %Y"
org-brain-visualize-mode-hook '((lambda nil
  (define-key org-brain-visualize-mode-map (kbd 
"o")
   (quote brain-open-narrow))
  

[BUG] babel runs bash instead of zsh when sessions are used

2020-08-20 Thread Rudi C
#+BEGIN_SRC zsh :session z1
echo $HOME $0
#+END_SRC

#+RESULTS:
: /Users/evar /bin/bash

As compared to:

#+BEGIN_SRC zsh
echo $HOME $0
#+END_SRC

#+RESULTS:
: /Users/evar zsh


Bug: Unicode ORG-TODO-KEYWORDS not recognized in agenda's stuck projects [9.3.6 (9.3.6-4-gdfa7a3-elpa @ /home/andy/.config/emacs/elpa/org-20200217/)]

2020-08-20 Thread Andy Drop


I configured my org-todo-keywords in a way, that they are just single
unicode symbols instead of the classic TODO, NEXT, WAIT, DONE,etc. This is
done in my init.el like this:

(setq org-todo-keywords '((sequence "⭕(p)" "⸰(t)" "▶(n)" "⏸(w)" "|" "✔(d)" 
"❌(c)" "⏩(r)")))

This works perfectly, so I can advance the todo-states, choose them
directly, and filter on them in the agenda's todo-view, even org-edna,
which heavily relies on them works as designed.

While trying to use GTDs approach I defined a stuck project as one
having no next action meaning, having no subheading with a todo state of "▶"

(setq org-stuck-projects '("project" ("▶" "NEXT") nil ""))

The 'NEXT' is used here only for validating the existence of a bug, originally 
it was
omitted in my config.

My projects look like this:

** ⭕ [3/4] Dame Edna   :project:dame:...
** ⭕ [0/13] Example project: Garage Project:project:garage:
 :PROPERTIES:
 :COLUMNS:  %40ITEM %8Effort(Effort){:} %60BLOCKER
 :COOKIE_DATA: todo recursive
 :END:
*** ⸰ Find local stores for paint
*** ⸰ Choose color for paint
*** ⸰ Buy paint
*** ⸰ Move car to nearby parking lot
*** ⸰ Remove bikes
*** ⸰ Remove stuff from shelves
*** ⸰ Remove shelves
*** ▶ Garage is empty
*** ⸰ Paint walls and floor
*** ⸰ Re-install shelves
*** ⸰ Bring back bikes into garage
*** ⸰ Bring back car into garage
*** ⸰ Celebrate and close project

Both of them contain a subheading with a todo state of "▶" which should prevent 
them from
showing up in the stuck projects agenda view. However, they both appear

List of stuck projects: 
  ops:⭕ [3/4] Dame Edna   :project:dame:
  ops:⭕ [0/13] Example project: Garage Project
:project:garage:

I suspected the problem to be with the excluded todo-state beeing a
unicode symbol, so I tried to substitute it with the classical 'NEXT',
so it now showed like this:

** ⭕ [3/4] Dame Edna   :project:dame:
** ⭕ [0/13] Example project: Garage Project:project:garage:
 :PROPERTIES:
 :COLUMNS:  %40ITEM %8Effort(Effort){:} %60BLOCKER
 :COOKIE_DATA: todo recursive
 :END:
*** ⸰ Find local stores for paint
*** ⸰ Choose color for paint
*** ⸰ Buy paint
*** ⸰ Move car to nearby parking lot
*** ⸰ Remove bikes
*** ⸰ Remove stuff from shelves
*** ⸰ Remove shelves
*** NEXT Garage is empty
*** ⸰ Paint walls and floor
*** ⸰ Re-install shelves
*** ⸰ Bring back bikes into garage
*** ⸰ Bring back car into garage
*** ⸰ Celebrate and close project

And now the Garage project is successfully removed from the stuck
projects, because it contains a NEXT at the position of the todo
keyword, despite the fact, that NEXT is not even defined as a valid todo
keyword.

Looks like in this place there is some simple string comparison magic 
happening, that
can't handle unicode, instead of usage of the defined org-todo-keywords



Emacs  : GNU Emacs 27.1 (build 1, x86_64-pc-linux-gnu, GTK+ Version 2.24.32)
 of 2020-08-12
Package: Org mode version 9.3.6 (9.3.6-4-gdfa7a3-elpa @ 
/home/andy/.config/emacs/elpa/org-20200217/)

current state:
==
(setq
 org-todo-keywords '((sequence "⭕(p)" "⸰(t)" "▶(n)"
  "⏸(w)" "|" "✔(d)" "❌(c)" "⏩(r)")
 )
 org-stuck-projects '("project" ("▶" "NEXT") nil "")
 org-use-property-inheritance t
 org-tags-exclude-from-inheritance '("crypt" "project")

 org-agenda-files '("~/cloud/org/ops.org")
 org-closed-keep-when-no-todo t
 )




LaTeX maths export problems

2020-08-20 Thread Nick Higham
I use Org for producing LaTeX (e.g., all of https://github.com/higham/what-is
is produced from Org source).

I'm finding that Org has trouble parsing some LaTeX maths expressions and
I then have to make seemingly arbitrary tweaks to get it to parse correctly.

I thought this might be to do with something in my .emacs, but the same
problem happens with a bare bones Emacs. A simple example is this file:

#
# ex1a_bad.org
\[
 \widehat{y} = f(x+\widehat{x}) + \Delta y,
 \quad |\widehat{y}| \le \epsilon |y|, \;
   |\widehat{x}| \le \epsilon |x|
\]
#

With emacs -q and

  This is GNU Emacs 26.3 (build 1, x86_64-w64-mingw32) of 2019-08-29
  org-version is a variable defined in 'org.el'. Its value is "9.1.9"

I get as the exported LaTeX:

%
% Created 2020-08-13 Thu 01:36
% Intended LaTeX compiler: pdflatex
\documentclass[11pt]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{graphicx}
\usepackage{grffile}
\usepackage{longtable}
\usepackage{wrapfig}
\usepackage{rotating}
\usepackage[normalem]{ulem}
\usepackage{amsmath}
\usepackage{textcomp}
\usepackage{amssymb}
\usepackage{capt-of}
\usepackage{hyperref}
\date{\today}
\title{}
\hypersetup{
 pdfauthor={},
 pdftitle={},
 pdfkeywords={},
 pdfsubject={},
 pdfcreator={Emacs 26.3 (Org mode 9.1.9)},
 pdflang={English}}
\begin{document}

\tableofcontents

$\backslash$[
 \widehat{y} = f(x+\widehat{x}) + \(\Delta\) y,
 \quad |\widehat{y}| \(\le\) \(\epsilon\) |y|, $\backslash$;
\begin{center}
\begin{tabular}{lll}
\widehat{x} & \(\le\) \(\epsilon\) & x\\
\end{tabular}
\end{center}
$\backslash$]
\end{document}
%

The backslashes are being interpreted literally and the pipes are being
interpreted as a table.  Yet this version processes correctly:

#
# ex1a_good.org
\[
\widehat{y} = f(x+\widehat{x}) + \Delta y,
\quad |\widehat{y}| \le \epsilon |y|, \; |\widehat{x}| \le \epsilon |x|
\]
#

I have other simple examples like this one.

The same thing happens with my usual Emacs configuration, which uses Org 9.3.7.

---Nick Higham



window setup that works with org-agenda

2020-08-20 Thread 陈贤文
Hi! 

I use both org mode and org-roam. 

org-roam opens a right-hand side window that displays backlinks. 

When I run org-agenda, the right window is closed automatically. 


I would like to receive tips regarding how to permanently set up the
window layout that I have on my mind. The layout has three windows. 


The right window, *c*, displays the backlinks from org-roam. The rest of
the space is divided in half, which I call them as the window *a* and
the window *b*. 

|-| 

|  a |   | 

|--|   c  | 

|  b |   | 

|-| 


When org-agenda displays agendas, it will not close *c* and it will not
resize *b*. It will display the agendas in the window *b*. 

Cheers, 


Xianwen

Bug: org agenda leader text "on-the-date" doesn't show for items with both SCHEDULED and DEADLINE properties [9.1.9 (release_9.1.9-65-g5e4542 @ /usr/share/emacs/26.1/lisp/org/)]

2020-08-20 Thread Dinnyés Dániel
--text follows this line--

I am using factory default Emacs and Org-mode settings.

I am using the following org todo item:

#+BEGIN_SRC org
* TODO EXAMPLE
  SCHEDULED: <2020-08-09 Sun>
  DEADLINE: <2020-08-09 Sun>
#+END_SRC

It is expected that on the date 2020-08-09 I will see 2 lines in my Org
agenda: one with "Scheduled:" leader text, while the other with
"Deadline:" leader text.

What happens instead is that one of the lines show "Scheduled:" leader
text, and the other line shows no leader text at all.

Also, consider changing the order of the SCHEDULED and DEADLINE properties:

#+BEGIN_SRC org
* TODO EXAMPLE
  DEADLINE: <2020-08-09 Sun>
  SCHEDULED: <2020-08-09 Sun>
#+END_SRC

In this case it will be only the "Deadline:" leader text shown on one of
the lines, while the other line shows no leader text at all.

Therefore my assumption, is that somehow only the first of the
properties is taken into account, while the property which comes second
is ignored.

As stated earlier, the expected behaviour is that both leader/warning
texts are displayed on their appropriate line entry.

Emacs  : GNU Emacs 26.1 (build 2, x86_64-pc-linux-gnu, GTK+ Version 3.24.5)
 of 2019-09-23, modified by Debian
Package: Org mode version 9.1.9 (release_9.1.9-65-g5e4542 @
/usr/share/emacs/26.1/lisp/org/)


[ANN] Org-webring

2020-08-20 Thread Brett Gilio
Hello all!

I hope this post is well received. Today marks the first stable release
of org-webring. Org-webring is an alternative implementation of a
feed-based webring, taking inspiration from openring by Drew DeVault.
Intended to integrate with Org-based websites and blogs (either
directly, or indirectly, as in ox-hugo), it will fetch a given list of
web feed files and correctly parse and format the elements to be
displayed for sharing.

You can find more details about org-webring on my recent blogpost:
https://brettgilio.ml/posts/2020-08-20-announcing-org-webring.html

The project page, including sourcecode is available at:
https://sr.ht/~brettgilio/org-webring/

If you want to participate in discussion or send patches, we have a
private mailing list I encourage you to subscribe to located at:
https://sr.ht/~brettgilio/org-webring/lists

Best wishes to all,
Brett Gilio



Re: [PATCH] org-habit: custom consistency graph placement [9.3.7 (release_9.3.7-716-g6d5cab @ /home/n/.emacs.d/straight/build/org/)]

2020-08-20 Thread No Wayman


Ihor Radchenko  writes:

As I remember, last time I played with multi-line agenda 
entries, there

were issues with org-agenda-next/previous-item. You may consider
checking if your patch breaks those.


Thanks for the heads up, Ihor. The patch itself shouldn't break
anything and is completely optional behavior, though the example I 
gave in the docstring does.

I ended up faking the newline with the display text-property:


(defun +org-habit-graph-on-own-line (graph)
 "Place org habit consitency graph below the habit."
 (add-text-properties
  (line-beginning-position)
  (line-end-position)
  `(display ,(concat (when-let ((icon (car 
  (org-agenda-get-category-icon

(org-agenda-get-category)

   (format " %s " icon))
 (string-trim-left (thing-at-point 'line))
 (make-string (or org-habit-graph-column 0) ? 
 )
 (propertize graph 'display '(height (+ 
 1)))


This works well for me so far.

I've revised the docstring attachment in the attached patch.

>From 41ee2b974a98e0beac00a8012eab91cec948e6d5 Mon Sep 17 00:00:00 2001
From: Nicholas Vollmer 
Date: Thu, 20 Aug 2020 13:46:49 -0400
Subject: [PATCH] habit: add custom option for placing consistency graph

* lisp/org-habit.el (org-habit-insert-consistency-graphs): Add
`org-habit-insert-graph-function' defcustom.

Allow user to control consistency graph placement with a customizable
function.  See `org-habit-insert-graph-function` docstring for an
example.
---
 lisp/org-habit.el | 51 +--
 1 file changed, 40 insertions(+), 11 deletions(-)

diff --git a/lisp/org-habit.el b/lisp/org-habit.el
index f76f0f213..55577f442 100644
--- a/lisp/org-habit.el
+++ b/lisp/org-habit.el
@@ -104,6 +104,33 @@ means of creating calendar-based reminders."
   :package-version '(Org . "9.3")
   :safe (lambda (v) (or (integerp v) (null v
 
+(defcustom org-habit-insert-graph-function nil
+  "Function called to place each consistency graph.
+It must accept the graph string as its sole argument.
+It is invoked with point on the current habit's line in the agenda
+buffer, and is responsible for placing point on the line before the
+next habit if point is moved.
+
+For example, to insert graphs on a new line below each habit:
+
+\(setq org-habit-insert-graph-function
+  (lambda (graph)
+\"Place org habit consitency on its own line below the habit.\"
+(add-text-properties
+ (line-beginning-position) (line-end-position)
+ \\=`(display ,(concat
+ (when-let ((icon (car (org-agenda-get-category-icon
+(org-agenda-get-category)
+
+   (format \" %s \" icon))
+ (string-trim-left (thing-at-point \\='line))
+ (make-string (or org-habit-graph-column 0) ? )
+ (insert graph))
+
+If nil, the graph is inserted on the current habit's line at `org-habit-graph-column'."
+  :group 'org-habit
+  :type 'function)
+
 (defface org-habit-clear-face
   'background light)) (:background "#8270f9"))
 (((background dark)) (:background "blue")))
@@ -430,17 +457,19 @@ current time."
   (while (not (eobp))
 	(let ((habit (get-text-property (point) 'org-habit-p)))
 	  (when habit
-	(move-to-column org-habit-graph-column t)
-	(delete-char (min (+ 1 org-habit-preceding-days
- org-habit-following-days)
-			  (- (line-end-position) (point
-	(insert-before-markers
-	 (org-habit-build-graph
-	  habit
-	  (time-subtract moment (days-to-time org-habit-preceding-days))
-	  moment
-	  (time-add moment (days-to-time org-habit-following-days))
-	(forward-line)
+(let ((graph (org-habit-build-graph
+  habit
+  (time-subtract moment (days-to-time org-habit-preceding-days))
+  moment
+  (time-add moment (days-to-time org-habit-following-days)
+  (if (functionp org-habit-insert-graph-function)
+  (funcall org-habit-insert-graph-function graph)
+(move-to-column org-habit-graph-column t)
+(delete-char (min (+ 1 org-habit-preceding-days
+ org-habit-following-days)
+  (- (line-end-position) (point
+(insert-before-markers graph)
+(forward-line)
 
 (defun org-habit-toggle-habits ()
   "Toggle display of habits in an agenda buffer."
-- 
2.28.0



Re: [PATCH] ob-python.el: Fix issue with sessions on remote machines

2020-08-20 Thread Jack Kamm
Merged now -- thanks for your contribution.

Cheers,
Jack



Re: [PATCH] org-habit: custom consistency graph placement [9.3.7 (release_9.3.7-716-g6d5cab @ /home/n/.emacs.d/straight/build/org/)]

2020-08-20 Thread Ihor Radchenko
> Famous last words. I forgot the agenda relies on text-properties 
> for much of its functionality.
> I've attached a patch that addresses this and also removes the 
> `save-excursion` around the funcall to the custom insertion 
> function.

As I remember, last time I played with multi-line agenda entries, there
were issues with org-agenda-next/previous-item. You may consider
checking if your patch breaks those.

Best,
Ihor


No Wayman  writes:

> No Wayman  writes:
>
>> It makes this sort of customization very simple
>
> Famous last words. I forgot the agenda relies on text-properties 
> for much of its functionality.
> I've attached a patch that addresses this and also removes the 
> `save-excursion` around the funcall to the custom insertion 
> function.
> I've noted in the documentation that if the function is moving 
> point, it is responsible for making sure it ends up on the line 
> before the next habit.
>
> From 93496b6b86d73a95512c277a1321005d5f1995d1 Mon Sep 17 00:00:00 2001
> From: Nicholas Vollmer 
> Date: Thu, 20 Aug 2020 13:46:49 -0400
> Subject: [PATCH] habit: add custom option for placing consistency graph
>
> * lisp/org-habit.el (org-habit-insert-consistency-graphs): Add
> `org-habit-insert-graph-function' defcustom.
>
> Allow user to control consistency graph placement with a customizable
> function.  See `org-habit-insert-graph-function` docstring for an
> example.
> ---
>  lisp/org-habit.el | 45 ++---
>  1 file changed, 34 insertions(+), 11 deletions(-)
>
> diff --git a/lisp/org-habit.el b/lisp/org-habit.el
> index f76f0f213..99dfe8def 100644
> --- a/lisp/org-habit.el
> +++ b/lisp/org-habit.el
> @@ -104,6 +104,27 @@ means of creating calendar-based reminders."
>:package-version '(Org . "9.3")
>:safe (lambda (v) (or (integerp v) (null v
>  
> +(defcustom org-habit-insert-graph-function nil
> +  "Function called to place each consistency graph.
> +It must accept the graph string as its sole argument.
> +It is invoked with point on the current habit's line in the agenda buffer,
> +and is responsible for placing point on the line before the next habit if 
> point is moved.
> +
> +For example, to insert graphs on a new line below the habit:
> +
> +  (setq org-habit-insert-graph-function
> +(lambda (graph)
> +  (let ((props (text-properties-at (point
> +(end-of-line)
> +;; org-agenda functionality depends on current line's text 
> properties
> +(insert (concat \"\\n\" (make-string (1+ (or 
> org-habit-graph-column 0)) ? )))
> +(add-text-properties (line-beginning-position) 
> (line-end-position) props)
> +(insert graph
> +
> +If nil, the graph is inserted on the current habit's line at 
> `org-habit-graph-column'."
> +  :group 'org-habit
> +  :type 'function)
> +
>  (defface org-habit-clear-face
>'background light)) (:background "#8270f9"))
>  (((background dark)) (:background "blue")))
> @@ -430,17 +451,19 @@ current time."
>(while (not (eobp))
>   (let ((habit (get-text-property (point) 'org-habit-p)))
> (when habit
> - (move-to-column org-habit-graph-column t)
> - (delete-char (min (+ 1 org-habit-preceding-days
> -  org-habit-following-days)
> -   (- (line-end-position) (point
> - (insert-before-markers
> -  (org-habit-build-graph
> -   habit
> -   (time-subtract moment (days-to-time org-habit-preceding-days))
> -   moment
> -   (time-add moment (days-to-time org-habit-following-days))
> - (forward-line)
> +(let ((graph (org-habit-build-graph
> +  habit
> +  (time-subtract moment (days-to-time 
> org-habit-preceding-days))
> +  moment
> +  (time-add moment (days-to-time 
> org-habit-following-days)
> +  (if (functionp org-habit-insert-graph-function)
> +  (funcall org-habit-insert-graph-function graph)
> +(move-to-column org-habit-graph-column t)
> +(delete-char (min (+ 1 org-habit-preceding-days
> + org-habit-following-days)
> +  (- (line-end-position) (point
> +(insert-before-markers graph)
> +(forward-line)
>  
>  (defun org-habit-toggle-habits ()
>"Toggle display of habits in an agenda buffer."
> -- 
> 2.28.0



Re: [bug] args out of range upon meta-return in body of list item

2020-08-20 Thread Samuel Wales
thanks.  just wanted to make sure i wasn't supposed to report that it
wasn't working or was a different bug.

On 8/20/20, Nicolas Goaziou  wrote:
> Hello,
>
> Samuel Wales  writes:
>
>> i presume the fix will come out in the next release of maint?
>
> I applied the fix on master because it is built on top of another fix
> from there. So no, it should be available in Org 9.4 only.
>
> Regards,
> --
> Nicolas Goaziou
>


-- 
The Kafka Pandemic

Please learn what misopathy is.
https://thekafkapandemic.blogspot.com/2013/10/why-some-diseases-are-wronged.html



Re: [PATCH] org-habit: custom consistency graph placement [9.3.7 (release_9.3.7-716-g6d5cab @ /home/n/.emacs.d/straight/build/org/)]

2020-08-20 Thread No Wayman


No Wayman  writes:


It makes this sort of customization very simple


Famous last words. I forgot the agenda relies on text-properties 
for much of its functionality.
I've attached a patch that addresses this and also removes the 
`save-excursion` around the funcall to the custom insertion 
function.
I've noted in the documentation that if the function is moving 
point, it is responsible for making sure it ends up on the line 
before the next habit.


>From 93496b6b86d73a95512c277a1321005d5f1995d1 Mon Sep 17 00:00:00 2001
From: Nicholas Vollmer 
Date: Thu, 20 Aug 2020 13:46:49 -0400
Subject: [PATCH] habit: add custom option for placing consistency graph

* lisp/org-habit.el (org-habit-insert-consistency-graphs): Add
`org-habit-insert-graph-function' defcustom.

Allow user to control consistency graph placement with a customizable
function.  See `org-habit-insert-graph-function` docstring for an
example.
---
 lisp/org-habit.el | 45 ++---
 1 file changed, 34 insertions(+), 11 deletions(-)

diff --git a/lisp/org-habit.el b/lisp/org-habit.el
index f76f0f213..99dfe8def 100644
--- a/lisp/org-habit.el
+++ b/lisp/org-habit.el
@@ -104,6 +104,27 @@ means of creating calendar-based reminders."
   :package-version '(Org . "9.3")
   :safe (lambda (v) (or (integerp v) (null v
 
+(defcustom org-habit-insert-graph-function nil
+  "Function called to place each consistency graph.
+It must accept the graph string as its sole argument.
+It is invoked with point on the current habit's line in the agenda buffer,
+and is responsible for placing point on the line before the next habit if point is moved.
+
+For example, to insert graphs on a new line below the habit:
+
+  (setq org-habit-insert-graph-function
+(lambda (graph)
+  (let ((props (text-properties-at (point
+(end-of-line)
+;; org-agenda functionality depends on current line's text properties
+(insert (concat \"\\n\" (make-string (1+ (or org-habit-graph-column 0)) ? )))
+(add-text-properties (line-beginning-position) (line-end-position) props)
+(insert graph
+
+If nil, the graph is inserted on the current habit's line at `org-habit-graph-column'."
+  :group 'org-habit
+  :type 'function)
+
 (defface org-habit-clear-face
   'background light)) (:background "#8270f9"))
 (((background dark)) (:background "blue")))
@@ -430,17 +451,19 @@ current time."
   (while (not (eobp))
 	(let ((habit (get-text-property (point) 'org-habit-p)))
 	  (when habit
-	(move-to-column org-habit-graph-column t)
-	(delete-char (min (+ 1 org-habit-preceding-days
- org-habit-following-days)
-			  (- (line-end-position) (point
-	(insert-before-markers
-	 (org-habit-build-graph
-	  habit
-	  (time-subtract moment (days-to-time org-habit-preceding-days))
-	  moment
-	  (time-add moment (days-to-time org-habit-following-days))
-	(forward-line)
+(let ((graph (org-habit-build-graph
+  habit
+  (time-subtract moment (days-to-time org-habit-preceding-days))
+  moment
+  (time-add moment (days-to-time org-habit-following-days)
+  (if (functionp org-habit-insert-graph-function)
+  (funcall org-habit-insert-graph-function graph)
+(move-to-column org-habit-graph-column t)
+(delete-char (min (+ 1 org-habit-preceding-days
+ org-habit-following-days)
+  (- (line-end-position) (point
+(insert-before-markers graph)
+(forward-line)
 
 (defun org-habit-toggle-habits ()
   "Toggle display of habits in an agenda buffer."
-- 
2.28.0



Re: [bug] args out of range upon meta-return in body of list item

2020-08-20 Thread Nicolas Goaziou
Hello,

Samuel Wales  writes:

> i presume the fix will come out in the next release of maint?

I applied the fix on master because it is built on top of another fix
from there. So no, it should be available in Org 9.4 only.

Regards,
-- 
Nicolas Goaziou



Re: [bug] args out of range upon meta-return in body of list item

2020-08-20 Thread Samuel Wales
i presume the fix will come out in the next release of maint?
[still getting in maint, which is ok; just confirming.]

On 8/16/20, Samuel Wales  wrote:
> thank you both.
>
> On 8/16/20, Kyle Meyer  wrote:
>> Nicolas Goaziou writes:
>>
>>> Yes, the problem lies in `org-list-insert-item'. I pushed a fix and
>>> a test for that.
>>
>> Great.  Thank you!
>>
>
>
> --
> The Kafka Pandemic
>
> Please learn what misopathy is.
> https://thekafkapandemic.blogspot.com/2013/10/why-some-diseases-are-wronged.html
>


-- 
The Kafka Pandemic

Please learn what misopathy is.
https://thekafkapandemic.blogspot.com/2013/10/why-some-diseases-are-wronged.html



Re: [PATCH] org-habit: custom consistency graph placement [9.3.7 (release_9.3.7-716-g6d5cab @ /home/n/.emacs.d/straight/build/org/)]

2020-08-20 Thread No Wayman



No Wayman  writes:

I'm using it now to place each habit's graph on a new line below 
the habit at `org-habit-graph-column'. 


Forgot to mention, this also has the added benefit of not 
displacing the tags on each habit's line.




[PATCH] org-habit: custom consistency graph placement [9.3.7 (release_9.3.7-716-g6d5cab @ /home/n/.emacs.d/straight/build/org/)]

2020-08-20 Thread No Wayman


I like seeing a month long habit consistency graph, but this 
usually overwrites most of the information on each agenda habit 
line unless the window is particularly wide.
The attached patch adds a customizable option to place the graph. 
I'm using it now to place each habit's graph on a new line below 
the habit at `org-habit-graph-column'. It makes this sort of 
customization very simple, e.g.


 (setq org-habit-insert-graph-function
   (lambda (graph)
 (goto-char (point-at-eol))
 (insert "\n")
 (move-to-column org-habit-graph-column t)
 (insert graph)))

Would love to see it included in org-habit.

Thanks,
Nicholas Vollmer

>From 6d5cabcbe15e67873a7ce489e59cff642357d8e6 Mon Sep 17 00:00:00 2001
From: Nicholas Vollmer 
Date: Thu, 20 Aug 2020 13:46:49 -0400
Subject: [PATCH] habit: add custom option for placing consistency graph

* lisp/org-habit.el (org-habit-insert-consistency-graphs): Add
`org-habit-insert-graph-function' defcustom.

Allow user to control consistency graph placement with a customizable
function.  See `org-habit-insert-graph-function` docstring for an
example.
---
 lisp/org-habit.el | 42 +++---
 1 file changed, 31 insertions(+), 11 deletions(-)

diff --git a/lisp/org-habit.el b/lisp/org-habit.el
index f76f0f213..64d265448 100644
--- a/lisp/org-habit.el
+++ b/lisp/org-habit.el
@@ -104,6 +104,24 @@ means of creating calendar-based reminders."
   :package-version '(Org . "9.3")
   :safe (lambda (v) (or (integerp v) (null v
 
+(defcustom org-habit-insert-graph-function nil
+  "Function called to place each consistency graph.
+It must accept the graph string as its sole argument.
+It is invoked with point on the current habit's line in the agenda buffer.
+
+For example, to insert graphs on a new line below the habit:
+
+  (setq org-habit-insert-graph-function
+(lambda (graph)
+  (goto-char (point-at-eol))
+  (insert \"\\n\")
+  (move-to-column org-habit-graph-column t)
+  (insert graph)))
+
+If nil, the graph is inserted on the current habit's line at `org-habit-graph-column'."
+  :group 'org-habit
+  :type 'function)
+
 (defface org-habit-clear-face
   'background light)) (:background "#8270f9"))
 (((background dark)) (:background "blue")))
@@ -430,17 +448,19 @@ current time."
   (while (not (eobp))
 	(let ((habit (get-text-property (point) 'org-habit-p)))
 	  (when habit
-	(move-to-column org-habit-graph-column t)
-	(delete-char (min (+ 1 org-habit-preceding-days
- org-habit-following-days)
-			  (- (line-end-position) (point
-	(insert-before-markers
-	 (org-habit-build-graph
-	  habit
-	  (time-subtract moment (days-to-time org-habit-preceding-days))
-	  moment
-	  (time-add moment (days-to-time org-habit-following-days))
-	(forward-line)
+(let ((graph (org-habit-build-graph
+  habit
+  (time-subtract moment (days-to-time org-habit-preceding-days))
+  moment
+  (time-add moment (days-to-time org-habit-following-days)
+  (if (functionp org-habit-insert-graph-function)
+  (save-excursion (funcall org-habit-insert-graph-function graph))
+(move-to-column org-habit-graph-column t)
+(delete-char (min (+ 1 org-habit-preceding-days
+ org-habit-following-days)
+  (- (line-end-position) (point
+(insert-before-markers graph
+  (forward-line))
 
 (defun org-habit-toggle-habits ()
   "Toggle display of habits in an agenda buffer."
-- 
2.28.0



Re: Font width in Properties Drawer

2020-08-20 Thread Norman Tovey-Walsh
Garrett Rolfs  writes:
> Executing C-u C-x = on a space in this area indicates there is no face
> defined. So I suspect the answer is currently no.

I don’t know if this is useful feedback, but I’m running Org-mode
version 9.3.7 and in my properties drawers, the keywords are in
org-special-keyword face and the values are in org-property-value face.

Be seeing you,
  norm

--
Norman Tovey-Walsh 
https://nwalsh.com/

> Lawyers, I suppose, were children once.--Charles Lamb


signature.asc
Description: PGP signature


Bug: Unicode ORG-TODO-KEYWORDS not recognized in agenda's stuck projects [9.3.6 (9.3.6-4-gdfa7a3-elpa @ /home/andy/.config/emacs/elpa/org-20200217/)]

2020-08-20 Thread Andreas Drop


I configured my org-todo-keywords in a way, that they are just single
unicode symbols instead of the classic TODO, NEXT, WAIT, DONE,etc. This is
done in my init.el like this:

(setq org-todo-keywords '((sequence "⭕(p)" "⸰(t)" "▶(n)" "⏸(w)" "|" "✔(d)" 
"❌(c)" "⏩(r)")))

This works perfectly, so I can advance the todo-states, choose them
directly, and filter on them in the agenda's todo-view, even org-edna,
which heavily relies on them works as designed.

While trying to use GTDs approach I defined a stuck project as one
having no next action meaning, having no subheading with a todo state of "▶"

(setq org-stuck-projects '("project" ("▶" "NEXT") nil ""))

The 'NEXT' is used here only for validating the existence of a bug, originally 
it was
omitted in my config.

My projects look like this:

** ⭕ [3/4] Dame Edna   :project:dame:...
** ⭕ [0/13] Example project: Garage Project:project:garage:
 :PROPERTIES:
 :COLUMNS:  %40ITEM %8Effort(Effort){:} %60BLOCKER
 :COOKIE_DATA: todo recursive
 :END:
*** ⸰ Find local stores for paint
*** ⸰ Choose color for paint
*** ⸰ Buy paint
*** ⸰ Move car to nearby parking lot
*** ⸰ Remove bikes
*** ⸰ Remove stuff from shelves
*** ⸰ Remove shelves
*** ▶ Garage is empty
*** ⸰ Paint walls and floor
*** ⸰ Re-install shelves
*** ⸰ Bring back bikes into garage
*** ⸰ Bring back car into garage
*** ⸰ Celebrate and close project

Both of them contain a subheading with a todo state of "▶" which should prevent 
them from
showing up in the stuck projects agenda view. However, they both appear

List of stuck projects: 
  ops:⭕ [3/4] Dame Edna   :project:dame:
  ops:⭕ [0/13] Example project: Garage Project
:project:garage:

I suspected the problem to be with the excluded todo-state beeing a
unicode symbol, so I tried to substitute it with the classical 'NEXT',
so it now showed like this:

** ⭕ [3/4] Dame Edna   :project:dame:
** ⭕ [0/13] Example project: Garage Project:project:garage:
 :PROPERTIES:
 :COLUMNS:  %40ITEM %8Effort(Effort){:} %60BLOCKER
 :COOKIE_DATA: todo recursive
 :END:
*** ⸰ Find local stores for paint
*** ⸰ Choose color for paint
*** ⸰ Buy paint
*** ⸰ Move car to nearby parking lot
*** ⸰ Remove bikes
*** ⸰ Remove stuff from shelves
*** ⸰ Remove shelves
*** NEXT Garage is empty
*** ⸰ Paint walls and floor
*** ⸰ Re-install shelves
*** ⸰ Bring back bikes into garage
*** ⸰ Bring back car into garage
*** ⸰ Celebrate and close project

And now the Garage project is successfully removed from the stuck
projects, because it contains a NEXT at the position of the todo
keyword, despite the fact, that NEXT is not even defined as a valid todo
keyword.

Looks like in this place there is some simple string comparison magic 
happening, that
can't handle unicode, instead of usage of the defined org-todo-keywords



Emacs  : GNU Emacs 27.1 (build 1, x86_64-pc-linux-gnu, GTK+ Version 2.24.32)
 of 2020-08-12
Package: Org mode version 9.3.6 (9.3.6-4-gdfa7a3-elpa @ 
/home/andy/.config/emacs/elpa/org-20200217/)

current state:
==
(setq
 org-todo-keywords '((sequence "⭕(p)" "⸰(t)" "▶(n)"
  "⏸(w)" "|" "✔(d)" "❌(c)" "⏩(r)")
 )
 org-stuck-projects '("project" ("▶" "NEXT") nil "")
 org-use-property-inheritance t
 org-tags-exclude-from-inheritance '("crypt" "project")

 org-agenda-files '("~/cloud/org/ops.org")
 org-closed-keep-when-no-todo t
 )


Andy Drop