Re: [PATCH] org-contacts.el: Use `bound-and-true-p' to check (unbound) var

2021-01-05 Thread miles christopher


Applied, I think this should be the final version.

I also fixed a problem in org-contacts-store-link.

David Florness  writes:

> * org-contacts.el (org-contacts-link-store): Use `bound-and-true-p' to
> check the truthiness of org-id-link-to-org-use-id, which may or may
> not be bound depending on whether org-id has been loaded.  This
> simplifies the code.
> ---
> Thank you, Kyle.  This patch should do the trick.  I'm always happy to
> send another revision so feel free to nitpick.
>
>  contrib/lisp/org-contacts.el | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/contrib/lisp/org-contacts.el b/contrib/lisp/org-contacts.el
> index 7ad425519..3df1b52dd 100644
> --- a/contrib/lisp/org-contacts.el
> +++ b/contrib/lisp/org-contacts.el
> @@ -1166,7 +1166,7 @@ are effectively trimmed).  If nil, all zero-length 
> substrings are retained."
>"Store the contact in `org-contacts-files' with a link."
>(when (and (eq major-mode 'org-mode)
>(member (buffer-file-name) (mapcar 'expand-file-name 
> org-contacts-files)))
> -(if (and (featurep 'org-id) org-id-link-to-org-use-id)
> +(if (bound-and-true-p org-id-link-to-org-use-id)
>   (org-id-store-link)
>(let ((headline-str (substring-no-properties (org-get-heading t t t 
> t
>   (org-store-link-props


-- 
[ stardiviner ]
   I try to make every word tell the meaning that I want to express.

   Blog: https://stardiviner.github.io/
   IRC(freenode): stardiviner, Matrix: stardiviner
   GPG: F09F650D7D674819892591401B5DF1C95AE89AC3



[BUG] org-log-states-order-reversed nil caused org-clock-in and out failed

2021-01-05 Thread miles christopher


When I set:

#+begin_src emacs-lisp
(setq org-log-states-order-reversed nil)
#+end_src

org-clock-in on a task or org-clock-out will failed.

-- 
[ stardiviner ]
   I try to make every word tell the meaning that I want to express.

   Blog: https://stardiviner.github.io/
   IRC(freenode): stardiviner, Matrix: stardiviner
   GPG: F09F650D7D674819892591401B5DF1C95AE89AC3



xclip/pbcopy/clipboard 'target' for export backends?

2021-01-05 Thread Tim Visher
Hi Everyone,

I'm interested in adding something to the export dispatcher that would
automatically put the exported text (or perhaps even file?) onto my
clipboard.

Preferably I'd like to define this once and have it available to each
backend. So maybe I want markdown this time but rather than to a buffer or
file I want it to go straight to my clipboard. Next time I want HTML or
Plain Text but the same thing.

Can anyone give me some hints on where to start looking for that? Or maybe
it's already been done?

Thanks in advance!

--

In Christ,

Timmy V.

https://blog.twonegatives.com
http://five.sentenc.es


bug with macro expansion after underscore (subscript)

2021-01-05 Thread Dauer, Michael
Hi,

I cannot expand a macro after underscore, as the following sample shows in
detail:

#+macro: xxx A
* macro bug
_{{{xxx}}}
a _{{{xxx}}}
a_{{{xxx}}}
a^{{{xxx}}}
a{{{xxx}}}
a_A

generates:

_A
a _A
a_{{{xxx}}}
a^{{{xxx}}}
aA
a_A

thx
m


Bug: org mode rendering linked heading wrongly [9.4.4 (9.4.4-4-g99eafe-elpaplus @ /Users/cvl/.config/emacs/elpa/28.0/develop/org-plus-contrib-20210104/)]

2021-01-05 Thread Tianrui Wei



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://orgmode.org/manual/Feedback.html#Feedback

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


Here is a minimal reproducing example

** *heading to be linked to*

[[**heading to be linked to*]]

Expected rendered result:

*heading to be linked to

Actual rendered result

**heading to be linked to

Emacs  : GNU Emacs 28.0.50 (build 1, x86_64-apple-darwin20.2.0, NS 
appkit-2022.20 Version 11.1 (Build 20C69))
of 2020-12-24
Package: Org mode version 9.4.4 (9.4.4-4-g99eafe-elpaplus @ 
/Users/cvl/.config/emacs/elpa/28.0/develop/org-plus-contrib-20210104/)



Re: xclip/pbcopy/clipboard 'target' for export backends?

2021-01-05 Thread John Kitchin
I guess you are looking for something like
https://github.com/jkitchin/ox-clip.

It doesn't support all the backends you want, but might be a start for
you.  you can also install it from MELPA.

John

---
Professor John Kitchin
Doherty Hall A207F
Department of Chemical Engineering
Carnegie Mellon University
Pittsburgh, PA 15213
412-268-7803
@johnkitchin
http://kitchingroup.cheme.cmu.edu



On Tue, Jan 5, 2021 at 9:03 AM Tim Visher  wrote:

> Hi Everyone,
>
> I'm interested in adding something to the export dispatcher that would
> automatically put the exported text (or perhaps even file?) onto my
> clipboard.
>
> Preferably I'd like to define this once and have it available to each
> backend. So maybe I want markdown this time but rather than to a buffer or
> file I want it to go straight to my clipboard. Next time I want HTML or
> Plain Text but the same thing.
>
> Can anyone give me some hints on where to start looking for that? Or maybe
> it's already been done?
>
> Thanks in advance!
>
> --
>
> In Christ,
>
> Timmy V.
>
> https://blog.twonegatives.com
> http://five.sentenc.es
>


Re: accounting

2021-01-05 Thread Uwe Brauer

> On Monday,  4 Jan 2021 at 21:01, Uwe Brauer wrote:

> Yes.

> Sorry I was brief: I cut and pasted something from one of my files while
> in a rush!

> Basically, you could do:

> #+begin_src ledger :cmdline -V --format "%-20A %14T\n" bal --flat assets 
> 2010/01/01 * Starting balance
>   assets:bank:savings  1300.00
>   income:starting balances
> 2010/07/22 * Got paid
>   assets:bank:chequing  1000.00
>   income:salary
> #+end_src

> and you would get, as output,

> #+results:
> : assets:bank:chequing   1000
> : assets:bank:savings1300
> :2300


Thanks. I figured out that I have to read a bit accounting again (I
don't want to  use gnucash again, I prefer an org solution). I think
ledger is a reasonable solution (I cannot install currently beancount)


> I'm not saying that this is much prettier than the default but simply
> that you have total control over the formatting of the output so you may
> be able to achieve what you wish.


Yeah, your solution does not work for the example I had in mind
but I realize now what I miss: the output should be an org table


#+name: test
#+begin_src ledger 
2010/01/01 * Starting balance
  assets:bank:savings  0
  income:starting balances
2010/07/23 ChristmasTree
  expenses:Brother:ChristmasTree  40.00
  income:Brother:Card
2010/07/24 Jacket
  expenses:BigBrother:Jacket  150.00
  income:BigBrother:Card
2010/07/24 Schuhe
  expenses:BigBrother:Shoes  20
  income:BigBrother:Card
2010/07/23 BigBrother 
  expenses:Brother:BigBrother  130
  income:Brother:Card
#+end_src

#+RESULTS: test
#+begin_example
 340  expenses
 170BigBrother
 150  Jacket
  20  Shoes
 170Brother
 130  BigBrother
  40  ChristmasTree
-340  income
-170BigBrother:Card
-170Brother:Card

   0
#+end_example


But I rather prefer to have

|  340 | expenses | |   |
|  170 |  | BigBrother  |   |
|  150 |  | | Jacket|
|   20 |  | | Shoes |
|  170 |  | Brother |   |
|  130 |  | | BigBrother|
|   40 |  | | ChristmasTree |
| -340 | income   | |   |
| -170 |  | BigBrother:Card |   |
| -170 |  | Brother:Card|   |
|  |  | |   |
|--+--+-+---|
|0 |  | |   |


Any idea how to achieve this?


smime.p7s
Description: S/MIME cryptographic signature


Re: xclip/pbcopy/clipboard 'target' for export backends?

2021-01-05 Thread Eric S Fraga
On Tuesday,  5 Jan 2021 at 09:01, Tim Visher wrote:
> Preferably I'd like to define this once and have it available to each
> backend. 

I cannot help directly but I can contribute a random thought: many of
the exporters have the ability to export to a buffer.  Maybe there could
be a hook (there isn't one at present that is appropriate, I think) that
you can add to that captures the contents of the buffer and puts them in
the clipboard?  Or you might be able to "advice" the export (or each
exporter maybe) dispatcher to do so?

-- 
: Eric S Fraga via Emacs 28.0.50, Org release_9.4.4-166-g291993



Re: accounting

2021-01-05 Thread Uwe Brauer
>>> "CM" == Charles Millar  writes:

> On 1/4/21 3:54 AM, Uwe Brauer wrote:
>> Hi
>> https://orgmode.org/worg/org-contrib/babel/languages/ob-doc-ledger.html
>> Points out how to use ledger within org mode.
>> Is there any simpler solution?
>> Regards
>> Uwe Brauer
>> 
> If "simpler" means just making entries into your ledger.dat file using
> orgmode you may wish to refer to Sacha Chua's capture template for
> that very purpose. She posted it a few years ago.

> https://sachachua.com/blog/2010/11/emacs-recording-ledger-entries-with-org-capture-templates/

Thanks, that looks nice, but I finally think that the example in 
https://orgmode.org/worg/org-contrib/babel/languages/ob-doc-ledger.html

Is fine. The only think I am missing is the output in an org table form


smime.p7s
Description: S/MIME cryptographic signature


[A solution of sorts] (was: accounting)

2021-01-05 Thread Uwe Brauer
>>> "UB" == Uwe Brauer  writes:

>> On Monday,  4 Jan 2021 at 21:01, Uwe Brauer wrote:

>> Yes.

>> Sorry I was brief: I cut and pasted something from one of my files while
>> in a rush!

>> Basically, you could do:

>> #+begin_src ledger :cmdline -V --format "%-20A %14T\n" bal --flat assets 
>> 2010/01/01 * Starting balance
>> assets:bank:savings  1300.00
>> income:starting balances
>> 2010/07/22 * Got paid
>> assets:bank:chequing  1000.00
>> income:salary
>> #+end_src

>> and you would get, as output,


> But I rather prefer to have

> |  340 | expenses | |   |
> |  170 |  | BigBrother  |   |
> |  150 |  | | Jacket|
> |   20 |  | | Shoes |
> |  170 |  | Brother |   |
> |  130 |  | | BigBrother|
> |   40 |  | | ChristmasTree |
> | -340 | income   | |   |
> | -170 |  | BigBrother:Card |   |
> | -170 |  | Brother:Card|   |
> |  |  | |   |
> |--+--+-+---|
> |0 |  | |   |


> Any idea how to achieve this?

Well 10 years ago Eric Schulte posted this 
https://lists.gnu.org/archive/html/emacs-orgmode/2010-08/msg00502.html

#+name: test
#+begin_src ledger 
2010/01/01 * Starting balance
  assets:bank:savings  0
  income:starting balances
2010/07/23 ChristmasTree
  expenses:Brother:ChristmasTree  40.00
  income:Brother:Card
2010/07/24 Jacket
  expenses:BigBrother:Jacket  150.00
  income:BigBrother:Card
2010/07/24 Schuhe
  expenses:BigBrother:Shoes  20
  income:BigBrother:Card
2010/07/23 BigBrother 
  expenses:Brother:BigBrother  130
  income:Brother:Card
#+end_src

#+begin_src emacs-lisp :var ledger=test
  (with-temp-buffer
(insert ledger)
(message ledger)
(org-table-convert-region (point-min) (point-max) 2)
(org-table-to-lisp))
#+end_src

#+RESULTS:
|  340 | expenses|
|  170 | BigBrother  |
|  150 | Jacket  |
|   20 | Shoes   |
|  170 | Brother |
|  130 | BigBrother  |
|   40 | ChristmasTree   |
| -340 | income  |
| -170 | BigBrother:Card |
| -170 | Brother:Card|
|  | |
|0 | |


It is not precisely what I want, but not bad either. If somebody can
come up with a better solution...




Re: accounting

2021-01-05 Thread Eric S Fraga
On Tuesday,  5 Jan 2021 at 16:35, Uwe Brauer wrote:
> Yeah, your solution does not work for the example I had in mind
> but I realize now what I miss: the output should be an org table

If the ledger formatting options cannot help you (they are potentially
quite powerful), all I can suggest is a post-processing script
(e.g. with sed or awk or equivalent) that massages the output from
ledger into a form you like.

Hope you get something working to your satisfaction.  Ledger is an
excellent text based accounting tool.

-- 
: Eric S Fraga via Emacs 28.0.50, Org release_9.4.4-166-g291993



Re: [A solution of sorts]

2021-01-05 Thread Eric S Fraga
On Tuesday,  5 Jan 2021 at 17:02, Uwe Brauer wrote:
> Well 10 years ago Eric Schulte posted this 
> https://lists.gnu.org/archive/html/emacs-orgmode/2010-08/msg00502.html

Yes, this is what I meant about post-processing (in this case using
elisp).

> It is not precisely what I want, but not bad either. If somebody can
> come up with a better solution...

Maybe append this to the ledger src block begin line:

  :cmdline bal --flat

This will at least remove duplication of data.

-- 
: Eric S Fraga via Emacs 28.0.50, Org release_9.4.4-166-g291993



Re: xclip/pbcopy/clipboard 'target' for export backends?

2021-01-05 Thread Diego Zamboni
Hi Tim,

Funny - just a few minutes ago, before reading your message, I learned
while installing https://github.com/stig/ox-jira.el, about =
org-export-copy-to-kill-ring=:

org-export-copy-to-kill-ring is a variable defined in ox.el.

Non-nil means pushing export output to the kill ring.

This variable is ignored during asynchronous export.


In my brief testing, it does exactly what you want: regardless of the
export output or method (to a file or to a temporary buffer), the result is
placed in the clipboard.

Best,
--Diego


On Tue, Jan 5, 2021 at 3:03 PM Tim Visher  wrote:

> Hi Everyone,
>
> I'm interested in adding something to the export dispatcher that would
> automatically put the exported text (or perhaps even file?) onto my
> clipboard.
>
> Preferably I'd like to define this once and have it available to each
> backend. So maybe I want markdown this time but rather than to a buffer or
> file I want it to go straight to my clipboard. Next time I want HTML or
> Plain Text but the same thing.
>
> Can anyone give me some hints on where to start looking for that? Or maybe
> it's already been done?
>
> Thanks in advance!
>
> --
>
> In Christ,
>
> Timmy V.
>
> https://blog.twonegatives.com
> http://five.sentenc.es
>


Re: Regression in table.el detection? [maint]

2021-01-05 Thread Nicolas Goaziou
Hello,

Kaushal Modi  writes:

> I was able to reproduce with issue with ox-html as well.
>
> Please copy paste this in a new temp.org file and run `C-c C-e h H':
>
> * Subtree 1
> +--+--+--+
> | Header 1 | Header 2 | Header 3 |
> +--+--+--+
> | a| b| c|
> +--+--+--+
> | d| e| f|
> +--+--+--+
> * Subtree 2
>
>
> The issue is when the "* Subtree 2" begins in the very next line after that
> last line of table.el table ending in "--+".

Oops. Fixed. Thank you.

Regards,
-- 
Nicolas Goaziou



Bug: org.el has wrong (or none) version [fatal: No names found, cannot describe anything. (fatal: No names found, cannot describe anything. @ /Users/niels/.emacs.d/straight/build/org-agenda/)]

2021-01-05 Thread Niels Søndergaard


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://orgmode.org/manual/Feedback.html#Feedback

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


This morning at at reboot of emacs, it came up telling me, that
org-contrib is not found, investigating the problem was, that the file
with org.el is version 9.5.
I've been looking for org-contrib and the like, but found nothing on the
net.
By ow org-capture does not work (maybee more, I've not investigated
that.

The system have been running flawless in several months

with kind regard
Niels (ni...@algon.dk)

Emacs  : GNU Emacs 28.0.50 (build 4, x86_64-apple-darwin16.7.0, NS 
appkit-1504.84 Version 10.12.6 (Build 16G2136))
 of 2020-11-02
Package: Org mode version fatal: No names found, cannot describe anything. 
(fatal: No names found, cannot describe anything. @ 
/Users/niels/.emacs.d/straight/build/org-agenda/)

current state:
==
(setq
 org-roam-db-location "/Users/niels/Dropbox/org/roam/org-roam.db"
 org-src-mode-hook '(org-src-babel-configure-edit-buffer 
org-src-mode-configure-edit-buffer)
 org-refile-target-verify-function 'bh/verify-refile-target
 org-latex-listings t
 org-agenda-tags-column -10
 org-columns-default-format "%TODO %32ITEM  %3PRIORITY %14SCHEDULED %TAGS"
 org-capture-prepare-finalize-hook '(org-roam-capture--install-finalize
 doct-run-prepare-finalize)
 org-roam-dailies-calendar-hook '(org-roam-dailies-calendar-mark-entries)
 org-link-shell-confirm-function 'yes-or-no-p
 org-blank-before-new-entry '((heading . t) (plain-list-item))
 org-pretty-tags-global-mode t
 org-metadown-hook '(org-babel-pop-to-session-maybe)
 org-roam-title-to-slug-function 'org-roam--title-to-slug
 org-clock-out-hook '(org-clock-remove-empty-clock-drawer)
 org-agenda-cleanup-fancy-diary-hook '((closure (t) nil (goto-char (point-min))
(save-excursion
 (while (re-search-forward "^[a-z]" nil 
t)
  (goto-char (match-beginning 0))
  (insert "0:00-24:00 "))
 )
(while (re-search-forward "^ [a-z]" nil 
t)
 (goto-char (match-beginning 0))
 (save-excursion
  (re-search-backward 
"^[0-9]+:[0-9]+-[0-9]+:[0-9]+ "
   nil t)
  )
 (insert (match-string 0)))
)
   )
 org-refile-targets '((nil :maxlevel . 7) (org-agenda-files :maxlevel . 7))
 org-html-format-inlinetask-function 
'org-html-format-inlinetask-default-function
 outline-isearch-open-invisible-function 'outline-isearch-open-invisible
 org-pretty-entities t
 org-enforce-todo-dependencies t
 org-capture-bookmark nil
 org-odt-format-headline-function 'org-odt-format-headline-default-function
 org-latex-pdf-process '("latexmk -lualatex -recorder -synctex=1 -bibtex-cond 
%b")
 org-agenda-files "~/Dropbox/org/org-files"
 org-ascii-format-inlinetask-function 'org-ascii-format-inlinetask-default
 org-blocker-hook '(org-block-todo-from-children-or-siblings-or-parent)
 org-export-creator-string "\\tiny{Emacs 28.0.50 (Org mode 9.4)}"
 org-roam-buffer-prepare-hook '(org-roam-buffer--insert-title
org-roam-buffer--insert-backlinks
org-roam-buffer--insert-ref-links)
 org-id-link-to-org-use-id t
 org-super-agenda-mode t
 org-mode-hook '(#[0 "\301\211\207" [imenu-create-index-function 
org-imenu-get-tree] 2]
 org-timed-alerts-mode org-bullets-mode
 (closure (t) nil "Beautify org symbols."
  (setq prettify-symbols-alist nec-prettify-symbols-alist)
  (prettify-symbols-mode 1))
 toc-org-mode org-fancy-priorities-mode rainbow-delimiters-mode
 turn-on-auto-fill
 #[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-eldoc-load)
 org-roam-mode t
 org-fancy-priorities-list '(" " " " " " " ")
 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-confirm-elisp-link-function 'yes-or-no-p
 org-agenda-finalize-ho

Re: Regression in table.el detection? [maint]

2021-01-05 Thread Kaushal Modi
On Tue, Jan 5, 2021 at 12:09 PM Nicolas Goaziou 
wrote:

> Oops. Fixed. Thank you.
>

Thank you! for fixing this so quick :)

I confirm that fix you made in
https://code.orgmode.org/bzg/org-mode/commit/332da69b3c3ca222943728c20287e4ace6d40e61
.

Can you also please add a test for that? [My ox-hugo test suite will
anyways keep on serving via its weekly crons :) ]


Re: xclip/pbcopy/clipboard 'target' for export backends?

2021-01-05 Thread Tim Visher
On Tue, Jan 5, 2021 at 11:13 AM Diego Zamboni  wrote:

> Funny - just a few minutes ago, before reading your message, I learned
> while installing https://github.com/stig/ox-jira.el, about =
> org-export-copy-to-kill-ring=:
>
> org-export-copy-to-kill-ring is a variable defined in ox.el.
>
> Non-nil means pushing export output to the kill ring.
>
> This variable is ignored during asynchronous export.
>
>
> In my brief testing, it does exactly what you want: regardless of the
> export output or method (to a file or to a temporary buffer), the result is
> placed in the clipboard.
>

Hah! Good old C-x M-c M-butterfly. I'll have to play with this myself.


Inserting LaTex expressions using a filter fails

2021-01-05 Thread Mart van de Wege
I'm trying to replace U+00BD in an org buffer with \sfrac{1}{2} during
export to LaTex, and obviously I'm doing something wrong, or I don't
understand the documentation.

I use the following code to set up the filter:
#+BIND: org-export-filter-item-functions (latex-replace-half)
#+BEGIN_SRC emacs-lisp :exports results :results none
  (defun latex-replace-half (text backend info)
(when (org-export-derived-backend-p backend 'latex)
  (replace-regexp-in-string  "½" "\\sfrac{1}{2}" text)))
#+END_SRC

Down the line in the document there is this example line:

   - 1½ eetl. gehakte peterselie, ½ eetl. azijn, 4 eetl. olie

Or this one:

   Laat de gewassen en gebroken vermicelli met de foelie ½ uur in de

But neither of them get replaced. I tried plain-text, item, and
final-output filters.

What am I missing?

Mart

-- 
"We will need a longer wall when the revolution comes."
--- AJS, quoting an uncertain source.



Bug: org.el has wrong (or none) version [fatal: No names found, cannot describe anything. (fatal: No names found, cannot describe anything. @ /Users/niels/.emacs.d/straight/build/org-agenda/)]

2021-01-05 Thread Niels Søndergaard

--text follows this line--

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://orgmode.org/manual/Feedback.html#Feedback

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


This morning at at reboot of emacs, it came up telling me, that
org-contrib is not found, investigating the problem was, that the file
with org.el is version 9.5.
I've been looking for org-contrib and the like, but found nothing on the
net.
By ow org-capture does not work (maybee more, I've not investigated
that.

The system have been running flawless in several months

with kind regard
Niels (ni...@algon.dk)

Emacs  : GNU Emacs 28.0.50 (build 4, x86_64-apple-darwin16.7.0, NS 
appkit-1504.84 Version 10.12.6 (Build 16G2136))
 of 2020-11-02
Package: Org mode version fatal: No names found, cannot describe anything. 
(fatal: No names found, cannot describe anything. @ 
/Users/niels/.emacs.d/straight/build/org-agenda/)

current state:
==
(setq
 org-roam-db-location "/Users/niels/Dropbox/org/roam/org-roam.db"
 org-src-mode-hook '(org-src-babel-configure-edit-buffer 
org-src-mode-configure-edit-buffer)
 org-refile-target-verify-function 'bh/verify-refile-target
 org-latex-listings t
 org-agenda-tags-column -10
 org-columns-default-format "%TODO %32ITEM  %3PRIORITY %14SCHEDULED %TAGS"
 org-capture-prepare-finalize-hook '(org-roam-capture--install-finalize
 doct-run-prepare-finalize)
 org-roam-dailies-calendar-hook '(org-roam-dailies-calendar-mark-entries)
 org-link-shell-confirm-function 'yes-or-no-p
 org-blank-before-new-entry '((heading . t) (plain-list-item))
 org-pretty-tags-global-mode t
 org-metadown-hook '(org-babel-pop-to-session-maybe)
 org-roam-title-to-slug-function 'org-roam--title-to-slug
 org-clock-out-hook '(org-clock-remove-empty-clock-drawer)
 org-agenda-cleanup-fancy-diary-hook '((closure (t) nil (goto-char (point-min))
(save-excursion
 (while (re-search-forward "^[a-z]" nil 
t)
  (goto-char (match-beginning 0))
  (insert "0:00-24:00 "))
 )
(while (re-search-forward "^ [a-z]" nil 
t)
 (goto-char (match-beginning 0))
 (save-excursion
  (re-search-backward 
"^[0-9]+:[0-9]+-[0-9]+:[0-9]+ "
   nil t)
  )
 (insert (match-string 0)))
)
   )
 org-refile-targets '((nil :maxlevel . 7) (org-agenda-files :maxlevel . 7))
 org-html-format-inlinetask-function 
'org-html-format-inlinetask-default-function
 outline-isearch-open-invisible-function 'outline-isearch-open-invisible
 org-pretty-entities t
 org-enforce-todo-dependencies t
 org-capture-bookmark nil
 org-odt-format-headline-function 'org-odt-format-headline-default-function
 org-latex-pdf-process '("latexmk -lualatex -recorder -synctex=1 -bibtex-cond 
%b")
 org-agenda-files "~/Dropbox/org/org-files"
 org-ascii-format-inlinetask-function 'org-ascii-format-inlinetask-default
 org-blocker-hook '(org-block-todo-from-children-or-siblings-or-parent)
 org-export-creator-string "\\tiny{Emacs 28.0.50 (Org mode 9.4)}"
 org-roam-buffer-prepare-hook '(org-roam-buffer--insert-title
org-roam-buffer--insert-backlinks
org-roam-buffer--insert-ref-links)
 org-id-link-to-org-use-id t
 org-super-agenda-mode t
 org-mode-hook '(#[0 "\301\211\207" [imenu-create-index-function 
org-imenu-get-tree] 2]
 org-timed-alerts-mode org-bullets-mode
 (closure (t) nil "Beautify org symbols."
  (setq prettify-symbols-alist nec-prettify-symbols-alist)
  (prettify-symbols-mode 1))
 toc-org-mode org-fancy-priorities-mode rainbow-delimiters-mode
 turn-on-auto-fill
 #[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-eldoc-load)
 org-roam-mode t
 org-fancy-priorities-list '(" " " " " " " ")
 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-confirm-elisp-link-function 'yes-or-n

Re: Inserting LaTex expressions using a filter fails

2021-01-05 Thread Juan Manuel Macías
Hello,

Mart van de Wege  writes:

> I'm trying to replace U+00BD in an org buffer with \sfrac{1}{2} during
> export to LaTex, and obviously I'm doing something wrong, or I don't
> understand the documentation.
>
> I use the following code to set up the filter:
>
> #+BIND: org-export-filter-item-functions (latex-replace-half)
> #+BEGIN_SRC emacs-lisp :exports results :results none
>
>   (defun latex-replace-half (text backend info)
> (when (org-export-derived-backend-p backend 'latex)
>   (replace-regexp-in-string  "½" "\\sfrac{1}{2}" text)))
> #+END_SRC

You must add a double escape character to the backslash:

...
  (replace-regexp-in-string  "½" "sfrac{1}{2}" text)))
...

Regards,

Juan Manuel 



Re: Inserting LaTex expressions using a filter fails

2021-01-05 Thread Nick Dokos
Mart van de Wege  writes:

> I'm trying to replace U+00BD in an org buffer with \sfrac{1}{2} during
> export to LaTex, and obviously I'm doing something wrong, or I don't
> understand the documentation.
>
> I use the following code to set up the filter:
>
> #+BIND: org-export-filter-item-functions (latex-replace-half)
> #+BEGIN_SRC emacs-lisp :exports results :results none
>
>   (defun latex-replace-half (text backend info)
> (when (org-export-derived-backend-p backend 'latex)
>   (replace-regexp-in-string  "½" "\\sfrac{1}{2}" text)))
> #+END_SRC
>

Try

(replace-regexp-in-string  "½" "sfrac{1}{2}" text)))


> Down the line in the document there is this example line:
>
>- 1½ eetl. gehakte peterselie, ½ eetl. azijn, 4 eetl. olie
>
> Or this one:
>
>Laat de gewassen en gebroken vermicelli met de foelie ½ uur in de
>
> But neither of them get replaced. I tried plain-text, item, and
> final-output filters.
>

"item" will only deal with the first one: an item in a list. You'll need
to use "final-output" probably.

> What am I missing?
>
> Mart

-- 
Nick

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




Short videos about workflows - and how to upload them

2021-01-05 Thread Eduardo Ochs
Hi list,

this is slightly off-topic - but only slightly, I think.
Yesterday I attended (as a lurker...) this meeting of the EmacsNYC
group:

https://emacsnyc.org/2020/12/28/online-meetup-discussionhow-do-we-improve-emacs.html

In it Sacha Chua said that she feels that most people, especially
newbies, have a hard time figuring out other people's workflows, and
that we should try to make short videos about our workflows and share
them...

Long story short: I have a nice workflow for recording and uploading
short videos to my home page, and I made a 5-minute video about it. It
is here:

  http://angg.twu.net/eev-videos/2020-short-find-ssr-links-2.mp4

It uses eev, that can be used in conjunction with Org, but that is
based on design decisions that are very different from the ones in
Org. I gave a presentation about these design decisions at the last
EmacsConf:

  http://angg.twu.net/emacsconf2020.html

I know only a handful of features of Org at the moment, and I don't
know (yet) how to translate the ideas of this method for uploading
videos to "pure Org", i.e., to Org without eev... I hope that someone
would find a way, and would share it with everybody. Also, I think
that it would be really, really, really great if more people start to
make their videos downloadable from places that are not Youtube; eev
has some functions that help downloading videos from Youtube with
youtube-dl - see:

  http://angg.twu.net/2020-some-template-based.html
  http://www.youtube.com/watch?v=91-9YfRPsuk#t=19m23s (intro)
  http://www.youtube.com/watch?v=91-9YfRPsuk#t=22m48s (demo)

but they're a bit clumsy... eev also has functions for accessing
videos at , and, far more
important than that, it has this comment in its source:

  ;; The definitions of `find-eevvideo-links' and `code-eevvideo' above
  ;; have strings like "eev" and "http://angg.twu.net/eev-videos/";
  ;; hardcoded in several places... it is easy, but not entirely
  ;; trivial, to create variants of them that point to other sites that
  ;; stores video tutorials and presentations in ways that are easy to
  ;; download. If you are aware of sites like that, please get in touch
  ;; and I'll create functions pointing to them!

So: let's create videos about workflows and videos about creating
videos about workflows, and let's share ideas and links

  Cheers =) =) =),
Eduardo Ochs
http://angg.twu.net/#eev
https://github.com/edrx/eev#introduction



Re: accounting

2021-01-05 Thread Ihor Radchenko
Also, ledger can format output as Elisp sexp (with emacs command). That
should be easier to parse.

Best,
Ihor



Re: [BUG] org-log-states-order-reversed nil caused org-clock-in and out failed

2021-01-05 Thread Kyle Meyer
miles christopher writes:

> When I set:
>
> #+begin_src emacs-lisp
> (setq org-log-states-order-reversed nil)
> #+end_src
>
> org-clock-in on a task or org-clock-out will failed.

With the above setting and an otherwise default configuration, clocking
in and out works for me on master and maint.

Could you provide a backtrace and a minimal reproducer?



Re: Bug: (org-release) returns empty string on Elpa [ ( @ /home/pierre/.guix-profile/share/emacs/site-lisp/)]

2021-01-05 Thread Kyle Meyer
Pierre Langlois writes:

> Hello there!
>
> Since the latest update to 9.4.4, some of us in Guix have been
> experiencing issues with loading packages that depend on Org [0]. It
> seems the root of the problem is that (org-release) returns an empty
> string, you can see this manifesting in this email actually :-).
[...]
> We download the Org source code directly from ELPA [1], it would seemx
> the org-version.el wasn't correctly generated, right?

Thanks for reporting.

It looks like org-release is also an empty string for 9.4.3, while 9.4.2
looks okay:

  # https://elpa.gnu.org/packages/org-9.4.2.tar.lz
  # https://elpa.gnu.org/packages/org-9.4.3.tar.lz
  $ grep '(org-release' org-9.4.3/org-version.el
 (let ((org-release ""))
  $ grep '(org-release' org-9.4.2/org-version.el
 (let ((org-release "9.4.2")

In between those two releases, there seems to have been some
restructuring on ELPA's end, in particular ee03829f90 (Finalize the new
master branch, 2020-12-14).

Based on looking at Org's entry in the elpa-packages file

  ("org"
   :url "https://code.orgmode.org/bzg/org-mode";
   :lisp-dir "lisp"
   :release-branch "maint"
   :ignored-files ("etc/schema" "contrib" "mk" "testing" "lisp/org-install.el")
   :news "etc/ORG-NEWS"
   :shell-command "make autoloads info; mv doc/org org.info; mv doc/orgguide 
orgguide.info"
   :doc ("org.info" "orgguide.info")
   :auto-sync t)

my uneducated guess is that the make command is failing to generate the
version when executed from its elpa.git worktree because,
unsurprisingly, elpa.git doesn't (and shouldn't) pull in the Org repo's
tags.

Bastien and Stefan, does the above guess sound right?  Any thoughts on
how to address the issue?



Re: Bug: org.el has wrong (or none) version [fatal: No names found, cannot describe anything. (fatal: No names found, cannot describe anything. @ /Users/niels/.emacs.d/straight/build/org-agenda/)]

2021-01-05 Thread Kyle Meyer
Niels Søndergaard writes:

> This morning at at reboot of emacs, it came up telling me, that
> org-contrib is not found, investigating the problem was, that the file
> with org.el is version 9.5.
> I've been looking for org-contrib and the like, but found nothing on the
> net.
> By ow org-capture does not work (maybee more, I've not investigated
> that.

I don't know anything about straight, but this sounds like what you'd
get if you try to generate org-version.el in an Org repo without tags.

  $ git clone --depth 1 file://$ORGREPO .
  $ git tag
  $ make autoloads
  [...]
  fatal: No names found, cannot describe anything.
  [...]
  $ head lisp/org-version.el
  ;;; org-version.el --- autogenerated file, do not edit
  ;;
  ;;; Code:
  ;;;###autoload
  (defun org-release ()
"The release version of Org.
  Inserted by installing Org mode or when a release is made."
 (let ((org-release ""))
   org-release))
  ;;;###autoload

> The system have been running flawless in several months

Does the packaging depend on ELPA in any way?  If so, perhaps it's
related to this recent issue:

  https://yhetil.org/orgmode/87y2hi9qev@gmx.com



Re: Org-capture template no longer recognised...

2021-01-05 Thread Kyle Meyer
Neil Shephard writes:

> Until recently I could invoke org-capture, select e r and I'd be
> prompted to enter data under Route...
>
> | <2021-01-03 |  | km | min + s | | |
>
>
> On saving this would populate the table and calculate the pace.  Now
> though I'm informed...
>
> Capture abort: Symbol's function definition is void: assert
[...]
> As I say I'd not changed my configuration which is the org-mode
> bundled with Emacs 27.1.  I do have

Hmm, so that's Org 9.3.  There aren't many plain assert's left in the
Org repo, just a few spots in contrib/ files (which aren't included in
Emacs):

  $ git grep '(assert\b' release_9.3
  release_9.3:contrib/lisp/org-attach-embedded-images.el:   (assert data)
  release_9.3:contrib/lisp/org-learn.el:  (assert (> n 0))
  release_9.3:contrib/lisp/org-learn.el:  (assert (and (>= quality 0) (<= 
quality 5)))
  release_9.3:contrib/lisp/ox-freemind.el:(assert (symbolp (car 
parsed-xml

  $ git grep '(cl-assert\b' release_9.3 | wc
   37 1913163

So...

>
> a few computers though and it was still working on a second system
> until I update installed packages,

...it does seem likely that the issue is outside of Org proper.  But
unfortunately I don't have any suggestions about where that might be, or
why it's getting triggered in the above scenario.  Hopefully others
will.



Possibility to copy text outside EMACS and send it to orgmode document

2021-01-05 Thread Gerardo Moro
Basically that: as I copy (Control-C) text from the browser (Chrome), I
would like those copied sentences to be sent to a ordered list in an
OrgMode document:

- copied text 1
- copied text 2
- etc.

Any ideas? This would be very useful.
Thanks!


Re: Possibility to copy text outside EMACS and send it to orgmode document

2021-01-05 Thread Samuel Wales
there is a tricky org-protocol thing you can do with emacsclient and a
capture template, but i suspect that chrome has an extension just like
firefox does called org-capture that does some of that in the browser
itself.  in firefox-esr, i select text and click the unicorn icon.

you will have to read about capture templates to create your own to
match the one that the org-capture extension uses [a single letter].

On 1/5/21, Gerardo Moro  wrote:
> Basically that: as I copy (Control-C) text from the browser (Chrome), I
> would like those copied sentences to be sent to a ordered list in an
> OrgMode document:
>
> - copied text 1
> - copied text 2
> - etc.
>
> Any ideas? This would be very useful.
> Thanks!
>


-- 
The Kafka Pandemic

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



Re: Possibility to copy text outside EMACS and send it to orgmode document

2021-01-05 Thread Tom Gillespie
You can achieve something a bit like this using
org-protocol-capture-html
https://github.com/alphapapa/org-protocol-capture-html. I'm not
entirely sure whether you can bind the equivalent of a hook in
javascript to run every time you C-c, but if you can, then it should
be possible to match this exactly. You might also be able to wire up
org-protocol to the X clipboard (if you are on linux).

Best,
Tom



Re: Possibility to copy text outside EMACS and send it to orgmode document

2021-01-05 Thread Gerardo Moro
Thanks, guys.
I'll have a look.
I understand that using org-protocol in combo with org-capture I would have
to visit the Emacs window for capturing the copied text or not?
Because this is crucial, as I aim to avoid this step.
Thanks!

El mié, 6 ene 2021 a las 8:49, Tom Gillespie () escribió:

> You can achieve something a bit like this using
> org-protocol-capture-html
> https://github.com/alphapapa/org-protocol-capture-html. I'm not
> entirely sure whether you can bind the equivalent of a hook in
> javascript to run every time you C-c, but if you can, then it should
> be possible to match this exactly. You might also be able to wire up
> org-protocol to the X clipboard (if you are on linux).
>
> Best,
> Tom
>


Re: Inserting LaTex expressions using a filter fails

2021-01-05 Thread Mart van de Wege
On Tue, 05 Jan 2021 22:58:33 +0100
Juan Manuel Macías  wrote:

> Hello,
> 
> Mart van de Wege  writes:
> 
> > I'm trying to replace U+00BD in an org buffer with \sfrac{1}{2}
> > during export to LaTex, and obviously I'm doing something wrong, or
> > I don't understand the documentation.
> >
> > I use the following code to set up the filter:
> >
> > #+BIND: org-export-filter-item-functions (latex-replace-half)
> > #+BEGIN_SRC emacs-lisp :exports results :results none
> >
> >   (defun latex-replace-half (text backend info)
> > (when (org-export-derived-backend-p backend 'latex)
> >   (replace-regexp-in-string  "½" "\\sfrac{1}{2}" text)))
> > #+END_SRC  
> 
> You must add a double escape character to the backslash:
> 
> ...
>   (replace-regexp-in-string  "½" "sfrac{1}{2}" text)))
> ...
> 
Thanks!

But see my answer to Nick Dokos on the list, that does not do anything
either.

Regards,


Mart



Re: Inserting LaTex expressions using a filter fails

2021-01-05 Thread Mart van de Wege
Nick Dokos  writes:

> Mart van de Wege  writes:
>
>> I'm trying to replace U+00BD in an org buffer with \sfrac{1}{2} during
>> export to LaTex, and obviously I'm doing something wrong, or I don't
>> understand the documentation.
>>
>> I use the following code to set up the filter:
>>
>> #+BIND: org-export-filter-item-functions (latex-replace-half)
>> #+BEGIN_SRC emacs-lisp :exports results :results none
>>
>>   (defun latex-replace-half (text backend info)
>> (when (org-export-derived-backend-p backend 'latex)
>>   (replace-regexp-in-string  "½" "\\sfrac{1}{2}" text)))
>> #+END_SRC
>>
>
> Try
>
> (replace-regexp-in-string  "½" "sfrac{1}{2}" text)))
>
Nope. Doesn't do it. Here's the Latex output of the two example lines:

  \item 1½ eetl. gehakte peterselie, ½ eetl. azijn, 4 eetl. olie.

  Laat de gewassen en gebroken vermicelli met de foelie ½ uur in de

This was run using final-output-functions, btw.

Regards,

Mart

-- 
"We will need a longer wall when the revolution comes."
--- AJS, quoting an uncertain source.