ox-publish index allows alternative formats?

2023-07-24 Thread Britt Anderson
Question:

Could ~:makeindex~ (in the ~org-publish-project-alist~) be expanded to
accept a user provided function for formatting the output differently?

Background: 

I am using org for a static website (brittanderson.github.io). I wanted
to make a list of blog posts subdivided by topic and I decided to use
~:makeindex~. I add ~#+Index: keyword~ lines to the preamble of the
posts and the list is generated, however I did not like the formatting.
It gave me a list of keywords as links (often repeated) with no context
(like title or date). So I hacked this alternative:
https://brittanderson.github.io/posts/theindex.html

It seems like it would be nice to allow users to provide their own
formatting functions to ~org-publish-index-generate-theindex~. Similar
to the way that ~:sitemap-function~ allows a user controlled sitemap.
I altered a few lines to do this for myself (as seen in the diff below),
but am unsure whether there is any more general interest in expanding
the index functionality or where in the org hierarchy would be the best
place to try and code such that ~:makeindex~ can be nil, 'default or the
name of a user provided function that expects one argument (to become
~target~). 

My question is whether this is something that is worth doing, and if it
is worth doing how hard should it be for a novice to attempt, and does
anyone have any pointers for how to tackle it?

-- Britt Anderson

My example of minor edits:

diff --git a/lisp/ox-publish.el b/lisp/ox-publish.el
index 3c7311b56..d04c15fd5 100644
--- a/lisp/ox-publish.el
+++ b/lisp/ox-publish.el
@@ -1109,15 +1109,16 @@ publishing directory."
;; Last term: Link it to TARGET, if possible.
(let ((target (nth 2 idx)))
  (format
-  "[[%s][%s]]"
-  ;; Destination.
+  "*%s* [[%s]]"
+   (car (last entry))
+   ;; Destination.
   (pcase (car target)
 (`nil (format "file:%s" file))
 (`id (format "id:%s" (cdr target)))
 (`custom-id (format "file:%s::#%s" file (cdr target)))
 (_ (format "file:%s::*%s" file (cdr target
   ;; Description.
-  (car (last entry)
+  )))
  "\n"
(setq current-letter letter last-entry entry
   ;; Create "theindex.org", if it doesn't exist yet, and provide




CSL export not using local #+bibliography:

2023-01-24 Thread Britt
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

I reported the following as an issue to citeproc, but was advised by the
library maintainer to report it here instead.

The problem is summarized in the subject line.

I set ~org-cite-global-biography~ in my init.el.

I then write a file for export with ~org-publish~ to html and where the
org file has in the header ~#+bibliography:
"path-to-different-bib-file.bib"~ I can C-c C-c and am told that the
local environment has been updated, but when I export with
~org-publish-project~ the bib file being used is still the global one.
I have to manually ~setq~ the global bib to get the correct file used at
export.

-BEGIN PGP SIGNATURE-
Version: ProtonMail

wsBzBAEBCAAnBQJjz98YCZAwMVHgg5k1RxYhBNNYE9hwe4A6OqjHzDAxUeCD
mTVHAABUigf8C7gc3Q3wqrVytPs7FCZ4qKojqM48+tJn6HVbXWGKEiGx5f78
Shiry+wTlIvKGFIVf5Hw8Vgqh6YnBiFMyUkiHoUGbv0bqET2b6cODaCZHXiy
OTAPUoa/nqsRewmL9PZ8JlPhIkD2+iBYMNqPHUKVYqPDeNybF+qpvxFFZuVV
stj15N0InMMUY2CO0eknu2oF5+kFZ0P+bOFuQwUS90nWpsIXtq36b1n0aikb
wA+52Kl5E2NOAadQGya5RoQeslIkfjVVxtk+OkBqvJ4GWzrxj4dGlRkftmCH
gUVQYfc3iMZNss5Tvi+fqhtDk4ro/KQMEeV3xjRuqTVlZn4DS4Ky0A==
=f9TP
-END PGP SIGNATURE-


publickey - brittanderson@protonmail.com - d35813d8.asc
Description: application/pgp-keys


publickey - brittanderson@protonmail.com - d35813d8.asc.sig
Description: PGP signature


Re: [O] org-list-make-subtree produces JSON readtable error: 47

2019-04-30 Thread Britt Anderson
Britt Anderson  writes:

> Whether or not I use the keyboard short cut or M-x. Any idea what may be
> causing this?
>
> (org-version)
> "9.2.3"
> (emacs-version)
> "GNU Emacs 26.2 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.8)
>  of 2019-04-12"
>
>
> Thanks

Appears to be caused by a conflict with ob-ipython. Will post issue
there. /Britt




Re: [O] org-list-make-subtree produces JSON readtable error: 47

2019-04-30 Thread Britt Anderson
Britt Anderson  writes:

> Whether or not I use the keyboard short cut or M-x. Any idea what may be
> causing this?
>
> (org-version)
> "9.2.3"
> (emacs-version)
> "GNU Emacs 26.2 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.8)
>  of 2019-04-12"
>
>
> Thanks

Seems to be caused by a conflict with ob-ipython. Will report issue
there.



[O] org-list-make-subtree produces JSON readtable error: 47

2019-04-30 Thread Britt Anderson
Whether or not I use the keyboard short cut or M-x. Any idea what may be
causing this?

(org-version)
"9.2.3"
(emacs-version)
"GNU Emacs 26.2 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.8)
 of 2019-04-12"


Thanks




[O] org-copy-subtree: Invalid function: org-preserve-local-variables

2019-01-07 Thread Britt Anderson
Using org version 9.2 and emacs version 26.1 I received the error in the
subject line when trying to move or archive subtrees. It seems to me
that this is related to the

(eval-and-compile (require 'org-macs))

line in org.el as replacing it with (require 'org-macs) solved that
problem.

Can someone tell me whether this is actually related to something else
that I may have set up faulty or whether there is a more correct fix.

Thanks, 




[O] args-out-of-range #

2016-03-03 Thread britt
This message just started appearing today when I open an agenda view
"C-c a a". It is not obvious to me what I am doing or have done
differently, and I would appreciate some advice how to diagnose the
problem:
Emacs: 24.5.1
Orgmode: 8.3.4-5 (20160229 elpa)

Thank you, -- Britt

The error trace follows:

Debugger entered--Lisp error: (args-out-of-range # 1372 
1409)
  match-string(1)
  (let ((s (match-string 1)) (s-begin (match-beginning 1)) (s-end (match-end 
1)) (beg (match-beginning 0)) (end (match-end 0)) (cite-re (format "^\\(%s:\\)" 
(regexp-opt (-sort (function (lambda ... ...)) org-ref-cite-types 
cite-type) (if (and s (string-match cite-re s)) (progn (setq cite-type 
(match-string 1 s)) (remove-text-properties beg end (quote (invisible))) 
(add-text-properties beg end (list (quote face) (list (quote :foreground) 
org-ref-cite-color))
  (progn (let ((s (match-string 1)) (s-begin (match-beginning 1)) (s-end 
(match-end 1)) (beg (match-beginning 0)) (end (match-end 0)) (cite-re (format 
"^\\(%s:\\)" (regexp-opt (-sort (function ...) org-ref-cite-types 
cite-type) (if (and s (string-match cite-re s)) (progn (setq cite-type 
(match-string 1 s)) (remove-text-properties beg end (quote (invisible))) 
(add-text-properties beg end (list (quote face) (list (quote :foreground) 
org-ref-cite-color)))
  (unwind-protect (progn (let ((s (match-string 1)) (s-begin (match-beginning 
1)) (s-end (match-end 1)) (beg (match-beginning 0)) (end (match-end 0)) 
(cite-re (format "^\\(%s:\\)" (regexp-opt (-sort ... org-ref-cite-types 
cite-type) (if (and s (string-match cite-re s)) (progn (setq cite-type 
(match-string 1 s)) (remove-text-properties beg end (quote (invisible))) 
(add-text-properties beg end (list (quote face) (list ... 
org-ref-cite-color))) (set-match-data save-match-data-internal (quote 
evaporate)))
  (let ((save-match-data-internal (match-data))) (unwind-protect (progn (let 
((s (match-string 1)) (s-begin (match-beginning 1)) (s-end (match-end 1)) (beg 
(match-beginning 0)) (end (match-end 0)) (cite-re (format "^\\(%s:\\)" 
(regexp-opt ...))) cite-type) (if (and s (string-match cite-re s)) (progn (setq 
cite-type (match-string 1 s)) (remove-text-properties beg end (quote ...)) 
(add-text-properties beg end (list ... ...)) (set-match-data 
save-match-data-internal (quote evaporate
  org-ref-make-org-link-cite-key-visible(416)
  apply(org-ref-make-org-link-cite-key-visible 416)
  org-activate-bracket-links(416)
  org-agenda-finalize()
  byte-code("\206).
\203(.\n\203..;\203..\306\307\n#\202%.\n\203$.\306\310\n\"\202%.\311\206).\f.\312\313!\210.\2064..@\211.;\203B.\314\315\316\317.#!.\320\321!\210\322\321!\210\323.A\206W..B\206W..C!.A\324
 
.D.\206d..D.E\325.A.E\"\211.F\326=\204{..F\327=\205}..G.G\330\316\331\"\211.H.I.G\203\224..F\326W\203\231..E\202\277.\332\333.E!!.J.G.K.J.KZ.L.E.L\334W\203\271.\326\202\272.\334.L\\Z+\211.MC.N\334.O.P?.Q.R.S\316\211.T.U\316\211.V.W\316\211.X.Y\316\211.L.Z\316\211.[.\\\316\211.].^\316._\335\336.`D.\336.AD.a\257..b.FS\334.c.d.c.dW\203*..n...@t.nb.n.ct\211.c\202..*.N\237\211.N@.].N.e\337.e!@)\206B.\334T.^\340.N@.f.g\341.g!.fL*\210\342.`.f.g\341.g!.fL*\210\343\323.A!.f.g\341.g!.fL*\210.h\204\362..N@.i.N.e\337.e!@).j\344.i!.k\344.j!.l`.T.m\203\262.\345\346.m!\316\347\350$\351\261.\210\202\340.\352.A!\353.j.iZ\354W\203\333..k.lU\203\321.\306\355.k\"\202\334.\306\356.k.l#\202\334.\357\360\261.\210,\361.T`S\347\350\362\317F#\210\363.T!\210.N\211A.N\242\211.L\203\374.\333.L!.Y`.T.L.DU\211.\\\204
 
..Z\204&..L.EU\203&.`.Z\2023..Z\2033..[\2043.`.[.H.I\316.W.I\211A.I\242\211.X\203N.\364\365\215\210\202:..n\203i.\317.o\366\367!\210\370.Y!.V\371.W.V\".W).W\204s..p\203\362..OT.O.q;\203\211.\372.q\373.Y!\"\202\216..q.Y!\351\261.\210\374.T`S\347\375.Y!$\210\374.T`S\362\317$\210\374.T`S\376\317$\210\374.T`S\377.O$\210.\\\203\310.\374.T`S\324\317$\210\201y..W.F.\\#\211.W\203\343.\201z..W\321\"\351\261.\210\374.T`S\201{..L$\210\374.T`S\377.O$\210\202\362..r\203U..]\203U.\330\316\331\"\346.s!\316.t.u..\201|..u\201}.\".u\201~..u\201..]#.u\201~..u\201\200..^#.u\201~..u\201\201.\321#.u\201\202.\201\203..u\"\211.tc\210+eb\210.v\204b.\201\204.
 
\210\201\205.e!\203r.\201\205.d!\204\237.dSb\210\201\206.\201\207.!\210\201\205..Z\206\211.\201\210.!\204\237..Z\206\225.\201\210.b\210\201\206.\201\210.!\210.Z\206\247.\201\210.b\210\361ed\201\211.\321\201\212..`..AE\201\213..b\201\214..w\257#\210.S\201\215.=\203\325.\201\216.
 \210\201\217. \210\317.x\201\220.\357!..\207" [org-agenda-buffer-tmp-name 
org-agenda-sticky org-keys org-match org-agenda-buffer-name start-day format 
"*Org Agenda(%s:%s)*" "*Org Agenda(%s)*" "*Org Agenda(a)*" org-agenda-prepare 
"Day/Week" time-to-days org-read-date nil t org-compile-prefix-format agenda 
org-set-sorting-strategy org-agenda-ndays-to-span org-today 
org-agenda-span-t