Re: org-table-blank-field key binding removal

2021-10-05 Thread Kyle Meyer
On 10/05/21 21:49:22 -0500, Alan Wehmann wrote:
> On 2/5/21 in this email list Carsten Dominik suggested removing the
> key binding C-c  for "org-table-blank-field".  That got
> implemented for Org-9.5, but the Info file didn't get changed, so it
> still says:
>
> ‘C-c ’ (‘org-table-blank-field’)
>  Blank the field at point.
>
> in node (org) Built-in Table Editor

Thank you for catching that.  I've updated the manual in 6874af872.

> In my own usage of tables I use this key binding a lot, so I am going
> to figure how to restore it.

Sorry about that.  You can restore it on your end by putting something
like this in your config:

  (define-key org-mode-map (kbd "C-c SPC") #'org-table-blank-field)



org-table-blank-field key binding removal

2021-10-05 Thread Alan Wehmann
On 2/5/21 in this email list Carsten Dominik suggested removing the key binding 
C-c  for "org-table-blank-field".  That got implemented for Org-9.5, but 
the Info file didn't get changed, so it still says:

‘C-c ’ (‘org-table-blank-field’)
 Blank the field at point.

in node (org) Built-in Table Editor

In my own usage of tables I use this key binding a lot, so I am going to figure 
how to restore it.

I don't subscribe to this list, because it's too overwhelming.

Alan Wehmann
alan.wehm...@gmail.com



Re: [BUG] org-save-all-org-buffers reapplies startup visibility [9.5 (release_9.5 @ /usr/local/share/emacs/29.0.50/lisp/org/)]

2021-10-05 Thread No Wayman

Confirmed with the following, simpler, test case:

Yodel[1] Report 2021-10-05 22:07:33
===

--8<---cut here---start->8---
(yodel
 :user-dir "org-save-all-org-buffers"
 :packages* org
 :formatter yodel-format-as-mailing-list-message
 :post*
 (yodel-file "./test.org"
   :with*
   "#+startup: overview
* A
** B"
   :then*
   (require 'org-element)
   (defun +org-visible nil
 (org-element-interpret-data
  (org-element-parse-buffer nil 'visible-only)))
   (message "%s
%s" "Before `org-save-all-org-buffers':"
(+org-visible))
   (set-buffer-modified-p t)
   (org-save-all-org-buffers)
   (message "%s
%s" "After `org-save-all-org-buffers':"
(+org-visible
--8<---cut here---end--->8---

STDOUT
==

Loading 
/tmp/org-save-all-org-buffers/straight-bootstrap-snippet.el 
(source)...

Before `org-save-all-org-buffers':



#+startup: overview
* A
** B



Saving all Org buffers...



Saving all Org buffers... done
After `org-save-all-org-buffers':



#+startup: overview
* A


Environment
===

- emacs version: GNU Emacs 28.0.50 (build 1, x86_64-pc-linux-gnu, 
 X toolkit, cairo version 1.17.4, Xaw3d scroll bars)

of 2021-09-29
- system type: gnu/linux

Packages


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


The behavior of `save-some-buffers' PRED argument changed 
recently:


https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=a9ad3d477441feefa3bf6107d58281cb64e0e78a

If the PRED returns a function, that function is called.
Since `derived-mode-p' returns the symbol `org-mode', Org is being 
reloaded in modified buffers.
That's what is causing the visibility change. 
This could also have other undesirable behavior such as running 
the mode hook, resetting buffer-local variables, etc.


The attached patch ensures we're returning a boolean from the PRED 
function.

Tested with:

Yodel[1] Report 2021-10-05 22:07:33
===

--8<---cut here---start->8---
(yodel
 :user-dir "org-save-all-org-buffers.patch"
 :packages*
 (org :host github :repo "progfolio/org-mode" :branch 
 "fix/org-save-all-org-buffers")

 :formatter yodel-format-as-mailing-list-message
 :post*
 (yodel-file "./test.org"
   :with*
   "#+startup: overview
* A
** B"
   :then*
   (require 'org-element)
   (defun +org-visible nil
 (org-element-interpret-data
  (org-element-parse-buffer nil 'visible-only)))
   (message "%s
%s" "Before `org-save-all-org-buffers':"
(+org-visible))
   (set-buffer-modified-p t)
   (org-save-all-org-buffers)
   (message "%s
%s" "After `org-save-all-org-buffers':"
(+org-visible
--8<---cut here---end--->8---

STDOUT
==

Loading 
/tmp/org-save-all-org-buffers.patch/straight-bootstrap-snippet.el 
(source)...

Bootstrapping straight.el...
Bootstrapping straight.el...done
Rebuilding all packages due to build cache schema change
Looking for gnu-elpa-mirror recipe → Cloning melpa...
Looking for gnu-elpa-mirror recipe → Cloning melpa...done
Looking for emacsmirror-mirror recipe → Cloning 
gnu-elpa-mirror...
Looking for emacsmirror-mirror recipe → Cloning 
gnu-elpa-mirror...done

Looking for emacsmirror-mirror recipe → Cloning el-get...
Looking for emacsmirror-mirror recipe → Cloning el-get...done
Looking for straight recipe → Cloning emacsmirror-mirror...
Looking for straight recipe → Cloning emacsmirror-mirror...done
Building straight...
Building straight...done
Cloning org...
Cloning org...done
Building org...
Building org...done



Before `org-save-all-org-buffers':



#+startup: overview
* A
** B



Saving all Org buffers...



Saving all Org buffers... done
After `org-save-all-org-buffers':



#+startup: overview
* A
** B


Environment
===

- emacs version: GNU Emacs 28.0.50 (build 1, x86_64-pc-linux-gnu, 
 X toolkit, cairo version 1.17.4, Xaw3d scroll bars)

of 2021-09-29
- system type: gnu/linux

Packages


- org 
 https://github.com/progfolio/org-mode/commit/f1fc22f861ca9610ad4f1e1227660712b46337e4



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

>From f1fc22f861ca9610ad4f1e1227660712b46337e4 Mon Sep 17 00:00:00 2001
From: Nicholas Vollmer 
Date: Tue, 5 Oct 2021 21:07:01 -0400
Subject: [PATCH] lisp/org.el: (org-save-all-org-buffers): Prevent `org-mode'
 reload

* lisp/org.el: (org-save-all-org-buffers): Ensure `save-some-buffers' PRED returns boolean.

As of this upstream commit:

https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=a9ad3d477441feefa3bf6107d58281cb64e0e78a

`save-some-buffers' will call its PRED argument if it returns a function.
Since (derived-mode-p 'org-mode) returns the symbol org-mode,
and org-mode is a function, org-mode is reloaded in modified Org
buffers when calling `org-save-all-org-buffers'. Among other
undesirable behavior, this will cause the buffer's visibility to be
reset to 

[PATCH] ob-R async evaluation

2021-10-05 Thread Jeremie Juste
Hello,

I'm attaching a patch that clean up a bit of non conventional coding
practices (mainly because of my ignorance), in ob-R. These were
initially generating warning during the compilation of org-mode.

The main feature is the use of the defvaralias ess-eval-visibly-p when
the :result output in async evaluation. 

With this change make does not generate any warning for ob-R.el and all
the test of ob-R.el passes, so no significant change for the user.

Best regards,
Jeremie



0001-ob-R.el-Patch-4-async-evaluation.patch
Description: Adobe PDF document


Re: cite page number

2021-10-05 Thread Ypo
You are right. Chapters with reference to pages.


Oct 5, 2021 23:24:22 Bruce D'Arcus :

> On Tue, Oct 5, 2021 at 3:57 PM Ypo  wrote:
> 
>> I think that already works. For me it was overkilling when I tried to use it 
>> for my personal notes. It was too much work and it cluttered my "global" 
>> references.bib with an item for each cited page.
>> 
>> But maybe that would be the correct way? Since in the bibliography 
>> references it must appear one item for each cited chapter or pages?
> 
> I've never heard of separate bibliographic entries for each page.
> 
> Chapters are a different matter, at least in edited books, since they
> are different works.
> 
> Bruce



Re: Citation not inserted as 1st item in footnote (using org-cite and org-ref-cite)

2021-10-05 Thread Nicolas Goaziou
Hello,

Elias Bounatirou  writes:

> I have looked at the problem that citations cannot be inserted as 1st items
> in footnotes once again more closely. It has become obvious for me that
> this is indeed a bug of org-cite or rather a default setting which was
> deliberately introduced, although it is not really user-friendly or
> practical to my mind.

This is not intentional.

> I modified the function org-cite--allowed-p in oc.el  and inserted
> 'footnote-definition' in the following lines:
>
> ;; Paragraphs and blank lines at top of document are fine.
>  ((memq type '(nil paragraph footnote-definition)))

This allows one to insert a citation in the middle of the citation
number, which is not desirable either. IOW, an additional check is
required.

Regards,
-- 
Nicolas Goaziou



Re: Citation not inserted as 1st item in footnote (using org-cite and org-ref-cite)

2021-10-05 Thread Elias Bounatirou
I have looked at the problem that citations cannot be inserted as 1st items
in footnotes once again more closely. It has become obvious for me that
this is indeed a bug of org-cite or rather a default setting which was
deliberately introduced, although it is not really user-friendly or
practical to my mind.

I modified the function org-cite--allowed-p in oc.el  and inserted
'footnote-definition' in the following lines:

;; Paragraphs and blank lines at top of document are fine.
 ((memq type '(nil paragraph footnote-definition)))

(I leave the comment in its original form to make the passage easier to
identify.) 'footnote-definition' by the way does not appear anywhere in
org-cite--allowed-p in its current form.
After this I can easily insert footnotes as 1st items in citations, and I
do not get Org's warning "Cannot insert citation here".

Am Sa., 18. Sept. 2021 um 22:39 Uhr schrieb Bruce D'Arcus :

> Elias - do you mean org-cite-insert won't allow this?
>
> [fn:1] [cite:@doe2019].
>
> If yes, I don't see that; it inserts fine.
>
> I'm using bibtex-actions for the insert processor, but I don't think
> that should make any difference, since it's org-cite that's handling
> that.
>
> On Sat, Sep 18, 2021 at 4:23 PM Elias Bounatirou
>  wrote:
> >
> > Hi,
> > When I try to insert a citation as the first item into a
> non-inline-definition footnote, org-ref-cite refuses to insert the citation
> returning in the minibuffer "Cannot insert citation here". The same problem
> does not occur if the footnote has an inline definition. As for
> non-inline-definition footnotes, if I copy the citation into the footnote,
> no problem occurs, either. The citation is also properly exported to LaTeX.
> > Is this a problem of org-cite/org-mode in general or rather of
> org-ref-cite?
> >
> > Best regards,
> > Elias
>


Re: cite page number

2021-10-05 Thread Bruce D'Arcus
On Tue, Oct 5, 2021 at 3:57 PM Ypo  wrote:

> I think that already works. For me it was overkilling when I tried to use it 
> for my personal notes. It was too much work and it cluttered my "global" 
> references.bib with an item for each cited page.
>
> But maybe that would be the correct way? Since in the bibliography references 
> it must appear one item for each cited chapter or pages?

I've never heard of separate bibliographic entries for each page.

Chapters are a different matter, at least in edited books, since they
are different works.

Bruce



Re: Citation in footnote not expanded/exported to LaTeX (using Org-ref-cite)

2021-10-05 Thread Elias Bounatirou
Many thanks to Nicolas and Bruce for their mails and their help.
However, it appears Nicolas' MWE unfortunately does not  reproduce the
issue. It's not the footnote that is omitted/ not exported, it's the
citation in the footnote that is left out (when the footnote follows two or
more citations, of which one has a suffix). In Nicolas' MWE, there is no
citation in the footnote. What seems to me (being no export on LaTeX)
strange about Bruce's LaTeX output is that there is no command
\footnote{...} or the like. So is the footnote-part of the LaTeX output
real LaTeX? (Sorry for this naïve question.)

I've tested again.
With verbose I get the same erroneous result: the citation in the footnote
is not rendered (using the development version of org-mode, see below):
INPUT:

#+LANGUAGE: en
#+latex_header:\usepackage{minted}
#+bibliography_style: plain
#+cite_export: biblatex verbose
# Bibliography (bib file) specified within org-ref-cite in the init file

Body text [cite: @ravlic2021; @saric2010 with a SUFFIX][fn:1]
\printbibliography

#+begin_src emacs-lisp
(org-version)
#+end_src

#+RESULTS:
: 9.5

#+begin_src emacs-lisp
(emacs-version)
#+end_src

#+RESULTS:
: GNU Emacs 27.2 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.20, cairo
version 1.16.0)
:  of 2021-06-04

* Footnotes

[fn:1]Test [cite: @senker1987]

LaTeX OUTPUT (shortened):

Body text \autocites{ravlic2021}[][with a SUFFIX]{saric2010}\footnote{Test}


\printbibliography


As a work around I insert a zero width space before footnotes in the
context described.


Am Mo., 4. Okt. 2021 um 16:26 Uhr schrieb Bruce D'Arcus :

> On Mon, Oct 4, 2021 at 10:11 AM Bruce D'Arcus  wrote:
> >
> > On Sun, Oct 3, 2021 at 6:23 PM Nicolas Goaziou 
> wrote:
> > >
> > > Hello,
> > >
> > > Elias Bounatirou  writes:
> > >
> > > > Just to clarify the BUG:
> > > > Citations in a footnote in the following environment are not
> exported to
> > > > LaTeX: when the footnote follows two or more citations, of which one
> has a
> > > > suffix, i.e. for instance in
> > > >
> > > > Body text with a citation: [cite:@low2001; @mcneill2011 with a
> > > > suffix][fn:3].
> > >
> > > I cannot reproduce the problem. With the following document:
> > >
> > > --8<---cut here---start->8---
> > > #+bibliography: foo.bibtex
> > > #+cite_export: biblatex authoryear
> >
> > Can you try with a note-based style like verbose?
>
> Now I'm not sure.
>
> Input:
>
> 
> #+language: en
> #+bibliography: test.bib
> #+cite_export: biblatex verbose
>
> Body text with a citation: [cite:@low2001; @mcneill2011; with a
> suffix][fn:1].
>
> #+print_bibliography:
>
> * Footnotes
>
> [fn:1] Third commentary, and then a citation: [cite:@low2001].
> ---
>
> LaTeX output:
>
> ---
> Body text with a citation: \autocites(with a
> suffix){low2001}[][]{mcneill2011}\relax[1].
>
> \printbibliography
>
>
>
> Footnotes
> ─
>
> [1] Third commentary, and then a citation: \autocite{low2001}.
> ---
>
> But the PDF leaves off the last citation, in the footnote.
>
> Bruce
>


Re: cite page number

2021-10-05 Thread Ypo
I think that already works. For me it was overkilling when I tried to use it 
for my personal notes. It was too much work and it cluttered my "global" 
references.bib with an item for each cited page.

But maybe that would be the correct way? Since in the bibliography references 
it must appear one item for each cited chapter or pages?



Oct 5, 2021 18:01:56 emacs-orgmode-requ...@gnu.org:

> How would this work?
> 
> Does [cite/locators:@someone-2021].
> 
> imply a specific field in a bibliography entry, e.g. pages, or location?
> and then CSL is responsible for formatting it to something like "p. 42" or
> "pp. 42-44", etc?
> 
> And then if you want to refer to another page in someone-2021, then you
> need another bibliography entry with a different key for that, e.g.
> someone-2021-87 that might have page 87 in it?
> 
> John
> 
> ---
> Professor John Kitchin (he/him/his)
> Doherty Hall A207F
> Department of Chemical Engineering
> Carnegie Mellon University
> Pittsburgh, PA 15213
> 412-268-7803
> @johnkitchin
> http://kitchingroup.cheme.cmu.edu



Re: Fwd: [BUG] org-save-all-org-buffers reapplies startup visibility [9.5 (release_9.5 @ /usr/local/share/emacs/29.0.50/lisp/org/)]

2021-10-05 Thread Michael Powe

forgot to hit 'reply all.'


 Forwarded Message 
Subject:Re: [BUG] org-save-all-org-buffers reapplies startup
visibility [9.5 (release_9.5 @ /usr/local/share/emacs/29.0.50/lisp/org/)]
Date:   Tue, 5 Oct 2021 15:47:42 -0400
From:   Michael Powe 
To: Bhavin Gandhi 



Hello,

I hesitate to reply, but here's a report from Windows 10.

works as expected
C:\Emacs\emacs-28\bin\runemacs.exe -Q -L
C:\Users\micha\AppData\Roaming\.emacs.d\elpa\org-9.5\ 'G:\My
Drive\org\daily.org'
GNU Emacs 28.0.50 (build 1, x86_64-w64-mingw32) of 2021-08-11
Org mode version 9.5 (9.5-g0a86ad @
c:/Users/micha/AppData/Roaming/.emacs.d/elpa/org-9.5/)

Now for the bad news.

does not save files at all!
C:\Emacs\emacs29\bin\runemacs.exe -Q 'G:\My Drive\org\daily.org'
GNU Emacs 29.0.50 (build 1, x86_64-w64-mingw32) of 2021-10-02
Org mode version 9.5 (release_9.5 @
c:/Emacs/emacs29/share/emacs/29.0.50/lisp/org/)

Upon invoking the save, contents of the file shift to the left, then
shift back; and that's it.

HTH.

mp

Bhavin Gandhi wrote on 10/5/2021 13:53:
> Hello Marcel,
>
> On Tue, 5 Oct 2021 at 19:14, Marcel van der Boom  wrote:
>> […]
>> - emacs -Q test.org
>> - make sure the outline is unfolded
>> - make a change so test.org is 'dirty'
>> - M-x org-save-all-org-buffers
>>
>> Observed behaviour:
>> The outline in test.org will collapse and only show 'Header one'
>>
>> Expected behaviour:
>> Outline state does not change on calling `org-save-all-buffers`
>>
> I tried to follow the above steps with Emacs 27.1, and Org mode latest
> main branch as well as the release_9.5 tag. The only different step I
> took was this:
>
> emacs -Q -L ~/src/org-mode/lisp/ ~/test.org
>
> When I modify the test.org and call org-save-all-org-buffers, all the
> headings remain unfolded. I tried to switch to a different buffer and
> called the function, but still it remained in overview state. Maybe
> someone with the latest Emacs build from master can try to reproduce?
>

-- 
Sent from Postbox 


signature.asc
Description: OpenPGP digital signature


Re: Best way to include METAPOST in ConTeXt exporter

2021-10-05 Thread Jason Ross

Here's a hook that modifies the source blocks to wrap their
output in #+BEGIN/END_METAPOST tags if the ConTeXt backend is used,
before Org Babel gets to them, but otherwise leaves them alone.

I wonder if anyone has any better ideas of how to do this. I'm
modifying the Org source with the hook before the document gets parsed
so that it can be more backend-agnostic but it seems like it would
be better if there was a way to modify the document parse tree
directly instead. I don't like that I'm effectively parsing and
rebuilding (hopefully) the same string in order to change the :result
type.

I also don't like that I don't really have a clean way of turning
the hook on and off with document keywords. This is kind of a nasty
thing to do to a document and users should probably have to explicitly
opt in.

I also found an old answer that describes how to add captions
to figures generated by source blocks:
https://www.mail-archive.com/emacs-orgmode@gnu.org/msg68100.html
Probably not news to many other people on this list but myself :)
#+TITLE: Metapost Handler

This is a basic handler for METAPOST that exports as raw code
when the ConTeXt exporter is used but otherwise does whatever you
tell it to.

#+NAME: hooks
#+BEGIN_SRC emacs-lisp :exports none :results none
(defun format-src-block-arguments (arguments)
  "Returns a formatted plist of header arguments"
  (mapconcat
   (lambda (argument)
 (let ((kw (car argument))
   (vals (cdr argument)))
   (concat (format "%s" kw)
   " "
   (format "%s" vals
   arguments
   " "))
(defun metapost-process-hook (backend)
  "If BACKEND is `context', change metapost code blocks to output
raw code wrapped in #+BEGIN_METAPOST/#+END_METAPOST tags."
  ;; TODO This should be controlled by a flag.
  ;; TODO Check buffer info to see if we are allowed to do this.
  (when (string= backend "context")
(goto-char (point-min))
(let ((case-fold-search t)
  ;; Search for source code with a regex
  (regexp "^[ \t]*#\\+BEGIN_SRC"))
  (while (re-search-forward regexp nil t)
(let* ((objectp (match-end 1))
   (tree (org-element-parse-buffer))
   ;; Get the buffer info plist (need this to export a caption)
   (info (org-combine-plists
 (org-export--get-export-attributes)
 (org-export-get-environment)))
   (info (progn
  (org-export--prune-tree tree info)
  (org-export--remove-uninterpreted-data tree info)
  (org-combine-plists info
  (org-export--collect-tree-properties
   tree info
   ;; Get a code element
   (element
(save-match-data
  (if objectp (org-element-context) (org-element-at-point
   (caption (org-element-property :caption element))
   (type (org-element-type element))
   (begin (copy-marker (org-element-property :begin element)))
   (end (copy-marker
 (save-excursion
   (goto-char (org-element-property :end element))
   (skip-chars-backward " \r\t\n")
   (point
   (block-info (org-babel-get-src-block-info t))
   (language (nth 0 block-info))
   (body (nth 1 block-info))
   (arguments (nth 2 block-info))
   (arguments (delq (assoc :file arguments) arguments))
   (switches (nth 3 block-info))
   (name (nth 4 block-info))
   (start (nth 5 block-info))
   (coderef (nth 6 block-info)))

  (when (or t (string= (downcase language) "metapost"))
;; Remove "file" from `results' setting
(setf (alist-get :results arguments)
  (mapconcat
   #'identity
   (seq-filter
(lambda (a) (not (string= a "file")) )
(split-string (alist-get :results arguments)))
   " "))
;; Add a wrap argument to wrap in a METAPOST special block
(setf (alist-get :wrap arguments) "METAPOST")
(pcase type
  (`src-block
   (progn
 (delete-region begin end)
 (goto-char begin)
 (insert
  (concat
   ;; Captions and names got deleted; add them back
   (when (org-string-nw-p name)
 (format "#+NAME: %s \n" name))
   (when caption
 (format "#+CAPTION: %s\n"
 (org-string-nw-p
  (org-trim
   (org-export-data
(or
 (org-export-get-caption element t)

Re: Some broken links in pages under https://orgmode.org/worg/org-contrib/babel

2021-10-05 Thread Thomas S. Dye



Daniel Fleischer  writes:

- "org-contrib/babel/library-of-babel" not sure why it doesn't 
appear on

  the server because the file compiles locally to HTML.


A bad link blocked HTML compilation on the server.  Fixed now, 
thanks.


All the best,
Tom

--
Thomas S. Dye
https://tsdye.online/tsdye



Re: [BUG] org-save-all-org-buffers reapplies startup visibility [9.5 (release_9.5 @ /usr/local/share/emacs/29.0.50/lisp/org/)]

2021-10-05 Thread Bhavin Gandhi
Hello Marcel,

On Tue, 5 Oct 2021 at 19:14, Marcel van der Boom  wrote:
> […]
> - emacs -Q test.org
> - make sure the outline is unfolded
> - make a change so test.org is 'dirty'
> - M-x org-save-all-org-buffers
>
> Observed behaviour:
> The outline in test.org will collapse and only show 'Header one'
>
> Expected behaviour:
> Outline state does not change on calling `org-save-all-buffers`
>

I tried to follow the above steps with Emacs 27.1, and Org mode latest
main branch as well as the release_9.5 tag. The only different step I
took was this:

emacs -Q -L ~/src/org-mode/lisp/ ~/test.org

When I modify the test.org and call org-save-all-org-buffers, all the
headings remain unfolded. I tried to switch to a different buffer and
called the function, but still it remained in overview state. Maybe
someone with the latest Emacs build from master can try to reproduce?

-- 
Regards,
Bhavin Gandhi (bhavin192) | https://geeksocket.in



Re: [PATCH] [BUG] Org 9.5: org-goto UI seems broken

2021-10-05 Thread Ihor Radchenko
Max Nikulin  writes:

> Thank you, Ihor. I am a user of alternative `org-goto' interface. I have 
> tried default one having a couple of windows in the frame (indirect 
> buffer for subtree, indirect for src block). It seems, previous window 
> configuration is restored correctly when `org-goto' is finished.
>
> Curiously `org-no-popup' was introduced namely for `org-goto`

Thanks for the testing and digging the old commits.

I tried come up with the reason why org-no-popup was used in the initial
implementation. I think, the reason is avoiding situation like what you
may see after running
(let ((pop-up-frames t)) (funcall-interactively #'org-goto))
So, removing the macro completely is not a good idea.

I have updated the patch that should work without dropping the macro.
See the attached.

Best,
Ihor

>From 438c476066e897b1fc3d758fd48712c1846cd845 Mon Sep 17 00:00:00 2001
Message-Id: <438c476066e897b1fc3d758fd48712c1846cd845.1633451289.git.yanta...@gmail.com>
From: Ihor Radchenko 
Date: Tue, 5 Oct 2021 20:37:02 +0800
Subject: [PATCH] org-goto: Fix window broken arrangement after 399481bad

* lisp/org-goto.el (org-goto-location): Make sure that `org-on-popups'
macro does not suppress the *Org Help* window pop-up.

Fixes https://list.orgmode.org/e169a2f9-72b1-02bb-96c1-6e7368f64...@gmail.com/T/#t
---
 lisp/org-goto.el | 19 ++-
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/lisp/org-goto.el b/lisp/org-goto.el
index 0a3470f54..cd832d72c 100644
--- a/lisp/org-goto.el
+++ b/lisp/org-goto.el
@@ -217,15 +217,16 @@ (defun org-goto-location ( _buf help)
 	  (condition-case nil
 	  (make-indirect-buffer (current-buffer) "*org-goto*" t)
 	(error (make-indirect-buffer (current-buffer) "*org-goto*" t
-	 (let (temp-buffer-show-function temp-buffer-show-hook)
-	   (with-output-to-temp-buffer "*Org Help*"
-	 (princ (format help (if org-goto-auto-isearch
- "  Just type for auto-isearch."
-   "  n/p/f/b/u to navigate, q to quit.")
-	 (org-fit-window-to-buffer (get-buffer-window "*Org Help*"))
-	 (org-overview)
-	 (setq buffer-read-only t)
-	 (if (and (boundp 'org-goto-start-pos)
+ (let ((pop-up-windows t))
+	   (let (temp-buffer-show-function temp-buffer-show-hook)
+	 (with-output-to-temp-buffer "*Org Help*"
+	   (princ (format help (if org-goto-auto-isearch
+   "  Just type for auto-isearch."
+ "  n/p/f/b/u to navigate, q to quit.")
+	   (org-fit-window-to-buffer (get-buffer-window "*Org Help*")))
+ (org-overview)
+ (setq buffer-read-only t)
+ (if (and (boundp 'org-goto-start-pos)
 		  (integer-or-marker-p org-goto-start-pos))
 	 (progn (goto-char org-goto-start-pos)
 		(when (org-invisible-p)
-- 
2.32.0



Re: [Worg] New subdirectory not fully built?

2021-10-05 Thread Adam Porter
Max Nikulin  writes:

> It seems, you have managed to solve the problem, I guess, by fixing
> link targets:
>
> https://git.sr.ht/~bzg/worg/commit/31f4212874e1bc54f335e329f6bcee83801dcf9c

I did that, but see also the following commit where I gave in and set
"broken-links:t".  There were too many internal "id:" links to convert
manually in that very old file that few will ever read, anyway.  :)

(And I thought that "id:" links worked in exported files, but apparently
not?)




Re: [PATCH] Accept more :tangle-mode specification forms

2021-10-05 Thread Timothy
Hi  Jeremy,

> I think this is a good idea and don’t see any problems (or other
> suggestions) with the proposed formats.
>
> The existing (identity #o0755) will still function, correct?
> i.e. backward compatibility.

It should yes. I’ll double check before I actually push the commit.

All the best,
Timothy


Re: [PATCH] Accept more :tangle-mode specification forms

2021-10-05 Thread tomas
On Tue, Oct 05, 2021 at 10:45:59PM +0800, Timothy wrote:
> Hi  Everyone,
> 
> It feels like we’re near a patch that would be good to merge. I would very 
> much
> like to get feedback on what I proposed in my reply to Tom though (see below).

OK. Since I made some noises, I feel compelled to feed back :)

> >> That said, reducing the number of forms as Eric suggests would
> >> be a happy medium.
> >
> > Indeed, I’ve basically supported every form I could think of. I’m currently
> > inclined to cut it down to:
> > • 755
> > • “rwxrw-r–” (`ls -l’ style)
> > • chmod style with `org-babel-tangle-default-mode’ and 
> > `file-modes-symbolic-to-number’

This looks perfect to me.

> > Maybe with (if anybody says they would like this)
> > • #o755 (elisp octal)
> > • 0755 (C octal)
> > • “rwx” = user perm, bit-or’d with `org-babel-tangle-default-mode’ for the 
> > rest
> >   (i.e. `org-babel-tangle-default-mode’, but not exceeding the user perm)

I wouldn't miss those, having the above. Less is more, IMHO.

Thanks for your work, and for the way you do it. You rock!

Cheers
 - t


signature.asc
Description: Digital signature


Re: [PATCH] Accept more :tangle-mode specification forms

2021-10-05 Thread unkn...@email.com
Timothy  writes:

> It feels like we’re near a patch that would be good to merge. I would very 
> much
> like to get feedback on what I proposed in my reply to Tom though (see below).
>
>> Maybe with (if anybody says they would like this)
>> • #o755 (elisp octal)
>> • 0755 (C octal)
>> • “rwx” = user perm, bit-or’d with `org-babel-tangle-default-mode’ for the 
>> rest

I think this is a good idea and don't see any problems (or other
suggestions) with the proposed formats.

The existing (identity #o0755) will still function, correct?
i.e. backward compatibility.

--
Jeremy Cowgar



Re: [Worg] New subdirectory not fully built?

2021-10-05 Thread Max Nikulin

On 02/10/2021 18:54, Adam Porter wrote:


I took the liberty of creating a new "archive" subdirectory in Worg to
preserve some obsolete content (like "Fireforg", an extension which its
Worg entry said hasn't been developed since 2009):

https://orgmode.org/worg/archive/index.html

The archive's index page is exported, but the linked "fireforg.org"
file, in the same directory, appears to not have been generated, as it
returns 404:

https://orgmode.org/worg/archive/fireforg.html

I checked other subdirectories' indexes and files, and I made the link
in the same way, so I don't know if I did something wrong, or if there's
something else going on.


It seems, you have managed to solve the problem, I guess, by fixing link 
targets:


https://git.sr.ht/~bzg/worg/commit/31f4212874e1bc54f335e329f6bcee83801dcf9c





Re: Bare oc-csl author variants?

2021-10-05 Thread Bruce D'Arcus
On Tue, Oct 5, 2021 at 11:04 AM Timothy  wrote:

> Sounds like the general attitude is “why not?”. So I’ve turned my snippet 
> into a
> patch and unless any concerns are raised in the next few days I’ll push it to
> main.

For parity, it would probably make sense to add the equivalent to
oc-natbib and oc-biblatex if someone gets a chance.

Bruce



Re: [PATCH] Accept more :tangle-mode specification forms

2021-10-05 Thread Timothy
Hi  Everyone,

It feels like we’re near a patch that would be good to merge. I would very much
like to get feedback on what I proposed in my reply to Tom though (see below).

>> That said, reducing the number of forms as Eric suggests would
>> be a happy medium.
>
> Indeed, I’ve basically supported every form I could think of. I’m currently
> inclined to cut it down to:
> • 755
> • “rwxrw-r–” (`ls -l’ style)
> • chmod style with `org-babel-tangle-default-mode’ and 
> `file-modes-symbolic-to-number’
>
> Maybe with (if anybody says they would like this)
> • #o755 (elisp octal)
> • 0755 (C octal)
> • “rwx” = user perm, bit-or’d with `org-babel-tangle-default-mode’ for the 
> rest
>   (i.e. `org-babel-tangle-default-mode’, but not exceeding the user perm)

All the best,
Timothy


Re: [org-cite] How to cite page number(s) in APA Style?

2021-10-05 Thread John Kitchin
Got it, thanks!

John

---
Professor John Kitchin (he/him/his)
Doherty Hall A207F
Department of Chemical Engineering
Carnegie Mellon University
Pittsburgh, PA 15213
412-268-7803
@johnkitchin
http://kitchingroup.cheme.cmu.edu



On Tue, Oct 5, 2021 at 10:54 AM Bruce D'Arcus  wrote:

> On Tue, Oct 5, 2021 at 10:42 AM John Kitchin 
> wrote:
> >
> > How would this work?
> >
> > Does [cite/locators:@someone-2021].
> >
> > imply a specific field in a bibliography entry, e.g. pages, or location?
> and then CSL is responsible for formatting it to something like "p. 42" or
> "pp. 42-44", etc?
>
> As Rudy noted my example was wrong, because I forgot to include the suffix.
>
> Should be:
>
> [cite/locators:@someone-2021 p. 42]
>
> > And then if you want to refer to another page in someone-2021, then you
> need another bibliography entry with a different key for that, e.g.
> someone-2021-87 that might have page 87 in it?
>
> No. Per above, same key and entry; just a different suffix with locator.
>
> [cite/locators:@someone-2021 p. 87]
>
> Sorry for the confusion.
>
>
> Bruce
>


Re: [org-cite] How to cite page number(s) in APA Style?

2021-10-05 Thread Bruce D'Arcus
On Tue, Oct 5, 2021 at 10:42 AM John Kitchin  wrote:
>
> How would this work?
>
> Does [cite/locators:@someone-2021].
>
> imply a specific field in a bibliography entry, e.g. pages, or location? and 
> then CSL is responsible for formatting it to something like "p. 42" or "pp. 
> 42-44", etc?

As Rudy noted my example was wrong, because I forgot to include the suffix.

Should be:

[cite/locators:@someone-2021 p. 42]

> And then if you want to refer to another page in someone-2021, then you need 
> another bibliography entry with a different key for that, e.g. 
> someone-2021-87 that might have page 87 in it?

No. Per above, same key and entry; just a different suffix with locator.

[cite/locators:@someone-2021 p. 87]

Sorry for the confusion.


Bruce



Re: Rescaling #+INCLUDES / Not centering #+INCLUDE?

2021-10-05 Thread Eric S Fraga
A data point: your example works just fine in org 9.5.
-- 
: Eric S Fraga via Emacs 28.0.60, Org release_9.5-62-gcc2490
: Latest paper written in org: https://arxiv.org/abs/2106.05096



Re: [org-cite] How to cite page number(s) in APA Style?

2021-10-05 Thread John Kitchin
How would this work?

Does [cite/locators:@someone-2021].

imply a specific field in a bibliography entry, e.g. pages, or location?
and then CSL is responsible for formatting it to something like "p. 42" or
"pp. 42-44", etc?

And then if you want to refer to another page in someone-2021, then you
need another bibliography entry with a different key for that, e.g.
someone-2021-87 that might have page 87 in it?

John

---
Professor John Kitchin (he/him/his)
Doherty Hall A207F
Department of Chemical Engineering
Carnegie Mellon University
Pittsburgh, PA 15213
412-268-7803
@johnkitchin
http://kitchingroup.cheme.cmu.edu



On Sun, Oct 3, 2021 at 6:59 AM Bruce D'Arcus  wrote:

> On Sun, Oct 3, 2021 at 6:35 AM Rudolf Adamkovič  wrote:
>
> > I use APA (via CSL) to cite and would like to write
> >
> > > According to Someone (2021), foo-bar (p. 42).
> >
> > I can almost do it with
> >
> > > Accordint to [cite/text:@someone-2021], foo-bar
> > > .
> >
> > Any ideas? In APA, this pattern comes up often.
>
> ATM, your only option is to do "(p. 42)."
>
> It would be possible (easy?) to add a "locators" style to
> citeproc-el/oc-csl as in oc-biblatex, in which case you would do:
>
> According to [cite/text:@someone-2021], foo-bar
> [cite/locators:@someone-2021].
>
> Bruce
>
>


Re: Best way to include METAPOST in ConTeXt exporter

2021-10-05 Thread Jason Ross
(Apologies to Ihor who I already replied to without cc'ing the list)
===
> If you are in control of the export backend, you can directly process
> the metapost source blocks during export and ignore/filter their output
> as needed.

This is definitely possible, but I don't want to commit to bypassing the
entire Org Babel system right now. I will explore this a bit.

> Or you can use "raw" results by default and format everything as you
> wish in your Org Babel module programatically.

I'm not sure I understand this yet. Would this emit METAPOST code to the
Org buffer? Ideally, I'd like to emit METAPOST code if the backend is
`context`, otherwise, emit a file.

> If above is not sufficient, you can install global export filters that
> can transform the metapost blocks/source blocks/their results as you
> need in other export backends.

This sounds like it might be a good solution. Is it possible to have an
export filter that changes the header arguments of a source block before
Org Babel sees them? If so, ox-context could change all METAPOST source
block header arguments to give raw results wrapped in appropriate tags.

Also, I'm still curious if there's a better way to add #+CAPTION and
#+NAME tags to images generated by source blocks (in any context). It
would be extremely handy to reference figures generated with
matplotlib throughout the document, not just METAPOST drawings.

Thanks,
Jason

On Mon, Oct 4, 2021 at 9:44 AM Ihor Radchenko  wrote:
>
> Jason Ross  writes:
>
> > I had considered using special blocks; they match my mental model the best.
> > However, they don't provide any support for syntax highlighting or opening
> > the block in a new major mode buffer. I'm not sure if it's worth giving up
> > language features in order to use the block that's most intuitive to users.
> >
> > I'm also considering writing an Org Babel module for METAPOST. This could
> > allow METAPOST figures to be included with any export backend. However,
> > if I go this route, there are still some challenges:
>
> If you are in control of the export backend, you can directly process
> the metapost source blocks during export and ignore/filter their output
> as needed.
>
> >#+MACRO: conditional-header (eval (when (not (eq
> > org-export-current-backend 'context)) (concat  "#+HEADER: :results
> > file :file " $1)))
>
> >#+BEGIN_SRC metapost :results drawer :post
> > wrap_metapost(name="my-name", caption="my-caption", data=*this*)
>
> Or you can use "raw" results by default and format everything as you
> wish in your Org Babel module programatically.
>
> If above is not sufficient, you can install global export filters that
> can transform the metapost blocks/source blocks/their results as you
> need in other export backends.
>
> Best,
> Ihor



Re: Bare oc-csl author variants?

2021-10-05 Thread Timothy
Hi  All,

Sounds like the general attitude is “why not?”. So I’ve turned my snippet into a
patch and unless any concerns are raised in the next few days I’ll push it to
main.

All the best,
Timothy
>From 88f8bb7bc8726c20f3cdd4e8d47d1b487b1c2cd7 Mon Sep 17 00:00:00 2001
From: TEC 
Date: Tue, 5 Oct 2021 22:36:13 +0800
Subject: [PATCH] oc-csl: Support bare author citations

* lisp/oc-csl.el (org-cite-csl--create-structure-params): Add support
for bare (b), bare-caps (bc), bare-full (bf), and bare-caps-full (bcf)
author citation styles.
---
 lisp/oc-csl.el | 4 
 1 file changed, 4 insertions(+)

diff --git a/lisp/oc-csl.el b/lisp/oc-csl.el
index 3d1388075..3d8f8ed03 100644
--- a/lisp/oc-csl.el
+++ b/lisp/oc-csl.el
@@ -300,9 +300,13 @@ (defun org-cite-csl--create-structure-params (citation info)
   ;; "author" style.
   (`(,(or "author" "a") . ,variant)
(pcase variant
+	 ((or "bare" "b") '(:mode author-only :suppress-affixes t))
 	 ((or "caps" "c") '(:mode author-only :capitalize-first t))
 	 ((or "full" "f") '(:mode author-only :ignore-et-al t))
+	 ((or "bare-caps" "bc") '(:mode author-only :suppress-affixes t :capitalize-first t))
+	 ((or "bare-full" "bf") '(:mode author-only :suppress-affixes t :ignore-et-al t))
 	 ((or "caps-full" "cf") '(:mode author-only :capitalize-first t :ignore-et-al t))
+	 ((or "bare-caps-full" "bcf") '(:mode author-only :suppress-affixes t :capitalize-first t :ignore-et-al t))
 	 (_ '(:mode author-only
   ;; "noauthor" style.
   (`(,(or "noauthor" "na") . ,variant)
-- 
2.33.0



Re: [PATCH] [BUG] Org 9.5: org-goto UI seems broken

2021-10-05 Thread Max Nikulin

On 05/10/2021 19:45, Ihor Radchenko wrote:

Max Nikulin writes:


Regression is caused by

commit 399481bad10845a77f210c9320ff1efee9a312c8
Author: Ihor Radchenko 
Date:   Mon May 31 20:47:45 2021 +0800

  Do not ignore user-defined display-buffer-alist in org-insert-link


See the attached fix.  The fix looks reasonable, though I fail to
understand why org-no-popup was even used in org-goto-location.  We kind
of want a popup there.  git blame did not reveal anything useful either.


Thank you, Ihor. I am a user of alternative `org-goto' interface. I have 
tried default one having a couple of windows in the frame (indirect 
buffer for subtree, indirect for src block). It seems, previous window 
configuration is restored correctly when `org-goto' is finished.


Curiously `org-no-popup' was introduced namely for `org-goto`


commit b508943d329fed2af457c50afd5f63938b23c58c
Author: Achim Gratz 
Date:   Thu Dec 20 10:18:02 2012 +0100

org-compat: new macro org-no-popups

* lisp/org-compat.el (org-no-popups): New wrapper macro which

  let-binds the correct variables to suppress popup windows depending
  on the Emacs version in use.  This is a compile-time decision when
  byte-compiling.

* lisp/org.el (org-get-location, org-switch-to-buffer-other-window):

  Use the wrapper `org-no-popups´ to let-bind the correct variables
  for suppression of popup window

To emphasize actual changes due to the patch just suggested by Ihor:

git diff -b HEAD~
diff --git a/lisp/org-goto.el b/lisp/org-goto.el
index 0a3470f54..352bf9f2e 100644
--- a/lisp/org-goto.el
+++ b/lisp/org-goto.el
@@ -203,7 +203,6 @@ When nil, you can use these keybindings to navigate 
the buffer:

   "Let the user select a location in current buffer.
 This function uses a recursive edit.  It returns the selected
 position or nil."
-  (org-no-popups
   (let ((isearch-mode-map org-goto-local-auto-isearch-map)
(isearch-hide-immediately nil)
(isearch-search-fun-function
@@ -236,7 +235,7 @@ position or nil."
(use-local-map org-goto-map)
(recursive-edit)))
 (kill-buffer "*org-goto*")
- (cons org-goto-selected-point org-goto-exit-command
+(cons org-goto-selected-point org-goto-exit-command)))

 ;;;###autoload
 (defun org-goto ( alternative-interface)






Re: Bare oc-csl author variants?

2021-10-05 Thread John Kitchin
These would be equivalent to things like \citeauthor{key} in natbib I think.

John

---
Professor John Kitchin (he/him/his)
Doherty Hall A207F
Department of Chemical Engineering
Carnegie Mellon University
Pittsburgh, PA 15213
412-268-7803
@johnkitchin
http://kitchingroup.cheme.cmu.edu



On Tue, Oct 5, 2021 at 9:29 AM Bruce D'Arcus  wrote:

> On Tue, Oct 5, 2021 at 9:19 AM Timothy  wrote:
>
> > > It’s just odd to have a name without any other citation marker. How
> > > would a reader know it’s a citation?
> >
> > For context, I’m basically just using this as a way to insert the
> author’s name
> > without any chance of typos.
>
> Right.
>
> I don't see any downside in adding them myself.
>
> Bruce
>
>


Rescaling #+INCLUDES / Not centering #+INCLUDE?

2021-10-05 Thread Guillaume MULLER
Hi,

I have Emacs 26.3 + Org mode 9.4.6.

I tried to recompile an org-beamer file I created a few moths ago (see 
equivalent MCE attached), but it did not succeed.

The thing is I was #+INCLUDing a .dot file (also attached for completeness, but 
it could be any .dot file). I was putting the result inside a scalebox:

@@latex: \center \scalebox{.85}{@@
#+INCLUDE: test.dot src dot :file test.png
@@latex:}@@

I don't know how it was translated in previous versions of org-mode but it 
compiled perfectly.

Now I get error "! LaTeX Error: Something's wrong--perhaps a missing \item." 
during LaTeX compilation.

It seems the problem comes from the fact that the included file is 
automatically \begin{center}ed, which conflicts with my scalebox, as seen in 
output .tex file:

\begin{frame}[label={sec:org0a44c10}]{Test Slide}
 \center \scalebox{.85}{
\begin{center}
\includegraphics[width=.9\linewidth]{./images/DesignPatterns/23_DesignPatterns.png}
\end{center}

}
\end{frame}

When I remove the \begin/end{center}, the .tex file compiles fine.

I've tried to add ":center false" in the #+INCLUDE instruction and in a 
#+ATTR_LATEX preceding the #+INCLUDE. With no success.

I cannot find anything about centering (or not) a #+INCLUDE results in the docs 
nor in the mailing list.

Maybe there is a way to rescale the output without the \scalebox too, but I 
couldn't find how. Whatever I put in the #+ATTR_LATEX before the #+INCLUDE or 
in the #+INCLUDE (:cmdline -Gsize for dot) does not seem to be taken into 
account.

So any help would be appreciated.

BTW, thanks for the magnificent tools. I use them everyday and I love them!

Regards,

-- 
Guillaume MULLER
Data Scientist, PhD
Télécom Saint-Étienne (office i119)
25 rue du Dr Remy Annino
-
Laboratoire Hubert Curien (office e002)
18 rue du Pr Benoît Lauras
-
42000 Saint-Étienne
FRANCE


test.dot
Description: application/msword-template
#+STARTUP: showall indent beamer

#+LATEX_CLASS: beamer

* Test Slide

#+ATTR_LATEX: :width .1\textwidth
#+ATTR_DOT: size="9,15"
#+INCLUDE: test.dot src dot results :cmdline -Tpng -Gsize=9,15 -Gdpi=100 :file 
test.png


OpenPGP_signature
Description: OpenPGP digital signature


[BUG] org-save-all-org-buffers reapplies startup visibility [9.5 (release_9.5 @ /usr/local/share/emacs/29.0.50/lisp/org/)]

2021-10-05 Thread Marcel van der Boom



Summary:
When calling `org-save-all-org-buffers` the initial visibility 
setting as specified in `org-startup-folded` or specified in 
=#+STARTUP: overview= will be applied to the org buffer in view.


My usecase is that `org-save-all-org-buffers` is called in an idle 
timer and makes working on org files annoying, as the outline 
keeps changing all the time, for example after returning from an 
interrupting phonecall.


To reproduce:

- create two files:

test.org:

--8<---cut here---start->8---
 #+SETUPFILE: ~/test-config.org

* Header one
 Test header folding on save all buffers
** Header two
 This will collapse after calling org-save-all-org-buffers
--8<---cut here---end--->8---


test-config.org;

--8<---cut here---start->8---
#+STARTUP:overview
--8<---cut here---end--->8---

- emacs -Q test.org
- make sure the outline is unfolded
- make a change so test.org is 'dirty'
- M-x org-save-all-org-buffers

Observed behaviour:
The outline in test.org will collapse and only show 'Header one'

Expected behaviour:
Outline state does not change on calling `org-save-all-buffers`




Emacs  : GNU Emacs 29.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ 
Version 3.24.30, cairo version 1.17.4)

of 2021-10-03
Package: Org mode version 9.5 (release_9.5 @ 
/usr/local/share/emacs/29.0.50/lisp/org/)




Re: Bare oc-csl author variants?

2021-10-05 Thread Bruce D'Arcus
On Tue, Oct 5, 2021 at 9:19 AM Timothy  wrote:

> > It’s just odd to have a name without any other citation marker. How
> > would a reader know it’s a citation?
>
> For context, I’m basically just using this as a way to insert the author’s 
> name
> without any chance of typos.

Right.

I don't see any downside in adding them myself.

Bruce



Re: Bare oc-csl author variants?

2021-10-05 Thread Timothy
Hi  Bruce,

>> Is there any reason why we haven’t added `a/b’, `a/bc’, `a/bf’, `a/bcf’ ?
>
> There is a reason, though it may not be the strongest.
>
> It’s just odd to have a name without any other citation marker. How
> would a reader know it’s a citation?

For context, I’m basically just using this as a way to insert the author’s name
without any chance of typos.

Some thing was introduced in Doe (2019), and some comments about it.
To demonstrate X, Doe considers … which allows Doe to ….

All the best,
Timothy


Re: [PATCH] [BUG] Org 9.5: org-goto UI seems broken

2021-10-05 Thread Adam Porter
Hi Ihor,

> See the attached fix.  The fix looks reasonable, though I fail to
> understand why org-no-popup was even used in org-goto-location.  We kind
> of want a popup there.  git blame did not reveal anything useful either.
>
> Adam, can you test the fix in different scenarios first? I do not use
> org-goto interface, so I only did a light testing.

A quick test seems to indicate that it works again.  Please note that I
only recently started using org-goto myself, so I can't claim to know
all the ways in which it ought to be tested.  :)

Thanks.




Re: [BUG] Org 9.5: org-goto UI seems broken

2021-10-05 Thread Adam Porter
Max Nikulin  writes:

>> Running Org 9.5 on Emacs 28.0.60, I noticed that org-goto seems to be
>> broken:
>>
>> 1. When I press "C-c C-j", instead of displaying the indirect buffer in
>> one window and the org-goto menu in another, only the org-goto window
>> (the "*Org Help*" buffer) is displayed.
>
> Confirmed
>
> Regression is caused by

Thanks.  :)




[PATCH] make quarter work as parameter for :step in clocktable

2021-10-05 Thread Joost Helberg
Hi,

many years ago a colleague and myself wrote a patch for quarters into
org-mode/clocktable for blocks, today I noticed that :step should allow
'quarter' as an argument too. Here's the tiny patch to allow that:

---
 doc/org-manual.org | 2 +-
 lisp/org-clock.el  | 4 +++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/doc/org-manual.org b/doc/org-manual.org
index b25da7889..133d880c7 100644
--- a/doc/org-manual.org
+++ b/doc/org-manual.org
@@ -6738,7 +6738,7 @@ be selected:
 
 - =:step= ::
 
-  Set to =day=, =week=, =semimonth=, =month=, or =year= to split the
+  Set to =day=, =week=, =semimonth=, =month=, =quarter=, or =year= to split the
   table into chunks.  To use this, either =:block=, or =:tstart= and
   =:tend= are required.
 
diff --git a/lisp/org-clock.el b/lisp/org-clock.el
index 143ed4f12..4628d4b5f 100644
--- a/lisp/org-clock.el
+++ b/lisp/org-clock.el
@@ -2822,6 +2822,7 @@ a number of clock tables."
 (`semimonth "Semimonthly report starting on: ")
 (`month "Monthly report starting on: ")
 (`year "Annual report starting on: ")
+(`quarter "Quarterly report starting on: ")
 (_ (user-error "Unknown `:step' specification: %S" step
  (week-start (or (plist-get params :wstart) 1))
  (month-start (or (plist-get params :mstart) 1))
@@ -2873,7 +2874,8 @@ a number of clock tables."
(if (< d 16) 16 1)
(if (< d 16) m (1+ m)) y))
  (`month (list 0 0 0 month-start (1+ m) y))
- (`year (list 0 0 org-extend-today-until 1 1 (1+ 
y)))
+ (`year (list 0 0 org-extend-today-until 1 1 (1+ y)))
+ (`quarter (list 0 0 0 month-start (+ 3 m) y))
  (table-begin (line-beginning-position 0))
 (step-time
   ;; Write clock table between START and NEXT.
-- 
2.25.1

-- 
Cistus



Re: Inequalities in math blocks

2021-10-05 Thread Rudolf Adamkovič

Max Nikulin  writes:

On 05/10/2021 14:55, Rudolf Adamkovič wrote: 
Timothy writes:  
You’re going to be much better off if you just use LaTeX math 
delimiters, i.e. `\( ... \)'. 


Interesting. It works, but I do not understand why! 


Did you inspect HTML file? Playing with export, I do not see 
real  difference. Result is "\(1<2\)" even for $1<2$. 


Oops! I spoke too soon. I re-tried \( and \) with "1" and "2" 
instead of "a" and "b", but that does not break HTML rendering in 
Firefox. When I use "a" and "b" instead, like I did in my original 
post, it does break rendering with both $$ and \( and \).


- \(a>b\) \(bb$ $b- everywhere, but ugh.   R+ 


--
Logic is a science of the necessary laws of thought, without which 
no employment of the understanding and the reason takes place. -- 
Immanuel Kant, 1785  Rudolf Adamkovič  
Studenohorská 25 84103 Bratislava Slovakia  [he/him]




[PATCH] [BUG] Org 9.5: org-goto UI seems broken

2021-10-05 Thread Ihor Radchenko
Max Nikulin  writes:

> Regression is caused by
>
> commit 399481bad10845a77f210c9320ff1efee9a312c8
> Author: Ihor Radchenko 
> Date:   Mon May 31 20:47:45 2021 +0800
>
>  Do not ignore user-defined display-buffer-alist in org-insert-link

See the attached fix.  The fix looks reasonable, though I fail to
understand why org-no-popup was even used in org-goto-location.  We kind
of want a popup there.  git blame did not reveal anything useful either.

Adam, can you test the fix in different scenarios first? I do not use
org-goto interface, so I only did a light testing.

Best,
Ihor

>From 72d62d9f54a356273b2fa8ccf4f71b9faccf280c Mon Sep 17 00:00:00 2001
Message-Id: <72d62d9f54a356273b2fa8ccf4f71b9faccf280c.1633437697.git.yanta...@gmail.com>
From: Ihor Radchenko 
Date: Tue, 5 Oct 2021 20:37:02 +0800
Subject: [PATCH] org-goto: Fix window broken arrangement after 399481bad

* lisp/org-goto.el (org-goto-location): Do not wrap code into
`org-no-popups' macro.  The macro prevents popup windows and we do
want *Org Help* window as a popup herein.

Fixes https://list.orgmode.org/e169a2f9-72b1-02bb-96c1-6e7368f64...@gmail.com/T/#t
---
 lisp/org-goto.el | 67 
 1 file changed, 33 insertions(+), 34 deletions(-)

diff --git a/lisp/org-goto.el b/lisp/org-goto.el
index 0a3470f54..352bf9f2e 100644
--- a/lisp/org-goto.el
+++ b/lisp/org-goto.el
@@ -203,40 +203,39 @@ (defun org-goto-location ( _buf help)
   "Let the user select a location in current buffer.
 This function uses a recursive edit.  It returns the selected
 position or nil."
-  (org-no-popups
-   (let ((isearch-mode-map org-goto-local-auto-isearch-map)
-	 (isearch-hide-immediately nil)
-	 (isearch-search-fun-function
-	  (lambda () #'org-goto--local-search-headings))
-	 (help (or help org-goto-help)))
- (save-excursion
-   (save-window-excursion
-	 (delete-other-windows)
-	 (and (get-buffer "*org-goto*") (kill-buffer "*org-goto*"))
-	 (pop-to-buffer-same-window
-	  (condition-case nil
-	  (make-indirect-buffer (current-buffer) "*org-goto*" t)
-	(error (make-indirect-buffer (current-buffer) "*org-goto*" t
-	 (let (temp-buffer-show-function temp-buffer-show-hook)
-	   (with-output-to-temp-buffer "*Org Help*"
-	 (princ (format help (if org-goto-auto-isearch
- "  Just type for auto-isearch."
-   "  n/p/f/b/u to navigate, q to quit.")
-	 (org-fit-window-to-buffer (get-buffer-window "*Org Help*"))
-	 (org-overview)
-	 (setq buffer-read-only t)
-	 (if (and (boundp 'org-goto-start-pos)
-		  (integer-or-marker-p org-goto-start-pos))
-	 (progn (goto-char org-goto-start-pos)
-		(when (org-invisible-p)
-		  (org-show-set-visibility 'lineage)))
-	   (goto-char (point-min)))
-	 (let (org-special-ctrl-a/e) (org-beginning-of-line))
-	 (message "Select location and press RET")
-	 (use-local-map org-goto-map)
-	 (recursive-edit)))
- (kill-buffer "*org-goto*")
- (cons org-goto-selected-point org-goto-exit-command
+  (let ((isearch-mode-map org-goto-local-auto-isearch-map)
+	(isearch-hide-immediately nil)
+	(isearch-search-fun-function
+	 (lambda () #'org-goto--local-search-headings))
+	(help (or help org-goto-help)))
+(save-excursion
+  (save-window-excursion
+	(delete-other-windows)
+	(and (get-buffer "*org-goto*") (kill-buffer "*org-goto*"))
+	(pop-to-buffer-same-window
+	 (condition-case nil
+	 (make-indirect-buffer (current-buffer) "*org-goto*" t)
+	   (error (make-indirect-buffer (current-buffer) "*org-goto*" t
+	(let (temp-buffer-show-function temp-buffer-show-hook)
+	  (with-output-to-temp-buffer "*Org Help*"
+	(princ (format help (if org-goto-auto-isearch
+"  Just type for auto-isearch."
+  "  n/p/f/b/u to navigate, q to quit.")
+	(org-fit-window-to-buffer (get-buffer-window "*Org Help*"))
+	(org-overview)
+	(setq buffer-read-only t)
+	(if (and (boundp 'org-goto-start-pos)
+		 (integer-or-marker-p org-goto-start-pos))
+	(progn (goto-char org-goto-start-pos)
+		   (when (org-invisible-p)
+		 (org-show-set-visibility 'lineage)))
+	  (goto-char (point-min)))
+	(let (org-special-ctrl-a/e) (org-beginning-of-line))
+	(message "Select location and press RET")
+	(use-local-map org-goto-map)
+	(recursive-edit)))
+(kill-buffer "*org-goto*")
+(cons org-goto-selected-point org-goto-exit-command)))
 
 ;;;###autoload
 (defun org-goto ( alternative-interface)
-- 
2.32.0



Re: Inequalities in math blocks

2021-10-05 Thread Eric S Fraga
Slightly off-topic but, just in case anybody is interested, here is some
code I use to allow me to easily get \(...\) by typing $:

#+begin_src emacs-lisp
  ;; from Nicolas Richard 
  ;; Date: Fri, 8 Mar 2013 16:23:02 +0100
  ;; Message-ID: <87vc913oh5@yahoo.fr>
  (defun yf/org-electric-dollar nil
"When called once, insert \\(\\) and leave point in between.
  When called twice, replace the previously inserted \\(\\) by one $."
 (interactive)
 (if (and (looking-at ")") (looking-back "("))
 (progn (delete-char 2)
(delete-char -2)
(insert "$"))
   (insert "\\(\\)")
   (backward-char 2)))
  (define-key org-mode-map (kbd "$") 'yf/org-electric-dollar)
#+end_src

Typing two $ in a row inserts a single $.
-- 
: Eric S Fraga via Emacs 28.0.60, Org release_9.5-30-g9e71df
: Latest paper written in org: https://arxiv.org/abs/2106.05096



Re: Inequalities in math blocks

2021-10-05 Thread Max Nikulin

On 05/10/2021 14:55, Rudolf Adamkovič wrote:

Timothy writes:

You’re going to be much better off if you just use LaTeX math 
delimiters, i.e. `\( ... \)'.


Interesting. It works, but I do not understand why!


Did you inspect HTML file? Playing with export, I do not see real 
difference. Result is "\(1<2\)" even for $1<2$.


info "(org) LaTeX fragments" https://orgmode.org/manual/LaTeX-fragments.html
highlight some issues with $:

 To avoid conflicts with currency specifications, single ‘$’ characters
are only recognized as math delimiters if the enclosed text contains at
most two line breaks, is directly attached to the ‘$’ characters with no
whitespace in between, and if the closing ‘$’ is followed by whitespace,
punctuation or a dash. For the other delimiters, there is no such
restriction, so when in doubt, use ‘\(...\)’ as inline math delimiters.


Do we consider 
inequalities in $$ breaking HTML export expected behavior? Or, do we 
consider it a bug? I suppose there exists no formal specification, 
executable or not, to answer the question?


Tom Gillespie mentioned in another thread yesterday:

https://orgmode.org/worg/dev/org-syntax.html#Entities_and_LaTeX_Fragments

It would introduce incompatibilities with previous Org versions, but
support for $...$ (and for symmetry, $$...$$) constructs ought to be
removed.

They are slow to parse, fragile, redundant and imply false
positives. — ngz






Re: [BUG] Org 9.5: org-goto UI seems broken

2021-10-05 Thread Max Nikulin

On 05/10/2021 13:31, Adam Porter wrote:


Running Org 9.5 on Emacs 28.0.60, I noticed that org-goto seems to be
broken:

1. When I press "C-c C-j", instead of displaying the indirect buffer in
one window and the org-goto menu in another, only the org-goto window
(the "*Org Help*" buffer) is displayed.


Confirmed

Regression is caused by

commit 399481bad10845a77f210c9320ff1efee9a312c8
Author: Ihor Radchenko 
Date:   Mon May 31 20:47:45 2021 +0800

Do not ignore user-defined display-buffer-alist in org-insert-link

and may be related to https://list.orgmode.org/871rdtupey@joshuao.com
On 06/02/2021 23:33, "Joshua O'Connor" wrote:

I was wondering what the reason is for Org to employ the tactic of
overriding the variable 'display-buffer-alist' in a few places, using
the 'org-no-popups' macro?


Sidenote: I usually use completion in C-u C-c C-j and could not 
reproduce the bug till I have realized that I should not press C-u.




Re: Bare oc-csl author variants?

2021-10-05 Thread Bruce D'Arcus
On Tue, Oct 5, 2021 at 1:35 AM Timothy  wrote:

> Is there any reason why we haven’t added `a/b', `a/bc', `a/bf', `a/bcf' ?

There is a reason, though it may not be the strongest.

It's just odd to have a name without any other citation marker. How
would a reader know it's a citation?

Is it for cases similar to what Rudy asked about the other day, where
you basically have a split citation?

Doe says "something" (2019, p2).

In his case, he was wanting to do:

Doe (2019) says "something" (p2).

If so, may as well add them.

Bruce



Re: Some broken links in pages under https://orgmode.org/worg/org-contrib/babel

2021-10-05 Thread Daniel Fleischer
> Mandar Mitra [2021-10-04 Mon 18:15] wrote:
>
>> * https://orgmode.org/worg/org-contrib/babel/intro.html
>> *** ... relevant section in the 
>> [[https://orgmode.org/manual/Literal-examples.html][Org manual]] ...
>> *** please have a look at the 
>> [[https://orgmode.org/manual/Literal-examples.html][Org-mode manual]] before 
>> proceeding
>> *** blocks located in the 
>> [[https://orgmode.org/worg/org-contrib/babel/library-of-babel.html][Library 
>> of Babel]] file – raw file at
>>
>> * https://orgmode.org/worg/org-contrib/babel/uses.html
>> *** 
>> [[https://orgmode.org/worg/org-contrib/babel/examples/org-check.html][Checking
>>  Your Org Mode Configuration]]
>> *** 
>> [[https://orgmode.org/worg/org-contrib/babel/examples/data-collection-analysis.html][Data
>>  Collection and Analysis]]

Pushed a fix for 2 HTML links fixes.
Pushed a fix for "data-collection-analysis".

- "org-check" needs refactor of the latex section in order to compile.
- "org-contrib/babel/library-of-babel" not sure why it doesn't appear on
  the server because the file compiles locally to HTML.

-- 

Daniel Fleischer



Re: Inequalities in math blocks

2021-10-05 Thread Timothy
Hi  Rudolf,

>> You’re going to be much better off if you just use LaTeX math delimiters, 
>> i.e.
>> `...’.
>
> Interesting. It works, but I do not understand why! Do we consider 
> inequalities
> in $$ breaking HTML export expected behavior? Or, do we consider it a bug? I
> suppose there exists no formal specification, executable or not, to answer the
> question?

Just considering the general situation, $ is hard for Org because it needs to do
“double duty” as both a currency symbol in text, and math delimiters. This means
that it can’t be consistent with how LaTeX works. However, `\( ... \)' doesn’t 
and
so Org can be much more consistent with LaTeX here. Besides which `$ ... $' is a
TeX-ism and `\( ... \)' is the /proper/ way of doing inline maths in LaTeX, so
really you should be reaching for those anyway.

> I ask because if … breaks basic mathematics, I should either return
> back to LaTeX for any serious notes or replace every … with … in all my
> Org files to avoid accidental breakage of mathematics in the future. Thank 
> you!

I’d just use `\( ... \)' in future, and that way you’ll be fine in LaTeX and Org
. You might be able to use `org-element-map' to robustly convert from $ … $=
to `\( ... \)'.

All the best,
Timothy


Re: [org-cite] How to cite page number(s) in APA Style?

2021-10-05 Thread Rudolf Adamkovič

"Bruce D'Arcus"  writes:


You could put in a feature request though ;-)


How?


Aside: […]


Thank you for the explanation!

Rudy 


--
"Contrariwise," continued Tweedledee, "if it was so, it might be; 
and if it were so, it would be; but as it isn't, it ain't. That's 
logic." -- Lewis Carroll, Through the Looking Glass  Rudolf 
Adamkovič  Studenohorská 25 84103 Bratislava 
Slovakia  [he/him]




Re: Inequalities in math blocks

2021-10-05 Thread Rudolf Adamkovič

Timothy  writes:

You’re going to be much better off if you just use LaTeX math 
delimiters, i.e. `\( ... \)'.


Interesting. It works, but I do not understand why! Do we consider 
inequalities in $$ breaking HTML export expected behavior? Or, do 
we consider it a bug? I suppose there exists no formal 
specification, executable or not, to answer the question? I ask 
because if $…$ breaks basic mathematics, I should either return 
back to LaTeX for any serious notes or replace every $…$ with 
\(…\) in all my Org files to avoid accidental breakage of 
mathematics in the future. Thank you!


R+ 


--
Programming reliably --- must be an activity of an undeniably 
mathematical nature [...] You see, mathematics is about thinking, 
and doing mathematics is always trying to think as well as 
possible. -- Edsger W. Dijkstra (1981)  Rudolf Adamkovič 
 Studenohorská 25 84103 Bratislava Slovakia 
[he/him]




[BUG] Org 9.5: org-goto UI seems broken

2021-10-05 Thread Adam Porter
Hi,

Running Org 9.5 on Emacs 28.0.60, I noticed that org-goto seems to be
broken:

1. When I press "C-c C-j", instead of displaying the indirect buffer in
one window and the org-goto menu in another, only the org-goto window
(the "*Org Help*" buffer) is displayed.

2. When I type a letter of a heading, instead of going to a heading
matching that character, I see "No variable specified" in the echo area.

3. When I press "C-g" to exit org-goto, the "*Org Help*" buffer doesn't
get buried, and I see "Quit" in the echo area.

4. When I then press "q", the "*Org Help*" buffer is buried and I'm
shown an "*org-goto*" buffer, which appears to be the indirect clone
that should have been shown.

5. Then when I press "C-g" again, I'm returned to the window
configuration that was shown before I called org-goto.

AFAIK, org-goto worked on Org 9.4.6 that I was using before Org 9.5 was
merged into the Emacs 28.0.x branch.

--
Thanks,
Adam