Re: stability of toc links

2020-12-10 Thread Carsten Dominik
Dear all,

let me test this a bit, and then I am going to proposa a patch.

Kind regards

Carsten

On Thu, Dec 10, 2020 at 3:38 PM TEC  wrote:

>
> > There are a few touch ups I'll do to my code shortly
>
> I'm pleased to say that I've improved the readability and documentation
> of my code (hopefully) in
>
> https://eur04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Ftecosaur%2Femacs-config%2Fcommit%2Fdc873d3data=04%7C01%7Cc.dominik%40uva.nl%7C783e4577fb6342a7a43e08d89d193c38%7Ca0f1cacd618c4403b94576fb3d6874e5%7C1%7C0%7C637432078994585612%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000sdata=0i0U93RLqza1tVFDzVEXCc4xzwHAEvDmmZ51Woom%2F8A%3Dreserved=0
>
> I hope this may be of some help,
>
> Timothy
>


Re: [PATCH] ob-ruby.el: Don't reuse the same buffer among different named

2020-12-10 Thread Aaron Madlon-Kay
> + (run-ruby-or-pop-to-buffer
> +  cmd (or session "ruby")
> +  (unless session
> +(inf-ruby-buffer)))

I have just run into an issue with this: If you don't specify :ruby
then `cmd' for me is calculated by

(cdr (assoc inf-ruby-default-implementation inf-ruby-implementations))

which gives the function `inf-ruby--irb-command' as a result.

However `run-ruby-or-pop-to-buffer' expects to get a string only.

I'm not sure if it should be org-mode's responsibility to resolve the
actual command string, or if it should be done by
`run-ruby-or-pop-to-buffer'. (It kind of seems like the latter?)

Any thoughts?

-Aaron



Re: Time Slots in Org-Agenda

2020-12-10 Thread steve-humphreys



> Sent: Friday, December 11, 2020 at 7:52 AM
> From: "Ihor Radchenko" 
> To: steve-humphr...@gmx.com
> Cc: "Org-Mode mailing list" 
> Subject: Re: Time Slots in Org-Agenda
>
> >> See org-agenda-time-grid
> >
> > Where can I find some information on how to use it?
>
> Menu help -> Describe -> Describe variable org-agenda-time-grid 
> or
>  v org-agenda-time-grid 

At first

I have started with the following command, but emacs does not like it

(setq times '(800 1000 1200))
(setq freq '("daily" "today"))
(setq org-agenda-time-grid '(freq times "---" "+++"))

I also tried variants thereof.  My elisp is not so good
but tried to have a look at the code.

But this second command works.

(setq org-agenda-time-grid '((daily today require-timed)
   (800 1000 1200 1400 1600 1800 2000)
   ".." ""))


> Best,
> Ihor
>
>



Re: Time Slots in Org-Agenda

2020-12-10 Thread Ihor Radchenko
>> See org-agenda-time-grid
>
> Where can I find some information on how to use it?

Menu help -> Describe -> Describe variable org-agenda-time-grid 
or
 v org-agenda-time-grid 

Best,
Ihor



Re: Time Slots in Org-Agenda

2020-12-10 Thread steve-humphreys



> Sent: Friday, December 11, 2020 at 6:43 AM
> From: "Ihor Radchenko" 
> To: steve-humphr...@gmx.com, pie...@caramail.com
> Cc: "Org-Mode mailing list" 
> Subject: Re: Time Slots in Org-Agenda
>
> steve-humphr...@gmx.com writes:
> > What I would like to know is how to make the slots with smaller time
> > durations.  Currently they are of two-hours, which I find too long.
>
> See org-agenda-time-grid

Where can I find some information on how to use it?


> Best,
> Ihor
>
>



Re: Someone to oversee Org bugs as reported with M-x report-emacs-bugs?

2020-12-10 Thread Bastien
Thanks Jean, I agree with most of your points.

Are you volunteering for this task?

-- 
 Bastien



Re: Emacs inserts hardwired org-agenda-files variable, overwriting user options

2020-12-10 Thread Jean Louis
* TRS-80  [2020-12-11 08:23]:
> On 2020-11-29 17:08, daniela-s...@gmx.it wrote:

> > Yes, there are problems with the documentation.  I noticed
> > recently that some guy criticised the manual, and so many got
> > super defensive.  You should give him a medal for telling you how
> > things are.

> I guess in my mind, complaining about the manual, to a bunch of
> volunteers and fellow users, is probably on the pretty unhelpful end
> of the scale.

Please assume good faith while trying not to wrong users.

GNU Kind Communications Guidelines
https://www.gnu.org/philosophy/kind-communication.html




Re: Someone to oversee Org bugs as reported with M-x report-emacs-bugs?

2020-12-10 Thread Jean Louis
* Bastien  [2020-12-11 08:18]:
> Dear all,
> 
> as the subject says: it would be nice to have someone overseeing Org
> bugs that are reported with M-x report-emacs-bugs.
> 
> These bugs end up in the Emacs debbugs tracking tool:
> 
> https://debbugs.gnu.org/cgi/pkgreport.cgi?package=emacs
> https://www.gnu.org/software/emacs/manual/html_node/emacs/Bugs.html
> 
> They are also sent to the bug-gnu-emacs mailing list:
> https://mail.gnu.org/mailman/listinfo/bug-gnu-emacs

Process could be somewhat automated if program calculcates what is the
month and expands to 2020-12 then downloads automatically the mbox
file from:

https://lists.gnu.org/archive/mbox/bug-gnu-emacs/2020-12

and conduct grep searches:

grep -i "Subject: .*Org" 2020-12

which gives:

Subject: bug#45002: gnu.org Mailbox Upgrade!!
Subject: bug#43268: Update Org for Emacs 27.2
Subject: bug#45091: 27.1; M-x org-table-paste-rectanble
Subject: bug#45091: 27.1; M-x org-table-paste-rectanble
Subject: bug#45091: 27.1; M-x org-table-paste-rectanble
Subject: bug#45091: 27.1; M-x org-table-paste-rectanble
Subject: bug#45091: 27.1; M-x org-table-paste-rectanble
Subject: bug#45091: 27.1; M-x org-table-paste-rectangle
Subject: bug#45091: 27.1; M-x org-table-paste-rectangle
Subject: bug#43268: Update Org for Emacs 27.2
Subject: bug#43268: Update Org for Emacs 27.2
Subject: bug#45091: 27.1; M-x org-table-paste-rectangle
Subject: bug#43268: Update Org for Emacs 27.2
Subject: bug#45091: 27.1; M-x org-table-paste-rectangle
Subject: bug#45091: 27.1; M-x org-table-paste-rectangle
Subject: bug#42484: 26.1: org-mode should display value of links in minibuffer
Subject: bug#45147: Org-like cycling in outline-minor-mode
Subject: bug#45147: Org-like cycling in outline-minor-mode

If somebody has a VPS the report could come once per day. For me it
would be quite natural that report arrives as Org file report.

It is additionally possible to parse: bug#45147 into a hyperlink to
WWW report:

https://debbugs.gnu.org/cgi/bugreport.cgi?bug=45147

or to directly link to mbox:

https://debbugs.gnu.org/cgi/bugreport.cgi?bug=45147=yes

> Volunteering for overseeing these bugs does not mean you have to
> subscribe to this list or to fix all Org bugs there :)

But one could do that as it would be useful activity. And when one
answers on bug reported through main Emacs interface one could add Cc:
to Org mailing list.

> First of all, most users use M-x org-submit-bug-report for Org bugs,
> which is the preferred way of submitting Org bugs.

Maybe they use that, maybe most users use the menu option. Let us not
forget that majority of users will never report a bug and that bug
reporting should be encouraged.

> Secondly, most bugs reported with M-x report-emacs-bugs are bugs
> against old versions of Org, already fixed upstream.
> 
> So the idea is just to be able to answer one of these:
> 
> - "Thanks but I cannot reproduce the bug with the latest Org."

Org users are not necessarily experienced users who will know what it means:

- bug? - when users do not understand the meaning they may not even
  report. If they wish to improve some feature, they will not
  report. Option in the Org menu: "Send bug report" could as well be
  more descriptive to be like: "Send bug report or feature request"
  and manual could prominently invite users to send bug reports or
  feature requests. Additionally, I suggest you add in the menu
  "Subscribe to Org mailing list" to invite users.

- "to reproduce the bug" -- this may not have meaning for new users
  same as for you. It may be also understood as rejection or that
  user's observation is wrong, thus wronging the user. It needs more
  description

- "latest Org" -- this may not be understood in the same way. It needs
  pointers how to upgrade.

Formulation should be adopted to the view point of a new user, it
could be something like:

"Thank you for your bug report related to Org mode. New bugs like you
reported get resolved in the next development version of the Org
mode. The bug as described is not reproducing in that latest
development version, so I think that it hsa been resolved. Advise is
that you upgrade your Org package in Emacs by doing: M-x .."

Additionally in that snipper under that context that bug is not
reproducible, you should tell to user that Org bugs may be reported
straight from Org mode menu or by M-x org-submit-bug-report

Please do not tell users something like Org is not Emacs as that is
confusing, and not true. Telling them harshly that Org bugs have to be
submitted to Org mailing list is causing problems as it is wronging
users. Do not assume that user, especially one who reports through
main interface, would know what you mean.

You may formulate it better in the sense that it will be better
understood. It is a snippet or template to be used, not something to
re-type over and over again.

Consider that Org comes with Emacs. GNU/Linux and BSD derivatives
distribute Emacs. Users using Org need not know that 

Re: Time Slots in Org-Agenda

2020-12-10 Thread Ihor Radchenko
steve-humphr...@gmx.com writes:
> What I would like to know is how to make the slots with smaller time
> durations.  Currently they are of two-hours, which I find too long.

See org-agenda-time-grid

Best,
Ihor



Re: Emacs inserts hardwired org-agenda-files variable, overwriting user options

2020-12-10 Thread TRS-80

On 2020-11-29 17:08, daniela-s...@gmx.it wrote:


Yes, there are problems with the documentation.  I noticed recently 
that
some guy criticised the manual, and so many got super defensive.  You 
should

give him a medal for telling you how things are.


I guess in my mind, complaining about the manual, to a bunch of
volunteers and fellow users, is probably on the pretty unhelpful end of
the scale.

Making constructive criticism is then slightly better, at least you are
not deriding (mostly volunteer) people's work and effort.  Although not
by much, as this still does not require too much effort.

However submitting a patch with an improvement to the documentation is
quite valuable.  Pretty much on the opposite end of the scale in fact.
And thus, only this level of contribution "deserves a medal" as far as I
am concerned.

I was not privy to particulars of conversation you mention, although I
have seen this sort of entitled attitude often enough in F/LOSS to have
somewhat of an idea of how it might have played out.

Entitled users becoming demanding of things they expect (for free, no
less) is not just a drag, it's the cancer that slowly kills F/LOSS
projects.  As eventually actually valuable contributors (maintainers,
devs, etc.) have had enough of it, get burnt out and leave the project.
I have seen it far too many times over the years.

So I imagine what you witnessed was a sort of natural defense mechanism,
protecting the overall health of the community and project by having a
strong reaction to such negative attitudes.

Cheers,
TRS-80



Re: Time Slots in Org-Agenda

2020-12-10 Thread steve-humphreys
> Sent: Thursday, December 10, 2020 at 8:31 PM
> From: pie...@caramail.com
> To: "Christopher Dimech" 
> Cc: "Org-Mode mailing list" 
> Subject: Time Slots in Org-Agenda
>
> Dear Christopher
>
> Appointment slots are very useful when you don't know who needs to
> meet with you, but you want to make yourself available. You can
> offer people a block of time on your agenda that they can book
> time slots within. For example, you can set aside 20 minutes that
> you're available to meet with people.
>
> It would also be useful to show the percentage of appointments for
> the day, week, month.  With possible indication of empty slots.

What I would like to know is how to make the slots with smaller time
durations.  Currently they are of two-hours, which I find too long.

I see that the slots remain empty even when there is an appointment
at that particular time.


> Regards
> Pietru
>
>
>
> Pietru Caxaro
> Director of Underground Sensing Techniques
> Special Superintendence for the Archaeological Heritage of Rome
>
> > Sent: Wednesday, December 09, 2020 at 8:50 PM
> > From: "Christopher Dimech" 
> > To: "Org-Mode mailing list" 
> > Subject: Time Slots in Org-Agenda
> >
> > It would be good if the following org-agenda problem could be addressed.
> >
> > Here is a section of a diary
> >
> > Dec 05, 2020
> > 06:13-08:34 Gnu Hackers Meeting
> > 10:21-12:00 Richard Stallman Talk
> > 12:00-12:34 Lunch
> > 14:21-17:34 Hacking Session
> >
> > This gives the following in Org-Agenda.
> >
> >
> > Saturday 5 December 2020
> > 5:06.. now - - - - - - - - - - - - - - - - - - - - - - - - -
> > Diary: 7:55- 9:34 Gnu Hackers Meeting *
> > 8:00.. 
> > 10:00.. 
> > Diary: 10:21-12:00 Richard Stallman Talk
> > 12:00.. 
> > Diary: 12:00-12:34 Lunch
> > 14:00.. 
> > Diary: 14:21-17:34 Hacking Session *
> > 16:00.. 
> > 18:00.. 
> > 20:00.. 
> >
> >
> > Loking at the entries with a star, end later than the
> > next time thresholds of 08:00 and 16:00, yet the entries
> > are not being populated for the later times.
> >
> > I would be grateful if the slots at the later times would
> > also be filled. For instance, according to the setup below
> > (see the ** entries)
> >
> > Saturday 5 December 2020
> > 5:06.. now - - - - - - - - - - - - - - - - - - - - - - - - -
> > Diary: 7:55- 8:00 Gnu Hackers Meeting **
> > 8:00.. 
> > Diary: 8:00- 9:34 Gnu Hackers Meeting **
> > 10:00.. 
> > Diary: 10:21-12:00 Richard Stallman Talk
> > 12:00.. 
> > Diary: 12:00-12:34 Lunch
> > 14:00.. 
> > Diary: 14:21-16:00 Hacking Session **
> > 16:00.. 
> > Diary: 17:00-17:34 Hacking Session **
> > 18:00.. 
> > 20:00.. 
> >
> >
> >
> >
>



Someone to oversee Org bugs as reported with M-x report-emacs-bugs?

2020-12-10 Thread Bastien
Dear all,

as the subject says: it would be nice to have someone overseeing Org
bugs that are reported with M-x report-emacs-bugs.

These bugs end up in the Emacs debbugs tracking tool:

https://debbugs.gnu.org/cgi/pkgreport.cgi?package=emacs
https://www.gnu.org/software/emacs/manual/html_node/emacs/Bugs.html

They are also sent to the bug-gnu-emacs mailing list:
https://mail.gnu.org/mailman/listinfo/bug-gnu-emacs

Volunteering for overseeing these bugs does not mean you have to
subscribe to this list or to fix all Org bugs there :)

First of all, most users use M-x org-submit-bug-report for Org bugs,
which is the preferred way of submitting Org bugs.

Secondly, most bugs reported with M-x report-emacs-bugs are bugs
against old versions of Org, already fixed upstream.

So the idea is just to be able to answer one of these:

- "Thanks but I cannot reproduce the bug with the latest Org."

- "Thanks, I confirm this is a bug, can you forward it to the Org
  mailing list at emacs-orgmode@gnu.org?"

... and to make sure that you _close_ the bug report when necessary.

It is a very nice way to get _some_ work done for Org/Emacs while 
also being part of the Emacs maintainance larger team.

Who's in?

-- 
 Bastien



Re: Emacs inserts hardwired org-agenda-files variable, overwriting user options

2020-12-10 Thread daniela-spit



> Sent: Friday, December 11, 2020 at 4:59 AM
> From: "TRS-80" 
> To: daniela-s...@gmx.it
> Cc: "Kyle Meyer" , "Tom Gillespie" , 
> "Org-Mode mailing list" , "Emacs-orgmode" 
> 
> Subject: Re: Emacs inserts hardwired org-agenda-files variable, overwriting 
> user options
>
> On 2020-11-29 17:08, daniela-s...@gmx.it wrote:
> >
> > Yes, there are problems with the documentation.  I noticed recently
> > that
> > some guy criticised the manual, and so many got super defensive.  You
> > should
> > give him a medal for telling you how things are.
>
> I guess in my mind, complaining about the manual, to a bunch of
> volunteers and fellow users, is probably on the pretty unhelpful end of
> the scale.
>
> Making constructive criticism is then slightly better, at least you are
> not deriding (mostly volunteer) people's work and effort.  Although not
> by much, as this still does not require too much effort.
>
> However submitting a patch with an improvement to the documentation is
> quite valuable.  Pretty much on the opposite end of the scale in fact.
> And thus, only this level of contribution "deserves a medal" as far as I
> am concerned.
>
> I was not privy to particulars of conversation you mention, although I
> have seen this sort of entitled attitude often enough in F/LOSS to have
> somewhat of an idea of how it might have played out.
>
> Entitled users becoming demanding of things they expect (for free, no
> less) is not just a drag, it's the cancer that slowly kills F/LOSS
> projects.  As eventually actually valuable contributors (maintainers,
> devs, etc.) have had enough of it, get burnt out and leave the project.
> I have seen it far too many times over the years.
>
> So I imagine what you witnessed was a sort of natural defense mechanism,
> protecting the overall health of the community and project by having a
> strong reaction to such negative attitudes.

There are problems in Org-Agenda my friend.  And quite some confusion
on what mailing list to use.  Only one mailing list is mentioned, then
people start sending you here and there.  At other times, things are done
in a piecemeal process.  Elisp can be challenging and you will not learning
in school.  There needs to be some intermediate level manual if you want
people to get good enough to help the project.  I am quite sure that some
people do spend a long time testing the code.


> Cheers,
> TRS-80
>



Re: [PATCH] Fix org-in-archived-heading-p when tag contains ARCHIVE as a substring

2020-12-10 Thread Kyle Meyer


Ihor Radchenko writes:

> Subject: [PATCH] Fix org-in-archived-heading-p
>
> * lisp/org.el (org-in-archived-heading-p): When called on a heading
> with a tag containing org-archive-tag string as a substring, that
> heading was incorrectly recognised as archived.  Changed matching
> against the whole :tag1:tag2:...: string to matching against tag list
> as returned by `org-get-tags'.
> * testing/lisp/test-org.el (test-org/in-archived-heading-p): Add test
> when one of the heading tags contains org-archive-tag as a substring.

Nicely done.  Pushed (a03f17e49).

Thank you.



Re: [PATCH] Turkish translation added for export

2020-12-10 Thread Kyle Meyer


Fatih Aydin writes:

> ---
>  lisp/ox.el | 36 +---
>  1 file changed, 29 insertions(+), 7 deletions(-)

Pushed (dc1e037cd), tweaking the commit message and adding a changelog
entry.

Thanks!



Re: org-mac-link patch

2020-12-10 Thread Kyle Meyer


Jan Lübke writes:

> Good morning,
>
> this is my first time submitting a patch, here.

Thank you!

> I hope I did everything right. If I made a mistake, please let me
> know. If you have any questions, feel free to ask.

The patch format looks good.  I have only minor/cosmetic comments.

> Not sure if this is even an official bug, yet. However here is a fix
> for a strange behaviour: Links to mail.app don’t open any more after
> upgrading to macOS 11.

Sounds like a bug.  I don't run macOS, so I'd be very grateful if
another macOS/mail.app user could confirm that your patch works on their
end.

> From: raumi75 <@raumi75>

Is it okay if I set this to the sender address of the main message?

> Date: Wed, 9 Dec 2020 09:31:01 +0100
> Subject: [PATCH] contrib module org-mac-link.el/open links from Mail.app: fix
>  compatibility issue with macOS 11 Big Sur.

It'd be nice to shorten a bit.  Perhaps

contrib/org-mac-link.el: fix Mail.app link compatibility with macOS 11

> * org-mac-link.el (org-mac-message-open): replaced angular brackets with 
> encoded version (< to %3C and > to %3E) so macOS 11 Big Sur can open the 
> message in mail.app

Looks good.  Please wrap the commit message lines, something like the
slightly edited

  * org-mac-link.el (org-mac-message-open): Replace angular brackets
  with encoded version (< to %3C and > to %3E) so macOS 11 Big Sur can
  open the message in mail.app.

> TINYCHANGE macOS 11 does not open the mail link with angular brackets any 
> more.  This fix is backwards compatible.  I have tested it on macOS 10.15.7.

Great, thanks for considering and checking the backwards compatibility.
That was going to be my main question.

> ---
>  contrib/lisp/org-mac-link.el | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/contrib/lisp/org-mac-link.el b/contrib/lisp/org-mac-link.el
> index d16190e5a..e692acb3e 100644
> --- a/contrib/lisp/org-mac-link.el
> +++ b/contrib/lisp/org-mac-link.el
> @@ -912,7 +912,7 @@ selected items in DEVONthink Pro Office and make link(s) 
> out of it/them."
>"Visit the message with MESSAGE-ID.
>  This will use the command `open' with the message URL."
>(start-process (concat "open message:" message-id) nil
> - "open" (concat "message://<" (substring message-id 2) ">")))
> + "open" (concat "message://%3C" (substring message-id 2) 
> "%3E")))


Looks as advertised :)  Again, it'd be good to get another macOS user to
confirm, but if not, I'll go ahead and apply this patch in a few days.

If my suggested commit message edits above look okay to you, there's no
need to resend.  I can amend when applying.

Thanks again.

>  
>  (defun org-as-get-selected-mail ()
>"AppleScript to create links to selected messages in Mail.app."
> -- 
> 2.29.2



Re: Emacs inserts hardwired org-agenda-files variable, overwriting user options

2020-12-10 Thread daniela-spit
> Sent: Friday, December 11, 2020 at 4:59 AM
> From: "TRS-80" 
> To: daniela-s...@gmx.it
> Cc: "Kyle Meyer" , "Tom Gillespie" , 
> "Org-Mode mailing list" , "Emacs-orgmode" 
> 
> Subject: Re: Emacs inserts hardwired org-agenda-files variable, overwriting 
> user options
>
> On 2020-11-29 17:08, daniela-s...@gmx.it wrote:
> >
> > Yes, there are problems with the documentation.  I noticed recently
> > that
> > some guy criticised the manual, and so many got super defensive.  You
> > should
> > give him a medal for telling you how things are.
>
> I guess in my mind, complaining about the manual, to a bunch of
> volunteers and fellow users, is probably on the pretty unhelpful end of
> the scale.
>
> Making constructive criticism is then slightly better, at least you are
> not deriding (mostly volunteer) people's work and effort.  Although not
> by much, as this still does not require too much effort.
>
> However submitting a patch with an improvement to the documentation is
> quite valuable.  Pretty much on the opposite end of the scale in fact.
> And thus, only this level of contribution "deserves a medal" as far as I
> am concerned.
>
> I was not privy to particulars of conversation you mention, although I
> have seen this sort of entitled attitude often enough in F/LOSS to have
> somewhat of an idea of how it might have played out.
>
> Entitled users becoming demanding of things they expect (for free, no
> less) is not just a drag, it's the cancer that slowly kills F/LOSS
> projects.  As eventually actually valuable contributors (maintainers,
> devs, etc.) have had enough of it, get burnt out and leave the project.
> I have seen it far too many times over the years.

You work on it and get a lot of praise but have almost no tolerance for
negative feedback.  When you get project maintainers complaining about your
attitude "Don't complain, I'm only volunteer. Bye Bye", something is screwed
up.  And now you want to start this all over again.  Bye Bye.


> So I imagine what you witnessed was a sort of natural defense mechanism,
> protecting the overall health of the community and project by having a
> strong reaction to such negative attitudes.
>
> Cheers,
> TRS-80
>



Re: org-table change time from UTC to other timezones

2020-12-10 Thread Alan E. Davis
Thank you for taking the time to answer my questions, TIm.

For my purposes, it's maybe easier to just bite the bullet and do it in my
head.

I had hoped that subtracting 10 hours from 06:44 UTC would get me at least
-04:44.  I can easily make the change to correct clock time (19:44) and
change the day name.  I was duplicating the work of looking up the time in
XEphem, the ephemeris program I am using, which requires some amount of
fiddling---solving for the time of max/min lunar declination.   It will
save hours of time to use org-mode's spreadsheet to add/subtract the
Timezone offsets.

As it turns out, this is not a straightforward procedure.  Also, as you
point out, this process is even less convenient due to inconsistencies in
the political realm.

I appreciate your comments.

Alan Davis

On Thu, Dec 10, 2020 at 12:17 PM Tim Cross  wrote:

>
> Alan E. Davis  writes:
>
> > I am close to throwing in the towel.
> >
> > Thank you for the suggestion.  Several problems have been encountered.  I
> > wonder whether I understand this tool at all.   If I subtract 10:00 from
> > 08:46, the answer given is -01:14.  I used #+TBLFM: $6=$4+$5;U, as
> follows
> > (please forgive the formatting):
> >
> > | Phenom |   Date | DoW |   UTC |Hrs |   ChST |   |
> > |++-+---+++---|
> > | ApoG   | 22 | Fr  | 06:44 | -10:00 | -03:16 |   |
> > |++-+---+++---|
> >   #+TBLFM: $6=$4+$5;U
> >
> > When I add 10:00, I think the values are sensible: 21:45 + 10:00 = 31:45.
> >
>
> What did you expect for 8:46 - 10:00? Looks correct to me or were you
> expecting 22:46 (24:00 - 01:14)? This would mean 21:45 + 10:00 should be
> 07:45. I think when your working with times like this, you need to
> include the date to help make sense of the result.
>
> > Another problem was in trying to use an inactive org timestamp.  It was
> not
> > straightforward to add or subtract N hours (say, 08:00).
> >
>
> You probably need to use the ort-timestamp-to-time and
> org-timestmap-from-time to convert the timestamp to a 'time' value (I
> suspect it uses either ms or sec since epoch as the base).  Convert to
> time, add/subtract offset, convert back to inactive timestamp.
>
> > This it a thornier problem than I had envisioned, anyway, because in
> locale
> > with time zones, the conversion factor will change at some point DURING
> the
> > month.
> >
> > Perhaps there is a calc procedure to convert time zones that will take
> into
> > account the system's knowledge of the timezones as well as changes
> to/from
> > Daylight Time.
> >
> > For now,
> >
>
> The big pain with working on time and timezones is the daylight savings
> complication. This is really tricky because the start and end date tend
> to be influenced by politics (I've seen DST change because of some
> event, like Olympic games or to coincide with easter holiday etc) and
> some states/geographies may decide not to use DST while others do (for
> example, in Australia, some states have DST and some don't - so for half
> the year, all the eastern states have the same timezone, but then for
> half the year, 3 are the same and one is different).
>
> There is some information in the calendar section of the emacs manual
> which might be useful and it does have a section on working with DST
> (I've not read it). In addition to the org mode functions to manipulate
> dates and times, there are also various elisp functions you can also
> use.
>
> It is a thorny problem because of the edge cases, but the basic
> functions are all there. Your best bet is to probably write a function
> which accepts a full date+time and UTC offset in minutes which returns a
> new date+time value and then call that function in your table formula.
> --
> Tim Cross
>


-- 
  "This ignorance about the limits of the earth's ability to absorb
   pollutants should be reason enough for caution in the release
   of polluting substances."
   ---Meadows et al.   1972.  Limits to Growth
.
(p. 81)


Accessing a DLNA server through an Org link

2020-12-10 Thread Juan Manuel Macías
Hi,

I'm storing in an Org document a list of links to all my media files
(videos, music, and the like). This is a little trick that I came up
with to access the multimedia content of my raspberry's dlna server
(minidlna), using an Org link and the Javier López
'simple-dlna-browser' script
(https://github.com/javier-lopez/learn/blob/master/sh/tools/simple-dlna-browser).
You need to install socat:

#+begin_src emacs-lisp
  (org-link-set-parameters
   "dlna"
   :follow (lambda (file)
 (let ((command (concat "~/Scripts/./simple-dlna-browser.sh "
"\""
file
"\""
" | xargs vlc")))
   (start-process-shell-command command nil command)))
   :face '(:foreground "green4" :weight bold :underline t))
#+end_src

Tested on Arch Linux. As an external player I use vlc; `file' can simply be the 
name of
the file. For example, if we have gattaca.mp4 on our server, the link could be:

#+begin_src org
  [[dlna:gattaca]]
#+end_src

Well, it works reasonably well. But I wonder if anyone knows of any
package or library to be able to do this (accessing a dlna server) in
a more emacs/org-centric way ...

Regards,

Juan Manuel 


Time Slots in Org-Agenda

2020-12-10 Thread pietru
Dear Christopher

Appointment slots are very useful when you don't know who needs to
meet with you, but you want to make yourself available. You can
offer people a block of time on your agenda that they can book
time slots within. For example, you can set aside 20 minutes that
you're available to meet with people.

It would also be useful to show the percentage of appointments for
the day, week, month.  With possible indication of empty slots.

Regards
Pietru



Pietru Caxaro
Director of Underground Sensing Techniques
Special Superintendence for the Archaeological Heritage of Rome

> Sent: Wednesday, December 09, 2020 at 8:50 PM
> From: "Christopher Dimech" 
> To: "Org-Mode mailing list" 
> Subject: Time Slots in Org-Agenda
>
> It would be good if the following org-agenda problem could be addressed.
>
> Here is a section of a diary
>
> Dec 05, 2020
> 06:13-08:34 Gnu Hackers Meeting
> 10:21-12:00 Richard Stallman Talk
> 12:00-12:34 Lunch
> 14:21-17:34 Hacking Session
>
> This gives the following in Org-Agenda.
>
>
> Saturday 5 December 2020
> 5:06.. now - - - - - - - - - - - - - - - - - - - - - - - - -
> Diary: 7:55- 9:34 Gnu Hackers Meeting *
> 8:00.. 
> 10:00.. 
> Diary: 10:21-12:00 Richard Stallman Talk
> 12:00.. 
> Diary: 12:00-12:34 Lunch
> 14:00.. 
> Diary: 14:21-17:34 Hacking Session *
> 16:00.. 
> 18:00.. 
> 20:00.. 
>
>
> Loking at the entries with a star, end later than the
> next time thresholds of 08:00 and 16:00, yet the entries
> are not being populated for the later times.
>
> I would be grateful if the slots at the later times would
> also be filled. For instance, according to the setup below
> (see the ** entries)
>
> Saturday 5 December 2020
> 5:06.. now - - - - - - - - - - - - - - - - - - - - - - - - -
> Diary: 7:55- 8:00 Gnu Hackers Meeting **
> 8:00.. 
> Diary: 8:00- 9:34 Gnu Hackers Meeting **
> 10:00.. 
> Diary: 10:21-12:00 Richard Stallman Talk
> 12:00.. 
> Diary: 12:00-12:34 Lunch
> 14:00.. 
> Diary: 14:21-16:00 Hacking Session **
> 16:00.. 
> Diary: 17:00-17:34 Hacking Session **
> 18:00.. 
> 20:00.. 
>
>
>
>



Re: from dired to an org file with list of files with links

2020-12-10 Thread Jean Louis
Dear Uwe,

* Uwe Brauer  [2020-12-10 22:45]:
> 
> Hi 
> 
> Suppose via dired I see
> 
>   -rw-rw-r--   1 oub oub 1003 dic 10 18:17 auto-org-md-autoloads.el
>   -rw-rw-r--   1 oub oub 2,0K dic 10 18:17 auto-org-md.el
>   -rw-rw-r--   1 oub oub 2,3K dic 10 18:17 auto-org-md.elc
>   -rw-rw-r--   1 oub oub  486 dic 10 18:17 auto-org-md-pkg.el
> 
> I'd like to create a org file
> with lists these files and there links to it
> 
> Like this
> 
> 
> [[file:.emacs.d/elpa/auto-org-md-20180213.2343/auto-org-md-autoloads.el][outo-org-md-autoloads.el]]
> [[file:.emacs.d/elpa/auto-org-md-20180213.2343/auto-org-md.el][outo-org-md.el]]
> [[file:.emacs.d/elpa/auto-org-md-20180213.2343/auto-org-md.el][outo-org-md.el]]
> [[file:.emacs.d/elpa/auto-org-md-20180213.2343/auto-org-md.elc][outo-org-md.elc]]
> [[file:.emacs.d/elpa/auto-org-md-20180213.2343/auto-org-md-pkg.elc][outo-org-md-pkg.elc]]
> 
> Anybody know whether such a functionality/package exist?

(require 'dired-x)

(defun dired-to-org-links ()
  "Generates Org links for Dired files and stores in memory. Yank
it in other buffer"
  (interactive)
  (let* ((files (dired-get-marked-files)))
(when files
  (kill-new
   (with-temp-buffer
 (dolist (file files)
   (let* ((base (file-name-nondirectory file))
  (link (format "[[file:%s][%s]]\n" file base)))
 (insert link)))
 (buffer-string))



[one pkf found] (was: from dired to an org file with list of files with links)

2020-12-10 Thread Uwe Brauer
>>> "UB" == Uwe Brauer  writes:

> Hi 

> Suppose via dired I see

>   -rw-rw-r--   1 oub oub 1003 dic 10 18:17 auto-org-md-autoloads.el
>   -rw-rw-r--   1 oub oub 2,0K dic 10 18:17 auto-org-md.el
>   -rw-rw-r--   1 oub oub 2,3K dic 10 18:17 auto-org-md.elc
>   -rw-rw-r--   1 oub oub  486 dic 10 18:17 auto-org-md-pkg.el

> I'd like to create a org file
> with lists these files and there links to it

> Like this


> [[file:.emacs.d/elpa/auto-org-md-20180213.2343/auto-org-md-autoloads.el][outo-org-md-autoloads.el]]
> [[file:.emacs.d/elpa/auto-org-md-20180213.2343/auto-org-md.el][outo-org-md.el]]
> [[file:.emacs.d/elpa/auto-org-md-20180213.2343/auto-org-md.el][outo-org-md.el]]
> [[file:.emacs.d/elpa/auto-org-md-20180213.2343/auto-org-md.elc][outo-org-md.elc]]
> [[file:.emacs.d/elpa/auto-org-md-20180213.2343/auto-org-md-pkg.elc][outo-org-md-pkg.elc]]

> Anybody know whether such a functionality/package exist?
It seems that 
https://github.com/JayDugger/.emacs.d/blob/master/el-get/org-fstree/org-fstree.el

Does what I want. That pkg is 8 years old maybe there is a more recent
pkg with a similar feature?

Regards

Uwe Brauer 


smime.p7s
Description: S/MIME cryptographic signature


Re: Unhealthy Haskell babel

2020-12-10 Thread Lawrence Bottorff
Yes -- and I think I came across this long ago during another attempt and
totally forgot about it. I think I'll write this up on emacs.stackexchange
so others will not have to scrounge around. I'm pursuing this because I
really believe emacs org-mode "reproducible research" is superior to all
other methods so far.

On Thu, Dec 10, 2020 at 12:40 PM Immanuel Litzroth <
immanuel.litzr...@gmail.com> wrote:

> Well another possible solution is to wrap the code blocks in
> :{
> xxx
> :}
> in
> (defun org-babel-execute:haskell (body params) -- ob-haskell.el
> Immanuel
>
> On Thu, Dec 10, 2020 at 6:21 PM Lawrence Bottorff 
> wrote:
> >
> > I see your point, i.e., compiled, multi-file projects are not really
> meant for the REPL-dominant world of org-mode babel. Babel's sweet-spot
> would be the interpreted world, the very best probably a Lisp language.
> Still, the ability to add code to a running REPL should be possible. As I
> mentioned, SML is a sibling of Haskell and its babel implementation worked
> fine for me as I worked through an SML course. So yes, this appears to be a
> Haskell REPL issue. I'm just a beginner with Haskell, and all my intro
> texts start you out using the ghci REPL interactively. But then they switch
> you over to a text file compiled in the REPL with :l myfile.hs . . . no
> explanation as to why you can't just continue with the REPL putting the
> program in line-by-line. The fact that I can use the :set +m to include
> multiple lines of code, but cannot do a type definition is rather bizarre,
> though. This is a decision Haskell made with their REPL and babel really
> can't do much about it, I suppose. The Haskell .lhs literate option is
> interesting. Yes, I'd like to see your tangle option, please.
> >
> > On Thu, Dec 10, 2020 at 4:28 AM Immanuel Litzroth <
> immanuel.litzr...@gmail.com> wrote:
> >>
> >> I don't think org-babel is a good fit for compiled languages. If the
> >> idea is to just take 1 snippet,
> >> and "execute" that it means that to have a consistent whole you'd need
> >> to put all the modules of
> >> your program into that snippet (already impossible in Haskell, you can
> >> have only 1 module per file),
> >> compile that, run the resulting binary. Or org mode would have to have
> >> some idea of what needs to
> >> be retangled & rebuilt.
> >> I think that using org-babel for compiled, multifile languages will
> >> only work in very simple cases -- and
> >> even then.. -- but will lead to problems very soon.
> >> Immanuel
> >>
> >> On Thu, Dec 10, 2020 at 4:21 AM Lawrence Bottorff 
> wrote:
> >> >
> >> > I'm looking into Haskell (latest ghci) again on org-mode. This
> >> >
> >> > #+begin_src haskell :results verbatim :exports both
> >> > :set +m
> >> > doubleSmallNumber x = if x > 100
> >> >   then x
> >> >   else x*2
> >> > #+end_src
> >> >
> >> > works, but still the :set +m is necessary for it to see the whole.
> But this
> >> >
> >> > #+begin_src haskell :results verbatim :exports both
> >> > :set +m
> >> > factorial :: Int -> Int
> >> > factorial 0 = 1
> >> > factorial n = n * factorial (n - 1)
> >> > #+end_src
> >> >
> >> > results in this on the REPL side:
> >> >
> >> > Prelude> :set +m
> >> > factorial :: Int -> Int
> >> > factorial 0 = 1
> >> > factorial n = n * factorial (n - 1)
> >> > "org-babel-haskell-eoe"
> >> > Prelude>
> >> > :26:1-23: error:
> >> > • No instance for (Show (Int -> Int)) arising from a use of
> ‘print’
> >> > (maybe you haven't applied a function to enough arguments?)
> >> > • In a stmt of an interactive GHCi command: print it
> >> > Prelude> Prelude> Prelude> "org-babel-haskell-eoe"
> >> >
> >> > which is the same behavior if I try to feed the program into the REPL
> one line at a time, i.e.,
> >> >
> >> > Prelude> factorial :: Int -> Int
> >> >
> >> > :40:1-23: error:
> >> > • No instance for (Show (Int -> Int)) arising from a use of
> ‘print’
> >> > (maybe you haven't applied a function to enough arguments?)
> >> > • In a stmt of an interactive GHCi command: print it
> >> >
> >> > So the :set +m trick (take multiple lines) doesn't help here.
> Obviously, Haskell is not ready to be used with Babel. Can it be fixed?
> BTW, this does work with the regular ghci REPL and haskell-mode. If it
> helps, Standard ML, which has very similar syntax (it was Haskell's
> parent), works fine.
> >> >
> >> > LB
> >>
> >>
> >>
> >> --
> >> -- Researching the dual problem of finding the function that has a
> >> given point as fixpoint.
>
>
>
> --
> -- Researching the dual problem of finding the function that has a
> given point as fixpoint.
>


Re: org-table change time from UTC to other timezones

2020-12-10 Thread Tim Cross


Alan E. Davis  writes:

> I am close to throwing in the towel.
>
> Thank you for the suggestion.  Several problems have been encountered.  I
> wonder whether I understand this tool at all.   If I subtract 10:00 from
> 08:46, the answer given is -01:14.  I used #+TBLFM: $6=$4+$5;U, as follows
> (please forgive the formatting):
>
> | Phenom |   Date | DoW |   UTC |Hrs |   ChST |   |
> |++-+---+++---|
> | ApoG   | 22 | Fr  | 06:44 | -10:00 | -03:16 |   |
> |++-+---+++---|
>   #+TBLFM: $6=$4+$5;U
>
> When I add 10:00, I think the values are sensible: 21:45 + 10:00 = 31:45.
>

What did you expect for 8:46 - 10:00? Looks correct to me or were you
expecting 22:46 (24:00 - 01:14)? This would mean 21:45 + 10:00 should be
07:45. I think when your working with times like this, you need to
include the date to help make sense of the result.

> Another problem was in trying to use an inactive org timestamp.  It was not
> straightforward to add or subtract N hours (say, 08:00).
>

You probably need to use the ort-timestamp-to-time and
org-timestmap-from-time to convert the timestamp to a 'time' value (I
suspect it uses either ms or sec since epoch as the base).  Convert to
time, add/subtract offset, convert back to inactive timestamp.

> This it a thornier problem than I had envisioned, anyway, because in locale
> with time zones, the conversion factor will change at some point DURING the
> month.
>
> Perhaps there is a calc procedure to convert time zones that will take into
> account the system's knowledge of the timezones as well as changes to/from
> Daylight Time.
>
> For now,
>

The big pain with working on time and timezones is the daylight savings
complication. This is really tricky because the start and end date tend
to be influenced by politics (I've seen DST change because of some
event, like Olympic games or to coincide with easter holiday etc) and
some states/geographies may decide not to use DST while others do (for
example, in Australia, some states have DST and some don't - so for half
the year, all the eastern states have the same timezone, but then for
half the year, 3 are the same and one is different).

There is some information in the calendar section of the emacs manual
which might be useful and it does have a section on working with DST
(I've not read it). In addition to the org mode functions to manipulate
dates and times, there are also various elisp functions you can also
use.

It is a thorny problem because of the edge cases, but the basic
functions are all there. Your best bet is to probably write a function
which accepts a full date+time and UTC offset in minutes which returns a
new date+time value and then call that function in your table formula.
--
Tim Cross



from dired to an org file with list of files with links

2020-12-10 Thread Uwe Brauer


Hi 

Suppose via dired I see

  -rw-rw-r--   1 oub oub 1003 dic 10 18:17 auto-org-md-autoloads.el
  -rw-rw-r--   1 oub oub 2,0K dic 10 18:17 auto-org-md.el
  -rw-rw-r--   1 oub oub 2,3K dic 10 18:17 auto-org-md.elc
  -rw-rw-r--   1 oub oub  486 dic 10 18:17 auto-org-md-pkg.el

I'd like to create a org file
with lists these files and there links to it

Like this


[[file:.emacs.d/elpa/auto-org-md-20180213.2343/auto-org-md-autoloads.el][outo-org-md-autoloads.el]]
[[file:.emacs.d/elpa/auto-org-md-20180213.2343/auto-org-md.el][outo-org-md.el]]
[[file:.emacs.d/elpa/auto-org-md-20180213.2343/auto-org-md.el][outo-org-md.el]]
[[file:.emacs.d/elpa/auto-org-md-20180213.2343/auto-org-md.elc][outo-org-md.elc]]
[[file:.emacs.d/elpa/auto-org-md-20180213.2343/auto-org-md-pkg.elc][outo-org-md-pkg.elc]]

Anybody know whether such a functionality/package exist?

Thanks 

Uwe Brauer 




Re: Unhealthy Haskell babel

2020-12-10 Thread Immanuel Litzroth
Well another possible solution is to wrap the code blocks in
:{
xxx
:}
in
(defun org-babel-execute:haskell (body params) -- ob-haskell.el
Immanuel

On Thu, Dec 10, 2020 at 6:21 PM Lawrence Bottorff  wrote:
>
> I see your point, i.e., compiled, multi-file projects are not really meant 
> for the REPL-dominant world of org-mode babel. Babel's sweet-spot would be 
> the interpreted world, the very best probably a Lisp language. Still, the 
> ability to add code to a running REPL should be possible. As I mentioned, SML 
> is a sibling of Haskell and its babel implementation worked fine for me as I 
> worked through an SML course. So yes, this appears to be a Haskell REPL 
> issue. I'm just a beginner with Haskell, and all my intro texts start you out 
> using the ghci REPL interactively. But then they switch you over to a text 
> file compiled in the REPL with :l myfile.hs . . . no explanation as to why 
> you can't just continue with the REPL putting the program in line-by-line. 
> The fact that I can use the :set +m to include multiple lines of code, but 
> cannot do a type definition is rather bizarre, though. This is a decision 
> Haskell made with their REPL and babel really can't do much about it, I 
> suppose. The Haskell .lhs literate option is interesting. Yes, I'd like to 
> see your tangle option, please.
>
> On Thu, Dec 10, 2020 at 4:28 AM Immanuel Litzroth 
>  wrote:
>>
>> I don't think org-babel is a good fit for compiled languages. If the
>> idea is to just take 1 snippet,
>> and "execute" that it means that to have a consistent whole you'd need
>> to put all the modules of
>> your program into that snippet (already impossible in Haskell, you can
>> have only 1 module per file),
>> compile that, run the resulting binary. Or org mode would have to have
>> some idea of what needs to
>> be retangled & rebuilt.
>> I think that using org-babel for compiled, multifile languages will
>> only work in very simple cases -- and
>> even then.. -- but will lead to problems very soon.
>> Immanuel
>>
>> On Thu, Dec 10, 2020 at 4:21 AM Lawrence Bottorff  wrote:
>> >
>> > I'm looking into Haskell (latest ghci) again on org-mode. This
>> >
>> > #+begin_src haskell :results verbatim :exports both
>> > :set +m
>> > doubleSmallNumber x = if x > 100
>> >   then x
>> >   else x*2
>> > #+end_src
>> >
>> > works, but still the :set +m is necessary for it to see the whole. But this
>> >
>> > #+begin_src haskell :results verbatim :exports both
>> > :set +m
>> > factorial :: Int -> Int
>> > factorial 0 = 1
>> > factorial n = n * factorial (n - 1)
>> > #+end_src
>> >
>> > results in this on the REPL side:
>> >
>> > Prelude> :set +m
>> > factorial :: Int -> Int
>> > factorial 0 = 1
>> > factorial n = n * factorial (n - 1)
>> > "org-babel-haskell-eoe"
>> > Prelude>
>> > :26:1-23: error:
>> > • No instance for (Show (Int -> Int)) arising from a use of ‘print’
>> > (maybe you haven't applied a function to enough arguments?)
>> > • In a stmt of an interactive GHCi command: print it
>> > Prelude> Prelude> Prelude> "org-babel-haskell-eoe"
>> >
>> > which is the same behavior if I try to feed the program into the REPL one 
>> > line at a time, i.e.,
>> >
>> > Prelude> factorial :: Int -> Int
>> >
>> > :40:1-23: error:
>> > • No instance for (Show (Int -> Int)) arising from a use of ‘print’
>> > (maybe you haven't applied a function to enough arguments?)
>> > • In a stmt of an interactive GHCi command: print it
>> >
>> > So the :set +m trick (take multiple lines) doesn't help here. Obviously, 
>> > Haskell is not ready to be used with Babel. Can it be fixed? BTW, this 
>> > does work with the regular ghci REPL and haskell-mode. If it helps, 
>> > Standard ML, which has very similar syntax (it was Haskell's parent), 
>> > works fine.
>> >
>> > LB
>>
>>
>>
>> --
>> -- Researching the dual problem of finding the function that has a
>> given point as fixpoint.



-- 
-- Researching the dual problem of finding the function that has a
given point as fixpoint.



Re: Unhealthy Haskell babel

2020-12-10 Thread Lawrence Bottorff
I see your point, i.e., compiled, multi-file projects are not really meant
for the REPL-dominant world of org-mode babel. Babel's sweet-spot would be
the interpreted world, the very best probably a Lisp language. Still, the
ability to add code to a running REPL should be possible. As I mentioned,
SML is a sibling of Haskell and its babel implementation worked fine for me
as I worked through an SML course. So yes, this appears to be a Haskell
REPL issue. I'm just a beginner with Haskell, and all my intro texts start
you out using the ghci REPL interactively. But then they switch you over to
a text file compiled in the REPL with :l myfile.hs . . . no explanation as
to why you can't just continue with the REPL putting the program in
line-by-line. The fact that I can use the :set +m to include multiple lines
of code, but cannot do a type definition is rather bizarre, though. This is
a decision Haskell made with their REPL and babel really can't do much
about it, I suppose. The Haskell .lhs literate option is interesting. Yes,
I'd like to see your tangle option, please.

On Thu, Dec 10, 2020 at 4:28 AM Immanuel Litzroth <
immanuel.litzr...@gmail.com> wrote:

> I don't think org-babel is a good fit for compiled languages. If the
> idea is to just take 1 snippet,
> and "execute" that it means that to have a consistent whole you'd need
> to put all the modules of
> your program into that snippet (already impossible in Haskell, you can
> have only 1 module per file),
> compile that, run the resulting binary. Or org mode would have to have
> some idea of what needs to
> be retangled & rebuilt.
> I think that using org-babel for compiled, multifile languages will
> only work in very simple cases -- and
> even then.. -- but will lead to problems very soon.
> Immanuel
>
> On Thu, Dec 10, 2020 at 4:21 AM Lawrence Bottorff 
> wrote:
> >
> > I'm looking into Haskell (latest ghci) again on org-mode. This
> >
> > #+begin_src haskell :results verbatim :exports both
> > :set +m
> > doubleSmallNumber x = if x > 100
> >   then x
> >   else x*2
> > #+end_src
> >
> > works, but still the :set +m is necessary for it to see the whole. But
> this
> >
> > #+begin_src haskell :results verbatim :exports both
> > :set +m
> > factorial :: Int -> Int
> > factorial 0 = 1
> > factorial n = n * factorial (n - 1)
> > #+end_src
> >
> > results in this on the REPL side:
> >
> > Prelude> :set +m
> > factorial :: Int -> Int
> > factorial 0 = 1
> > factorial n = n * factorial (n - 1)
> > "org-babel-haskell-eoe"
> > Prelude>
> > :26:1-23: error:
> > • No instance for (Show (Int -> Int)) arising from a use of ‘print’
> > (maybe you haven't applied a function to enough arguments?)
> > • In a stmt of an interactive GHCi command: print it
> > Prelude> Prelude> Prelude> "org-babel-haskell-eoe"
> >
> > which is the same behavior if I try to feed the program into the REPL
> one line at a time, i.e.,
> >
> > Prelude> factorial :: Int -> Int
> >
> > :40:1-23: error:
> > • No instance for (Show (Int -> Int)) arising from a use of ‘print’
> > (maybe you haven't applied a function to enough arguments?)
> > • In a stmt of an interactive GHCi command: print it
> >
> > So the :set +m trick (take multiple lines) doesn't help here. Obviously,
> Haskell is not ready to be used with Babel. Can it be fixed? BTW, this does
> work with the regular ghci REPL and haskell-mode. If it helps, Standard ML,
> which has very similar syntax (it was Haskell's parent), works fine.
> >
> > LB
>
>
>
> --
> -- Researching the dual problem of finding the function that has a
> given point as fixpoint.
>


Re: stability of toc links

2020-12-10 Thread TEC


> There are a few touch ups I'll do to my code shortly

I'm pleased to say that I've improved the readability and documentation
of my code (hopefully) in
https://github.com/tecosaur/emacs-config/commit/dc873d3

I hope this may be of some help,

Timothy



Re: stability of toc links

2020-12-10 Thread TEC


Carsten Dominik  writes:

> Yes, I mean this code, or something like this, to aid the automatic
> creation of links that are somewhat stable.  I have been missing this very
> much.

Hi Carsten, glad to hear that there /does/ seem to be interest in this after 
all :)

A few things worth saying I think:
- I'm quite happy with the idea of my code being used verbatim, with any
  modifications others think are a good idea (of course)
- I am have FSF assignment, and the repo is MIT licensed already. In
case it needs saying, I'm quite happy to waive any annoying licence
terms (inclusion of copyright notice is the only thing that comes to
mind) for any code that may be used in Org.
- There are a few touch ups I'll do to my code shortly

All the best,

Timothy.



Re: [PATCH] org-plot abstractions and extension

2020-12-10 Thread Bastien
Hi Timothy,

TEC  writes:

> It's now been 1.5 months, so I'm going to bump this thread.

Sure - thanks for bumping this.

I'm slowly reading emails from the past weeks, I will handle
this ASAP.

Thanks,

-- 
 Bastien



Re: Unhealthy Haskell babel

2020-12-10 Thread Immanuel Litzroth
I don't think org-babel is a good fit for compiled languages. If the
idea is to just take 1 snippet,
and "execute" that it means that to have a consistent whole you'd need
to put all the modules of
your program into that snippet (already impossible in Haskell, you can
have only 1 module per file),
compile that, run the resulting binary. Or org mode would have to have
some idea of what needs to
be retangled & rebuilt.
I think that using org-babel for compiled, multifile languages will
only work in very simple cases -- and
even then.. -- but will lead to problems very soon.
Immanuel

On Thu, Dec 10, 2020 at 4:21 AM Lawrence Bottorff  wrote:
>
> I'm looking into Haskell (latest ghci) again on org-mode. This
>
> #+begin_src haskell :results verbatim :exports both
> :set +m
> doubleSmallNumber x = if x > 100
>   then x
>   else x*2
> #+end_src
>
> works, but still the :set +m is necessary for it to see the whole. But this
>
> #+begin_src haskell :results verbatim :exports both
> :set +m
> factorial :: Int -> Int
> factorial 0 = 1
> factorial n = n * factorial (n - 1)
> #+end_src
>
> results in this on the REPL side:
>
> Prelude> :set +m
> factorial :: Int -> Int
> factorial 0 = 1
> factorial n = n * factorial (n - 1)
> "org-babel-haskell-eoe"
> Prelude>
> :26:1-23: error:
> • No instance for (Show (Int -> Int)) arising from a use of ‘print’
> (maybe you haven't applied a function to enough arguments?)
> • In a stmt of an interactive GHCi command: print it
> Prelude> Prelude> Prelude> "org-babel-haskell-eoe"
>
> which is the same behavior if I try to feed the program into the REPL one 
> line at a time, i.e.,
>
> Prelude> factorial :: Int -> Int
>
> :40:1-23: error:
> • No instance for (Show (Int -> Int)) arising from a use of ‘print’
> (maybe you haven't applied a function to enough arguments?)
> • In a stmt of an interactive GHCi command: print it
>
> So the :set +m trick (take multiple lines) doesn't help here. Obviously, 
> Haskell is not ready to be used with Babel. Can it be fixed? BTW, this does 
> work with the regular ghci REPL and haskell-mode. If it helps, Standard ML, 
> which has very similar syntax (it was Haskell's parent), works fine.
>
> LB



-- 
-- Researching the dual problem of finding the function that has a
given point as fixpoint.



New startup options, showlevels

2020-12-10 Thread Gustav Wikström
Prompted by a question on StackOverflow, 
https://stackoverflow.com/questions/56536184/set-initial-visiblity-to-a-certain-level-in-org-mode,
 a few new options are added to the startup setting.

Patch is applied to master as this is non-critical and it is communicated here 
and now for full transparency. See commit hash a71ac14e4, 
https://code.orgmode.org/bzg/org-mode/commit/a71ac14e46bb820abdbd2e6651c58179c50eb2fa

Hope these new options will be usable for some of you!

Kind Regards
Gustav


Re: stability of toc links

2020-12-10 Thread Carsten Dominik
On Wed, Dec 9, 2020 at 10:25 PM Samuel Wales  wrote:

> just so everybody is on the same page, i think carsten is talking
> about tec's code that generates html id's that are then used in urls?
>

Yes, I mean this code, or something like this, to aid the automatic
creation of links that are somewhat stable.  I have been missing this very
much.

Kind regards

Carsten


>
> imo great idea.
>
>
> On 12/9/20, Carsten Dominik  wrote:
> > I think we should merge this code into Org.
> >
> > Kind regards
> >
> > Carsten
> >
> > On Wed, Dec 9, 2020 at 3:54 AM TEC  wrote:
> >
> >>
> >> Hi Sam, link stability is a concern I've had too. I currently have a fix
> >> (or at the very least, an improvement) for this in my config where I
> >> overwrite org-export-get-reference. (see:
> >>
> https://eur04.safelinks.protection.outlook.com/?url=https%3A%2F%2Ftecosaur.github.io%2Femacs-config%2Fconfig.html%23nicer-generated-headingdata=04%7C01%7Cc.dominik%40uva.nl%7C64cff9b5261046b136f808d89c88ebcf%7Ca0f1cacd618c4403b94576fb3d6874e5%7C1%7C0%7C637431459175966570%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000sdata=jE5t3HVjViPeswx%2BQP7Qe0kdrHTZaS3r4WByndfU71g%3Dreserved=0
> >> ).
> >>
> >> I raised this on the list a while ago ---
> >>
> https://eur04.safelinks.protection.outlook.com/?url=https%3A%2F%2Forgmode.org%2Flist%2FE1jxAjq-0004Dk-LH%40lists.gnu.org%2Fdata=04%7C01%7Cc.dominik%40uva.nl%7C64cff9b5261046b136f808d89c88ebcf%7Ca0f1cacd618c4403b94576fb3d6874e5%7C1%7C0%7C637431459175966570%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000sdata=%2Fpl%2BCWuuwqY2voqj0VZpu0MCqniow5%2FRjixB8SycDUM%3Dreserved=0
> but there
> >> didn't seem to be much interest.
> >>
> >> All the best,
> >> Timothy
> >>
> >> Samuel Wales  writes:
> >>
> >> > when you link to a section using toc, you get a link like
> >> >
> >> >
> >>
> https://eur04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fthekafkapandemic.blogspot.com%2F2020%2F02%2Fcrimes-against-humanity_3.html%23org080f0abdata=04%7C01%7Cc.dominik%40uva.nl%7C64cff9b5261046b136f808d89c88ebcf%7Ca0f1cacd618c4403b94576fb3d6874e5%7C1%7C0%7C637431459175966570%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000sdata=nHDQx0BMqTeDGLt3OFCAWcLoCrpDoWEbticHf9NT1ZY%3Dreserved=0
> >> >
> >> > will these links break if somebody copies them and pastes them
> >> > elsewhere?  what if you add a section?
> >> >
> >> > there doesn't seem to be a perfect solution, short of adding custom id
> >> > or id to everything, but perhaps a fuzzy hash of the header and
> >> > contents of the section could be used?  or a strict hash of the
> >> > header?  is anything like this being done?  just curious.
> >>
> >>
> >>
> >
>
>
> --
> The Kafka Pandemic
>
> Please learn what misopathy is.
>
> https://eur04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fthekafkapandemic.blogspot.com%2F2013%2F10%2Fwhy-some-diseases-are-wronged.htmldata=04%7C01%7Cc.dominik%40uva.nl%7C64cff9b5261046b136f808d89c88ebcf%7Ca0f1cacd618c4403b94576fb3d6874e5%7C1%7C0%7C637431459175966570%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000sdata=db%2FAmlA1knJ%2Bph6jM%2B6AvXND%2BdMT8YFpmmcT33kqJrg%3Dreserved=0
>


Re: org-table change time from UTC to other timezones

2020-12-10 Thread Alan E. Davis
I am close to throwing in the towel.

Thank you for the suggestion.  Several problems have been encountered.  I
wonder whether I understand this tool at all.   If I subtract 10:00 from
08:46, the answer given is -01:14.  I used #+TBLFM: $6=$4+$5;U, as follows
(please forgive the formatting):

| Phenom |   Date | DoW |   UTC |Hrs |   ChST |   |
|++-+---+++---|
| ApoG   | 22 | Fr  | 06:44 | -10:00 | -03:16 |   |
|++-+---+++---|
  #+TBLFM: $6=$4+$5;U

When I add 10:00, I think the values are sensible: 21:45 + 10:00 = 31:45.

Another problem was in trying to use an inactive org timestamp.  It was not
straightforward to add or subtract N hours (say, 08:00).

This it a thornier problem than I had envisioned, anyway, because in locale
with time zones, the conversion factor will change at some point DURING the
month.

Perhaps there is a calc procedure to convert time zones that will take into
account the system's knowledge of the timezones as well as changes to/from
Daylight Time.

For now,

On Wed, Dec 9, 2020 at 3:40 AM Tim Cross  wrote:

>
> Alan E. Davis  writes:
>
> > I have been pleased to learn that I can add / subtract hours in org-table
> > to shift time zones.  I am making tables of  lunar/solar parameters
> > relevant to tides.  Org-table is a convenient way to enter data in a
> > tabular format that can be printed via LaTeX.  So each year, for several
> > time zones, I enter these times by hand.
> >
> > It's very, very easy, I have learned, to collect all of these times (at
> > most, maybe 12 per month) for UTC, and add or subtract to generate a
> column
> > of times for a new time zone.  Very Slick!
> >
> > Except that when I add, for example. 09:00 to 23:33, I guess it is pretty
> > obvious what is going to happen: it would be the same day, but at 32:33
> !!
> >
> > I have tripped up on trying to test for whether the sum is greater than
> or
> > equal to 24:00, and then doing something interesting with it.  It's
> > actually pretty easy to go through all the months and find the
> exceptions,
> > and make manual changes.  But, as I usually have done, I would rather
> spend
> > a few hours coming up with some programmatic method for making this work
> > automatically!
> >
> > The other problem is the change of the day.  I suppose I could use 0, 1,
> > 2... for Sunday, Monday, Tuesday...  (I am living in the United States).
> >
> > Has someone solved this problem?
> >
>
> Org tables support formulas which use the Emacs 'calc' program. Calc has
> pretty good support for adding, subtracting, multiplying and otherwise
> manipulating dates and times (this is how the org clocktable works). It
> should be pretty straight forward to have a column of date + time
> values, a time offset representing a timezone and a 3rd column which is
> the new date/time after applying the offset. Have a look at the secton
> in the org manual on table formulas and the calc manual in info.
>
> --
> Tim Cross
>
>

-- 
  "This ignorance about the limits of the earth's ability to absorb
   pollutants should be reason enough for caution in the release
   of polluting substances."
   ---Meadows et al.   1972.  Limits to Growth
.
(p. 81)