Re: netspend table

2023-02-07 Thread Jude DaShiell
I added that check column to the table and like that feature.  That shows
you the previous balance so errors can be caught humans make not orgmode.
My walmart order got cancelled by walmart so I deleted that row and put an
entry in for amazon to buy the razor WalMart couldn't ship.  The $1.00
transaction fees only happen on withdrawls not deposits with netspend.
Fortunately this isn't the official record but something I track so I have
an idea what's on the card at any time and don't overspend.
I think if I had known about orgmode when studying adjusted trial balance
sheets I would have used it since braille paper has a maximum of 42
characters in a line.
Ways exist to get around that so long as every column will be 42
characters or less, but they're not being used by any of the
braille producers


Jude 
"There are four boxes to be used in defense of liberty:
 soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author, 1940)

.

On Tue, 7 Feb 2023, TRS-80 wrote:

> Jude DaShiell  writes:
>
> > I think if I ever get good with #TBLFMT lines I'd like to write up
> > tables that cover many more useful and simpler calculation tables now
> > missing from documented orgmode.
>
> I replied separately about the accounting use-case (and I still think
> that's best handled by accounting software).  However I also agree that
> tables (spreadsheets especially) are very, very useful for many things.
> It's so handy having a little table (and some calculations) right there
> in your notes.
>
> It took me quite a while to get the hang of it though, but eventually I
> was able to produce some quite impressive (to myself, anyway) results.
> I guess what I am trying to say is, stick with it, the payoff is worth
> it.
>
> Since you provided this as an example though, we will work with it
> anyway.  If you have some other ideas, post them to the list (in new
> topics).  I think it would be very helpful for a lot of people to see
> some examples of this.  And I'm happy to share what I've learned.
>
> > This is a running balance table and I don't know what kind of a
> > #TBLFMT line would be useful for that either.
>
> You probably want to use a formula referencing relative (instead of
> absolute) locations, something like:
>
> #+begin_src org
>   Original table:
>   |--+--++---+-|
>   | date | transaction  | amount |   fee | balance |
>   |--+--++---+-|
>   | [2023-01-11] | original balance |  +0.00 | +0.00 | +423.17 |
>   | [2023-01-12] | dunkin   | -18.68 | -1.00 |  403.49 |
>   | [2023-01-13] | WalMart  | -28.68 | -1.00 |  384.88 |
>   | [2023-01-16] | Deposit  |  + |   |  634.88 |
>   | [2023-01-17] | Capris   |  - | - |  615.34 |
>   | [2023-01-17] | Mcdonalds|  -4.74 | -1.00 |  609.60 |
>   | [2023-01-18] | verizon  |  - | - |  543.35 |
>   | [2023-01-26] | dunkin   |  - | - |  542.37 |
>   | [2023-02-01] | damgoodcafe  | -13.28 | -1.00 |  528.09 |
>   |--+--++---+-|
>
>   Empty amounts (signs only) removed:
>   |--+--++---+-|
>   | date | transaction  | amount |   fee | balance |
>   |--+--++---+-|
>   | [2023-01-11] | original balance |  +0.00 | +0.00 | +423.17 |
>   | [2023-01-12] | dunkin   | -18.68 | -1.00 |  403.49 |
>   | [2023-01-13] | WalMart  | -28.68 | -1.00 |  373.81 |
>   | [2023-01-16] | Deposit  ||   |  373.81 |
>   | [2023-01-17] | Capris   ||   |  373.81 |
>   | [2023-01-17] | Mcdonalds|  -4.74 | -1.00 |  368.07 |
>   | [2023-01-18] | verizon  ||   |  368.07 |
>   | [2023-01-26] | dunkin   ||   |  368.07 |
>   | [2023-02-01] | damgoodcafe  | -13.28 | -1.00 |  353.79 |
>   |--+--++---+-|
>   ,#+TBLFM: @3$5..@>$5 = @-1 + ($-2 + $-1)
> #+end_src
>
> I am not sure what those signs (+/-) with empty amounts were about, but
> the way I would do it would be to make your entries in the 'amount' and
> 'fee' columns, and then let the running balance column be calculated.
> That's what I did in second table, above.
>
> Let me know if you have any questions.
>
>



Re: netspend table

2023-02-07 Thread TRS-80
Jude DaShiell  writes:

> I think if I ever get good with #TBLFMT lines I'd like to write up
> tables that cover many more useful and simpler calculation tables now
> missing from documented orgmode.

I replied separately about the accounting use-case (and I still think
that's best handled by accounting software).  However I also agree that
tables (spreadsheets especially) are very, very useful for many things.
It's so handy having a little table (and some calculations) right there
in your notes.

It took me quite a while to get the hang of it though, but eventually I
was able to produce some quite impressive (to myself, anyway) results.
I guess what I am trying to say is, stick with it, the payoff is worth
it.

Since you provided this as an example though, we will work with it
anyway.  If you have some other ideas, post them to the list (in new
topics).  I think it would be very helpful for a lot of people to see
some examples of this.  And I'm happy to share what I've learned.

> This is a running balance table and I don't know what kind of a
> #TBLFMT line would be useful for that either.

You probably want to use a formula referencing relative (instead of
absolute) locations, something like:

#+begin_src org
  Original table:
  |--+--++---+-|
  | date | transaction  | amount |   fee | balance |
  |--+--++---+-|
  | [2023-01-11] | original balance |  +0.00 | +0.00 | +423.17 |
  | [2023-01-12] | dunkin   | -18.68 | -1.00 |  403.49 |
  | [2023-01-13] | WalMart  | -28.68 | -1.00 |  384.88 |
  | [2023-01-16] | Deposit  |  + |   |  634.88 |
  | [2023-01-17] | Capris   |  - | - |  615.34 |
  | [2023-01-17] | Mcdonalds|  -4.74 | -1.00 |  609.60 |
  | [2023-01-18] | verizon  |  - | - |  543.35 |
  | [2023-01-26] | dunkin   |  - | - |  542.37 |
  | [2023-02-01] | damgoodcafe  | -13.28 | -1.00 |  528.09 |
  |--+--++---+-|

  Empty amounts (signs only) removed:
  |--+--++---+-|
  | date | transaction  | amount |   fee | balance |
  |--+--++---+-|
  | [2023-01-11] | original balance |  +0.00 | +0.00 | +423.17 |
  | [2023-01-12] | dunkin   | -18.68 | -1.00 |  403.49 |
  | [2023-01-13] | WalMart  | -28.68 | -1.00 |  373.81 |
  | [2023-01-16] | Deposit  ||   |  373.81 |
  | [2023-01-17] | Capris   ||   |  373.81 |
  | [2023-01-17] | Mcdonalds|  -4.74 | -1.00 |  368.07 |
  | [2023-01-18] | verizon  ||   |  368.07 |
  | [2023-01-26] | dunkin   ||   |  368.07 |
  | [2023-02-01] | damgoodcafe  | -13.28 | -1.00 |  353.79 |
  |--+--++---+-|
  ,#+TBLFM: @3$5..@>$5 = @-1 + ($-2 + $-1)
#+end_src

I am not sure what those signs (+/-) with empty amounts were about, but
the way I would do it would be to make your entries in the 'amount' and
'fee' columns, and then let the running balance column be calculated.
That's what I did in second table, above.

Let me know if you have any questions.

-- 
Cheers,
TRS-80




Re: netspend table

2023-02-07 Thread TRS-80
Jude DaShiell  writes:

> Thanks much for your help on this problem.  I've never done anything with
> ledger-cli yet and wasn't aware such a package existed.

Arne beat me to it, but I agree that this kind of thing is better in an
actual accounting program.  I love Orgmode as much as anyone, but I keep
my finances in something like ledger as well.

There are actually quite a lot of ledger-alikes, with a whole ecosystem
of various software around them, see:

https://plaintextaccounting.org/

Personally I use Beancount, but arrived at that decision after doing a
fair amount of reading at the above site.  YMMV of course.

-- 
Cheers,
TRS-80




Re: [POLL] Proposed syntax for timestamps with time zone info (was: [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda)

2023-02-07 Thread Jean Louis
* ypuntot  [2023-02-05 16:03]:
> For the Poll, the Jeans proposal would be to introduce manually:
> [2024-02-04 12:00 @America/Vancouver]

I never recommend or recommended to anybody, ever, to make timestamps
manually. That is for computer to make it right.

For human, that is to use calendar. Calendar must use time zone
databases in background as to avoid placing invalid timestamps.

> And org to convert it into:
> [2024-02-04 12:00 @-08,America/Vancouver]

If we speak of future planning, general recommendation I have already
referenced is:

- to say date, time and time zone,

- while knowing one cannot know if time zone will exist in future

- while knowing UTC offset may be changed in future, for future
  timestamps for human meetings is not necessary and not absolutely
  possible to know UTC offset

- future time zone database could tell that time zone does not exist
  any more. It could maybe try to derive new time zone, but it is
  vague, as cities and countries could change.

- future time zone database can have the new updated UTC offset.

- if offset is placed in future timestamps, again the future time zone
  database should be consulted. Change of UTC offset would not
  humanely change the time of meeting. If time of meeting is 12
  o'clock, then it would remain same, no matter offset. But other
  participants would need to consult time zone database to understand
  the time of meeting.

- for past timestamps local time plus UTC offset is good choice.

p-- 
Jean

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

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



Re: [POLL] Proposed syntax for timestamps with time zone info (was: [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda)

2023-02-07 Thread Jean Louis
* Max Nikulin  [2023-02-05 20:06]:
> On 05/02/2023 01:59, ypuntot wrote:
> > Then, given the time zone and the local time, you can know UTC.
> > If orgmode gets the UTC there is not ambiguity.
> 
> Mapping from local time to UTC may be ambiguous, so mapping from local time
> to time zone offset may be ambiguous as well.

Okay, though explain practical case examples.

Local time to UTC is almost always used in computing for accurate log
purposes.

Using UTC time for future events is vague, for reason that other human
cannot know with certainty what the author intended to do. Maybe
author intended meeting at 10 o'clock, but UTC offset in author's or
participant's time zone changed, or even time zone entry is not any
more. Author maybe had UTC offset -5, but now is -7, it becomes vague
what time author really intended.

Local time to time with UTC offset for same reason could be
non-conclusive in future.

Past is alright, as local time with UTC offset is pretty certain as
time zones hardly change in past.

Org needs first use examples, and then implementation for use examples.

> Usual case is local time change due to daylight saving time. Notice that 2nd
> and 4th lines in the results table have the same input, but time offset
> differs by 1 hour in the output while local time is the same:

Which is good example to demonstrate to people that 2:30 o'clock alone
cannot be represented in such time zones without UTC offset. That
"02:30" appears twice, it does not mean it is ambigous, as UTC offset
or different name of time zone like CET, CEST, would indicat what time
is that exacctly.


-- 
Jean

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

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



Re: [POLL] Proposed syntax for timestamps with time zone info (was: [FEATURE REQUEST] Timezone support in org-mode datestamps and org-agenda)

2023-02-07 Thread Jean Louis
* Ihor Radchenko  [2023-02-06 17:11]:
> Jean Louis  writes:
> 
> > * Ihor Radchenko  [2023-02-05 13:45]:
> >> [2024-02-04 12:00 @-08,America/Vancouver] will use fixed -8 offset
> >
> > What does that mean practically? Provide example for better
> > understanding. 
> 
> It means "when I scheduled this item, I expected the UTC offset at the
> time of the timestamp to be -08 and remain so. It was motivated by
> America/Vancouver time zone, but if it changes in future, I do not care
> - the scheduled time should remain at specific time point relative to
> UTC".

I read, though sorry, I do not understand who is expected to think
that UTC offset is fixed?

Is it Org as program?

Or is it human?

Another program in future, and human, must know did the organizer of
event, had in mind:

- to rather keep appointment at 12:00 o'clock, no matter the UTC
  offset changes, or

- to keep appointment based on UTC definition?

I find such situations rather easy to solve with database:

- I can have column like "timestamp" with UTC time or local time plus
  UTC offset, and if I did not enter any other information, that UTC
  offset is considered in future. Consider this column name
  "timestamp".

- I can have column "time" and when such is entered, then date is
  extracted from "timestamp" column, and combined with time. In this
  case UTC is only calculated in new time point but not used as period
  from past to appointment time.

- I can have time zone for the future, if I enter such in other
  column, the future calculation must use that proper time zone. 

The above handling is for program to handle and for human to know that
it is handled that way.

You said "I do not care", that means you as human decide that 
[2024-02-04 12:00 @-08,America/Vancouver] will use fixed -8 offset

But from where in such timestamp does user or program understand that?

> > - The UTC offset is not certain to remain fixed in the future. 
> 
> Yes. But fixing UTC offset means that time point is fixed. Example: you
> need a timestamp exactly N hours from now. It must not be affected by
> time zone rule changes.

Not generally! As I said, your time stamp is not structured, I cannot
see how do you decide the appointment here: 
[2024-02-04 12:00 @-08,America/Vancouver]

1. Both time zone and UTC offset may be changed in future. 

2. You as organizer you were maybe meaning UTC time "fixed" with offet
   -8, but the UTC offset maybe changed in future, it became -07. It
   is confusing, and neither program neither human will know with
   certainty if you meant 1 hour more or less.

3. To solve that problem, appointments are better defined as
following, with the structured time stamp:

* Meeting, discussion of our plan beyond 2030
  :PROPERTIES:
  :TIME: 10:00
  :TIMEZONE: Europe/Berlin
  :END:

Or this way, but I do not find that practical, however, "UTC-TIME"
could mean to program that it is fixed.

* Meeting, discussion of our plan beyond 2030
  :PROPERTIES:
  :UTC-TIME: [2024-02-04 12:00 @-08, America/Vancouver]
  :END:

However, if you do not define UTC-TIME to mean fixed, how is program
to know that the timestamp:

[2024-02-04 12:00 @-08, America/Vancouver]

means that it is -08 UTC fixed offset?

Without putting some structure, it will not know it.

Maybe this way (hypothetically):

[2024-02-04 12:00 @-08, America/Vancouver/UTC-FIXED]

as that way you would give signal to program that you want UTC fixed
time in future, and not 12:00 o'clock necessary.

Without any tag, neither program, nor authors, cannot know which time
will it be in future, if there is DST change, time zone change or
replacement of it, or UTC offset change.

Structuring it, becomes clear DATE:, TIME:, TIME-ZONE: as future TZ
database can give information of UTC offset and various local times
for TIME:

> > - If you do not have the time of creation of the timestamp above, you
> >   cannot know with certainty what was the offset in past, to calculate
> >   new UTC offset in case it changed
> 
> America/Vancouver in the above timestamp is nothing but a reference
> comment. One may or may not use it.
> 
> > - As not even time zone is certain to remain in existence in future,
> >   you will need to use time zone, in order to derive that future UTC
> >   offset correctly. As it could change in mean time.
> 
> If timestamp must follow the future time zone rules, can just use 
>  [2024-02-04 12:00 @America/Vancouver]

Exactly. And that is human friendly versus UTC, which is not readable.

> >> [2024-02-04 12:00 @America/Vancouver] will use @America/Vancouver time
> >> zone, as it is be defined in you OS time zone database.
> >
> > If you do not keep UTC offset, you will miss changes in future and
> > generate errors.
> 
> Only if you care. Maybe it is not an error to follow the future changes.
> If you want to be notified, just use [2024-02-04 12:00
> @-08,!America/Vancouver] explicitly stating the offset you expect in
> future.

OK but expecting or not expecting makes again 

Re: [TIP] Exporting Maxima results to LaTeX

2023-02-07 Thread Thomas S. Dye

Aloha Leo,

Leo Butler  writes:

Attached is a self-documented setup to do what the subject line 
says.

Comments/suggestions welcome.

Best,
Leo



Please consider adding this to 
https://orgmode.org/worg/org-contrib/babel/languages/ob-doc-maxima.org, 
which also has some notes on how to export Maxima to LaTeX.


All the best,
Tom

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



[BUG] M-S- does not adjust clock timestamps as described in docs [9.5.5]

2023-02-07 Thread Robert Nikander
Hi,

The docs say this about S-M + arrow keys on clock log lines. (In section: 8.4.1 
- Dates and Times > Clocking Work Time > Clocking Commands)

  ‘S-M-’ (‘org-timestamp-up’)
  ‘S-M-’ (‘org-timestamp-down’)
 On ‘CLOCK’ log lines, increase/decrease the timestamp at point and
 the one of the previous, or the next, clock timestamp by the same
 duration.  For example, if you hit ‘S-M-’ to increase a
 clocked-out timestamp by five minutes, then the clocked-in
 timestamp of the next clock is increased by five minutes.

But it doesn't seem to work like that. For example

   * Testing it out
   :LOGBOOK:
   CLOCK: [2023-02-07 Tue 12:35]--[2023-02-07 Tue 12:45] =>  0:10
   CLOCK: [2023-02-07 Tue 12:20]--[2023-02-07 Tue 12:30] =>  0:10
   CLOCK: [2023-02-06 Mon 12:20]--[2023-02-06 Mon 13:20] =>  1:00
   :END:

If I put point on the minutes of 12:30 (second line) and hit S-M-, it moves 
the time to 12:35, but nothing else moves. Based on the docs, I thought it 
would shift one of the other lines.

Rob


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.5.5 (release_9.5.5 @ 
/Applications/Emacs.app/Contents/Resources/lisp/org/)




[TIP] Exporting Maxima results to LaTeX

2023-02-07 Thread Leo Butler
Attached is a self-documented setup to do what the subject line says.
Comments/suggestions welcome.

Best,
Leo

#+TITLE: Tip for exporting Maxima results to LaTeX
#+AUTHOR: Leo Butler
#+OPTIONS: H:2 toc:nil num:nil tags:nil todo:nil
#+LATEX_CLASS: article
#+LATEX_HEADER: \usepackage{color}
#+LATEX_COMPILER: lualatex
#+STARTUP: beamer
#+PROPERTY: header-args:maxima :eval never-export :exports results :results raw drawer

* Goal
Generate @@latex:\LaTeX{}@@ code from Maxima code.

* Setup
** maxima-init.lisp
The command =org-babel-execute:maxima= in =lisp/ob-maxima.el= uses the Maxima command ~batchload~ to execute Maxima code. This is a very tight-lipped loader, so we over-write ~batchload~ with ~batch~. We also ~load~ an init file:

#+begin_example
,#+begin_src maxima :tangle maxima-init.lisp :exports none
  (defun $batchload (file) (mfuncall '$batch file))
  ($load "./maxima-init.mac")
,#+end_src
#+end_example

On tangling, this produces the ~common-lisp~ output file ~maxima-init.lisp~. It will be pre-loaded into Maxima.

#+begin_src maxima :tangle maxima-init.lisp :exports none
  (defun $batchload (file) (mfuncall '$batch file))
  ($load "./maxima-init.mac")
#+end_src

** maxima-init.mac
Next, we need to create an init file for Maxima that will provide an output printer that produces @@latex:\LaTeX{}@@ output. One option would be to use the ~imaxima~ printer. Here is another option that uses the ~alt-display~ package.
The code replaces the default printer with ~org_tex_display~. It also sets the ~epilog~ prompt, so that the final ~#+begin_example~ is terminated.

#+begin_example
,#+begin_src maxima :tangle maxima-init.mac :exports none
  load("alt-display.mac") $
  set_prompt('epilog,printf(false,"~%#+end_example")) $
  define_alt_display(org_tex_display(x),
block([], printf(true,"#+end_example~%#+begin_export latex~%"),
  printf(true,"\\textcolor{blue}{(\\~a~d)} ",outchar,linenum-1), tex(second(x)), 

Re: [POLL] Proposed syntax for timestamps with time zone info

2023-02-07 Thread Jean Louis
* Marcin Borkowski  [2023-02-06 18:34]:
> Out of curiosity: in what time zone you were when you sent this???

In EAT, by heart in Berlin, Europe, at time in future during
DST, as to test various features.

Forgot to change time back by using NTP.

And e-mail went, discovering few problems in the mailing list
software, and Dino messenger.

-- 
Jean

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

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



Re: [BUG] list.orgmode.org managed to parse a message in future: 2023-10-29 [9.6.1 (release_9.6.1-223-gc8d20d @ /home/yantar92/.emacs.d/straight/build/org/)]

2023-02-07 Thread Jean Louis
* Greg Minshall  [2023-02-05 21:43]:
> so, i wouldn't blame mail services for accepting mail with odd dates.
> but, i would question MUAs (like mh-e, mutt, etc., i guess) that allow
> one to send e-mail with odd dates.  (i mean, i guess if the person
> stands on their head and swears up and down that they mean to do it,

`mutt' is program that receives date from system date. Nothing wrong
with it alone.

You cannot blame computer program for doing what is
instructed. Programs know the time we gave to them.

A server for mailing list is much more important program than single
MUA.

Mailing list solves communication of many people.

Such computer is always online and can easily synchronize time with
Internet servers.

In my opinion central computer that manages mailing lists should
recogniz if time of users is far in future and handle it
appropriately.

Maybe re-writing time with explanation in e-mail header would be more
appropriate.

-- 
Jean

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

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



Re: Specialized sparse-tree via hook to show specific view in org mode

2023-02-07 Thread Ihor Radchenko
Kevin Layer  writes:

> My main todo file defines various TODO keywords and initial state like this:
>
> #+STARTUP: indent overview
> #+TODO: @NOW @NEXT @WIP @PENDING
>
> What I really want is to initially only see items noted with those TODO
> keywords and also due items.  Everything else should be hidden.

I think you can use `org-match-sparse-tree'. It supports the general
match syntax. See 11.3.3 Matching tags and properties section for the
match syntax.

> If this is the right way and the maintainer wants me to submit a patch, I
> would include these functions to get a new optional for keep-previous,
> since they could all plausibly be used for the same thing that
> org-check-before-date was:
> * org-show-todo-tree
> * org-check-deadlines
> * org-check-before-date
> * org-check-after-date
> * org-check-dates-range

I think that it does make sense to support KEEP-PREVIOUS in these
functions. `org-occur' does support it and there is no reason not to
allow the same toggle in the listed functions.


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



clock reports, group/rollup by tags, properties?

2023-02-07 Thread Robert Nikander
Hi,

I see some previous discussion about this years ago [1], but it looks like it 
never made it into the official code base. (?)

If I use `:scope agenda`, I get a column called “File” that is used as the top 
“group by” in the query. I don’t see a way to change that.

I’d like to see my time divided by different criteria, like the type of work, 
which I would define using properties or tags.

Does org-mode do this now? If not, would people want this feature, or was there 
a reason it was abandoned?

Rob

[1] https://lists.gnu.org/archive/html/emacs-orgmode/2011-05/msg00219.html





Re: [PATCH] worg/org-faq.org: Recommend cb_thunderlink Thunderbird add-on

2023-02-07 Thread Bruno Barbier


Hi Max,

Max Nikulin  writes:
> A have prepared an alternative patch. Let me know if have suggestions, 
> objections, or if you prefer to proceed with another revision of your
> patch.

Looks good to me.

> It seems you had no plan to polish your Org and system configuration to 
> such degree.

Not that one, that I'm using only when forced to use win32!
(else, I'm a very happy user of notmuch)

Thanks Max!

Bruno


> From a1b3a81bbc11fd2f55096cc2e29f97797b80b915 Mon Sep 17 00:00:00 2001
> From: Max Nikulin 
> Date: Tue, 7 Feb 2023 21:49:06 +0700
> Subject: [PATCH] org-faq.org: Recommend cb_thunderlink Thunderbird add-on
>
> * org-faq.org (Thunderbird emails): Add CUSTOM_ID property to have
> stable anchor during HTML export.  Recommend cb_thunderlink extension as a
> means to generate mid: links and to handle existing thunderlink: ones.
> Add a note that on Windows Thunderbird should register itself as a
> handler of the mid: protocol.
>
> Thanks to Bruno Barbier for discussion on the emacs-orgmode
> mailing list.
> ---
>  org-faq.org | 37 +
>  1 file changed, 29 insertions(+), 8 deletions(-)
>
> diff --git a/org-faq.org b/org-faq.org
> index 0410d368..a7db75c1 100644
> --- a/org-faq.org
> +++ b/org-faq.org
> @@ -1999,13 +1999,16 @@ ** Can I use CamelCase links?
>  consult the 
> [[https://orgmode.org/worg/org-contrib/org-wikinodes.html][documentation]].
>  
>  ** Can I create links to Thunderbirds emails?
> +:PROPERTIES:
> +:CUSTOM_ID: mid-url-handler
> +:END:
>  
>  Thunderbird-91 and later versions support =mid:= URI scheme proposed
> -many years ago, see
> -[[https://www.rfc-editor.org/rfc/rfc2392.html][RFC 2392 - Content-ID and 
> Message-ID Uniform Resource Locators]]
> -for details.  To create a link you need to copy the value of the
> -Message-ID header, it should be possible with some add-on.  As the
> -last resort you may obtain the identifier by opening message source
> +many years ago in
> +[[https://www.rfc-editor.org/rfc/rfc2392.html][RFC 2392 - Content-ID and 
> Message-ID Uniform Resource Locators]].
> +To create a link you need to copy the value of the Message-ID header.
> +It requires installing some add-on, see =cb_thunderlink= example below.
> +As the last resort you may obtain the identifier by opening message source
>  (=Ctrl+U=).  Message-ID resembles email address but has a unique
>  string in the local (user) part.  Remove angle brackets and prepend
>  the inner part with =mid:= to create a link.  A command to open the
> @@ -2034,6 +2037,10 @@ ** Can I create links to Thunderbirds emails?
>  [Default Applications]
>  x-scheme-handler/mid=thunderbird.desktop;
>  #+END_EXAMPLE
> +On Windows ensure that Thunderbird is installed as default handler
> +for URI protocols related to mail.  This approach allows to have
> +uniform handler withing Emacs, including
> +[[https://www.gnu.org/software/emacs/manual/html_node/emacs/Goto-Address-mode.html][~goto-address-mode~]].
>  
>  Instead of calling ~browse-url~ and setting up the scheme handler
>  you may launch thunderbird directly.  It is a bit tricky in Emacs,
> @@ -2044,12 +2051,26 @@ ** Can I create links to Thunderbirds emails?
>  the link:
>  : thunderbird -mail 
> 'imap-message://user_name%40gmail@imap.googlemail.com/INBOX?messageId=ka42mn$mn9$1...@ger.gmane.org'
>  
> +There is
> +[[https://addons.thunderbird.net/thunderbird/addon/cb_thunderlink/][=cb_thunderlink=
>  Thunderbird add-on]]
> +that allows to generate links accordingly to configurable template, e.g.
> +: [[mid:$msgid$][$author_name$: $subject$ ($date_iso$)]]
> +See the
> +[[https://list.orgmode.org/63d01412.050a0220.9611.9...@mx.google.com/][discussion]]
> +on the emacs-orgmode mailing list.
> +Additionally the extension may open messages using =thunderlink:=
> +and =cbthunderlink:= protocols however it requires installing
> +of a helper application.  These URI schemes may be registered in Org
> +just as it is suggested for =mid:= links above.
> +
>  The ThunderLink add-on recommended earlier did not work since
> -transition of Thunderbird from XUL add-ons to WebExtensions,
> +transition of Thunderbird-78 from XUL add-ons to WebExtensions,
>  so the following recipe is obsolete:
>  [[http://list.orgmode.org/ka42mn$mn9$1...@ger.gmane.org][from Christoph 
> Herzog: Re: Linking to Thunderbird (correction)]].
> -Notice that this link uses Message-ID to reference a particular
> -message as well.
> +To open earlier created =thunderlink:= links either
> +install =cb_thunderlink= add-on or add to ~browse-url-handlers~ alist
> +a function that extracts Message-ID and passes it to =mid:= protocol
> +handler.
>  
>  * Plain Lists
>:PROPERTIES:
> -- 
> 2.25.1



Re: [PATCH] org--batch-store-agenda-views: Fix treatment of lambda functions

2023-02-07 Thread Aaron Zeng
Thanks Ihor, I sent a new patch with your comment included verbatim, and
also added a ChangeLog entry.

On Tue, Feb 7, 2023 at 12:47 PM Aaron L. Zeng  wrote:

> * org-agenda.el (org--batch-store-agenda-views): Fix treatment of
> lambda functions used as custom agenda commands.
> `org-agenda-custom-commands' entries may specify a custom function
> instead of a symbol like `tags-todo'.  `org--batch-store-agenda-views'
> behaved differently from `org-agenda' when that custom function was
> defined as a lambda rather than a symbol, incorrectly treating the
> lambda form as a list of agenda commands.  Instead, use the same test
> as `org-agenda' does to determine whether the command is a series.
> ---
>  lisp/org-agenda.el | 10 +++---
>  1 file changed, 7 insertions(+), 3 deletions(-)
>
> diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el
> index 1d1f2271b..49f93c338 100644
> --- a/lisp/org-agenda.el
> +++ b/lisp/org-agenda.el
> @@ -3525,10 +3525,13 @@ This ensures the export commands can easily use
> it."
>(let ((cmds (org-agenda-normalize-custom-commands
> org-agenda-custom-commands))
>  (pop-up-frames nil)
>  (dir default-directory)
> -cmd thiscmdkey thiscmdcmd match files opts cmd-or-set bufname)
> +cmd thiscmdkey thiscmdcmd match files opts cmd-or-set
> +seriesp bufname)
>  (save-window-excursion
>(while cmds
> (setq cmd (pop cmds)
> +  ;; series: (0:key 1:desc 2:(cmd1 cmd2 ...)
> 3:general-settings 4:files)
> +  ;; non-series: (0:key 1:desc 2:type 3:match4:settings
>5:files)
>   thiscmdkey (car cmd)
>   thiscmdcmd (cdr cmd)
>   match (nth 2 thiscmdcmd)
> @@ -3538,8 +3541,9 @@ This ensures the export commands can easily use it."
>   (format "*Org Agenda(%s)*" thiscmdkey))
> org-agenda-buffer-name)
>   cmd-or-set (nth 2 cmd)
> - opts (nth (if (listp cmd-or-set) 3 4) cmd)
> - files (nth (if (listp cmd-or-set) 4 5) cmd))
> + seriesp (not (or (symbolp cmd-or-set) (functionp
> cmd-or-set)))
> + opts (nth (if seriesp 3 4) cmd)
> + files (nth (if seriesp 4 5) cmd))
> (if (stringp files) (setq files (list files)))
> (when files
>   (let* ((opts (append org-agenda-exporter-settings opts))
> --
> 2.38.1
>
>


[PATCH] org--batch-store-agenda-views: Fix treatment of lambda functions

2023-02-07 Thread Aaron L. Zeng
* org-agenda.el (org--batch-store-agenda-views): Fix treatment of
lambda functions used as custom agenda commands.
`org-agenda-custom-commands' entries may specify a custom function
instead of a symbol like `tags-todo'.  `org--batch-store-agenda-views'
behaved differently from `org-agenda' when that custom function was
defined as a lambda rather than a symbol, incorrectly treating the
lambda form as a list of agenda commands.  Instead, use the same test
as `org-agenda' does to determine whether the command is a series.
---
 lisp/org-agenda.el | 10 +++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el
index 1d1f2271b..49f93c338 100644
--- a/lisp/org-agenda.el
+++ b/lisp/org-agenda.el
@@ -3525,10 +3525,13 @@ This ensures the export commands can easily use it."
   (let ((cmds (org-agenda-normalize-custom-commands 
org-agenda-custom-commands))
 (pop-up-frames nil)
 (dir default-directory)
-cmd thiscmdkey thiscmdcmd match files opts cmd-or-set bufname)
+cmd thiscmdkey thiscmdcmd match files opts cmd-or-set
+seriesp bufname)
 (save-window-excursion
   (while cmds
(setq cmd (pop cmds)
+  ;; series: (0:key 1:desc 2:(cmd1 cmd2 ...) 
3:general-settings 4:files)
+  ;; non-series: (0:key 1:desc 2:type 3:match4:settings
 5:files)
  thiscmdkey (car cmd)
  thiscmdcmd (cdr cmd)
  match (nth 2 thiscmdcmd)
@@ -3538,8 +3541,9 @@ This ensures the export commands can easily use it."
  (format "*Org Agenda(%s)*" thiscmdkey))
org-agenda-buffer-name)
  cmd-or-set (nth 2 cmd)
- opts (nth (if (listp cmd-or-set) 3 4) cmd)
- files (nth (if (listp cmd-or-set) 4 5) cmd))
+ seriesp (not (or (symbolp cmd-or-set) (functionp cmd-or-set)))
+ opts (nth (if seriesp 3 4) cmd)
+ files (nth (if seriesp 4 5) cmd))
(if (stringp files) (setq files (list files)))
(when files
  (let* ((opts (append org-agenda-exporter-settings opts))
-- 
2.38.1




Re: [PATCH] ox-texinfo: Fix invalid syntax in Texinfo version detection code

2023-02-07 Thread Max Nikulin

On 07/02/2023 19:21, Ihor Radchenko wrote:

Max Nikulin writes:


Historically subr-x was avoided in Org. Latest discussion:
https://list.orgmode.org/b1eef17f-b8ef-2e2a-d463-7909b03ce...@gmail.com/T/#u


... which concluded that it is safe to use subr-x.
If we need to add a require, so be it. I see no major downsides.


I do not mind.

Since content of subr-x.el consists of `defsubst' definitions, likely it 
is preferable to use


(eval-when-compile (require 'subr-x))




[PATCH] worg/org-faq.org: Recommend cb_thunderlink Thunderbird add-on

2023-02-07 Thread Max Nikulin

On 06/02/2023 18:46, Bruno Barbier wrote:


After asking Thunderbird to register itself as the default mail
application, "mid:" seems to be working from everywhere.


A have prepared an alternative patch. Let me know if have suggestions, 
objections, or if you prefer to proceed with another revision of your patch.


It seems you had no plan to polish your Org and system configuration to 
such degree.From a1b3a81bbc11fd2f55096cc2e29f97797b80b915 Mon Sep 17 00:00:00 2001
From: Max Nikulin 
Date: Tue, 7 Feb 2023 21:49:06 +0700
Subject: [PATCH] org-faq.org: Recommend cb_thunderlink Thunderbird add-on

* org-faq.org (Thunderbird emails): Add CUSTOM_ID property to have
stable anchor during HTML export.  Recommend cb_thunderlink extension as a
means to generate mid: links and to handle existing thunderlink: ones.
Add a note that on Windows Thunderbird should register itself as a
handler of the mid: protocol.

Thanks to Bruno Barbier for discussion on the emacs-orgmode
mailing list.
---
 org-faq.org | 37 +
 1 file changed, 29 insertions(+), 8 deletions(-)

diff --git a/org-faq.org b/org-faq.org
index 0410d368..a7db75c1 100644
--- a/org-faq.org
+++ b/org-faq.org
@@ -1999,13 +1999,16 @@ ** Can I use CamelCase links?
 consult the [[https://orgmode.org/worg/org-contrib/org-wikinodes.html][documentation]].
 
 ** Can I create links to Thunderbirds emails?
+:PROPERTIES:
+:CUSTOM_ID: mid-url-handler
+:END:
 
 Thunderbird-91 and later versions support =mid:= URI scheme proposed
-many years ago, see
-[[https://www.rfc-editor.org/rfc/rfc2392.html][RFC 2392 - Content-ID and Message-ID Uniform Resource Locators]]
-for details.  To create a link you need to copy the value of the
-Message-ID header, it should be possible with some add-on.  As the
-last resort you may obtain the identifier by opening message source
+many years ago in
+[[https://www.rfc-editor.org/rfc/rfc2392.html][RFC 2392 - Content-ID and Message-ID Uniform Resource Locators]].
+To create a link you need to copy the value of the Message-ID header.
+It requires installing some add-on, see =cb_thunderlink= example below.
+As the last resort you may obtain the identifier by opening message source
 (=Ctrl+U=).  Message-ID resembles email address but has a unique
 string in the local (user) part.  Remove angle brackets and prepend
 the inner part with =mid:= to create a link.  A command to open the
@@ -2034,6 +2037,10 @@ ** Can I create links to Thunderbirds emails?
 [Default Applications]
 x-scheme-handler/mid=thunderbird.desktop;
 #+END_EXAMPLE
+On Windows ensure that Thunderbird is installed as default handler
+for URI protocols related to mail.  This approach allows to have
+uniform handler withing Emacs, including
+[[https://www.gnu.org/software/emacs/manual/html_node/emacs/Goto-Address-mode.html][~goto-address-mode~]].
 
 Instead of calling ~browse-url~ and setting up the scheme handler
 you may launch thunderbird directly.  It is a bit tricky in Emacs,
@@ -2044,12 +2051,26 @@ ** Can I create links to Thunderbirds emails?
 the link:
 : thunderbird -mail 'imap-message://user_name%40gmail@imap.googlemail.com/INBOX?messageId=ka42mn$mn9$1...@ger.gmane.org'
 
+There is
+[[https://addons.thunderbird.net/thunderbird/addon/cb_thunderlink/][=cb_thunderlink= Thunderbird add-on]]
+that allows to generate links accordingly to configurable template, e.g.
+: [[mid:$msgid$][$author_name$: $subject$ ($date_iso$)]]
+See the
+[[https://list.orgmode.org/63d01412.050a0220.9611.9...@mx.google.com/][discussion]]
+on the emacs-orgmode mailing list.
+Additionally the extension may open messages using =thunderlink:=
+and =cbthunderlink:= protocols however it requires installing
+of a helper application.  These URI schemes may be registered in Org
+just as it is suggested for =mid:= links above.
+
 The ThunderLink add-on recommended earlier did not work since
-transition of Thunderbird from XUL add-ons to WebExtensions,
+transition of Thunderbird-78 from XUL add-ons to WebExtensions,
 so the following recipe is obsolete:
 [[http://list.orgmode.org/ka42mn$mn9$1...@ger.gmane.org][from Christoph Herzog: Re: Linking to Thunderbird (correction)]].
-Notice that this link uses Message-ID to reference a particular
-message as well.
+To open earlier created =thunderlink:= links either
+install =cb_thunderlink= add-on or add to ~browse-url-handlers~ alist
+a function that extracts Message-ID and passes it to =mid:= protocol
+handler.
 
 * Plain Lists
   :PROPERTIES:
-- 
2.25.1



new org mode, changed folding behavior could be improved / more consistent

2023-02-07 Thread Laurenz Wiskott
Hi,

org mode has apparently been rewritten somehow.  At least I noticed a few 
differences
after updating to the new Debian version.  For instance, it got much faster.  
GREAT!

There is one feature however that I really miss: It used to be that I could add 
an entry
with a certain number of stars in the first line, and then 'org-global-cycle' 
using S-TAB
would allow to make all the headlines visible only up to that many stars.  For 
instance,
a file with


*** -
* 1
  Text 1
** 2
   Text 2
*** 3
Text 3
 4
 Text 4

after one or two S-TAB (depending on the initial folding state) would look like

*** -
* 1
** 2
*** 3

without the 4-star headline visible.  If I remove one star in the first line 
and type
S-TAB once or twice, then it looks like

** -
* 1
** 2

I found that a convenient way of controlling the depth of the CONTENT view (I 
believe it
is called).  That does not work any more.  Typing S-TAB once or twice leads to 
the
CONTENTS view that shows all headlines, no matter how many stars and 
independently of the
first line.

I have read that I can get the desired behavior with a numerical argument.  So, 
I have a
work around.  GREAT!

However, I find it inconsistent, that 'org-global-cycle' and 'org-cycle' work
differently.  The latter shows the old behavior (GREAT!), but can apparently 
not be
controlled directly with a numerical argument, while for the former it is the 
other way
around.

I suggest, to enable the trick with the first line for both 'org-global-cycle' 
and
'org-cycle' and to also enable overwriting this with a numerical argument.

Here is an example for 'org-cycle'

* 1
*** -
** A
*** Aa
Text
** B
*** Ba
 Ba1
 Text

Typing TAB once or twice (depending on the initial folding state) on the main 
headline (*
1) yields the view:

* 1
*** -
** A
*** Aa
** B
*** Ba

If I remove one star in the second line (*** -), typing TAB yields

* 1
** -
** A
** B

So, that still works.  But a numerical argument has no effect.  However, I 
found that C-c
TAB (org-show-children) does this, but why not just numerical argument plus 
TAB, like for
S-TAB?

Anyhow, I am extremely grateful for the org-mode and I use it daily.  Thanks a 
lot.

Best,

Laurenz Wiskott.



Re: new org mode, changed folding behavior could be improved / more consistent

2023-02-07 Thread Laurenz Wiskott
PS: I use org-mode version 9.4

On Mon, Feb 06, 2023 at 09:08:16PM +0100, Laurenz Wiskott wrote:
> Hi,
> 
> org mode has apparently been rewritten somehow.  At least I noticed a few 
> differences
> after updating to the new Debian version.  For instance, it got much faster.  
> GREAT!
> 
> There is one feature however that I really miss: It used to be that I could 
> add an entry
> with a certain number of stars in the first line, and then 'org-global-cycle' 
> using S-TAB
> would allow to make all the headlines visible only up to that many stars.  
> For instance,
> a file with
> 
> 
> *** -
> * 1
>   Text 1
> ** 2
>Text 2
> *** 3
> Text 3
>  4
>  Text 4
> 
> after one or two S-TAB (depending on the initial folding state) would look 
> like
> 
> *** -
> * 1
> ** 2
> *** 3
> 
> without the 4-star headline visible.  If I remove one star in the first line 
> and type
> S-TAB once or twice, then it looks like
> 
> ** -
> * 1
> ** 2
> 
> I found that a convenient way of controlling the depth of the CONTENT view (I 
> believe it
> is called).  That does not work any more.  Typing S-TAB once or twice leads 
> to the
> CONTENTS view that shows all headlines, no matter how many stars and 
> independently of the
> first line.
> 
> I have read that I can get the desired behavior with a numerical argument.  
> So, I have a
> work around.  GREAT!
> 
> However, I find it inconsistent, that 'org-global-cycle' and 'org-cycle' work
> differently.  The latter shows the old behavior (GREAT!), but can apparently 
> not be
> controlled directly with a numerical argument, while for the former it is the 
> other way
> around.
> 
> I suggest, to enable the trick with the first line for both 
> 'org-global-cycle' and
> 'org-cycle' and to also enable overwriting this with a numerical argument.
> 
> Here is an example for 'org-cycle'
> 
> * 1
> *** -
> ** A
> *** Aa
> Text
> ** B
> *** Ba
>  Ba1
>  Text
> 
> Typing TAB once or twice (depending on the initial folding state) on the main 
> headline (*
> 1) yields the view:
> 
> * 1
> *** -
> ** A
> *** Aa
> ** B
> *** Ba
> 
> If I remove one star in the second line (*** -), typing TAB yields
> 
> * 1
> ** -
> ** A
> ** B
> 
> So, that still works.  But a numerical argument has no effect.  However, I 
> found that C-c
> TAB (org-show-children) does this, but why not just numerical argument plus 
> TAB, like for
> S-TAB?
> 
> Anyhow, I am extremely grateful for the org-mode and I use it daily.  Thanks 
> a lot.
> 
> Best,
> 
> Laurenz Wiskott.



Re: Should we obsolete org-emphasis-alist? (was: [PATCH v5] org.el: Warning for unsupported markers in `org-set-emphasis-alist')

2023-02-07 Thread Timothy
Hi Ihor,

> I think that we should simply obsolete `org-emphasis-alist’ and
> introduce individual faces for emphasis.

I’m in favour of this approach.

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 .


Re: [PATCH] ox-texinfo: Fix invalid syntax in Texinfo version detection code

2023-02-07 Thread Ihor Radchenko
Max Nikulin  writes:

> In emacs-26 `string-join' is defined in subr-x.el, but ox-texinfo.el 
> does not have (require 'subr-x). Personally I see nothing bad in
>
> (format "@displaymath\n%s\n@end" math-example)
>
> Historically subr-x was avoided in Org. Latest discussion:
> https://list.orgmode.org/b1eef17f-b8ef-2e2a-d463-7909b03ce...@gmail.com/T/#u

... which concluded that it is safe to use subr-x.
If we need to add a require, so be it. I see no major downsides.

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



Re: [BUG] Warning (org-element-cache): org-element--cache: Warning(XXX.org): (gz/org-agenda-list) Cached element is incorrect in XXX.org. (Cache tic up to date: "yes") [9.6.1 (release_9.6.1-208-g0c0

2023-02-07 Thread Ihor Radchenko
Gregor Zattler  writes:

>> This is strange. Did the buffer in question happened to be an indirect 
>> buffer?
>
> I do not use indirect buffers intentionally.  If an agenda
> is an indirect buffer than it may be -- I do not remember
> the exact situation, it was happening at the very first
> minutes I used emacs after it's startup.

I see. This likely means that the error happened some time during
earlier Emacs session. Backtrace is not stored between Emacs sessions. 

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



Re: [PATCH] ox-texinfo: Fix invalid syntax in Texinfo version detection code

2023-02-07 Thread Max Nikulin
Rudolf, I am afraid there is another obstacle till your step to improve 
Org may be completed.


On 07/02/2023 15:39, Rudolf Adamkovič wrote:

-(let* ((input-file
-(make-temp-file "test" nil ".info"))
-   (input-content
-(concat (format "@setfilename %s" input-file) "\n"
-"@node Top" "\n"
-(format "@displaymath{%s}" math-example) "\n")))
+(let* ((input-file (make-temp-file "test" nil ".info"))
+   (input-content (string-join


In emacs-26 `string-join' is defined in subr-x.el, but ox-texinfo.el 
does not have (require 'subr-x). Personally I see nothing bad in


   (format "@displaymath\n%s\n@end" math-example)

Historically subr-x was avoided in Org. Latest discussion:
https://list.orgmode.org/b1eef17f-b8ef-2e2a-d463-7909b03ce...@gmail.com/T/#u
[BUG] Re: 98e168b48 Add compatibility wrapper for 
string-clean-whitespace (Emacs 26 compatibility) Fri, 07 Oct 2022 
13:14:11 +0800


I will leave the decision to the maintainers since I have no particular 
opinion. Alternatively you may use (mapconcat #'identity (list) "\n").


It is preferable to fix earlier added call to `string-join' in this 
file. The similar approach should be applied to the tests added by this 
patch.



+   (list (format "@setfilename %s" input-file)
+ "@node Top"
+ "@displaymath"





Re: [BUG] Warning (org-element-cache): org-element--cache: Warning(XXX.org): (gz/org-agenda-list) Cached element is incorrect in XXX.org. (Cache tic up to date: "yes") [9.6.1 (release_9.6.1-208-g0c0

2023-02-07 Thread Gregor Zattler
Hi Ihor,
* Ihor Radchenko  [2023-02-07; 10:59 GMT]:
> Gregor Zattler  writes:
>> * Ihor Radchenko  [2023-02-06; 10:28 GMT]:
>>> Gregor Zattler  writes:
>>> Unfortunately, the provided log is incomplete. I cannot deduce anything
>>> useful from it.
>>
>> that's strange, I realized it was shorter than others, but
>> it's all emacs had in it's *Warnings* buffer then.
>
> This is strange. Did the buffer in question happened to be an indirect buffer?

I do not use indirect buffers intentionally.  If an agenda
is an indirect buffer than it may be -- I do not remember
the exact situation, it was happening at the very first
minutes I used emacs after it's startup.

Ciao; Gregor
--
 -... --- .-. . -.. ..--.. ...-.-



Re: [PATCH] Async evaluation in ob-shell

2023-02-07 Thread Ihor Radchenko
Matt  writes:

> I'm excited to share that I've got async evaluation working (crudely) with 
> ob-shell.  A rough implementation is attached.  
>
> It has clear issues, such as the prompt being present in the output:

That's likely because of the same reasons why prompt did not get cleaned
in synchronous blocks earlier. See `org-babel-comint-with-output'.

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



Re: increase width of save file dialog box

2023-02-07 Thread Ihor Radchenko
Vlastimil Vondra  writes:

> Do you know if it is possible to increase save file dialog box width in
> emacs (GNU Emacs 28.2 (build 2, x86_64-w64-mingw32) of 2022-09-13)?
>
> As you can see on my screenshot I can't see what I'm saving.
> [image: image.png]

Thanks for reporting, but it does not appear to be related to Org mode.

May you instead report it as Emacs bug? You can use M-x report-emacs-bug
- it will generate bug report template with all the build information
about your Emacs that you can either send from within Emacs (if your
Emacs configured to send email) or copy-paste into the mail client you
prefer.

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



Re: [PATCH] org--batch-store-agenda-views: Fix treatment of lambda functions

2023-02-07 Thread Ihor Radchenko
"Aaron L. Zeng"  writes:

> `org-agenda-custom-commands' entries may specify a custom function
> instead of a symbol like `tags-todo'.  `org--batch-store-agenda-views'
> behaved differently from `org-agenda' when that custom function was
> defined as a lambda rather than a symbol, incorrectly treating the
> lambda form as a list of agenda commands.

Thanks for the patch!

> -   opts (nth (if (listp cmd-or-set) 3 4) cmd)
> -   files (nth (if (listp cmd-or-set) 4 5) cmd))
> +   seriesp (not (or (symbolp cmd-or-set) (functionp cmd-or-set)))
> +   opts (nth (if seriesp 3 4) cmd)
> +   files (nth (if seriesp 4 5) cmd))

Could you add a brief comment explaining why "3", "4", and "5"?
Something like

;; series: (0:key 1:desc 2:(cmd1 cmd2 ...) 3:general-settings 4:files)
;; non-series: (0:key 1:desc 2:type 3:match4:settings 5:files)

Also, please add a changelog entry, as described in
https://orgmode.org/worg/org-contribute.html#commit-messages

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



Re: [BUG] Warning (org-element-cache): org-element--cache: Warning(XXX.org): (gz/org-agenda-list) Cached element is incorrect in XXX.org. (Cache tic up to date: "yes") [9.6.1 (release_9.6.1-208-g0c0

2023-02-07 Thread Ihor Radchenko
Gregor Zattler  writes:

> Hi Ihor,
> * Ihor Radchenko  [2023-02-06; 10:28 GMT]:
>> Gregor Zattler  writes:
>> Unfortunately, the provided log is incomplete. I cannot deduce anything
>> useful from it.
>
> that's strange, I realized it was shorter than others, but
> it's all emacs had in it's *Warnings* buffer then.

This is strange. Did the buffer in question happened to be an indirect buffer?

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



Re: [PATCH 0/4] Structure editing when region is active

2023-02-07 Thread Ihor Radchenko
Rudolf Adamkovič  writes:

> However, I find it a bit surprising (confusing, really) that
>
>   'C-c C-x R' and 'C-c C-x L'

[ for context, these are `org-shiftmetaright' and `org-shiftmetaleft'

> do not promote/demote the selected subtrees, despite being documented as 
>
>   "Demote subtree or insert table column."

They indeed do not. Only on selected list items. Patches welcome!

> and then
>
>   'C-c C-x r' and 'C-c C-x l'
>
> do promote/demote selected subtrees despite being documented as
>
>   "Demote heading, list item at point or move table column right."
>
> I immediately reached for the subtree manipulation commands, but they did not
> work on the marked subtrees.  Confused, I tried the headline manipulation
> commands, and they did work ... on the marked subtrees.

C-/// do work on selected headings.

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



Should we obsolete org-emphasis-alist? (was: [PATCH v5] org.el: Warning for unsupported markers in `org-set-emphasis-alist')

2023-02-07 Thread Ihor Radchenko
Max Nikulin  writes:

>> +(add-variable-watcher 'org-emphasis-alist #'org-emphasis-alist--check-value)
>
> Thinking more I have realized that I am in doubts if 
> `add-variable-watcher' is appropriate tool in this particular case. The 
> only way to get some effect from change of `org-emphasis-alist' is to 
> call `org-set-emph-re' (its :set function), so it should be enough to 
> call `org-emphasis-alist--check-value' from `org-set-emph-re'.

Upon looking closer, `org-set-emph-re' is not affected by the value of
`org-emphasis-alist' with a single exception when the value is nil.

> I have no idea what should be considered as best practice: should 
> `set-default-toplevel-value' be combined with changes of `org-emph-re' 
> as it is done in current code or `org-set-emph-re' should be split into 
> the function that modifies `org-emph-re' (so it can be called 
> separately) and a tiny setter (that may be defined as lambda this case) 
> that calls the new function and `set-default-toplevel-value'.

I now reviewed the usage of `org-emphasis-alist' and setting/changing
the value has the following effects:

1. nil (and only nil) value makes `org-emph-re' and `org-verbatim-re'
   nil. Otherwise, these regexps are not affected.

   Also, `org-emph-re' only affects fontification.
   `org-verbarim-re' affects fontification and
   `org-in-verbatim-emphasis'. The latter should be fixed to use
   org-element API.

2. The value affects `org-mode-transpose-word-syntax-table'. Should be
   fixed - parser is not affected by `org-emphasis-alist'.

3. Fontification is affected in `org-do-emphasis-faces'.

4. Emphasis selection dialogue in `org-emphasize' is only using the
   emphasis from the alist.

That's all.

I think that we should simply obsolete `org-emphasis-alist' and
introduce individual faces for emphasis.

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



Re: [BUG] Warning (org-element-cache): org-element--cache: Warning(XXX.org): (gz/org-agenda-list) Cached element is incorrect in XXX.org. (Cache tic up to date: "yes") [9.6.1 (release_9.6.1-208-g0c0

2023-02-07 Thread Gregor Zattler
Hi Ihor,
* Ihor Radchenko  [2023-02-06; 10:28 GMT]:
> Gregor Zattler  writes:
> Unfortunately, the provided log is incomplete. I cannot deduce anything
> useful from it.

that's strange, I realized it was shorter than others, but
it's all emacs had in it's *Warnings* buffer then.

> Please provide the full log if you encounter the warning again.

Sure.

Thanks for looking into it; Gregor
--
 -... --- .-. . -.. ..--.. ...-.-



Re: [PATCH] ox-texinfo: Fix invalid syntax in Texinfo version detection code

2023-02-07 Thread Rudolf Adamkovič
Max Nikulin  writes:

> Should not the format argument be corrected to have valid @displaymath 
> snippet instead?

Thank you, Max!  See, this happens when I write code 10 minutes before going to
bed: incorrect code and no tests, both equally bad.

Please see the attached patch.

Rudy
>From ce1062dbda870346b18ae35c28e9cc034c0de548 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Rudolf=20Adamkovi=C4=8D?= 
Date: Mon, 6 Feb 2023 22:33:40 +0100
Subject: [PATCH] ox-texinfo: Fix invalid syntax in Texinfo version detection
 code

* lisp/ox-texinfo.el (org-texinfo-supports-math-p): Fix the incorrect
syntax @displaymath{1 + 1 = 2} used to detect whether Texinfo supports
TeX "math mode".  Instead, use the correct syntax @math{1 + 1 = 2}.
---
 lisp/ox-texinfo.el  | 14 --
 testing/lisp/test-ox-texinfo.el | 30 ++
 2 files changed, 38 insertions(+), 6 deletions(-)

diff --git a/lisp/ox-texinfo.el b/lisp/ox-texinfo.el
index 8e3a04562..56564a5c5 100644
--- a/lisp/ox-texinfo.el
+++ b/lisp/ox-texinfo.el
@@ -2025,12 +2025,14 @@ Once computed, the results remain cached."
   (unless (boundp 'org-texinfo-supports-math--cache)
 (setq org-texinfo-supports-math--cache
   (let ((math-example "1 + 1 = 2"))
-(let* ((input-file
-(make-temp-file "test" nil ".info"))
-   (input-content
-(concat (format "@setfilename %s" input-file) "\n"
-"@node Top" "\n"
-(format "@displaymath{%s}" math-example) "\n")))
+(let* ((input-file (make-temp-file "test" nil ".info"))
+   (input-content (string-join
+   (list (format "@setfilename %s" input-file)
+ "@node Top"
+ "@displaymath"
+ math-example
+ "@end displaymath")
+   "\n")))
   (with-temp-file input-file
 (insert input-content))
   (let* ((output-file (org-texinfo-compile input-file))
diff --git a/testing/lisp/test-ox-texinfo.el b/testing/lisp/test-ox-texinfo.el
index 51fdb3606..4bb902988 100644
--- a/testing/lisp/test-ox-texinfo.el
+++ b/testing/lisp/test-ox-texinfo.el
@@ -292,5 +292,35 @@
  nil
  '(:with-latex t))
 
+
+;;; End-to-end
+
+(ert-deftest test-ox-texinfo/end-to-end-inline ()
+  "Test end-to-end with inline TeX fragment."
+  (should
+   (org-test-with-temp-text
+"$a^2 = b$"
+(let ((export-buffer "*Test Texinfo Export*")
+  (org-export-show-temporary-export-buffer nil))
+  (org-export-to-buffer 'texinfo export-buffer
+nil nil nil nil nil
+#'texinfo-mode)
+
+(ert-deftest test-ox-texinfo/end-to-end-sanity-check-displayed ()
+  "Test end-to-end with LaTeX environment."
+  (should
+   (org-test-with-temp-text
+(string-join
+ (list "\\begin{equation}"
+   "a ^ 2 = b"
+   "b ^ 2 = c"
+   "\\end{equation}")
+ "\n")
+(let ((export-buffer "*Test Texinfo Export*")
+  (org-export-show-temporary-export-buffer nil))
+  (org-export-to-buffer 'texinfo export-buffer
+nil nil nil nil nil
+#'texinfo-mode)
+
 (provide 'test-ox-texinfo)
 ;;; test-ox-texinfo.el end here
-- 
2.39.0

-- 
"Strange as it may sound, the power of mathematics rests on its evasion
of all unnecessary thought and on its wonderful saving of mental
operations."
-- Ernst Mach, 1838-1916

Rudolf Adamkovič  [he/him]
Studenohorská 25
84103 Bratislava
Slovakia