Re: org-open-at-point while on "normal" text

2024-01-30 Thread Ihor Radchenko
Rainer Dunker  writes:

>> I am unable to reproduce the problem on the latest stable version of Org
>> mode - 9.6.17.
>> 
>> May you upgrade Org mode and let us know if you are still experiencing
>> the problem?
>
> Of course. I did a test install of release_9.6.17-1108-gf490c15, and yes--the 
> unepected behaviour persists. The result of the test expression is not 
> completely identical to that of version 9.6.6, though; instead of ...
>
>(headline (:raw-value "heading" :begin 1 :end 16 :pre-blank 0
>:contents-begin 11 :contents-end 16 ...
> ...
> But nevertheless, it's still not nil. Thus, I'm afraid, the upgrade did not 
> solve the issue.

Ok. Then, may you provide more detailed instructions how to reproduce
the problem? Starting from emacs -Q or make repro. See
https://orgmode.org/manual/Feedback.html#Feedback

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



Re: [PATCH] ob-tangle: Add flag to optionally remove files before writing

2024-01-30 Thread Ihor Radchenko
Olivier Lischer  writes:

>> I suggest changing your patch, setting the default value of
>> `org-babel-tangle-remove-file-before-write' to 'auto.
>> This will keep the current behaviour but fall back to delete + write new
>> file when the tangle target is read-only.
>> That will avoid feature regression.
>
> I changed the path as you proposed.

Thanks, but I think that I was not clear enough explaining what I wanted
you to change.

> -(defcustom org-babel-tangle-uncomment-comments nil
> +(defcustom org-babel-tangle-uncomment-comments 'auto

I did not ask to change `org-babel-tangle-uncomment-comments'.
I meant that you allow the new variable you propose
(`org-babel-tangle-remove-file-before-write') to have 3 values:
nil, t, and 'auto.

> +(defcustom org-babel-tangle-remove-file-before-write nil

... with default being 'auto, not nil.

> - ;; We do not erase, but overwrite previous file
> - ;; to preserve any existing symlinks.
> -  (write-region nil nil file-name)
> + (when (and (file-exists-p file-name) 
> org-babel-tangle-remove-file-before-write)
> +   (delete-file file-name))
> + (write-region nil nil file-name)

Then, with the default value of 'auto, you only call `delete-file' when
the file is read-only.

It would also help to extend the comment ";; We do not erase...", not
just delete it.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



Re: Connecting to an Already Running Scheme REPL with org-babel

2024-01-30 Thread Ihor Radchenko
Hunter Jozwiak  writes:

>>> + (host (cdr (assq :host params)))
>>> + (port (cdr (assq :port params)))
>>
>> Please declare these new scheme-specific header argument in
>> `org-babel-header-args:scheme'.
>> See `org-babel-header-args:C' for an example.
>> This is necessary for header argument completion to work.

> Okay. Is there a way to tighten these inputs further? I have them set to
> :any for the moment, but I wonder if there is a way to leverage the
> values for `geiser-repl-default-host` and `geiser-repl-default-port`.

Org-mode currently does not provide completion for header argument
values. (see `pcomplete/org-mode/block-option/src')

If Org were to support such completion, you could theoretically allow
special values for :host/:port like default:

#+begin_src scheme :host default :port default
...
#+end_src

to use `geiser-repl-default-host'/`...-port'.

Then, you could add these values as (default :any).

>>> -  (and (not (string= session "none")) session ; session
>>> +  (and (not (string= session "none")) session)  host port))) ; 
>>> session
>>
>> This does not look right. Your change will disable session support
>> completely when host and port are not provided.
> Is there a way to test this and pinpoint the problem?

Hmm. I just realized that I am reading that line wrongly - host and port
are additional arguments passed to
`org-babel-scheme-execute-with-geiser', not a part of
(and (not ...) host port)

So, my only comment remaining is to put each argument in its own line,
like it is done for all the previous arguments:

(org-babel-scheme-execute-with-geiser
   full-body   ; code
   (string= result-type "output")  ; output?
   impl; implementation
   (and (not (string= session "none")) session) ; session
   host ; repl host name
   port) ; repl port

That will make the code more readable.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



[FR] Append wrapped results from babel block (was: Appending results from babel block)

2024-01-30 Thread Ihor Radchenko
Ken Mankoff  writes:

>>> Weirdly,
>>> 
>>> :results append drawer
>>> 
>>> Appends result #2, but then inserts all results after the first.
>>  
>> I'm not sure what you mean. However, trying it, I see bunches of
>> "results-end" groups. I assume this is what you see, too?
>
> Yes that's what I see in general format. You ran it 3x in on second so I 
> can't very we're seeing the same thing. But the order becomes
>
> 1
> 5
> 4
> 3
> 2
>
> That is, 2 is appended as expected, but then 3 is inserted after 1 but before 
> 2, 4 is after 1 but before 3, etc.

This is expected, because Org mode has no way to know which drawers are
related to results and which are not.

Let me illustrate with an example:

#+begin_src ... :results append drawer
...
#+end_src

:drawer:
I have nothing to do with the above src block
:end:

When you evaluate the code block, Org mode searches for #+RESULTS:
keyword to mark the results. If there is none, it adds it:

#+begin_src ... :results append drawer
...
#+end_src

#+RESULTS:
:drawer:
1
:end:
:drawer:
I have nothing to do with the above src block
:end:

Now, when you ask Org mode to append to result, it will find the drawer
with #+results: keyword and insert the new result _after_:

#+begin_src ... :results append drawer
...
#+end_src

#+RESULTS:
:drawer:
1
:end:
:drawer:
2
:end:
:drawer:
I have nothing to do with the above src block
:end:

If we now execute the source code block again, Org mode will have no
idea that the "2" drawer has anything to do with results of evaluation,
because it has no :RESULTS: keyword. Only the first drawer is
considered. Hence, Org mode appends the result after "1" again:

#+begin_src ... :results append drawer
...
#+end_src

#+RESULTS:
:drawer:
1
:end:
:drawer:
3
:end:
:drawer:
2
:end:
:drawer:
I have nothing to do with the above src block
:end:

That's how the sequence your observe is constructed.

When you do not use :results drawer, it happens so that subsequent

: 1
: 2

are not creating two separate syntax objects, but are merged into a
single fixed-width markup. So, appending works just fine.



Now, indeed, the above situation with drawers (and :wrap in general) is
confusing.

What we might do is modify `org-babel-insert-result' so that it unwraps
and re-wraps the existing result when it has exactly the same wrap
style. That might be a nice new feature to have.
Patches welcome!

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



Re: bug#68687: [PATCH] Use text/org media type

2024-01-30 Thread Ihor Radchenko
Richard Stallman  writes:

> I am concerned that the actions described above would tend to embed
> Org format and Org mode more deeply into Emacs usage.
>
> Suppose A and B are Org users.  If A knows this, and mails B a message
> which contains text labaled as text/org, that won't make anyone
> unhappy.  No one would have a reason to complain.
>
> But what if C mails a message to D with text labeled as text/org and D
> is not an Org user?  Will that cause Emacs to load Org?  It should
> not.

> What will Gnus do when the user readss a message with text labaled as
> text/org?  What will Rmail do?  What will MH-E do?

It may or may not depending on user customization `mm-inline-media-tests'.
Just like with text/html, application/javascript, text/x-sh, images,
etc.

By default, for example, text/html gets rendered via shr.el (AFAIK). Do
you think that shr.el should not be loaded (in (require 'shr) sense)?

> These are crucial questions because the answers would determine
> whether this feature pressures people to use Org mode or not.  We need
> concrete answers because only that would enable us to see cleary now
> whether the feature would do that if in use.

Even when text/org is rendered using Org mode, there is nothing
pressuring people to use Org mode there. It is just visuals. Org major
mode is not activated.

Also, it is already what Emacs does for text/x-org. This patch is merely
asking to treat text/org as text/x-org is already treated.

> Max Nikulin  wrote:
>
> Received or fetched Org 
>   > files must be treated with some precautions, but it is another story.
>
> I was not aware of this issue.  Let's look at it concretely now so we
> can determine what its implications are.  Have people already written
> a list of these precautions?  If so, I'd like to see it.

Max is referring to various security issues with evaluating code inside
Org mode buffers. They are known, but not relevant to Org text being
displayed in email MUA - Org never evaluates any code automatically
without user explicitly asking for it. And in MUA, Org mode is simply
used to apply faces. No other interaction with the displayed text/org
mime part is allowed.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



Re: bug#68687: [PATCH] Use text/org media type

2024-01-30 Thread Eli Zaretskii
> From: Richard Stallman 
> Cc: maniku...@gmail.com, 68...@debbugs.gnu.org, emacs-orgmode@gnu.org,
>   stefankan...@gmail.com
> Date: Mon, 29 Jan 2024 22:56:58 -0500
> 
> I am concerned that the actions described above would tend to embed
> Org format and Org mode more deeply into Emacs usage.
> 
> Suppose A and B are Org users.  If A knows this, and mails B a message
> which contains text labaled as text/org, that won't make anyone
> unhappy.  No one would have a reason to complain.
> 
> But what if C mails a message to D with text labeled as text/org and D
> is not an Org user?  Will that cause Emacs to load Org?  It should
> not.
> 
> What will Gnus do when the user readss a message with text labaled as
> text/org?  What will Rmail do?  What will MH-E do?

This happens to me all the time (because our mailing lists are full of
such C's, and I'm one example of D), so I know what happens, at least
in Rmail: you see the text with Org markup uninterpreted, as plain
text.  Here's a random example:

  #+begin_src emacs-lisp
  (add-hook 'before-save-hook 'time-stamp)
  (require 'org-refile)
  (setq org-refile-use-cache t)
  (setq org-refile-use-outline-path t)
  (setq org-refile-targets '((nil :maxlevel . 5)))
  (setq org-goto-interface 'outline-path-completion)
  (setq large-file-warning-threshold 1500)
  (find-file "foo.org")
  (org-refile-get-targets)
  #+end_src

With Org, the header and footer should be removed from display, and
the Lisp code should be displayed with lisp-mode fontifications.  What
I see is just plain text, including the pesky header and footer.

It isn't a catastrophe, IMO.

> These are crucial questions because the answers would determine
> whether this feature pressures people to use Org mode or not.  We need
> concrete answers because only that would enable us to see cleary now
> whether the feature would do that if in use.

In any case, we already have this in the wild, it just uses
Content-type that current standards frown on.  This proposal is just
to use a different, more standard-compliant Content-type.



Re: link broken on babel header-args

2024-01-30 Thread Ihor Radchenko
Ihor Radchenko  writes:

>> I think the correct link is:
>>
>> https://orgmode.org/manual/Using-Header-Arguments.html#Using-Header-Arguments
>
> Well. Rather https://orgmode.org/manual/Working-with-Source-Code.html
> We do not anymore have a dedicated section listing all the possible
> header arguments. So, the text in
> https://orgmode.org/worg/org-contrib/babel/header-args.html may also
> need to be changed.

Fixed.
https://git.sr.ht/~bzg/worg/commit/e8cd4b07

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



[BUG] repeated warnings about org-element-at-point "cannot be used in non-Org buffer" [9.7 (9.7-??-57b94f3 @ /Users/cstevens/.emacs.d/.local/straight/build-29.2/org/)]

2024-01-30 Thread Christopher Stevenson



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.


I get these warnings about org-element when I am in non-org files; the
main ones that come to mind are JavaScript files and in magit when I am
doing a commit. They don't seem to break anything but it does get
annoying to have to constantly dismiss them.

Emacs  : GNU Emacs 29.2 (build 2, aarch64-apple-darwin23.2.0, NS appkit-2487.30 
Version 14.2.1 (Build 23C71))
of 2024-01-23
Package: Org mode version 9.7 (9.7-??-57b94f3 @ 
/Users/cstevens/.emacs.d/.local/straight/build-29.2/org/)

current state:
==
(setq
org-link-elisp-confirm-function nil
org-directory "~/SynologyDrive/OrgRoam"
org-agenda-skip-deadline-prewarning-if-scheduled t
org-cite-insert-processor 'citar
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 'org-bibtex-headline-format-default
org-download-file-format-function 'org-download-file-format-default
org-log-done t
org-roam-mode-hook '(+org-roam-detach-magit-section-mode-map-h 
turn-on-visual-line-mode)
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-smartparens-h 
+org-init-roam-h)
org-startup-folded 'show2levels
org-babel-after-execute-hook '(+org-redisplay-inline-images-in-babel-result-h)
org-link-abbrev-alist '(("doomdir" . "/Users/cstevens/.doom.d/%s") ("emacsdir" 
. "/Users/cstevens/.emacs.d/%s")
 ("doom-repo" . 
"https://github.com/doomemacs/doomemacs/%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-skip-scheduled-if-done t
org-agenda-files '("~/SynologyDrive/OrgRoam")
org-capture-templates '(("t" "Quick Todo" entry (file +org-capture-todo-file) 
"* TODO %^{Task}\nSCHEDULED: %t\n"
  :immediate-finish t)
 ("T" "Todo" entry (file +org-capture-todo-file) "* 
TODO %?\n %i\n")
 ("n" "Quick Note" entry (file +org-capture-notes-file) 
"* %^{Note}\n" :immediate-finish t)
 ("N" "Note" entry (file +org-capture-notes-file) "* 
%?\n %i\n"))
org-roam-node-display-template "${title:*} ${tags:10}"
org-persist-after-read-hook '(org-element--cache-persist-after-read)
org-refile-targets '((nil :maxlevel . 5) (org-agenda-files :maxlevel . 5))
org-export-before-parsing-hook '(org-attach-expand-links)
org-cycle-tab-first-hook '(+org-yas-expand-maybe-h +org-indent-maybe-h 
org-babel-hide-result-toggle-maybe
org-babel-header-arg-expand 
+org-clear-babel-results-h +org-cycle-only-current-subtree-h)
org-tag-alist '(("grading" . 103) ("important" . 105) ("dept" . 100) ("cmte" . 
99))
org-default-notes-file "~/SynologyDrive/OrgRoam/inbox.org"
org-roam-find-file-hook 
'(doom--setq-org-id-link-to-org-use-id-for-org-roam-find-file-h 
org-roam-buffer--setup-redisplay-h
   org-roam--register-completion-functions-h 
org-roam--replace-roam-links-on-save-h
   org-roam-db-autosync--setup-update-on-save-h 
+org-roam-enable-auto-backlinks-buffer-h)
org-refile-use-outline-path 'file
org-archive-hook '(org-attach-archive-delete-maybe)
org-cite-follow-processor 'citar
org-file-apps '((remote . emacs) ("\\.pdf\\'" . default) (directory . emacs) 
(auto-mode . emacs) ("\\.mm\\'" . default)
 ("\\.x?html?\\'" . default) ("\\.xls\\'" . default) 
("\\.xlsm\\'" . default) ("\\.xlsx\\'" . default)
 ("\\.docx\\'" . default) ("\\.doc\\'" . default))
org-cycle-hook '(org-cycle-hide-archived-subtrees org-cycle-show-empty-lines
  org-cycle-optimize-window-after-visibility-change 
org-cycle-display-inline-images)
org-persist-before-read-hook '(org-element--cache-persist-before-read)
org-font-lock-set-keywords-hook '(doom-themes-enable-org-fontification)
org-modules '(ol-bibtex)
org-image-actual-width nil
org-atta

Re: [PATCH] Add buffer-local setting to request specific ESS process/session name (was: [PATCH] Set Python shell in Org edit buffer)

2024-01-30 Thread Martin Maechler
> Ihor Radchenko 
> on Mon, 22 Jan 2024 12:13:15 + writes:

> "Sparapani, Rodney"  writes:
>> I’ve test that and it works for me per your prescription
>> below.  And, I have committed it to the ESS git repo.

> Thank you!  May I know which version of ESS will have this
> commit?

The Melpa version that was just released, does.

As you probably know more than me about emacs package
maintenance and release cycles: 
Do you think we should also try to get a  Melpa-stable release?

Is the wording we have about MELPA in
   
https://ess.r-project.org/Manual/readme.html#Installing-from-a-third_002dparty-repository
satisfactory?

Thank you, Ihor, for your contributions!

Best,
Martin

--
Martin Maechler
ETH Zurich, Switzerland




[BUG] org-highlight-latex-and-related naive + script renders links improperly

2024-01-30 Thread Michael Klooss

Hello,

I have encountered following bug when I set =native= and =script= in 
=org-highlight-latex-and-related=:

Expected behaviour: Links are displayed as before.
Actual behaviour: If a link contains an underscore (which is quite
common), then a "subscript" is displayed as part of the link.

Example: The link

[[https://en.wikipedia.org/wiki/Harmonic_series_(mathematics)][Text]]

is rendered as

_seriesLinkb

with a small "s", and "_series" and "Text" fontified differently, but 
all of it is still recognized as the link (e.g., highlighted and 
clickable on mouseover).


Tested on Debian Testing with emacs -Q where:
Emacs  : GNU Emacs 29.1 (build 1, x86_64-pc-linux-gnu, GTK+ Version 
3.24.38, cairo version 1.16.0)

 of 2023-08-30, modified by Debian
Package: Org mode version 9.6.6 (release_9.6.6 @ 
/usr/share/emacs/29.1/lisp/org/)


Additional info:
The bug does not seem to occur when =latex= and =script= is used (but 
=native= looks better, so I would like to keep it).
Considering the much improved readability 
=org-highlight-latex-and-related= gives for documents with latex mixed 
in, the malformed link rendering is not a major problem, but confusing 
nonetheless. So it would be nice if this could be fixed.


Thank you and best,
Michael


OpenPGP_0x3B635BCF7240FEA4.asc
Description: OpenPGP public key


OpenPGP_signature.asc
Description: OpenPGP digital signature


[BUG] tag alignment breaks when headings have links [9.6.15 (release_9.6.15 @ /opt/homebrew/Cellar/emacs-plus@29/29.2/share/emacs/29.2/lisp/org/)]

2024-01-30 Thread Peter Solodov
Reproduction steps:

* no site config loaded, using bundled org-mode
* sample org file below (deadline/scheduled must have a repeater and a link):

 * TODO test [[http://foo][bar]] :FOO:bar:
 DEADLINE: <2024-01-21 Sun ++1d>

* tags column set to 40 (but happens with negative values too)
* change todo state of this heading *in agenda*
* tags are no longer alingned correctly

 * TODO test [[http://foo][bar]] :FOO:bar:
 DEADLINE: <2024-01-22 Mon ++1d>

Changing changing todo state of the heading in the file directly doesn't
break tag alignment, it only happens from agenda.


Emacs  : GNU Emacs 29.2 (build 1, aarch64-apple-darwin23.2.0, NS appkit-2487.30 
Version 14.2.1 (Build 23C71))
of 2024-01-20
Package: Org mode version 9.6.15 (release_9.6.15 @ 
/opt/homebrew/Cellar/emacs-plus@29/29.2/share/emacs/29.2/lisp/org/)

current state:
==
(setq
org-link-elisp-confirm-function 'yes-or-no-p
org-bibtex-headline-format-function #[257 "\300\236A\207" [:title] 3 "\n\n(fn 
ENTRY)"]
org-agenda-files '("/Users/peter/test.org")
org-persist-after-read-hook '(org-element--cache-persist-after-read)
org-export-before-parsing-hook '(org-attach-expand-links)
org-cycle-tab-first-hook '(org-babel-hide-result-toggle-maybe 
org-babel-header-arg-expand)
org-archive-hook '(org-attach-archive-delete-maybe)
org-cycle-hook '(org-cycle-hide-archived-subtrees org-cycle-show-empty-lines 
org-cycle-optimize-window-after-visibility-change
  org-cycle-display-inline-images)
org-persist-before-read-hook '(org-element--cache-persist-before-read)
org-mode-hook '(#[0 "\300\301\302\303\304$\207" [add-hook 
change-major-mode-hook org-fold-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-babel-load-languages '((emacs-lisp . t) (shell . t))
org-confirm-shell-link-function 'yes-or-no-p
outline-isearch-open-invisible-function 'outline-isearch-open-invisible
org-agenda-before-write-hook '(org-agenda-add-entry-text)
org-src-mode-hook '(org-src-babel-configure-edit-buffer 
org-src-mode-configure-edit-buffer)
org-confirm-elisp-link-function 'yes-or-no-p
org-speed-command-hook '(org-speed-command-activate 
org-babel-speed-command-activate)
org-persist-directory 
"/var/folders/nj/yq0sk71n10s13m2570pwfb04gn/T/org-persist-Hgi4ea"
org-fold-core-isearch-open-function 'org-fold-core--isearch-reveal
org-persist-before-write-hook '(org-element--cache-persist-before-write)
org-tab-first-hook '(org-babel-hide-result-toggle-maybe 
org-babel-header-arg-expand)
org-link-shell-confirm-function 'yes-or-no-p
org-babel-pre-tangle-hook '(save-buffer)
org-agenda-loop-over-headlines-in-active-region nil
org-occur-hook '(org-first-headline-recenter)
org-metadown-hook '(org-babel-pop-to-session-maybe)
org-link-parameters '(("attachment" :follow org-attach-follow :complete 
org-attach-complete-link) ("id" :follow org-id-open)
   ("eww" :follow org-eww-open :store org-eww-store-link) 
("rmail" :follow org-rmail-open :store org-rmail-store-link)
   ("mhe" :follow org-mhe-open :store org-mhe-store-link)
   ("irc" :follow org-irc-visit :store org-irc-store-link 
:export org-irc-export)
   ("info" :follow org-info-open :export org-info-export 
:store org-info-store-link :insert-description
org-info-description-as-command)
   ("gnus" :follow org-gnus-open :store org-gnus-store-link)
   ("docview" :follow org-docview-open :export 
org-docview-export :store org-docview-store-link)
   ("bibtex" :follow org-bibtex-open :store 
org-bibtex-store-link)
   ("bbdb" :follow org-bbdb-open :export org-bbdb-export 
:complete org-bbdb-complete-link :store org-bbdb-store-link)
   ("w3m" :store org-w3m-store-link) ("doi" :follow 
org-link-doi-open :export org-link-doi-export) ("file+sys")
   ("file+emacs") ("shell" :follow org-link--open-shell)
   ("news" :follow #[514 "\301\300\302Q\"\207" ["news" 
browse-url ":"] 6 "\n\n(fn URL ARG)"])
   ("mailto" :follow #[514 "\301\300\302Q\"\207" ["mailto" 
browse-url ":"] 6 "\n\n(fn URL ARG)"])
   ("https" :follow #[514 "\301\300\302Q\"\207" ["https" 
browse-url ":"] 6 "\n\n(fn URL ARG)"])
   ("http" :follow #[514 "\301\300\302Q\"\207" ["http" 
browse-url ":"] 6 "\n\n(fn URL ARG)"])
   ("ftp" :follow #[514 "\301\300\302Q\"\207" ["ftp" 
browse-url ":"] 6 "\n\n(fn URL ARG)"])
   ("help" :follow org-link--open-help :store 
org-link--store-help) ("file" :complete org-link-complete-file)
   ("elisp" :follow org-link--open-elisp))
org-metaup-hook '(org-babel-load-in-session-

[BUG] tag alignment breaks when headings have links [9.6.15 (release_9.6.15 @ /opt/homebrew/Cellar/emacs-plus@29/29.2/share/emacs/29.2/lisp/org/)]

2024-01-30 Thread Peter Solodov
Reproduction steps:

* no site config loaded, using bundled org-mode
* sample org file below (deadline/scheduled must have a repeater and a link):

  * TODO test [[http://foo][bar]] :FOO:bar:
  DEADLINE: <2024-01-21 Sun ++1d>

* tags column set to 40 (but happens with negative values too)
* change todo state of this heading *in agenda*
* tags are no longer alingned correctly

  * TODO test [[http://foo][bar]] :FOO:bar:
  DEADLINE: <2024-01-22 Mon ++1d>

Changing changing todo state of the heading in the file directly doesn't
break tag alignment, it only happens from agenda.


Emacs  : GNU Emacs 29.2 (build 1, aarch64-apple-darwin23.2.0, NS appkit-2487.30 
Version 14.2.1 (Build 23C71))
of 2024-01-20
Package: Org mode version 9.6.15 (release_9.6.15 @ 
/opt/homebrew/Cellar/emacs-plus@29/29.2/share/emacs/29.2/lisp/org/)

current state:
==
(setq
org-link-elisp-confirm-function 'yes-or-no-p
org-bibtex-headline-format-function #[257 "\300\236A\207" [:title] 3 "\n\n(fn 
ENTRY)"]
org-agenda-files '("/Users/peter/test.org")
org-persist-after-read-hook '(org-element--cache-persist-after-read)
org-export-before-parsing-hook '(org-attach-expand-links)
org-cycle-tab-first-hook '(org-babel-hide-result-toggle-maybe 
org-babel-header-arg-expand)
org-archive-hook '(org-attach-archive-delete-maybe)
org-cycle-hook '(org-cycle-hide-archived-subtrees org-cycle-show-empty-lines 
org-cycle-optimize-window-after-visibility-change
  org-cycle-display-inline-images)
org-persist-before-read-hook '(org-element--cache-persist-before-read)
org-mode-hook '(#[0 "\300\301\302\303\304$\207" [add-hook 
change-major-mode-hook org-fold-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-babel-load-languages '((emacs-lisp . t) (shell . t))
org-confirm-shell-link-function 'yes-or-no-p
outline-isearch-open-invisible-function 'outline-isearch-open-invisible
org-agenda-before-write-hook '(org-agenda-add-entry-text)
org-src-mode-hook '(org-src-babel-configure-edit-buffer 
org-src-mode-configure-edit-buffer)
org-confirm-elisp-link-function 'yes-or-no-p
org-speed-command-hook '(org-speed-command-activate 
org-babel-speed-command-activate)
org-persist-directory 
"/var/folders/nj/yq0sk71n10s13m2570pwfb04gn/T/org-persist-Hgi4ea"
org-fold-core-isearch-open-function 'org-fold-core--isearch-reveal
org-persist-before-write-hook '(org-element--cache-persist-before-write)
org-tab-first-hook '(org-babel-hide-result-toggle-maybe 
org-babel-header-arg-expand)
org-link-shell-confirm-function 'yes-or-no-p
org-babel-pre-tangle-hook '(save-buffer)
org-agenda-loop-over-headlines-in-active-region nil
org-occur-hook '(org-first-headline-recenter)
org-metadown-hook '(org-babel-pop-to-session-maybe)
org-link-parameters '(("attachment" :follow org-attach-follow :complete 
org-attach-complete-link) ("id" :follow org-id-open)
   ("eww" :follow org-eww-open :store org-eww-store-link) 
("rmail" :follow org-rmail-open :store org-rmail-store-link)
   ("mhe" :follow org-mhe-open :store org-mhe-store-link)
   ("irc" :follow org-irc-visit :store org-irc-store-link 
:export org-irc-export)
   ("info" :follow org-info-open :export org-info-export 
:store org-info-store-link :insert-description
org-info-description-as-command)
   ("gnus" :follow org-gnus-open :store org-gnus-store-link)
   ("docview" :follow org-docview-open :export 
org-docview-export :store org-docview-store-link)
   ("bibtex" :follow org-bibtex-open :store 
org-bibtex-store-link)
   ("bbdb" :follow org-bbdb-open :export org-bbdb-export 
:complete org-bbdb-complete-link :store org-bbdb-store-link)
   ("w3m" :store org-w3m-store-link) ("doi" :follow 
org-link-doi-open :export org-link-doi-export) ("file+sys")
   ("file+emacs") ("shell" :follow org-link--open-shell)
   ("news" :follow #[514 "\301\300\302Q\"\207" ["news" 
browse-url ":"] 6 "\n\n(fn URL ARG)"])
   ("mailto" :follow #[514 "\301\300\302Q\"\207" ["mailto" 
browse-url ":"] 6 "\n\n(fn URL ARG)"])
   ("https" :follow #[514 "\301\300\302Q\"\207" ["https" 
browse-url ":"] 6 "\n\n(fn URL ARG)"])
   ("http" :follow #[514 "\301\300\302Q\"\207" ["http" 
browse-url ":"] 6 "\n\n(fn URL ARG)"])
   ("ftp" :follow #[514 "\301\300\302Q\"\207" ["ftp" 
browse-url ":"] 6 "\n\n(fn URL ARG)"])
   ("help" :follow org-link--open-help :store 
org-link--store-help) ("file" :complete org-link-complete-file)
   ("elisp" :follow org-link--open-elisp))
org-metaup-hook '(org-babel-load-in-sess

[BUG] Timezone is inserted in middle of range [9.7 (9.7-??-e90a8a69a)]

2024-01-30 Thread Zaz
When I set Org to include the timezone in the timestamp and schedule a
task for 17:00-18:00, the correct format appears in the autocompletion,
"17:00-18:00 EST"; but when I press enter, the timezone is inserted in
the middle: "17:00 EST-18:00", which is not parsed correctly by Org agenda.




Minimal Doom configuration:

`init.el`:

```
(doom! :lang
   org)
```

`config.el`:

```
(after! org
(setq org-time-stamp-formats '("<%Y-%m-%d %a>" . "<%Y-%m-%d %a
%H:%M %Z>")))
```



Emacs  : GNU Emacs 29.1
Package: Org mode version 9.7 (9.7-??-e90a8a69a)



org-store-link modifies readonly-buffer

2024-01-30 Thread Tennyson Bardwell
Hi org-mode devs,

My apologies for the sparse & trivial bug report.

It seems as though =org-store-link= does not respect the "readonly" part of
read-only buffers. I noticed it myself[1], found a bug report on
stackexchange[2], and did not see the appropriate check in the code[3].

If this is unintended, I would be happy to try to submit a PR. I have not
yet contributed to any emacs ecosystem, so I would be slow & bad at this,
but happy to try.

🌸
Tennyson

[1]
Evil spacemacs, heavily customized

[2]
https://emacs.stackexchange.com/questions/79220/how-to-ignore-buffer-read-only-when-archiving-subtrees-in-org-mode

[3]
- https://github.com/bzg/org-mode/blob/main/lisp/ol.el#L1687-L1703
-
https://github.com/bzg/org-mode/blob/9183e3c723b812360d1042196416d521db590e9f/lisp/ol.el#L1687-L1703


[BUG] Face of Org block ending line (org-block-end-line) propagates to next line. [9.6.6 (release_9.6.6 @ /usr/share/emacs/29.1/lisp/org/)]

2024-01-30 Thread Kostas Papadakis

Summary: The face org-block-end-line is propagating to the next line
causing graphic anomalies when it's customized with anything like
background, underline, overline etc.

How to reproduce:
Start a new Emacs instance with the command "emacs -Q".
Issue find-file and create a new org file buffer and insert
just the following two lines of text (i.e. an empty source block):
#+begin_src
#+end_src

Place the cursor at the end of the 2nd line (which should also be the
last character in the buffer), i.e like here:
#+end_src[_]

And issue the describe-face command. You will notice it's using the
default face. Now run the open-line command (C-o by default) in order to
insert a new line below, and rerun the describe-face from the same
cursor position. You will notice now that we get the org-block-end-line
face (which is in accordance to how the face org-block-begin-line is
working). So far so good. Now from this same position press the Enter
key. This should move the cursor to the start of the third line of our
buffer. Now issue the describe-face command again. You will notice that
the org-block-end-line face still applies on the new line (while the
right face here would be the default). If we start writing something on
the third line, the org-block-end-line face goes away and default face
comes in, "fixing" the issue.

Now this is becoming really annoying when you have a theme that you
customize org-block-end-line with :extend t and anything like
:background, :box, :underline, :overline. The face would propagate on
the next line, and create ugly artifacts on the screen.



Emacs  : GNU Emacs 29.1 (build 2, x86_64-pc-linux-gnu, X toolkit, cairo version 
1.16.0, Xaw3d scroll bars)
 of 2023-08-30, modified by Debian
Package: Org mode version 9.6.6 (release_9.6.6 @ 
/usr/share/emacs/29.1/lisp/org/)

current state:
==
(setq
 org-link-elisp-confirm-function 'yes-or-no-p
 org-bibtex-headline-format-function #[257 "\300\236A\207" [:title] 3 "\n\n(fn 
ENTRY)"]
 org-persist-after-read-hook '(org-element--cache-persist-after-read)
 org-export-before-parsing-hook '(org-attach-expand-links)
 org-cycle-tab-first-hook '(org-babel-hide-result-toggle-maybe
org-babel-header-arg-expand)
 org-archive-hook '(org-attach-archive-delete-maybe)
 org-cycle-hook '(org-cycle-hide-archived-subtrees org-cycle-show-empty-lines
  org-cycle-optimize-window-after-visibility-change
  org-cycle-display-inline-images)
 org-persist-before-read-hook '(org-element--cache-persist-before-read)
 org-mode-hook '(#[0 "\300\301\302\303\304$\207"
   [add-hook change-major-mode-hook org-fold-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-confirm-shell-link-function 'yes-or-no-p
 outline-isearch-open-invisible-function 'outline-isearch-open-invisible
 org-agenda-before-write-hook '(org-agenda-add-entry-text)
 org-src-mode-hook '(org-src-babel-configure-edit-buffer
 org-src-mode-configure-edit-buffer)
 org-confirm-elisp-link-function 'yes-or-no-p
 org-speed-command-hook '(org-speed-command-activate
  org-babel-speed-command-activate)
 org-persist-directory "/tmp/org-persist-NEwgDE"
 org-fold-core-isearch-open-function 'org-fold--isearch-reveal
 org-persist-before-write-hook '(org-element--cache-persist-before-write)
 org-tab-first-hook '(org-babel-hide-result-toggle-maybe
  org-babel-header-arg-expand)
 org-link-shell-confirm-function 'yes-or-no-p
 org-babel-pre-tangle-hook '(save-buffer)
 org-agenda-loop-over-headlines-in-active-region nil
 org-occur-hook '(org-first-headline-recenter)
 org-metadown-hook '(org-babel-pop-to-session-maybe)
 org-link-parameters '(("attachment" :follow org-attach-follow :complete
org-attach-complete-link)
   ("id" :follow org-id-open)
   ("eww" :follow org-eww-open :store org-eww-store-link)
   ("rmail" :follow org-rmail-open :store
org-rmail-store-link)
   ("mhe" :follow org-mhe-open :store org-mhe-store-link)
   ("irc" :follow org-irc-visit :store org-irc-store-link
:export org-irc-export)
   ("info" :follow org-info-open :export org-info-export
:store org-info-store-link :insert-description
org-info-description-as-command)
   ("gnus" :follow org-gnus-open :store
org-gnus-store-link)
   ("docview" :follow org-docview-open :export
  

Re: [BUG] Child's visibility property is overridden by parent's [9.5.2 (9.5.2-gbc8c3e @ /home/john/.emacs.d/straight/build/org/)

2024-01-30 Thread Ihor Radchenko
Ihor Radchenko  writes:

> I would say that the existing behaviour is a confusing and might be
> considered as a bug. However, it may not always be straightforward how
> to deal with different combinations of VISIBILITY setting for
> ancestor/descendent headings. Consider the following example:
>
> * Foo
> :PROPERTIES:
> :VISIBILITY: folded
> :END:
> ** Bar
> :PROPERTIES:
> :VISIBILITY: content
> :END:
> *** Baz
>
> Foo is supposed to be folded, but it is unclear how to process Bar.
> Should Bar's contents be visible? Should it be folded?

My conclusion is that Bar should be visible. This will be consistent
with how VISIBILITY overrides document-wide STARTUP settings.

Also, the comment in one of Org tests I was concerned about was
inaccurate - it tested for a slightly different bug.

Fixed, on main.
https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=a5c977b43

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



Re: [BUG] Timezone is inserted in middle of range [9.7 (9.7-??-e90a8a69a)]

2024-01-30 Thread Ihor Radchenko
Zaz  writes:

> When I set Org to include the timezone in the timestamp and schedule a
> task for 17:00-18:00, the correct format appears in the autocompletion,
> "17:00-18:00 EST"; but when I press enter, the timezone is inserted in
> the middle: "17:00 EST-18:00", which is not parsed correctly by Org agenda.

> ...

> (after! org
> (setq org-time-stamp-formats '("<%Y-%m-%d %a>" . "<%Y-%m-%d %a
> %H:%M %Z>")))

Changing `org-time-stamp-formats' constant is not supported by Org mode.
It may or may not work.
Not a bug.
Canceled.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



Re: org-store-link modifies readonly-buffer

2024-01-30 Thread Ihor Radchenko
Tennyson Bardwell  writes:

> It seems as though =org-store-link= does not respect the "readonly" part of
> read-only buffers. I noticed it myself[1], found a bug report on
> stackexchange[2], and did not see the appropriate check in the code[3].
>
> If this is unintended, I would be happy to try to submit a PR. I have not
> yet contributed to any emacs ecosystem, so I would be slow & bad at this,
> but happy to try.

Confirmed.
This is intended, with the main purpose of not barfing with error when
users call `org-store-link' in read-only *Org goto* indirect buffers.

More generally, Org mode handling of read-only state is rather
inconsistent. We have a number of places that do ignore read-only and a
number of places that don't.

I do believe that the right things to do is respecting read-only state
with an exception to *Org goto* buffers (or maybe other buffers that we
should explicitly mark). But doing so might break user workflows.
We need to carefully study various instances where Org mode ignores
read-only state to decide what is the best course of action.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



Re: [BUG] org-highlight-latex-and-related naive + script renders links improperly

2024-01-30 Thread Ihor Radchenko
Michael Klooss  writes:

> I have encountered following bug when I set =native= and =script= in 
> =org-highlight-latex-and-related=:
> Expected behaviour: Links are displayed as before.
> Actual behaviour: If a link contains an underscore (which is quite
> common), then a "subscript" is displayed as part of the link.
>
> Example: The link
>
> [[https://en.wikipedia.org/wiki/Harmonic_series_(mathematics)][Text]]
>
> is rendered as
>
> _seriesLinkb

Confirmed.
Yet another bug caused by approximate fontification based on regexps
rather than on Org parser.
See https://list.orgmode.org/87ee7c9quk.fsf@localhost/

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



Re: [BUG] tag alignment breaks when headings have links [9.6.15 (release_9.6.15 @ /opt/homebrew/Cellar/emacs-plus@29/29.2/share/emacs/29.2/lisp/org/)]

2024-01-30 Thread Ihor Radchenko
Peter Solodov  writes:

> Reproduction steps:
>
> * no site config loaded, using bundled org-mode
> * sample org file below (deadline/scheduled must have a repeater and a link):
>
>   * TODO test [[http://foo][bar]] :FOO:bar:
>   DEADLINE: <2024-01-21 Sun ++1d>
>
> * tags column set to 40 (but happens with negative values too)
> * change todo state of this heading *in agenda*
> * tags are no longer alingned correctly
>
>   * TODO test [[http://foo][bar]] :FOO:bar:
>   DEADLINE: <2024-01-22 Mon ++1d>
>
> Changing changing todo state of the heading in the file directly doesn't
> break tag alignment, it only happens from agenda.

Thanks for reporting!
Fixed, on bugfix.
https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=7de8b3917

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



Re: [BUG] tag alignment breaks when headings have links [9.6.15 (release_9.6.15 @ /opt/homebrew/Cellar/emacs-plus@29/29.2/share/emacs/29.2/lisp/org/)]

2024-01-30 Thread Ihor Radchenko
Peter Solodov  writes:

> Reproduction steps:

Duplicate of
https://orgmode.org/list/413c89c3-25db-425b-a367-fa683e7ad...@gmail.com
Canceled.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



Re: An academic journal made entirely in Org-Mode

2024-01-30 Thread Pedro Andres Aranda Gutierrez
Wow! Biggest round of applause :-)

Congrats!, /PA

-- 
Fragen sind nicht da, um beantwortet zu werden,
Fragen sind da um gestellt zu werden
Georg Kreisler

Headaches with a Juju log:
unit-basic-16: 09:17:36 WARNING juju.worker.uniter.operation we should run
a leader-deposed hook here, but we can't yet


Re: [BUG] repeated warnings about org-element-at-point "cannot be used in non-Org buffer" [9.7 (9.7-??-57b94f3 @ /Users/cstevens/.emacs.d/.local/straight/build-29.2/org/)]

2024-01-30 Thread Ihor Radchenko
Christopher Stevenson  writes:

> I get these warnings about org-element when I am in non-org files; the
> main ones that come to mind are JavaScript files and in magit when I am
> doing a commit. They don't seem to break anything but it does get
> annoying to have to constantly dismiss them.

These warnings indicate that some of your packages or customization
causes `org-element-at-point' to be executed in non-Org buffer.
`org-element-at-point' does not have a defined behaviour in non-Org
buffers and may cause random errors.

If you can narrow down the caller of `org-element-at-point', I suggest
you to report the observed behaviour as a bug (if that is a third-party
package).

Otherwise, you may suppress the Org warning.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



Re: Connecting to an Already Running Scheme REPL with org-babel

2024-01-30 Thread Hunter Jozwiak
Ihor Radchenko  writes:

> Hunter Jozwiak  writes:
>
 + (host (cdr (assq :host params)))
 + (port (cdr (assq :port params)))
>>>
>>> Please declare these new scheme-specific header argument in
>>> `org-babel-header-args:scheme'.
>>> See `org-babel-header-args:C' for an example.
>>> This is necessary for header argument completion to work.
>
>> Okay. Is there a way to tighten these inputs further? I have them set to
>> :any for the moment, but I wonder if there is a way to leverage the
>> values for `geiser-repl-default-host` and `geiser-repl-default-port`.
>
> Org-mode currently does not provide completion for header argument
> values. (see `pcomplete/org-mode/block-option/src')
>
> If Org were to support such completion, you could theoretically allow
> special values for :host/:port like default:
>
> #+begin_src scheme :host default :port default
> ...
> #+end_src
>
> to use `geiser-repl-default-host'/`...-port'.
>
> Then, you could add these values as (default :any).
>
 - (and (not (string= session "none")) session ; session
 + (and (not (string= session "none")) session)  host port))) ; 
 session
>>>
>>> This does not look right. Your change will disable session support
>>> completely when host and port are not provided.
>> Is there a way to test this and pinpoint the problem?
>
> Hmm. I just realized that I am reading that line wrongly - host and port
> are additional arguments passed to
> `org-babel-scheme-execute-with-geiser', not a part of
> (and (not ...) host port)
>
> So, my only comment remaining is to put each argument in its own line,
> like it is done for all the previous arguments:
>
> (org-babel-scheme-execute-with-geiser
>  full-body   ; code
>  (string= result-type "output")  ; output?
>  impl; implementation
>  (and (not (string= session "none")) session) ; session
>host ; repl host name
>port) ; repl port
>
> That will make the code more readable.

Here is an updated patch.

From ff82afda9b862a7899abf10b7d1a4cde3c1d5314 Mon Sep 17 00:00:00 2001
From: Hunter Jozwiak 
Date: Sun, 28 Jan 2024 21:48:05 -0500
Subject: [PATCH] org-mode: allow ob-scheme to accept a remote connection.

* lisp/org/ob-scheme.el (org-babel-scheme-get-repl): introduce two
optional variables  host  and port. If there are not given, just run
Geiser as before. In the case when  both are given, connect to the
remotely running Scheme process.
* lisp/org/ob-scheme (org-babel-scheme-execute-with-geiser,
org-babel-execute:scheme): take these  optional arguments into account.
* lisp/org/ob-scheme.el (org-babel-header-args:scheme): define host
and port for completion.
---
 lisp/org/ob-scheme.el | 27 +++
 1 file changed, 19 insertions(+), 8 deletions(-)

diff --git a/lisp/org/ob-scheme.el b/lisp/org/ob-scheme.el
index d13b975084c..4a214b222eb 100644
--- a/lisp/org/ob-scheme.el
+++ b/lisp/org/ob-scheme.el
@@ -1,4 +1,4 @@
-;;; ob-scheme.el --- Babel Functions for Scheme  -*- lexical-binding: t; -*-
+;; ob-scheme.el --- Babel Functions for Scheme  -*- lexical-binding: t; -*-
 
 ;; Copyright (C) 2010-2024 Free Software Foundation, Inc.
 
@@ -54,7 +54,7 @@ geiser-debug-show-debug-p
 (defvar geiser-debug-jump-to-debug-p)  ; Defined in geiser-debug.el
 (defvar geiser-repl-use-other-window)  ; Defined in geiser-repl.el
 (defvar geiser-repl-window-allow-split)	; Defined in geiser-repl.el
-
+(declare-function geiser-connect "ext:geiser-repl" (impl &optional host port))
 (declare-function run-geiser "ext:geiser-repl" (impl))
 (declare-function geiser "ext:geiser-repl" (impl))
 (declare-function geiser-mode "ext:geiser-mode" ())
@@ -75,6 +75,9 @@ org-babel-scheme-null-to
 
 (defvar org-babel-default-header-args:scheme '()
   "Default header arguments for scheme code blocks.")
+(defconst org-babel-header-args:scheme '((host . :any)
+ (port . :any))
+  "Header arguments supported in  Scheme.")
 
 (defun org-babel-expand-body:scheme (body params)
   "Expand BODY according to PARAMS, return the expanded body."
@@ -116,13 +119,17 @@ org-babel-scheme-get-buffer-impl
   (with-current-buffer (set-buffer buffer)
 geiser-impl--implementation))
 
-(defun org-babel-scheme-get-repl (impl name)
-  "Switch to a scheme REPL, creating it if it doesn't exist."
+(defun org-babel-scheme-get-repl (impl name &optional host port)
+  "Switch to a scheme REPL, creating it if it doesn't exist.
+
+If the variables host and port are set, connect to the running Scheme REPL."
   (let ((buffer (org-babel-scheme-get-session-buffer name)))
 (or buffer
 	(progn
   (if (fboundp 'geiser)
-  (geiser impl)
+  (if (and host port)
+  (geiser-connect impl host port)
+(geiser impl))
 ;; Obsolete since Geiser 0.26.
 	(run-geiser impl))

Re: Connecting to an Already Running Scheme REPL with org-babel

2024-01-30 Thread Ihor Radchenko
Hunter Jozwiak  writes:

> Here is an updated patch.

Applied, onto main, with minor amendments and adding TINYCHANGE cookie
(you don't seem to have copyright assignment; see
https://orgmode.org/worg/org-contribute.html#first-patch).

https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=86c4038da

Thanks for your contribution!
You are now listed as one of Org mode contributors:
https://git.sr.ht/~bzg/worg/commit/07c4796e

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



Re: Connecting to an Already Running Scheme REPL with org-babel

2024-01-30 Thread Ihor Radchenko
Hunter Jozwiak  writes:

> From 2dc78a7edbbe38614a5f7fafa2c295f52528f04d Mon Sep 17 00:00:00 2001
> From: Hunter Jozwiak 
> Date: Mon, 29 Jan 2024 12:48:41 -0500
> Subject: [PATCH] ob-scheme: document  the new header arguments.
>
> * org-contrib/babel/languages/ob-doc-scheme.org (header-arguments):
> note the  new options :host and :port.
> ---
>  org-contrib/babel/languages/ob-doc-scheme.org | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)

Applied.
https://git.sr.ht/~bzg/worg/commit/8b7824b4

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



#6 [[bbb:OrgMeetup]] on Wed, Feb 14, 19:00 UTC+3

2024-01-30 Thread Ihor Radchenko
Dear all,

Another OrgMeetup will be scheduled on the second Wednesday of February,
in two weeks.

Previous meetup notes:
https://list.orgmode.org/87fryho22t.fsf@localhost/T/#u

URL: https://bbb.emacsverse.org/b/iho-h7r-qg8-led
Time & Date: <2024-02-14 Wed 19:00-21:00 @+03,Europe/Istanbul>
The room will be open half an hour before the official start.

During the meetup, we can:

- Give advice to new users
- Showcase Org configs or workflows
- Demo/discuss interesting packages
- Troubleshoot each-other's issues
- Discuss Org mode development
- Discuss "Org mode" section of Emacs news (https://sachachua.com/blog/)
- Discuss anything else Org-related

Everyone is free to join the discussion/chat or lurk around silently,
listening.

We will _not_ do any recording by default.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



Re: Org mode code evaluation (was: bug#68687: [PATCH] Use text/org media type)

2024-01-30 Thread Ihor Radchenko
Mike Kupfer  writes:

> I can believe that Org text snippets are safe in an email MUA.  

That's exactly what I wanted to emphasize.

> But in the general case, I don't think Org mode is quite as safe as you
> implied.

I did not imply that Org mode is safe. I directly said that there are
security issues and that they are known.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



Re: bug#68687: [PATCH] Use text/org media type

2024-01-30 Thread Stefan Kangas
Ihor Radchenko  writes:

> I see using text/org as an improvement. text/x-org is likely useless.
> At least,
> https://github.com/jeremy-compostella/org-msg/blob/master/org-msg.el
> uses text/org, which may appear in email parts.
>
> However, AFAIU, text/org will fall into "standards tree" in IANA media
> type specification, which means that it MUST be registered, as described
> in https://www.rfc-editor.org/rfc/rfc6838.html#section-3.1
>
> Registering text/org media type requires syntax spec. We are
> still working on format Org mode syntax specifications. See
> https://list.orgmode.org/orgmode/871rjhha8t@gmail.com/ and
> https://orgmode.org/worg/org-syntax.html
>
> The spec is still not fully finalized, so we are not yet initiating the
> registration, as we will need to repeat it again if we decide to make
> further changes (https://www.rfc-editor.org/rfc/rfc6838.html#section-5.5)

What does this mean with regards to the patch?  Should we wait with
installing it until that process is done?



How to update to the last orgmode version

2024-01-30 Thread ypuntot
I need to update orgmode to the version 9.7.
Could you please help me with some links or instructions?

Best!


Re: How to update to the last orgmode version

2024-01-30 Thread Ihor Radchenko
ypuntot  writes:

> I need to update orgmode to the version 9.7.
> Could you please help me with some links or instructions?

https://orgmode.org/manual/Installation.html

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



Re: bug#68687: [PATCH] Use text/org media type

2024-01-30 Thread Ihor Radchenko
Stefan Kangas  writes:

> Ihor Radchenko  writes:
>
>> I see using text/org as an improvement. text/x-org is likely useless.
>> At least,
>> https://github.com/jeremy-compostella/org-msg/blob/master/org-msg.el
>> uses text/org, which may appear in email parts.
> ...
> What does this mean with regards to the patch?  Should we wait with
> installing it until that process is done?

I see no reason to wait.
We already have people sending text/org in emails. Recognizing mime
parts marked as text/org as we already do for text/x-org will be a
clear improvement.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



Re: How to update to the last orgmode version

2024-01-30 Thread Ypo

Hi Ihor

Can it be installed like any other elisp package?

I thought I could go using the web browser to the address showed in the 
manual:


https://git.savannah.gnu.org/git/emacs/org-mode.git

And from there to download the org-mode package, and the to load it, but 
I can't download it.


Is it necessary to build it, or to use git? This would be above my head.

Best


On 30/01/2024 21:11, Ihor Radchenko wrote:

ypuntot  writes:


I need to update orgmode to the version 9.7.
Could you please help me with some links or instructions?

https://orgmode.org/manual/Installation.html


Re: How to update to the last orgmode version

2024-01-30 Thread Ihor Radchenko
Ypo  writes:

> Can it be installed like any other elisp package?
>
> I thought I could go using the web browser to the address showed in the 
> manual:
>
> https://git.savannah.gnu.org/git/emacs/org-mode.git
>
> And from there to download the org-mode package, and the to load it, but 
> I can't download it.
>
> Is it necessary to build it, or to use git? This would be above my head.

You are asking about pre-release version of Org mode. So, git is not
unexpected.

If you absolutely want to use Emacs package system, you may consider
adding ELPA devel  (see
https://protesilaos.com/codelog/2022-05-13-emacs-elpa-devel/)
or M-x package-vc-install (in newer Emacs).

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



Re: Search and replace excluding code blocks?

2024-01-30 Thread Berry, Charles


> On Jan 29, 2024, at 3:47 PM, Vikas Rawal  wrote:
> 
> Hi all,
> 
> Is it possible to search and replace a regex/string in an org file excluding 
> the code blocks from its scope?
> 
> Say, I want to replace all opening quotes (") by backticks(``) in the text 
> but not in the code blocks. Is there a way one could achieve that?
> 

Sure, the recommended way to search and replace programmatically is given in 

(info "(elisp) Search and Replace")

Hacking that slightly to test if point is in a src block and using the double 
quote preceded by white space as the search string and replacing by that white 
space and double backticks gives:



#+begin_src elisp
  (goto-char 0)
  (while (re-search-forward "\\([[:space:]]\\)\"" nil t)
(unless (eq (org-element-type (org-element-at-point)) `src-block)
  (replace-match "\\1``")))
#+end_src

You can roll this into a function and add arguments as desired to allow 
different search/replacement strings. 

Best,

Chuck