Could a citation act as a link, or a link to be exported as a citation?

2021-06-07 Thread Ypo
I've been reading you about cites. Conversation is above my head, but 
just in case it could be helpful, I would like to address a frequent 
problem in the workflow of taking notes, that advanced users suffer too.


When taking notes, it's usual to make some bibliographical references in 
one file and some related notes in a different file. I link both using 
internal links, but it can't be exported directly as a bibliography, 
which would be cool indeed.


Could a citation act as a link, or a link to be exported as a citation?

An example, could the link "[[id:20210607T083216.726761][...]]" be 
substituted by a cite, that takes you to the reference?


*Reference (from a .org file, as it is, but if it needed to had /.bib 
structure/ to kind of "unify" internal links and cites, would be fine too):*


 William Denton [w...@pobox.com]. (29 Mar 2021 16:15:18 -0400 (EDT)). 
/About exporting [Respuesta en emacs-orgmode]./ Lista de correo.

:PROPERTIES:
:ID:   20210607T083216.726761
:END:
:LINKS:
- [[id:20210607T083216.765049][Memoir could be flexible,]]
:END:
https://lists.gnu.org/archive/html/emacs-orgmode/2021-03/msg00443.html
To get better at it, I'd recommend reading the manual for the Memoir 
class [1]
(the first few chapters that talk about page design, at least, then 
refer to the
rest as needed) and Robert Bringhurst's THE ELEMENTS OF TYPOGRAPHIC 
STYLE [2]
(which will give you ideas you can implement and right away your 
documents will

look great).

Bill

[1] https://www.ctan.org/pkg/memoir
[2] https://en.wikipedia.org/wiki/The_Elements_of_Typographic_Style



*Note (it could be a task, or a study note, or a note to write a book in 
the future...):*


 Memoir could be flexible, take a look at it.
:PROPERTIES:
:ID:   20210607T083216.765049
:END:
:LINKS:
- [[id:20210607T083216.726761][William Denton [w...@pobox.com]. (29 Mar 
2021 16:15:18 -0400 (EDT)). /About exporting [Respuesta en 
emacs-orgmode]./ Lista de correo.]]

:END:




Cannot schedule something for 2039?

2021-06-07 Thread alan . schmitt
Hello,

I need to schedule something for 2039, but when I do it the date is set
for 2037. I tried with a plain emacs config and I see the same issue. Is
this a bug?

Best,

Alan


signature.asc
Description: PGP signature


Re: Cannot schedule something for 2039?

2021-06-07 Thread Richard Lawrence
Hi Alan,

alan.schm...@polytechnique.org writes:

> I need to schedule something for 2039, but when I do it the date is set
> for 2037. I tried with a plain emacs config and I see the same issue. Is
> this a bug?

whoa, that's a weird behavior, but it seems not to be a bug. I learned
something today!

It looks like some Emacs implementations don't support dates after
2038-1-1, so Org doesn't let you specify them by default. See the
variable `org-read-date-force-compatible-dates'. I think you want to set
this variable to nil.

-- 
Best,
Richard



Re: Cannot schedule something for 2039?

2021-06-07 Thread Samuel Loury
alan.schm...@polytechnique.org writes:

[...]

> I need to schedule something for 2039, but when I do it the date is set
> for 2037. I tried with a plain emacs config and I see the same issue. Is
> this a bug?

Sounds like the bug of 2038¹. I assume that 32 bit integers are used
somewhere to encode the date.

For the record, I see the same behavior.


¹  https://en.wikipedia.org/wiki/Year_2038_problem
-- 
Konubinix
GPG Key: 7439106A
Fingerprint: 5993 BE7A DA65 E2D9 06CE  5C36 75D2 3CED 7439 106A


signature.asc
Description: PGP signature


Re: Cannot schedule something for 2039?

2021-06-07 Thread Alan Schmitt
Hello Richard,

On 2021-06-07 11:17, Richard Lawrence  
writes:

> whoa, that's a weird behavior, but it seems not to be a bug. I learned
> something today!
>
> It looks like some Emacs implementations don't support dates after
> 2038-1-1, so Org doesn't let you specify them by default. See the
> variable `org-read-date-force-compatible-dates'. I think you want to set
> this variable to nil.

Thanks a lot for pointing to this variable, its docstring is quite
interesting.

I’m trying the workaround suggested (using a diary sexp, i.e.,
"<%%(diary-date 2039 4 2)>" in my case), but I cannot test it (the
agenda for that date won’t build, at the date is outside the range). I
guess this will be fixed by then ;)

Best,

Alan


signature.asc
Description: PGP signature


Re: Could a citation act as a link, or a link to be exported as a citation?

2021-06-07 Thread Ypo

Thanks, Jonathan

I don't know much about Hyperbole, but it looked kind of aside from 
orgmode. Not sure if I want to add that possible difficulty to orgmode 
parsers.


BTW, in the William's example I added before, it could work org-ref, 
because there are not subtrees, just by citing to the reference in a 
.bib file. But this wouldn't work with subtrees, where each subtree is a 
chapter of the referenced book.


*Reference:*

**

*** Suárez Falcón, J. C., Recio Saboya, P., San Luis Costas, M. C., y 
Pozo Cabanillas, M. P. (2019). /Introducción al análisis de datos: 
Aplicaciones en psicología y ciencias de la salud./ Sanz y Torres


*** Suárez Falcón et al. (2019) "1 Conceptos básicos y Organización de 
Datos - 1.3. Concepto y Funciones de la Estadística: Descripción e 
Inferencia"

:PROPERTIES:
:ID:   20210607T122433.664964
:END:
*
**

*
*

*Note:*

* Here you can see *duplicate linking* is needed: one for the Chapter 
in the Reference file (above) and another one for citations to work to 
the bibtex file, below.

:PROPERTIES:
:ID:   20210607T122524.032860
:END:
:LINKS:
/*- [[id:20210607T122433.664964]]*//*
*//*- cite:SuarezFalcon.2019.IntroduccionAnalisisDatos*/
:END:


*Bibtex entry:*

**


*@book{SuarezFalcon.2019.IntroduccionAnalisisDatos,
  title = {Introducción al análisis de datos: aplicaciones en 
psicología y ciencias de la salud},

  shorttitle = {Introducción al análisis de datos},
  author = {Suárez Falcón, Juan Carlos and RECIO SABOYA, PATRICIA and 
SAN LUIS COSTAS, MARÍA CONCEPCIÓN and POZO CABANILLAS, MARÍA DEL PILAR},

  year = {2019},
  publisher = {Sanz y Torres},
  address = {Alcorcón},
  annotation = {OCLC: 1140871590},
  file = {Z\:\\SuarezFalcon.2019.IntroduccionAnalisisDatos.pdf},
  isbn = {978-84-17765-42-2},
  language = {Spanish}
}*

*
*

Just a thought, maybe superficial and un-needed feature, just in case.

Best regards


El 07/06/2021 a las 10:30, indieterminacy@libre.brussels escribió:

Hi Bill,

Perhaps its worth looking into Hyperbole?

It has contexts and actions which could work when the cursor is on the 
link reference. Given it operates well with Orgmode now and has 
transitioned into globa minor mode some of its deficiencies have been 
ironed out.



Jonathan



June 7, 2021 9:03 AM, "Ypo" > wrote:


I've been reading you about cites. Conversation is above my head,
but just in case it could be helpful, I would like to address a
frequent problem in the workflow of taking notes, that advanced
users suffer too.

When taking notes, it's usual to make some bibliographical
references in one file and some related notes in a different file.
I link both using internal links, but it can't be exported
directly as a bibliography, which would be cool indeed.

Could a citation act as a link, or a link to be exported as a
citation?

An example, could the link "[[id:20210607T083216.726761][...]]" be
substituted by a cite, that takes you to the reference?

*Reference (from a .org file, as it is, but if it needed to had
/.bib structure/ to kind of "unify" internal links and cites,
would be fine too):*

 William Denton [w...@pobox.com ]. (29
Mar 2021 16:15:18 -0400 (EDT)). /About exporting [Respuesta en
emacs-orgmode]./ Lista de correo.
:PROPERTIES:
:ID: 20210607T083216.726761
:END:
:LINKS:
- [[id:20210607T083216.765049][Memoir could be flexible,]]
:END:
https://lists.gnu.org/archive/html/emacs-orgmode/2021-03/msg00443.html

To get better at it, I'd recommend reading the manual for the
Memoir class [1]
(the first few chapters that talk about page design, at least,
then refer to the
rest as needed) and Robert Bringhurst's THE ELEMENTS OF
TYPOGRAPHIC STYLE [2]
(which will give you ideas you can implement and right away your
documents will
look great).

Bill

[1] https://www.ctan.org/pkg/memoir 
[2]
https://en.wikipedia.org/wiki/The_Elements_of_Typographic_Style


*Note (it could be a task, or a study note, or a note to write a
book in the future...):*

 Memoir could be flexible, take a look at it.
:PROPERTIES:
:ID: 20210607T083216.765049
:END:
:LINKS:
- [[id:20210607T083216.726761][William Denton [w...@pobox.com
]. (29 Mar 2021 16:15:18 -0400 (EDT)).
/About exporting [Respuesta en emacs-orgmode]./ Lista de correo.]]
:END:





literate programming, development log -- ideas?

2021-06-07 Thread Greg Minshall
hi, all.

i write most of my code in a (per-project) .org file, which is typically
tangled into source or script files.  i have a question about how people
structure their .org files for this sort of use.

some of the non-source bits surrounding my source blocks are for
"classical" literate programming text, i.e., introductions to sections
of code, maybe with links to external pages for libraries or packages i
use in the associated code block.

but i also feel a need for something that might be called a lab
notebook, a development log, of ideas, including dead ends, i pursue
during the development process, with links, etc..  but, i'm not really
sure how to structure this bit, how to integrate it in the rest of the
.org file -- i.e., as a separate heading, or related to the code section
that (originally) was under development when the notes were created.
or...?  etc.

i'm wondering if people do this, especially the development log, and if
there are any hints or practices people might feel would be of interest
to share.

(sorry for the non-specificness of the question.)

cheers, Greg



Re: literate programming, development log -- ideas?

2021-06-07 Thread Juan Manuel Macías
Hi Greg,

Greg Minshall writes:

> but i also feel a need for something that might be called a lab
> notebook, a development log, of ideas, including dead ends, i pursue
> during the development process, with links, etc..  but, i'm not really
> sure how to structure this bit, how to integrate it in the rest of the
> .org file -- i.e., as a separate heading, or related to the code section
> that (originally) was under development when the notes were created.
> or...?  etc.

I use `org-add-note' a lot, in a wide variety of scenarios. According to their
docstring:

"Add a note to the current entry.
This is done in the same way as adding a state change note."

And I've set (setq org-log-into-drawer t)

On the other hand, maybe you can find interesting the org-marginalia package:
(https://github.com/nobiot/org-marginalia).

Best regards,

Juan Manuel 




Re: An org-latex face

2021-06-07 Thread Léo Ackermann
Hi both!
Thanks a lot for your answers, it looks pretty now :)

Best,
Leo

Le mar. 1 juin 2021 à 10:43, Timothy  a écrit :

> Hi Léo,
>
> For what it’s worth, I currently make do with:
>
> (setq org-highlight-latex-and-related '(native script entities))(add-to-list 
> 'org-src-block-faces '("latex" (:inherit default :extend t)))
>
> All the best,
> *Timothy*
>
> * From*: Léo Ackermann <%22Léo+ackermann%22+%3cleo.ko...@gmail.com%3E>
> * Subject*: An org-latex face
> * To*: "emacs-orgmode@gnu.org" 
> * Date*: Tue, 01 Jun 2021 14:04:47 +0800
> Hi,
>
> When it comes to preview inline LaTeX fragments within org-mode, the org
> package applies the `org-block` face. It would be nice to *treat inline
> latex block specially*, to make integration of the those preview-block
> easier when surrounded by plaintext. This feature would allow to have a
> theme that highlight blocks (source code, examples) without the background
> artifact you can see in attachment when previewing latex fragments.
> It seems that a way to adress this is to add another `org-latex` face, as
> we already have with `org-quote`. One could also change the
> `org-src-font-lock-fontify-block` function to include a subroutine for
> inline latex blocks. Nevertheless, the later seems to be harder to
> customize...
> What do you think of this ?
>
> Thank you for your job on this amazing program!
> Have a nice day!
>
> Best,
> Leo
>


Re: literate programming, development log -- ideas?

2021-06-07 Thread Eric S Fraga
On Monday,  7 Jun 2021 at 14:43, Greg Minshall wrote:
> i write most of my code in a (per-project) .org file, which is typically
> tangled into source or script files.  

I do the same.

> i'm wondering if people do this, especially the development log, and if
> there are any hints or practices people might feel would be of interest
> to share.

I use version control for this aspect, liberally adding/deleting
text/code and relying on the version control system to keep the log for
me.  I used to try to keep the log, as you call it, within the org file
but that seemed eventually to be both difficult and pointless when there
are decent version control tools out there.

I use src mostly [1] when everything is going to be in one file.

The "current" version of the document will have the code and results
that match the text.

YMMV, of course.

HTH,
eric


Footnotes:
[1]  https://gitlab.com/esr/src

-- 
: Eric S Fraga via Emacs 28.0.50, Org release_9.4.6-549-ga0a87d



Re: Could a citation act as a link, or a link to be exported as a citation?

2021-06-07 Thread Bruce D'Arcus
On Mon, Jun 7, 2021 at 3:02 AM Ypo  wrote:
>
> I've been reading you about cites. Conversation is above my head, but just in 
> case it could be helpful, I would like to address a frequent problem in the 
> workflow of taking notes, that advanced users suffer too.
>
> When taking notes, it's usual to make some bibliographical references in one 
> file and some related notes in a different file. I link both using internal 
> links, but it can't be exported directly as a bibliography, which would be 
> cool indeed.
>
> Could a citation act as a link, or a link to be exported as a citation?

In general, a citation is conceptually a kind of specialized link.

And org-ref and now org-cite is designed around the possibility of
attaching actions to those citations. So, for example:

> An example, could the link "[[id:20210607T083216.726761][...]]" be 
> substituted by a cite, that takes you to the reference?

The oc-basic processor has an at-point function that will do just
this, if by "reference" you mean the bibtex (and maybe ultimately csl
json) source entry.

Have you looked at org-roam and org-roam-bibtex?

If not, that might give you some ideas, as it heavily relies on org
links, but also has support for citations.

Plans there are to support org-cite, BTW.

Bruce



Hiding results using :post

2021-06-07 Thread Roger Mason
Hello,

I'd like to be able to hide results, for example when I expect the
them to span many lines.  I know I can hit =tab= on the #+RESULTS: line,
but I'd like to be able to set this automatically.

My most recent effort:

#+name: hideresults
#+begin_src emacs-lisp :results none :exports none
(add-to-invisibility-spec '(org-babel-hide-result . t))
#+end_src

run like this

#+header: :engine postgresql :dbhost "localhost"  :dbuser "rmason" :database 
"test" :colnames yes
#+header: :post hideresults
#+name: pgquery
#+begin_src sql
select timestamp,nempty0 from settings where timestamp like '%20210528%'
#+end_src

produces

#+RESULTS: pgquery
: nil

I'm sure there is a way to do this, but I need some pointers as to how.

Thanks for any help.

Roger

Org mode version 9.2.3 (release_9.2.3-390-gfb5091 @
/home/rmason/.emacs.d/org-git/lisp/)

GNU Emacs 27.2 (build 1, amd64-portbld-freebsd11.4, X toolkit, cairo version 
1.16.0, Xaw3d scroll bars)



org-critical-edition (a package for philologists and classicists)

2021-06-07 Thread Juan Manuel Macías
Hi all,

I have uploaded the (very) initial version of my package
org-critical-edition:

https://gitlab.com/maciaschain/org-critical-edition

This package lets you prepare a philological critical edition in Org
Mode. The natural output is LaTeX with the reledmac package
(https://www.ctan.org/pkg/reledmac).

(For those who are not philologists, this is an example of critical
edition that I typesetted recently: https://imgur.com/a/drqCib5)

Feedback welcome!

Best regards,

Juan Manuel



Re: literate programming, development log -- ideas?

2021-06-07 Thread Dr. Arne Babenhauserheide

Greg Minshall  writes:
> but i also feel a need for something that might be called a lab
> notebook, a development log, of ideas, including dead ends, i pursue
> during the development process, with links, etc..  but, i'm not really
> sure how to structure this bit, how to integrate it in the rest of the
> .org file -- i.e., as a separate heading, or related to the code section
> that (originally) was under development when the notes were created.
> or...?  etc.

I just add more sections/headings, sometimes tagged as :noexport:

If need be, I add code-snippets with examples there.

I feel that that’s the simplest way to do it.

Best wishes,
Arne
-- 
Unpolitisch sein
heißt politisch sein
ohne es zu merken


signature.asc
Description: PGP signature


Re: Hiding results using :post

2021-06-07 Thread Nick Savage
My initial thoughts are that this is very possible. This might be an 
area where we could add a new defcustom on always hiding the results to 
allow the user to choose it. Without looking at the code, I think it 
would be pretty straight forward to make an excursion to the results 
line, toggle showing it, then going back to where the point was.


I can take a crack at a patch in the next day or so if no one else wants 
to or gets there first.


On 6/7/21 8:51 AM, Roger Mason wrote:

Hello,

I'd like to be able to hide results, for example when I expect the
them to span many lines.  I know I can hit =tab= on the #+RESULTS: line,
but I'd like to be able to set this automatically.

My most recent effort:

#+name: hideresults
#+begin_src emacs-lisp :results none :exports none
(add-to-invisibility-spec '(org-babel-hide-result . t))
#+end_src

run like this

#+header: :engine postgresql :dbhost "localhost"  :dbuser "rmason" :database 
"test" :colnames yes
#+header: :post hideresults
#+name: pgquery
#+begin_src sql
select timestamp,nempty0 from settings where timestamp like '%20210528%'
#+end_src

produces

#+RESULTS: pgquery
: nil

I'm sure there is a way to do this, but I need some pointers as to how.

Thanks for any help.

Roger

Org mode version 9.2.3 (release_9.2.3-390-gfb5091 @
/home/rmason/.emacs.d/org-git/lisp/)

GNU Emacs 27.2 (build 1, amd64-portbld-freebsd11.4, X toolkit, cairo version 
1.16.0, Xaw3d scroll bars)





Re: Bug: Reclocking errors out if org-log-note-clock-out is t [9.4.6 (9.4.6-gab9f2a @ /gnu/store/2pny4z6mbi2aybgzzxz0yrzkds7hbpmq-emacs-org-9.4.6/share/emacs/site-lisp/org-9.4.6/)]

2021-06-07 Thread Jorge P . de Morais Neto
Em [2021-05-31 seg 21:43:23+0800], Ihor Radchenko escreveu:

> Confirmed
>
> The fix is attached.

I have applied (by copying the Guix package recipe and then modifying
it) Ihor's patch and customized `org-log-note-clock-out' back to t.
Since then I have been using the patched Org it and I can confirm Ihor's
patch fixes the problem.

Thank you Ihor!

-- 
-  "In Support of Richard Stallman"
- I am Brazilian.  I hope my English is correct and I welcome feedback.
- 
- 



[native mac python3 does not work] (was: MacOS 10.15 cannot use the python-matlab engine.)

2021-06-07 Thread Uwe Brauer
>>> "UB" == Uwe Brauer  writes:

> Hi 

> Could use perfectly well the python-matlab engine from within emacs org
> mode in Ubuntu 16.04, python 3.5 and matlab 2019b.

> Now I am using 

> 1. Macos 10.15 (catalina),

> 2. Matlab2019b. (That only support python 2.7, 3.6, 3.7 but not 3.8,
>which the MacOs ships.

> 3. So I installed fink (and python 3.7.)

> 4. The installation of the python engine.

>a. In /Applications/MATLAB_R2019b.app/extern/engines/python I run

>b. sudo /opt/sw/bin/python3.7 setup.py install

>c. The installation seem fine

> 5. Setting up emacs: my setting is now slightly different:

> #+BEGIN_SRC emacs-lisp
> (setq org-confirm-babel-evaluate nil)   ;don't prompt me to confirm everytime 
> I want to evaluate a block
> ;;; display/update images in the buffer after I evaluate
> (add-hook 'org-babel-after-execute-hook 'org-display-inline-images 'append)

> (add-to-list 'org-src-lang-modes '("matlab" . matlab))
> (setq python-shell-interpreter "/opt/sw/bin/python3.7")
> ;; set default headers for convenience
> (setq org-babel-default-header-args:matlab
>   '((:results . "output replace")
>   (:session . "matlab")
>   (:kernel . "matlab")
>   (:exports . "code")
>   (:cache .   "no")
>   (:noweb . "no")
>   (:hlines . "no")
>   (:tangle . "no")))
> (defalias 'org-babel-execute:matlab 'org-babel-execute:ipython)
> (defalias 'org-babel-prep-session:matlab 'org-babel-prep-session:ipython)
> (defalias 'org-babel-matlab-initiate-session 
> 'org-babel-ipython-initiate-session)
> #+END_SRC



> Now, I run as an example 

> #+begin_src matlab :results output latex :exports results  :eval never-export 
> :wrap latex
> x = [1, 2, 3, 4, 5];
> fprintf('|%d', x)
> #+end_src


> But I obtain now the unexpected error

> ,
> | Debugger entered--Lisp error: (error "There was a fatal error trying to 
> process the requ...")
> |   signal(error ("There was a fatal error trying to process the requ..."))
> |   error("There was a fatal error trying to process the requ...")
> |   ob-ipython--dump-error("Traceback (most recent call last):\n  File 
> \"/Users/...")
> |   ob-ipython--execute-request("x = [1, 2, 3, 4, 5];\nfprintf('|%d', x)" 
> "matlab")
> |   ob-ipython--execute-sync("x = [1, 2, 3, 4, 5];\nfprintf('|%d', x)"
> | ((:colname-names) (:rowname-names) (:result-params "replace"
> | "output" "latex") (:result-type . output) (:results . "replace
> | output latex") (:exports . "results") (:session . "matlab") (:kernel
> | . "matlab") (:cache . "no") (:noweb . "no") (:hlines . "no")
> | (:tangle . "no") (:eval . "never-export") (:wrap . "latex")))
> |   org-babel-execute:matlab("x = [1, 2, 3, 4, 5];\nfprintf('|%d', x)"
> | ((:colname-names) (:rowname-names) (:result-params "replace"
> | "output" "latex") (:result-type . output) (:results . "replace
> | output latex") (:exports . "results") (:session . "matlab") (:kernel
> | . "matlab") (:cache . "no") (:noweb . "no") (:hlines . "no")
> | (:tangle . "no") (:eval . "never-export") (:wrap . "latex")))
> |   org-babel-execute-src-block(nil ("matlab" "x = [1, 2, 3, 4,
> | 5];\nfprintf('|%d', x)" ((:colname-names) (:rowname-names)
> | (:result-params "latex" "output" "replace") (:result-type . output)
> | (:results . "latex output replace") (:exports . "results") (:wrap .
> | "latex") (:eval . "never-export") (:tangle . "no") (:hlines . "no")
> | (:noweb . "no") (:cache . "no") (:kernel . "matlab") (:session .
> | "matlab")) "" nil 2036 "(ref:%s)"))
> |   org-ctrl-c-ctrl-c(nil)
> |   funcall-interactively(org-ctrl-c-ctrl-c nil)
> |   call-interactively(org-ctrl-c-ctrl-c nil nil)
> |   command-execute(org-ctrl-c-ctrl-c)
> `


> I know that there some MaCOS users here in the list:

> Any idea what went wrong.

> Any help is strongly appreciated, since I don't have access to my Linux
> machine fro the coming days.

I upgraded my matlab version to 2020b in order to install the engine
with catalina 3.8 engine.

Again the same error.

Help is strongly appreciated.

Uwe Brauer 


smime.p7s
Description: S/MIME cryptographic signature


[org-cite, oc-basic] configurable open-at-point, font-locking when json?

2021-06-07 Thread Bruce D'Arcus
I'm kind of losing track of details, but two things:

First, the current oc-basic has a "follow" function that if point is
over a citation-reference (key), and one does "M-x org-open-at-point",
the bibtex entry is opened.

Very cool!

Similar to my idea to have a configurable capf, could that function be
configurable?

A couple of people noted, for example, that the preferred choice would
be that the actual document be opened. I actually got a PR for exactly
this default behavior this past weekend, and bibtex-completion has a
function that takes keys and does this. So would be great do something
like:

(setq org-cite-basic-open bibtex-completion-open-pdf)

Second, I completely lose font-locking when using json files. I know
you have plans, Nicolas, to add json support, but even without that,
shouldn't the citation be highlighted?

Bruce



Re: literate programming, development log -- ideas?

2021-06-07 Thread briangpowell
* Donald Knuth created much for us, including TeX and a Literate
Programming system called CWeb which helped to make C code documented in
what he envisioned for Literate Programming

** A more generalized system that is based on CWeb is NoWeb--useful not
just for C/C++ code but for every language: Recommend using NoWeb for
Literate Programming: "NoWeb — A Simple, Extensible Tool for Literate
Programming":

https://www.cs.tufts.edu/~nr/noweb/

"As of 28 June 2018, the current supported version is version 2.12."
{Author recommends against NOWEB 3.x}





On Mon, Jun 7, 2021 at 9:54 AM Dr. Arne Babenhauserheide 
wrote:

>
> Greg Minshall  writes:
> > but i also feel a need for something that might be called a lab
> > notebook, a development log, of ideas, including dead ends, i pursue
> > during the development process, with links, etc..  but, i'm not really
> > sure how to structure this bit, how to integrate it in the rest of the
> > .org file -- i.e., as a separate heading, or related to the code section
> > that (originally) was under development when the notes were created.
> > or...?  etc.
>
> I just add more sections/headings, sometimes tagged as :noexport:
>
> If need be, I add code-snippets with examples there.
>
> I feel that that’s the simplest way to do it.
>
> Best wishes,
> Arne
> --
> Unpolitisch sein
> heißt politisch sein
> ohne es zu merken
>


Re: [org-cite, oc-basic] configurable open-at-point, font-locking when json?

2021-06-07 Thread Bruce D'Arcus
On Mon, Jun 7, 2021 at 12:53 PM Bruce D'Arcus  wrote:

> ... would be great do something
> like:
>
> (setq org-cite-basic-open bibtex-completion-open-pdf)

I guess that raises a question for me about what code goes where.

Maybe instead have it set in oc.el?

(setq org-cite-open 'bibtex-completion-open-pdf)

Bruce


Bruce



Re: literate programming, development log -- ideas?

2021-06-07 Thread Jack Kamm
Hi Greg,

Greg Minshall  writes:

> but i also feel a need for something that might be called a lab
> notebook, a development log, of ideas, including dead ends, i pursue
> during the development process, with links, etc..  but, i'm not really
> sure how to structure this bit, how to integrate it in the rest of the
> .org file -- i.e., as a separate heading, or related to the code section
> that (originally) was under development when the notes were created.
> or...?  etc.

This is how I have been using org-babel recently. In particulary, I use
it as a journal for my exploratory data analyses (EDA), mainly in Python
and R.

I find that using a month-tree format, similar to org-capture with
:tree-type month [1], works well for organizing my EDA sections/notes.

Figures I create are named like so:

fig/eda/<6-digit-date>-.png

e.g., "fig/eda/210607-celltype-heatmap.png".

I found this workflow keeps things fairly neat, without having to think
too much about how I'm going to organize and name everything. Perfect
for trying out new ideas, iterating quickly, and having an easy to refer
to log of what I've already tried.

[1] https://orgmode.org/manual/Template-elements.html



Re: Cannot schedule something for 2039?

2021-06-07 Thread Samuel Wales
fwiw i ran this once:

  ;;(/ (org-time-string-to-seconds "--01-01 00:00") 60.0) 4222846500.0
  ;;(/ (org-time-string-to-seconds "-0001-12-31 00:00") 60.0) -1035068671.7
  ;;  oops
  ;;(/ (org-time-string-to-seconds "-12-31 00:00") 60.0)  -1035594271.7
  ;;(/ (org-time-string-to-seconds "0001-12-31 00:00") 60.0)  -1035068671.7
  ;;(/ (org-time-string-to-seconds "1000-12-31 00:00") 60.0) -509645791.7
  ;;(/ (org-time-string-to-seconds "1776-12-31 00:00") 60.0) -101508031.7
  ;;(/ (org-time-string-to-seconds "1900-12-31 00:00") 60.0) -36291900.0
  ;;   nan on non-64
  ;;(/ (org-time-string-to-seconds "1901-12-31 00:00") 60.0) -35766300.0
  ;;(/ (org-time-string-to-seconds "1934-12-31 00:00") 60.0) -18409980.0
  ;;(/ (org-time-string-to-seconds "1960-12-31 00:00") 60.0) -4734300.0
  ;;(/ (org-time-string-to-seconds "1969-12-31 00:00") 60.0) -1020.0
  ;;(/ (org-time-string-to-seconds "1970-01-01 00:00") 60.0) 420.0
  ;;(/ (org-time-string-to-seconds "1980-01-01 00:00") 60.0) 5259300.0
  ;;(/ (org-time-string-to-seconds "1990-01-01 00:00") 60.0) 10519620.0
  ;;(/ (org-time-string-to-seconds "2000-01-01 00:00") 60.0) 15778500.0
  ;;(/ (org-time-string-to-seconds "2010-01-01 00:00") 60.0) 21038820.0
  ;;(/ (org-time-string-to-seconds "2038-01-01 00:00") 60.0) 35765700.0
  ;;(/ (org-time-string-to-seconds "2138-01-01 00:00") 60.0) 88360260.0
  ;;(/ (org-time-string-to-seconds "-01-01 00:00") 60.0) 4222846500.0
  ;;   nan on non-64


On 6/7/21, Alan Schmitt  wrote:
> Hello Richard,
>
> On 2021-06-07 11:17, Richard Lawrence 
> writes:
>
>> whoa, that's a weird behavior, but it seems not to be a bug. I learned
>> something today!
>>
>> It looks like some Emacs implementations don't support dates after
>> 2038-1-1, so Org doesn't let you specify them by default. See the
>> variable `org-read-date-force-compatible-dates'. I think you want to set
>> this variable to nil.
>
> Thanks a lot for pointing to this variable, its docstring is quite
> interesting.
>
> I’m trying the workaround suggested (using a diary sexp, i.e.,
> "<%%(diary-date 2039 4 2)>" in my case), but I cannot test it (the
> agenda for that date won’t build, at the date is outside the range). I
> guess this will be fixed by then ;)
>
> Best,
>
> Alan
>


-- 
The Kafka Pandemic

Please learn what misopathy is.
https://thekafkapandemic.blogspot.com/2013/10/why-some-diseases-are-wronged.html



Re: Hiding results using :post

2021-06-07 Thread John Kitchin
This is doable with a hook and advice I think. The hook will hide the
results if you use :results hide in the header.

I had to use the advice to remove the results before hand, so that you
toggle the visibility off. This is pretty lightly tested. you could
eliminate

(defun hide-results (&optional &rest args)
  (let ((results (cdr (assoc :results (third (org-babel-get-src-block-info
'light))
(when (string-match "hide" results)
  (org-babel-hide-result-toggle t

(add-hook 'org-babel-after-execute-hook 'hide-results)

(advice-add 'org-babel-execute-src-block :before (lambda (&rest args)
(org-babel-remove-result)))

I guess there are other ways that might work too.

#+BEGIN_SRC jupyter-python :results hide
print(5)
#+END_SRC

#+RESULTS:
: 5


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 Mon, Jun 7, 2021 at 10:03 AM Nick Savage  wrote:

> My initial thoughts are that this is very possible. This might be an
> area where we could add a new defcustom on always hiding the results to
> allow the user to choose it. Without looking at the code, I think it
> would be pretty straight forward to make an excursion to the results
> line, toggle showing it, then going back to where the point was.
>
> I can take a crack at a patch in the next day or so if no one else wants
> to or gets there first.
>
> On 6/7/21 8:51 AM, Roger Mason wrote:
> > Hello,
> >
> > I'd like to be able to hide results, for example when I expect the
> > them to span many lines.  I know I can hit =tab= on the #+RESULTS: line,
> > but I'd like to be able to set this automatically.
> >
> > My most recent effort:
> >
> > #+name: hideresults
> > #+begin_src emacs-lisp :results none :exports none
> > (add-to-invisibility-spec '(org-babel-hide-result . t))
> > #+end_src
> >
> > run like this
> >
> > #+header: :engine postgresql :dbhost "localhost"  :dbuser "rmason"
> :database "test" :colnames yes
> > #+header: :post hideresults
> > #+name: pgquery
> > #+begin_src sql
> > select timestamp,nempty0 from settings where timestamp like '%20210528%'
> > #+end_src
> >
> > produces
> >
> > #+RESULTS: pgquery
> > : nil
> >
> > I'm sure there is a way to do this, but I need some pointers as to how.
> >
> > Thanks for any help.
> >
> > Roger
> >
> > Org mode version 9.2.3 (release_9.2.3-390-gfb5091 @
> > /home/rmason/.emacs.d/org-git/lisp/)
> >
> > GNU Emacs 27.2 (build 1, amd64-portbld-freebsd11.4, X toolkit, cairo
> version 1.16.0, Xaw3d scroll bars)
> >
>
>


Re: [org-cite, oc-basic] configurable open-at-point, font-locking when json?

2021-06-07 Thread Nicolas Goaziou
Hello,

"Bruce D'Arcus"  writes:

> Similar to my idea to have a configurable capf, could that function be
> configurable?
>
> A couple of people noted, for example, that the preferred choice would
> be that the actual document be opened. I actually got a PR for exactly
> this default behavior this past weekend, and bibtex-completion has a
> function that takes keys and does this. So would be great do something
> like:
>
> (setq org-cite-basic-open bibtex-completion-open-pdf)

If you want to use a different "follow" capability, you need to provide
a different processor instead of configuring this one.

> Second, I completely lose font-locking when using json files. I know
> you have plans, Nicolas, to add json support, but even without that,
> shouldn't the citation be highlighted?

Could you provide an example?

Regards,
-- 
Nicolas Goaziou



Re: Hiding results using :post

2021-06-07 Thread George Mauer
Woah woah. What is the jupyter-python language, John?

On Mon, Jun 7, 2021, 15:44 John Kitchin  wrote:

> This is doable with a hook and advice I think. The hook will hide the
> results if you use :results hide in the header.
>
> I had to use the advice to remove the results before hand, so that you
> toggle the visibility off. This is pretty lightly tested. you could
> eliminate
>
> (defun hide-results (&optional &rest args)
>   (let ((results (cdr (assoc :results (third (org-babel-get-src-block-info
> 'light))
> (when (string-match "hide" results)
>   (org-babel-hide-result-toggle t
>
> (add-hook 'org-babel-after-execute-hook 'hide-results)
>
> (advice-add 'org-babel-execute-src-block :before (lambda (&rest args)
> (org-babel-remove-result)))
>
> I guess there are other ways that might work too.
>
> #+BEGIN_SRC jupyter-python :results hide
> print(5)
> #+END_SRC
>
> #+RESULTS:
> : 5
>
>
> 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 Mon, Jun 7, 2021 at 10:03 AM Nick Savage  wrote:
>
>> My initial thoughts are that this is very possible. This might be an
>> area where we could add a new defcustom on always hiding the results to
>> allow the user to choose it. Without looking at the code, I think it
>> would be pretty straight forward to make an excursion to the results
>> line, toggle showing it, then going back to where the point was.
>>
>> I can take a crack at a patch in the next day or so if no one else wants
>> to or gets there first.
>>
>> On 6/7/21 8:51 AM, Roger Mason wrote:
>> > Hello,
>> >
>> > I'd like to be able to hide results, for example when I expect the
>> > them to span many lines.  I know I can hit =tab= on the #+RESULTS: line,
>> > but I'd like to be able to set this automatically.
>> >
>> > My most recent effort:
>> >
>> > #+name: hideresults
>> > #+begin_src emacs-lisp :results none :exports none
>> > (add-to-invisibility-spec '(org-babel-hide-result . t))
>> > #+end_src
>> >
>> > run like this
>> >
>> > #+header: :engine postgresql :dbhost "localhost"  :dbuser "rmason"
>> :database "test" :colnames yes
>> > #+header: :post hideresults
>> > #+name: pgquery
>> > #+begin_src sql
>> > select timestamp,nempty0 from settings where timestamp like '%20210528%'
>> > #+end_src
>> >
>> > produces
>> >
>> > #+RESULTS: pgquery
>> > : nil
>> >
>> > I'm sure there is a way to do this, but I need some pointers as to how.
>> >
>> > Thanks for any help.
>> >
>> > Roger
>> >
>> > Org mode version 9.2.3 (release_9.2.3-390-gfb5091 @
>> > /home/rmason/.emacs.d/org-git/lisp/)
>> >
>> > GNU Emacs 27.2 (build 1, amd64-portbld-freebsd11.4, X toolkit, cairo
>> version 1.16.0, Xaw3d scroll bars)
>> >
>>
>>


Re: [org-cite, oc-basic] configurable open-at-point, font-locking when json?

2021-06-07 Thread Bruce D'Arcus
On Mon, Jun 7, 2021 at 5:14 PM Nicolas Goaziou  wrote:

> ... would be great do something
> > like:
> >
> > (setq org-cite-basic-open bibtex-completion-open-pdf)
>
> If you want to use a different "follow" capability, you need to provide
> a different processor instead of configuring this one.

OIC.

So would it be so simple as doing something like this, to use the
bibtex-completion-open function instead?

(org-cite-register-processor 'basic
  :follow #'bibtex-completion-open)

As in, that just tells what function to use for at-point?

If yes, that definitely works!

I've been a bit slow wrapping my head around the difference between
follow and activate, but I think it's starting to become more clear.

> > Second, I completely lose font-locking when using json files. I know
> > you have plans, Nicolas, to add json support, but even without that,
> > shouldn't the citation be highlighted?
>
> Could you provide an example?

I'm sorry; you're going to kill me.

In trying to reproduce it just now, I can't.

So I guess you can ignore this too.

Bruce



Re: Hiding results using :post

2021-06-07 Thread John Kitchin
it is the name of blocks that use emacs-jupyter (
https://github.com/nnicandro/emacs-jupyter)  (instead of ob-ipython).
Basically it is a connection between org-src blocks and a jupyter kernel
(it does not have to be python, it can be julia, R, etc.) I am trying it
out this summer.

I think that code should work on most src-blocks though.

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 Mon, Jun 7, 2021 at 5:21 PM George Mauer  wrote:

> Woah woah. What is the jupyter-python language, John?
>
> On Mon, Jun 7, 2021, 15:44 John Kitchin  wrote:
>
>> This is doable with a hook and advice I think. The hook will hide the
>> results if you use :results hide in the header.
>>
>> I had to use the advice to remove the results before hand, so that you
>> toggle the visibility off. This is pretty lightly tested. you could
>> eliminate
>>
>> (defun hide-results (&optional &rest args)
>>   (let ((results (cdr (assoc :results (third
>> (org-babel-get-src-block-info 'light))
>> (when (string-match "hide" results)
>>   (org-babel-hide-result-toggle t
>>
>> (add-hook 'org-babel-after-execute-hook 'hide-results)
>>
>> (advice-add 'org-babel-execute-src-block :before (lambda (&rest args)
>> (org-babel-remove-result)))
>>
>> I guess there are other ways that might work too.
>>
>> #+BEGIN_SRC jupyter-python :results hide
>> print(5)
>> #+END_SRC
>>
>> #+RESULTS:
>> : 5
>>
>>
>> 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 Mon, Jun 7, 2021 at 10:03 AM Nick Savage  wrote:
>>
>>> My initial thoughts are that this is very possible. This might be an
>>> area where we could add a new defcustom on always hiding the results to
>>> allow the user to choose it. Without looking at the code, I think it
>>> would be pretty straight forward to make an excursion to the results
>>> line, toggle showing it, then going back to where the point was.
>>>
>>> I can take a crack at a patch in the next day or so if no one else wants
>>> to or gets there first.
>>>
>>> On 6/7/21 8:51 AM, Roger Mason wrote:
>>> > Hello,
>>> >
>>> > I'd like to be able to hide results, for example when I expect the
>>> > them to span many lines.  I know I can hit =tab= on the #+RESULTS:
>>> line,
>>> > but I'd like to be able to set this automatically.
>>> >
>>> > My most recent effort:
>>> >
>>> > #+name: hideresults
>>> > #+begin_src emacs-lisp :results none :exports none
>>> > (add-to-invisibility-spec '(org-babel-hide-result . t))
>>> > #+end_src
>>> >
>>> > run like this
>>> >
>>> > #+header: :engine postgresql :dbhost "localhost"  :dbuser "rmason"
>>> :database "test" :colnames yes
>>> > #+header: :post hideresults
>>> > #+name: pgquery
>>> > #+begin_src sql
>>> > select timestamp,nempty0 from settings where timestamp like
>>> '%20210528%'
>>> > #+end_src
>>> >
>>> > produces
>>> >
>>> > #+RESULTS: pgquery
>>> > : nil
>>> >
>>> > I'm sure there is a way to do this, but I need some pointers as to how.
>>> >
>>> > Thanks for any help.
>>> >
>>> > Roger
>>> >
>>> > Org mode version 9.2.3 (release_9.2.3-390-gfb5091 @
>>> > /home/rmason/.emacs.d/org-git/lisp/)
>>> >
>>> > GNU Emacs 27.2 (build 1, amd64-portbld-freebsd11.4, X toolkit, cairo
>>> version 1.16.0, Xaw3d scroll bars)
>>> >
>>>
>>>


Re: Hiding results using :post

2021-06-07 Thread George Mauer
Cool, thanks!

On Mon, Jun 7, 2021 at 4:31 PM John Kitchin  wrote:

> it is the name of blocks that use emacs-jupyter (
> https://github.com/nnicandro/emacs-jupyter)  (instead of ob-ipython).
> Basically it is a connection between org-src blocks and a jupyter kernel
> (it does not have to be python, it can be julia, R, etc.) I am trying it
> out this summer.
>
> I think that code should work on most src-blocks though.
>
> 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 Mon, Jun 7, 2021 at 5:21 PM George Mauer  wrote:
>
>> Woah woah. What is the jupyter-python language, John?
>>
>> On Mon, Jun 7, 2021, 15:44 John Kitchin  wrote:
>>
>>> This is doable with a hook and advice I think. The hook will hide the
>>> results if you use :results hide in the header.
>>>
>>> I had to use the advice to remove the results before hand, so that you
>>> toggle the visibility off. This is pretty lightly tested. you could
>>> eliminate
>>>
>>> (defun hide-results (&optional &rest args)
>>>   (let ((results (cdr (assoc :results (third
>>> (org-babel-get-src-block-info 'light))
>>> (when (string-match "hide" results)
>>>   (org-babel-hide-result-toggle t
>>>
>>> (add-hook 'org-babel-after-execute-hook 'hide-results)
>>>
>>> (advice-add 'org-babel-execute-src-block :before (lambda (&rest args)
>>> (org-babel-remove-result)))
>>>
>>> I guess there are other ways that might work too.
>>>
>>> #+BEGIN_SRC jupyter-python :results hide
>>> print(5)
>>> #+END_SRC
>>>
>>> #+RESULTS:
>>> : 5
>>>
>>>
>>> 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 Mon, Jun 7, 2021 at 10:03 AM Nick Savage  wrote:
>>>
 My initial thoughts are that this is very possible. This might be an
 area where we could add a new defcustom on always hiding the results to
 allow the user to choose it. Without looking at the code, I think it
 would be pretty straight forward to make an excursion to the results
 line, toggle showing it, then going back to where the point was.

 I can take a crack at a patch in the next day or so if no one else
 wants
 to or gets there first.

 On 6/7/21 8:51 AM, Roger Mason wrote:
 > Hello,
 >
 > I'd like to be able to hide results, for example when I expect the
 > them to span many lines.  I know I can hit =tab= on the #+RESULTS:
 line,
 > but I'd like to be able to set this automatically.
 >
 > My most recent effort:
 >
 > #+name: hideresults
 > #+begin_src emacs-lisp :results none :exports none
 > (add-to-invisibility-spec '(org-babel-hide-result . t))
 > #+end_src
 >
 > run like this
 >
 > #+header: :engine postgresql :dbhost "localhost"  :dbuser "rmason"
 :database "test" :colnames yes
 > #+header: :post hideresults
 > #+name: pgquery
 > #+begin_src sql
 > select timestamp,nempty0 from settings where timestamp like
 '%20210528%'
 > #+end_src
 >
 > produces
 >
 > #+RESULTS: pgquery
 > : nil
 >
 > I'm sure there is a way to do this, but I need some pointers as to
 how.
 >
 > Thanks for any help.
 >
 > Roger
 >
 > Org mode version 9.2.3 (release_9.2.3-390-gfb5091 @
 > /home/rmason/.emacs.d/org-git/lisp/)
 >
 > GNU Emacs 27.2 (build 1, amd64-portbld-freebsd11.4, X toolkit, cairo
 version 1.16.0, Xaw3d scroll bars)
 >




Re: [org-cite, oc-basic] configurable open-at-point, font-locking when json?

2021-06-07 Thread Bruce D'Arcus
On Mon, Jun 7, 2021 at 5:27 PM Bruce D'Arcus  wrote:

> So would it be so simple as doing something like this, to use the
> bibtex-completion-open function instead?
>
> (org-cite-register-processor 'basic
>   :follow #'bibtex-completion-open)
>
> As in, that just tells what function to use for at-point?

... or rather, one would have to write additional code to accompany
that function?

LIke a 'oc-bibtex-completion-follow'?

Bruce



Re: literate programming, development log -- ideas?

2021-06-07 Thread Dr. Arne Babenhauserheide

briangpowell  writes:

> * Donald Knuth created much for us, including TeX and a Literate
> Programming system called CWeb which helped to make C code documented in
> what he envisioned for Literate Programming
>
> ** A more generalized system that is based on CWeb is NoWeb--useful not
> just for C/C++ code but for every language: Recommend using NoWeb for
> Literate Programming: "NoWeb — A Simple, Extensible Tool for Literate
> Programming":
>
> https://www.cs.tufts.edu/~nr/noweb/

I use :noweb-ref quite a bit, and most of my org-files end in

# Local Variables:
# org-confirm-babel-evaluate: nil
# org-export-default-language: en
# org-babel-noweb-wrap-start: "{{{"
# org-babel-noweb-wrap-end: "}}}"
# End:

A recent wonderful discovery I made is M-x org-babel-detangle. I used it
extensively with mathe-ass:
- 
https://hg.sr.ht/~arnebab/draketo/browse/anderes/mathe-ass.org?rev=e9c77a19ed5f#L344
- https://www.draketo.de/anderes/mathe-ass.js

mathe-ass.org:
* code :noexport:
#+begin_src javascript :tangle "mathe-ass.js" :exports none :comments link
…
#+end_src

mathe-ass.js:
// [[file:mathe-ass.org::*code][code:1]]
…
// code:1 ends here

With this I can program in the tangled file and then re-import the code
to org.

Best wishes,
Arne
-- 
Unpolitisch sein
heißt politisch sein
ohne es zu merken


signature.asc
Description: PGP signature


[PATCH] org.el: prevent partial fontification when a link is full displayed (was org-link-set-parameters: when :display full, etc.)

2021-06-07 Thread Juan Manuel Macías
As I commented in a previous post of this thread, to reproduce the
bug, just run `org-toggle-link-display'.

As a possible solution I'm attaching this patch (little tested).

Best regards,

Juan Manuel

>From caf32a7e1fb1b4bddfa011520f5403d5b6b19ddd Mon Sep 17 00:00:00 2001
From: Juan Manuel Macias 
Date: Tue, 8 Jun 2021 01:55:02 +0200
Subject: [PATCH] org.el: prevent partial fontification when a link is
 displayed full

* lisp/org.el (org-activate-links): apply `face-property' variable in
other cases when handle invisible parts in bracket links
---
 lisp/org.el | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/lisp/org.el b/lisp/org.el
index 1bd9e02eb..b55d8798a 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -5224,9 +5224,11 @@ This includes angle, plain, and bracket links."
 			   ,(or (org-link-get-parameter type :display)
 'org-link))
 			 properties)))
+		(add-face-text-property start visible-start face-property)
 		(add-text-properties start visible-start hidden)
-(add-face-text-property visible-start visible-end face-property)
+		(add-face-text-property visible-start visible-end face-property)
 		(add-text-properties visible-start visible-end properties)
+		(add-face-text-property visible-end end face-property)
 		(add-text-properties visible-end end hidden)
 		(org-rear-nonsticky-at visible-start)
 		(org-rear-nonsticky-at visible-end)))
-- 
2.31.1



Re: literate programming, development log -- ideas?

2021-06-07 Thread Samuel Banya
I did a ton of notes in Org Mode with src blocks all of the time in my previous 
support job, and planning to do the same in my new one.

Can anyone post any video links to this kind of style of programming being used 
directly in Emacs?

I know there's the awesome one on YouTube by Harry Schwartz, but I feel like 
there's gotta be some more content on how to do this, and how to integrate this 
effectively in a workflow.

I know some people had mentioned in this thread that they use a .org file for 
their given project, but can anyone link to any repos where this is actually 
being used?

Would be curious on how people have implemented this.

Also, would be interested in other Org packages as well (since I was debating 
org-roam, but didn't feel I was smart enough to handle it yet).

On Mon, Jun 7, 2021, at 11:17 PM, Dr. Arne Babenhauserheide wrote:
> 
> briangpowell mailto:briangpowellms%40gmail.com>> 
> writes:
> 
> > * Donald Knuth created much for us, including TeX and a Literate
> > Programming system called CWeb which helped to make C code documented in
> > what he envisioned for Literate Programming
> >
> > ** A more generalized system that is based on CWeb is NoWeb--useful not
> > just for C/C++ code but for every language: Recommend using NoWeb for
> > Literate Programming: "NoWeb — A Simple, Extensible Tool for Literate
> > Programming":
> >
> > https://www.cs.tufts.edu/~nr/noweb/
> 
> I use :noweb-ref quite a bit, and most of my org-files end in
> 
> # Local Variables:
> # org-confirm-babel-evaluate: nil
> # org-export-default-language: en
> # org-babel-noweb-wrap-start: "{{{"
> # org-babel-noweb-wrap-end: "}}}"
> # End:
> 
> A recent wonderful discovery I made is M-x org-babel-detangle. I used it
> extensively with mathe-ass:
> - 
> https://hg.sr.ht/~arnebab/draketo/browse/anderes/mathe-ass.org?rev=e9c77a19ed5f#L344
> - https://www.draketo.de/anderes/mathe-ass.js
> 
> mathe-ass.org:
> * code :noexport:
> #+begin_src javascript :tangle "mathe-ass.js" :exports none :comments link
> …
> #+end_src
> 
> mathe-ass.js:
> // [[file:mathe-ass.org::*code][code:1]]
> …
> // code:1 ends here
> 
> With this I can program in the tangled file and then re-import the code
> to org.
> 
> Best wishes,
> Arne
> -- 
> Unpolitisch sein
> heißt politisch sein
> ohne es zu merken
> 
> 
> *Attachments:*
>  * signature.asc


Re: [org-cite, oc-basic] configurable open-at-point, font-locking when json?

2021-06-07 Thread Matt Price
Ni Nicolas and Bruce,

I'm having trouble keeping up with these emails, let alone testing all
these new features!  But this most recent response of yours, Nicolas, makes
me wonder if it's worth raising a concern.

On Mon, Jun 7, 2021 at 5:15 PM Nicolas Goaziou 
wrote:

> Hello,
>
> "Bruce D'Arcus"  writes:
>
> > Similar to my idea to have a configurable capf, could that function be
> > configurable?
> >
> > A couple of people noted, for example, that the preferred choice would
> > be that the actual document be opened. I actually got a PR for exactly
> > this default behavior this past weekend, and bibtex-completion has a
> > function that takes keys and does this. So would be great do something
> > like:
> >
> > (setq org-cite-basic-open bibtex-completion-open-pdf)
>
> If you want to use a different "follow" capability, you need to provide
> a different processor instead of configuring this one.
>

IIUC, the current architecture assigns responsibility for both *citation
export* and *in-buffer actions* to a processor shosen by the user (right
now, oc-cite, oc-natbib, or oc-csl).

In addition, it is more or less expected that some users will frequently
switch back and forth between processors depending on whether they are
exporting to latex or HTML (or something else, like ODT, I guess).

But these two features (in-buffer actions and eport) are functionally and
logically distinct. The current architecture (if I've understood it right)
means that in a non-infrequent use case, the in-buffer actions (and also
fontification & overlays) will likely change back and forth rather
quickly.But surely this is not what most users would want. Instead, they
would likely want to fine-tune the in-buffer appearance and actions
themselves.  Wouldn't it make sense to have a series of defcustoms, like,
maybe, org-cite-open-function, org-cite-font-lock-function, and maybe
others, which could be set by users on their own? Org-cite could supply
some sensible defaults and advanced users could customize.

I guess this will become complicated once there are processors supporting
more exotic backends (e.g. Zotero via zotxt), but package managers could
handle that in readme's or perhaps with a single defcustom like, maybe,
~org-zotxt-do-cite-setup~, or similar.

I also think this will reduce code repetition across the 3 processors, and
generally simplify life for most users (though initial setup may be more
frequent.

Have I understood correctly, and if so what do you think of this idea?

>
> > Second, I completely lose font-locking when using json files. I know
> > you have plans, Nicolas, to add json support, but even without that,
> > shouldn't the citation be highlighted?
>
> Could you provide an example?
>
> Regards,
> --
> Nicolas Goaziou
>
>


Re: literate programming, development log -- ideas?

2021-06-07 Thread Greg Minshall
Samuel,

> Can anyone post any video links to this kind of style of programming
> being used directly in Emacs?

there was an effort recently, that i'm tardy on reporting on here, to do
an introduction to "emacs for R programmers".

https://ess-intro.github.io/


as part of that, i did a (either too short, or too long) video on Org
mode, which, in reality, is pretty neutral w.r.t. programming language.
you might find that of interest.  it's linked at the above ESS intro
site.

i hadn't known of Harry Schwartz's efforts -- thanks for that.

> I know some people had mentioned in this thread that they use a .org
> file for their given project, but can anyone link to any repos where
> this is actually being used?

many people here probably have repos with software.  two of mine are

https://gitlab.com/minshall/covid-19
https://gitlab.com/minshall/photoTagger


cheers, Greg



Re: literate programming, development log -- ideas?

2021-06-07 Thread Samuel Banya
Neat stuff, will bookmark this, thanks Greg!

On Tue, Jun 8, 2021, at 3:23 AM, Greg Minshall wrote:
> Samuel,
> 
> > Can anyone post any video links to this kind of style of programming
> > being used directly in Emacs?
> 
> there was an effort recently, that i'm tardy on reporting on here, to do
> an introduction to "emacs for R programmers".
> 
> https://ess-intro.github.io/
> 
> 
> as part of that, i did a (either too short, or too long) video on Org
> mode, which, in reality, is pretty neutral w.r.t. programming language.
> you might find that of interest.  it's linked at the above ESS intro
> site.
> 
> i hadn't known of Harry Schwartz's efforts -- thanks for that.
> 
> > I know some people had mentioned in this thread that they use a .org
> > file for their given project, but can anyone link to any repos where
> > this is actually being used?
> 
> many people here probably have repos with software.  two of mine are
> 
> https://gitlab.com/minshall/covid-19
> https://gitlab.com/minshall/photoTagger
> 
> 
> cheers, Greg
> 


Re: literate programming, development log -- ideas?

2021-06-07 Thread Greg Minshall
Samuel,

> Neat stuff, will bookmark this, thanks Greg!

you're welcome.  i should mention that i don't recommend the .org files
in my gitlab repositories as exemplars of structure/style.  but, they
might give an idea.  the .org file related to the ESS video is probably
more manageable.

cheers, Greg