Re: Question about citation formatting

2024-03-27 Thread William Denton
On Tuesday, March 26th, 2024 at 23:17, Christian Wittern  
wrote:

> This paper is discussing and comparing translations to the same text. So
> when I mention publications in the text, I want to have the keyword to
> be the translator, rather than the author.

You could do the citations by hand, the old-fashioned way!  But that doesn't 
use the full power of Org.

You could trick the system if you had a bib file where every book had two keys, 
for example @dogenMoonDewdrop1985 and @t_dogenMoonDewdrop1985.  The t_ entries 
are used for citations in the text, and you've set the translator's name as 
author so they show the way you want.  Their data is copied from the real bib 
entry, but can be kept simple because only author-date is used.  The real bib 
entries all have some keyword in them (such as "use_this") and you use 
"#+print_bibliography: :keyword use_this" to print the references.  This means 
if you edit a source's metadata you might need to do it in two places, but it 
would let you think, "Do I want to cite by translator or author here?"

Bill

--
William Denton
https://www.miskatonic.org/
Librarian, artist and licensed private investigator.
Toronto, Canada




Re: Question about citation formatting

2024-03-27 Thread András Simonyi
Dear All,

On Wed, 27 Mar 2024 at 04:17, Christian Wittern  wrote:

> This paper is discussing and comparing translations to the same text. So
> when I mention publications in the text, I want to have the keyword to
> be the translator, rather than the author.

I think your best bet is modifying (the citation part of) the CSL
style you are using. The format is well documented (see
https://docs.citationstyles.org/en/stable/specification.html) and
there is even an online visual CSL editor
(https://editor.citationstyles.org/visualEditor/).

best wishes,
András



Re: [PATCH] Run latex more than once for LaTeX src block evaluation

2024-03-27 Thread Michael

Max Nikulin  writes:


On 24/03/2024 15:58, Ihor Radchenko wrote:

Max Nikulin writes:

On 22/03/2024 05:55, Michael wrote:
I have a small patch for `org-preview-latex-process-alist' 
making
the default setting for LaTeX source block evaluation be 
running

latex three times (instead of the current one).


I suspect it may make the LaTeX preview feature unacceptably 
slow for

documents heavily loaded with math snippets.
Then, we may instead use latexmk - it will run latex as many 
times

as
necessary.


Sorry I have no experience with latexmk. At least a fallback 
should be

available if this script is not installed.

The LaTeX preview feature is close to dangerous per se. With 
latexmk

the barrier may be even lower. Some users may have -shell-escape
enabled in latexmk configuration. I hope, it is not possible to 
force
latexmk execute something weird by spitting a crafted message 
into

logs.

I have no idea how to enable preview for trusted files only 
without

ruining usability.


Should we perhaps have different variables for preview & Org
source block evaluation?

--
Michael 



Re: [BUG] ox-html output does not pass validation for html4-strict doctype [9.7-pre (release_9.6.23-1423-gcea6a1.dirty @ /home/yantar92/.emacs.d/straight/build/org/)]

2024-03-27 Thread Max Nikulin

On 25/03/2024 18:18, Ihor Radchenko wrote:

I am wondering whether it is at all possible to use the same syntax and
yet pass validation for all the allowed values of `org-html-doctype':
"html4-strict", "html4-transitional", "html4-frameset", "xhtml-strict",
"xhtml-transitional", "xhtml-frameset", "xhtml-11", "html5", "xhtml5".


Is it correct to use text/html for XHTML? I would expect 
application/xhtml+xml, but it is better to check standard.


For html5 my expectation is



instead of http-equiv
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/meta#charset




Re: Feature request: exclude sub-trees by backend

2024-03-27 Thread Edgar Lux
Hi, I had a need for this again (sorry for the necro-bump).

On Feb 26, 2024 at 5:51 PM, Ihor Radchenko  wrote:
> The suggestions to use backend-specific export tag in the links are used
> as ugly workarounds...

Ok. It was just to show that there are other people who may use it :) .

> As for ignore-heading, ...
> ... the author of Org export system
> repeatedly opposed it. This is why:
> https://list.orgmode.org/87mwdfzmox@nicolasgoaziou.fr/

Ok. Sorry. I should have assumed (or looked for) that there was a reason :) .

-- 
Sent with https://mailfence.com  
Secure and private email



Re: [BUG] Partially broken Org mode when remote setupfile is unavailable

2024-03-27 Thread Max Nikulin

On 20/03/2024 19:15, Ihor Radchenko wrote:

Max Nikulin writes:

#+setupfile: /dav:localhost#8000:/setup-dav-123.org

[...]

Package ‘tramp-gvfs’ not supported
File mode specification error: (user-error Package `tramp-gvfs' not supported)

[...]

- When point is on any non-empty line, RET is broken

save-excursion: Wrong type argument: stringp, nil

[...]

This is because `file-remote-p' throws an error. [...]
See https://debbugs.gnu.org/cgi/bugreport.cgi?bug=68976


Thanks for the link. I would consider a workaround:

(defun org-file-remote-p (file  args)
  (condition-case err
  (apply #'file-remote-p file args)
('user-error
 (let ((file (apply #'tramp-file-name-for-operation
#'file-remote-p file args)))
   (and (tramp-tramp-file-p file)
  (tramp-handle-file-remote-p file))






Re: "Bad template" when creating org-capture for table-line without '|'

2024-03-27 Thread Ihor Radchenko
Rens Oliemans  writes:

> ...
> However, I did not know that the _template_ also has to start with '|', and 
> org-capture
> still inserts the string "| Bad template |", which does not suggest in any 
> way that the
> lacking '|' would be the problem (after all, it is smart enough to prepend a 
> '|').
> ...
> however, is this also what's ideal? I would suggest one of the following 
> alternatives:
>
> - An error is signalled to the user with the root cause of the error: no '|' 
> at start of
>   template. In addition, the org-capture-templates variable documentation 
> string and the
>   manual would be updated. I am happy to create a patch for this.
>
> - org-capture could pre- and suffix a '|' if the user did not supply it in 
> their template.
>
> What are your thoughts on this?

Org mode is inconsistent here.

`org-capture-place-entry' uses `org-capture-verify-tree' and throws an
error when the template does not start from a headline or contains
headings with lower level after higher level.

Yet, `org-capture-place-item' prepends "-" when the template does not
start from a list item.

And, as you noticed, `org-capture-place-table-line' replaces the
template with "Bad template".

I think that the best course of action would be automatically fixing the
templates, as you propose in option (2), changing
`org-capture-place-entry' to automatically prepend "* " if necessary
(still leaving the subtree check though).

>   I am also happy to create a patch for this, however that would be my first 
> so such a
>   patch would perhaps have a few iterations ;)

That would be welcome. We can take as many iterations as necessary.
You may refer to
https://orgmode.org/worg/org-contribute.html#first-patch for instructions.

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



Re: [PATCH] lisp/ox-html.el: Add avif support for html export inline images

2024-03-27 Thread Ihor Radchenko
Ross Timson  writes:

> * lisp/ox-html.el (org-html-inline-image-rules): Add AVIF image
> support for inline images on HTML export.
>
> AVIF is well supported by browsers these days and offers similar
> features and much better compression than the other image formats
> commonly used for the web.
>
> TINYCHANGE

Thanks!
Applied, onto main.
I added etc/ORG-NEWS entry and marked the defcustom that its value have
been changed in Org 9.7.
https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=1be2f9693

You are also now listed as an Org mode contributor.
https://git.sr.ht/~bzg/worg/commit/16c24ea8

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



Re: org-agenda-skip-function now evaluated on line after headline?

2024-03-27 Thread Ihor Radchenko
Sean Whitton  writes:

> ...  I'm not sure enough of the problem now.

Canceled, for now.
Feel free to submit another bug report with more details, if the problem
arises again.

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



Re: [BUG] org-clock-sum: Wrong type argument: fixnump, nil [9.7-pre (release_9.6.22-1309-g8507ef @ /home/grfz/src/org-mode/lisp/)]

2024-03-27 Thread Ihor Radchenko
Gregor Zattler  writes:

>> I'd like to see the problematic timestamp to understand what might be
>> going on there.
>
>
> thanks for your instructions, I edited it a bit:
>
> " - SxII VPN vxx USB S ()
>   CLOCK: [2012-02-02 Do 14:00]--[2012-02-02 Do 16:00] =>  2:00
>   - SxII; Rxx kx, n xx
>   Clock: [2012-02-01 Mi 17:34]--[2012-02-01 Mi 18:24] =>  0:50

The parser had inconsistent handling of case-sensitivity in "CLOCK:"
keyword. Now, fixed - it should be case-insensitive.

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

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



Re: Pending contents in org documents (Re: Asynchronous blocks for everything (was Re: ...))

2024-03-27 Thread Ihor Radchenko
Bruno Barbier  writes:

> I've pushed an update that should address most of your comments.

Thanks!

> I've found a better name: I'm now calling it a "lock".  So I renamed
> "PENREG" into "REGLOCK" as "region lock".  The structure is now
> `org-pending-reglock'.

I slightly dislike short names and would prefer region-lock, but not a
big deal - it is just my personal style preference.

> I've renamed org-pending-ti-send-update to org-pending-send-update
> (now that the task control is gone, the prefix becomes useless).

I have a further request on interaction with penreg objects.
I feel that it is not ideal that overlays associated with penreg objects
cannot be fully controlled by the callers.

In particular, I'd like to see some way to

1. Create penreg object without locking the region, so that scheduled-at
   time is not set immediately and status overlay is not displayed.
   Then, `org-pending-send-update' could send :schedule signal to
   perform actual lock.

2. Act on the outcome overlays - there is currently no way to remove
   them using penreg object. Maybe :cancel signal? Canceled penreg
   objects can then be garbage-collected from the manager.

Also, the top-level commentary is getting incomplete and out-of-sync at
this point. May you work towards more detailed top-level description of
the library? This will make your ideas more explicit and make life
easier for me during the further review (now, I have to guess what you
meant by some parts of the code).

>> HANLDER will be another object we may expose via something like
>> (org-pending-handler ( on-success-function on-cancel-function on-await 
>> on-insert-logs) ...)
>> Then, PENREG will call appropriate handler function as needed.
>
> As the task-control is now gone:
>   - get/await is gone,
>   - cancel is now a hook/function of REGLOCK,
>   - insert-details is now a hook/function too of REGLOCK.
>> ...
>> Yes. Lexical context is implicit and harder to debug, while storing
>> necessary data explicitly in the struct slots is more robust as we are
>> very clear which context is intended to be captured.
>
> Done.

Is there any reason why you hide the extra information behind :-alist
filed? Why not directly adding extra fields with proper documentation?

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



Re: [BUG] Prompt appears in async shell results

2024-03-27 Thread Ihor Radchenko
Matt  writes:

> 1. Can people please test that the changes to
> =org-babel-comint-with-output= haven't broken other languages?

Over a week have passed. No objections have been raised.
Feel free to apply the patches.

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



"Bad template" when creating org-capture for table-line without '|'

2024-03-27 Thread Rens Oliemans
Hi,

I was trying to create an org-capture for a table-line type, and I noticed that
org-capture inserts the string "| Bad template |" when the template does not 
start with
'|'. This could make sense, since a line is (only) considered part of a table 
when it
starts with '|'.

However, I did not know that the _template_ also has to start with '|', and 
org-capture
still inserts the string "| Bad template |", which does not suggest in any way 
that the
lacking '|' would be the problem (after all, it is smart enough to prepend a 
'|').

Use this template to reproduce the behaviour, present on 9.7-pre
(release_9.6.23-1318-g990b89):

(setq org-capture-templates '(("t" "Test" table-line (file "test.org")
   "%^t")))

I did not see this documented anywhere: this was quite confusing, and the only 
way I got a
hint at what I did wrong was to see the default template for table-line: "| %? 
|". It
seems that this behaviour is intended, looking at org-capture.el:1358 @ 
990b89d3:

...
 (pcase (org-trim (org-capture-get :template))
   ((pred (string-match-p org-table-border-regexp))
"| %?Bad template |")
   (text (concat text "\n"
...

however, is this also what's ideal? I would suggest one of the following 
alternatives:

- An error is signalled to the user with the root cause of the error: no '|' at 
start of
  template. In addition, the org-capture-templates variable documentation 
string and the
  manual would be updated. I am happy to create a patch for this.

- org-capture could pre- and suffix a '|' if the user did not supply it in 
their template.
  I am also happy to create a patch for this, however that would be my first so 
such a
  patch would perhaps have a few iterations ;)

What are your thoughts on this?

Best