[O] org-compat needed for org-gnus?

2014-02-10 Thread Tim Landscheidt
Hi,

I recently made the jump to install my first ELPA package
because capture wasn't available in Emacs 24.3.1's org-mode,
and installed org 20140130.

Today I tried working with links to Gnus and they failed
(No match - create this as a new heading?).  So I looked
around and tried M-x load-library org-gnus RET which failed
with byte-code: Symbol's function definition is void:
org-defvaralias.

Further grepping led to loading org-compat, then org-gnus,
and it worked.

So I'm wondering if the missing (require 'org-compat) in
org-gnus is just an oversight, or if I'm doing something
wrong?

Tim




[Orgmode] Re: [ANN] org-mac-link-grabber: Grab links from running Mac applications

2010-04-06 Thread Tim Landscheidt
Anthony Lander anthonylan...@yahoo.com wrote:

 I've put together a bit of code to grab links from open mac
 applications, and paste them at point in org documents. If
 your  workflow is spend the majority of your time in
 org-mode typing, and  occasionally grab links from other
 applications, then you might find  this useful.

 It's available as a git repository here: 
 http://github.com/alander/org-mac-link-grabber

 Right now it supports the following applications:

   - Finder.app
   - Mail.app
   - Address Book.app
   - Firefox.app
   - Together.app

 It's easy to add more, but I started here because these are
 the ones I use. There is a readme file that explains
 installation, usage and  configuration.

 The code uses the same method as org-mac-message by
 Christopher Suckling and John Weigley, and indeed simply
 wraps it for the Mail.app  integration.

Nice idea. Has anyone worked on something similar for Linux?
Konqueror seems to be queryable with Emacs' D-Bus; has Fire-
fox similar interfaces?

Tim



___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


[Orgmode] Re: Feasibility investigation: org-mode paper

2010-04-26 Thread Tim Landscheidt
Torsten Wagner torsten.wag...@gmail.com wrote:

 [...]
 As I said it is just a silly idea, maybe not really useful
 but I thought it would be at least nice to make a
 proof-of-principle. Finally, with the increase of ebook
 readers with touch screens, digital pens, tablets and
 netbooks with touchscreens, this might become even more
 interesting.

 Happy to hear any opinion.

Not wanting to call it silly :-), but I think the major ad-
vantage of any electronic thingy compared to pen and paper
is that you can rearrange the structure and correct any mis-
takes you make. I wouldn't want to have to pen down any text
without this capability.

Tim



___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


[Orgmode] Re: Gmane readers - please subscribe

2010-04-27 Thread Tim Landscheidt
Ben Finney ben+em...@benfinney.id.au wrote:

  A large part of my reason for reading via Gmane is to avoid yet
  another set of authentication credentials. Especially one that I
  never use; that's a security nightmare waiting to happen. So I'm not
  interested in increasing my security exposure by making a Mailman
  account on yet another site.

 Yikes! What nightmare awaits those of us who've foolishly gone ahead
 and subscribed? What's my exposure, beyond some nefarious cracker
 impersonating me on emacs-orgmode?

 The assumption here is that logging into the mailing list account is
 something done infrequently to never for any given user. That's
 certainly the case for just about any list I've subscribed to.

 For an infrequently-to-never used passphrase, one of two things is the
 case: either it's unique, or it is identical to the passphrase that
 accesses some other set of services for the user.

 Since it's an infrequently-to-never accessed service, it's an
 unreasonable burden to expect the user to maintain unique passphrases
 for every such service. If for this list, why not for every such list?

 So what usually ends up happening is they're identical for a given
 person across many different services. But the more that's the case, the
 greater the exposure: any one of those services could manage their
 security poorly, or simply be unlucky enough to attract a bored and/or
 motivated cracker; and a compromise on any one of them removes any
 expectation of security on any of the rest of the services where the
 user has the same passphrase.

 The sensible policy, therefore, is to cull the proliferation of such
 passphrase-requiring infrequently-to-never-accessed accounts. Which, in
 turn, means saying a polite “no thank you” to most requests to set up
 new accounts.

The common policy, however, is that you subscribe to the
mailing list with the defaults, use the automatically gener-
ated password to set the account to no mail and never
bother again. Some mailing lists will send you a reminder of
your account's subscriptions once a month, some not even
that. And should you really ever need to access your ac-
count's configuration, you can always use the lost pass-
word link.

Tim



___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


[O] "Show Org source" on http://orgmode.org/worg/ does not work

2017-05-18 Thread Tim Landscheidt
Hi,

if I click (for example) on http://orgmode.org/worg/ on the
button "Show Org source", nothing happens.  The browser con-
sole shows that "show_org_source is not defined".

If that is non-trivial to fix, removing the button ad inter-
im would be an option as well.

Tim




Re: [O] Public TODO agendas

2017-11-21 Thread Tim Landscheidt
Tim Cross  wrote:

> I don't think tramp will work in this way, at least not without some
> sort of special client running on the remote http server and
> modifications to tramp to work with that client. The HTTP protocol will
> not easily fit with tramp - in fact, it is such a big 'disconnect'
> between tramp and http, you really would be trying to push a round peg
> into a square hole. It would be far easier to use other built-in bits of
> Emacs functionality along with some sort of remote http service agent to
> satisfy this use case (assuming you want bi-directional updates
> i.e. pull down an org file, update and push back up - just pulling down
> the file and appending it would be easy enough, but going the other way
> adds a lot of additional complexity).

> […]

To point out what "easy enough" in Emacs means (for
read-only access): M-x url-handler-mode RET, C-x C-f
http://www.gnu.org/software/emacs/ RET :-).

Tim




[O] Bug: Broken orgmode.org links in doc/misc/org.texi and lisp/org

2018-01-07 Thread Tim Landscheidt
(All links to http://orgmode.org/ should be updated to
https://orgmode.org/ and a slash should be added to
https://orgmode.org/worg/org-contrib/babel to avoid a
redirect.)

The following links in Emacs master's doc/misc/org.texi and
lisp/org are broken (404):

- https://orgmode.org/org-remember.pdf
- https://orgmode.org/worg/code/org-info-js/
- https://orgmode.org/worg/org-contrib/babel/languages.html
- https://orgmode.org/worg/org-contrib/babel/languages/ob-doc-lilypond.html
- https://orgmode.org/worg/org-contrib/babel/languages/ob-doc-stan.html



[O] Documentation references to htmlize and htmlize vs. htmlfontify

2018-01-08 Thread Tim Landscheidt
Hi,

the Org Mode Manual (here: Emacs master's 9.1.4) refers to
htmlize in several places in slightly different ways; for
example, in one place it says:

| This works automatically for the HTML back-end (it requires
| version 1.34 of the ‘htmlize.el’ package, which you need to
| install).

This is problematic as 1.34 does not work with Emacs 23+;
also it could be interpreted as saying that (current) ver-
sion 1.51 is not supported.

Additionally, there is confusing language throughout whether
it is called "htmlize" or "htmlize.el", whether it is a file
or a package, and whether one needs to download it from the
author's GitHub page.  I assume for most users it is prefer-
able to install it using the MELPA or Debian package.

I wanted to propose to move instructions on how to install
htmlize to the "Installation" node and refer to that section
everywhere else until I noted the section "Packages that Org
cooperates with" that on the other hand does not list
htmlize :-).

There may be other packages referenced in this inconsistent
way; it would be nice to have them all in one place ("Pack-
ages that Org cooperates with"?) and use uniform language.

Finally, Emacs already ships with htmlfontify.  On (non-Org)
files, I see small, but not significant differences between
it and htmlize.  Are there features that only htmlize of-
fers?  Otherwise it would be very convenient to replace
calls to htmlize with a wrapper that tests if the user set
some configurable variable org-htmlize-function (and calls
that), otherwise tries to load htmlize and use that, and
falls back to using htmlfontify.  Glancing at the code, org-
mode seems to use htmlize-region (with (point-min) (point-
max), but on narrowed buffers) which htmlfontify does not
offer, but it is unclear to me whether that would kill 100 %
of all use cases or only some.  (If it works out of the box
with htmlfontify for the most common ones, IMHO that would
be preferable to the current situation where it does not
work at all unless one installs htmlize.)

Tim




[O] Test test-org/timestamp-from-time fails on Fedora 26/Debian Jessie

2018-01-16 Thread Tim Landscheidt
On Fedora 26/Emacs 25.3.1 and Debian Jessie/Emacs 24.4.1,
test-org/timestamp-from-time fails with:

| Test test-org/timestamp-from-time backtrace:
|   (if (unwind-protect (setq value-14556 (apply fn-14554 args-14555)) (
|   (let (form-description-14558) (if (unwind-protect (setq value-14556
|   (let ((value-14556 (quote ert-form-evaluation-aborted-14557))) (let
|   (let ((fn-14554 (function equal)) (args-14555 (list "<2012-03-29 Thu
|   (lambda nil (let ((fn-14554 (function equal)) (args-14555 (list "<20
|   ert--run-test-internal([cl-struct-ert--test-execution-info [cl-struc
|   ert-run-test([cl-struct-ert-test test-org/timestamp-from-time "Test
|   ert-run-or-rerun-test([cl-struct-ert--stats "\\(org\\|ob\\)" [[cl-st
|   ert-run-tests("\\(org\\|ob\\)" #[385 "\306\307\"\203G\211\211G\310
|   ert-run-tests-batch("\\(org\\|ob\\)")
|   ert-run-tests-batch-and-exit("\\(org\\|ob\\)")
|   (let ((org-id-track-globally t) (org-test-selector (if org-test-sele
|   org-test-run-batch-tests("\\(org\\|ob\\)")
|   eval((org-test-run-batch-tests org-test-select-re))
|   command-line-1(("--eval" "(setq vc-handled-backends nil org-startup-
|   command-line()
|   normal-top-level()
| Test test-org/timestamp-from-time condition:
| (ert-test-failed
|  ((should
|(equal "<2012-03-29 Thu>"
|   (let ... ...)))
|   :form
|   (equal "<2012-03-29 Thu>" "<2012-03-28 Wed>")
|   :value nil :explanation
|   (array-elt 10
|  (different-atoms
|   (57 "#x39" "?9")
|   (56 "#x38" "?8")
|FAILED  754/762  test-org/timestamp-from-time

Both machines run on UTC.

Tim




Re: [O] Bug: Broken orgmode.org links in doc/misc/org.texi and lisp/org

2018-01-18 Thread Tim Landscheidt
Nicolas Goaziou  wrote:

> […]

> Thank you! However, these patches do not seem to apply cleanly on maint
> tip. Could you rebase them against maint HEAD and send them again?

Sure.

> Also, if you haven't signed FSF papers, you need to add TINYCHANGE at
> the end of each commit message.

According to Emacs's CONTRIBUTE (referenced by
README_contribute), that should be
"Copyright-paperwork-exempt: yes"?  (Is
mk/make_emacs_changelog still used for anything?)

Tim




Re: [O] [PATCH] Remove obsolete mk/list-hooks.pl

2018-02-05 Thread Tim Landscheidt
Nicolas Goaziou  wrote:

>> The functionality of mk/list-hooks.pl has been implemented by mk/eldo.el.

>> * mk/list-hooks.pl: Remove.

> Are you sure list-hooks.pl isn't used?

Reasonably sure; mk/eldo.el has the same (or more) function-
ality and is referenced in README_maintainer under "Updating
the list of hooks/commands/options on Worg", while I found
nothing that mentioned mk/list-hooks.pl.

Tim



Re: [O] Purpose of mk/pw?

2018-02-05 Thread Tim Landscheidt
Nicolas Goaziou <m...@nicolasgoaziou.fr> wrote:

>> mk/pw seems to have not been touched in a long time, and
>> whatever it did, it does not seem to do it nowaways:

> [...]

>> Is it still relevant?

> No it isn't.

> […]

John confirmed that by private mail as well, so the attached
patch will remove it.

Tim
>From 7214e34e3104399035c523eaa28b33ad4498f3b2 Mon Sep 17 00:00:00 2001
From: Tim Landscheidt <t...@tim-landscheidt.de>
Date: Mon, 5 Feb 2018 14:12:16 +
Subject: [PATCH] Remove obsolete mk/pw

* mk/pw: Remove.
---
 mk/pw | 664 --
 1 file changed, 664 deletions(-)
 delete mode 100755 mk/pw

diff --git a/mk/pw b/mk/pw
deleted file mode 100755
index 13df6ea5b..0
-- 
2.13.6



Re: [O] Bug: Broken orgmode.org links in doc/misc/org.texi and lisp/org

2018-02-05 Thread Tim Landscheidt
Nicolas Goaziou  wrote:

>> Could you then please document TINYCHANGE in
>> README_contribute?  Merci!

> This is already covered at
> 

I may be biased here because I did not find that :-), but
that page is referenced in the org-mode repository only in
README_maintainer with the context:

| […]

| The list of all contributors from who we have the papers is kept on
| Worg at https://orgmode.org/worg/org-contribute.html, so that
| committers can check if a patch can go into the core.

| […]

and in etc/ORG-NEWS with the context:

| […]

| * Version 9.1

| […]

| ** Miscellaneous

| *** The Library of Babel now on Worg

| The library-of-babel.org used to be accessible from the =doc/=
| directory, distributed with Org’s core.  It is now accessible
| from the Worg community-driven documentation 
[[https://orgmode.org/worg/library-of-babel.html][here]].

| If you want to contribute to it, please see 
[[https://orgmode.org/worg/org-contribute.html][how to contribute]].

| […]

Especially, it is not linked to from README_contribute :-).

Tim




Re: [O] Bug: Broken orgmode.org links in doc/misc/org.texi and lisp/org

2018-02-05 Thread Tim Landscheidt
Nicolas Goaziou <m...@nicolasgoaziou.fr> wrote:

>> […]

>> Patch #2 makes some links to the manual and external URLs in
>> docstrings clickable.

>> […]

> Applied. Thank you.

> […]

I think you missed patch #2; I have attached it again re-
based on current maint (I removed TINYCHANGE because I have
signed papers for Emacs since then).

Tim
>From 14fa16af86dfc21e77698a36c76a4e6ac017cd49 Mon Sep 17 00:00:00 2001
From: Tim Landscheidt <t...@tim-landscheidt.de>
Date: Tue, 16 Jan 2018 16:46:46 +
Subject: [PATCH] Make manual and URL links in docstrings clickable

---
 lisp/org-table.el  | 2 +-
 lisp/ox-latex.el   | 5 ++---
 testing/lisp/test-org-table.el | 2 +-
 3 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/lisp/org-table.el b/lisp/org-table.el
index 159a4fb5c..11d42d3cb 100644
--- a/lisp/org-table.el
+++ b/lisp/org-table.el
@@ -135,7 +135,7 @@ the fixed string \"#+ORGTBL: SEND\", followed by instruction on how to
 convert the table into a data structure useful in the
 language of the buffer.  Check the manual for the section on
 \"Translator functions\", and more generally check out
-https://orgmode.org/manual/Tables-in-arbitrary-syntax.html#Tables-in-arbitrary-syntax
+the Info node `(org)Tables in arbitrary syntax'.
 
 All occurrences of %n in a template will be replaced with the name of the
 table, obtained by prompting the user."
diff --git a/lisp/ox-latex.el b/lisp/ox-latex.el
index b3fbf8e95..e612b32ca 100644
--- a/lisp/ox-latex.el
+++ b/lisp/ox-latex.el
@@ -920,15 +920,14 @@ using customize, or with
   (add-to-list \\='org-latex-packages-alist \\='(\"newfloat\" \"minted\"))
 
 In addition, it is necessary to install pygments
-\(http://pygments.org), and to configure the variable
+\(URL `http://pygments.org>'), and to configure the variable
 `org-latex-pdf-process' so that the -shell-escape option is
 passed to pdflatex.
 
 The minted choice has possible repercussions on the preview of
 latex fragments (see `org-preview-latex-fragment').  If you run
 into previewing problems, please consult
-
-  https://orgmode.org/worg/org-tutorials/org-latex-preview.html;
+URL `https://orgmode.org/worg/org-tutorials/org-latex-preview.html'."
   :group 'org-export-latex
   :type '(choice
 	  (const :tag "Use listings" t)
diff --git a/testing/lisp/test-org-table.el b/testing/lisp/test-org-table.el
index ea72ae53f..31f10f6f2 100644
--- a/testing/lisp/test-org-table.el
+++ b/testing/lisp/test-org-table.el
@@ -710,7 +710,7 @@ formatter \"%.1f\"."
 
 (ert-deftest test-org-table/org-lookup-all ()
   "Use `org-lookup-all' for several GROUP BY as in SQL and for ranking.
-See also http://orgmode.org/worg/org-tutorials/org-lookups.html ."
+See also URL `https://orgmode.org/worg/org-tutorials/org-lookups.html'."
   (let ((data "
 #+NAME: data
 | Purchase | Product | Shop | Rating |
-- 
2.13.6



[O] Purpose of mk/pw?

2018-01-17 Thread Tim Landscheidt
Hi,

mk/pw seems to have not been touched in a long time, and
whatever it did, it does not seem to do it nowaways:

| [tim@passepartout ~/src/org-mode]$ mk/pw list
| Traceback (most recent call last):
|   File "mk/pw", line 664, in 
| main()
|   File "mk/pw", line 585, in main
| action_list(rpc, filt, submitter_str, delegate_str)
|   File "mk/pw", line 190, in action_list
| filter.resolve_ids(rpc)
|   File "mk/pw", line 76, in resolve_ids
| id = state_id_by_name(rpc, self.state)
|   File "mk/pw", line 168, in state_id_by_name
| states = rpc.state_list(name, 0)
|   File "/usr/lib64/python2.7/xmlrpclib.py", line 1243, in __call__
| return self.__send(self.__name, args)
|   File "/usr/lib64/python2.7/xmlrpclib.py", line 1602, in __request
| verbose=self.__verbose
|   File "/usr/lib64/python2.7/xmlrpclib.py", line 1283, in request
| return self.single_request(host, handler, request_body, verbose)
|   File "/usr/lib64/python2.7/xmlrpclib.py", line 1331, in single_request
| response.msg,
| xmlrpclib.ProtocolError: 
| [tim@passepartout ~/src/org-mode]$

(http://patchwork.newartisans.com/ itself is 404 as well.)

Is it still relevant?  If it was some kind of patch queue,
is that aspect now sufficiently handled by
https://code.orgmode.org/bzg/org-mode/pulls?

Tim




Re: [O] Bug: Broken orgmode.org links in doc/misc/org.texi and lisp/org

2018-01-16 Thread Tim Landscheidt
Hi,

attached are five patches mostly related to the http to
https update part of my post.

Patch #1 updates only URLs from http to https that I consid-
er "uncontroversial".

Patch #2 makes some links to the manual and external URLs in
docstrings clickable.

Patch #3 updates URLs from http to https in old entries of
etc/ORG-NEWS.  There is an argument for keeping them as is,
and I have no strong opinion on that.

Patch #4 updates URLs from http to https in source code and
test cases.  These need to be reviewed more carefully, espe-
cially as there probably should remain some test cases for
http URLs.  (I get a test failure for
test-org/timestamp-from-time, but AFAICT this is unrelated.)

Patch #5 just adds a trailing slash to two links to
https://orgmode.org/worg/org-contrib/babel.

Tim
>From eb2208842b3568122ecc9f9936dc255d73b76577 Mon Sep 17 00:00:00 2001
From: Tim Landscheidt <t...@tim-landscheidt.de>
Date: Tue, 16 Jan 2018 16:22:00 +
Subject: [PATCH 1/5] Use https for links to orgmode.org

---
 Makefile |  2 +-
 README_ELPA  |  4 +-
 README_git   |  4 +-
 README_maintainer|  2 +-
 contrib/lisp/ob-csharp.el|  2 +-
 contrib/lisp/ob-eukleides.el |  2 +-
 contrib/lisp/ob-fomus.el |  2 +-
 contrib/lisp/ob-mathomatic.el|  2 +-
 contrib/lisp/ob-oz.el|  2 +-
 contrib/lisp/ob-tcl.el   |  2 +-
 contrib/lisp/ob-vbnet.el |  2 +-
 contrib/lisp/org-bibtex-extras.el|  2 +-
 contrib/lisp/org-collector.el|  2 +-
 contrib/lisp/org-contribdir.el   |  2 +-
 contrib/lisp/org-depend.el   |  2 +-
 contrib/lisp/org-effectiveness.el|  2 +-
 contrib/lisp/org-eval-light.el   |  2 +-
 contrib/lisp/org-eval.el |  2 +-
 contrib/lisp/org-index.el|  2 +-
 contrib/lisp/org-learn.el|  2 +-
 contrib/lisp/org-license.el  |  2 +-
 contrib/lisp/org-link-edit.el| 16 
 contrib/lisp/org-mairix.el   |  2 +-
 contrib/lisp/org-man.el  |  2 +-
 contrib/lisp/org-mew.el  |  2 +-
 contrib/lisp/org-notmuch.el  |  2 +-
 contrib/lisp/org-passwords.el|  2 +-
 contrib/lisp/org-screenshot.el   |  2 +-
 contrib/lisp/org-sudoku.el   |  2 +-
 contrib/lisp/org-track.el|  6 +--
 contrib/lisp/org-vm.el   |  2 +-
 contrib/lisp/org-wikinodes.el|  2 +-
 contrib/lisp/org-wl.el   |  2 +-
 contrib/lisp/ox-rss.el   |  2 +-
 contrib/scripts/org-docco.org|  6 +--
 contrib/scripts/staticmathjax/README.org |  2 +-
 doc/orgguide.texi| 70 
 etc/ORG-NEWS |  4 +-
 etc/styles/README|  2 +-
 lisp/ob-C.el |  2 +-
 lisp/ob-J.el |  2 +-
 lisp/ob-R.el |  2 +-
 lisp/ob-asymptote.el |  2 +-
 lisp/ob-awk.el   |  2 +-
 lisp/ob-calc.el  |  2 +-
 lisp/ob-clojure.el   |  2 +-
 lisp/ob-comint.el|  2 +-
 lisp/ob-coq.el   |  2 +-
 lisp/ob-core.el  |  2 +-
 lisp/ob-css.el   |  2 +-
 lisp/ob-ditaa.el |  2 +-
 lisp/ob-dot.el   |  2 +-
 lisp/ob-ebnf.el  |  2 +-
 lisp/ob-emacs-lisp.el|  2 +-
 lisp/ob-eval.el  |  2 +-
 lisp/ob-exp.el   |  2 +-
 lisp/ob-forth.el |  2 +-
 lisp/ob-fortran.el   |  2 +-
 lisp/ob-gnuplot.el   |  2 +-
 lisp/ob-groovy.el|  2 +-
 lisp/ob-haskell.el   |  2 +-
 lisp/ob-hledger.el   |  2 +-
 lisp/ob-io.el|  2 +-
 lisp/ob-java.el  |  2 +-
 lisp/ob-js.el|  2 +-
 lisp/ob-keys.el  |  2 +-
 lisp/ob-latex.el |  2 +-
 lisp/ob-ledger.el|  2 +-
 lisp/ob-lilypond.el  |  4 +-
 lisp/ob-lisp.el  |  2 +-
 lisp/ob-lob.el   |  2 +-
 lisp/ob-lua.el   |  2 +-
 lisp/ob-makefile.el  |  2 +-
 lisp/ob-matlab.el|  2 +-
 lisp/ob-maxima.el|  2 +-
 lisp/ob-mscgen.el|  2 +-
 lisp/ob-ocaml.el |  2 +-
 lisp/ob-octave.el|  2

Re: [O] Bug: Broken orgmode.org links in doc/misc/org.texi and lisp/org

2018-01-18 Thread Tim Landscheidt
Nicolas Goaziou  wrote:

>> According to Emacs's CONTRIBUTE (referenced by
>> README_contribute), that should be
>> "Copyright-paperwork-exempt: yes"?  

> Our commits do not appear in Emacs' history, so we are not required to
> follow their conventions for commit messages.

Could you then please document TINYCHANGE in
README_contribute?  Merci!

Tim




Re: [O] Bug: Broken orgmode.org links in doc/misc/org.texi and lisp/org

2018-01-18 Thread Tim Landscheidt
Nicolas Goaziou <m...@nicolasgoaziou.fr> wrote:

> […]

> Thank you! However, these patches do not seem to apply cleanly on maint
> tip. Could you rebase them against maint HEAD and send them again?

> […]

I have attached the patches rebased on maint, with
TINYCHANGE.  (I've switched patches #4 and #5 as #4 is
easier to review than #5.)

Patch #1 updates only URLs from http to https that I consid-
er "uncontroversial".

Patch #2 makes some links to the manual and external URLs in
docstrings clickable.

Patch #3 updates URLs from http to https in old entries of
etc/ORG-NEWS.  There is an argument for keeping them as is,
and I have no strong opinion on that.

Patch #4 just adds a trailing slash to two links to
https://orgmode.org/worg/org-contrib/babel.

Patch #5 updates URLs from http to https in source code and
test cases.  These need to be reviewed more carefully, espe-
cially as there probably should remain some test cases for
http URLs.  (I get a test failure for
test-org/timestamp-from-time, but AFAICT this is unrelated.)

Tim
>From defa7770f7b136d6ec122f91ee84a471d6a83462 Mon Sep 17 00:00:00 2001
From: Tim Landscheidt <t...@tim-landscheidt.de>
Date: Tue, 16 Jan 2018 16:22:00 +
Subject: [PATCH 1/5] Use https for links to orgmode.org

TINYCHANGE
---
 Makefile |  2 +-
 README_ELPA  |  4 +-
 README_git   |  4 +-
 README_maintainer|  2 +-
 contrib/lisp/ob-csharp.el|  2 +-
 contrib/lisp/ob-eukleides.el |  2 +-
 contrib/lisp/ob-fomus.el |  2 +-
 contrib/lisp/ob-mathomatic.el|  2 +-
 contrib/lisp/ob-oz.el|  2 +-
 contrib/lisp/ob-tcl.el   |  2 +-
 contrib/lisp/ob-vbnet.el |  2 +-
 contrib/lisp/org-bibtex-extras.el|  2 +-
 contrib/lisp/org-collector.el|  2 +-
 contrib/lisp/org-contribdir.el   |  2 +-
 contrib/lisp/org-depend.el   |  2 +-
 contrib/lisp/org-effectiveness.el|  2 +-
 contrib/lisp/org-eval-light.el   |  2 +-
 contrib/lisp/org-eval.el |  2 +-
 contrib/lisp/org-index.el|  2 +-
 contrib/lisp/org-learn.el|  2 +-
 contrib/lisp/org-license.el  |  2 +-
 contrib/lisp/org-link-edit.el| 16 
 contrib/lisp/org-mairix.el   |  2 +-
 contrib/lisp/org-man.el  |  2 +-
 contrib/lisp/org-mew.el  |  2 +-
 contrib/lisp/org-notmuch.el  |  2 +-
 contrib/lisp/org-passwords.el|  2 +-
 contrib/lisp/org-screenshot.el   |  2 +-
 contrib/lisp/org-sudoku.el   |  2 +-
 contrib/lisp/org-track.el|  6 +--
 contrib/lisp/org-vm.el   |  2 +-
 contrib/lisp/org-wikinodes.el|  2 +-
 contrib/lisp/org-wl.el   |  2 +-
 contrib/lisp/ox-rss.el   |  2 +-
 contrib/orgmanual.org| 52 
 contrib/scripts/org-docco.org|  6 +--
 contrib/scripts/staticmathjax/README.org |  2 +-
 doc/orgguide.texi| 70 
 etc/ORG-NEWS |  4 +-
 etc/styles/README|  2 +-
 lisp/ob-C.el |  2 +-
 lisp/ob-J.el |  2 +-
 lisp/ob-R.el |  2 +-
 lisp/ob-asymptote.el |  2 +-
 lisp/ob-awk.el   |  2 +-
 lisp/ob-calc.el  |  2 +-
 lisp/ob-clojure.el   |  2 +-
 lisp/ob-comint.el|  2 +-
 lisp/ob-coq.el   |  2 +-
 lisp/ob-core.el  |  2 +-
 lisp/ob-css.el   |  2 +-
 lisp/ob-ditaa.el |  2 +-
 lisp/ob-dot.el   |  2 +-
 lisp/ob-ebnf.el  |  2 +-
 lisp/ob-emacs-lisp.el|  2 +-
 lisp/ob-eval.el  |  2 +-
 lisp/ob-exp.el   |  2 +-
 lisp/ob-forth.el |  2 +-
 lisp/ob-fortran.el   |  2 +-
 lisp/ob-gnuplot.el   |  2 +-
 lisp/ob-groovy.el|  2 +-
 lisp/ob-haskell.el   |  2 +-
 lisp/ob-hledger.el   |  2 +-
 lisp/ob-io.el|  2 +-
 lisp/ob-java.el  |  2 +-
 lisp/ob-js.el|  2 +-
 lisp/ob-keys.el  |  2 +-
 lisp/ob-latex.el |  2 +-
 lisp/ob-ledger.el|  2 +-
 lisp/ob-lilypond.el  |  4 +-
 lisp/ob-lisp.el  |  2 +-
 lisp/ob-lob.el   |  2 +-
 lisp/ob-lua.el  

[O] [PATCH] Remove obsolete mk/list-hooks.pl

2018-01-18 Thread Tim Landscheidt
The functionality of mk/list-hooks.pl has been implemented by mk/eldo.el.

* mk/list-hooks.pl: Remove.

TINYCHANGE
---
 mk/list-hooks.pl | 32 
 1 file changed, 32 deletions(-)
 delete mode 100755 mk/list-hooks.pl

diff --git a/mk/list-hooks.pl b/mk/list-hooks.pl
deleted file mode 100755
index ffacd7c79..0
-- 
2.13.6





Re: [O] Bug: Broken orgmode.org links in doc/misc/org.texi and lisp/org

2018-03-06 Thread Tim Landscheidt
I wrote:

> […]

> The following links in Emacs master's doc/misc/org.texi and
> lisp/org are broken (404):

> - https://orgmode.org/org-remember.pdf
> - https://orgmode.org/worg/code/org-info-js/
> - https://orgmode.org/worg/org-contrib/babel/languages.html
> - https://orgmode.org/worg/org-contrib/babel/languages/ob-doc-lilypond.html
> - https://orgmode.org/worg/org-contrib/babel/languages/ob-doc-stan.html

The last four work now (merci Bastien!), the first still
not.  It is referenced in etc/ORG-NEWS, documenting the
changes in version 7.8.11:

| […]

| ** Important new features

| […]

| *** org-capture.el is now the default capture system

| This replaces the earlier system org-remember.  The manual only
| describes org-capture, but for people who prefer to continue to
| use org-remember, we keep a static copy of the former manual
| section [[https://orgmode.org/org-remember.pdf][chapter about remember]].

| […]

The Internet Archive's Wayback Machine has archived a copy
(https://web.archive.org/web/20171027214006/https://orgmode.org/org-remember.pdf).
Would it work if it is committed as /org-remember.pdf to
https://code.orgmode.org/bzg/orgweb?

Tim




[O] Bug: Incorrect/incomplete documentation for org-timestamp-change

2019-05-05 Thread Tim Landscheidt
I wanted to (and did) change a number of timestamps by a
constant.  So I found (and successfully used)
org-timestamp-change which starts with (master):

| […]
| (defun org-timestamp-change (n  what updown suppress-tmp-delay)
|   "Change the date in the time stamp at point.
| The date will be changed by N times WHAT.  WHAT can be `day', `month',
| `year', `minute', `second'.  If WHAT is not given, the cursor position
| in the timestamp determines what will be changed.
| When SUPPRESS-TMP-DELAY is non-nil, suppress delays like \"--2d\"."
| […]

Incorrect is the enumeration of valid values for WHAT: 'hour
is missing and 'second is probably wrong (?).

Incomplete is the documentation for UPDOWN: I had assumed it
was the "direction" of change, but that is determined in-
stead by the sign of N.



[O] [PATCH] ox-rss: Fix typos

2019-07-15 Thread Tim Landscheidt
---
 contrib/lisp/ox-rss.el | 10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/contrib/lisp/ox-rss.el b/contrib/lisp/ox-rss.el
index 10f2cc244..bb069dadf 100644
--- a/contrib/lisp/ox-rss.el
+++ b/contrib/lisp/ox-rss.el
@@ -22,8 +22,8 @@
 
 ;;; Commentary:
 
-;; This library implements a RSS 2.0 back-end for Org exporter, based on
-;; the `html' back-end.
+;; This library implements an RSS 2.0 back-end for Org exporter, based
+;; on the `html' back-end.
 ;;
 ;; It requires Emacs 24.1 at least.
 ;;
@@ -85,7 +85,7 @@
   :package-version '(Org . "8.0"))
 
 (defcustom org-rss-image-url 
"https://orgmode.org/img/org-mode-unicorn-logo.png;
-  "The URL of the an image for the RSS feed."
+  "The URL of the image for the RSS feed."
   :group 'org-export-rss
   :type 'string)
 
@@ -143,7 +143,7 @@ When nil, Org will create ids using 
`org-icalendar-create-uid'."
 
 ;;;###autoload
 (defun org-rss-export-as-rss ( async subtreep visible-only)
-  "Export current buffer to a RSS buffer.
+  "Export current buffer to an RSS buffer.
 
 If narrowing is active in the current buffer, only export its
 narrowed part.
@@ -173,7 +173,7 @@ non-nil."
 
 ;;;###autoload
 (defun org-rss-export-to-rss ( async subtreep visible-only)
-  "Export current buffer to a RSS file.
+  "Export current buffer to an RSS file.
 
 If narrowing is active in the current buffer, only export its
 narrowed part.
-- 
2.20.1




How to mark task as done at specified (past) time?

2019-11-28 Thread Tim Landscheidt
Hi,

with Emacs 26.2/org-mode 9.1.9, I have a repeating task that
I close with a helper function:

| (defun tl-entry-done ()
|   (interactive)
|   (find-file "/path/to/file.org")
|   (goto-char (org-find-entry-with-id "ENTRY-ID"))
|   (org-todo 'done))

Every time I do this task, I get an acknowledging mail, so
instead of manually closing this task (and forgetting to do
that, or delaying it for some time) I want Gnus to mark the
task as done /at the time when the mail was sent/, i. e. in:

|- State "DONE"   from "TODO"   [2019-11-27 Mi 16:44]

I want "2019-11-27 Mi 16:44" not to be the current time, but
some other (past) time.

How can I mark a task as done at a specified time?  Looking
at org-add-planning-info, there seems to be a mechanism to
pass a timestamp, but it does not seem to be exposed at
higher levels (?).

Do I have to cl-flet org-current-time or something similar?

Tim




Re: How to mark task as done at specified (past) time?

2020-07-08 Thread Tim Landscheidt
Kyle Meyer  wrote a long time ago:

> […]

>> Do I have to cl-flet org-current-time or something similar?

> Something along those lines would probably be the most straightforward.
> Light testing with the command below suggests overriding current-time is
> sufficient:

> (defun my-org-todo-time-machine ()
>   (interactive)
>   (cl-letf (((symbol-function 'current-time)
>  (lambda ()
>(apply #'encode-time (org-parse-time-string
>  "2019-11-27 Mi 16:44")
> (call-interactively #'org-todo)))

I finally got around to this and ended up with an entry in
gnus-select-article-hook à la:

| (lambda nil
|   (if
|   (and
|(string= gnus-newsgroup-name "mail.only.this.group")
|(string-match "^Regular expression that matches subject$"
|  (gnus-summary-article-subject)))
|   (let
|   ((article-time
| (gnus-date-get-time
|  (mail-header-date
|   (gnus-summary-article-header)
| (cl-letf
| (((symbol-function 'current-time)
|   (lambda nil article-time)))
|   (find-file "/path/to/file.org")
|   (goto-char
|(org-find-entry-with-id "TASK-ID"))
|   (org-todo 'done)

I have an icky feeling about cl-letfing current-time because
Murphy might cause a timer to fire in just that time frame
and I have no idea what current-time is for that timer; so
if future org-mode releases would provide a cleaner API I
would very much appreciate that :-).

Thanks,
Tim



Capture with (moving) attachment?

2020-07-22 Thread Tim Landscheidt
Hi,

I have a capture template to file items to a list:

| ("i" "inventory" entry
|  (file "~/Desktop/Agenda/Inventar.org")
|  "* %^{Name}" :immediate-finish t)

Currently, when I want to file an item with an associated
image, I open the directory of the images with dired, visit
the image file, use the capture to add an item, kill the im-
age buffer, use M-0 w in dired to copy the file's name,
switch to the org file, use C-c C-a m to attach the image by
moving the file, and then switch back to the dired buffer.
Lather, rinse, repeat, until the directory with the images
is empty.

What I want to do instead is open the image file (via dir-
ed), have the capture do the attaching by itself (if it is
called in an image-mode buffer) and then kill the image
buffer.  (Emacs does not care if the file associated with
the buffer is deleted in the mean time.)

First idea was to use %(EXP) to set
org-capture-after-finalize-hook to attach the file, but that
hook is called in the original (image) buffer.
org-capture-before-finalize-hook on the other hand is called
in a CAPTURE-Inventar.org buffer (with no associated file),
same with org-capture-prepare-finalize-hook.  (I also would
like to perform the attaching only *after* the item has suc-
cessfully been filed to avoid misfiling/deleting image
files.)

There are other ways to achieve this in this particular case
(capture, visit the org file, go to (point-max),
(org-attach-attach file nil 'mv), maybe even replace capture
with an (insert (format "* %s\n" (read-string, but are
there general solutions for this issue that will work, well,
more generally?

TIA,
Tim




Bug: :prologue and :epilogue are ignored in ob-sql code blocks (inter alia)

2020-11-24 Thread Tim Landscheidt
With Emacs 27.1/org-mode 9.3, "(org) Environment of a Code
Block" ends with:

| Inserting headers and footers
| -

| The ‘prologue’ header argument is for appending to the top of the code
| block for execution, like a reset instruction.  For example, you may use
| ‘:prologue "reset"’ in a Gnuplot code block or, for every such block:
|
|  (add-to-list 'org-babel-default-header-args:gnuplot
|   '((:prologue . "reset")))

|Likewise, the value of the ‘epilogue’ header argument is for
| appending to the end of the code block for execution.

However it appears as if :prologue and :epilogue are ignored
in ob-sql code blocks:

| #+NAME: test-for-ob-sql
| #+BEGIN_SRC sql :engine postgresql :results verbatim :prologue "SELECT 1;" 
:epilogue "SELECT 5;" :cmdline --no-psqlrc -P format=aligned -P footer=on
|   SELECT 2;
|   SELECT 3;
|   SELECT 4;
| #+END_SRC

| #+RESULTS: test-for-ob-sql
| #+begin_example
|  ?column?
| --
| 2
| (1 Zeile)

|  ?column?
| --
| 3
| (1 Zeile)

|  ?column?
| --
| 4
| (1 Zeile)

| #+end_example

It seems that :prologue and :epilogue are only honoured in
languages that use org-babel-expand-body:generic and a
(very) few others; especially, the following languages prob-
ably ignore them (untested):

| [tim@passepartout ~/src/emacs]$ find lisp/org -type f -name ob-\*.el \
| > -not -exec fgrep -q 'org-babel-expand-body:generic' {} \; \
| > -not -exec fgrep -q ':prologue' {} \; \
| > -print
| lisp/org/ob-C.el
| lisp/org/ob-J.el
| lisp/org/ob-abc.el
| lisp/org/ob-awk.el
| lisp/org/ob-calc.el
| lisp/org/ob-clojure.el
| lisp/org/ob-comint.el
| lisp/org/ob-css.el
| lisp/org/ob-ditaa.el
| lisp/org/ob-dot.el
| lisp/org/ob-ebnf.el
| lisp/org/ob-emacs-lisp.el
| lisp/org/ob-eval.el
| lisp/org/ob-exp.el
| lisp/org/ob-fortran.el
| lisp/org/ob-hledger.el
| lisp/org/ob-latex.el
| lisp/org/ob-ledger.el
| lisp/org/ob-lisp.el
| lisp/org/ob-lob.el
| lisp/org/ob-makefile.el
| lisp/org/ob-matlab.el
| lisp/org/ob-mscgen.el
| lisp/org/ob-org.el
| lisp/org/ob-picolisp.el
| lisp/org/ob-ref.el
| lisp/org/ob-sed.el
| lisp/org/ob-shen.el
| lisp/org/ob-sql.el
| lisp/org/ob-sqlite.el
| lisp/org/ob-table.el
| lisp/org/ob-stan.el
| lisp/org/ob-vala.el



Re: Time Slots in Org-Agenda

2020-12-15 Thread Tim Landscheidt
steve-humphr...@gmx.com wrote:

>> >> 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.
> […]

The last line means: Set the variable org-agenda-time-grid
to a list that consists of the symbol (!) "freq", the sym-
bol "times", the string "---" and the string "+++".  How-
ever, you want the first and second elements to be the val-
ues of those variables, so you could say:

| (setq org-agenda-time-grid `(,freq ,times "---" "+++"))

or:

| (setq org-agenda-time-grid (list freq times "---" "+++"))

(NB: There are more subtleties to this (e. g., a symbol can
have separate meanings as a variable and a function (and I
really should finally read the elisp info file from begin-
ning to end :-, but my most common mistake is either to
quote something that I do not want to quote or not quote
something that I do want to quote.)

Tim




Bug: "DEFINITION NOT FOUND" for footnote in Org manual

2021-07-11 Thread Tim Landscheidt
At https://orgmode.org/manual/Export-Settings.html#DOCF124
and (renumbered to "fn:123") in doc/org-manual.org, a foot-
note is defined as "DEFINITION NOT FOUND":

| [tim@vagabond ~/src/org-mode]$ git grep -2 'DEFINITION NOT FOUND' -- 
doc/org-manual.org
| doc/org-manual.org-this timestamp are exported.
| doc/org-manual.org-
| doc/org-manual.org:[fn:123] DEFINITION NOT FOUND.
| doc/org-manual.org-
| doc/org-manual.org-[fn:124] At the moment, some export back-ends do not obey 
this
| [tim@vagabond ~/src/org-mode]$

The original footnote seems to have been added with commit
e30aed8f0c62e74633f7a0398340f9bd7bdfa3cc (but personally I
don't find that text very helpful).



Testing if a scheduled date is prior to another date

2021-08-22 Thread Tim Landscheidt
Hi,

in a capture template, I want to test whether the scheduled
date for a specific task is prior to another, calculated
date (and depending on the answer, insert a checkbox or
not).

I can get the scheduled date for the task by:

| (with-current-buffer (find-file-noselect "/path/to/file.org")
|   (save-mark-and-excursion
| (goto-char
|  (org-find-entry-with-id "TASK_ID"))
| (org-element-property ':scheduled (org-element-at-point

which returns a structure like:

| (timestamp
|  (:type active
|   :raw-value "<2021-08-30 Mo 08:00 .+4d>"
|   :year-start 2021
|   :month-start 8
|   :day-start 30
|   :hour-start 8
|   :minute-start 0
|   :year-end 2021
|   :month-end 8
|   :day-end 30
|   :hour-end 8
|   :minute-end 0
|   :begin 436166
|   :end 436192
|   :post-blank 0
|   :repeater-type restart
|   :repeater-value 4
|   :repeater-unit day))

However, comparing this value with org-time< & Co. is futile
as org-2ft always returns 0.

Before I wade through the various functions to build a con-
version chain, what is the best practice to compare time-
stamp values with dates?  (And if there is an org-mode func-
tion that checks if the task at point is scheduled prior to
another date, I'd appreciate pointers as well :-).)

TIA,
Tim




Re: Bug: Cannot insert multiple multi-line elisp links [9.4.4 (release_9.4.4 @ /usr/share/emacs/27.2/lisp/org/)]

2021-08-09 Thread Tim Landscheidt
Eric S Fraga  wrote:

> What if you escape the \n, i.e. \\n?

Then org-mode's display is correct, but the message call
will not output a newline, but a backslash and an "n" :-).

Tim



Bug: Cannot insert multiple multi-line elisp links [9.4.4 (release_9.4.4 @ /usr/share/emacs/27.2/lisp/org/)]

2021-08-08 Thread Tim Landscheidt
With Emacs 27.2, I want to generate a list of stuff with em-
bedded Emacs Lisp scripts to work on it.  The Emacs Lisp
scripts have newlines as string literals in them.

When I evaluate:

| #+BEGIN_SRC elisp :results raw :var number-of-lines=1
|   (mapconcat
|(lambda (i)
|  (concat
|   (org-link-make-string (concat "elisp:" (prin1-to-string `(message 
"Hello, World %d!\n" ,i))) (format "Test #1.%d" i))
|   "\n"))
|(number-sequence 1 number-of-lines)
|"")
| #+END_SRC

for the first time with C-c C-c, I get:

| #+RESULTS:
| [[elisp:(message "Hello, World %d!
| " 1)][Test #1.1]]

which, if shown in org-mode, is and works exactly correct.

(When I rerun C-C C-c, I get:

| #+RESULTS:
| [[elisp:(message "Hello, World %d!
| " 1)][Test #1.1]]
| " 1)][Test #1.1]]

which is not correct, but does not bother me much.)

When I evalute:

| #+BEGIN_SRC elisp :results raw :var number-of-lines=10
|   (mapconcat
|(lambda (i)
|  (concat
|   (org-link-make-string (concat "elisp:" (prin1-to-string `(message 
"Hello, World %d!\n" ,i))) (format "Test #1.%d" i))
|   "\n"))
|(number-sequence 1 number-of-lines)
|"")
| #+END_SRC

I get:

| #+RESULTS:
| [[elisp:(message "Hello, World %d!
| " 1)][Test #1.1]]
| [[elisp:(message "Hello, World %d!
| " 2)][Test #1.2]]
| [[elisp:(message "Hello, World %d!
| " 3)][Test #1.3]]
| [[elisp:(message "Hello, World %d!
| " 4)][Test #1.4]]
| [[elisp:(message "Hello, World %d!
| " 5)][Test #1.5]]
| [[elisp:(message "Hello, World %d!
| " 6)][Test #1.6]]
| [[elisp:(message "Hello, World %d!
| " 7)][Test #1.7]]
| [[elisp:(message "Hello, World %d!
| " 8)][Test #1.8]]
| [[elisp:(message "Hello, World %d!
| " 9)][Test #1.9]]
| [[elisp:(message "Hello, World %d!
| " 10)][Test #1.10]]

where the last link ("Test #1.10") is not recognized by
org-mode and not clickable.

My guess is that org-link-make-string should escape new-
lines, but does not, and the org-mode parser is liberal
enough to "fix" some links, but not all.



Re: Bug: Cannot insert multiple multi-line elisp links [9.4.4 (release_9.4.4 @ /usr/share/emacs/27.2/lisp/org/)]

2021-08-08 Thread Tim Landscheidt
(Sidenote: The issue can be worked around by replacing "\n"
with (make-string 1 10).)




Re: Bug: "DEFINITION NOT FOUND" for footnote in Org manual

2021-07-24 Thread Tim Landscheidt
Timothy  wrote:

> […]

>> The original footnote seems to have been added with commit
>> e30aed8f0c62e74633f7a0398340f9bd7bdfa3cc (but personally I
>> don't find that text very helpful).

> Do you think it would be more appropriate to update or remove the
> footnote?

AFAIUI, if LANGUAGE is set, for LaTeX export,
org-latex-package-alist *must* also be set/amended, so the
documentation of this relationship cannot be removed.

But some other minor nitpicks with that setting (from a non-
native speaker):

| - =LANGUAGE= ::

|   #+cindex: @samp{LANGUAGE}, keyword
|   #+vindex: org-export-default-language
|   Language to use for translating certain strings
|   (~org-export-default-language~).  With =#+LANGUAGE: fr=, for
|   example, Org translates =Table of contents= to the French =Table des
|   matières=[fn:122].

1. "Certain strings" is true, but which ones are they?
   Without the second sentence, I couldn't imagine what
   strings the documentation is talking about.  And does
   org-mode change user-supplied occurences of "Table of
   contents" to "Table des matières" as well?

2. Neither org-mode nor anything else is /translating/
   (how?) those strings.  Instead, one chooses the language
   for the name of the "Table of contents" section and
   others.

| - =LANGUAGE= ::
|   #+cindex: @samp{LANGUAGE}, keyword
|   #+vindex: org-latex-package-alist
|   In order to be effective, the =babel= or =polyglossia=
|   packages---according to the LaTeX compiler used---must be loaded
|   with the appropriate language as argument.  This can be accomplished
|   by modifying the =org-latex-package-alist= variable, e.g., with the
|   following snippet:
|
|   #+begin_src emacs-lisp
|   (add-to-list org-latex-package-alist
|'("AUTO" "babel" t ("pdflatex")))
|   (add-to-list org-latex-package-alist
|'("AUTO" "polyglossia" t ("xelatex" "lualatex")))
|   #+end_src

3. General question: Why can't the requirement be automatic?
   E. g., if LANGUAGE != "en", use babel or polyglossia?

4. In org-latex-packages-alist (or
   org-latex-default-packages-alist), "AUTO" is not docu-
   mented, neither is OPTIONS in general.

5. My (rudimentary) understanding of LaTeX and babel &
   Co. is that one needs to use it with something like
   "\usepackage[english,german]{babel}".  The first sentence
   ("be loaded with the appropriate language as argument")
   seems to confirm that.  The second sentence says that
   "this" can be accomplished by the following snippet.
   However, there does not seem to be any argument that con-
   veys a language.  Does that happen automatically?  I. e.,
   does the snippet actually accomplish what it claims to?
   (I haven't tested this.)

Tim



Possible to robustly embed elisp links in source block table results?

2022-02-12 Thread Tim Landscheidt
Hi,

I want org-mode to display a tab-separated values table ge-
nerated by jq that includes elisp links that do something
(differently) for each row, especially containing data that
is not displayed in other columns.

The source block:

| #+BEGIN_SRC sh :colnames '(Column\ A Column\ B Column\ C)
|   jq --null-input -r 'range(1; 4) | tostring | [ "A" + ., "B" + ., 
"[[elisp:(ignore)][Do it]]"] | @tsv'
| #+END_SRC

evaluates to:

| #+RESULTS:
| | Column A | Column B | Column C |
| |--+--+--|
| | A1   | B1   | [[elisp:(ignore)][Do it]]|
| | A2   | B2   | [[elisp:(ignore)][Do it]]|
| | A3   | B3   | [[elisp:(ignore)][Do it]]|

which org-mode displays as:

| #+RESULTS:
| | Column A | Column B | Column C |
| |--+--+--|
| | A1   | B1   | Do it|
| | A2   | B2   | Do it|
| | A3   | B3   | Do it|

with each "Do it" being a button that, when pressed and con-
firmed, executes ignore.  Great!

Executing Emacs Lisp:

| (org-insert-link nil "elisp:(ignore \"1\")" "Do it")

results in the org-mode source code:

| [[elisp:(ignore "1")][Do it]]

so let's try jq generating that with:

| #+BEGIN_SRC sh :colnames '(Column\ A Column\ B Column\ C)
|   jq --null-input -r 'range(1; 4) | tostring | [ "A" + ., "B" + ., 
"[[elisp:(ignore \"" + . + "\")][Do it]]"] | @tsv'
| #+END_SRC

This jq call, executed in a shell, evaluates to the output
(tab-separated):

| A1  B1  [[elisp:(ignore "1")][Do it]]
| A2  B2  [[elisp:(ignore "2")][Do it]]
| A3  B3  [[elisp:(ignore "3")][Do it]]

When org-mode evaluates the source block, it strips it down
to:

| #+RESULTS:
| | Column A | Column B | Column C |
| |--+--+--|
| | A1   | B1   |1 |
| | A2   | B2   |2 |
| | A3   | B3   |3 |

where "1", "2" and "3" are not buttons or anything else but
plain text, and any other input has been permanently dis-
carded (i. e., is not just not displayed).

If however I set ":results raw" in the source block:

| #+BEGIN_SRC sh :colnames '(Column\ A Column\ B Column\ C) :results raw
|   jq --null-input -r 'range(1; 4) | tostring | [ "A" + ., "B" + ., 
"[[elisp:(ignore \"" + . + "\")][Do it]]"] | @tsv'
| #+END_SRC

org-mode evaluates that to:

| #+RESULTS:
| A1B1  Do it
| A2B2  Do it
| A3B3  Do it

with each "Do it" being a button that, when pressed and con-
firmed, will execute (ignore "1"), (ignore "2") and (ignore
"3"), respectively.

So in the first and third source block, org-mode teases me
that I can embed elisp links in that very nice table format
(first source block) with "complex" Lisp code (third source
block), but when I try to combine the two (second source
block), it slaps me in the face.

Surely I must be missing some obvious solution?  Is there
another syntax I need to use?  Do I need to have jq output
the raw columns A, B, D and E and then define a :post source
block that converts that to A, B and C = f(D, E)?

My alternative and thus benchmark for such "dashboards" that
show "stuff" and offer things to do with it are derivatives
of tabulated-list-mode, but their programming requires de-
finitions of functions & Co. that need to be updated syn-
chronously; an org-mode source block on the other hand just
does what it says on the tin.

TIA,
Tim




Best practice for writing and debugging shell source blocks?

2023-10-24 Thread Tim Landscheidt
Hi,

inspired by "Literate DevOps"
(https://howardism.org/Technical/Emacs/literate-devops.html),
I want to document some "stuff" in an Org file with the goal
to be able to replay the steps done in the future so that I
can either recreate the same "product" or variations there-
of.

My actual topic involves (inter alia) containers, but for
simplicity, let us assume that I want to document the se-
quence of shell commands:

| $ mktemp
| /tmp/tmp.gSffc4XtQ0
| $ echo a >> /tmp/tmp.gSffc4XtQ0
| $ echo b >> /tmp/tmp.gSffc4XtQ0
| $ fgrep -x a /tmp/tmp.gSffc4XtQ0
| a
| $

In other words: An "entity" is created and its identifier
shown, this entity is then referenced by this identifier,
changed and queried.

If I put the shell commands in one source block each:

| #+NAME: create-temporary-file
| #+BEGIN_SRC sh
| mktemp
| #+END_SRC

| #+BEGIN_SRC sh :var tmpfile=create-temporary-file
| echo a >> $tmpfile
| #+END_SRC

| #+BEGIN_SRC sh :var tmpfile=create-temporary-file
| echo b >> $tmpfile
| #+END_SRC

| #+BEGIN_SRC sh :var tmpfile=create-temporary-file
| fgrep -x a $tmpfile
| #+END_SRC

and then evaluate the last source block, it calls the source
block create-temporary-file, then searches the (empty) file
and fails, i. e. the second and third source blocks are not
evaluated at all.  (Dealing with failing shell commands is
another headache—thankfully, the trick at
https://emacs.stackexchange.com/questions/59875/org-src-block-does-not-return-any-output
(provide header arguments :prologue "exec 2>&1" and
:epilogue ":") works reasonably well.)

Adding more to the confusion, if I manually evaluate the
first source block (create-temporary-file), it produces for
example:

| #+RESULTS: create-temporary-file
| : /tmp/tmp.lOKZtyJ124

If I then evaluate the last source block (again), the first
code block gets called, but its (different) result gets only
passed to the last source block and used there, while the
"#+RESULTS" section stays the same.

The same thing happens if I add ":session my-test" to all
source blocks, except that I get an additional buffer
"my-test" with the content:

| mktemp
| sh-5.2$ echo 'org_babel_sh_eoe'
| /tmp/tmp.e19GfJsH7w
| sh-5.2$ org_babel_sh_eoe
| sh-5.2$ tmpfile='/tmp/tmp.e19GfJsH7w'
| sh-5.2$ fgrep -x a $tmpfile
| sh-5.2$ echo 'org_babel_sh_eoe'
| org_babel_sh_eoe
| sh-5.2$

where the "mixed" output of "mktemp" and "echo
'org_babel_sh_eoe'" does not necessarily instill confidence
to run commands that are destructive in nature.

So what is The Right Way™ to document sequences of shell
commands so that they are evaluated in sequence, being able
to refer to the output of previous commands?  Are there any
obvious collections of examples that I missed?

TIA,
Tim



Re: Some links in online manual do not work

2022-10-16 Thread Tim Landscheidt
Bastien Guerry  wrote:

>> More:

> Fixed, thanks!

> https://git.sr.ht/~bzg/worg/commit/408f05a0

Thanks to everyone involved, works for me now!

Tim



Re: Some links in online manual do not work

2022-10-06 Thread Tim Landscheidt
Ihor Radchenko  wrote:

>>> This looks like the nginx case issue again.

>>> I've looked at this and there does not seem to be any 'clean' way to fix
>>> this which also doesn't have significant processing overhead or a
>>> maintenance burden.

>>> I wonder if it would be worthwhile adding an option to HTML export which
>>> would force all link targets and exported filenames to lower case,
>>> thereby avoiding issues on platforms and with web servers which have
>>> different positions wrt case sensitivity?

>> Is the nginx configuration/webserver setup documented some-
>> where?

> AFAIK, our nginx configs are not public, but Bastien may privately share
> them if you are willing to help.

Willingness implies commitment, and I don't have that (nor
deeper nginx experience). :-) (That's one of the advantages
of free software for me: I can look at a bunch of problems,
pick the one I know the solution for and get instant grati-
fication :-).)

Tim



Re: Some links in online manual do not work

2022-10-07 Thread Tim Landscheidt
Bastien Guerry  wrote:

>> AFAIK, our nginx configs are not public, but Bastien may privately share
>> them if you are willing to help.

> FWIW, I've shared the nginx.config here:
> https://git.sr.ht/~bzg/worg/tree/master/item/nginx.conf

Thanks.  Assuming the relevant line is:

| rewrite HTML-export.html HTML-Export.html permanent;

looking at
http://nginx.org/en/docs/http/ngx_http_rewrite_module.html#rewrite
suggests that this will match any URL that contains the
string "HTML-export.html", i. e. the regular expression is
not anchored anywhere.

So if that regular expression is intended to match on URLs
that end in "/HTML-export.html", an (untested) fix would be
something along the lines of:

| rewrite /HTML-export\.html$ HTML-Export.html permanent;

However I do not understand the need for these rewrites and
fixing the underlying issue is probably worthwhile.

Tim



Some links in online manual do not work

2022-10-02 Thread Tim Landscheidt
Hi,

at https://orgmode.org/manual/HTML-Export.html, the links
for the first five (5) and the last two (2) subsections
work, the links for:

- "Headlines in HTML export"
  (https://orgmode.org/manual/Headlines-in-HTML-export.html)
- "Links in HTML export"
  (https://orgmode.org/manual/Links-in-HTML-export.html)
- "Tables in HTML export"
  (https://orgmode.org/manual/Tables-in-HTML-export.html)
- "Images in HTML export"
  (https://orgmode.org/manual/Images-in-HTML-export.html)
- "Math formatting in HTML export"
  (https://orgmode.org/manual/Math-formatting-in-HTML-export.html)
- "Text areas in HTML export"
  (https://orgmode.org/manual/Text-areas-in-HTML-export.html)

however all return "301 Moved Permanently", pointing back to
"HTML-Export.html".

The fact that all failing links are named
"Something-in-HTML-export.html" might suggest an issue with
the webserver configuration.

Tim




Re: Some links in online manual do not work

2022-10-05 Thread Tim Landscheidt
Tim Cross  wrote:

>> at https://orgmode.org/manual/HTML-Export.html, the links
>> for the first five (5) and the last two (2) subsections
>> work, the links for:

>> - "Headlines in HTML export"
>>   (https://orgmode.org/manual/Headlines-in-HTML-export.html)
>> - "Links in HTML export"
>>   (https://orgmode.org/manual/Links-in-HTML-export.html)
>> - "Tables in HTML export"
>>   (https://orgmode.org/manual/Tables-in-HTML-export.html)
>> - "Images in HTML export"
>>   (https://orgmode.org/manual/Images-in-HTML-export.html)
>> - "Math formatting in HTML export"
>>   (https://orgmode.org/manual/Math-formatting-in-HTML-export.html)
>> - "Text areas in HTML export"
>>   (https://orgmode.org/manual/Text-areas-in-HTML-export.html)

>> however all return "301 Moved Permanently", pointing back to
>> "HTML-Export.html".

>> The fact that all failing links are named
>> "Something-in-HTML-export.html" might suggest an issue with
>> the webserver configuration.

> This looks like the nginx case issue again.

> I've looked at this and there does not seem to be any 'clean' way to fix
> this which also doesn't have significant processing overhead or a
> maintenance burden.

> I wonder if it would be worthwhile adding an option to HTML export which
> would force all link targets and exported filenames to lower case,
> thereby avoiding issues on platforms and with web servers which have
> different positions wrt case sensitivity?

Is the nginx configuration/webserver setup documented some-
where?

Tim




[BUG] Documentation for #+INCLUDE: does not specify order when exporting [9.5.5 (release_9.5.5 @ /usr/share/emacs/28.2/lisp/org/)]

2023-04-08 Thread Tim Landscheidt
With the Org file:

| #+BEGIN_SRC python :results silent :exports results
|   test = '1'
|   with open('test-a.log', 'w') as f:
|   f.write(f'Test {test}a\n')
|   with open('test-b.log', 'w') as f:
|   f.write(f'Test {test}b\n')
| #+END_SRC

| Test, part A:

| #+INCLUDE: "test-a.log" verbatim

| Test, part B:

| #+INCLUDE: "test-b.log" verbatim

and test-a.log and test-b.log not existing, on the first
(unsuccessful) export, the error:

| org-export-expand-include-keyword: Cannot include file /tmp/test-a.log

is displayed.  However, if these files already exist, they
are included as is, and /after/ that inclusion, the Python
source block is executed.

This means that if one changes "test = '1'" to "test = '2'"
in the Python source block, one has to export the Org file
twice to see the changed result in the export.

Technically, this is probably the "correct" behaviour as
otherwise the order of execution would be very hard to de-
termine.

But why did I spend a few hours debugging this before final-
ly understanding Org's mode of operation?  The first sen-
tence of the documentation in "13.4 Include Files" reads:

| During export, you can include the content of another file.
| […]

I'm not a native speaker, but the word "during" drew the
mental image for me that, when exporting, Org starts at the
top of the document, reads through to the end, and if en-
counters a "#+INCLUDE:" statement /during/ that, it includes
the referenced file at that point.

Now the Org manual is already beset with examples that look
as if someone complained about something not being document-
ed somewhere, and then someone adding one sentence just that
somewhere, so I don't want to add to that with "just a quick
fix".

But I do think it would be helpful if the "order" while ex-
porting would be documented in a meaningful way.



Re: What is a week?

2023-04-10 Thread Tim Landscheidt
Max Nikulin  wrote:

> […]

> So at least some people expect 7, not 0. I would say, both
> variants should be acceptable.

> P.S. It seems, there is no way to get in Emacs first_weekday from locale(5)

But there is calendar-week-start-day which I would expect
affected Emacs users to have customized.

Tim




How to execute Lisp code /after/ a capture template has been filled before it is finalized?

2023-12-23 Thread Tim Landscheidt
Hi,

I (want to) have a capture template that fills a table and
then (re-)calculates a cell based on a formula (and aligns
the table):

| - Note taken on %U 
|   | Coin | Count
|   |---+|
|   | 0.01 | %^{Number of € 0.01 coins|0} |
|   | 0.02 | %^{Number of € 0.02 coins|0} |
|   | 0.05 | %^{Number of € 0.05 coins|0} |
|   | 0.10 | %^{Number of € 0.10 coins|0} |
|   | 0.20 | %^{Number of € 0.20 coins|0} |
|   | 0.50 | %^{Number of € 0.50 coins|0} |
|   | 1.00 | %^{Number of € 1.00 coins|0} |
|   | 2.00 | %^{Number of € 2.00 coins|0} |
|   |---+|
|   |  | |
|   #+TBLFM: @>$>=(@I$1..@II$1)*(@I$2..@II$2)

If I naively append "%(org-table-recalculate t)" to that
template, the expression gets evaluated immediately when I
start the capture and the text:

| %![Error: (user-error Not at a table)]

gets appended to the capture buffer /before/ I get prompted
for the first field.

Looking at the hooks for org-capture-mode, I also thought
about recalculating the table at finalizing the capture (*1)
and tried:

| %(progn (message "org-capture-prepare-finalize-hook = %S" 
org-capture-prepare-finalize-hook) (add-hook 'org-capture-prepare-finalize-hook 
(lambda nil (message "Hook called.")) 0 t) (message 
"org-capture-prepare-finalize-hook = %S" org-capture-prepare-finalize-hook) "")

but to my surprise, org-capture-prepare-finalize-hook is nil
prior to the add-hook call, has stored the function after
the add-hook call, but in the interactive capture buffer is
nil again (and no message is printed in *Messages*).

How can I evaluate Lisp code after all prompts have been
answered?

TIA,
Tim

(*1)   I would prefer not doing this, as in this case I
   could not see the result prior to finalizing.



Re: How to execute Lisp code /after/ a capture template has been filled before it is finalized?

2023-12-24 Thread Tim Landscheidt
Ihor Radchenko  wrote:

> […]

> %(...) expansion is executed _before_ capture template is fully
>  calculated. It is generally not designed to side-effect functions.

> You can instead use template-local hooks, introduced in Org 9.6. See
> https://git.savannah.gnu.org/cgit/emacs/org-mode.git/tree/etc/ORG-NEWS#n1270

I'm using Emacs 28.3, so that is something for the future.
But your pointer made me read the source and adjust my men-
tal picture: I had always thought that capturing opened a
window showing a narrowed section of the buffer, invoked
org-capture-mode-hook, then inserted the template and went
on from there.

Instead (CMIIW), the template is evaluated in a temporary
buffer, the result is pasted in the capture buffer, and then
org-capture-mode-hook is invoked.  That means inter alia
that org-capture-mode-hook can work on the "completed" tem-
plate.

For my problem, I thus first (partly) replicated Org 9.6's
behaviour by adding:

| (lambda nil
|(if
|(version< org-version "9.6")
|(let
|((hook
|  (org-capture-get :hook)))
|  (if
|  (functionp hook)
|  (funcall hook)
|(mapc #'funcall hook)

to org-capture-mode-hook.

Then I thought about using org-table-map-tables to call
org-table-recalculate on all tables in the capture buffer to
avoid having to figure out where my table was.  But
org-table-map-tables unfortunately widens the buffer before
iterating, so this was no option.

Therefore, to keep it simple, I amended my template by add-
ing "%?" to the cell where the sum is put in and setting the
:hook property to org-table-recalculate.  (I also added
";%.2f" to the formula for formatting.)  In the end, this
works very nicely.

Thanks!
Tim



Documentation of hline symbol in source blocks results

2023-12-25 Thread Tim Landscheidt
Hi,

this is just a data point for anyone looking at restructur-
ing the Org documentation.

I wanted an Emacs Lisp source block to produce a table with
a column name and a horizontal line separating the column
name and the data cells.  The data-only source block:

| #+BEGIN_SRC emacs-lisp
|   '((1)
| (2)
| (3))
| #+END_SRC

produces the result:

| #+RESULTS:
| | 1 |
| | 2 |
| | 3 |

I wanted to get the result:

| #+RESULTS:
| | Number |
| ||
| |  1 |
| |  2 |
| |  3 |

It took me quite a while to figure out that the first row
returned from the source block can be viewed as the column
name, and a horizontal line can be achieved by returning the
symbol 'hline:

| #+BEGIN_SRC emacs-lisp
|   '(("Number")
| hline
| (1)
| (2)
| (3))
| #+END_SRC

The only reference to this behaviour I could find, is liter-
ally the last (!, :-)) paragraph in the info file:

|For complicated translations the generic translator function could be
| replaced by a custom translator function.  Such a custom function must
| take two arguments and return a single string containing the formatted
| table.  The first argument is the table whose lines are a list of fields
^^
| or the symbol ‘hline’.  The second argument is the property list
  ^
| consisting of parameters specified in the ‘#+ORGTBL: SEND’ line.  Please
| share your translator functions by posting them to the Org users mailing
| list, at .

Just for further inspiration how the documentation could be
rewritten, consider the current wording of "Results of Eval-
uation/Collection/value":

|  Default for most Babel libraries(1).  Functional mode.  Org gets
|  the value by wrapping the code in a function definition in the
|  language of the source block.  That is why when using ‘:results
|  value’, code should execute like a function and return a value.
|  For languages like Python, an explicit ‘return’ statement is
|  mandatory when using ‘:results value’.  Result is the value
|  returned by the last statement in the code block.

|  When evaluating the code block in a session (see *note Environment
|  of a Code Block::), Org passes the code to an interpreter running
|  as an interactive Emacs inferior process.  Org gets the value from
|  the source code interpreter’s last statement output.  Org has to
|  use language-specific methods to obtain the value.  For example,
|  from the variable ‘_’ in Ruby, and the value of ‘.Last.value’ in R.

Wrapping the code?  "Code /should/"?  "Like a function"?
Why is the Python requirement stated here?  Why "using
‘:results value’" when the paragraph should (only) document
this?  "Result is the value"?  What kind of value?  Why are
there references to Ruby and R here?  All this confuses me
and does not provide the information I searched for (empha-
sis on me).

I would probably prefer a clean-slate approach that starts
with something along the lines of: "Source blocks produce
results that can be integrated into an Org document and used
as input for other source blocks.  The abstract specifica-
tion for source blocks looks like this ("structured table
data" vs. "text dump", header arguments, export, etc.).
Emacs Lisp source blocks produce these values in this way.
Python that way.  Shell scripts return tables in this way."

Org is extremely powerful, but (I think I wrote it somewhere
before) the documentation reads like users having had an is-
sue ("my Python code does not produce (correct) results")
and then someone feeling the need to document the solution
right then and there.  IMNSHO this leads to documentation
that is not very usable for the general audience.

Tim