Re: bug#58678: 28.2; :session in org-babel for python unexpected output

2022-10-24 Thread Sergey
I have traced this to org-bable issue with MacOS python readline and native 
completion. Similar issues discussed in 
https://github.com/jorgenschaefer/elpy/issues/887
and 
https://debbugs.gnu.org/cgi/bugreport.cgi?bug=25753

The solution proposed in those threads, i.e., installing python from homebrew, 
which has gnureadline, helps for emacs 27 but causes freezing in emacs 28 after 
displaying following message:
```
Warning (python): Your ‘python-shell-interpreter’ doesn’t seem to support 
readline, yet ‘python-shell-completion-native-enable’ was t and "python3" is 
not part of the ‘python-shell-completion-native-disabled-interpreters’ list. 
Native completions have been disabled locally.
```

Setting ~python-shell-completion-native-enable~ to nil removes the warning but 
doesn't prevent freezing. This behaviour persists with minimal org setup as 
well (although, I believe my emacs comes with org pre-packaged).

Cheers,
Sergey.


--- Original Message ---
On Saturday, October 22nd, 2022 at 12:58 AM, Ihor Radchenko 
 wrote:


> [Redirecting from Emacs bugs]
> [See the quote below for the original report]
> 
> > #+RESULTS:
> > : >>> __PYTHON_EL_eval("try:\nwith 
> > open('/var/folders/dk/3btmprj123b_31jsp30thzrmgq/T/babel-9tY6uv/python-92ZLVe')
> >  as 
> > __org_babel_python_tmpfile:\nexec(compile(__org_babel_python_tmpfile.read(),
> >  __org_babel_python_tmpfile.name, 
> > 'exec'))\nexcept:\nraise\nfinally:\nprint('
> > ```
> 
> 
> I am unable to reproduce with the latest main on Linux.
> Sergey, could you please try to reproduce with the latest Org version
> from Git? See https://orgmode.org/manual/Feedback.html#Feedback
> 
> Best,
> Ihor
> 
> Sergey via "Bug reports for GNU Emacs, the Swiss army knife of text
> editors" bug-gnu-em...@gnu.org writes:
> 
> > Running the following org file in 'emacs -Q' leads to an unexpected
> > output as demonstrated below:
> > ```
> > #+begin_src elisp
> > (setq org-babel-python-command "python3")
> > (setq python-shell-interpreter "/usr/bin/python3")
> > (org-babel-do-load-languages
> > 'org-babel-load-languages
> > '(
> > (python . t)))
> > #+end_src
> > 
> > #+begin_src python :results output
> > print(2)
> > #+end_src
> > 
> > #+RESULTS:
> > : 2
> > 
> > #+begin_src python :results output :session python-test
> > print(2)
> > #+end_src
> > 
> > #+RESULTS:
> > : >>> __PYTHON_EL_eval("try:\nwith 
> > open('/var/folders/dk/3btmprj123b_31jsp30thzrmgq/T/babel-9tY6uv/python-92ZLVe')
> >  as 
> > __org_babel_python_tmpfile:\nexec(compile(__org_babel_python_tmpfile.read(),
> >  __org_babel_python_tmpfile.name, 
> > 'exec'))\nexcept:\nraise\nfinally:\nprint('
> > ```
> > 
> > In GNU Emacs 28.2 (build 1, aarch64-apple-darwin21.6.0, NS appkit-2113.60 
> > Version 12.6 (Build 21G115))
> > of 2022-10-12 built on MAC-140754
> > Windowing system distributor 'Apple', version 10.3.2113
> > System Description:macOS 12.6
> > 
> > Configured using:
> > 'configure --disable-dependency-tracking --disable-silent-rules
> > --enable-locallisppath=/opt/homebrew/share/emacs/site-lisp
> > --infodir=/opt/homebrew/Cellar/emacs-plus@28/28.2/share/info/emacs
> > --prefix=/opt/homebrew/Cellar/emacs-plus@28/28.2 --with-xml2
> > --with-gnutls --without-dbus --without-imagemagick --with-modules
> > --with-rsvg --with-ns --disable-ns-self-contained 'CFLAGS=-Os -w -pipe
> > -mmacosx-version-min=12
> > -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX12.sdk
> > -DFD_SETSIZE=1 -DDARWIN_UNLIMITED_SELECT'
> > 'CPPFLAGS=-I/opt/homebrew/opt/icu4c/include
> > -I/opt/homebrew/opt/openssl@1.1/include
> > -I/opt/homebrew/opt/readline/include -isystem/opt/homebrew/include
> > -F/opt/homebrew/Frameworks
> > -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX12.sdk'
> > 'LDFLAGS=-L/opt/homebrew/opt/icu4c/lib
> > -L/opt/homebrew/opt/openssl@1.1/lib -L/opt/homebrew/opt/readline/lib
> > -L/opt/homebrew/lib -F/opt/homebrew/Frameworks
> > -Wl,-headerpad_max_install_names
> > -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX12.sdk''
> > 
> > Configured features:
> > ACL GLIB GMP GNUTLS JPEG JSON LCMS2 LIBXML2 MODULES NOTIFY KQUEUE NS
> > PDUMPER PNG RSVG THREADS TIFF TOOLKIT_SCROLL_BARS XIM ZLIB
> > 
> > Important settings:
> > value of $LANG: en_US.UTF-8
> > locale-coding-system: utf-8-unix
> > 
> > Major mode: Info
> > 
> > Minor modes in effect:
> > shell-dirtrack-mode: t
> > tooltip-mode: t
> > global-eldoc-mode: t
> > show-paren-mode: t
> > electric-indent-mode: t
> > mouse-wheel-mode: t
> > tool-bar-mode: t
> > menu-bar-mode: t
> > file-name-shadow-mode: t
> > global-font-lock-mode: t
> > font-lock-mode: t
> > blink-cursor-mode: t
> > auto-composition-mode: t
> > auto-encryption-mode: t
> > auto-compression-mode: t
> > buffer-read-only: t
> > line-number-mode: t
> > indent-tabs-mode: t
> > transient-mark-mode: t
> > 
> > Load-path shadows:
> > None found.
> > 
> > Features:
> > (shadow sort mail-extr emacsbug sendmail info warnings compile ob-python
> > python tramp-sh tramp 

Re: [BUG] Undocumented convention for org-time-stamp-custom-formats to be "<...>" (was: time-stamp in DONE tag is not really displayed)

2022-10-24 Thread Tim Cross


Ihor Radchenko  writes:

> Uwe Brauer  writes:
>
>> My time-stamps are of the form <2022-10-23 Sun>
>> I have an entry like this 
>>
>> - State "DONE"   from "WAIT"   [2022-10-23 21:06] \\
>>
>>
>>
>> However it is displayed when I use org-toggle-time-stamp-overlays  as
>>  [23.10.%]
>>
>> Neither the year not the time is displayed, why!
>>  
>> I have set 
>> org-time-stamp-custom-formats 
>> to 
>> (" %d.%m.%Y " . " %d.%m.%Y")
>>
>> I am puzzled, any ideas?
>
> Confirmed.
>
> This is because Org expects the first and the last characters in
> org-time-stamp-custom-formats to be opening/closing brackets.
> (undocumented)
>
> Why?
> Because org-time-stamp-formats does so.
>
> Why does org-time-stamp-formats does so?
> No idea.
> This code dates back to initial Org commits.
>
> I think it would make sense to change it.
> However, if we change special treatment of the first/last characters in
> org-time-stamp-custom-formats, it will also make sense to change
> org-time-stamp-formats constant.
>
> For backwards compatibility, we will need to keep special treatment to
> strip brackets around the formats, if present.
>
> I propose to do the following:
> 1. org-time-stamp-formats and org-time-stamp-custom-formats will be
>treated as is, unless they contain "<" and ">" and the first and the
>last char.
> 2. If the formats do contain <...>, strip the "<" and ">".
> 3. Document (2) in the docstrings.
>
> Any objections?

Little unsure/confused regarding what is being proposed here.

- If we are removing <...>, does that mean we just retain [..] for
  inactive timestamps and all other timestamps are 'active' by default?

- How will this change impact code which distinguishes active/inactive
  timestamps based on presence/absence of <..> and [..]?

- What impact will this have on existing org files?

- Will this cause issues in parsing when you may have dates/times which
  are not supposed to be timestamps, but will look the same as
  timestamps? How will you distinguish them?

Personally, I like the clear distinction between what is a timestamp and
what isn't and what is an active timestamp and what is an inactive
timestamp.



[BUG] Error in html form of org manual [9.5.5 (9.5.5-ge58bd0 @ /home/jds6696/.emacs.d/straight/build/org/)]

2022-10-24 Thread Justin Silverman
Remember to cover the basics, that is, what you expected to happen and
what in fact did happen.  You don't know how to make a good report?  See



Your bug report will be posted to the Org mailing list.


Try going to this link:


It just takes you to the Latex Export page. Most of the links on the latex 
export page don't seem to go anywhere. 

Thank you all so much for the amazing work!

Emacs  : GNU Emacs 28.2 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.34, 
cairo version 1.17.6)
 of 2022-09-12
Package: Org mode version 9.5.5 (9.5.5-ge58bd0 @ 
/home/jds6696/.emacs.d/straight/build/org/)


Re: Request for feedback: ox-linuxmag

2022-10-24 Thread Damien Cassou
Ihor Radchenko  writes:
> Why not using org-export-define-derived-backend?

I didn't know this function exist. I changed the code to use it.

> Also, linuxmag might be confused with…

What do you think about ox-linuxmag-fr as package name and linuxmag-fr
as exporter name?

>> (defconst ox-linuxmag--resources-dir
>>   (expand-file-name "resources" (file-name-directory (or load-file-name 
>> (buffer-file-name
>>   "Directory containing the style and template XML files.")
>
> This will spoil the installation dir.

What do you mean by that? Do you have a different way to do it? The odt
exporter contains a similar variable and external files (see
`org-odt-lib-dir`).

> Your template function has side effects. Side effects are usually
> implemented inside the export function. like ox-linuxmag--export-to-odt

I guess you are referring to `ox-linuxmag--write-meta-file` and
`ox-linuxmag--write-styles-file`. I would be happy to move them to the
export function but they depend on `info` and I don't know how to get
that from there. Also, I copy/pasted the structure of ox-odt which does
something similar in `org-odt-template`.

Any recommendation?


>> ox-linuxmag--export-to-odt
>
> Why is it marked as private function? By convention, Org exporters
> provide public function to export programatically.

You are perfectly right. This is now fixed.

Thank you very much for helping me improve the code! I really appreciate
the time and effort.

-- 
Damien Cassou

"Success is the ability to go from one failure to another without
losing enthusiasm." --Winston Churchill



Re: [off-topic] E-readers and Org-Mode

2022-10-24 Thread Juan Manuel Macías
Fraga, Eric writes:
> On Monday, 24 Oct 2022 at 17:42, Jeffrey DeLeo wrote:
>> I am very happy with my Kobo Elipsa
>
> Your workflow is very similar to that of mine on the reMarkable and the
> two units are similar in size etc.  It's a workflow that is fine for
> annotating documents (which is what I want) but definitely no link to
> org mode for the OP... ;-)

Indeed. Both Kobo Elipsa and reMarkable are very tempting and in a
similar price range. The main problem I find is that they both also run
closed and, presumably, proprietary software. I don't know if my
knowledge (and my time) would be enough to try to hack them. And I
imagine that I would run the risk of ending up bricking the gadget.

The annotations by hand with the stylus are difficult to translate to
Org :-) but in any case they are tremendously useful and save
considerable paper and ink.

I wonder if these devices are capable of exporting normal annotations in
plain text or xml? Anyway, I think it would be possible to write some
python script[1] to extract the annotations and then parse the resulting
xml from there to get a nice and beautiful Org document. Which also
leads me to wonder if anyone has tried that. I think it's a good
entertainment for a vacation...

[1] https://stackoverflow.com/questions/1106098/parse-annotations-from-a-pdf



Re: Interest in an Org video meetup?

2022-10-24 Thread Leo Vivier
Hi all,

I’m super happy to see the interest in getting an org-mode usergroup off
the ground!  I’m even happier about the fact that we could help you
address the technical and logistical issues that have been raised in
this thread.

Since EmacsConf 2020, Sacha and I have been working with Emacs usergroup
organizers to provide them with the tools needed to publicize, host, and
record their sessions.  We have a page on the EmacsWiki which lists all
the usergroups we know of: https://www.emacswiki.org/emacs/Usergroups

For the recording problem at hand, we’d be able to offer you access to
a BigBlueButton (BBB) [0] instance running on a server we own (kindly
provided to us by Fosshost).  BBB provides server-side recording for all
audio and video feeds, and we’ve been using it to record and publish the
live Q with EmacsConf speakers without problems.

George Mauer  writes:

> One thing I always mention when conversations about recording come up
> is that if you promote recordings as a resource, it is considered good
> form to have transcription available.

Captions are also something we could help you with!  Last year, for
EmacsConf 2021, we managed to get almost all the talks captioned before
broadcast thanks to our team of volunteers.  This year, we’ve improved
our process by introducing speech recognition via OpenAI Whisper [1],
and we’ve been pretty happy with the results. We’d be happy to help you
get set up for captioning too, especially if there’s a great talk you’d
like to extract and share.

Let me know what you're interested in and we’ll set you up with
everything. :)

Notes:
[0] BigBlueButton (BBB) is FLOSS Video conferencing suite.  For details,
see: https://bigbluebutton.org/
[1] https://openai.com/blog/whisper/

Best,
-- 
Leo Vivier
Freelance Software Developer
Website: www.leovivier.com | Blog: www.zaeph.net



Re: [off-topic] E-readers and Org-Mode

2022-10-24 Thread Fraga, Eric
On Monday, 24 Oct 2022 at 17:42, Jeffrey DeLeo wrote:
> I am very happy with my Kobo Elipsa

Your workflow is very similar to that of mine on the reMarkable and the
two units are similar in size etc.  It's a workflow that is fine for
annotating documents (which is what I want) but definitely no link to
org mode for the OP... ;-)

-- 
: Eric S Fraga, with org release_9.5.5-1023-g48b237 in Emacs 29.0.50


How ro delete DONE attemps

2022-10-24 Thread Renato Pontefice
Hi,
I’m wondering how can I delete, on my .org file, the line that have:
- an old Timestamp (i.e. if I set a thing to be done today (<2022-10-24 Mon 
17:26>)
- a TODO item (always with a past date) <2022-10-24 Mon 17:26>

That to have a more clean .org file.

Is it possible?
How can I obtain it?

Thank you

Renato


[BUG] org-cite-insert error on style part

2022-10-24 Thread Kierin Bell


Hello,
When I run 'org-cite-insert' with point before the initial colon of a
citation element, Emacs signals a 'wrong-number-of-arguments' error.

For example, 'C-c C-x @' with point below X in:
  X
[cite:@author2022]

...Produces:
Debugger entered--Lisp error: (wrong-number-of-arguments (1 . 1) 0)
  org-cite-basic--complete-style()
  #f(compiled-function (context arg) #)((citation (:style nil :begin 94 :post-blank 0 \\
   :end 111 :contents-begin 100 :contents-end 110 :parent (paragraph  \\
   (:begin 94 :end 111 :contents-begin 94 :contents-end 111   \\
   :post-blank 0 :post-affiliated 94 :parent nil nil)
  org-cite-insert(nil)
  funcall-interactively(org-cite-insert nil)
  call-interactively(org-cite-insert nil nil)
  command-execute(org-cite-insert)

The problem appears to be that my Emacs build doesn't like that
'org-cite-make-insert-processor' is calling
'org-cite-basic--complete-style' without any arguments on line 1636 of
oc.el:
 (style (funcall select-style)))

'org-cite-insert' in other contexts works as expected, including with a
prefix argument when point is outside of any citation, which creates a
new citation by doing completion for a style.

This may be more of an issue with my setup; I'm not an Elisp expert. But
I'm filing it as a bug because I'm getting an error that is reproducible
even with 'emacs -Q'.

GNU Emacs 29.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.24, cairo 
version 1.16.0)
Org mode version 9.5.4 (release_9.5.4-17-g6e991f @ 
/usr/local/share/emacs/29.0.50/lisp/org/)

Thanks,
Kierin



Re: [off-topic] E-readers and Org-Mode

2022-10-24 Thread Jeffrey DeLeo
I am very happy with my Kobo Elipsa
(https://us.kobobooks.com/products/kobo-elipsa).

I use the following flow very often:

  + Place a PDF in dropbox folder, sync to Elipsa

  + Read on Elipsa, annotate in various ways

  + Sync back to dropbox.

  + Look at PDF on my desktop computer (linux), annotations visible.

I use okular to read PDF on linux.

  





Re: [off-topic] E-readers and Org-Mode

2022-10-24 Thread Fraga, Eric
On Monday, 24 Oct 2022 at 11:50, Juan Manuel Macías wrote:
> The Parabola hack looks pretty cool (that's supposed to be equivalent
> to being able to use Emacs with pdf-tools package). 

Be aware (as I wasn't when I answered your previous post) that Parabola
is not free in the $ sense although the author claims it is free in the
libre sense.

-- 
: Eric S Fraga, with org release_9.5.5-966-g88c85d in Emacs 29.0.50

How to delete an instruction when it has expired

2022-10-24 Thread Renato Pontefice
Hi,
I’m wondering how can I delete, on my .org file, the line that have:
- an old Timestamp (i.e. if I set a thing to be done today (<2022-10-24 Mon 
17:26>)
- a TODO item (always with a past date) <2022-10-24 Mon 17:26>

That to have a more clean .org file.

Is it possible?
How can I obtain it?

Thank you

Renato


Re: [BUG] Undocumented convention for org-time-stamp-custom-formats to be "<...>"

2022-10-24 Thread Uwe Brauer
>>> "IR" == Ihor Radchenko  writes:

> Uwe Brauer  writes:
>> My time-stamps are of the form <2022-10-23 Sun>
>> I have an entry like this 
>> 
>> - State "DONE"   from "WAIT"   [2022-10-23 21:06] \\
>> 
>> 
>> 
>> However it is displayed when I use org-toggle-time-stamp-overlays  as
>> [23.10.%]
>> 
>> Neither the year not the time is displayed, why!
>> 
>> I have set 
>> org-time-stamp-custom-formats 
>> to 
>> (" %d.%m.%Y " . " %d.%m.%Y")
>> 
>> I am puzzled, any ideas?

> Confirmed.

thanks

> This is because Org expects the first and the last characters in
> org-time-stamp-custom-formats to be opening/closing brackets.
> (undocumented)

So this should have been the correct setting?

("<%d.%m.%Y " . " %d.%m.%Y>")

> Why?
> Because org-time-stamp-formats does so.

> Why does org-time-stamp-formats does so?
> No idea.
> This code dates back to initial Org commits.

> I think it would make sense to change it.
> However, if we change special treatment of the first/last characters in
> org-time-stamp-custom-formats, it will also make sense to change
> org-time-stamp-formats constant.

> For backwards compatibility, we will need to keep special treatment to
> strip brackets around the formats, if present.

> I propose to do the following:
> 1. org-time-stamp-formats and org-time-stamp-custom-formats will be
>treated as is, unless they contain "<" and ">" and the first and the
>last char.
> 2. If the formats do contain <...>, strip the "<" and ">".
> 3. Document (2) in the docstrings.

> Any objections?

To me that sounds logical.



-- 
Warning: Content may be disturbing to some audiences
I strongly condemn Putin's war of aggression against the Ukraine.
I support to deliver weapons to Ukraine's military. 
I support the ban of Russia from SWIFT.
I support the EU membership of the Ukraine. 
https://addons.thunderbird.net/en-US/thunderbird/addon/gmail-conversation-view/


smime.p7s
Description: S/MIME cryptographic signature


Re: [PATCH 2/2] doc/org-manual.org: Document org-clock-{in,out}-switch-to-state

2022-10-24 Thread Samuel W. Flint
> Ihor Radchenko writes:

IR> "Samuel W. Flint"  writes:
>> +  #+vindex: org-clock-in-switch-to-state
>> +  #+vindex: org-clock-in-next-state
>> +  #+findex: org-clock-in-next-state-function
>> +  The variable ~org-clock-in-switch-to-state~ controls if and how a
>> +  current task's TODO state is changed.  No change (a ~nil~) is the
>> +  default.  A specific state may be forced with a string value.  The
>> +  ~org-clock-in-next-state~ alist may be utilized by setting it to
>> +  ~org-clock-in-next-state-function~, or a custom function may be
>> +  used.  This custom function should take the current state, and
>> +  return either a new state or ~nil~ to keep the current state.

IR> First of all, thanks for the patch!

IR> However, it is not clear for me what is the purpose of this new feature
IR> (even after reading the proposed patch to the manual).

IR> Could you please explain in simple words when your new feature can be
IR> useful?

The variable `org-clock-in-switch-to-state` can be really handy,
however, it wasn't documented in the manual which made discovery
somewhat difficult.  The manual patch documents the variable, as well as
a new variable exposed through customize to describe how states should
change on clock-in/clock-out.  This means that instead of having to
write a custom function to do this, it's provided and exposed through
customize and thus should be more discoverable and hopefully usable.
Patch 1/2 provides the implementation.

Consider, for example, the following settings:

(setf org-clock-in-switch-to-state 'org-clock-in-next-state-function
  org-clock-in-next-state '(("TODO" . "WORKING")
("WAITING" . "WORKING")))

And the following heading:

* TODO Do a thing

When clocking in, it will become:

* WORKING Do a thing

On the next clock-in, it will stay at "WORKING".  Consider instead:

* WAITING Waiting to do a thing

On clock-in to this heading, it becomes

* WORKING Waiting to do a thing

This can be applied similarly for org-clock-out, though I'm not sure how
useful that will be.

hth,

Sam

-- 
Samuel W. Flint
4096R/FA13D704
  (F50D 862B 4F65 5943 A8C2  EF0E 86C9 3E7A FA13 D704)
λs.(s s) λs.(s s)
O< ascii ribbon campaign - stop html mail - www.asciiribbon.org



Re: LIterate programming with calc (help)

2022-10-24 Thread Fraga, Eric
On Monday, 24 Oct 2022 at 13:26, Ypo wrote:
> Why do you think it doesn't work something more human readable like this?
>
> #+begin_src calc
>solve([
>a = 300 m,
>b = 300 m,
>Area = a*b,
>cost = 1 (USD/m^2),
>z = Area*cost
>
>], [a, b, Area, cost, z])
> #+end_src

It only parses a line at a line unfortunately.  This would work in
Maxima, mind you. ;-)  (with some minor change in syntax, of course)

-- 
: Eric S Fraga, with org release_9.5.5-966-g88c85d in Emacs 29.0.50


Re: Request for feedback: ox-linuxmag

2022-10-24 Thread Ihor Radchenko
Damien Cassou  writes:

> I'm done writing ox-linuxmag, an exporter for the French GNU/Linux
> Magazine: https://github.com/DamienCassou/ox-linuxmag.

Why not using org-export-define-derived-backend?
Also, linuxmag might be confused with
https://www.linux-magazine.com/tags/view/Operating+Systems/GNU

> (defconst ox-linuxmag--resources-dir
>   (expand-file-name "resources" (file-name-directory (or load-file-name 
> (buffer-file-name
>   "Directory containing the style and template XML files.")

This will spoil the installation dir.

> ox-linuxmag--template

Your template function has side effects. Side effects are usually
implemented inside the export function. like ox-linuxmag--export-to-odt

> ox-linuxmag--export-to-odt

Why is it marked as private function? By convention, Org exporters
provide public function to export programatically.

And it is (interactive), which is even more strange given that it is
marked private (--).


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



Re: [off-topic] E-readers and Org-Mode

2022-10-24 Thread Juan Manuel Macías
Pedro Andres Aranda Gutierrez writes:

> My workflow is to create an HTML from the org file(s) and then
> generate an EPUB2 file forthe reader (in my case Kobo or Cervantes
> Light) I have always felt the rendition is much more confortable than
> PDF. Other readers may be better suited for PDF.

Thanks, Pedro. BTW, have you tried org-epub
(http://github.com/ofosos/org-epub)? I don't usually work with epubs,
but the few times that I need to export to epub it usually works for me.

Best regards,

Juan Manuel 




Re: Fix M-j with default fill-prefix value

2022-10-24 Thread Ihor Radchenko
Ihor Radchenko  writes:

> Javier Olaechea  writes:
>
>> org-comment-line-break-function does not handle fill-prefix being set to
>> nil, which is the default value for fill-prefix. This means that pressing
>> M-j inside an org-mode buffer in a vanilla installation of Emacs results in
>> an error. From looking at other callers of
>> insert-before-markers-and-inherit it is clear that a guard against
>> fill-prefix being nil is missing.
>
> I guess this is fine to fix the immediate error, but I do not see much
> point in the whole org-comment-line-break function. AFAIU, it does not
> even recognise whether we are inside comment or not. I just tried to use
> the default comment-indent-new-line and it correctly indents paragraphs
> and also comments. On the other hand, it does not indent item lists and
> src-blocks.
>
> Rather than applying this patch I would remove
> org-comment-line-break-function alltogether. It will already be better
> than the current state. Alternatively, it should be rewritten to take
> into account current element context, similar to org-insert-comment.

My guess was not correct.
The issue had to be fixed by modifying org-comment-line-break-function
at the end.
Now, fixed on main.
See https://list.orgmode.org/877d1m9343.fsf@localhost/

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



Re: [O] Bug: Bulk adding tags in agenda does not respect radio groups

2022-10-24 Thread Ihor Radchenko
Mark Kerr  writes:

> I have a radio group of 3 tags defined in org-tag-alist: now. next, later.
> This tag group works correctly when editing the tags directly in the
> original org files or when the tags are edited individually in the agenda
> using ':'.
>
> When editing tags via the agenda's bulk editing command, however, adding a
> tag from that radio group does not remove any pre-existing tags from that
> group.
>
> For example, say an item is already tagged "now", and the tag "next" is
> added to it via bulk editing. The expected result is that the tag "next" is
> added and the tag "now" is removed. Instead, the result is ":now:next:", as
> the pre-existing tag is not removed.
>
> I have version 9.2.3

Sorry for the late reply.
This is yet another case where limited tag group support shows up.
Note that Org mode support for group tags is mostly tailored for agenda
matching. Commands are not well-adapted.
The fix will require careful review of Org code and is not trivial.
Patches always welcome though.

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



Re: [off-topic] E-readers and Org-Mode

2022-10-24 Thread Juan Manuel Macías
Hi, Eric,

Fraga, Eric writes:

> Putting aside the org mode aspect for the moment, I highly recommend the
> reMarkable [1] tablet for reading PDF documents.  I have owned one for
> several years now and use it all the time (in particular for reading 300
> pages theses on the train...).  I do not use org mode on it, however.
>
> For Emacs, some people have hacked the reMarkable.  I have not tried any
> of the hacks but the Parabola initiative [2] seems the most advanced.
>
> HTH,
> eric
>
> Footnotes:
> [1]  https://remarkable.com/
>
> [2]  http://www.davisr.me/projects/parabola-rm/,

Thanks a lot for the pointers. I didn't know about it, but something
like reMarkable is what I'm looking for, a device that serves as a
substitute for printed paper in A4 and reading on a desktop screen. The
Parabola hack looks pretty cool (that's supposed to be equivalent to
being able to use Emacs with pdf-tools package). I have seen that the
Wi-Fi does not work (it is not essential for me) but the OTG does. I
will investigate about it... In that device line I had also seen the
Onyx Boox Note. But recently I read that this brand has a sad history of
violating the Linux kernel GPL license.

N.B.: I have to say that I have never used an e-ink device. The
''closest'' thing is this hack I wrote, for use especially on my old
Thinkpad in high light environments. It uses Picom compositor and
Redshift. And, after messing around with the parameters a lot, I found
these that I'm quite satisfied with. It also helps to apply a monochrome
theme in Emacs. Of course, it is nothing more than a simulation to try
to reduce the light emission as much as possible:

#+begin_src emacs-lisp

(setq picom-command "picom --backend glx --glx-fshader-win \"uniform sampler2D 
tex; uniform float opacity; void main() { vec4 color = texture2D(tex, 
gl_TexCoord[0].xy); gl_FragColor = vec4(vec3(0.2126 * color.r + 0.7152 * 
color.g + 0.0722 * color.b) * opacity, color.a * opacity); }\"")

(setq redshift-command "redshift -l 40.5914000:-4.1474000 -b 0.9:0.9 -t 
4000k:4000k -g 0.5:0.5:0.8")

(defun my-poor-man-eink-toggle ()
  (interactive)
  (when (equal (process-status "picom") 'run)
(kill-process "picom"))
  (if (and (not (equal (process-status "picom-g") 'run))
   (not (equal (process-status "redshifg-g") 'run)))
  (progn
(shell-command "killall picom") 
(shell-command "killall redshift-gtk")
(shell-command "redshift -x")
(start-process-shell-command "redshift-g" nil redshift-command)
(start-process-shell-command "picom-g" nil picom-command))
(kill-process "picom-g")
(kill-process "redshift-g")
(shell-command "redshift -x")
(start-process-shell-command "redshift" nil "redshift-gtk -c 
~/.redshift.conf")))
#+end_src




Re: Bug: canceled capture operation results in demoted following heading when template ends with newline [9.2.4 (9.2.4-11-g1c3eae-elpaplus @ /home/gustavo/.emacs.d/elpa/org-plus-contrib-20190722/)]

2022-10-24 Thread Gustavo Barros
Hi Ihor,

On Mon, 24 Oct 2022 at 01:21, Ihor Radchenko  wrote:

> I am unable to reproduce your recipe on the latest Org main.

Indeed, I can confirm! True, the empty line between the headings still
goes missing, but there's no longer structural change which was the
real problem.

And, sorry for the noise. I had assumed that for such an old one the
latest release was good enough approximation, it turned out it wasn't.

> Note that we have several capture-related fixed on main but not on
> stable Org 9.5.5.

I was tempted to call the "lucky us" card again, but twice in a row
makes it unlikely. It seems that what's really going on is folks
working hard for the upcoming release, which is much appreciated.  :-)
Thank you all! And particularly to whoever got this one fixed.

Best regards,
Gustavo.



Re: [BUG] org-link-descriptive not honored as file-local-variable [9.5 (9.5-g0a86ad @ /home/gustavo/.emacs.d/elpa/org-9.5/)]

2022-10-24 Thread Gustavo Barros
Hi Ihor,

On Mon, 24 Oct 2022 at 01:52, Ihor Radchenko  wrote:

> This is because setting things up for links is a part of Org loading
> process. And file-local variables are only loaded after major mode by
> Emacs. See https://debbugs.gnu.org/cgi/bugreport.cgi?bug=57003

Ah, I had presumed this one would be a load order issue, and indeed it
is a general one. Agreed that this report should stay on standby until
it's been decided what to do in general terms.

And thank you for raising the issue in the Emacs list. Good discussion, btw.

Best regards,
Gustavo.



Re: LIterate programming with calc (help)

2022-10-24 Thread Ypo

Not bad, thanks!!!

Why do you think it doesn't work something more human readable like this?

#+begin_src calc
   solve([
   a = 300 m,
   b = 300 m,
   Area = a*b,
   cost = 1 (USD/m^2),
   z = Area*cost

   ], [a, b, Area, cost, z])
#+end_src


Best regards


El 24/10/2022 a las 9:56, Fraga, Eric escribió:

On Sunday, 23 Oct 2022 at 14:15, Ypo wrote:

Is it possible to express in a calc block some basic operations with
variables and non-predefined units?
Why A*c won't show an arithmetic result, but ~: A c ~?

I've never managed to get calc blocks define variables.  The equations
you have typed in are "equations" in the mathematical sense, not
assignment statements.


Is it possible to work with the "$" unit?

$ means something specific in calc (cannot remember what).  I use "USD"
instead, for instance, and it works fine.

The following single line calc block does do what you want:

#+begin_src calc
   solve([a = 300 m, b = 300 m, Area = a*b, cost = 1 (USD/m^2), z = Area*cost], 
[a, b, Area, cost, z])
#+end_src

#+results:
: [a = 300 m, b = 300 m, Area = 9 m^2, cost = USD / m^2, z = 9 USD]


Re: [BUG] ox-odt file: links are not pointing to the real files (was: [BUG] ox-odt fails for org-id links (e.g., from org-roam v2) [9.5.2 (9.5.2-gfbff08 @ /home/moritz/.emacs.d/elpa/27.2/develop/org-9

2022-10-24 Thread Max Nikulin

On 23/10/2022 11:29, Ihor Radchenko wrote:

Max Nikulin writes:


pandoc-2.5 generates a link that can not be opened by LibreOffice as
well (no leading ../).

echo 'A' | pandoc -f html -t odt -o pandoc.odt

A


May you ask pandoc people about this?


Pandoc, I have installed, is too old for a bug report, but such issue 
was created several years ago:


https://github.com/jgm/pandoc/issues/3524
ODT: relative links #3524

Unfortunately attempts to find similar discussions related to office 
applications give excessive noise related to UI recipes. I mostly avoid 
office software, so I may miss something quite obvious for experienced 
users.






[BUG] there was a sudden message [9.6 (9.6-??-86c4635db @ /Users/mohammedalbatati/.emacs.d/.local/straight/build-28.2/org/)]

2022-10-24 Thread Mohammed Albatati



Remember to cover the basics, that is, what you expected to happen and
what in fact did happen.  You don't know how to make a good report?  See

 https://orgmode.org/manual/Feedback.html#Feedback

Your bug report will be posted to the Org mailing list.


While typing this message showed up to me asking to submit the bug
report


Warning (lsp-mode): Unable to calculate the languageId for buffer ‘custom.el’. 
Take a look at ‘lsp-language-id-configuration’. The ‘major-mode’ is 
emacs-lisp-mode Disable showing Disable logging
Warning (org-element-cache): org-element--cache: Org parser error in 
report_submit.org::5095. Resetting.
The error was: (wrong-type-argument integer-or-marker-p nil)
Backtrace:
"  backtrace-to-string(nil)
  org-element-at-point()
  org-back-to-heading(t)
  org-back-to-heading-or-point-min(t)
  org-get-property-block()
  org--property-local-values(\"LOG_INTO_DRAWER\" t)
  org-entry-get-with-inheritance(\"LOG_INTO_DRAWER\" t)
  org-entry-get(nil \"LOG_INTO_DRAWER\" inherit t)
  org-log-into-drawer()
  org-mode-flyspell-verify()
  flyspell-word()
  flyspell-check-region-doublons(576 5121)
  flyspell-large-region(576 5121)
  flyspell-region(576 5121)
  flyspell-lazy-check-visible()
  apply(flyspell-lazy-check-visible nil)
  timer-event-handler([t 0 3 0 t flyspell-lazy-check-visible nil idle 0 nil])
"

Emacs  : GNU Emacs 28.2 (build 1, x86_64-apple-darwin18.7.0, NS appkit-1671.60 
Version 10.14.6 (Build 18G95))
of 2022-09-12
Package: Org mode version 9.6 (9.6-??-86c4635db @ 
/Users/mohammedalbatati/.emacs.d/.local/straight/build-28.2/org/)

current state:
==
(setq
org-journal-date-prefix "#+TITLE:"
org-link-elisp-confirm-function nil
org-directory "~/org/"
org-after-refile-insert-hook '(save-buffer)
org-indirect-buffer-display 'current-window
org-crypt-key nil
org-hide-emphasis-markers t
org-bibtex-headline-format-function #[257 "\300\236A\207" [:title] 3 "\n\n(fn 
ENTRY)"]
org-download-file-format-function 'org-download-file-format-default
org-log-done 'time
org-load-hook '(+org-init-org-directory-h +org-init-appearance-h 
+org-init-agenda-h
 +org-init-attachments-h +org-init-babel-h 
+org-init-babel-lazy-loader-h
 +org-init-capture-defaults-h +org-init-capture-frame-h
 +org-init-custom-links-h +org-init-export-h +org-init-habit-h
 +org-init-hacks-h +org-init-keybinds-h +org-init-popup-rules-h
 +org-init-smartparens-h)
org-log-into-drawer t
org-startup-folded nil
org-babel-after-execute-hook '(+org-redisplay-inline-images-in-babel-result-h)
org-link-abbrev-alist '(("doomdir" . "/Users/mohammedalbatati/.doom.d/%s")
 ("emacsdir" . "/Users/mohammedalbatati/.emacs.d/%s")
 ("doom-repo" . 
"https://github.com/doomemacs/doomemacs/%s;)
 ("wolfram" . "https://wolframalpha.com/input/?i=%s;)
 ("wikipedia" . "https://en.wikipedia.org/wiki/%s;)
 ("duckduckgo" . "https://duckduckgo.com/?q=%s;)
 ("gmap" . "https://maps.google.com/maps?q=%s;)
 ("gimages" . "https://google.com/images?q=%s;)
 ("google" . "https://google.com/search?q=;)
 ("youtube" . "https://youtube.com/watch?v=%s;)
 ("github" . "https://github.com/%s;))
org-agenda-skip-scheduled-if-done t
org-agenda-files '("~/org/")
org-journal-dir "/Users/mohammedalbatati/org/journal/"
org-journal-date-format "%a, %Y-%m-%d"
org-capture-templates '(("t" "Personal todo" entry
  (file+headline +org-capture-todo-file "Inbox")
  "* [ ] %?\n%i\n%a" :prepend t)
 ("n" "Personal notes" entry
  (file+headline +org-capture-notes-file "Inbox")
  "* %u %?\n%i\n%a" :prepend t)
 ("j" "Journal" entry
  (file+olp+datetree +org-capture-journal-file) "* %U 
%?\n%i\n%a"
  :prepend t)
 ("p" "Templates for projects")
 ("pt" "Project-local todo" entry
  (file+headline +org-capture-project-todo-file "Inbox")
  "* TODO %?\n%i\n%a" :prepend t)
 ("pn" "Project-local notes" entry
  (file+headline +org-capture-project-notes-file 
"Inbox")
  "* %U %?\n%i\n%a" :prepend t)
 ("pc" "Project-local changelog" entry
  (file+headline +org-capture-project-changelog-file 
"Unreleased")
  "* %U %?\n%i\n%a" :prepend t)
 ("o" "Centralized templates for projects")
 ("ot" "Project todo" entry
  

Re: [ANN] The 2022 Emacs User Survey is now open!

2022-10-24 Thread Jean Louis
How were you introduced to Emacs?
Friend
Recommended by a colleague
University/College
Some part of the internet

You forgot that GNU/Linux distributions were initially distributed on
CD and DVD ROMs, people were buying it, getting from magazines "for
free" and by similar physical distribution.

IMHO, that is one major point, that shall be considered primary.

-- 
Jean

Take action in Free Software Foundation campaigns:
https://www.fsf.org/campaigns

In support of Richard M. Stallman
https://stallmansupport.org/



Re: [ANN] The 2022 Emacs User Survey is now open!

2022-10-24 Thread Russell Adams
Completed!

On Mon, Oct 24, 2022 at 06:42:35PM +0800, Timothy wrote:
> Hi All,
>
> I’m thrilled to announce that the Emacs User Survey 2022 is now open to
> responses. It is my hope that this may help emacs-devel, Emacs package
> maintainers, and the wider Emacs community develop a better understanding of
> how people experience Emacs on a day-to-day basis.
>
> 
>
> The survey will be open from October 24th to November 30th.
>
> This time there are /no/ non-free Javascript or user-tracking caveats as this
> features a bespoke survey framework written from scratch for the Emacs User
> Survey to support a pure HTML-forms + CSS approach with server-side rendering
> .
>
> See the [FAQ] for more information on the survey itself.
>
> It would be fantastic for this to be shared as far and wide as possible, to 
> get
> responses from a large swathe of the community. If you can share this with 
> Emacs
> communities you are a part of, as well as any friends or colleagues that use
> Emacs, that would be much appreciated.
>
> We can look forward to a discussion of the (preliminary) results in EmacsConf:
> .
>
> All the best,
> Timothy
>
> --
> Timothy (‘tecosaur’/‘TEC’), Org mode contributor.
> Learn more about Org mode at .
> Support Org development at ,
> or support my work at .
>
>
> [FAQ] 



--
Russell Adamsrlad...@adamsinfoserv.com
https://www.adamsinfoserv.com/



Re: LIterate programming with calc (help)

2022-10-24 Thread Christian Moe


Fraga, Eric writes:

> On Monday, 24 Oct 2022 at 09:20, Ihor Radchenko wrote:
>> I vaguely recall that storing variables in calc is something like
>> variable := assignment (which is actually rewrite rule, but that's how
>> 13.1 Storing Variables section of the calc manual explains variable
>> assignments).
>
> That is true for embedded calc (which I use all the time) but I cannot
> seem to get this to work for src blocks:


Same: it requires using the `s s' (calc-store) command, though (which
can also be done without the := assignment operator), and I've searched
the manual without spotting a way to do that with algebraic entry and
hence in a src block, as there doesn't seem to be any corresponding
command. I hope there is a way, though!

As an unsatisfying workaround, one could use :var header arguments; they
work up to a point, but not with units, as Ypo wants to use (and which
are are a really cool thing about Calc).

Once one's using variables, it will probably be necessary to wrap the
final calculation in evalv() to get a numeric value as output instead of
a formula with the variable names in it.

Another obstacle to what Ypo is trying to do is the attempt to use the $
sign for the currency unit. Calc does not have pre-defined currency
units, and $ is taken - it refers to the last value on stack. I tend to
use 'USD'.

So a partial, if pointless, way to do this would be to first store the
variables with the calculator:

  ' 300 m
s s a   # store a = 300 m
  ' 300 m
s s b   # store b = 300 m
  ' 1 USD/m^2
s s cost# store cost = (1) usd/m^2
  ' a*b
s s Area# store Area = a*b (*not* 9 m^2)

Then the last step could be done in a src block:

  #+begin_src calc
evalv(Area * cost)
  #+end_src

  #+RESULTS:
  : 9 USD

(Another cool bit: If you change the value of a or b and rerun the src
block, the result will change, since what was stored in Area was the
product of the variables, not the product of their values.)

Yours,
Christian



Re: Best android app

2022-10-24 Thread Jean Louis
* Ihor Radchenko  [2022-10-24 05:52]:
> 
> Except for https://easyPLAGIARISM.com/, feel free to send a patch
> against 

Pure Plagiarism.

Getting customers for proprietary software through Org mailing list.

Plagiarists getting smarter and smarter.

* Overview of noun plagiarism

The noun plagiarism has 2 senses (no senses from tagged texts)
1. plagiarism -- (a piece of writing that has been copied from someone
else and is presented as being your own work)

2. plagiarism, plagiarization, plagiarisation, piracy -- (the act of
plagiarizing; taking someone's words or ideas as if they were your
own)

Additionally "Org Mode" qualifies as trademark in Sweden, where this
company is registered. 

I advise to Org Mode authors to defend against plagiarism, as they
call it Emacs Org Mode -- which is not. I do not mind if anybody will
complain or not -- I am only pointing out to not ethical behavior of
that company.

It would be fine to say that they use headings and TODO things
similarly like Org Mode, but their wordings for proprietary software I
find very deceptive. 

,
| "Emacs Org mode Made Easy
| 
| EasyOrg is compatible and comes with many of the functionalities
| provided by Emacs Org mode, but with more user friendliness. Both
| Editor and Agenda provided."
`

These words cheat the reader by telling that it is "compatible"
something, while it is not editor mode, it is probably whole editor
and software without Emacs.


Jean

Take action in Free Software Foundation campaigns:
https://www.fsf.org/campaigns

In support of Richard M. Stallman
https://stallmansupport.org/



Re: [ANN] The 2022 Emacs User Survey is now open!

2022-10-24 Thread Payas Relekar


Great job on the survey!

Filled and submitted.

Timothy  writes:

> Hi All,
>
> I’m thrilled to announce that the Emacs User Survey 2022 is now open to
> responses. It is my hope that this may help emacs-devel, Emacs package
> maintainers, and the wider Emacs community develop a better understanding of
> how people experience Emacs on a day-to-day basis.
>
> 
>
> The survey will be open from October 24th to November 30th.
>
> This time there are /no/ non-free Javascript or user-tracking caveats as this
> features a bespoke survey framework written from scratch for the Emacs User
> Survey to support a pure HTML-forms + CSS approach with server-side rendering
> .
>
> See the [FAQ] for more information on the survey itself.
>
> It would be fantastic for this to be shared as far and wide as possible, to 
> get
> responses from a large swathe of the community. If you can share this with 
> Emacs
> communities you are a part of, as well as any friends or colleagues that use
> Emacs, that would be much appreciated.
>
> We can look forward to a discussion of the (preliminary) results in EmacsConf:
> .
>
> All the best,
> Timothy

--



[ANN] The 2022 Emacs User Survey is now open!

2022-10-24 Thread Timothy
Hi All,

I’m thrilled to announce that the Emacs User Survey 2022 is now open to
responses. It is my hope that this may help emacs-devel, Emacs package
maintainers, and the wider Emacs community develop a better understanding of
how people experience Emacs on a day-to-day basis.



The survey will be open from October 24th to November 30th.

This time there are /no/ non-free Javascript or user-tracking caveats as this
features a bespoke survey framework written from scratch for the Emacs User
Survey to support a pure HTML-forms + CSS approach with server-side rendering
.

See the [FAQ] for more information on the survey itself.

It would be fantastic for this to be shared as far and wide as possible, to get
responses from a large swathe of the community. If you can share this with Emacs
communities you are a part of, as well as any friends or colleagues that use
Emacs, that would be much appreciated.

We can look forward to a discussion of the (preliminary) results in EmacsConf:
.

All the best,
Timothy

-- 
Timothy (‘tecosaur’/‘TEC’), Org mode contributor.
Learn more about Org mode at .
Support Org development at ,
or support my work at .


[FAQ] 


Re: LIterate programming with calc (help)

2022-10-24 Thread Ihor Radchenko
"Fraga, Eric"  writes:

> On Sunday, 23 Oct 2022 at 14:15, Ypo wrote:
>> Is it possible to express in a calc block some basic operations with
>> variables and non-predefined units?
>
>> Why A*c won't show an arithmetic result, but ~: A c ~?
>
> I've never managed to get calc blocks define variables.  The equations
> you have typed in are "equations" in the mathematical sense, not
> assignment statements.

I vaguely recall that storing variables in calc is something like
variable := assignment (which is actually rewrite rule, but that's how
13.1 Storing Variables section of the calc manual explains variable
assignments).

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



[BUG] Undocumented convention for org-time-stamp-custom-formats to be "<...>" (was: time-stamp in DONE tag is not really displayed)

2022-10-24 Thread Ihor Radchenko
Uwe Brauer  writes:

> My time-stamps are of the form <2022-10-23 Sun>
> I have an entry like this 
>
> - State "DONE"   from "WAIT"   [2022-10-23 21:06] \\
>
>
>
> However it is displayed when I use org-toggle-time-stamp-overlays  as
>  [23.10.%]
>
> Neither the year not the time is displayed, why!
>  
> I have set 
> org-time-stamp-custom-formats 
> to 
> (" %d.%m.%Y " . " %d.%m.%Y")
>
> I am puzzled, any ideas?

Confirmed.

This is because Org expects the first and the last characters in
org-time-stamp-custom-formats to be opening/closing brackets.
(undocumented)

Why?
Because org-time-stamp-formats does so.

Why does org-time-stamp-formats does so?
No idea.
This code dates back to initial Org commits.

I think it would make sense to change it.
However, if we change special treatment of the first/last characters in
org-time-stamp-custom-formats, it will also make sense to change
org-time-stamp-formats constant.

For backwards compatibility, we will need to keep special treatment to
strip brackets around the formats, if present.

I propose to do the following:
1. org-time-stamp-formats and org-time-stamp-custom-formats will be
   treated as is, unless they contain "<" and ">" and the first and the
   last char.
2. If the formats do contain <...>, strip the "<" and ">".
3. Document (2) in the docstrings.

Any objections?

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



Re: LIterate programming with calc (help)

2022-10-24 Thread Fraga, Eric
On Monday, 24 Oct 2022 at 09:20, Ihor Radchenko wrote:
> I vaguely recall that storing variables in calc is something like
> variable := assignment (which is actually rewrite rule, but that's how
> 13.1 Storing Variables section of the calc manual explains variable
> assignments).

That is true for embedded calc (which I use all the time) but I cannot
seem to get this to work for src blocks:

#+begin_src calc
  a := 300 m
  2 a
#+end_src

#+results:
: 2 a

whereas embedded mode works fine:

a := 300 m

and

2 a => 600 m

I really do not understand how calc src blocks work (I've not looked at
the code, mind you).

-- 
: Eric S Fraga, with org release_9.5.5-966-g88c85d in Emacs 29.0.50


Re: [PATCH 2/2] doc/org-manual.org: Document org-clock-{in,out}-switch-to-state

2022-10-24 Thread Ihor Radchenko
"Samuel W. Flint"  writes:

> +  #+vindex: org-clock-in-switch-to-state
> +  #+vindex: org-clock-in-next-state
> +  #+findex: org-clock-in-next-state-function
> +  The variable ~org-clock-in-switch-to-state~ controls if and how a
> +  current task's TODO state is changed.  No change (a ~nil~) is the
> +  default.  A specific state may be forced with a string value.  The
> +  ~org-clock-in-next-state~ alist may be utilized by setting it to
> +  ~org-clock-in-next-state-function~, or a custom function may be
> +  used.  This custom function should take the current state, and
> +  return either a new state or ~nil~ to keep the current state.

First of all, thanks for the patch!

However, it is not clear for me what is the purpose of this new feature
(even after reading the proposed patch to the manual).

Could you please explain in simple words when your new feature can be
useful?

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



Re: Best android app

2022-10-24 Thread Ihor Radchenko
Ypo  writes:

> I don't know how to send patches.
>
> I have found the place where I want to add some lines:
>
> https://git.sr.ht/~bzg/worg/tree/master/item/org-faq.org#L4502
>
>
> I have cloned the "repository" hoping it works like in github, but I see 
> no option to edit.

See https://orgmode.org/worg/org-contribute.html#orge1714bb

Or you can simply open the org-faq.org file, make your edits,
call M-x vc-diff, save the resulting buffer, and send it as an
attachment here.

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



Re: LIterate programming with calc (help)

2022-10-24 Thread Fraga, Eric
On Sunday, 23 Oct 2022 at 14:15, Ypo wrote:
> Is it possible to express in a calc block some basic operations with
> variables and non-predefined units?

> Why A*c won't show an arithmetic result, but ~: A c ~?

I've never managed to get calc blocks define variables.  The equations
you have typed in are "equations" in the mathematical sense, not
assignment statements.

> Is it possible to work with the "$" unit?

$ means something specific in calc (cannot remember what).  I use "USD"
instead, for instance, and it works fine.

The following single line calc block does do what you want:

#+begin_src calc
  solve([a = 300 m, b = 300 m, Area = a*b, cost = 1 (USD/m^2), z = Area*cost], 
[a, b, Area, cost, z])
#+end_src

#+results:
: [a = 300 m, b = 300 m, Area = 9 m^2, cost = USD / m^2, z = 9 USD]

-- 
: Eric S Fraga, with org release_9.5.5-966-g88c85d in Emacs 29.0.50


Re: Possible bugs in org-babel-temp-stable-file

2022-10-24 Thread Ihor Radchenko
Ferdinand Pieper  writes:

> Ihor Radchenko  writes:
>
>> When you have :dir argument in a source block, default-directory is set
>> to :dir value during execution. This affects the location of temporary
>> files as well.
>
> Yes, but not for header argument evaluation (which I think is reasonable).
> An example of what I meant:
>
> --8<---cut here---start->8---
> #+begin_src shell :dir /ssh:remote: :var file=(org-babel-temp-stable-file 
> (org-babel-get-src-block-info t) "")
> echo hello world > $file
> #+end_src
> --8<---cut here---end--->8---

Sure. I believe that we do not need to change anything wrt this example.
Though maybe explain a bit in documentation? Patches welcome!

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



Re: Possible bugs in org-babel-temp-stable-file

2022-10-24 Thread Ferdinand Pieper
Ihor Radchenko  writes:

> When you have :dir argument in a source block, default-directory is set
> to :dir value during execution. This affects the location of temporary
> files as well.

Yes, but not for header argument evaluation (which I think is reasonable).
An example of what I meant:

--8<---cut here---start->8---
#+begin_src shell :dir /ssh:remote: :var file=(org-babel-temp-stable-file 
(org-babel-get-src-block-info t) "")
echo hello world > $file
#+end_src
--8<---cut here---end--->8---



Re: [off-topic] E-readers and Org-Mode

2022-10-24 Thread Fraga, Eric
Dear Juan Manuel,

On Sunday, 23 Oct 2022 at 15:16, Juan Manuel Macías wrote:
> Hi all,
>
> As I am beginning to have serious eye fatigue problems, I am thinking of
> buying an e-ink device, not to read books but to read documents. 
> My idea is that it be an Android device and that it supports the
> installation of apk, to be able to install Termux/Emacs/Org-Mode and
> Nextcloud to sync with my desktop PC or my laptop. I'd like to explore
> a workflow where I could read PDFs on the device (and probably also
> text-only web pages with eww) and also take Org Mode notes.

Putting aside the org mode aspect for the moment, I highly recommend the
reMarkable [1] tablet for reading PDF documents.  I have owned one for
several years now and use it all the time (in particular for reading 300
pages theses on the train...).  I do not use org mode on it, however.

For Emacs, some people have hacked the reMarkable.  I have not tried any
of the hacks but the Parabola initiative [2] seems the most advanced.

HTH,
eric

Footnotes:
[1]  https://remarkable.com/

[2]  http://www.davisr.me/projects/parabola-rm/,

-- 
: Eric S Fraga, with org release_9.5.5-966-g88c85d in Emacs 29.0.50

Re: [off-topic] E-readers and Org-Mode

2022-10-24 Thread Pedro Andres Aranda Gutierrez
Hi Juan Manuel

My workflow is to create an HTML from the org file(s) and then generate an
EPUB2 file forthe reader (in my case Kobo or Cervantes Light) I have always
felt the rendition is much more confortable than PDF. Other readers may be
better suited for PDF.

Just my experience,
/Pedro A. Aranda

-- 
Fragen sind nicht da um beantwortet zu werden,
Fragen sind da um gestellt zu werden
Georg Kreisler

Headaches with a Juju log:
unit-basic-16: 09:17:36 WARNING juju.worker.uniter.operation we should run
a leader-deposed hook here, but we can't yet


Re: Org 9.6-pre and Bash sessions

2022-10-24 Thread Ihor Radchenko
Ihor Radchenko  writes:

> This is actually expected. Without session, ob-shell discards results of
> src blocks that fail and display *Error* window (empty in this case).
>
> If you try 
>
>   #+begin_src bash :results output
>   echo one > one.txt
>   echo two > two.txt
>   diff one.txt two.txt || true
>   #+end_src
>
> things will work as expected.
>
> I guess we can display a bit more info in `org-babel-eval'.

I improved the error buffer a bit and also made babel return the
available output with non-0 exit code.
https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=ab7eff9d9c0968392bd9783d72c56a4023bd10be
https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=f8a9cd23087799519bd709ea5c208ed29cb6587f

>>   #+begin_src bash :session bash :results output
>>   echo one > one.txt
>>   echo two > two.txt
>>   diff one.txt two.txt
>>   #+end_src
>>
>> ACTUAL:
>>   
>>   #+RESULTS:
>>   : org_babel_sh_prompt> 1c1
>>   : < one
>>   : ---
>>   : > two
>>   
>> EXPECTED:
>>   
>>   #+RESULTS:
>>   : 1c1
>>   : < one
>>   : ---
>>   : > two
>
> Confirmed.
> I know what is the problem. It is comint sometimes throwing output
> without newlines, which leads to comint-prompt-regexp not matching all
> the prompts after concatenating. Will take a look tomorrow.

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

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



Re: [BUG] org-link-descriptive not honored as file-local-variable [9.5 (9.5-g0a86ad @ /home/gustavo/.emacs.d/elpa/org-9.5/)]

2022-10-24 Thread Ihor Radchenko
Gustavo Barros  writes:

> On Fri, 29 Oct 2021 at 15:53, Gustavo Barros  wrote:
>
>> Currently, trying to set `org-link-descriptive' as file-local-variable
>> is not honored by Org, and doing so, leads to one of mismatched states
>> between `org-link-descriptive' and the invisibility specs.
>
> a respectful bump.
> Despite the changes made to `org-link-descriptive` by Kyle in a
> related thread (https://list.orgmode.org/87im4ypu9v@kyleam.com/),
> the failing recipe in this report can still be reproduced in Org 9.5.5
> and Emacs 28.2.

This is because setting things up for links is a part of Org loading
process. And file-local variables are only loaded after major mode by
Emacs. See https://debbugs.gnu.org/cgi/bugreport.cgi?bug=57003

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



Exporting diary-sexps into icalendar file

2022-10-24 Thread Stephen Eglen
hi,

I have a simple file, notes.org, with the following content.  (This is
the example from the org mode manual).

--
* 22:00-23:00 The nerd meeting on every 2nd Thursday of the month
  <%%(diary-float t 4 2)>
--

and this entry then appears once/month in the org agenda, as expected.
However, when I export to ics, the notes.ics file is effectively empty:

--
BEGIN:VCALENDAR
VERSION:2.0
X-WR-CALNAME:notes
PRODID:-//Stephen Eglen//Emacs with Org mode//EN
X-WR-TIMEZONE:BST
X-WR-CALDESC:
CALSCALE:GREGORIAN
END:VCALENDAR

--

I have org-icalendar-include-sexps set to t

Any clues what could be going wrong?

Stephen






[PATCH] ox.el: Refactor variable org-html--id-attr-prefix, ox-html.el: Add support for the ID property to org-html--reference

2022-10-24 Thread Feraidoon Mehri
I have already signed the copyright assignment. (Though I used my
other email rudiwillalwayslove...@gmail.com when signing it.)

I have manually tested the changes with a custom value for
`org-html--id-attr-prefix', and everything works.

I did not change the behavior of `org-html-prefer-user-labels'; the ID
property will not be used if `org-html-prefer-user-labels' is nil. IMO
this behavior should be changed, and it should be always used, just
like CUSTOM_ID.

Changelog:

* org/ox.el (org-html--id-attr-prefix): Refactor hardcoded "ID-" as a
new private variable.

* org/ox-html.el (org-html--reference): Add support for the ID
property (previously only supported CUSTOM_ID)

These changes make crossfile ID links work in the exported HTML when
`org-html-prefer-user-labels' is not-nil.


0001-ox.el-Refactor-variable-org-html-id-attr-prefix-ox-h.patch
Description: Binary data


time-stamp in DONE tag is not really displayed

2022-10-24 Thread Uwe Brauer



Hi

My time-stamps are of the form <2022-10-23 Sun>
I have an entry like this 

- State "DONE"   from "WAIT"   [2022-10-23 21:06] \\



However it is displayed when I use org-toggle-time-stamp-overlays  as
 [23.10.%]

Neither the year not the time is displayed, why!
 
I have set 
org-time-stamp-custom-formats 
to 
(" %d.%m.%Y " . " %d.%m.%Y")

I am puzzled, any ideas?

Uwe Brauer 




-- 
Warning: Content may be disturbing to some audiences
I strongly condemn Putin's war of aggression against the Ukraine.
I support to deliver weapons to Ukraine's military. 
I support the ban of Russia from SWIFT.
I support the EU membership of the Ukraine. 
https://addons.thunderbird.net/en-US/thunderbird/addon/gmail-conversation-view/