Re: ODT export failing

2023-11-27 Thread Fraga, Eric
Hi Ihor,

On Monday, 27 Nov 2023 at 19:49, Ihor Radchenko wrote:
> AFAIU, that message is for fuzzy and id links that do not point to
> heading or target - such links are not supported.

I've had this before when the target (i.e. the label within the org
file) did not exist.  I have never seen this with a missing file, as in
pointing to ~theimage~ where

#+name: theimage
[[file:thisimagedoesnotexist]]

To solve the problem, I just had to create the file
"thisimagedoesnotexist".  I guess it is sort of the same issue as
missing link target so maybe it makes sense even though it is not an id
link or fuzzy?

> "FIXME" indicates that such feature would be welcome, but alas - not
> yet.

Understood!

thank you,
eric

-- 
: Eric S Fraga, with org release_9.6.7-661-g34ee6f in Emacs 30.0.50


Re: Citation bug with basic and nb style: no matching number on bibliographic entry

2023-11-27 Thread William Denton

Ignore this.  To make the numbering appear in the bibliography, use this:

#+cite_export: basic numeric

I'm working my way through all the combinations and will submit some patches for 
the documentation when I have it figured out more.


Bill


On 27 November 2023, William Denton wrote:

I'm trying citations with the basic processor, and have found what seems to 
be a problem with the "nb" (numeric) style: the citation has a number, but 
it's not matched to anything in the bibliography.


Try this as Basic.bib:

@book{chassellIntro,
 title = {An Introduction to Programming in {{Emacs Lisp}}},
 author = {Chassell, Robert},
 date = {2023},
 publisher = {{GNU Press}},
 location = {Boston},
 isbn = {1-882114-43-4},
 url = {https://www.gnu.org/software/emacs/manual/eintr.html},
 keywords = {emacs}
}

And this as basic.org:

# --

#+bibliography: Basic.bib

#+cite_export: basic

Emacs comes with a guide to learning Emacs Lisp [cite/nb:@chassellIntro].

* Bibliography

#+print_bibliography:

# --

Exporting to PDF, the citation becomes (1), but there's no matching number in 
the bibliography, so the citation and the source are not connected.  You 
can't connect (1) to Chassell, Robert.  (Using two sources doesn't make 
numbers suddenly appear.)


Using the CSL processor and the IEEE style (the sort of style on which I 
assume the basic nb style is based) the citation is [1] and the book is 
listed as [1] in the bibliography.



Bill

--
William Denton
https://www.miskatonic.org/
Librarian, artist and licensed private investigator.
Toronto, Canada
CO₂: 421.47 ppm (Mauna Loa Observatory, 2023-11-24)


--
William Denton
https://www.miskatonic.org/
Librarian, artist and licensed private investigator.
Toronto, Canada
CO₂: 421.47 ppm (Mauna Loa Observatory, 2023-11-24)

Getting email from MS outlook into emacs

2023-11-27 Thread Doyley, Marvin M.
Hi there,

I have been trying to configure mbsync to download email from MS Outlook.  
Unfortunately, the new oauth2 authentication makes things difficult, especially 
since my institution has disabled the Azure App permission.

Does anybody have a workaround?  I just want the email message to be linked to 
my todos, which is almost impossible.  I am working on a Mac and org-mac-link 
just hangs when I try to grab Outlook emails.


Thanks in advance for your help.

Cheers,
M

PS I have also tried Davmail, which almost worked, except my institution placed 
another roadblock.

Marvin M. Doyley, Ph.D.
Wilson Professor of Electronic Imaging
Professor and Chair of the Department of Electrical and Computer Engineering,
Professor of Biomedical Engineering
Professor Imaging Sciences,
University of Rochester
518 Computer Studies Building Rochester NY 14627
Tel: 585-275-3774 Fax: 585-273-4919
Website: http://www.ece.rochester.edu/projects/doyley_lab/




Citation bug with basic and nb style: no matching number on bibliographic entry

2023-11-27 Thread William Denton
I'm trying citations with the basic processor, and have found what seems to be a 
problem with the "nb" (numeric) style: the citation has a number, but it's not 
matched to anything in the bibliography.


Try this as Basic.bib:

@book{chassellIntro,
  title = {An Introduction to Programming in {{Emacs Lisp}}},
  author = {Chassell, Robert},
  date = {2023},
  publisher = {{GNU Press}},
  location = {Boston},
  isbn = {1-882114-43-4},
  url = {https://www.gnu.org/software/emacs/manual/eintr.html},
  keywords = {emacs}
}

And this as basic.org:

# --

#+bibliography: Basic.bib

#+cite_export: basic

Emacs comes with a guide to learning Emacs Lisp [cite/nb:@chassellIntro].

* Bibliography

#+print_bibliography:

# --

Exporting to PDF, the citation becomes (1), but there's no matching number in 
the bibliography, so the citation and the source are not connected.  You can't 
connect (1) to Chassell, Robert.  (Using two sources doesn't make numbers 
suddenly appear.)


Using the CSL processor and the IEEE style (the sort of style on which I assume 
the basic nb style is based) the citation is [1] and the book is listed as [1] 
in the bibliography.



Bill

--
William Denton
https://www.miskatonic.org/
Librarian, artist and licensed private investigator.
Toronto, Canada
CO₂: 421.47 ppm (Mauna Loa Observatory, 2023-11-24)

Re: How to get the inner boundaries of a block

2023-11-27 Thread Ihor Radchenko
Jens Schmidt  writes:

> Triggered by a recent question here on `org-in-src-block-p' and a
> current need: Is there a function already available that returns
> the *inner* boundaries of an arbitrary block element?

Nope. There is `org-src--contents-area', but it is not guaranteed to
work as it is an internal function.

> Currently, I use org element properties and some combination of
> save-excursion, forward-line, and skip-syntax-*

This is currently the way to go.

> ..., but I thought this
> could be something which is available already.  A cursory search hasn't
> brought up anything, though.

Maybe in future. Something like
https://git.sr.ht/~yantar92/org-mode/tree/feature/org-font-lock-element/item/lisp/org-element-match.el
But not yet finalized.

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



Re: [Bug] org-in-src-block-p returns t when not in source block

2023-11-27 Thread No Wayman

Ihor Radchenko  writes:


point on trailing blank line: FAIL


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


Confirmed on my end by adding `:packages* org` to the previous 
test:


Yodel[1] Report 2023-11-27 15:34:45
===

STDOUT
==

INFO Scraping files for loaddefs... 
  INFO Scraping files for loaddefs...done

  GEN  ../elpaca-autoloads.el
Cloning into '/tmp/yodel-yCfbwq/elpaca/repos/elpaca'...
Your branch is up to date with 'origin/master'.
Checking /tmp/yodel-yCfbwq/elpaca/repos/elpaca...
Compiling 
/tmp/yodel-yCfbwq/elpaca/repos/elpaca/elpaca-info.el...

Compiling /tmp/yodel-yCfbwq/elpaca/repos/elpaca/elpaca-log.el...
Compiling 
/tmp/yodel-yCfbwq/elpaca/repos/elpaca/elpaca-manager.el...
Compiling 
/tmp/yodel-yCfbwq/elpaca/repos/elpaca/elpaca-menu-elpa.el...
Compiling 
/tmp/yodel-yCfbwq/elpaca/repos/elpaca/elpaca-menu-melpa.el...
Compiling 
/tmp/yodel-yCfbwq/elpaca/repos/elpaca/elpaca-menu-org.el...
Compiling 
/tmp/yodel-yCfbwq/elpaca/repos/elpaca/elpaca-process.el...
Compiling 
/tmp/yodel-yCfbwq/elpaca/repos/elpaca/elpaca-test.el...

Compiling /tmp/yodel-yCfbwq/elpaca/repos/elpaca/elpaca-ui.el...
Compiling /tmp/yodel-yCfbwq/elpaca/repos/elpaca/elpaca.el...
Checking /tmp/yodel-yCfbwq/elpaca/repos/elpaca/doc...
Compiling 
/tmp/yodel-yCfbwq/elpaca/repos/elpaca/doc/early-init.el...

Compiling /tmp/yodel-yCfbwq/elpaca/repos/elpaca/doc/init.el...
Checking /tmp/yodel-yCfbwq/elpaca/repos/elpaca/extensions...
Compiling 
/tmp/yodel-yCfbwq/elpaca/repos/elpaca/extensions/elpaca-use-package.el...

Checking /tmp/yodel-yCfbwq/elpaca/repos/elpaca/images...
Checking /tmp/yodel-yCfbwq/elpaca/repos/elpaca/test...
Compiling 
/tmp/yodel-yCfbwq/elpaca/repos/elpaca/test/elpaca-test.el...

Done (Total of 11 files compiled, 3 skipped in 4 directories)



Downloading MELPA recipes...
Downloading MELPA recipes...100%
Downloading NonGNU-devel ELPA...
Downloading GNU-devel ELPA...
Downloading NonGNU ELPA...
Downloading GNU ELPA...
Org mode version 9.7-pre (9.7-pre-n/a-g6d7c79
 @ /tmp/yodel-yCfbwq/elpaca/builds/org/)
(org-in-source-block-p ’inside)
point on preceding blank line: PASS
point on begin_src: PASS
point between begin_src end_src: PASS
point on end_src (non-blank line after): PASS
point on end_src (blank line after): PASS
point on end_src (no line after): PASS
point on trailing blank line: PASS


Environment
===

- emacs version: GNU Emacs 30.0.50 (build 1, x86_64-pc-linux-gnu, 
 GTK+ Version 3.24.38, cairo version 1.18.0)

of 2023-11-16
- system type: gnu/linux

Packages


- elpaca 
 https://github.com/progfolio/elpaca/commit/86a562c0a7c0a009803172eb0ed55fdaf17c4559
- org 
 https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=6d7c7917a0294bb71c3294119984207b1d9b0385


[1] https://www.github.com/progfolio/yodel



Thanks again.



How to get the inner boundaries of a block

2023-11-27 Thread Jens Schmidt
Triggered by a recent question here on `org-in-src-block-p' and a
current need: Is there a function already available that returns
the *inner* boundaries of an arbitrary block element?

For the element corresponding to the block below:

#+begin_verse
^A  foo
  bar
  baz^B
#+end_verse

that function would return, for example, the pair of positions (A . B).

Currently, I use org element properties and some combination of
save-excursion, forward-line, and skip-syntax-*, but I thought this
could be something which is available already.  A cursory search hasn't
brought up anything, though.

Thanks  Jens




Re: [Bug] org-in-src-block-p returns t when not in source block

2023-11-27 Thread Ihor Radchenko
No Wayman  writes:

>> What about the attached patch?
>
> That is much clearer. Thank you.

Applied, onto main.
https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=bd7fab212

>> If you want to check if point is inside source block code, use INSIDE
>> argument.
>
> Using the INSIDE argument still appears to fail in some cases:
>
> ...
>> Org mode version 9.6.11 (release_9.6.11 @ /usr/share/emacs/30.0.50/lisp/org/)
>> (org-in-source-block-p ’inside)
>> point on preceding blank line: PASS
>> point on begin_src: PASS
>> point between begin_src end_src: PASS
>> point on end_src (non-blank line after): PASS
>> point on end_src (blank line after): PASS
>> point on end_src (no line after): FAIL

This one passed on main.

>> point on trailing blank line: FAIL

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

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



Re: [Bug] org-in-src-block-p returns t when not in source block

2023-11-27 Thread No Wayman


[Apologies for the duplicate message, Ihor. mu4e recently changed it's default
reply behavior without my noticing]

Ihor Radchenko  writes:

> This is very different from LAX argument in `org-at-timestamp-p' -
> timestamp-like text may not be proper syntactically correct Org markup
> element, but is still considered by agenda for historical and practical
> reasons.

Fair enough.
 
> What about the attached patch?

That is much clearer. Thank you.

> If you want to check if point is inside source block code, use INSIDE
> argument.

Using the INSIDE argument still appears to fail in some cases:

Yodel[1] Report 2023-11-27 14:55:05
===

--8<---cut here---start->8---
(yodel
  :post*
  (require 'org)
  (org-version nil 'full 'message)
  (message "(org-in-source-block-p 'inside)")
  (yodel-file "before.org" :point "|"
:with* "|\n#+begin_src text\ntest\n#+end_src\n"
:then* (message "point on preceding blank line: %s"
 (if (org-in-src-block-p 'inside) "FAIL" "PASS")))
  (yodel-file "begin.org" :point "|"
:with* "\n#+begin|_src text\ntest\n#+end_src\n"
:then* (message "point on begin_src: %s"
 (if (org-in-src-block-p 'inside) "FAIL" "PASS")))
  (yodel-file "in.org" :point "|"
:with* "\n#+begin_src text\nte|st\n#+end_src\n"
:then* (message "point between begin_src end_src: %s"
 (if (org-in-src-block-p 'inside) "PASS" "FAIL")))
  (yodel-file "end-non-blank.org" :point "|"
:with* "\n#+begin_src text\ntest\n#+end|_src\ntest"
:then* (message "point on end_src (non-blank line after): %s"
 (if (org-in-src-block-p 'inside) "FAIL" "PASS")))
  (yodel-file "end.org" :point "|"
:with* "\n#+begin_src text\ntest\n#+end|_src\n"
:then* (message "point on end_src (blank line after): %s"
 (if (org-in-src-block-p 'inside) "FAIL" "PASS")))
  (yodel-file "end-eobp.org" :point "|"
:with* "\n#+begin_src text\ntest\n#+end|_src"
:then* (message "point on end_src (no line after): %s"
 (if (org-in-src-block-p 'inside) "FAIL" "PASS")))
  (yodel-file "after.org" :point "|"
:with* "\n#+begin_src text\ntest\n#+end_src\n|"
:then* (message "point on trailing blank line: %s"
(if (org-in-src-block-p 'inside) "FAIL" "PASS"
--8<---cut here---end--->8---

STDOUT
==

> Org mode version 9.6.11 (release_9.6.11 @ /usr/share/emacs/30.0.50/lisp/org/)
> (org-in-source-block-p ’inside)
> point on preceding blank line: PASS
> point on begin_src: PASS
> point between begin_src end_src: PASS
> point on end_src (non-blank line after): PASS
> point on end_src (blank line after): PASS
> point on end_src (no line after): FAIL
> point on trailing blank line: FAIL

Environment
===

- emacs version: GNU Emacs 30.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version
3.24.38, cairo version 1.18.0)
 of 2023-11-16
- system type: gnu/linux

[1] https://www.github.com/progfolio/yodel



Re: [Bug] org-in-src-block-p returns t when not in source block

2023-11-27 Thread Ihor Radchenko
[ Adding Org mailing list back to CC ]

No Wayman  writes:

>> This is not a bug - Org considers blank lines after element as a 
>> part of
>> it. This includes source blocks.
>
> I would've reversed the semantics of the INSIDE argument.
> e.g.
>
> (defun org-in-src-block-p (&optional lax element)
> ...
> That's less confusing and mirrors other functions, such as 
> org-at-timestamp-p.

This is very different from LAX argument in `org-at-timestamp-p' -
timestamp-like text may not be proper syntactically correct Org markup
element, but is still considered by agenda for historical and practical
reasons.

> However, that's a breaking change, and I feel like adding another, 
> similarly named function will cause more confusion than it 
> prevents.

This too.

> ... With that in mind, the docstring could be improved.
> ...

What about the attached patch?

>From e5d5ab915eb4309082a4a274170fddc60a75c28b Mon Sep 17 00:00:00 2001
Message-ID: 
From: Ihor Radchenko 
Date: Mon, 27 Nov 2023 20:54:42 +0100
Subject: [PATCH] lisp/org.el (org-in-src-block-p): Improve docstring

* lisp/org.el (org-in-src-block-p):

Reported-by: No Wayman 
Link: https://orgmode.org/list/87il5n9owq@gmail.com
---
 lisp/org.el | 10 +++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/lisp/org.el b/lisp/org.el
index d2cd0b9b7..19887ff1e 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -18786,9 +18786,13 @@ (defun org-quote-vert (s)
   s)
 
 (defun org-in-src-block-p (&optional inside element)
-  "Whether point is in a code source block.
-When INSIDE is non-nil, don't consider we are within a source
-block when point is at #+BEGIN_SRC or #+END_SRC.
+  "Return t when point is at a source block element.
+When INSIDE is non-nil, return t only when point is between #+BEGIN_SRC
+and #+END_SRC lines.
+
+Note that affiliated keywords and blank lines after are considered a
+part of a source block.
+
 When ELEMENT is provided, it is considered to be element at point."
   (save-match-data (setq element (or element (org-element-at-point
   (when (org-element-type-p element 'src-block)
-- 
2.42.0


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


Re: ODT export failing

2023-11-27 Thread Ihor Radchenko
"Fraga, Eric"  writes:

> Ignore please.  I was trying to export an image which was in PDF; I
> thought I had changed to reference to a PNG but missed one.  Mind you,
> the error message could be a little more informative?

AFAIU, that message is for fuzzy and id links that do not point to
heading or target - such links are not supported.
For example, links to #+name'd elements are not supported by ox-odt,
from my reading of the code.

"FIXME" indicates that such feature would be welcome, but alas - not
yet.

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



Re: [Bug] org-in-src-block-p returns t when not in source block

2023-11-27 Thread Ihor Radchenko
No Wayman  writes:

> When on an empty line before a source block, org-in-src-block-p 
> correctly returns nil.
> However, when on an empty line after a source block, it returns t.
> This is reproducible on my end with both the built-in version of 
> Org and 9.7-pre. 

This is not a bug - Org considers blank lines after element as a part of
it. This includes source blocks.

If you want to check if point is inside source block code, use INSIDE
argument.

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



[Bug] org-in-src-block-p returns t when not in source block

2023-11-27 Thread No Wayman



When on an empty line before a source block, org-in-src-block-p 
correctly returns nil.

However, when on an empty line after a source block, it returns t.
This is reproducible on my end with both the built-in version of 
Org and 9.7-pre. 


Yodel[1] Report 2023-11-27 10:42:54
===

--8<---cut here---start->8---
(yodel
 :post*
 (require 'org)
 (org-version nil 'full 'message)
 (yodel-file
   :point "|"
   :with* "#+begin_src text\n#+end_src\n|"
   :then* (message "org-in-src-block-p below: %s" 
   (org-in-src-block-p)))

 (yodel-file
   :point "|"
   :with* "|\n#+begin_src text\n#+end_src"
   :then* (message "org-in-src-block-p above: %s" 
   (org-in-src-block-p

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

STDOUT
==

Org mode version 9.6.11 (release_9.6.11 @ 
/usr/share/emacs/30.0.50/lisp/org/)

org-in-src-block-p below: t
org-in-src-block-p above: nil


Environment
===

- emacs version: GNU Emacs 30.0.50 (build 1, x86_64-pc-linux-gnu, 
 GTK+ Version 3.24.38, cairo version 1.18.0)

of 2023-11-16
- system type: gnu/linux

[1] https://www.github.com/progfolio/yodel



Re: ODT export failing

2023-11-27 Thread Fraga, Eric
Ignore please.  I was trying to export an image which was in PDF; I
thought I had changed to reference to a PNG but missed one.  Mind you,
the error message could be a little more informative?

Sorry for the noise.

-- 
: Eric S Fraga, with org release_9.6.7-661-g34ee6f in Emacs 30.0.50


ODT export failing

2023-11-27 Thread Fraga, Eric
Hello all,

can anybody suggest what may be causing an error of the form:

org-odt-export-to-odt: OpenDocument export failed: FIXME: Unable to resolve 
[...]

The very long error message gives no actual detail as to what actually
failed to resolve.

I will try with emacs -Q etc. but challenging due to the large number of
customizations I have.

thank you,
eric

PS - I hate having to prepare Word formatted documents. 🙁
-- 
: Eric S Fraga, with org release_9.6.7-661-g34ee6f in Emacs 30.0.50