Re: Question Regarding Creating Workflow For Automatic Formulas For Finance Based Org Spreadsheet

2022-01-09 Thread Detlef Steuer
Am Mon, 10 Jan 2022 08:04:20 +0100
schrieb Marcin Borkowski :

> On 2022-01-10, at 04:42, Samuel Banya  wrote:
> 
> > Ah, Ledger is way too complicated for what it's worth. I've seen
> > videos on YouTube about it, and every person who's praised it is
> > pretty much too smart enough to be able to explain it in simple
> > terms.  
> 
> Interesting - I've been using Ledger for many years now, and while
> I agree that it has its dark corners, it's much like Org in that
> respect
> - you are not forced to use them at all.  And the "core" is IMHO
> /very/ simple - you just record your "transactions" (e.g., using the
> very nice Emacs ledger-mode) and look at a report.
> 
> I basically use just one kind of report - the balance report, both to
> reconcile my ledger file with my cash and bank and to see the
> current/previous month's income and expenses.
> 
> Before I started using Ledger, I used GNUcash (on and off for a few
> years, too) - I can't say a bad word about it, but it's not
> Emacs-based, so you know.  Also, it's not exactly text-based (AFAIR,
> it uses XML, so it "kind of" is, but...) - a big advantage of Ledger
> is that I can keep my books in Git.  (Of course, using Org would have
> the same advantage.)
> 
> Also, if you don't insist on Ledger, https://plaintextaccounting.org/
> has a comparison of other text-based accounting tools.
> 
> I'm wondering if your opinion about Ledger isn't influenced by the
> fact that it uses basic accounting principles, like the idea of
> double-entry accounting.  For me, it's /very/ simple and intuitive,
> but I graduated in economics many years ago and had a (basic, but
> still) course on accounting.  If that is your problem, I'd suggest
> spending some time on understanding that - even if you don't end up
> using Ledger but some other software, you might find learning about
> accounting useful.  (Also, it's fascinating.  No, really!  It's an
> extremely clever abstract system with a real-life use-case.)
> 
> That said, there are people who just use a regular spreadsheet for
> their personal/household finance, and it seems to work for them.  Go
> figure. (Now that I think of it, I'll have to ask someone who does
> how they manage that.)
> 
> Having said all that, would someone be interested in a blog post(s)
> with a Ledger basics crash course?

Yes.

Detlef

> 
> Hth,
> 




Re: Question Regarding Creating Workflow For Automatic Formulas For Finance Based Org Spreadsheet

2022-01-09 Thread Marcin Borkowski


On 2022-01-10, at 04:42, Samuel Banya  wrote:

> Ah, Ledger is way too complicated for what it's worth. I've seen videos on 
> YouTube about it, and every person who's praised it is pretty much too smart 
> enough to be able to explain it in simple terms.

Interesting - I've been using Ledger for many years now, and while
I agree that it has its dark corners, it's much like Org in that respect
- you are not forced to use them at all.  And the "core" is IMHO /very/
simple - you just record your "transactions" (e.g., using the very nice
Emacs ledger-mode) and look at a report.

I basically use just one kind of report - the balance report, both to
reconcile my ledger file with my cash and bank and to see the
current/previous month's income and expenses.

Before I started using Ledger, I used GNUcash (on and off for a few
years, too) - I can't say a bad word about it, but it's not Emacs-based,
so you know.  Also, it's not exactly text-based (AFAIR, it uses XML, so
it "kind of" is, but...) - a big advantage of Ledger is that I can keep
my books in Git.  (Of course, using Org would have the same advantage.)

Also, if you don't insist on Ledger, https://plaintextaccounting.org/
has a comparison of other text-based accounting tools.

I'm wondering if your opinion about Ledger isn't influenced by the fact
that it uses basic accounting principles, like the idea of double-entry
accounting.  For me, it's /very/ simple and intuitive, but I graduated
in economics many years ago and had a (basic, but still) course on
accounting.  If that is your problem, I'd suggest spending some time on
understanding that - even if you don't end up using Ledger but some
other software, you might find learning about accounting useful.  (Also,
it's fascinating.  No, really!  It's an extremely clever abstract
system with a real-life use-case.)

That said, there are people who just use a regular spreadsheet for their
personal/household finance, and it seems to work for them.  Go figure.
(Now that I think of it, I'll have to ask someone who does how they
manage that.)

Having said all that, would someone be interested in a blog post(s) with
a Ledger basics crash course?

Hth,

-- 
Marcin Borkowski
http://mbork.pl



Re: Question Regarding Creating Workflow For Automatic Formulas For Finance Based Org Spreadsheet

2022-01-09 Thread Samuel Banya
Ah, Ledger is way too complicated for what it's worth. I've seen videos on 
YouTube about it, and every person who's praised it is pretty much too smart 
enough to be able to explain it in simple terms.

I don't like how manual and frequent it is, and for my use case, I just 
download .csvs from my bank.

For what I use it for, Org Mode gets close.

I just needed to figure out how I can make those formulas actually work in this 
scenario using Emacs with Elisp itself.

There's gotta be a way to do this, since its weird how the individual rows 
don't have individual formulas. 

That's the big weird thing for me personally.

Sincerely,

Sam

On Sun, Jan 9, 2022, at 5:37 PM, Neil Jerram wrote:
> 
> On Sun, 9 Jan 2022, 17:18 Samuel Banya,  wrote:
>> __
>> Hey there,
>> 
>> So I've been managing my finances via an org doc that basically has tables 
>> that list all the expenses from my bank account, which has been awesome on 
>> some respects.
> 
> I also save and process my bank account transactions with Org, and I agree 
> that it's awesome.  The bank's own website and analysis capabilities are 
> rubbish in comparison.
> 
> For what it's worth, my approach is:
> 
> - Periodically download transactions when available (in OFX format, but 
> that's not important).
> 
> - Use Org and Babel with Scheme code to run arbitrary analyses over those, 
> with the results displayed in Org tables.
> 
> - Sometimes there are cases when I need an additional computation on one of 
> the output tables, and I can do that with an Org spreadsheet formula.  But if 
> it was anything useful in the longer term, I'd add the logic to the Scheme 
> coding instead.
> 
> 
> So I'd agree with the response that this kind of thing is a bit too complex 
> for Org table formulas alone.
> 
> Best wishes,
>  Neil
>> 


Re: Question Regarding Creating Workflow For Automatic Formulas For Finance Based Org Spreadsheet

2022-01-09 Thread Neil Jerram
On Sun, 9 Jan 2022, 17:18 Samuel Banya,  wrote:

> Hey there,
>
> So I've been managing my finances via an org doc that basically has tables
> that list all the expenses from my bank account, which has been awesome on
> some respects.
>

I also save and process my bank account transactions with Org, and I agree
that it's awesome.  The bank's own website and analysis capabilities are
rubbish in comparison.

For what it's worth, my approach is:

- Periodically download transactions when available (in OFX format, but
that's not important).

- Use Org and Babel with Scheme code to run arbitrary analyses over those,
with the results displayed in Org tables.

- Sometimes there are cases when I need an additional computation on one of
the output tables, and I can do that with an Org spreadsheet formula.  But
if it was anything useful in the longer term, I'd add the logic to the
Scheme coding instead.

So I'd agree with the response that this kind of thing is a bit too complex
for Org table formulas alone.

Best wishes,
 Neil

>
>


Re: Way to mark contents of an Org special block as verbatim?

2022-01-09 Thread Kaushal Modi
On Sun, Jan 9, 2022 at 3:01 PM Nicolas Goaziou  wrote:
>
> I suggest to use
>
>   (org-element-interpret-data (org-element-contents special-block))


That does it!! Thank you!

Also thanks to Juan and Charles who helped lead me to the final solution.



Re: Way to mark contents of an Org special block as verbatim?

2022-01-09 Thread Nicolas Goaziou
Hello,

"Berry, Charles"  writes:

> So,
> :   (format "{{<%s>}}\n%s{{}}\n" type contents type)
>
> has the contents already parsed and transcoded which you do not want. So use 
> something like:
>
> #+begin_src emacs-lisp
>
> (let ((raw-contents
> (buffer-substring-no-properties
>  (org-element-property :contents-begin special-block)
>  (org-element-property :contents-end special-block
>(format "{{<%s>}}\n%s{{}}\n" type raw-contents type))

I suggest to use

  (org-element-interpret-data (org-element-contents special-block))

Regards,
-- 
Nicolas Goaziou



Re: Way to mark contents of an Org special block as verbatim?

2022-01-09 Thread Berry, Charles



> On Jan 9, 2022, at 8:58 AM, Kaushal Modi  wrote:
> 
> How do we disable Org from transforming this:
> 
>E = -J \sum_{i=1}^N s_i s_{i+1}
> 
> to this:
> 
> 
>E = -J i=1^N s\_i si+1

Ahh! Sorry!

So,
:   (format "{{<%s>}}\n%s{{}}\n" type contents type)

has the contents already parsed and transcoded which you do not want. So use 
something like:

#+begin_src emacs-lisp

(let ((raw-contents
  (buffer-substring-no-properties
   (org-element-property :contents-begin special-block)
   (org-element-property :contents-end special-block
 (format "{{<%s>}}\n%s{{}}\n" type raw-contents type))

#+end_src

HTH,

Chuck



Re: Question Regarding Creating Workflow For Automatic Formulas For Finance Based Org Spreadsheet

2022-01-09 Thread John Hendy
On Sun, Jan 9, 2022 at 11:17 AM Samuel Banya  wrote:
>
> Hey there,
>

[...]

> After Reading The Online Manual, I Figured This Out:
>
> I tried using the 'org-table-edit-formulas' function via the "C-c ' (single 
> quote)" (Obtained this formula via the docs, 
> 'https://www.gnu.org/software/emacs/manual/html_mono/org.html#Formula-syntax-for-Lisp')
> I then accepted the mini buffer's changes with 'C-c C-c' which goes back to 
> the spreadsheet.
> I then hit 'C-c *' to update the tables present.
> The problem with this is that when I attempt to do this function for each 
> separate calculation row, both of the bottom calculation rows now only refer 
> to a single formula for some reason.
>

>From using org table formulas, I think the problem is that to my
knowledge, there is no way to maintain multiple formulas for a column.

"""
When you assign a formula to a simple column reference like ‘$3=’, the
same formula is used in all fields of that column
"""
https://orgmode.org/manual/Column-formulas.html

>
> For Reference, Here's A Modified Version Of My Running Finance Spreadsheet

[...]

> Why can't I use individual row formulas in this scenario?
> Why is it that when I use "C-c ' (single quote)" the row formulas are the 
> same for completely separate rows

After you enter these formulas, do you see the line that shows up
below the table? They were omitted in the sample spreadsheet above,
but for me, they look like this:

#+TBLFM: $3=vsum(@1$3..@2$3)::$4=vsum(@1$4..@2$4)

To my knowledge, Org-mode has no mechanism for what you really want,
per *cell* formulas. You're using per *column* formulas, and the
notation matches: for column 4, the formula is foo. There is no
differentiation for rows a and b, just that all of this column will
calculate foo.

> My Main Workflow Questions Include The Following:
>
> Is there a way I can maybe automate the initial steps of converting that .csv 
> into an .org mode doc, and to paste them into the existing org spreadsheet?

Probably, but without full knowledge of what you exactly want/need,
it's hard to comment further. For example, in theory you could just
open the .csv in emacs directly and:

`M-x replace-string [RET] , [RET] |

That would get you at least partially there. Do you need the .csv in
org-mode for some reason? Maybe the answer is "yes" and thus it
justifies solving this aspect further. Maybe the answer is "not
really, I just care about the totals" in which case this is a bit of a
tangent.

> Is there a way I can also update the existing formula for the given month if 
> Emacs would somehow know the current date time stamp and figure out the 
> month's row at the bottom of the spreadsheet accordingly to update the 
> correct row?

I think the reason ledger was suggested (a plain text finance program
with a mode for emacs) is that the answer is probably "no, this is
getting a bit complicated for org spreadsheets and calculations
directly."

I might suggest learning a little bit of python or R. Probably sounds
daunting, but I think it would be easier to pick up at least as much
as you've already taught yourself with respect to org calculation
field syntax! Here's an example:

#+begin_example
* foo

#+name: foo
|+-+---+--|
| 01/03/2022 | Example Rent Expense|
| -1061.67 |
| 01/04/2022 | Example Food Expense|
| -1061.67 |
| 02/05/2022 | Example Utility Expense |
| -2061.67 |
| 02/06/2022 | Example Random Expense  |
| -2061.67 |
|+-+---+--|
#+TBLFM: $3=vsum(@1$3..@2$3)::$4=vsum(@1$4..@2$4)

#+begin_src R :var foo=foo
jan <- sum(foo[1:2, 4])
feb <- sum(foo[3:4, 4])

result <- data.frame(
  month = c("jan", "feb"),
  total = c(jan, feb))

print(result)
#+end_src

#+RESULTS:
| jan | -2123.34 |
| feb | -4123.34 |
#+end_example

R can read in org tables, so that could merge these two solutions. R
can *also* just read in .csv files... so you'd not need to monkey with
.csv -> org at all. As mentioned, teaching yourself @1$4..@2$4 isn't
that much different from [1:2, 4] in R :)

Plus, then you absolutely have date manipulation available, either in
native R or with packages like lubridate which could read in your data
source date syntax (you'd tell it that the date was in "%m/%d/%Y"
format, and then filter to month == 1 for January.

> Anyway, I know my question might be a bit ambiguous and most likely will 
> involve using 'F3' to record macros, but I figured i would ask to maybe make 
> it easier since one of my goals for the new year is to make recording 
> finances an easier process.
>
> I felt like I've been over complicating this, and figured someone probably is 
> doing org finance spreadsheets better than me to figure this out.

Hopefully some useful ideas above. Sorry that I don't have a better
answer to 

Re: Question Regarding Creating Workflow For Automatic Formulas For Finance Based Org Spreadsheet

2022-01-09 Thread Ken Mankoff
Hi Sam,

Have you looked into Org Ledger?

  -k.

Please excuse brevity. Sent from tiny pocket computer with non-haptic
feedback keyboard.

On Sun, Jan 9, 2022, 09:18 Samuel Banya  wrote:

> Hey there,
>
> So I've been managing my finances via an org doc that basically has tables
> that list all the expenses from my bank account, which has been awesome on
> some respects.
>
> The only annoying thing I want to somehow figure out this year is how to
> make the process of updating the formula for a given month less tedious, so
> I am wondering if anyone could help me figure out a better workflow for
> doing this.
>
> *Here's My Current Workflow*
>
>- Download .csv from banking website
>- Convert .csv to .org file via file manager (with 'ranger' in 'vterm')
>- Change over to Dired Mode in the same directory and view the same
>.org file, and convert the data into an org table by using 'C-x h' to
>highlight everything, and use 'C-c |' to convert the range into an org 
> table
>- Open up the existing running total org mode spreadsheet in a
>separate buffer
>- Copy over the converted org mode table data from the new .csv buffer
>and paste it into the running org mode spreadsheet
>- Use 'C-c }' to show all formulas row and column values in the
>spreadsheet
>- Find the existing formula row line for the given month's totals at
>the bottom of the spreadsheet, and manually delete the values for the 3rd
>and 4th row respectively
>- Re-enter the formula manually for each cell and hit tab
>- Enter the same formulas on the next line to double check my work to
>make sure I entered them in correctly.
>
>
> *After Reading The Online Manual, I Figured This Out:*
>
>- I tried using the 'org-table-edit-formulas' function via the "C-c '
>(single quote)" (Obtained this formula via the docs, '
>
> https://www.gnu.org/software/emacs/manual/html_mono/org.html#Formula-syntax-for-Lisp
>')
>- I then accepted the mini buffer's changes with 'C-c C-c' which goes
>back to the spreadsheet.
>- I then hit 'C-c *' to update the tables present.
>- The problem with this is that when I attempt to do this function for
>each separate calculation row, both of the bottom calculation rows now only
>refer to a single formula for some reason.
>
>
> *For Reference, Here's A Modified Version Of My Running Finance
> Spreadsheet (Modified Without Actual Values Or Records For Personal
> Reasons) (NOTE: Sorry that the paste is terribly aligned --> I blame email
> formatting for this, also, note that I also put a note for myself as to
> what the formulas involved are for a given month since I can never remember
> the syntax personally since its flipped from typical Excel syntax of using
> row and column --> it uses column then row like an older calculator)*
>
>
> |+--+---+--|
> | 01/03/2022 | Example Rent Expense |   |
> -1061.67 |
> | 01/04/2022 | Example Food Expense |   |
> -1061.67 |
> | 02/05/2022 | Example Utility Expense  |   |
> -2061.67 |
> | 02/06/2022 | Example Random Expense   |   |
> -2061.67 |
>
> |+--+---+--|
> || EXPENSES JAN 2022 vsum(@1$3..@2$3) vsum(@1$4..@2$4)  | 0 |
> -2123.34 |
> || EXPENSES Feb 2022 vsum(@3$3..@4$3) vsum(@3$4..@4$4)  | 0 |
> -4123.34 |
>
> |+--+---+--|
>
> *Formulas Presented In the 3rd and 4th columns for Row 5:*
> # Column Formulas
> $3 = vsum(@1$3..@2$3)
> $4 = vsum(@1$4..@2$4)
>
> *Formulas Presented In The 3rd And 4th Columns For Row 6 (**NOTE**:
> Notice how I can't make them unique for each row for some reason):*
> # Column Formulas
> $3 = vsum(@1$3..@2$3)
> $4 = vsum(@1$4..@2$4)
>
> *Main Questions Regarding Formula Issues:*
>
>- Why can't I use individual row formulas in this scenario?
>- Why is it that when I use "C-c ' (single quote)" the row formulas
>are the same for completely separate rows
>
>
> *My Main Workflow Questions Include The Following:*
>
>- Is there a way I can maybe automate the initial steps of converting
>that .csv into an .org mode doc, and to paste them into the existing org
>spreadsheet?
>- Is there a way I can also update the existing formula for the given
>month if Emacs would somehow know the current date time stamp and figure
>out the month's row at the bottom of the spreadsheet accordingly to update
>the correct row?
>
>
> Anyway, I know my question might be a bit ambiguous and most likely will
> involve using 'F3' to record macros, but I figured i would ask to maybe
> make it easier since one of my goals for the new year is to make recording
> finances an easier process.
>
> I felt 

Re: Request To Contribute To 'Worg' Project

2022-01-09 Thread Samuel Banya
Hey Timothy!

I made a Sourcehut account with 'samuelbanya' already, forgot to mention that 
in my previous post.

I'm guessing in that case, I would have to wait for Bastien then to approve 
this via this email thread, or should I make a different request email?

Thanks,

Sam

On Sun, Jan 9, 2022, at 1:25 PM, Timothy wrote:
> Hi Samuel,
> 
> Great to hear from you!
> 
> Worg is a great place to improve the community documentation/guides of Org.
> 
> If you’d like access, have a look at https://orgmode.org/worg/worg-about.html 
> “Who can participate in the editing of Worg?”. The short version is you need 
> to create a sourcehut account and ask Bastien to be added as a contributer :)
> 
> If you’d like to contribute to Org “directly”, check out 
> https://orgmode.org/worg/org-contribute.html.
> 
> 
> All the best,
> *Timothy*
> 
> 
> *From*: Samuel Banya 
> * Subject*: Request To Contribute To 'Worg' Project
> * To*: Charles Berry 
> * Date*: Mon, 10 Jan 2022 01:23:18 +0800
> 


Re: Request To Contribute To 'Worg' Project

2022-01-09 Thread Thomas S. Dye

Aloha Samuel,

Samuel Banya  writes:

I read this page, and noted that you have to request access for 
this repo:

https://git.sr.ht/~bzg/worg

After the approval process is completed, can anyone point me to 
"How" exactly contributions are made?


Are they done through 'patch' based emails sent through to the 
mailing list itself?


Or are they done directly through git pushes?


You contribute with git pushes.

Thanks for our interest in Worg.

All the best,
Tom 


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



Re: Request To Contribute To 'Worg' Project

2022-01-09 Thread Timothy
Hi Samuel,

Great to hear from you!

Worg is a great place to improve the community documentation/guides of Org.

If you’d like access, have a look at 
“Who can participate in the editing of Worg?”. The short version is you need to
create a sourcehut account and ask Bastien to be added as a contributer :)

If you’d like to contribute to Org “directly”, check out
.

All the best,
Timothy


Org Syntax Specification

2022-01-09 Thread Timothy
Hi All,

I’ve talked about adding citation syntax to the org-syntax document before, and
previously expressed the thought that it could be generally improved quite a
bit. This has culminated me in spending the last few days straight working on a
rewrite of org-syntax.org to try to bring it closer to the point where we can
knock “(draft)” out of the title .

Ihor has been a tremendous help pointing out inaccuracies and explaining some of
the parsing behaviour (thanks!), which has allowed me to get it to a point where
I think it would benefit from wider feedback.

I’ve just pushed my latest revision to worg as
. Personally though, I 
think
it’s best viewed as a PDF, so I’ve also uploaded the PDF export to
.

It would be great if those of you with an interest/understanding of Org’s syntax
could have a look and let me know what you think. I think the best way to
compare to the current org-syntax.org would be to put them side-by-side. I’ve
attempted to list the main changes I’ve made in the appendix, however I’ve
likely missed things.

Lastly, having spent a while looking at the syntax, I’m wondering if we should
take this opportunity to mark some of the syntactic elements we’ve become less
happy with as *(depreciated)*. I’m specifically thinking of the TeX-style LaTeX
fragments which have been a bit of a pain. To quote Nicolas in org-syntax.org:
  It would introduce incompatibilities with previous Org versions,
  but support for `$...$' (and for symmetry, `$$...$$') constructs
  ought to be removed.

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

Marking this as depreciated would have no effect on Org’s current behaviour, but
we could:
1. Mark as depreciated now-ish
2. Add a utility to convert from TeX-style to LaTeX-style
3. Add org lint/fortification warnings
4. A while later (half a decade? more?) actually remove support

The other component of the syntax which feels particularly awkward to me is
source block switches. They seem a bit odd, and since arguments exist,
completely redundant.



That’s all for now, I hope you all had a great Christmas and new year!

All the best,
Timothy


Re: ob-plantuml: Proposal to add 'jar-args' customizable variable

2022-01-09 Thread Andy Moreton
On Fri 03 Dec 2021, Dejan Josifović wrote:

> Hi all,
>
> I use PlantUML integration in org-mode for years now, but only
> recently I came across some unwanted behavior.
>
> Using PlantUML from jar (org-plantuml-jar-path variable) and latest 
> org-mode, I wanted to render a diagram containing some Unicode 
> characters (such as '⊥' and '∀'), but the end image had some gibberish 
> instead. However,
> trying this from a standalone file using plantuml-mode[1], the end image 
> rendered correctly. Here is some sample code which can reproduce the issue:
>
> #+BEGIN_SRC plantuml :file ./test.png
> A -> B: ∀ characters display correctly is ⊥
> #+END_SRC
>
> Comparing ob-plantuml.el and plantuml-mode.el files I found what is the 
> problem. plantuml-mode has a customizable variable for specifying 
> arguments when using PlantUML from jar (plantuml-jar-args (list 
> "-charset" "UTF-8" ). The charset arguments is what is needed for
> the images to render correctly (I confirmed it by implementing it locally).
>
> I was wondering why such variable doesn't exist in ob-plantuml. I have
> searched the mailing list archives, confirmed bugs and help page and 
> couldn't find anything related.

I use this snippet to set the ob-plantuml.el args to match the
plantuml-mode.el settings:

  (setf (alist-get :javaorg-babel-default-header-args:plantuml)
(mapconcat #'identity plantuml-java-args " ")
(alist-get :cmdline org-babel-default-header-args:plantuml)
(mapconcat #'identity plantuml-jar-args " "))

Hope that helps,

AndyM




Request To Contribute To 'Worg' Project

2022-01-09 Thread Samuel Banya
Hey there,

Long time Emacs Org Mode user here, and think its the best thing I've ever 
used. Helped me in my multiple tech support jobs, and think its wonderful.

I wanted to see if there is anything I could contribute to for this project.

I read this page, and noted that you have to request access for this repo:
https://git.sr.ht/~bzg/worg

After the approval process is completed, can anyone point me to "How" exactly 
contributions are made?

Are they done through 'patch' based emails sent through to the mailing list 
itself?

Or are they done directly through git pushes?

I ask because I'm pretty much a hobbyist with projects, so I wanted to make 
sure I went through the required process in this scenario.

Thanks again, hope everyone is doing well :)

Sincerely,

Samuel Banya

Re: [BUG] Prefer lowercase #+results [9.5.2 (release_9.5.2-3-geb9f34 @ /Users/salutis/src/emacs/nextstep/Emacs.app/Contents/Resources/lisp/org/)]

2022-01-09 Thread Rudolf Adamkovič
Tim Cross  writes:

> The point is, the begin v BEGIN issue is to some extent bordering on
> becoming a religious argument and one which is unlikely to gain
> consensus. While personally I agree with your point and for
> consistency, I think the default should be lower case, it really
> doesn't matter.  Everyone will have their personal preferences and
> while it is trivial to set to your preferred format, it is one of
> those issues which will likely generate lots of noise with little
> resolution.

Thank you for providing me with such a clear explanation!  To make my
point clear, I do not care about whether Org uses upper case or lower
case keywords, but I do care about consistency.  Specifically, I think
Emacs should not make new users fiddle with variables just to make its
behavior internally consistent.  Thus, while I do understand both the
"lowercase religion" and the "uppercase religion", I do not understand
the "inconsistency religion".

Rudy
-- 
"I love deadlines. I love the whooshing noise they make as they go by."
-- Douglas Adams, The Salmon of Doubt

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



Question Regarding Creating Workflow For Automatic Formulas For Finance Based Org Spreadsheet

2022-01-09 Thread Samuel Banya
Hey there,

So I've been managing my finances via an org doc that basically has tables that 
list all the expenses from my bank account, which has been awesome on some 
respects.

The only annoying thing I want to somehow figure out this year is how to make 
the process of updating the formula for a given month less tedious, so I am 
wondering if anyone could help me figure out a better workflow for doing this.
*
*
*Here's My Current Workflow*
 * Download .csv from banking website
 * Convert .csv to .org file via file manager (with 'ranger' in 'vterm')
 * Change over to Dired Mode in the same directory and view the same .org file, 
and convert the data into an org table by using 'C-x h' to highlight 
everything, and use 'C-c |' to convert the range into an org table
 * Open up the existing running total org mode spreadsheet in a separate buffer
 * Copy over the converted org mode table data from the new .csv buffer and 
paste it into the running org mode spreadsheet
 * Use 'C-c }' to show all formulas row and column values in the spreadsheet
 * Find the existing formula row line for the given month's totals at the 
bottom of the spreadsheet, and manually delete the values for the 3rd and 4th 
row respectively
 * Re-enter the formula manually for each cell and hit tab
 * Enter the same formulas on the next line to double check my work to make 
sure I entered them in correctly.
*
*
*After Reading The Online Manual, I Figured This Out:*
 * `I tried using the 'org-table-edit-formulas' function via the "C-c ' (single 
quote)" (Obtained this formula via the docs, 
'`https://www.gnu.org/software/emacs/manual/html_mono/org.html#Formula-syntax-for-Lisp')``
 * I then accepted the mini buffer's changes with 'C-c C-c' which goes back to 
the spreadsheet.
 * I then hit 'C-c *' to update the tables present.
 * The problem with this is that when I attempt to do this function for each 
separate calculation row, both of the bottom calculation rows now only refer to 
a single formula for some reason.

*For Reference, Here's A Modified Version Of My Running Finance Spreadsheet 
(Modified Without Actual Values Or Records For Personal Reasons) (NOTE: Sorry 
that the paste is terribly aligned --> I blame email formatting for this, also, 
note that I also put a note for myself as to what the formulas involved are for 
a given month since I can never remember the syntax personally since its 
flipped from typical Excel syntax of using row and column --> it uses column 
then row like an older calculator)*

|+--+---+--|
| 01/03/2022 | Example Rent Expense |   | 
-1061.67 |
| 01/04/2022 | Example Food Expense |   | 
-1061.67 |
| 02/05/2022 | Example Utility Expense  |   | 
-2061.67 |
| 02/06/2022 | Example Random Expense   |   | 
-2061.67 |
|+--+---+--|
|| EXPENSES JAN 2022 vsum(@1$3..@2$3) vsum(@1$4..@2$4)  | 0 | 
-2123.34 |
|| EXPENSES Feb 2022 vsum(@3$3..@4$3) vsum(@3$4..@4$4)  | 0 | 
-4123.34 |
|+--+---+--|

*Formulas Presented In the 3rd and 4th columns for Row 5:**
*
# Column Formulas
$3 = vsum(@1$3..@2$3)
$4 = vsum(@1$4..@2$4)

*Formulas Presented In The 3rd And 4th Columns For Row 6 (**NOTE**: Notice how 
I can't make them unique for each row for some reason):*
# Column Formulas
$3 = vsum(@1$3..@2$3)
$4 = vsum(@1$4..@2$4)
*
*
*Main Questions Regarding Formula Issues:*
 * Why can't I use individual row formulas in this scenario?
 * Why is it that when I use "C-c ' (single quote)" the row formulas are the 
same for completely separate rows

*My Main Workflow Questions Include The Following:*
 * Is there a way I can maybe automate the initial steps of converting that 
.csv into an .org mode doc, and to paste them into the existing org spreadsheet?
 * Is there a way I can also update the existing formula for the given month if 
Emacs would somehow know the current date time stamp and figure out the month's 
row at the bottom of the spreadsheet accordingly to update the correct row?

Anyway, I know my question might be a bit ambiguous and most likely will 
involve using 'F3' to record macros, but I figured i would ask to maybe make it 
easier since one of my goals for the new year is to make recording finances an 
easier process. 

I felt like I've been over complicating this, and figured someone probably is 
doing org finance spreadsheets better than me to figure this out.

Sincerely,

Sam


`org-fill-paragraph' (`M-q') in Org Mode source blocks

2022-01-09 Thread Fabio Natali
Hello,

I'm having some issues with `M-q' (`org-fill-paragraph') within a Org
Mode source block.

Consider, for instance, a Org Mode file that contains the following
source block.

┌
│ #+BEGIN_SRC elisp
│ ;; A comment
│ (+ 2 2)
│ #+END_SRC
└

What happens: when calling `M-q' from within the block, the content is
handled like generic text and transformed as follows.

┌
│ #+BEGIN_SRC elisp
│   ;; A comment (+ 2 2)
│ #+END_SRC
└

What I'd be ideally expecting: the code to be potentially transformed
the same way it'd be in Emacs Lisp major mode.

What I'm actually expecting: the above might be too much of a high
expectation (i.e. for Org Mode to be aware of different `fill-paragraph'
mechanisms for different languages). As a second best, I'd be expecting
Org Mode to simply ignore my `M-q' command.

Here are some further considerations:

• Things work as expected when editing the block with the relevant major
  mode, e.g. Emacs Lisp; I know that this can be easily activated with
  `org-edit-special' (`C-c '').
• This can be replicated over different languages, i.e. it doesn't seem
  to be related to Emacs Lisp code in any way.
• I was able to reproduce this with a minimal `init.el' that only
  contains `(org-babel-do-load-languages 'org-babel-load-languages
  '((emacs-lisp . t)))'.
• I've been testing this with GNU Emacs 27.2 and Org Mode 9.5.1.

Also, I can see `M-q' is bound to `org-fill-paragraph'. The [source
code] for that function says:

  This function only applies to comment blocks, comments,
  example blocks and paragraphs.

This would seem to confirm my expectation, i.e. that the command
shouldn't be doing anything within a source block. Instead,
`org-fill-paragraph' seems to be calling `org-fill-element' and then
ultimately `fill-paragraph', [here].

This might be a relevant section:

┌
│ (cl-case (org-element-type element)
│   ;; Use major mode filling function is source blocks.
│   (src-block (org-babel-do-in-edit-buffer
│ (push-mark (point-min))
│ (goto-char (point-max))
│ (setq mark-active t)
│ (funcall-interactively #'fill-paragraph justify 'region)))
└

In order to honour its promise of only applying "to comment blocks,
comments, example blocks and paragraphs", shouldn't rather the function
do nothing in this case?

Is there anything obvious that you think I'm missing here? Is anyone
able to replicate the above behaviour and, if so, do you also find it
slightly problematic? Any thoughts and feedback on the above will be
greatly appreciated. :)

Thanks, best, F.


[source code]


[here]




Re: Way to mark contents of an Org special block as verbatim?

2022-01-09 Thread Kaushal Modi
> On Sat, Jan 8, 2022 at 10:01 PM Berry, Charles  
> wrote:

Hi Charles,

I used your minimal example to show the issue I am seeing when using
ox-md as the base exporter.

=
#+property: header-args :results none :exports none :eval never-export
#+options: toc:nil

* Define newmd :noexport:
Eval below to define a minimal "newmd" exporter:
#+begin_src emacs-lisp
;; minimal backend with md parent
(org-export-define-derived-backend 'newmd 'md
  :translate-alist
  '((special-block . org-newmd-special-block)))

;; special block transcoder
(defun org-newmd-special-block (special-block contents info)
  "Newmd special block transcoder."
  (let
   ((type (org-element-property :type special-block)))
(if (equal type "katex")
(format "{{<%s>}}\n%s{{}}\n" type contents type)
  ;; not `katex' so default to md transcoder
  (org-export-with-backend 'md special-block contents info
#+end_src
* Test block for exporting
#+begin_katex
E = -J \sum_{i=1}^N s_i s_{i+1}
#+end_katex
* Do export:noexport:
Eval below to export this buffer using the ~newmd~ exporter:
#+begin_src emacs-lisp
(org-export-to-buffer 'newmd "*Org NEW LATEX Export*" nil nil nil :body-only)
#+end_src
=

1. Eval the block in first heading
2. Eval the block in second heading to export

Exporter buffer content:

=
# Test block for exporting

{{}}
E = -J i=1^N s\_i si+1
{{}}
=


How do we disable Org from transforming this:

E = -J \sum_{i=1}^N s_i s_{i+1}

to this:


E = -J i=1^N s\_i si+1



Re: [BUG] org-persist.el: The commits after "410afd6f374e9" caused org-agenda buffer does not display scheduled and deadline tasks

2022-01-09 Thread Ihor Radchenko
"Christopher M. Miles"  writes:

> I use your reproduce steps, confirmed the problem exist. The headline does 
> not appear.
>
> 1. Run emacs -Q -L ./lisp ~/org-persist-test.org
> 2. M-x org-agenda
> 3. < a (set restriction to current buffer and run normal weekly agenda)
>
> My Emacs version: GNU Emacs 29.0.50 (build 1, aarch64-apple-darwin21.2.0, NS 
> appkit-2113.20 Version 12.1 (Build 21C52)) of 2021-12-30
> System: M1 macOS Monterey 12.1

Err..

I just tried again with even cleaner environment:
1. cd /tmp
2. git clone git://git.sv.gnu.org/emacs/org-mode.git
3. cd org-mode
4. make cleanall
5. make autoloads
6. emacs -Q -L ./lisp /tmp/bug.org
   with /tmp/bug.org file as attached
7. M-x org-agenda
8. < a

Emacs version: GNU Emacs 29.0.50 (build 1, x86_64-pc-linux-gnu, cairo version 
1.16.0) of 2022-01-08

I can still see the headline.

If you can still reproduce, we are entering the territory of Emacs
build-dependent bugs... My best suggestion then is going to
org-element.el and changing "(version< emacs-version "29")" to "t".

Best,
Ihor



bug.org
Description: Lotus Organizer


Re: [BUG] org-persist.el: The commits after "410afd6f374e9" caused org-agenda buffer does not display scheduled and deadline tasks

2022-01-09 Thread Ihor Radchenko
"Christopher M. Miles"  writes:

> I use your reproduce steps, confirmed the problem exist. The headline does 
> not appear.
>
> 1. Run emacs -Q -L ./lisp ~/org-persist-test.org
> 2. M-x org-agenda
> 3. < a (set restriction to current buffer and run normal weekly agenda)
>
> My Emacs version: GNU Emacs 29.0.50 (build 1, aarch64-apple-darwin21.2.0, NS 
> appkit-2113.20 Version 12.1 (Build 21C52)) of 2021-12-30
> System: M1 macOS Monterey 12.1

Err..

I just tried again with even cleaner environment:
1. cd /tmp
2. git clone git://git.sv.gnu.org/emacs/org-mode.git
3. cd org-mode
4. make cleanall
5. make autoloads
6. emacs -Q -L ./lisp /tmp/bug.org
   with /tmp/bug.org file as attached
7. M-x org-agenda
8. < a

Emacs version: GNU Emacs 29.0.50 (build 1, x86_64-pc-linux-gnu, cairo version 
1.16.0) of 2022-01-08

I can still see the headline.

If you can still reproduce, we are entering the territory of Emacs
build-dependent bugs... My best suggestion then is going to
org-element.el and changing "(version< emacs-version "29")" to "t".

Best,
Ihor



bug.org
Description: Lotus Organizer


Re: Bug: Incorrect indentation in Org Babel list output with multiline text [9.4.4 (release_9.4.4 @ /Applications/Emacs.app/Contents/Resources/lisp/org/)]

2022-01-09 Thread Vikas Kumar
Here is a patch with the fix.

-- 
Thanks,
Vikas

On Sat, Jan 8, 2022 at 9:22 PM Vikas Kumar  wrote:

> Hello,
>
> When I use ':results value list' in an emacs-lisp source block it looks
> like Babel does
> not indent list items correctly when one of the items is a multi-line text.
>
> To reproduce evaluate the following code block:
>
> #+begin_src emacs-lisp :results value list
>   '("Foo1\nBar1" "Foo2\n\nBar2")
> #+end_src
>
>
> It outputs:
>
> #+RESULTS:
> - Foo1
> Bar1
> - Foo2
>
>
> Bar2
>
>
> Expected output:
>
> #+RESULTS:
> - Foo1
>   Bar1
> - Foo2
>
>
>   Bar2
>
>
> Since the second line of the first item is out of indentation, this makes
> the output list actually
> finish after the first line of the first item. Re-evaluating the block
> then only removes the first line
> of the previous output.
>
> My Emacs and Org mode version:
> Emacs  : GNU Emacs 27.2 (build 1, x86_64-apple-darwin20.6.0, Carbon
> Version 164 AppKit 2022.6)
>  of 2021-11-16
> Package: Org mode version 9.4.4 (release_9.4.4 @
> /Applications/Emacs.app/Contents/Resources/lisp/org/)
>
> --
> Thanks,
> VIkas
>


0001-ob-core.el-Fix-indentation-of-multiline-text-in-list.patch
Description: Binary data


Re: [BUG] org-persist.el: The commits after "410afd6f374e9" caused org-agenda buffer does not display scheduled and deadline tasks

2022-01-09 Thread Christopher M. Miles

Ihor Radchenko  writes:

> "Christopher M. Miles"  writes:
>
>> Here is my reproduce environment:
>>
>> Reproduce test with =emacs -Q=
>>
>> #+begin_src shell :eval no
>> emacs -Q -l ~/.config/emacs/minimal-org-init.el ~/org-persist-test.org
>> #+end_src
>>
>> #+begin_src org :tangle "~/org-persist-test.org"
>>   ,* LEARN  Clojure Web Development Stack [0/0]
>>   DEADLINE: <2022-01-01 Sat>
>>   :LOGBOOK:
>>   - Removed deadline, was "[2018-12-09 Sun]" on [2019-04-13 Sat 11:14]
>>   - State "LEARN"  from  [2018-06-01 Fri 09:18]
>>   :END:
>>
>> #+end_src
>
> Thanks! I am still unable to reproduce. However, I was not able to use
> your minimal-org-init directly as I do not have ELPA folder.
>
> Also, note that your statement
> (org-babel-do-load-languages
>  'org-babel-load-languages
>  '((emacs-lisp . t)))
> may load built-in org
>
> I did the following:
> 1. go to Org mode source directory
> 2. create bug.el with the following contents (I tried my best to pull
>important pieces from your minimal init)
>
> (custom-set-variables '(org-modules nil))
>
> (setq org-src-fontify-natively t)
>
> (org-babel-do-load-languages
>  'org-babel-load-languages
>  '((emacs-lisp . t)))
>
> 3. Run emacs -Q -L ./lisp -l ./bug.el ~/org-persist-test.org
> 4. M-x org-agenda
> 5. < a (set restriction to current buffer and run normal weekly agenda)
> 6. The heading is displayed
>
> Can you follow my steps and report what happens?
>
> Best,
> Ihor

I use your reproduce steps, confirmed the problem exist. The headline does not 
appear.

1. Run emacs -Q -L ./lisp ~/org-persist-test.org
2. M-x org-agenda
3. < a (set restriction to current buffer and run normal weekly agenda)

My Emacs version: GNU Emacs 29.0.50 (build 1, aarch64-apple-darwin21.2.0, NS 
appkit-2113.20 Version 12.1 (Build 21C52)) of 2021-12-30
System: M1 macOS Monterey 12.1

-- 
[ stardiviner ]
   I try to make every word tell the meaning that I want to express.

   Blog: https://stardiviner.github.io/
   IRC(freenode): stardiviner, Matrix: stardiviner
   GPG: F09F650D7D674819892591401B5DF1C95AE89AC3


signature.asc
Description: PGP signature