Re: Please add support for dlangs packagemanager to ob-C.el

2022-03-10 Thread tbanelwebmin
Thanks Christian for this contribution.

Easily adding DLang dependencies while keeping a single code block seems
quite useful.
I will take a deeper look at your proposal.

Also, you marked your patch as TINYCHANGE, which imply it is less than
15 lines long. However your patch is 24 lines long. This requires that
you assign the copyright for your contributions to the FSF. Have you
signed the assignment? More on this process here:
https://orgmode.org/contribute.html

The best
Thierry
ob-C.el maintainer


Le 08/03/2022 à 23:47, Christian Köstlin a écrit :
> I Hope the patch already contains enough background information why
> its a nice feature to have in ob-C.el.
>
> Kind regards,
> Christian
>




Re: bug-tracker: How to response/subscribe to a bug-thread

2022-03-10 Thread Max Nikulin

On 09/03/2022 23:46, c.bu...@posteo.jp wrote:


There is a known bug that is also tracked on the "dashboard" 
(https://updates.orgmode.org/) as "Inconsistent handling of id: links to 
other file during publish".

https://list.orgmode.org/12368452.sVpYeFqCzH@pluto/

I was not subscribed to the list when this thread comes up. So I have no 
mail here I can reply-to. I can I answer to that thread?


There is a number of various mail list archives that allow to fetch 
particular message and to compose a reply to it. There are some minor 
bugs (they usually have workarounds), so I can not tell that it works 
really smooth.


Besides already mentioned public inbox instance:

Gmane archive is available though news:// or nntp:// protocols. You may 
setup a news reader, subscribe to the news group and fetch old messages 
or just access particular one by its Message-ID


w3m -m 'nntp://news.gmane.io/12368452.sVpYeFqCzH@pluto'
w3m -m 
'nntp://news.gmane.io/gmane.emacs.orgmode/12368452.sVpYeFqCzH@pluto'


"Official" (GNU) mail list archive has a reply button
https://lists.gnu.org/archive/cgi-bin/namazu.cgi?query=%2Bmessage-id%3A12368452.sVpYeFqCzH@pluto&idxname=emacs-orgmode
but it is necessary to edit "To" field otherwise the response will be 
sent off-list to the author only. Unfortunately the In-Reply-To field of 
mailto: links there violates "RFC 6068 - The 'mailto' URI Scheme" due to 
missed angle brackets around Message-ID, so a mailer may skip it.


For bugs submitted to https://debbugs.gnu.org it is enough to keep 
subject with bug number when the message is sent to 
bug-gnu-em...@gnu.org or to send it to the mail address of the bug 
n...@debbugs.gnu.org. Some efforts are required when you are at the HTML 
page with discussion of the bug and you intention is to respond namely 
with proper In-Reply-To. Unlike upstream https://bugs.debian.org/ , GNU 
version does not have "reply" links. It is possible to fetch particular 
message ("mbox" link), open it, and reply. Obstacles are ".mbox" 
extension instead of ".eml" despite correct MIME type "message/rfc866" 
in HTTP headers and necessity to edit "To" field since the downloaded 
message has only low-level service mail addresses.


So some attention is required to compose a well-formed response, but 
being subscribed to the mail list in advance is not a prerequisite.





[BUG] org-capture autoload bug? [9.5.2 (9.5.2-gfbff08 @ /home/ignacio/.emacs.d/elpa/org-9.5.2/)]

2022-03-10 Thread Ignacio Casso
Hello,

I think I've found a bug with org-capture autoload. If the first time
you use org-capture before it's actually loaded is within a let form binding
org-capture-templates, it produces an error saying that the template was
not found.

For example, if we call this:

  (let ((org-capture-templates
 '(("d" "default" entry
(file+headline org-default-notes-file "Tasks")
"* %?"
(org-capture nil "d")))

It produces the error:

  (error "No capture template referred to by \"d\" keys")


Furthermore, depending on where that form was evaluated or defined, the
next time you called org-capture may work or produce the following
error:

  org-capture: Symbol’s value as variable is void: org-capture-templates

In particular, if it is evaluated directly in the scratch buffer the
next call to org-capture works, and if it is part of a function
defined in my init file and evaluated in the scratch buffer, it produces
the error.

I have tried this too in Emacs 29 and the behaviour is similar, but
sometimes the error produced is

  (error "Defining as dynamic an already lexical var")

instead of

  (error "No capture template referred to by \"d\" keys")

This again depends on where the form is evaluated or defined.


Best regards,

Ignacio

P.S., I now this has an easy solution: not autoloading org-capture and having
(require 'org-capture) in my config. I'm just reporting the bug, if that
is what this is.

Emacs  : GNU Emacs 27.2 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.20)
 of 2022-01-16
Package: Org mode version 9.5.2 (9.5.2-gfbff08 @ 
/home/ignacio/.emacs.d/elpa/org-9.5.2/)



Re: Move or rename a file in a link

2022-03-10 Thread Juan Manuel Macías
Hi João, Thanks for your comment.

João Pedro de Amorim Paula writes:

> Thanks for sharing! It'd be great if it worked for attachments as well,
> but that is a whole can of worms.

Regarding attachments, do you mean org attachments or email attachments?
Could you give an example of a use case?

Best regards,

Juan Manuel 



Re: [BUG] org-capture autoload bug? [9.5.2 (9.5.2-gfbff08 @ /home/ignacio/.emacs.d/elpa/org-9.5.2/)]

2022-03-10 Thread Max Nikulin

On 10/03/2022 19:53, Ignacio Casso wrote:

For example, if we call this:

   (let ((org-capture-templates
  '(("d" "default" entry
 (file+headline org-default-notes-file "Tasks")
 "* %?"
 (org-capture nil "d")))

It produces the error:

   (error "No capture template referred to by \"d\" keys")


Ignacio, could you, please, try the following?

(custom-set-variables
 '(org-capture-templates
   '(("d" "default" entry
  (file "/tmp/capture-test.org")
  "* %?"
(org-capture nil "d")

On 09/03/2022 23:39, c.buhtz wrote in 
https://list.orgmode.org/7395938a0e6b06139239bc70ba7c2...@posteo.de:> 
Why using custom-set variables here? Is there something wrong with just 
doing

(org-export-with-broken-links t)
? 


I do not think that something similar may happen with 
`org-export-with-broken-links', but I suppose, the example above is 
another argument to prefer setting variables through customization 
interface instead of bare `setq' in general.




[PATCH] org-protocol.org: updated Linux setup (Gnome) section

2022-03-10 Thread Wilko Meyer
Good evening,

I'd like to suggest an update to the org-protocol.org "Linux setup (Gnome)"
section as it is refering to gconf/gconftool-2 which is deprecated as of
Gnome 3. It may be a good idea to use .desktop-Files (as described in
freedesktop.orgs Desktop Entry/Menu Specification) here to complete this
step (which is what my patch suggests).
>From 8c62f173c34929dd03e324ff3ec4d457850e52c4 Mon Sep 17 00:00:00 2001
From: Wilko Meyer 
Date: Thu, 10 Mar 2022 19:59:45 +0100
Subject: [PATCH] org-protocol.org: updated Linux setup (Gnome) section as
 gconf is deprecated by now

---
 org-contrib/org-protocol.org | 17 ++---
 1 file changed, 14 insertions(+), 3 deletions(-)

diff --git a/org-contrib/org-protocol.org b/org-contrib/org-protocol.org
index 57cab17f..b10ef41e 100644
--- a/org-contrib/org-protocol.org
+++ b/org-contrib/org-protocol.org
@@ -89,10 +89,21 @@ actions. Just register your custom sub-protocol and handler 
with the variable
 
 *** Linux setup (Gnome)
 
-For this to work, you'll need the Gnome-Libraries to be installed.
+Add a file =org-protocol.desktop= to =~/.local/share/applications/=:
+
+#+begin_example
+[Desktop Entry]
+Name=org-protocol
+Exec=emacsclient '%u'
+Type=Application
+Terminal=false
+Categories=System;
+MimeType=x-scheme-handler/org-protocol;
+#+end_example
+
+Update the cache database of MIME types handled by desktop files via:
 
-: gconftool-2 -s /desktop/gnome/url-handlers/org-protocol/command 
'/usr/local/bin/emacsclient %s' --type String
-: gconftool-2 -s /desktop/gnome/url-handlers/org-protocol/enabled --type 
Boolean true
+: update-desktop-database ~/.local/share/applications/
 
 *** Linux setup (KDE)
 
-- 
2.35.1



Re: [wip-cite-new] Exporting to pandoc md (and from there to zotero odt)

2022-03-10 Thread Anders Johansson
Hi,
>We should also get pandoc to support updated org-cite syntax.
> https://github.com/jgm/pandoc/issues/7329

Now that pandoc has org-cite support, I found it simpler to reuse
ox-pandoc (https://github.com/emacsorphanage/ox-pandoc) and just do
this very simple configuration. ox-pandoc exports to an intermediary
org file, so we can just make sure to reinsert citations in org
format.

(use-package ox-pandoc
  :custom (org-pandoc-options-for-odt
   '((lua-filter . "/home/aj/lib/bbt-pandoc-zotero.lua")
 (metadata . "zotero_author_in_text=true"

(org-cite-register-processor 'pandoc
  :export-citation #'oc-pandoc-export-citation
  :export-bibliography #'oc-pandoc-export-bibliography)

(defun oc-pandoc-export-citation (citation _style _ _info)
  "Export CITATION object in org format."
  (org-element-citation-interpreter
   citation
   (mapconcat (lambda (r) (org-element-citation-reference-interpreter r nil))
  (org-cite-get-references citation

(defun oc-pandoc-export-bibliography (_k _f _s _p _b _i)
  "Generate a #+print_bibliography:"
  "#+print_bibliography:")



Re: [BUG] org-capture autoload bug? [9.5.2 (9.5.2-gfbff08 @ /home/ignacio/.emacs.d/elpa/org-9.5.2/)]

2022-03-10 Thread Ignacio Casso


Max Nikulin  writes:

> On 10/03/2022 19:53, Ignacio Casso wrote:
>> For example, if we call this:
>>(let ((org-capture-templates
>>   '(("d" "default" entry
>>  (file+headline org-default-notes-file "Tasks")
>>  "* %?"
>>  (org-capture nil "d")))
>> It produces the error:
>>(error "No capture template referred to by \"d\" keys")
>
> Ignacio, could you, please, try the following?
>
> (custom-set-variables
>  '(org-capture-templates
>'(("d" "default" entry
>   (file "/tmp/capture-test.org")
>   "* %?"
> (org-capture nil "d")
>

That works, of course, but it's not suitable to my use case. The example
I have provided has been reduced from a larger function I wrote that
relies on org-capture functionality to create new entries in an org
file, using a template specific for that function which is not relevant
for any other Elisp code calling org-capture. Thus the function binds
locally and temporarily org-capture-templates, as I've seen other Elisp
code snippets do. If org-capture is already loaded it works just fine,
and I would expect it to work too when it is not and the function
triggers the autoload, but it doesn't.



Re: ox-publish: Some starting problems

2022-03-10 Thread Nick Dokos
[Answers to some of the questions inline]

c.bu...@posteo.jp writes:

> 1.  Is this mailing list the right place to discuss ox-publish
> related topics? The ox-publish.el only contains two e-mail
> addresses?
>
Yes.

> 2.  Because ox-publish is skipping "unmodified files" I deleted all
> HTML files between the publish-runs just to be sure that there are
> no side effects. But now when my output directory is totally empty
> ox-publish still keeps saying that it is skipping the unmodified
> files. So nothing is generated anymore. How can I handle that? Maybe
> resetting the "unmodified" flag somewhere? Or shouldn't ox-publish
> not only check for modifications but if there is something earlier
> generated content exist?
>
Org mode records the time when a file was published and compares it to
the last modification time to decide whether to publish or not. It
does not have a dependency mechanism like `make' to figure things
out. As you found out, you can force it by calling it with a `t'
argument for the `force' parameter. You can do this interactively with
`C-u M-x org-publish'. See the "Triggering Publication" section of the
manual:

  (info "(org)Triggering Publication")

That section also points you to the variable
`org-publish-use-timestamps-flag': if you set that to `nil', no
timestamp checking is done.

The timestamps are kept in the directory named by the variable
`org-publish-timestamp-directory' whose default value is
"~/.org-timestamps/".

> 4.  ox-publish ignores newlines. Two short lines in the org-file
> becomes one line in the HTML content.
>

That is how HTML export (and publishing) works: the browser does its
own layout of HTML content and you have no say in that (except for
`verbatim' things that are pre-formatted).

> 5.  I am not totally new to Emacs but quit fresh. So I have two
> questions about how to handle the documentation and help
> informations here.  a) I tried to "descrbie" the mode
> "ox-publish". But Emacs only offers me an "describe-mode" which
> describe all currently existing nodes. There is nothing like
> "describe-mode MODENAME". How can I handle that?

There is no such mode: `ox-publish' is (part of) the name of the file
that contains the code that is used for publishing - in particular
it contains the code of the function `org-publish'. You can get
the doc string of the function with `C-h f org-publish'.

> b) I another thread I was pointed to
> https://orgmode.org/manual/Publishing-options.html . There is no
> description about the options they are only listed. This does not
> help me. Maybe there are some useful options that could solve some
> of my problems. But without description I am not able to decide or
> know.
>

Read the first paragraph of that section carefully:

,
| The property list can be used to set many export options for the HTML
| and LaTeX exporters.  In most cases, these properties correspond to
| user variables in Org.  The table below lists these properties along
| with the variable they belong to.  See the documentation string for
| the respective variable for details.
`

So to find out e.g. what the option ‘:archived-trees’ does, you have
to ask for the doc string of the variable ‘org-export-with-archived-trees’.
You can do that with `C-h v org-export-with-archived-trees' or more easily
by putting the cursor on the name and typing `C-h v RET`.

-- 
Nick

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




Re: Cannot link to files with no extension

2022-03-10 Thread Nick Dokos
Colin Baxter  writes:


> 6. In a.org enter [[file:./z][This is file z]] and save.
>
> 7. Click on the link.
>
> 8. Message "Running less in /path/to/z ... done", but link does not
>open.
>

This sounds like your `org-file-apps' is funny. What is its value?
Check also the value of the system-specific variable
`org-file-apps-{gnus,windowsnt,macos}' - whichever is applcible to your
case.

-- 
Nick

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




Re: [BUG] Questionmarks in org-agenda instead of file names [9.5.2 (9.5.2-g3154c2 @ /Users/eugr/.emacs.d/straight/build/org/)]

2022-03-10 Thread Eugene Rakhmatulin
Hi Ihor,

It took a bit longer than usual to reproduce, but the questionmarks
appeared again.
Org was updated to the latest version on both machines.

I'll delete the caches and see if I can reproduce again.

Thanks,
Eugene.

On Sat, Feb 19, 2022 at 11:30 PM Ihor Radchenko  wrote:
>
> Eugene Rakhmatulin  writes:
>
> > Well, that happened again. See the backtrace below.
>
> I recently managed to find a reproducer when question marks wrongly
> appear in category. Just pushed the fix to main (c5a0113367). Can you
> try again and let me know if it is fixes your problem?
>
> Best,
> Ihor



Re: Cannot link to files with no extension

2022-03-10 Thread Nick Dokos
Nick Dokos  writes:

> Check also the value of the system-specific variable
> `org-file-apps-{gnus,windowsnt,macos}' - whichever is applcible to your
> case.

That should be `org-file-apps-{gnu,windowsnt,macos}'.
-- 
Nick

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




[BUG] error after reading in contents of other file [9.6 (9.6-??-e7ea951 @ /home/user/.emacs.d/.local/straight/build-28.0.50/org/)]

2022-03-10 Thread Mark Edgington


I manually opened a new daily file, and read in some content from
another file (using ':r filename.txt' with Evil).  After doing this, the
content was inserted, but the following traceback occurred:

Warning (org-element-cache): org-element--cache: Org parser error in 
2022-03-10.org::193. Resetting.
 The error was: (error "Invalid search bound (wrong side of point)")
 Backtrace:
"  backtrace-to-string(nil)
  org-element-at-point()
  org-element-context()
  (and t (org-element-context))
  (let* ((context (and t (org-element-context))) (path (and context 
(org-element-property :path context (if path (let* ((val 
(org-element-property :type context))) (cond ((equal val '\"kbd\") (let nil 
(format \"%s %s\" (propertize \"Key sequence:\" ... ...) (propertize ... ... 
... ((equal val '\"doom-module\") (let nil (format \"%s %s\" (propertize 
\"Doom module:\" ... ...) (propertize ... ... ... ((equal val 
'\"doom-package\") (let nil (format \"%s %s\" (propertize \"Doom package:\" ... 
...) (propertize ... ... ... (t (let ((type val)) (format \"Link: %s\" 
(org-element-property :raw-link context
  +org-display-link-in-eldoc-a(#f(compiled-function (string &rest plist) 
#))
  apply(+org-display-link-in-eldoc-a #f(compiled-function (string &rest plist) 
#))
  org-eldoc-documentation-function(#f(compiled-function (string &rest plist) 
#))
  eldoc-documentation-default()
  eldoc--invoke-strategy(nil)
  eldoc-print-current-symbol-info()
  #()
  apply(# nil)
  timer-event-handler([t 0 0 50 nil # nil idle 0])
"



Emacs  : GNU Emacs 28.0.50 (build 2, x86_64-pc-linux-gnu, GTK+ Version 3.24.20, 
cairo version 1.16.0)
 of 2022-01-15
Package: Org mode version 9.6 (9.6-??-e7ea951 @ 
/home/user/.emacs.d/.local/straight/build-28.0.50/org/)

current state:
==
(setq
 org-link-elisp-confirm-function nil
 org-directory "~/org/"
 org-after-refile-insert-hook '(save-buffer)
 org-indirect-buffer-display 'current-window
 org-roam-db-gc-threshold 2305843009213693951
 org-crypt-key nil
 org-bibtex-headline-format-function #[257 "\300%1\236A\207" [:title] 3 
"\n\n(fn ENTRY)"]
 org-roam-mode-hook '(+org-roam-detach-magit-section-mode-map-h 
turn-on-visual-line-mode)
 org-roam-dailies-capture-templates '(("d" "daily" plain 
#'org-roam-capture--get-point "" :immediate-finish t :kill-buffer t :file-name 
"dailies/%<%Y-%m-%d>" :head "#+TITLE: %<%Y-%m-%d>\n%(org-time-stamp-inactive 
'(16))\n\n"))
 org-load-hook '(+org-init-org-directory-h +org-init-appearance-h 
+org-init-agenda-h +org-init-attachments-h +org-init-babel-h 
+org-init-babel-lazy-loader-h +org-init-capture-defaults-h 
+org-init-capture-frame-h
 +org-init-custom-links-h +org-init-export-h +org-init-habit-h 
+org-init-hacks-h +org-init-keybinds-h +org-init-popup-rules-h 
+org-init-protocol-h +org-init-protocol-lazy-loader-h +org-init-smartparens-h
 +org-init-roam-h)
 org-startup-folded nil
 org-babel-after-execute-hook '(+org-redisplay-inline-images-in-babel-result-h)
 org-link-abbrev-alist '(("doom-repo" . 
"https://github.com/hlissner/doom-emacs/%s";) ("wolfram" . 
"https://wolframalpha.com/input/?i=%s";) ("wikipedia" . 
"https://en.wikipedia.org/wiki/%s";)
 ("duckduckgo" . "https://duckduckgo.com/?q=%s";) 
("gmap" . "https://maps.google.com/maps?q=%s";) ("gimages" . 
"https://google.com/images?q=%s";) ("google" . "https://google.com/search?q=";)
 ("youtube" . "https://youtube.com/watch?v=%s";) 
("github" . "https://github.com/%s";))
 org-agenda-files '("~/org/")
 org-capture-templates '(("t" "Personal todo" entry (file+headline 
+org-capture-todo-file "Inbox") "* [ ] %?\n%i\n%a" :prepend t)
 ("n" "Personal notes" entry (file+headline 
+org-capture-notes-file "Inbox") "* %u %?\n%i\n%a" :prepend t)
 ("j" "Journal" entry (file+olp+datetree 
+org-capture-journal-file) "* %U %?\n%i\n%a" :prepend t) ("p" "Templates for 
projects")
 ("pt" "Project-local todo" entry (file+headline 
+org-capture-project-todo-file "Inbox") "* TODO %?\n%i\n%a" :prepend t)
 ("pn" "Project-local notes" entry (file+headline 
+org-capture-project-notes-file "Inbox") "* %U %?\n%i\n%a" :prepend t)
 ("pc" "Project-local changelog" entry (file+headline 
+org-capture-project-changelog-file "Unreleased") "* %U %?\n%i\n%a" :prepend t) 
("o" "Centralized templates for projects")
 ("ot" "Project todo" entry 
#'+org-capture-central-project-todo-file "* TODO %?\n %i\n %a" :heading "Tasks" 
:prepend nil)
 ("on" "Project notes" entry 
#'+org-capture-central-project-notes-file "* %U %?\n %i\n %a" :heading "Notes" 
:prepend t)
 ("oc" "Project changelog" entry 
#'+org-capture-central-project-changelog-file "* %U %?\n %i\n %a" :heading 
"Changelog" :p

Re: Can't cite multiple sources with biblatex, autocites & autopunct

2022-03-10 Thread Zac E
Hello,
> Nicolas Goaziou  writes:
> 
> Could you provide an example demonstrating the issue? It should include
> a minimal Org source, the LaTeX output, and the expected output.

Thank you for your response! I have included a minimal example below. I am 
running Emacs 27.2 and Org-mode 9.6. 

ORG SOURCE

#+latex_class: article
#+latex_header: \usepackage[autopunct,style=american]{csquotes}
#+latex_header: \usepackage[autopunct=true,autocite=footnote]{biblatex}
#+cite_export: biblatex
#+bibliography: example.bib

With only one citation, the footnote is correctly moved outside of the period 
[cite:@example1]. With two citations, the footnote incorrectly remains within 
the punctuation [cite:@example1;@example2]. Lorem ipsum dolor sit amet.

ACTUAL LATEX OUTPUT

With only one citation, the footnote is correctly moved outside of the period 
\autocite{example1}. With two citations, the autocites command is followed by a 
relax command, such that the footnote incorrectly remains within the 
punctuation in the output pdf \autocites{example1}{example2}\relax. Lorem ipsum 
dolor sit amet.

EXPECTED LATEX OUTPUT

With only one citation, the footnote is correctly moved outside of the period 
\autocite{example1}. With two citations, the autocites command is followed by a 
relax command, such that the footnote incorrectly remains within the 
punctuation in the output pdf \autocites{example1}{example2}. Lorem ipsum dolor 
sit amet.

BIB SOURCE

@Book{example1,
  author =   {Lorem, Ipsum},
  title ={Example, First},
  publisher ={Org-Mode},
  date = 2022,
  address =  {Stallmanstadt},
}

@Book{example2,
  author =   {Dolor, Sit},
  title ={Example, Second},
  publisher ={Emacs},
  date = 2022,
  address =  {Utopie},
}

Regards,
Zac Endter



Re: Cannot link to files with no extension

2022-03-10 Thread Colin Baxter
Hi Nick,

> Nick Dokos  writes:

> Colin Baxter  writes:
>> 6. In a.org enter [[file:./z][This is file z]] and save.
>> 
>> 7. Click on the link.
>> 
>> 8. Message "Running less in /path/to/z ... done", but link does
>> not open.
>> 

> This sounds like your `org-file-apps' is funny. What is its value?
> Check also the value of the system-specific variable
> `org-file-apps-{gnus,windowsnt,macos}' - whichever is applcible to
> your case.

I have not altered (knowingly!) my 'org-file-apps' for years. Its value
is:

--8<---cut here---start->8---

Value:
(("\\.pdf\\'" . "xpdf %s")
 (auto-mode . emacs)
 ("\\.x?html?\\'" lambda
  (file link)
  (eww-open-file file))
 ("\\.pdf\\'" . system)
 ("\\.dvi\\'" . system)
 ("\\.ps\\'" . system))

Original value was 
((auto-mode . emacs)
 (directory . emacs)
 ("\\.mm\\'" . default)
 ("\\.x?html?\\'" . default)
 ("\\.pdf\\'" . default))

--8<---cut here---end--->8---

The odd thing is that my problem has just arisen. I don't remember
having it before say a few weeks ago.

Best wishes,

Colin.