Re: interaction of fontified calendar entries and org-read-date

2024-02-14 Thread John Kitchin
Thanks for the tip on `calendar-make-temp-face'. It gets even weirder now.

If I use a face, that function does not even seem to get called, so it
seems to work.

If I use the anonymous face though, it does get called, and I see the
inconsistent behavior.

However, if I edebug `calendar-make-temp-face' and step through each line,
then it works the same as using a face. And, after that it seems to work
most of the time.

"Do not call this directly from Lisp code; use ‘defface’ instead." seems
like a weird message. Where else would one use this?

Anyway, thanks again, I have stumbled on a solution, which is to modify
`calendar-mark-visible-date' so it does not use `calendar-make-temp-face' .

It is a small change of:
(t   ; attr list
(overlay-put
 (make-overlay (1- (point)) (1+ (point))) 'face
 (calendar-make-temp-face mark)))

to

(t   ; attr list
(overlay-put
 (make-overlay (1- (point)) (1+ (point))) 'face
mark))

That seems to work.

A simpler way though is to just put the overlays on manually in the hook,
e.g.

(let* ((mark-calendar (lambda ()
;; Goto today
(save-excursion
 (calendar-cursor-to-visible-date (read (format-time-string "(%m %d %Y)")))
 (overlay-put
  (make-overlay (1- (point)) (1+ (point))) 'face
  (list :foreground "blue" :weight 'bold)
   (calendar-today-visible-hook))
  (add-hook 'calendar-today-visible-hook
   mark-calendar)
  (org-read-date))

I can live with that solution. Thanks for the assist!

On Wed, Feb 14, 2024 at 3:14 PM Ihor Radchenko  wrote:

> John Kitchin  writes:
>
> > why does it work with a face though?
>
> It really does. That's confusing. And proves that Emacs is smart enough
> to invert cursor color in some situations.
>
> My only guess is that `calendar-make-temp-face' is using `make-face'
> incorrectly. I guess that
>
> Do not call this directly from Lisp code; use `defface' instead.
>
> in `make-face' docstring is there for a reason.
> Maybe report this as Emacs bug in calendar.el?
>
> --
> Ihor Radchenko // yantar92,
> Org mode contributor,
> Learn more about Org mode at .
> Support Org development at ,
> or support my work at 
>


-- 
John

---
Professor John Kitchin (he/his)
Doherty Hall A207F
Department of Chemical Engineering
Carnegie Mellon University
Pittsburgh, PA 15213
412-268-7803
https://kitchingroup.cheme.cmu.edu
https://pointbreezepubs.gumroad.com/ pycse bookstore


dynamic blocks orgmode manpage

2024-02-14 Thread chris
Hi all,

#+title: dynamic blocks orgmode manpage

* Example from the manual

Concerned page: [[https://orgmode.org/manual/Dynamic-Blocks.html][Dynamic 
Blocks (The Org Manual)]]

Below is an elisp snippet from the manual. You can execute it with =C-c C-c=.

#+begin_src emacs-lisp
  (defun org-dblock-write:block-update-time (params)
(let ((fmt (or (plist-get params :format) "%d. %m. %Y")))
  (insert "Last block update at: "
  (format-time-string fmt
#+end_src

#+RESULTS:
: org-dblock-write:block-update-time

Below is another snippet from the manual. You can update it with =M-x org-
dblock-update=.

#+BEGIN: block-update-time :format "on %m/%d/%Y at %H:%M"
Last block update at: on 02/14/2024 at 21:33
#+END:

Now, after running =C-c C-c= on the line below, trying =M-x org-dynamic-block-
insert-dblock= will result in the error: =funcall-interactively: Wrong type 
argument: commandp, org-dblock-write:block-update-time=.

#+begin_src emacs-lisp
  (org-dynamic-block-define "block update time" #'org-dblock-write:block-
update-time)
#+end_src

#+RESULTS:
: ((block update time . org-dblock-write:block-update-time) (abstracts-index . 
org-dblock-write:abstracts-index) (columnview . org-columns-insert-dblock) 
(clocktable . org-clock-report))


* Alternative construction

Given the circumstances described above, the following snippet works with both 
=M-x org-dblock-update= and =M-x org-dynamic-block-insert-dblock=.

#+begin_src emacs-lisp
  (defun cool-hello () (string-join '("cool" "hello") " "))

  (defun org-dblock-write:hello-dblock ( arg)
(interactive)
(let* ((a (if (called-interactively-p 'any)
 (format "#+BEGIN: hello-dblock\n%s\n#+END:\n"
 (cool-hello))
   (format "%s" (cool-hello)
  (insert a)))

  (org-dynamic-block-define "hello dblock" #'org-dblock-write:hello-dblock)
#+end_src

#+RESULTS:
: org-dblock-write:hello-dblock


#+BEGIN: hello-dblock
cool hello
#+END:

* Notes

In the above snippet, for it to work in both cases, after numerous 
experiments, I found that both the =(interactive)= part and the =( 
arg)= part are necessary.

If memory serves, depending on whether it is used with =M-x org-dblock-update= 
or =M-x org-dynamic-block-insert-dblock=, one of them might not require the 
=interactive= part, while it's a requirement for the other one. Similarly, one 
scenario requires no arguments, while the other demands that arguments are 
present.

Cheers,
Chris






Re: Retaking AUTO for \usepackage{fontenc}

2024-02-14 Thread Juan Manuel Macías
Ihor Radchenko writes:

> Juan Manuel Macías  writes:
>
>> Pedro Andres Aranda Gutierrez writes:
>>
>>> neither do I, This is why I'm asking for people to tell me what they
>>> use ;-)
>>
>> The babel ini files (why hadn't I thought of this before :-): look in the 
>> babel ini files:
>
> May it be that babel automatically loads fontenc with appropriate parameters?

AFAIK, I'm afraid it's not possible. What is possible is to be able to
select a language in the middle of the document, without declaring it
before. But you need to load fontenc and the appropriate fontencodings.
According to the babel manual (p. 8), this functionality is only limited
to Latin, Cyrillic, Greek, Arabic, Hebrew, Cherokee, Armenian, and
Georgian.

Best regards,

Juan Manuel 


-- 
Juan Manuel Macías -- Composición tipográfica, tratamiento de datos, diseño 
editorial y ortotipografía




Re: interaction of fontified calendar entries and org-read-date

2024-02-14 Thread Ihor Radchenko
John Kitchin  writes:

> why does it work with a face though?

It really does. That's confusing. And proves that Emacs is smart enough
to invert cursor color in some situations.

My only guess is that `calendar-make-temp-face' is using `make-face'
incorrectly. I guess that

Do not call this directly from Lisp code; use `defface' instead.

in `make-face' docstring is there for a reason.
Maybe report this as Emacs bug in calendar.el?

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



Re: interaction of fontified calendar entries and org-read-date

2024-02-14 Thread John Kitchin
why does it work with a face though?

On Wed, Feb 14, 2024 at 10:00 AM Ihor Radchenko  wrote:

> John Kitchin  writes:
>
> > This slightly different code (differs only in assigning an anonymous face
> > instead of an actual face doesn't do that exactly. Today is still marked
> > red, but it is no longer selected with the inverse square. Neighboring
> days
> > do get the red square, but not "today".
> >
> > (let* ((mark-calendar (lambda ()
> > (calendar-mark-visible-date
> > (read (format-time-string "(%m %d %Y)"))
> > (list :foreground "red" :weight 'bold
> >(calendar-today-visible-hook))
> >   (add-hook 'calendar-today-visible-hook
> >mark-calendar)
> >   (org-read-date))
>
> That's because cursor background becomes the same as text foreground and
> Emacs prevents the clash.
>
> --
> Ihor Radchenko // yantar92,
> Org mode contributor,
> Learn more about Org mode at .
> Support Org development at ,
> or support my work at 
>


-- 
John

---
Professor John Kitchin (he/his)
Doherty Hall A207F
Department of Chemical Engineering
Carnegie Mellon University
Pittsburgh, PA 15213
412-268-7803
https://kitchingroup.cheme.cmu.edu
https://pointbreezepubs.gumroad.com/ pycse bookstore


Re: [BUG] beamer export

2024-02-14 Thread Leo Butler
On Thu, Feb 01 2024, Ihor Radchenko  wrote:

> Leo Butler  writes:
>
>> Replying to self: Attached is a patch that adds a property,
>> BEAMER_FRAME, that lets the frame environment name be set on a
>> frame-by-frame basis. In addition, it typesets any fragile frame in the
>> `orgframe' environment. I am not sure if the latter is really needed,
>> given the former.
>
> Thanks!
>
>> Comments?
>
> I am not a big fan of introducing a new BEAMER_FRAME option.
> We already have BEAMER_ENV.
>
> However, BEAMER_ENV is somewhat tricky for frame headings - ox-beamer
> allows special values of frame and fullframe (the latter is not fully
> documented) to allow frames nesting different from
> `org-beamer-frame-level'.

I experimented with BEAMER_ENV, but my impression is that that the code
for extracting a label is quite brittle. I may re-visit this option, but
not at this time.

>
> What about not adding BEAMER_FRAME, but instead adding org-lint checker
> that will detect when frame text contains the problematic \end{orgframe}?

Ok, thanks for your feedback. I have modified the patch along the lines
you suggested. It is attached.

Best,
Leo

From cc3e1572e354d18ce57c6a7b89b7fdd96b7fe1a8 Mon Sep 17 00:00:00 2001
From: Leo Butler 
Date: Thu, 25 Jan 2024 09:48:20 -0600
Subject: [PATCH] lisp/ox-beamer.el:  customize the beamer frame environment
 name

* lisp/ox-beamer.el (org-beamer-frame-environment): A new customize
variable.  It contains the name of an environment that serves as an
alias for the beamer frame environment.

(org-beamer--format-frame): Introduce the new property, :BEAMER_FRAME.
If set in the headline, use that as name of the frame environment.
Otherwise, in frames marked as fragile, the name of the frame
environment is taken from `org-beamer--frame-environment'.  In all
other frames, the default name is frame.  Unless the frame name is
"frame", the name is added to the list
`org-beamer--frame-environments'.

(org-beamer--frame-environments): New variable and function.  The
variable holds a list of names of frame environments found while
formatting frames.  The function generates the LaTeX code to define
each new frame environment.

(org-beamer-template): Add a call to `org-beamer--frame-environments'
to insert the environment definitions into the beamer document.

* lisp/org-lint.el (org-lint-beamer-frame): Check the body of each
frame for an occurrence of \begin{orgframe} or \end{orgframe}, or
whatever environment name is in `org-beamer-frame-environment' [4].

Rationale: Code with \begin{frame} or \end{frame} cannot be embedded
in a verbatim environment inside a beamer frame due to a design
decision made by the beamer developers [1].  As suggested in that
report, defining an alias for the beamer frame environment will allow
such verbatim examples to compile correctly [2].

This solution also works with instances of \againframe.

Refs:
[1] https://github.com/josephwright/beamer/issues/360
[2] https://github.com/josephwright/beamer/issues/360#issuecomment-708705250
[3] https://list.orgmode.org/orgmode/87le8eg1hs.fsf@localhost/T/
[4] https://list.orgmode.org/orgmode/87il38i5tb.fsf@localhost/T/
---
 lisp/org-lint.el  | 15 +++
 lisp/ox-beamer.el | 43 ---
 2 files changed, 51 insertions(+), 7 deletions(-)

diff --git a/lisp/org-lint.el b/lisp/org-lint.el
index f68aeab01..7248f687d 100644
--- a/lisp/org-lint.el
+++ b/lisp/org-lint.el
@@ -1446,6 +1446,17 @@ AST is the buffer parse tree."
  ((memq (org-element-property :type deadline) '(inactive inactive-range))
   (list (org-element-begin planning) "Inactive timestamp in DEADLINE will not appear in agenda."))
  (t nil))
+
+(defun org-lint-beamer-frame (ast)
+  "Check for occurrences of begin or end frame."
+  (org-with-point-at ast
+(goto-char (point-min))
+(let (result)
+  (while (re-search-forward
+  (concat "\\(begin\\|end\\){" org-beamer-frame-environment "}") nil t)
+(push (list (match-beginning 0) "Beamer frame name may cause error when exporting.") result))
+  result)))
+
 
 ;;; Checkers declaration
 
@@ -1711,6 +1722,10 @@ AST is the buffer parse tree."
   "Report $ that might be treated as LaTeX fragment boundary."
   #'org-lint-LaTeX-$-ambiguous
   :categories '(markup) :trust 'low)
+(org-lint-add-checker 'beamer-frame
+  "Report that frame text contains beamer frame environment."
+  #'org-lint-beamer-frame
+  :categories '(export) :trust 'low)
 (org-lint-add-checker 'timestamp-syntax
   "Report malformed timestamps."
   #'org-lint-timestamp-syntax
diff --git a/lisp/ox-beamer.el b/lisp/ox-beamer.el
index 82c8841aa..65d8b06ef 100644
--- a/lisp/ox-beamer.el
+++ b/lisp/ox-beamer.el
@@ -149,9 +149,17 @@ which is replaced with the subtitle."
   :package-version '(Org . "8.3")
   :type '(string :tag "Format string"))
 
+(defcustom org-beamer-frame-environment "orgframe"
+  "Name of the beamer frame environment."
+  :group 

Re: ox-docx?

2024-02-14 Thread Sharon Kimble
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA512

Ihor Radchenko  writes:

> Sharon Kimble  writes:
>
>> I've just done a 'git pull' for updating my org-mode setup, and its throwing 
>> up the following error, which has also occurred in the past.
>>
>> =
>> Debugger entered--Lisp error: (file-missing "Cannot open load file" "No such 
>> file or directory" "ox-docx")
>>   require(ox-docx)
>>   #f(compiled-function () #)()
>>   eval-after-load-helper("/home/boudiccas/git/org-mode/lisp/ox.elc")
>>   run-hook-with-args(eval-after-load-helper 
>> "/home/boudiccas/git/org-mode/lisp/ox.elc")
>>   do-after-load-evaluation("/home/boudiccas/git/org-mode/lisp/ox.elc")
>
> ox-docx is not a part of Org mode. It appears to be requested by your
> personal `eval-after-load' or `use-package` configuration.

I've checked my config file and there is no mention of 'ox-docx' nor of 
'ox-doc'! So I've checked on my computer and there is no location of 'ox-docx' 
nor of 'ox-doc'! I've checked my lisp folders and again there is no file named
  'ox.docx' nor 'ox-doc', and I can't work out where its coming from.

But I've done git pull etc since and not found that problem so its not a 
problem!

Thanks
  Sharon.  
- -- 
A taste of linux = http://www.sharons.org.uk
TGmeds = http://www.tgmeds.org.uk
DrugFacts = https://www.drugfacts.org.uk
Debian 12.4, fluxbox 1.3.7, emacs 30.0.50, org 9.7-pre 
-BEGIN PGP SIGNATURE-

iQJRBAEBCgA7FiEELSc/6QwVBIYugJDbNoGAGQr4g1sFAmXM2YYdHGJvdWRpY2Nh
c0Bza2ltYmxlMDkucGx1cy5jb20ACgkQNoGAGQr4g1tiqw/+I7briZ+Y5sbIqvb0
BZa7XPeJ6sRNBbyuJwenY8xmDleIrdzYot2Mq9XEZQplSAccG4UNzDRwQZ7EX5YA
4LYQmCFYmvkBV5wUjGIIVCd84C8VMV8dKcqsfDsKPGUuWbgCWHHQccj0XAcfAFDf
MqD4UqnvWkE3GZLqxxGeLuOElowQCsFotuBYSVFHmDr7t8nht52arnF1bszXzLNA
o/Zli7wgUN9bp+nJ7hI7Xq29ZKS3C1OjWXQuDAW34Lo3f/8tl8YzR+fVrjOu0jZp
yNidZVdpu3GKPWJMa73dPDahcWG2DOOgJ+7I5Y8dvQAZz0mIFThGvYgiOm/VCNfK
K2EGKxsO0yXB5rhCd9rG+No1loDN8+SdqwcfWIPCULyt14nyPyqHfcOYrOSCHg+1
zT+HtDEWTtyqf/PE4iLnWw1l1Eokz8TQjowljwscxC6R/cFSgoPPt34bzy6C97HD
TJbCrpWJ/3dyVluTMCCjVwtXoNegVhjSC+bHHxTgsEdlq3x1Prnw8EU02pi2u0eX
60IQT3DPzaj63QfionBufLxtu0tpj2Mb6X//Y+bPGcRdJI/RBEANVm1RbEIkUP3L
bELa79mUx8s5f3XFPhKF6c5FPz3pAvq3yGeocH4ISby8KId0b+imDUOhp1bAUU3z
7D9Yw0+lAkr5x95Od6zjund10GI=
=5KMS
-END PGP SIGNATURE-



[BUG] ox-texinfo can't export example blocks [9.6.9 (release_9.6.9 @ /usr/local/share/emacs/30.0.50/lisp/org/)]

2024-02-14 Thread pva-outdoor



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.


Hello, Team!

It seems that in ox-texinfo.el the `string-match-p' is used instead of
`string-equal' (here is my patch):

--- /usr/local/share/emacs/30.0.50/lisp/org/ox-texinfo.el.gz
+++ #
@@ -1680,7 +1680,7 @@
   "Transcode a SRC-BLOCK element from Org to Texinfo.
 CONTENTS holds the contents of the item.  INFO is a plist holding
 contextual information."
-  (let* ((lisp (string-match-p "lisp"
+  (let* ((lisp (string-equal "lisp"
   (org-element-property :language src-block)))
 (code (org-texinfo--sanitize-content
(org-export-format-code-default src-block info)))

Without this fix I can't export my `.org' files to `.texi' format as the
:language property is nil for #+BEGIN_EXAMPLE ... #+END_EXAMPLE blocks.


Emacs  : GNU Emacs 30.0.50 (build 2, x86_64-pc-linux-gnu, GTK+ Version 3.24.38, 
cairo version 1.18.0)
 of 2023-10-05
Package: Org mode version 9.6.9 (release_9.6.9 @ 
/usr/local/share/emacs/30.0.50/lisp/org/)
-- 
С уважением,
Андрей Петров.



Re: interaction of fontified calendar entries and org-read-date

2024-02-14 Thread Ihor Radchenko
John Kitchin  writes:

> This slightly different code (differs only in assigning an anonymous face
> instead of an actual face doesn't do that exactly. Today is still marked
> red, but it is no longer selected with the inverse square. Neighboring days
> do get the red square, but not "today".
>
> (let* ((mark-calendar (lambda ()
> (calendar-mark-visible-date
> (read (format-time-string "(%m %d %Y)"))
> (list :foreground "red" :weight 'bold
>(calendar-today-visible-hook))
>   (add-hook 'calendar-today-visible-hook
>mark-calendar)
>   (org-read-date))

That's because cursor background becomes the same as text foreground and
Emacs prevents the clash.

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



Re: Retaking AUTO for \usepackage{fontenc}

2024-02-14 Thread Ihor Radchenko
Juan Manuel Macías  writes:

> Pedro Andres Aranda Gutierrez writes:
>
>> neither do I, This is why I'm asking for people to tell me what they
>> use ;-)
>
> The babel ini files (why hadn't I thought of this before :-): look in the 
> babel ini files:

May it be that babel automatically loads fontenc with appropriate parameters?

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



RE: [External] : Re: [DISCUSSION] "quick-help" popup for org-columns (column view)

2024-02-14 Thread Sławomir Grochowski


I have been using the https://github.com/justbur/emacs-which-key for a long 
time.
However, today I took a closer look at this package to see if it has
two features that I've found in 'quick-help' which I really like.

Those two features are:

1. option for popup to be persistent, sticky
It's a lifesaver for every new user to see permanently
available keybindings, as well as for every user who starts
use an unknown package.
'which-key' already has this feature implemented,
variable `which-key-persistent-popup'.

2. option to divide keybindings into groups
For example, with 'which-key' when I press 'C-h',
popup with 50 keybindings will appear on the screen.  
I'm completely overwhelmed by the amount of information.
Making any decision is very tiring and difficult.
Grouping will make it much easier to read and make a decision.
I don't see this functionality in 'which-key' but I found a topic on
Reddit 
https://www.reddit.com/r/emacs/comments/kxd9z4/grouped_bindings_in_whichkey
with repo link
https://github.com/loafofpiecrust/dotfiles/blob/main/emacs/.config/doom/custom/pretty-which-key.el
where this feature has been implemented.

Based on this information, I think it's worth waiting until 'which-key' is 
integrated.
And then implement the 'divide keybindings into groups' feature.

I'm not familiar with https://www.emacswiki.org/emacs/download/keysee.el
But I could try to answer some questions about 'which-key'.

Drew Adams  writes:

> 1. Doesn't which-key also provide the
> possibility (e.g., on-demand instead of
> by timer) to show all currently available
> bindings at top level, i.e., not on a
> prefix key)?  I thought it had added that
> feature at some point.
>
> If it doesn't, then that's another big
> difference ("critical", you say) from
> KeySee.

Yes, it's available with command `which-key-show-top-level'.

> 2. As for getting the completions in a
> buffer that you can access "persistently"
> (and, e.g., to search or edit):
>
> There should be a separate, more general
> feature for that: be able to "save" the
> current contents of `*Completions* (or
> another buffer displaying completions) to
> another buffer, regardless of what that
> completions buffer is showing.
>
> IOW, this shouldn't be only about _key_
> completions and descriptions as help.
>
> Icicles provides such a feature (as does
> Embark, IIUC).  Emacs should have it.  Hit
> a key, enter a destination buffer name (or
> just hit RET for a default name).

Yes, you can copy or even edit 'which-key' 'popup'.

> 3. Icicles can also show you complete help
> for key completions shown in *Completions*,
> in *Help*.  And likewise for any other
> kind of completions for which there's a
> help description.
>
> Showing help for completions is another
> general feature that Emacs should have.

I don't know if 'which-key' has this option.

-- 
Sławomir Grochowski



Re: [BUG] org-clock-in opens buffers for all agenda files

2024-02-14 Thread Ihor Radchenko
jman  writes:

> Why checking for dangling clocks in all files in `org-directory`?

Not in `org-directory', but all agenda files + all open Org buffers.

> .. Is it a common usecase to have clocks split in different files?

Yes, for some users.

> ... I'd like `org-clock-in` to close any running clocks but only check
> the file open in current buffer and not in all .org files in
> `org-directory`.

This is currently not possible.
Patches welcome though.

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



Re: [DISCUSSION, default settings] Using mailcap as default handler for opening file links

2024-02-14 Thread Ihor Radchenko
Max Nikulin  writes:

> On 13/02/2024 18:27, Ihor Radchenko wrote:
>> Max Nikulin writes:
>> 
>> I am mostly going to address user confusion about mailcap
>
> XDG configuration and so xdg-open behavior is often confusing to users 
> as well, especially in the cases of KDE and no DE. In GNOME it is 
> alleviated by a step with the application chooser if default application 
> has not been set yet.

I'd say that it is less confusing.
Of course, if you know anything even less confusing than xdg-open,
please share.

>> (2) Emacs' mailcap does not implement the specification fully - only a
>> subset of mailcap format is obeyed.
>
> Agree. On the other hand, mailcap.el is aware that Emacs can handle some 
> files internally. This feature should be preserved in some way. In 
> addition, mailcap has to be used if neither DISPLAY nor WAYLAND_DISPLAY 
> is set for current terminal.

May you please explain more about this?
What happens if a mailcap entry, say, declares "less" as a mimetype
handler and Emacs is running in terminal?

Also, I tried to run xdg-open from terminal (not emulator - C-M- on
Linux) and it runs w3m for .png image vs. feh when running from terminal
emulator on X.

>>> xdg-mime is more close to the file(1) tool
>> 
>> That might be a good alternative to file indeed; although file is
>> probably more widely installed.
>
> xdg-mime and xdg-open belong to the same package. In the case of no DE 
> xdg-mime calls file(1) (if mimetype(1) is not installed).

So, we can try xdg-mime and fall back to file.

>> Yes, but mailcap is not documented in Emacs manual.
>
> (info "emacs-mailcap") However it is not as useful as it should be.

It is not expected to be read by Emacs users:

   This manual is directed at users who want to modify the behaviour of
the MIME encoding/decoding process or want a more detailed picture of
how the Emacs MIME library works, and people who want to write functions
and commands that manipulate MIME elements.

So, I'd say that ordinary Emacs user probably has no idea that Emacs
consults .mailcap to open /files/. Maybe some users (who are already
familiar with .mailcap) expect .mailcap to be consulted when opening
email attachments. But I am not sure - even reading
https://man.archlinux.org/man/mailcap.5.en I cannot easily see why this
would be used to open files; not to render them inline.

>>> Is it necessary to modify Org? Maybe an alternative is to add "xdg-open
>>> %s" for */* to `mailcap-user-mime-data'.
>> 
>> Do you mean changing the default value of `mailcap-mime-data'?
>
> I am unsure what is a proper way to do it. I am not confident enough 
> with the code that selects handlers for files.

I feel that we are abusing the scope of mailcap when opening file links.

>>> I am still not really comfortable due to the strategy to start external
>>> processes diverged from methods used in browse-url.el.
>> 
>> Is it related to the problem at hand?
>
> - Eli had objections, but did not provide any details.
> - Error handling code was dropped for the sake of Emacs-25.
> - In the case of no DE, quit from emacs means terminating of started 
> applications.
> - I hope a bug I faced is exotic enough to never happen in real life.
>
> Unfortunately another approach is a kind of trade-off, not an 
> unambiguous advantage.

Sorry, but I have no idea what you are talking about. I assume that it
is some kind of Emacs bug you reported some time ago. I am not sure
which one. And I do not see how it is related to this discussion.

>> AFAIK, xdg.el does not support xdg-open functionality. We cannot use it
>> here.
>
> `xdg-mime-apps' looks like a building block. However it is not enough 
> and perhaps has enough bugs.
>
> Ideally Emacs should provide API that uses either xdg.el or mailcap.el 
> as backend depending on runtime and user configuration. Org is not the 
> only package that needs it.

Yes. But that's a lot of work; adding support of libmagic being just the
first step. Implementing something more reasonable for Org mode only is
a lower-handing fruit.

> P.S.
> Ihor, perhaps your clock is several minutes ahead.

I know.

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



Re: [patch] ox.latex.el: Add missing character warnings

2024-02-14 Thread Ihor Radchenko
Juan Manuel Macías  writes:

> I have fixed the org-latex-known-warnings regexp in the attached patch.
> I think it should work fine now...

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

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



Re: [BUG] Warning: The error was: (error "Invalid search bound (wrong side of point)") [9.6.15 (release_9.6.15 @ z:/emacs-i686/share/emacs/29.2/lisp/org/)]

2024-02-14 Thread Ihor Radchenko
Ypo  writes:

> I got a warning, which asked to be reported. Not sure why it happened, I 
> think it was when I refreshed calfw calendar:

Thanks for reporting!
Do you see the same warning if you switch to Org development branch?

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



Re: [PATCH] org-agenda: Make sure skipping warning/delay days never increases their number

2024-02-14 Thread Ihor Radchenko
Tim Ruffing  writes:

>> Please do not remove arguments from the public functions. This may
>> break
>> code outside Org mode.
>> 
> Hm, sure, I assumed it's okay for this niche thing. Can we deprecate
> the argument somehow?

We can do this - I do not see any code in the wild using the optional
arguments. However, we should do it carefully - (1) Move the function to
org-compat and mark obsolete, recommending a new function instead; (2)
Create a new function with a new name (say,
org-timestamp-get-warning-days) and without ZERO-OR-DELAY argument and
use it across Org mode.

> -   (suppress-prewarning
> +   (max-wdays

May you also rename this variable to be more clear. Something like,
max-warning-days? These short variable names make the code very
difficult to read.

> -   (wdays (or suppress-prewarning (org-get-wdays s
> +   (wdays (min max-wdays (org-get-wdays s

warning-days

> -   (suppress-delay
> +   (max-ddays

max-deadline-warning-days

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



Re: [PATCH] Fix bug assuming canonical duration units in org-agenda-format-items

2024-02-14 Thread Ihor Radchenko
Anders Johansson  writes:

> Included is a patch for the filtering (I assumed cl-intersection was
> reasonable to use since cl-lib is a requirement).
>
> However, I do not think this is enough, since it can cause quite
> unexpected results when canonical is used without specifying the
> format, Hence, I do think the previous patch should also be applied.
>
> For my case, org-duration-format is (("m") ("w") ("d") (special . h:mm)).
> This call to org-duration-from-minutes (like in org-agenda-format-item):
>
> (org-duration-from-minutes MINUTES nil t)
>
> will then result in a full format amounting to (("d")), (since
> "special" is not part of the canonical units), which is hardly what is
> expected for the agenda.

The patch breaks tests and thus cannot be applied.

May you please provide more details about the original problem you were
trying to solve? Preferably with a reproducer.

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



Re: [BUG] Org citations do not render in tables [9.5.5 (9.5.5-g8ef620 @ /home/stas/.emacs.d/straight/build/org/)]

2024-02-14 Thread Ihor Radchenko
Ihor Radchenko  writes:

> Stanislav Vlasov  writes:
>
>> #+BEGIN_SRC emacs-lisp :results table replace
>> "Prior research [cite:@paper] suggests that..."
>> #+END_SRC
>>
>> #+RESULTS:
>> | Prior research suggests that... |
>>
>> The expected outcome should be:
>>
>> #+RESULTS:
>> | Prior research [cite:@paper] suggests that... |
>>
>> It seems that this does not depend on src language (I have also tried with R 
>> and got the same issue).
>
> Confirmed.
>
> The problem is rather fundamental one.

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

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



Re: ox-docx?

2024-02-14 Thread Ihor Radchenko
Sharon Kimble  writes:

> I've just done a 'git pull' for updating my org-mode setup, and its throwing 
> up the following error, which has also occurred in the past.
>
> =
> Debugger entered--Lisp error: (file-missing "Cannot open load file" "No such 
> file or directory" "ox-docx")
>   require(ox-docx)
>   #f(compiled-function () #)()
>   eval-after-load-helper("/home/boudiccas/git/org-mode/lisp/ox.elc")
>   run-hook-with-args(eval-after-load-helper 
> "/home/boudiccas/git/org-mode/lisp/ox.elc")
>   do-after-load-evaluation("/home/boudiccas/git/org-mode/lisp/ox.elc")

ox-docx is not a part of Org mode. It appears to be requested by your
personal `eval-after-load' or `use-package` configuration.

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



ox-docx?

2024-02-14 Thread Sharon Kimble
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA512

  
I've just done a 'git pull' for updating my org-mode setup, and its throwing up 
the following error, which has also occurred in the past.

=
Debugger entered--Lisp error: (file-missing "Cannot open load file" "No such 
file or directory" "ox-docx")
  require(ox-docx)
  #f(compiled-function () #)()
  eval-after-load-helper("/home/boudiccas/git/org-mode/lisp/ox.elc")
  run-hook-with-args(eval-after-load-helper 
"/home/boudiccas/git/org-mode/lisp/ox.elc")
  do-after-load-evaluation("/home/boudiccas/git/org-mode/lisp/ox.elc")
  load("/home/boudiccas/git/org-mode/lisp/ox" noerror nil nil mustsuffix)
  #f(compiled-function (f) #)("ox")
  mapcar(#f(compiled-function (f) #) ("ob" "ob-C" 
"ob-awk" "ob-clojure" "ob-comint" "ob-core" "ob-emacs-lisp" "ob-eval" "ob-exp" 
"ob-java" "ob-latex" "ob-lob" "ob-python" "ob-ref" "ob-ruby" "ob-sh" "ob-table" 
"ob-tangle" "obarray" "oc" "oc-basic" "oclosure" "ol" "ol-bbdb" "ol-bibtex" 
"ol-docview" "ol-doi" "ol-eww" "ol-gnus" "ol-info" "ol-irc" "ol-mhe" "ol-rmail" 
"ol-w3m" "olivetti-autoloads" "org-agenda" "org-agenda-property" 
"org-agenda-show-deadlines" "org-alert-autoloads" "org-autolist" 
"org-bookmark-heading-autoloads" "org-books-autoloads" "org-bullets" 
"org-capture" "org-checklist" "org-cliplink" "org-cliplink-string" 
"org-cliplink-transport" "org-clock" "org-clock-budget" ...))
  org-reload(nil)
  funcall-interactively(org-reload nil)
  call-interactively(org-reload nil nil)
  command-execute(org-reload)
=

I did 'git pull', then when its completed, I did a 'make' followed by 'make 
docs'.

I then upgraded org-mode within org in emacs, and I have this version running 
at the moment - Org mode version 9.7-pre (release_9.6.18-1149-gb26745 @ 
/home/boudiccas/git/org-mode/lisp/).  

Thanks
  Sharon.
- -- 
A taste of linux = http://www.sharons.org.uk
TGmeds = http://www.tgmeds.org.uk
DrugFacts = https://www.drugfacts.org.uk
Debian 12.4, fluxbox 1.3.7, emacs 30.0.50, org 9.7-pre 
-BEGIN PGP SIGNATURE-

iQJRBAEBCgA7FiEELSc/6QwVBIYugJDbNoGAGQr4g1sFAmXMnxgdHGJvdWRpY2Nh
c0Bza2ltYmxlMDkucGx1cy5jb20ACgkQNoGAGQr4g1sc7Q//ddiCSoW+uSvrXiRB
afTP6S4C9GkefRjQnu1T5lE61Dn3Ezynw3ZMAkFqHZvcIvo7iJKhtA10CNqKuTrH
hLAOzM7KWGIJcr4tPO1RmxfDZCkotOGu0uZ0pynAF8JE66tzBkmGoch4WM+cBANc
PHYgViirFHeA9wyol7GiKKS/gGyhVUcaOmhisocU8v6Ne6yINvJHKo8h+8Wo4F6O
zkUxiLlyTyOOCQcFWQcpvpZ0TIPYpGE4tgd1nR8vgRu2vQO1evAZs+UCV54x5oyi
N8I6Bhm05zbe7bQiSaj2ZIqUTYUQjfO8tXe8MgPa/kMx3RLHKwlKa8I9Lf+S1FeQ
cavuv5B5yWnCzjSBJQNEchc3vhBbRDlOAhP5ijBgHbEC4vVL4iWjMM96yHAyn7ls
M35eIpkhZ2jQWTozVgoBhBhb28bAJg3v0Qcu1X5d30Piw6g0P6IETLCXM4n8T6xq
NF4qh6bldpwT47lAZyR233vIWPcsYvQiVRYwY2qxUY0RXy3UljiTZti+4xNULPlE
l6LoyVMYGiBXqqu/Cplh2rMxYY7tDhfYE7Ycq75PPcPVX934YMjKWkNC68DLayHk
kKQoi5bB+KntmVd9CjVYttMGZCMU9Jxda3WVMCbESyoomSw5XmtMR4hX6zIFFyXk
GlZPXeoP6rJ7nZot7KggjKS/0KE=
=4Bp4
-END PGP SIGNATURE-