Re: Highlighting and Background Colour for Source Code

2021-05-10 Thread Christopher Dimech



> Sent: Tuesday, May 11, 2021 at 4:50 PM
> From: "Tim Cross" 
> To: emacs-orgmode@gnu.org
> Subject: Re: Highlighting and Background Colour for Source Code
>
>
> Christopher Dimech  writes:
>
> > Currently currently handles the highlighting of programming languages 
> > through
> > "Code Blocks".  Could org-mode have the capability of highlighting a whole 
> > buffer
> > with a particular language highlight typeface.
> >
>
> Sorry, I don't quite understand what exactly your asking for?

Suppose I have an elisp file and I change to org-mode by hitting "M-x org-mode".
The code does not get highlighted because it is not embedded within org-babel
construct.

If I have a programming language file with some org-mode heading commands in it,
and change to org-mode, it would be neat to have language highlighting 
available.

> > I have also seen that within code blocks, the background is uses a colour 
> > that is
> > different from the background colour of the buffer.  Is there a capability 
> > that
> > the code block background is set to the buffer background colour.
>
> I think more often than not, this is determined by the Emacs colour
> theme your using. I've noticed that some themes colour src block
> backgrounds differently from the rest of the buffer background and some
> don't. I noticed this because I do like src blocks to have a different
> background and some of the themes I like fail to do this, so I had to
> customize them.

It is certainly useful but not always.  Outline could have a switch, that
toggles between highlight and no-highlight.

> You can try customizing your theme. Have a look at
>
> M-x list-colors-display
>
> to see a list of all the faces being used. Look for ones with your theme
> name or a name which looks like it might be the background face for src
> blocks (you can also see the colours and look for that. Once you have
> made the changes, look at
>
> M-x customize-theme
>
> and save your changes as a new customized theme.
>
>
>
> --
> Tim Cross
>
>



Re: Highlighting and Background Colour for Source Code

2021-05-10 Thread Tim Cross


Christopher Dimech  writes:

> Currently currently handles the highlighting of programming languages through
> "Code Blocks".  Could org-mode have the capability of highlighting a whole 
> buffer
> with a particular language highlight typeface.
>

Sorry, I don't quite understand what exactly your asking for?

> I have also seen that within code blocks, the background is uses a colour 
> that is
> different from the background colour of the buffer.  Is there a capability 
> that
> the code block background is set to the buffer background colour.

I think more often than not, this is determined by the Emacs colour
theme your using. I've noticed that some themes colour src block
backgrounds differently from the rest of the buffer background and some
don't. I noticed this because I do like src blocks to have a different
background and some of the themes I like fail to do this, so I had to
customize them. 

You can try customizing your theme. Have a look at 

M-x list-colors-display

to see a list of all the faces being used. Look for ones with your theme
name or a name which looks like it might be the background face for src
blocks (you can also see the colours and look for that. Once you have
made the changes, look at 

M-x customize-theme

and save your changes as a new customized theme.



-- 
Tim Cross



Re: Refiling All 'Terminal TODO State' Entries to a Particular Heading

2021-05-10 Thread Ihor Radchenko
Tim Visher  writes:

> I maintain my primary TODO list as an org file with top-level headings like *
> This Week, * Delegated, * Scheduled, * Deferred, etc. These all contain
> TODOs or potential TODOs.

FYI. You can also read [1] for alternative approaches.

[1] https://orgmode.org/list/76f7cd71190bcff68e57e71d163fe...@science.uva.nl/

>1. Is there a better way to find the * Done entry than searching for it
>every time?

You can assign a custom ID to that entry and use org-link-search.

>2. Am I using org-refile correctly there? It's functional but it also
>seems needlessly complicated.

Seems fine. I do not know any better way to do it.




Re: The fate of ditaa.jar (9.4.5.)

2021-05-10 Thread Tim Cross


Nick Dokos  writes:

> Jarmo Hurri  writes:
>
>> Greetings.
>>
>> I pulled the latest master and noticed that contrib has been moved into
>> a separate repository. I also cloned this contrib repository, but can
>> not find the file
>>
>> scripts/ditaa.jar
>>
>> in the repo. In fact, there is no directory scripts in the repo.
>>
>> The documentation in the latest master states that
>>
>> Stathis Sideris wrote the ‘ditaa.jar’ ASCII to PNG converter that is now
>> packaged into the org-contrib repository.
>>
>> How should I proceed? Should I build this separately
>>
>> https://github.com/stathissideris/ditaa
>
> You don't need to build it: it's available in the release area
>
> https://github.com/stathissideris/ditaa/releases
>
>>
>> or will it still be included into contrib?
>
> In general, I think it's a better idea to point to the canonical sources
> and document how to integrate it into Org mode, than bundle things like
> that, but I have no idea how things are going to go. I'm sure there will
> be some problems that will need fixing one way or another.

I agree. As pointed out already, just bundling the jar file is not
sufficient as you need a java runtime as well. If we bundle it, we also
need to ensure it is updated if/when new jar versions are released. 

Better to clearly document where to get the dependencies and point to
the appropriate installation instructions.

I think we also need to keep in mind that we are currently in a bit of a
transition stage with the move to using ELPA and non-gnu ELPA. There
will be teething problems needing to be worked through both before and
after the transition. 
-- 
Tim Cross



Re: Bug: Infinite loop in org-agenda-dim-blocked-tasks

2021-05-10 Thread Aaron L. Zeng
(Sorry, I am resending this email because I found out gmail doesn't support
In-Reply-To in mailto: links).

Unfortunately, I think this bug is still there (I also didn't see any
commits addressing it, but I could have missed it in the log
somewhere).  I tried the master branch but was still able to reproduce
the bug using `emacs -q -L ~/src/org-mode/lisp`:

After using `customize-set-variable` to enable
org-enforce-todo-checkbox-dependencies, with the following agenda
file:

* TODO blocked task
  - [ ] checkbox

Trying to clock into the task from org-todo-list results in an infinite loop.

Thanks,
Aaron



Re: Bug: Infinite loop in org-agenda-dim-blocked-tasks

2021-05-10 Thread Aaron Zeng
Hi Bastien,

Unfortunately, I think this bug is still there (I also didn't see any
commits addressing it, but I could have missed it in the log
somewhere).  I tried the master branch but was still able to reproduce
the bug using `emacs -q -L ~/src/org-mode/lisp`:

After using `customize-set-variable` to enable
org-enforce-todo-checkbox-dependencies, with the following agenda
file:

* TODO blocked task
  - [ ] checkbox

Trying to clock into the task from org-todo-list results in an infinite loop.

Thanks,
Aaron



Re: The fate of ditaa.jar (9.4.5.)

2021-05-10 Thread Christopher Dimech
If having the source is not as easy as getting a link that is dependable,
then it got to be bundled.  I rather use a version that works than nothing
at all.  I have used ditaa in org for the documentation of texinfo.

> Sent: Tuesday, May 11, 2021 at 6:41 AM
> From: "Nick Dokos" 
> To: emacs-orgmode@gnu.org
> Subject: Re: The fate of ditaa.jar (9.4.5.)
>
> Jarmo Hurri  writes:
> 
> > Greetings.
> >
> > I pulled the latest master and noticed that contrib has been moved into
> > a separate repository. I also cloned this contrib repository, but can
> > not find the file
> >
> > scripts/ditaa.jar
> >
> > in the repo. In fact, there is no directory scripts in the repo.
> >
> > The documentation in the latest master states that
> >
> > Stathis Sideris wrote the ‘ditaa.jar’ ASCII to PNG converter that is now
> > packaged into the org-contrib repository.
> >
> > How should I proceed? Should I build this separately
> >
> > https://github.com/stathissideris/ditaa
> 
> You don't need to build it: it's available in the release area
> 
> https://github.com/stathissideris/ditaa/releases
> 
> >
> > or will it still be included into contrib?
> 
> In general, I think it's a better idea to point to the canonical sources
> and document how to integrate it into Org mode, than bundle things like
> that, but I have no idea how things are going to go. I'm sure there will
> be some problems that will need fixing one way or another.
> 
> -- 
> Nick
> 
> "There are only two hard problems in computer science: cache
> invalidation, naming things, and off-by-one errors." -Martin Fowler
> 
> 
>



Re: The fate of ditaa.jar (9.4.5.)

2021-05-10 Thread Christopher Dimech
If org-mode wants to support ditaa, it is a requirement to inform the user how 
to
get the software and install it.  Moving into into a separate repository without
appropriately telling the user introduces the problem that users will miss out
on free software that they would otherwise have used.  Using org should not be 
made 
more difficult than it already is. 
  

> Sent: Tuesday, May 11, 2021 at 8:49 AM
> From: "Arthur Miller" 
> To: "Dr. Arne Babenhauserheide" 
> Cc: emacs-orgmode@gnu.org
> Subject: Re: The fate of ditaa.jar (9.4.5.)
>
> "Dr. Arne Babenhauserheide"  writes:
> 
> > Russell Adams  writes:
> >
> >> On Mon, May 10, 2021 at 02:28:57PM +0300, Jarmo Hurri wrote:
> >>> I pulled the latest master and noticed that contrib has been moved into
> >>> a separate repository. I also cloned this contrib repository, but can
> >>> not find the file
> >>>
> >>> scripts/ditaa.jar
> >>>
> >>> in the repo. In fact, there is no directory scripts in the repo.
> >>
> >> I actually never considered this might be packaged with Org. I always
> >> thought I had to install it separately, like my Latex distribution or
> >> PlantUML.
> >
> > Bundling this makes ditaa code blocks just work. Otherwise they won’t
> > work on every org-install.
> 
> The user still needs a Java runtime installed on his/her compute, so
> bundling ditaa.jar gives no guarantee at all that ditaa blocks will just
> work on every org-install.
> 
> Instead a less informaed user, not used to run java programs, might be
> left with a not working application that fails silently or to the user
> incomprehensible error message.
> 
> Better to point user to ditaa's sources/releases and inform it is
> optional with org. That way non-informed user will have to install java
> and ditaa and will at least have an idea where to look when things go wrong.
> 
>



Re: Bug: Double trailing slash for default candidate in org-refile-get-target [9.4 (9.4-7-g3eccc5-elpaplus @ /home/gustavo/.emacs.d/elpa/org-plus-contrib-20200921/)]

2021-05-10 Thread Bhavin Gandhi
Hello Bastien

I'm new to Org mode codebase as well as Elisp. Is this something I can pick
up, I was not sure that's why I thought of asking here on the list.

--
Regards,
Bhavin Gandhi (bhavin192) | https://geeksocket.in


Re: The fate of ditaa.jar (9.4.5.)

2021-05-10 Thread Arthur Miller
"Dr. Arne Babenhauserheide"  writes:

> Russell Adams  writes:
>
>> On Mon, May 10, 2021 at 02:28:57PM +0300, Jarmo Hurri wrote:
>>> I pulled the latest master and noticed that contrib has been moved into
>>> a separate repository. I also cloned this contrib repository, but can
>>> not find the file
>>>
>>> scripts/ditaa.jar
>>>
>>> in the repo. In fact, there is no directory scripts in the repo.
>>
>> I actually never considered this might be packaged with Org. I always
>> thought I had to install it separately, like my Latex distribution or
>> PlantUML.
>
> Bundling this makes ditaa code blocks just work. Otherwise they won’t
> work on every org-install.

The user still needs a Java runtime installed on his/her compute, so
bundling ditaa.jar gives no guarantee at all that ditaa blocks will just
work on every org-install.

Instead a less informaed user, not used to run java programs, might be
left with a not working application that fails silently or to the user
incomprehensible error message.

Better to point user to ditaa's sources/releases and inform it is
optional with org. That way non-informed user will have to install java
and ditaa and will at least have an idea where to look when things go wrong.



Re: [PATCH] Wrap LaTeX snippets in $$ with markdown export

2021-05-10 Thread Nicolas Goaziou
Hello,

Timothy  writes:

> Going off this, I've taken this as assent and just pushed my patch in
> its current form as 981f25031.

Thank you.

Regards,
-- 
Nicolas Goaziou



Re: [wip-cite-new] New natbib processor

2021-05-10 Thread Bruce D'Arcus
On Mon, May 10, 2021 at 4:22 PM Nicolas Goaziou  wrote:
>
> Hello,
>
> "Bruce D'Arcus"  writes:
>
> > Minor suggestion Nicolas:
> >
> > Currently, oc-natbib ignores global affixes.
>
> It is slightly more subtle. It ignores global affixes when there is
> a single citation reference. With multiple keys, it ignores local
> affixes and uses global ones instead.

I keep forgetting the limitations of natbib; namely, it has no
per-item affixes, so you can't separately specify locators for
individual items when there is more than one in a citation.

E.g. natbib itself only has global affixes, in practice, so the
question is just how to map the more expressive (biblate-inspired)
model of org-cite to that.

Maybe what you have now is good for a first release. We'll have to see
how people respond probably.

Bruce



Re: [wip-cite-new] New natbib processor

2021-05-10 Thread Nicolas Goaziou
Hello,

"Bruce D'Arcus"  writes:

> Minor suggestion Nicolas:
>
> Currently, oc-natbib ignores global affixes.

It is slightly more subtle. It ignores global affixes when there is
a single citation reference. With multiple keys, it ignores local
affixes and uses global ones instead.

> But it seems ideally the code would preprend the global prefix to the local
> prefix of the first cite.
>
> So [cite:global ;local @doe] should yield \citep[global local ][]{doe}.

The [cite:global ;local @doe] construct sounds odd. I also find the
current state predictable.

Do you still find concatenation prefix-only concatenation more
appropriate? Also, what would happen with multiple keys?

Regards,
-- 
Nicolas Goaziou



Re: The fate of ditaa.jar (9.4.5.)

2021-05-10 Thread Nick Dokos
Jarmo Hurri  writes:

> Greetings.
>
> I pulled the latest master and noticed that contrib has been moved into
> a separate repository. I also cloned this contrib repository, but can
> not find the file
>
> scripts/ditaa.jar
>
> in the repo. In fact, there is no directory scripts in the repo.
>
> The documentation in the latest master states that
>
> Stathis Sideris wrote the ‘ditaa.jar’ ASCII to PNG converter that is now
> packaged into the org-contrib repository.
>
> How should I proceed? Should I build this separately
>
> https://github.com/stathissideris/ditaa

You don't need to build it: it's available in the release area

https://github.com/stathissideris/ditaa/releases

>
> or will it still be included into contrib?

In general, I think it's a better idea to point to the canonical sources
and document how to integrate it into Org mode, than bundle things like
that, but I have no idea how things are going to go. I'm sure there will
be some problems that will need fixing one way or another.

-- 
Nick

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




Re: bug#47885: [PATCH] org-table-import: Make it more smarter for interactive use

2021-05-10 Thread Utkarsh Singh
Hi Maxim,

Sorry for the late reply!

On 2021-04-28, 23:38 +0700, Maxim Nikulin  wrote:

> On 28/04/2021 15:37, Utkarsh Singh wrote:
>> +List of preferred separator (in order of preference):
>> +comma, TAB, semicolon, colon or SPACE.
> I will hardly be using this feature heavily, so I do not insist that
> the following must be taken into account. Just some considerations...
>
> There are locales where comma is used as decimal separator 23,5
> (e.g. ru_RU.UTF-8). Office software and applications oriented to
> office users often use semicolon as field separator. There are still
> may be plenty of numbers with fractional part, so with commas. Likely
> ";" should be tried at first for such locales.
>
> However the same user may have enough CSV files that are really "comma
> separated", e.g. results of numerical simulation where localization is
> intentionally ignored, data obtained from some equipment, etc.
>
> Some files (e.g. downloaded bank statements) may be in legacy 8-bit
> encoding instead of UTF-8.
>
> As a result, sometimes the only convenient way is to try various
> options with interactive preview.

What do we mean by interactive preview?  Does this mean that we should
present a user with a list of possible delimiters using minibuffer?

If you are suggesting this then rather trying 'various options' based on
locals you can use =org-table-import= function directly as it accepts
separator as it's argument.

For ex (please review my usage of alist):

#+begin_src elisp
(defvar my-separator-alist '(("comma" . ",")
 ("tab" . "\t")
 ("semicolon" . ";")
 ("colon" . ":")
 ("space" . " ")))

(defun my/table-import (file separator)
  (interactive (list (read-file-name "Import CSV file: " nil nil t)
 (cdr (assoc (completing-read "Separator: " 
my-separator-alist)
 my-separator-alist
  (org-table-import file separator))
#+end_src

-- 
Utkarsh Singh
http://utkarshsingh.xyz



RE: ob-sql is not finding psql when using direnv+guix

2021-05-10 Thread Cook, Malcolm
>I am using Guix with direnv.

What is your shell?

How/When do you "hook direnv into your shell" (https://direnv.net/)?

> In an specific folder I am installing and using psql and postgresql using 
> direnv+guix as follows:
>use guix --manifest=cdpp-manifest.scm
>
>export PGUSER=food_user
>export PGPASSWORD=some_password
>export PGDATABASE=food
>
>layout postgres

When are you doing this?

 a) in the "specific folder"'s .envrc file?
 b) in an org-mode shell block that you execute prior to the sql block?
 c) ??


You seem to be following [Per\-project 
Postgres](https://jamey.thesharps.us/2019/05/29/per-project-postgres/) but with 
guix instead of nix.  Nice.

If you enter the directory and then call emacs, earthing should just work, no 
changes neede.

If you want to tell emacs to adopt the environment established by a .direnv, 
you probably want [direnv integration for 
emacs\.](https://github.com/wbolster/emacs-direnv)

I've got to try this!

Cheers

>
>
>Where cdpp-manifest.scm contains the following:
>
>(specifications->manifest
>'("python"
>   "python-pandas"
>   "python-numpy"
>   "python-flask"
>   "python-graphene"
>   "postgresql"
>   "jupyter"))
>
>I am able to use sql-mode and run queries against the database, in order to 
>achieve that I am using the following .dir-locals.el
>
>;;; Directory Local Variables
>;;; For more information see (info "(emacs) Directory Variables")
>
>
>((nil .
>  ((projectile-project-test-cmd . "pytest --color=no --failed-first 
>--maxfail=5")))
>(python-mode .
>  ((python-shell-buffer-name . "Python [CDPP-Inspecciones]")))
>
>(org-mode . (
>  (indent-tabs-mode . nil)
>  (org-src-preserve-indentation . t)
>  (org-footnote-auto-adjust . t)
>  (org-footnote-auto-label . t)
>  (ispell-local-dictionary . "spanish")
>  (org-export-allow-bind-keywords . t)
>  (org-footnote-define-inline . nil)
>  (org-footnote-section . "Footnotes")))
>
>(sql-mode . ((sql-connection-alist . ((mydb
>    (sql-product 'postgres)
>    (sql-database "mydb")
>    (sql-user "db_user")
>    (sql-server (expand-file-name 
>".direnv/postgres"))
>    (sql-port 5432)
>    )
>  )
>
>But If I try to use an sql org-babel block
>
>#+begin_src sql
>select 1;
>#+end_src
>
>(I am setting the connection variables in a PROPERTY)
>
>I get the error: `psql is not found`
>
>
>I was reading about the variable sql-postgres-program, so if I set the 
>following in dir-locals.el
>
>(sql-postgres-program . 
>"/gnu/store/f2v92bkx2vfzmkl14qxj3hlmby4dy9x0-profile/bin/psql")
>
>It works (note that psql ONLY lives inside the profile defined by 
>direnv+guix), but I don't like the idea of hardcode the path.
>
>Is there a better way?
>
>Ideally I will expect that the org block will read it from the environment, 
>but is not working. 
>
>Thanks in advance
>


[PATCH] Link handling for qutebrowser org-mac-link.el

2021-05-10 Thread Aimé Bertrand

Hi everyone,

hope to have done this right as a first time.
Work on a Mac with qutebrowser and thought the following patch 
would be helpful.


Salut
Aimé Bertrand



modified   lisp/org-mac-link.el
@@ -218,6 +218,12 @@
  :group 'org-mac-link
  :type 'string)

+(defcustom org-mac-grab-qutebrowser-app-p t
+  "Add menu option [q]utebrowser to grab links from 
qutebrowser.app."

+  :tag "Grab qutebrowser.app links"
+  :group 'org-mac-link
+  :type 'boolean)
+

;; In mac.c, removed in Emacs 23.
(declare-function do-applescript "org-mac-message" (script))
@@ -254,7 +260,8 @@ When done, go grab the link, and insert it at 
point."
("e" "evernote" org-mac-evernote-note-insert-selected 
,org-mac-grab-Evernote-app-p)
	("t" "ogether" org-mac-together-insert-selected 
,org-mac-grab-Together-app-p)
	("S" "kim" org-mac-skim-insert-page 
,org-mac-grab-Skim-app-p)
-	("A" "crobat" org-mac-acrobat-insert-page 
,org-mac-grab-Acrobat-app-p)))
+	("A" "crobat" org-mac-acrobat-insert-page 
,org-mac-grab-Acrobat-app-p)
+	("q" "utebrowser" org-mac-qutebrowser-insert-frontmost-url 
,org-mac-grab-qutebrowser-app-p)))

 (menu-string (make-string 0 ?x))
 input)

@@ -1013,6 +1020,52 @@ list of message:// links to flagged mail 
after heading."

(org-insert-heading nil t)
(insert org-heading "\n" (org-mac-message-get-links "f"))

+
+;; Handle links from qutebrowser.app
+
+(defun org-as-mac-qutebrowser-get-frontmost-url ()
+  (let ((result
+ (do-applescript
+  (concat
+   "set oldClipboard to the clipboard\n"
+   "set frontmostApplication to path to frontmost 
application\n"

+   "tell application \"qutebrowser\"\n"
+   "  activate\n"
+   "  delay 0.15\n"
+   "  tell application \"System Events\"\n"
+   "  keystroke \"y\"\n"
+   "  keystroke \"y\"\n"
+   "  end tell\n"
+   "  delay 0.15\n"
+   "  set theUrl to the clipboard\n"
+   "  set the clipboard to oldClipboard\n"
+   "  delay 0.15\n"
+   "  tell application \"System Events\"\n"
+   "  keystroke \"y\"\n"
+   "  keystroke \"T\"\n"
+   "  end tell\n"
+   "  delay 0.15\n"
+   "  set theTitle to the clipboard\n"
+   "  set the clipboard to oldClipboard\n"
+	   "set theResult to (get theUrl) & \"::split::\" & 
(get theTitle)\n"

+   "end tell\n"
+   "activate application (frontmostApplication as 
text)\n"

+   "set links to {}\n"
+   "copy theResult to the end of links\n"
+   "return links as string\n"
+ (car (split-string result "[\r\n]+" t
+
+;;;###autoload
+(defun org-mac-qutebrowser-get-frontmost-url ()
+  (interactive)
+  (message "Applescript: Getting qutebrowser url...")
+  (org-mac-paste-applescript-links 
(org-as-mac-qutebrowser-get-frontmost-url)))

+
+;;;###autoload
+(defun org-mac-qutebrowser-insert-frontmost-url ()
+  (interactive)
+  (insert (org-mac-qutebrowser-get-frontmost-url)))
+

(provide 'org-mac-link)



Re: How to have a repeating item within some hours?

2021-05-10 Thread Marcin Borkowski


On 2021-04-03, at 12:50, Christian Moe  wrote:

> If it's on the same day, how about this?
>
> ** <2021-03-29 Mon 05:15-06:16 +7d> Time block

That's interesting, since it seems to work (kind of - it puts a space
after the dash for some reason, but I can liver with it).  Thanks!

Is it documented somewhere?  May I rely on this feature or is it there
by accident and might disappear in a future version?

Best,

-- 
Marcin Borkowski
http://mbork.pl



Re: [wip-cite-new] New natbib processor

2021-05-10 Thread Bruce D'Arcus
Minor suggestion Nicolas:

Currently, oc-natbib ignores global affixes.

This makes some sense given natbib has no notion of global vs per-cite
affixes.

But it seems ideally the code would preprend the global prefix to the local
prefix of the first cite.

So [cite:global ;local @doe] should yield \citep[global local ][]{doe}.

Not sure about suffixes; maybe (?) those are best ignored.

Bruce


Re: The fate of ditaa.jar (9.4.5.)

2021-05-10 Thread Dr. Arne Babenhauserheide

Russell Adams  writes:

> On Mon, May 10, 2021 at 02:28:57PM +0300, Jarmo Hurri wrote:
>> I pulled the latest master and noticed that contrib has been moved into
>> a separate repository. I also cloned this contrib repository, but can
>> not find the file
>>
>> scripts/ditaa.jar
>>
>> in the repo. In fact, there is no directory scripts in the repo.
>
> I actually never considered this might be packaged with Org. I always
> thought I had to install it separately, like my Latex distribution or
> PlantUML.

Bundling this makes ditaa code blocks just work. Otherwise they won’t
work on every org-install.

Best wishes,
Arne
-- 
Unpolitisch sein
heißt politisch sein
ohne es zu merken


signature.asc
Description: PGP signature


Re: [External] : Re: Invalid duration format (9.4.5)

2021-05-10 Thread Daniel Ortmann

This fix works for me.

   commit 6107c2b15bf19ab5300c2861db365a3dc310adc6 (origin/maint)
   Author: Nicolas Goaziou 
   Date:   Mon May 10 18:00:58 2021 +0200

    Revert "agenda: Fix "org-duration-to-minutes: Invalid duration
   format" error"

    This reverts commit bc857bfc62ba94e04fb338bfb35f4b612c114d0c.

    The "fix" breaks elsewhere, as reported below.

    Reported-by: Daniel Ortmann 
   


On 5/10/21 9:25 AM, Nicholas Savage wrote:

Thanks for the report. This was also reported last night too: 
https://urldefense.com/v3/__https://lists.gnu.org/archive/html/emacs-orgmode/2021-05/msg00592.html__;!!GqivPVa7Brio!Non_TqJOEgfushDGmmgrZySe4dyz4pr69tdmeFRzKzRUwzoLORtfh7pMyW2pU_1ZotQ$

I'll probably have a chance to look into this sometime today, but it probably 
won't be until this evening if anyone else has a chance earlier than that.

On Mon, May 10, 2021, at 09:54, Detlef Steuer wrote:

Am Mon, 10 May 2021 16:45:30 +0300
schrieb Jarmo Hurri :


Greetings.

To get my work done, I had to switch from master branch to stable, but
now I started getting "invalid duration format" error when trying to
create my daily agenda:

org-duration-to-minutes: Invalid duration format: #("12:45-14:15 +1w"
0 15 (fontified nil org-category "schedule"))

Here is the corresponding row, and the preceding row, from file
schedule.org:

<2021-04-15 Thu 09:15-10:45 +1w>
<2021-04-19 Mon 12:45-14:15 +1w>

Any hints?

Jarmo




Can confirm!

Detlef


--
"Wozu leben wir, wenn nicht dazu, uns gegenseitig das Leben
  einfacher zu machen. (George Eliot)"

Dr. Detlef Steuer
Helmut-Schmidt-Universität
Fakultät WiSo
Holstenhofweg 85
22043 Hamburg

Tel:  040/6541-2819
mail: ste...@hsu-hh.de






Re: Bug: specifying end time of date as +0:20 [9.4.4 (release_9.4.4 @ /usr/local/share/emacs/28.0.50/lisp/org/)]

2021-05-10 Thread Nicolas Goaziou
Hello,

Stephen Eglen  writes:

>> I solved this part on maint branch.
>
> Thank you!

And I reverted it because the "fix" introduced other issues!

To be continued…

Regards,
-- 
Nicolas Goaziou



Re: [External] : Bug: org-duration-to-minutes: Invalid duration format [9.4.5 (release_9.4.5-530-g981f25 @ /home/dortmann/src/git-org-mode/lisp/)]

2021-05-10 Thread Daniel Ortmann

Fix confirmed as working.

   commit 6107c2b15bf19ab5300c2861db365a3dc310adc6 (origin/maint)
   Author: Nicolas Goaziou 
   Date:   Mon May 10 18:00:58 2021 +0200

    Revert "agenda: Fix "org-duration-to-minutes: Invalid duration
   format" error"

    This reverts commit bc857bfc62ba94e04fb338bfb35f4b612c114d0c.

    The "fix" breaks elsewhere, as reported below.

    Reported-by: Daniel Ortmann 
   



On 5/9/21 5:01 PM, Daniel Ortmann wrote:

Hello,
I opened my 'plan.org' file today and the C-c a a failed while 
creating the agenda.  The information is below.


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

https://urldefense.com/v3/__https://orgmode.org/manual/Feedback.html*Feedback__;Iw!!GqivPVa7Brio!LOkzTB59CDBzIuoTfXvXRwtkVqvxvGdCHi8m2Sx1wNReIvg87vPYcPOk5gcjflocjFo$ 


Your bug report will be posted to the Org mailing list.


The following long-time LOGBOOK entry, which has worked for a long 
time, now shows an error saying:


- Rescheduled from "[2020-01-16 Thu 12:30-13:30 ++1w]" on [2020-01-16 
Thu 11:03]


Here is the message from *Messages*:

org-duration-to-minutes: Invalid duration format: #("12:30-13:00 ++1w" 
0 16 (fontified nil org-category "plan"))



Emacs : GNU Emacs 28.0.50 (build 8, x86_64-pc-linux-gnu, GTK+ Version 
3.22.30, cairo version 1.15.12)

of 2021-05-09
Package: Org mode version 9.4.5 (release_9.4.5-530-g981f25 @ 
/home/dortmann/src/git-org-mode/lisp/)







Re: Bug: Custom Drawers - Contents show in HTML export [9.4.4 (release_9.4.4 @ /snap/emacs/current/usr/share/emacs/27.2/lisp/org/)]

2021-05-10 Thread Nicolas Goaziou
Hello,

Phil Marneweck  writes:

> Thank you very much, apologies for wasting your time having to go through
> this erroneous bug report.

No problem! The solution was easy enough, and, as you noticed, my answer
did not take too much time to write. ;)

> Is there any other place to ask questions other #orgmode?

I don't know, but this mailing list is a fine place to ask questions.

Regards,
-- 
Nicolas Goaziou



Re: [PATCH] Use cache in org-up-heading-safe

2021-05-10 Thread Ihor Radchenko
Maxim Nikulin  writes:

> I am trying to minimize number of regexp searches. Mostly it is applied 
> when information concerning multiple headings is required (agenda, 
> refile targets). It unlikely will get some benefits during interactive 
> calls related to single heading.

> Having the tree, it is possible to instantly find heading for 
> *arbitrary* position in the buffer. Likely the next operation is goto to 
> the heading or to it parent and parsing the line for more detailed 
> properties. The latter is cacheable, structure for heading properties 
> can be expanded.

Thanks for the explanation! I very much like this idea, though I do not
think that it is going to be practical on actual large files. Your code
runs for 0.25sec on my largest file:

| scan x10 | 2.482179163 | 1 | 0.3899682222157 |
| btree x10| 0.103329151 | 0 | 0.0 |
| scan+btree x10   | 2.666915096 | 1 |  0.365794656808 |
| find random x10 000  | 0.048668756 | 0 | 0.0 |
| nodes|   16641 |   | |

> Since there is no operations as insertion or deletion of nodes from 
> tree, no complex code is required to implement balancing rotations. That 
> is why I think that avl-tree is an overkill.

Yet, if we could keep the tree in sync with buffer modifications... And
we can, using org-element-cache. It already uses AVL-tree and already
syncs it automatically on buffer edits. The only problem is that it does
not work with headlines. However, I wrote some code adding headline
support to org-element-cache in https://github.com/yantar92/org.

Some benchmarks:

| scan x10 |2.179845106 | 0 |   
0.0 |
| btree x10|0.474887597 | 1 | 
0.36420128686 |
| scan+btree x10   |2.318029902 | 0 |   
0.0 |
| scan using org-element-cache x10 | 2.894182699004 | 0 |   
0.0 |
| populating the cache x1  |   11.332366941 | 5 | 
2.04015914697 |
| find random x10 000  |0.053074866 | 0 |   
0.0 |
| find random in org-element-cache x10 000 |0.007963375 | 0 |   
0.0 |
| nodes|  16641 |   |   
|

Scan through the file takes pretty much the same time with the btree
approach. Sometimes more, sometimes less. And most of the time is really
just re-search-forward. Find random showcases that avl-tree vs. btree
really makes a difference on such large number of headings.

On the worse side, initial population of the org-element-cache takes
quite a bit of time. However, it is normally done asynchronously during
idle time and does not really affect the user except the first loading
(which might be further optimised if we store cache between Emacs
sessions). Later, cache is updated automatically with buffer
modifications.

Moreover, the org-element-cache will already provide the parsed
headlines, including titles (and tags and other useful staff). No need
to match headline text with regexp.

For me, the idea of storing headlines in cache looks promising. I can
imagine many other Org functions using the cache after trivial
modifications. At least org-get-tags, org-get-category, org-entry-get
can be easily adapted to use the cache. What do you think?

> See the attachment for experimental (thus almost untested) code. Likely 
> you will find code style quite ugly. I am not happy with 0.1 sec for a 
> moderately large file. It is close to the limit for comfortable 
> interactive operations.

No worries about the style. It is testing anyway.

I modified your code slightly for testing the org-element-cache. See the
attached diff.

Best,
Ihor

diff -u /tmp/nm-btree-1.org /tmp/nm-btree.org
--- /tmp/nm-btree-1.org	2021-05-10 23:04:21.286395360 +0800
+++ /tmp/nm-btree.org	2021-05-10 23:02:17.586396326 +0800
@@ -1,3 +1,6 @@
+:PROPERTIES:
+:ID:   0aba93db-491d-46f7-b952-e138ba179a12
+:END:
 
 #+begin_src elisp :results none
 
@@ -38,6 +41,26 @@
 		(push props parents
 	  (and headings (cons headings count)))
 
+(defun nm-buffer-headings-reversed-cache (buffer)
+  (with-current-buffer buffer
+(save-restriction
+  (save-excursion
+	(widen)
+	(goto-char (point-min))
+	(let ((count 0)
+	  (headings ())
+	  (parents ()))
+	  (while (re-search-forward org-outline-regexp-bol nil t)
+(let ((cached (org-element--cache-find (line-beginning-position
+  (if (eq (org-element-property :begin cached) (line-beginning-position))
+  (push cached headings)
+(push (org-element-at-point) headings)))
+
+;; (save-excursion
+;;   (beginning-of-line)
+;;   (org-element-at-point 'cached))
+))
+
 
 ;; 

Re: Bug: spurious change in list indent cursor motion [9.4.4 (9.4.4-dist @ /home/powellj/elisp/org-9.4.4/lisp/)]

2021-05-10 Thread Greg Minshall
Kevin,

ah.  the behavior is complicated for me to understand, but presumably
useful.  (there's a Jerzy Neyman quote: Life is complicated, but not
uninteresting.)

cheers, Greg



Re: Invalid duration format (9.4.5)

2021-05-10 Thread Nicholas Savage
Thanks for the report. This was also reported last night too: 
https://lists.gnu.org/archive/html/emacs-orgmode/2021-05/msg00592.html

I'll probably have a chance to look into this sometime today, but it probably 
won't be until this evening if anyone else has a chance earlier than that.

On Mon, May 10, 2021, at 09:54, Detlef Steuer wrote:
> Am Mon, 10 May 2021 16:45:30 +0300
> schrieb Jarmo Hurri :
> 
> > Greetings.
> > 
> > To get my work done, I had to switch from master branch to stable, but
> > now I started getting "invalid duration format" error when trying to
> > create my daily agenda:
> > 
> > org-duration-to-minutes: Invalid duration format: #("12:45-14:15 +1w"
> > 0 15 (fontified nil org-category "schedule"))
> > 
> > Here is the corresponding row, and the preceding row, from file
> > schedule.org:
> > 
> > <2021-04-15 Thu 09:15-10:45 +1w>
> > <2021-04-19 Mon 12:45-14:15 +1w>
> > 
> > Any hints?
> > 
> > Jarmo
> > 
> > 
> 
> 
> Can confirm!
> 
> Detlef
> 
> 
> -- 
> "Wozu leben wir, wenn nicht dazu, uns gegenseitig das Leben 
>  einfacher zu machen. (George Eliot)" 
> 
> Dr. Detlef Steuer
> Helmut-Schmidt-Universität
> Fakultät WiSo
> Holstenhofweg 85
> 22043 Hamburg
> 
> Tel:  040/6541-2819
> mail: ste...@hsu-hh.de
> 
> 



Re: Invalid duration format (9.4.5)

2021-05-10 Thread Detlef Steuer
Am Mon, 10 May 2021 16:45:30 +0300
schrieb Jarmo Hurri :

> Greetings.
> 
> To get my work done, I had to switch from master branch to stable, but
> now I started getting "invalid duration format" error when trying to
> create my daily agenda:
> 
> org-duration-to-minutes: Invalid duration format: #("12:45-14:15 +1w"
> 0 15 (fontified nil org-category "schedule"))
> 
> Here is the corresponding row, and the preceding row, from file
> schedule.org:
> 
> <2021-04-15 Thu 09:15-10:45 +1w>
> <2021-04-19 Mon 12:45-14:15 +1w>
> 
> Any hints?
> 
> Jarmo
> 
> 


Can confirm!

Detlef


-- 
"Wozu leben wir, wenn nicht dazu, uns gegenseitig das Leben 
 einfacher zu machen. (George Eliot)" 

Dr. Detlef Steuer
Helmut-Schmidt-Universität
Fakultät WiSo
Holstenhofweg 85
22043 Hamburg

Tel:  040/6541-2819
mail: ste...@hsu-hh.de



Invalid duration format (9.4.5)

2021-05-10 Thread Jarmo Hurri


Greetings.

To get my work done, I had to switch from master branch to stable, but
now I started getting "invalid duration format" error when trying to
create my daily agenda:

org-duration-to-minutes: Invalid duration format: #("12:45-14:15 +1w" 0 15 
(fontified nil org-category "schedule"))

Here is the corresponding row, and the preceding row, from file
schedule.org:

<2021-04-15 Thu 09:15-10:45 +1w>
<2021-04-19 Mon 12:45-14:15 +1w>

Any hints?

Jarmo




Re: Bug: spurious change in list indent cursor motion [9.4.4 (9.4.4-dist @ /home/powellj/elisp/org-9.4.4/lisp/)]

2021-05-10 Thread Kévin Le Gouguec
Greg Minshall  writes:

> Kevin,
>
>> FWIW, during the latest poll somebody suggested making org-indent-line
>> cycle through "syntactically valid" indentation levels when hitting TAB
>> repeatedly, like python-indent-line-function; I like this idea.
>
> i think (*) the current "master" branch allows you to type "-
> fu- *bar" (where the " *" bit means "zero or more spaces").
> but, i guess because of folding, it's that sensitive, doesn't cycle when
> any non-blank is typed.

Right, that allows changing the indentation level of a newly inserted
bullet point; my remark was about changing the indentation level of
regular text, e.g. "- list itemunindented paragraph".

C-j works well enough when there are only two valid positions (column 2
and column 0); in this situation though:

- foo
  - bar
  - baz

It would be nice if RET TAB TAB TAB… cycled between columns 2→0→4…, just
like M-RET TAB TAB TAB… cycles between columns 6→2→4…



Re: Bug: spurious change in list indent cursor motion [9.4.4 (9.4.4-dist @ /home/powellj/elisp/org-9.4.4/lisp/)]

2021-05-10 Thread Greg Minshall
Kevin,

> FWIW, during the latest poll somebody suggested making org-indent-line
> cycle through "syntactically valid" indentation levels when hitting TAB
> repeatedly, like python-indent-line-function; I like this idea.

i think (*) the current "master" branch allows you to type "-
fu- *bar" (where the " *" bit means "zero or more spaces").
but, i guess because of folding, it's that sensitive, doesn't cycle when
any non-blank is typed.

(it might be nice if "- fu" moved you back to alignment with
the previous line.)

cheers, Greg

(*) i.e., "it works for me".



Re: The fate of ditaa.jar (9.4.5.)

2021-05-10 Thread Russell Adams
On Mon, May 10, 2021 at 02:28:57PM +0300, Jarmo Hurri wrote:
> I pulled the latest master and noticed that contrib has been moved into
> a separate repository. I also cloned this contrib repository, but can
> not find the file
>
> scripts/ditaa.jar
>
> in the repo. In fact, there is no directory scripts in the repo.

I actually never considered this might be packaged with Org. I always
thought I had to install it separately, like my Latex distribution or
PlantUML.



--
Russell Adamsrlad...@adamsinfoserv.com

PGP Key ID: 0x1160DCB3   http://www.adamsinfoserv.com/

Fingerprint:1723 D8CA 4280 1EC9 557F  66E8 1154 E018 1160 DCB3



Re: The fate of ditaa.jar (9.4.5.)

2021-05-10 Thread Eric S Fraga
On Monday, 10 May 2021 at 14:28, Jarmo Hurri wrote:
> I pulled the latest master and noticed that contrib has been moved into
> a separate repository. I also cloned this contrib repository, but can
> not find the file
>
> scripts/ditaa.jar
>
> in the repo. In fact, there is no directory scripts in the repo.

Bastien mentioned to me, off list, that he was going to move ditaa.jar
to Worg, specifically to worg/code/scripts, but this does not seem to
have taken place (yet).

FYI, Debian has the ditaa package which includes ditaa.jar.

-- 
: Eric S Fraga via Emacs 28.0.50, Org release_9.4.5-395-g82fbdd



The fate of ditaa.jar (9.4.5.)

2021-05-10 Thread Jarmo Hurri


Greetings.

I pulled the latest master and noticed that contrib has been moved into
a separate repository. I also cloned this contrib repository, but can
not find the file

scripts/ditaa.jar

in the repo. In fact, there is no directory scripts in the repo.

The documentation in the latest master states that

Stathis Sideris wrote the ‘ditaa.jar’ ASCII to PNG converter that is now
packaged into the org-contrib repository.

How should I proceed? Should I build this separately

https://github.com/stathissideris/ditaa

or will it still be included into contrib?

Have fun and stay safe!

Jarmo




Re: Bug: spurious change in list indent cursor motion [9.4.4 (9.4.4-dist @ /home/powellj/elisp/org-9.4.4/lisp/)]

2021-05-10 Thread Kévin Le Gouguec
Nicolas Goaziou  writes:

>> Note also that "- a" goes
>> back to column 0.  (FWIW I think that's a bit unwieldy; going back to
>> column 0 on the /second/  would make more sense to me, as
>> it would correspond to a "paragraph break")
>
> It would make it painful to insert a blank line within a list item.
> OTOH, on the third newline, you are really out of the list. 

Fair enough!  I figured the current behaviour made it easier to write
"multiple paragraphs" in a single list item, but I was unsure if anyone
actually relied on that.  Thanks for confirming this hunch :)

FWIW, during the latest poll somebody suggested making org-indent-line
cycle through "syntactically valid" indentation levels when hitting TAB
repeatedly, like python-indent-line-function; I like this idea.



Re: Bug: spurious change in list indent cursor motion [9.4.4 (9.4.4-dist @ /home/powellj/elisp/org-9.4.4/lisp/)]

2021-05-10 Thread Nicolas Goaziou
Hello,

Kévin Le Gouguec  writes:

> Note also that "- a" goes
> back to column 0.  (FWIW I think that's a bit unwieldy; going back to
> column 0 on the /second/  would make more sense to me, as
> it would correspond to a "paragraph break")

It would make it painful to insert a blank line within a list item.
OTOH, on the third newline, you are really out of the list. 

Regards,
-- 
Nicolas Goaziou



Re: Bug: Custom Drawers - Contents show in HTML export [9.4.4 (release_9.4.4 @ /snap/emacs/current/usr/share/emacs/27.2/lisp/org/)]

2021-05-10 Thread Phil Marneweck
Hi Nicolas

Thank you very much, apologies for wasting your time having to go through
this erroneous bug report. I spent a considerable time googling this and
trying different stuff but somehow I never made the connection to export
options or ignored it because of a in correct assumption that the default
value would be #+OPTIONS: d:nil, either way my bad!

Is there any other place to ask questions other #orgmode?

Regards
Phil




Regards
Phil

On Fri, May 7, 2021 at 1:45 PM Nicolas Goaziou 
wrote:

> Hello,
>
> "zar...@global.co.za"  writes:
> >
> > Drawers as I understand them should be hidden in any output at least
> > that is what the build-in drawers do.
> >
> > Also from what I understand is that you don't have to "declare" custom
> > drawers any more.
> >
> > When I try to use a custom drawer and export to HTML the contents of the
> > drawer is
> > output to the resulting HTML. But not the drawer name and end tags.
>
> See `org-export-with-drawers'.
>
> Regards,
> --
> Nicolas Goaziou
>


[tip] Export annotations with the 'Mindflow' LaTeX package

2021-05-10 Thread Juan Manuel Macías
Hi all,

A new LaTeX package, mindflow, has recently been uploaded to CTAN
(https://www.ctan.org/pkg/mindflow), which I found interesting and
useful for my org workflow. With this package we can add annotations and
ideas to our document. I mean, all that is in a `mindflow'
environment (including entire sections) will appear as in a kind of
'draft mode', with different format and colour. There is a global option
that allows you to choose between showing or not showing those
annotations.

I think it can be useful (for example) to export custom Org drawers to
that environment. But it also occurred to me to write the following, to
export a entire tree as a `mindflow' environment, with the tag
`:annotation:'

#+begin_src emacs-lisp
  (defun my-org-add-mindflow-env-heading (backend)
(when (eq backend 'latex)
  (org-show-all)
  (save-excursion
(goto-char (point-min))
(while (re-search-forward org-heading-regexp nil t)
  (let ((element (org-element-at-point)))
(when (member "annotation" (org-element-property :tags element))
  (save-restriction
(org-narrow-to-subtree)
(save-excursion
  (goto-char (point-min))
  (insert "\n\n@@latex:\\begin{mindflow}@@\n\n")
  (goto-char (point-max))
  (insert "\n\n@@latex:\\end{mindflow}@@\n\n")

  (add-hook 'org-export-before-processing-hook 
#'my-org-add-mindflow-env-heading)
#+end_src

Here are some screenshots: https://imgur.com/a/jo320AI

Best regards,

Juan Manuel

https://juanmanuelmacias.com/