Re: Retaking AUTO for \usepackage{fontenc}

2024-02-12 Thread Pedro Andres Aranda Gutierrez
Hi,

Next step, @all, please help me filling up the list of codings vs.
languages. I currently am somehow confident of the following:

greek -> LGR
russian -> T2A

Thanks for contribs, /PA


On Mon, 12 Feb 2024 at 14:57, Ihor Radchenko  wrote:

> Pedro Andres Aranda Gutierrez  writes:
>
> > I'm trying to put together all pieces for this before I actually write
> code.
> >
> > After looking at the current state, I would be lenient to include an
> > additional optional property to `org-latex-language-alist' I would
> directly
> > call `:fontenc'.
> >
> > \usepackage[AUTO]{fontenc}
> > would then take it to replace AUTO. If this property is not present, the
> > default value would be T1.
> >
> > Opinions?
>
> Sounds reasonable.
>
> --
> Ihor Radchenko // yantar92,
> Org mode contributor,
> Learn more about Org mode at .
> Support Org development at ,
> or support my work at 
>


-- 
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: [PATCH] org-ctags: Fix regexp to not break radio targets

2024-02-12 Thread Martin Marshall
Ihor Radchenko  writes:

> If your assignment has "GNU Emacs" in it, you are good to go.

Just found the scanned copy.  It refers to "GNU EMACS (herein called
the Program)" in paragraph 1.(a).  :-D

Also, in case it helps locate it, there is "RT:1798288" under my name on
the first page.  And the date of my signature is "January 29, 2022".
This copy doesn't have the Deputy Director's signature.

-- 
Best regards,
Martin Marshall



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

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

> Juan Manuel Macías  writes:
>
>>> When I try the patch with a simple file like
>>>
>>> Hello. 你好。
>>>
>>> I do not see any warnings or errors indicated.
>>
>> How weird... And don't they at least appear in the *Messages* buffer?
>> With your example, they appear to me with pdfLaTeX, lualatex and XelaTeX
>> (I have used the default value of org-latex-pdf-process):
>
> I did
>
> 1. Install your patch on top of the latest main
> 2. make repro
> 3. Open /tmp/1.org and enter
> Hello. 你好.
> 4. C-c C-e l o
>
> In *Messages* I see
> For information about GNU Emacs and the GNU system, type C-h C-a.
> Org mode version 9.7-pre (release_9.6.18-1196-g8bd0dd @ 
> /home/yantar92/Git/org-mode/lisp/)
> (New file)
> Making completion list... [3 times]
> Loading quail/PY (native compiled elisp)...done
> Saving file /tmp/1.org...
> Wrote /tmp/1.org
> Wrote /tmp/1.tex
> Processing LaTeX file 1.tex...
> PDF file produced.
> Running xdg-open /tmp/1.pdf...done
>
> My `org-latex-pdf-process' is
> ("latexmk -f -pdf -%latex -interaction=nonstopmode -output-directory=%o %f")
> since I have latexmk installed.

I have done the same, on a clean Emacs init. Warning appears.

And in *Messages*:

PDF file produced with warnings: [unicode character(s) not set up for use with 
pdflatex. You can run lualatex or xelatex instead]

In *Org PDF LaTeX Output*:

! LaTeX Error: Unicode character 你 (U+4F60)
   not set up for use with LaTeX.

(this error is the one that passes as a warning in my patch when
compiled with pdfLaTeX).



Re: [PATCH] org-ctags: Fix regexp to not break radio targets

2024-02-12 Thread Ihor Radchenko
Martin Marshall  writes:

> Ihor Radchenko  writes:
>> I also see that you submitted a number of patches recently.
>> For now, your contribution size is fairly small, but if you plan to
>> contribute a lot more, please consider signing FSF copyright assignment.
>> See https://orgmode.org/worg/org-contribute.html#copyright
>
> Thanks, I submitted a copyright assignment a year or two ago with
> respect to a pull-request submitted for the which-key package.  Not sure
> if it's project-specific, or if I'll need to submit a separate one
> (which I'm happy to do of course).

If your assignment has "GNU Emacs" in it, you are good to go.

Bastien, may you please check FSF records?

-- 
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-12 Thread Ihor Radchenko
Juan Manuel Macías  writes:

>> When I try the patch with a simple file like
>>
>> Hello. 你好。
>>
>> I do not see any warnings or errors indicated.
>
> How weird... And don't they at least appear in the *Messages* buffer?
> With your example, they appear to me with pdfLaTeX, lualatex and XelaTeX
> (I have used the default value of org-latex-pdf-process):

I did

1. Install your patch on top of the latest main
2. make repro
3. Open /tmp/1.org and enter
Hello. 你好.
4. C-c C-e l o

In *Messages* I see
For information about GNU Emacs and the GNU system, type C-h C-a.
Org mode version 9.7-pre (release_9.6.18-1196-g8bd0dd @ 
/home/yantar92/Git/org-mode/lisp/)
(New file)
Making completion list... [3 times]
Loading quail/PY (native compiled elisp)...done
Saving file /tmp/1.org...
Wrote /tmp/1.org
Wrote /tmp/1.tex
Processing LaTeX file 1.tex...
PDF file produced.
Running xdg-open /tmp/1.pdf...done

My `org-latex-pdf-process' is
("latexmk -f -pdf -%latex -interaction=nonstopmode -output-directory=%o %f")
since I have latexmk installed.

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



Re: [PATCH] org-ctags: Fix regexp to not break radio targets

2024-02-12 Thread Martin Marshall
Ihor Radchenko  writes:
> I also see that you submitted a number of patches recently.
> For now, your contribution size is fairly small, but if you plan to
> contribute a lot more, please consider signing FSF copyright assignment.
> See https://orgmode.org/worg/org-contribute.html#copyright

Thanks, I submitted a copyright assignment a year or two ago with
respect to a pull-request submitted for the which-key package.  Not sure
if it's project-specific, or if I'll need to submit a separate one
(which I'm happy to do of course).

-- 
Best regards,
Martin Marshall



Re: [PATCH] org-ctags: Fix regexp to not break radio targets

2024-02-12 Thread Ihor Radchenko
Martin Marshall  writes:

> ...  I just noticed that org-ctags breaks CUSTOM_ID property links
> in the same way.  So I might submit a patch for that as well soon.

Improvements are always welcome!

I also see that you submitted a number of patches recently.
For now, your contribution size is fairly small, but if you plan to
contribute a lot more, please consider signing FSF copyright assignment.
See https://orgmode.org/worg/org-contribute.html#copyright

-- 
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-12 Thread Ihor Radchenko
Juan Manuel Macías  writes:

> Sorry, the previous patch was incomplete. The attached patch is correct.

When I try the patch with a simple file like

Hello. 你好。

I do not see any warnings or errors indicated.

-- 
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-12 Thread Juan Manuel Macías
Sorry, the previous patch was incomplete. The attached patch is correct.

Best regards,

Juan Manuel 

Juan Manuel Macías writes:

> Rationale for the attached patch: It seems that a common problem that
> users have with exporting to LaTeX is unicode characters that cannot be
> represented in pdfLaTeX or LuaLaTeX/XelaTeX. In the Unicode TeX engines
> the warning is insidious, since the missing character warning is not
> preceded by a 'warning' string.
>
> Naturally, the added Org warnings do not solve the problem, but at least
> they give some clues on how to properly adjust the document.

>From 19fb7b81d6ce3a657c86497707f590063b27683c Mon Sep 17 00:00:00 2001
From: Juan Manuel Macias 
Date: Mon, 12 Feb 2024 16:10:28 +0100
Subject: [PATCH] lisp/ox-latex.el: Add missing character warnings

* (org-latex-known-warnings): Two missing character warnings are
added: one for LuaLaTeX/XelaTeX and another for pdfLaTeX.
---
 lisp/ox-latex.el | 8 +++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/lisp/ox-latex.el b/lisp/ox-latex.el
index cfa2b8178..da4792c04 100644
--- a/lisp/ox-latex.el
+++ b/lisp/ox-latex.el
@@ -1511,6 +1511,8 @@ logfiles to remove, set `org-latex-logfiles-extensions'."
 ("Underfull \\hbox" . "[underfull hbox]")
 ("Overfull \\hbox" . "[overfull hbox]")
 ("Citation.*?undefined" . "[undefined citation]")
+("LaTeX Error: Unicode character" . "[unicode character(s) not set up for use with pdflatex. You can run lualatex or xelatex instead]")
+("Missing character: There is no" . "[Missing character(s): please load an appropriate font with the fontspec package]")
 ("Undefined control sequence" . "[undefined control sequence]"))
   "Alist of regular expressions and associated messages for the user.
 The regular expressions are used to find possible warnings in the
@@ -4435,7 +4437,11 @@ encountered or nil if there was none."
 (save-excursion
   (goto-char (point-max))
   (when (re-search-backward "^[ \t]*This is .*?TeX.*?Version" nil t)
-	(if (re-search-forward "^!" nil t) 'error
+	(if (and
+	 (re-search-forward "^!\\(.+\\)" nil t)
+ ;; This error is passed as missing character warning
+ (not (string-match-p "Unicode character" (match-string 1
+'error
 	  (let ((case-fold-search t)
 		(warnings ""))
 	(dolist (warning org-latex-known-warnings)
-- 
2.43.1



Re: [PATCH] org-ctags: Fix regexp to not break radio targets

2024-02-12 Thread Martin Marshall
Ihor Radchenko  writes:

> Applied, onto main, with amendments to the commit message.
> I added a TINYCHANGE cookie and linked to this thread.
> https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=38dd88268

Thanks!  I just noticed that org-ctags breaks CUSTOM_ID property links
in the same way.  So I might submit a patch for that as well soon.

-- 
Best regards,
Martin Marshall



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

2024-02-12 Thread Juan Manuel Macías

Rationale for the attached patch: It seems that a common problem that
users have with exporting to LaTeX is unicode characters that cannot be
represented in pdfLaTeX or LuaLaTeX/XelaTeX. In the Unicode TeX engines
the warning is insidious, since the missing character warning is not
preceded by a 'warning' string.

Naturally, the added Org warnings do not solve the problem, but at least
they give some clues on how to properly adjust the document.

Best regards,

Juan Manuel 

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

>From 03c4c94c22f720e38f1ffb180aaa8a23abd90406 Mon Sep 17 00:00:00 2001
From: Juan Manuel Macias 
Date: Mon, 12 Feb 2024 16:10:28 +0100
Subject: [PATCH] lisp/ox-latex.el: Add missing character warnings

* (org-latex-known-warnings): Two missing character warnings are
added: one for LuaLaTeX/XelaTeX and another for pdfLaTeX.
---
 lisp/ox-latex.el | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/lisp/ox-latex.el b/lisp/ox-latex.el
index cfa2b8178..80d992160 100644
--- a/lisp/ox-latex.el
+++ b/lisp/ox-latex.el
@@ -1511,6 +1511,8 @@ logfiles to remove, set `org-latex-logfiles-extensions'."
 ("Underfull \\hbox" . "[underfull hbox]")
 ("Overfull \\hbox" . "[overfull hbox]")
 ("Citation.*?undefined" . "[undefined citation]")
+("LaTeX Error: Unicode character" . "[character(s) not set up for use with pdflatex. You can run lualatex or xelatex instead]")
+("Missing character: There is no" . "[Missing character(s): please load an appropriate font with the fontspec package]")
 ("Undefined control sequence" . "[undefined control sequence]"))
   "Alist of regular expressions and associated messages for the user.
 The regular expressions are used to find possible warnings in the
-- 
2.43.1



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

2024-02-12 Thread Stefan Kangas
Adam Porter  writes:

> Since transient.el is part of Emacs now, these kinds of menus should
> probably be implemented with it.

IIUC, this is not a menu, but a reminder of key bindings that are usable
in that context.  Other keybindings here are self-inserting keys, which
are equally useful, and they wouldn't be available in a transient.



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

2024-02-12 Thread Ihor Radchenko
Stefan Kangas  writes:

> Adam Porter  writes:
>
>> Since transient.el is part of Emacs now, these kinds of menus should
>> probably be implemented with it.
>
> IIUC, this is not a menu, but a reminder of key bindings that are usable
> in that context.  Other keybindings here are self-inserting keys, which
> are equally useful, and they wouldn't be available in a transient.

I am wondering how quick-help, transient, and which-key (AFAIU, it is to
be included into the core soon-ish) play together.

transient provides a specific way to define the displayed layout, among
other things. At the same time, quick-help provides an alternative
(undocumented) way to define the layout. And which-key uses pre-defined
layout.

I am wondering if transient style to define how various options in the
menu/help buffer/which-key buffer can be unified.

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



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

2024-02-12 Thread Philip Kaludercic
Ihor Radchenko  writes:

> Stefan Kangas  writes:
>
>> Adam Porter  writes:
>>
>>> Since transient.el is part of Emacs now, these kinds of menus should
>>> probably be implemented with it.
>>
>> IIUC, this is not a menu, but a reminder of key bindings that are usable
>> in that context.  Other keybindings here are self-inserting keys, which
>> are equally useful, and they wouldn't be available in a transient.

The point of quick-help is to provide a persistent buffer with useful
bindings, comparable to what Nano does OOTB.

> I am wondering how quick-help, transient, and which-key (AFAIU, it is to
> be included into the core soon-ish) play together.
>
> transient provides a specific way to define the displayed layout, among
> other things. At the same time, quick-help provides an alternative
> (undocumented) way to define the layout. And which-key uses pre-defined
> layout.

One critical difference between which-key and transient compared to
quick-help, is that the latter has nothing to do with prefix maps, but
(by default) just presents global bindings, and is as such closer to a
curated version of `describe-bindings' (sort of like how `shortdocs' is
a curated version of `apropos-functions').

> I am wondering if transient style to define how various options in the
> menu/help buffer/which-key buffer can be unified.

-- 
Philip Kaludercic



[BUG] Recursive dependency when gnuplot added to org-babel-load-languages [9.1.13 (release_9.1.13-791-g842002 @ /home/hugh/git/org-mode/lisp/)]

2024-02-12 Thread hugh


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.


When 'org-babel-load-languages includes '(gnuplot . t), M-x org-mode
RET, or equivalently editing a *.org file, generates a File mode
specification error:

,
| File mode specification error: (error Recursive load 
/home/hugh/git/org-mode/lisp/org.el /home/hugh/git/org-mode/lisp/org-element.el 
/home/hugh/git/org-mode/lisp/ox.el /home/hugh/git/org-mode/lisp/ox-ascii.el 
/home/hugh/git/org-mode/lisp/ob-gnuplot.el /home/hugh/git/org-mode/lisp/org.el 
/home/hugh/git/org-mode/lisp/org-element.el /home/hugh/git/org-mode/lisp/ox.el 
/home/hugh/git/org-mode/lisp/ox-ascii.el 
/home/hugh/git/org-mode/lisp/ob-gnuplot.el /home/hugh/git/org-mode/lisp/org.el 
/home/hugh/git/org-mode/lisp/org-element.el /home/hugh/git/org-mode/lisp/ox.el 
/home/hugh/git/org-mode/lisp/ox-ascii.el 
/home/hugh/git/org-mode/lisp/ob-gnuplot.el /home/hugh/git/org-mode/lisp/org.el 
/home/hugh/git/org-mode/lisp/org-element.el /home/hugh/git/org-mode/lisp/ox.el 
/home/hugh/git/org-mode/lisp/ox-ascii.el 
/home/hugh/git/org-mode/lisp/ob-gnuplot.el /home/hugh/git/org-mode/lisp/org.el)
`

rather than simply enabling org-mode.

Reproducible with command:

,
| emacs  -Q --load /tmp/emacs/init.el /tmp/xxx.org
`

Where /tmp/emacs/init.el contains:

,
| (add-to-list 'load-path "~/git/org-mode/lisp")
| 
| (custom-set-variables
|  ;; custom-set-variables was added by Custom.
|  ;; If you edit it by hand, you could mess it up, so be careful.
|  ;; Your init file should contain only one such instance.
|  ;; If there is more than one, they won't work right.
|  '(org-babel-load-languages '((gnuplot . t
`

Target file /tmp/xxx.org need not exist.  Its use on the command line is
simply to call 'org-mode.

Workaround is simply to remove '((gnuplot . t)) from
'org-babel-load-languages

Cheers,
Hugh
--

Emacs  : GNU Emacs 29.1 (build 1, x86_64-pc-linux-gnu, X toolkit, cairo version 
1.17.8, Xaw3d scroll bars)
 of 2023-08-18
Package: Org mode version 9.1.13 (release_9.1.13-791-g842002 @ 
/home/hugh/git/org-mode/lisp/)

current state:
==
(setq
 org-link-elisp-confirm-function 'yes-or-no-p
 org-bibtex-headline-format-function 'org-bibtex-headline-format-default
 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-yank-image-file-name-function 'org-yank-image-autogen-filename
 org-mode-hook '((closure
  (org--rds reftex-docstruct-symbol org-attach-method 
org--single-lines-list-is-paragraph
   org-element-greater-elements org-agenda-restrict-end 
org-agenda-restrict-begin
   org-agenda-restrict visual-fill-column-width 
org-clock-history org-agenda-current-date
   org-with-time org-defdecode org-def org-read-date-inactive 
org-ans2 org-ans1
   org-columns-current-fmt-compiled org-clock-current-task 
org-clock-effort
   org-agenda-skip-function org-agenda-skip-comment-trees 
org-agenda-archives-mode
   org-end-time-was-given org-time-was-given org-log-note-extra 
org-log-note-purpose
   org-log-post-message org-last-inserted-timestamp 
org-last-changed-timestamp
   org-entry-property-inherited-from org-state 
org-agenda-headline-snapshot-before-repeat
   org-agenda-buffer-name org-agenda-start-on-weekday 
org-agenda-buffer-tmp-name
   org-priority-regexp org-mode-abbrev-table 
org-element-use-cache org-element-cache-persistent
   org-element-cache-version buffer-face-mode-face org-tbl-menu 
org-org-menu org-struct-menu
   org-entities org-last-state org-id-track-globally 
org-clock-start-time texmathp-why
   remember-data-file org-agenda-tags-todo-honor-ignore-options 
calc-embedded-open-mode
   calc-embedded-open-formula calc-embedded-close-formula 
align-mode-rules-list
   org-emphasis-alist org-emphasis-regexp-components 
org-export-registered-backends org-modules
   crm-separator org-id-overriding-file-name 
org-indent-indentation-per-level
   org-element--timestamp-regexp 
org-element-cache-map-continue-from
   

Re: Link type for pdf-tools annotations

2024-02-12 Thread Irfan S
Juan Manuel Macías  writes:


> Many times I need to "save" an annotation point in the pdf-tools
> annotations buffer. So I defined a new link type and the function to
> store it. The link is stored with the structure:

> [[pdf-annot:/path/to/file.pdf::annotation-date][file-name.pdf (annot. on p. 
> page-number)]]

> The link opens the PDF and jumps to the specific annotation. A screenshot:

FYI, there is also 
[[https://github.com/fuxialexander/org-pdftools][org-pdftools]] which provides 
similar (and additional) functionality, and is on MELPA. Thanks for sharing 
your code.

Irfan



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

2024-02-12 Thread Adam Porter
Since transient.el is part of Emacs now, these kinds of menus should 
probably be implemented with it.




Re: Question regarding org-capture-bookmark and org-bookmark-names-plist

2024-02-12 Thread Tim Wichmann
Dear Ihor,

Ihor Radchenko  writes:
>> My question: Is this the intended way to suppress bookmark creation?
>
> I think so.

Great!

> We first introduced `org-capture-bookmark' and only then added
> `org-bookmark-names-plist'. Maybe we should obsolete
> `org-capture-bookmark' to avoid confusion.

Thanks for the clarification.  Obsoleting `org-capture-bookmark' sounds
good, as the variable does not add new functionality which can not be
achieved with `org-bookmark-names-plist' already.

>> ...(Note, moreover, that currently
>> the :last-capture-marker bookmark is created even in case
>> `org-capture-bookmark' is set to nil, see `org-refile'.)
>
> May you elaborate? Are you sure that it is still the case on the latest main?

I double checked in newest version of defun `org-refile' in main branch:
The bookmark for :last-capture-marker is set independently of the value
of `org-capture-bookmark'.  The corresponding code looks like this:

---[snip: org-refile.el, line 608 ff.]---
 (when (bound-and-true-p org-capture-is-refiling)
   (let ((bookmark-name (plist-get org-bookmark-names-plist
   :last-capture-marker)))
 (when bookmark-name
   (condition-case err
   (bookmark-set bookmark-name)
---[end snip]---

I would have expected that this bookmark is not set in case
`org-capture-bookmark' is set to nil, something like this:

---[snip]---
 (when (bound-and-true-p org-capture-is-refiling)
   (when org-capture-bookmark
 (let ((bookmark-name (plist-get org-bookmark-names-plist
   [...]
 
---[end snip]---

But, when obsoleting `org-capture-bookmark', this problem is solved
anyhow: Bookmark creation can be fully controlled using the plist
variable (and only there).

So, I vote for obsoleting `org-capture-bookmark'.

Thanks again for your help!


Best regards,
  Tim.



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

2024-02-12 Thread Drew Adams
> The point of quick-help is to provide a persistent buffer
> with useful bindings, comparable to what Nano does OOTB.

> One critical difference between which-key and transient
> compared to quick-help, is that the latter has nothing
> to do with prefix maps, but (by default) just presents
> global bindings, and is as such closer to a curated
> version of `describe-bindings' (sort of like how
> `shortdocs' is a curated version of `apropos-functions').

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.
___

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).
___

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.
___

https://www.emacswiki.org/emacs/download/keysee.el



Re: [PATCH] org-ctags: Fix regexp to not break radio targets

2024-02-12 Thread Ihor Radchenko
Martin Marshall  writes:

> Subject: [PATCH] org-ctags: Fix regexp to not break radio-target links
>
> * org-ctags.el (org-ctags-tag-regexp): Add left angle-bracket to
> excluded characters for tag text.
> ...
> This updates `org-ctags-tag-regexp' to avoid adding broken entries for
> radio targets in the TAGS file.
>
> With the old regexp, org-ctags would add radio targets to the TAGS file
> with an extra angle bracket at the beginning.  So a target of
> "<<>>" would be entered in the TAGS file as
> "https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=38dd88268

-- 
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-12 Thread Ihor Radchenko
Pedro Andres Aranda Gutierrez  writes:

> I'm trying to put together all pieces for this before I actually write code.
>
> After looking at the current state, I would be lenient to include an
> additional optional property to `org-latex-language-alist' I would directly
> call `:fontenc'.
>
> \usepackage[AUTO]{fontenc}
> would then take it to replace AUTO. If this property is not present, the
> default value would be T1.
>
> Opinions?

Sounds reasonable.

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



Re: table alignment tags in Org export

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

>> Is there a way to retain the alignment information when re-exporting to 
>> Org? - either a function or some setting somewhere

Alignment markers and other special table rows are now exported by
default in ox-org.

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

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



Re: [BUG] Documentation for #+INCLUDE: does not specify order when exporting [9.5.5 (release_9.5.5 @ /usr/share/emacs/28.2/lisp/org/)]

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

>> But I do think it would be helpful if the "order" while ex-
>> porting would be documented in a meaningful way.

Details of the export flow have been added to the manual.
https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=46cf76259
https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=5cbaa8747

Fixed, on main.

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



Re: [PATCH v4] org-manual: Describe export process flow

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

> ... See the attached.
> I added reference to the manual in `org-export-as' docstring and made it
> explicit that the manual section is related to `org-export-as' by adding
> #+findex entry.

Applied, onto main.
https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=1ff72e091
https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=46cf76259
https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=1087a7b4a
https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=f9fc9d95c
https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=a70f216e3

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



Re: Org LaTeX Beamer export and the order of loading packages and theme (XeLaTeX and fonts)

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

>> 2) Is there a reason why the Beamer theme options are exported after 
>> other LaTeX packages? Wouldn't it be better to export the Beamer theme 
>> options before loading additional packages? The reason for that being 
>> that the theme sets defaults, which can then (potentially) be altered by 
>> loading additional packages.
>
> No specific reason that I am aware of.
> Your suggestion sounds reasonable, but I'd like to hear from our LaTeX
> experts first ;)

Thinking about this more, I am afraid that changing the loading order
may break the existing documents. Similar to your case when loading
beamer theme after other packages produces different behavior, loading
beamer theme _before_ may have unwanted side effects.

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



Re: [PATCH] Fix formatting

2024-02-12 Thread Ihor Radchenko
Ilya Chernyshov  writes:

> Hi, just wanted the code to be more elisp style guide compliant, so here's
> a patch that adds spaces before opening parentheses.

Sorry, but we do not accept whitespace-only commits because they may
create problems when searching git history. See
https://orgmode.org/worg/org-contribute.html#org594198c and
https://yhetil.org/emacs-devel/e1k8aul-0001mr...@fencepost.gnu.org/

Canceled.

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



[PATCH] org-bibtex-yank: Allow to populate existing item

2024-02-12 Thread Martin Kampas
Hi,

The attached patch allows to use org-bibtex-yank to 
populate an existing item instead of creating a new one, 
aligning its behavior with org-bibtex-create.

BR,
Martin Kampas
>From 96af3ef46bb056e58206af77d3d37c5af2e43d7f Mon Sep 17 00:00:00 2001
From: Martin Kampas 
Date: Mon, 12 Feb 2024 13:24:54 +0100
Subject: [PATCH] org-bibtex-yank: Allow to populate existing item

Align with org-bibtex-create.

* lisp/ol-bibtex.el (org-bibtex-write): New optional argument nonew,
  similar to the existing nonew argument of org-bibtex-create
* lisp/ol-bibtex.el (org-bibtex-yank): New optional argument nonew,
  similar to the existing nonew argument of org-bibtex-create
---
 lisp/ol-bibtex.el | 39 ++-
 1 file changed, 22 insertions(+), 17 deletions(-)

diff --git a/lisp/ol-bibtex.el b/lisp/ol-bibtex.el
index c5a950e2d..6ae4ae3cc 100644
--- a/lisp/ol-bibtex.el
+++ b/lisp/ol-bibtex.el
@@ -722,29 +722,31 @@ Return the number of saved entries."
   (interactive "fFile: ")
   (org-bibtex-read-buffer (find-file-noselect file 'nowarn 'rawfile)))
 
-(defun org-bibtex-write ( noindent)
+(defun org-bibtex-write ( noindent nonew)
   "Insert a heading built from the first element of `org-bibtex-entries'.
 When optional argument NOINDENT is non-nil, do not indent the properties
-drawer."
+drawer. If NONEW is t, add data to the headline of the entry at point."
   (interactive)
   (unless org-bibtex-entries
 (error "No entries in `org-bibtex-entries'"))
   (let* ((entry (pop org-bibtex-entries))
 	 (org-special-properties nil) ; avoids errors with `org-entry-put'
 	 (val (lambda (field) (cdr (assoc field entry
-	 (togtag (lambda (tag) (org-toggle-tag tag 'on
-(org-insert-heading)
-(insert (funcall org-bibtex-headline-format-function entry))
-(insert "\n:PROPERTIES:\n")
-(org-bibtex-put "TITLE" (funcall val :title) 'insert)
+	 (togtag (lambda (tag) (org-toggle-tag tag 'on)))
+ (insert-raw (not nonew)))
+(unless nonew
+  (org-insert-heading)
+  (insert (funcall org-bibtex-headline-format-function entry))
+  (insert "\n:PROPERTIES:\n"))
+(org-bibtex-put "TITLE" (funcall val :title) insert-raw)
 (org-bibtex-put org-bibtex-type-property-name
 		(downcase (funcall val :type))
-'insert)
+insert-raw)
 (dolist (pair entry)
   (pcase (car pair)
 	(:titlenil)
 	(:type nil)
-	(:key  (org-bibtex-put org-bibtex-key-property (cdr pair) 'insert))
+	(:key  (org-bibtex-put org-bibtex-key-property (cdr pair) insert-raw))
 	(:keywords (if org-bibtex-tags-are-keywords
 		   (dolist (kw (split-string (cdr pair) ", *"))
 			 (funcall
@@ -752,25 +754,28 @@ drawer."
 			  (replace-regexp-in-string
 			   "[^[:alnum:]_@#%]" ""
 			   (replace-regexp-in-string "[ \t]+" "_" kw
-		 (org-bibtex-put (car pair) (cdr pair) 'insert)))
-	(_ (org-bibtex-put (car pair) (cdr pair) 'insert
-(insert ":END:\n")
+		 (org-bibtex-put (car pair) (cdr pair) insert-raw)))
+	(_ (org-bibtex-put (car pair) (cdr pair) insert-raw
+(unless nonew
+  (insert ":END:\n"))
 (mapc togtag org-bibtex-tags)
 (unless noindent
   (org-indent-region
(save-excursion (org-back-to-heading t) (point))
(point)
 
-(defun org-bibtex-yank ()
-  "If kill ring holds a bibtex entry yank it as an Org headline."
-  (interactive)
-  (let (entry)
+(defun org-bibtex-yank ( nonew)
+  "If kill ring holds a bibtex entry yank it as an Org headline.
+If nonew is t, add data to the headline of the entry at point."
+  (interactive "P")
+  (let (entry
+(noindent nonew))
 (with-temp-buffer
   (yank 1)
   (bibtex-mode)
   (setf entry (org-bibtex-read)))
 (if entry
-	(org-bibtex-write)
+	(org-bibtex-write noindent nonew)
   (error "Yanked text does not appear to contain a BibTeX entry"
 
 (defun org-bibtex-import-from-file (file)
-- 
2.43.0



Re: [BUG] org-fast-tag-selection-include-todo is documented in the manual, but its docstring says that it is undocumented [9.7-pre (release_9.6.15-1039-gc00217 @ /home/yantar92/.emacs.d/straight/build

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

> I am leaning towards removing the mention from the manual, but would
> like to hear from others.
>
> Is anyone using org-fast-tag-selection-include-todo? Does anyone think
> that documenting it properly would be useful?

No replies within one month, so I am going ahead with my plan.

I updated the manual removing mentions to
`org-fast-tag-selection-include-todo'.
https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=cf7ef80a1

Fixed.

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



[PATCH] Fix formatting

2024-02-12 Thread Ilya Chernyshov

Hi, just wanted the code to be more elisp style guide compliant, so here's
a patch that adds spaces before opening parentheses.

>From 0d9b7ce6d5e83d7758566dab6a17642fdf4b9b73 Mon Sep 17 00:00:00 2001
From: Ilya Chernyshov 
Date: Mon, 12 Feb 2024 18:33:29 +0600
Subject: [PATCH] Fix formatting

* lisp/ob-haskell.el (org-babel-interpret-haskell):
* lisp/ol-bibtex.el (org-bibtex-store-link):
* lisp/ol.el (org-link--fontify-links-to-this-file):
* lisp/org-agenda.el (org-agenda-open-link):
(org-agenda-reapply-filters):
* lisp/org-element.el (org-element-timestamp-interpreter):
* lisp/org-macs.el (org-buffer-list):
* lisp/org-pcomplete.el (pcomplete/org-mode/block-option/src):

Fix formatting.
---
 lisp/ob-haskell.el| 2 +-
 lisp/ol-bibtex.el | 2 +-
 lisp/ol.el| 6 +++---
 lisp/org-agenda.el| 4 ++--
 lisp/org-element.el   | 2 +-
 lisp/org-macs.el  | 2 +-
 lisp/org-pcomplete.el | 2 +-
 7 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/lisp/ob-haskell.el b/lisp/ob-haskell.el
index 00be6d52c..178e08424 100644
--- a/lisp/ob-haskell.el
+++ b/lisp/ob-haskell.el
@@ -188,7 +188,7 @@ This function should only be called by `org-babel-execute:haskell'."
 (send-eoe)))
   ;; We now display and capture the value.
  (comint-with-output
-  (lambda()
+  (lambda ()
 (send-txt-to-ghci "__LAST_VALUE_IMPROBABLE_NAME__\n")
 (send-eoe))
  (results (mapcar #'org-strip-quotes
diff --git a/lisp/ol-bibtex.el b/lisp/ol-bibtex.el
index c5a950e2d..b7bfe3059 100644
--- a/lisp/ol-bibtex.el
+++ b/lisp/ol-bibtex.el
@@ -514,7 +514,7 @@ ARG, when non-nil, is a universal prefix argument.  See
 	   (link (concat "file:" (abbreviate-file-name buffer-file-name)
 			 "::" search))
 	   (entry (mapcar ; repair strings enclosed in "..." or {...}
-		   (lambda(c)
+		   (lambda (c)
 		 (if (string-match
 			  "^\\(?:{\\|\"\\)\\(.*\\)\\(?:}\\|\"\\)$" (cdr c))
 			 (cons (car c) (match-string 1 (cdr c))) c))
diff --git a/lisp/ol.el b/lisp/ol.el
index ef3e6addc..00bfaf13a 100644
--- a/lisp/ol.el
+++ b/lisp/ol.el
@@ -716,14 +716,14 @@ followed by another \"%[A-F0-9]{2}\" group."
 (defun org-link--fontify-links-to-this-file ()
   "Fontify links to the current file in `org-stored-links'."
   (let ((f (buffer-file-name)) a b)
-(setq a (mapcar (lambda(l)
+(setq a (mapcar (lambda (l)
 		  (let ((ll (car l)))
 			(when (and (string-match "^file:\\(.+\\)::" ll)
    (equal f (expand-file-name (match-string 1 ll
 			  ll)))
 		org-stored-links))
 (when (featurep 'org-id)
-  (setq b (mapcar (lambda(l)
+  (setq b (mapcar (lambda (l)
 			(let ((ll (car l)))
 			  (when (and (string-match "^id:\\(.+\\)$" ll)
  (equal f (expand-file-name
@@ -731,7 +731,7 @@ followed by another \"%[A-F0-9]{2}\" group."
 		(match-string 1 ll)) ""
 			ll)))
 		  org-stored-links)))
-(mapcar (lambda(l)
+(mapcar (lambda (l)
 	  (put-text-property 0 (length l) 'face 'font-lock-comment-face l))
 	(delq nil (append a b)
 
diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el
index 514359b62..121ac11f6 100644
--- a/lisp/org-agenda.el
+++ b/lisp/org-agenda.el
@@ -9469,7 +9469,7 @@ It also looks at the text of the entry itself."
 	 trg)
 (cond
  ((and buffer lk)
-  (mapcar (lambda(l)
+  (mapcar (lambda (l)
 		(with-current-buffer buffer
 		  (setq trg (and (string-match org-link-bracket-re l)
  (match-string 1 l)))
@@ -11000,7 +11000,7 @@ current HH:MM time."
 (defun org-agenda-reapply-filters ()
   "Re-apply all agenda filters."
   (mapcar
-   (lambda(f) (when (car f) (org-agenda-filter-apply (car f) (cadr f) t)))
+   (lambda (f) (when (car f) (org-agenda-filter-apply (car f) (cadr f) t)))
`((,org-agenda-tag-filter tag)
  (,org-agenda-category-filter category)
  (,org-agenda-regexp-filter regexp)
diff --git a/lisp/org-element.el b/lisp/org-element.el
index e6df9743a..b8e0fc6dc 100644
--- a/lisp/org-element.el
+++ b/lisp/org-element.el
@@ -4383,7 +4383,7 @@ Assume point is at the beginning of the timestamp."
 
 (defun org-element-timestamp-interpreter (timestamp _)
   "Interpret TIMESTAMP object as Org syntax."
-  (let((type (org-element-property :type timestamp)))
+  (let ((type (org-element-property :type timestamp)))
 (if (member type '(active inactive inactive-range active-range))
 (let ((day-start (org-element-property :day-start timestamp))
   (month-start (org-element-property :month-start timestamp))
diff --git a/lisp/org-macs.el b/lisp/org-macs.el
index f14323d23..f713f4b8f 100644
--- a/lisp/org-macs.el
+++ b/lisp/org-macs.el
@@ -336,7 +336,7 @@ If EXCLUDE-TMP is non-nil, ignore temporary buffers."
 	  (buffer-name b)
 (delq nil
 	  (mapcar
-	   (lambda(b)
+	   (lambda (b)
 	 (if (and (funcall filter b)
 		  (or (not 

Re: "Full Block" character in example block not visible in Beamer PDF

2024-02-12 Thread Loris Bennett
Juan Manuel Macías  writes:

> Loris Bennett writes:
>
>> The blocks of the histogram are present in the PDF, but are white, like
>> the background of the slides.  I can see this by marking them with the
>> mouse.
>>
>> Does anyone know what I need to do to make the full block character
>> visible in this situation?
>
> Do you compile your document with pdfLaTeX?

Yes.

> It looks like you're using a Unicode character (FULL BLOCK / #2588 /
> descomp: █ #2588) that pdfLaTeX doesn't recognize. You would have to use
> LuaTeX or XeTeX as a TeX engine. And load the fontspec package to manage
> the ttf or otf fonts. Additionally, you must define a mono font that
> contains that character, for example Ubuntu Mono. An example:
>
> #+TITLE: Some title
> #+AUTHOR: author
>
> #+Beamer_Header:\usepackage{fontspec}
> #+Beamer_Header:\setsansfont{Linux Biolinum O}
> #+Beamer_Header:\setmonofont{Ubuntu Mono}
> #+LATEX_CLASS: beamer
> #+LATEX_CLASS_OPTIONS: [presentation]
> #+BEAMER_THEME: Boadilla
>
> #+COLUMNS: %45ITEM %10BEAMER_ENV(Env) %10BEAMER_ACT(Act) %4BEAMER_COL(Col)
>
> Screenshot:
>
> https://i.imgur.com/ulYxJgr.png

The following seems to be sufficient for me 

  #+LATEX_COMPILER: xelatex
  #+BEAMER_HEADER: \setmonofont{Fira Code}

Fira Code being the font for the terminal in which the histograms are
generated.

> Bonus: To check which fonts on your system contain a certain character,
> you can use the TeX live tool Albatross. E.g.:
>
> albatross █ --border-style 0 --detailed --show-styles --include-tex-fonts

Good to know.

Thanks!

Loris

> Best regards,
>
> Juan Manuel
>
> --
> Juan Manuel Macías -- Composición tipográfica, tratamiento de datos, diseño 
> editorial y ortotipografía
>
-- 
This signature is currently under constuction.



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

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

> On 04/06/2022 20:42, Ihor Radchenko wrote:
>> 
>> It appears that using mailcap is giving us more trouble than benefits.
>> I am not sure about the situation on Windows and Mac though.
>> 
>> Should we change the default file handlers to Emacs globally (unless
>> user customizes otherwise)? Should we continue efforts to work around
>> mailcap issues? Maybe there is yet another alternative generic way to
>> open files?
>
> ...
> I believe, there are enough issues with mailcap implementation in Emacs, 
> but do we have some alternative? There is no support of queries to 
> mimeapps.list files in Emacs (XDG). Like Chrome it is possible to call 
> xdg-open for any type that can not be handled internally. Maybe it 
> possible to leave it in Org as is or with the patch to call "file" 
> utility (after some fixes).

I have been digging more on this issue recently, and I have found that
Carsten once attempted to tweak this default to use xdg-mime:

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

Use `xdg-open' to open files where available
* lisp/org.el (org-file-apps-defaults-gnu): Use `xdg-open' to open files
  where available.

 (defconst org-file-apps-defaults-gnu
-  '((remote . emacs)
-(system . mailcap)
-(t . mailcap))
+  (append
+   '((remote . emacs))
+   (if (executable-find "xdg-open")
+   '((system . "xdg-open %s")
+(t . "xdg-open %s"))
+ '((system . mailcap)
+   (t . mailcap

However, that commit had been reverted because xdg-open did not work for
some users, "failing silently":
https://list.orgmode.org/CAN_Dec8n=yntto6uh0dn50fg_hbqhfqtmyocchh7wsyjdm3...@mail.gmail.com/

I believe that xdg-open issue has been fixed by you in
https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=5db61eb0f
org.el: Avoid xdg-open silent failure

So, it may be safe to re-apply that Carsten's commit now.

WDYT?

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



"Full Block" character in example block not visible in Beamer PDF

2024-02-12 Thread Loris Bennett
Hi,

I have a command line tool which generates an ASCII histogram.  I would
like to include the output in a PDF Beamer presentation.

Currently I am using an 'example' block, thus:

  #+begin_example
  ...

  -
  CPU Efficiency (%)
  -
0.00 -  10.00  [ 0]
   10.00 -  20.00  [ 0]
   20.00 -  30.00  [ 0]
   30.00 -  40.00  [ 0]
   40.00 -  50.00  [ 0]
   50.00 -  60.00  [ 0]
   60.00 -  70.00  [ 0]
   70.00 -  80.00  [ 1]  ▉ 
   80.00 -  90.00  [24]     
 
   90.00 - 100.00  [48]     
 

  ...
  #+end_example

The blocks of the histogram are present in the PDF, but are white, like
the background of the slides.  I can see this by marking them with the
mouse.

Does anyone know what I need to do to make the full block character
visible in this situation?

Cheers,

Loris


-- 
This signature is currently under constuction.