Re: [PATCH] Accept more :tangle-mode specification forms

2021-11-20 Thread Greg Minshall
Timothy,

> Just a quick note (see my long recent reply to Tim where I expand on this 
> more),
> but this isn’t new behaviour (isn’t actually affected by my recent changes) 
> and
> my concerns are with the viability of the necessary changes rather than 
> whether
> this would be good (we are of the same mind I think).

yes, i see.  i hadn't realized that.

maybe, though, we could start off by warning people who are writing
integer values; then deprecate it; then, N-releases from now, make it
illegal?

such a path might be worth it.  or, at least the warnings --
irrespective, i would say, of whether or not the decimal value turns
into some "reasonable" file mode value.

cheers, Greg



Re: [PATCH] Accept more :tangle-mode specification forms

2021-11-20 Thread Greg Minshall
hi, Timothy,

> I’ve just pushed three commits that
> 1. Add “o555” as an octal shorthand
> 2. Perform a simple check that integer modes are valid*
> 3. Make the ls-style regex stricter
> ...
> * For example, “:tangle-mode 755” will now produce the warning:
>   “1363 is not a valid file mode octal. Did you give the decimal value 755 by
>   mistake?”. Maybe it would be worth adding “if so try o755” or similar?

i'd push back, even here, on allowing decimal.  file modes are bit
masks.  to me, offering a way to set a bit mask via a *decimal* value
seems a mistake.

my +/- one cent.

cheers, Greg



Re: [PATCH] Accept more :tangle-mode specification forms

2021-11-19 Thread Greg Minshall
> Timothy  writes:

> I would just accept two formats, both being strings with either "o400"
> (or perhaps "#o400") and "u+rwx" symbolic form and anything else
> generates an error (a hard error, not a warning i.e. stop processing,
> don't tangle). 

+1.  (i'm neutral w.r.t. "o400" vs. "#o400".)

cheers, Greg



Re: Tables and org babel

2021-11-08 Thread Greg Minshall
sorry, in fact, =-Q= doesn't matter:

failing:
- Org mode version 9.5 (9.5-g531577 @ 
/home/minshall/.emacs.d/straight/build/org/)

succeeding:
- Org mode version 9.5 (9.5-gced2b3 @ 
/home/minshall/.emacs.d/straight/build/org/)

cheers, Greg



Re: Tables and org babel

2021-11-08 Thread Greg Minshall
my data point:

- emacs -Q: works as (i assume) expected
- emacs: i get an error, with this backtrace

Debugger entered--Lisp error: (wrong-type-argument markerp nil)
  #f(compiled-function () #)()
  org-babel-insert-result((1 2 3 4) ("replace") ("emacs-lisp" "data" ((:var 
data 1 2 3 4) (:colname-names) (:rowname-names) (:result-params "replace") 
(:result-type . value) (:results . "replace") (:exports . "code") (:session . 
"none") (:cache . "no") (:noweb . "no") (:hlines . "no") (:tangle . "no") 
(:lexical . "no")) "" nil 16920 "(ref:%s)") nil "emacs-lisp")
  org-babel-execute-src-block(nil ("emacs-lisp" "data" ((:var data 1 2 3 4) 
(:colname-names) (:rowname-names) (:result-params "replace") (:result-type . 
value) (:results . "replace") (:exports . "code") (:lexical . "no") (:tangle . 
"no") (:hlines . "no") (:noweb . "no") (:cache . "no") (:session . "none")) "" 
nil 16920 "(ref:%s)"))
  org-ctrl-c-ctrl-c(nil)
  funcall-interactively(org-ctrl-c-ctrl-c nil)
  call-interactively(org-ctrl-c-ctrl-c nil nil)
  command-execute(org-ctrl-c-ctrl-c)


i haven't noticed anything weird recently, but this may well be
something in my setup that's odder than "normal org mode" stuff.  so, a
grain of salt is warranted.

cheers, Greg



Re: typescript from org src buffer -- tide, lsp

2021-11-06 Thread Greg Minshall
Tim and Samuel, thanks.  :dir is a thought; and, links may yield
treasures.

cheers, Greg



typescript from org src buffer -- tide, lsp

2021-11-03 Thread Greg Minshall
hi.

i'm wondering if anyone programming in typescript might have run into,
and solved, this "problem", of tangling into a subdirectory, and tide
[1] not being able to resolve "relative" imports.

i have a file in path /a/b/foo.org.  it includes various source blocks,
and they do things like `:tangle c/d/bar.ts`.  another source block,
tangled into in c/d/fubar.ts, say, does something like:

import Bar from "./bar"


when i open an Org Src edit buffer from fubar.ts's source block, with
tide mode [1] enabled, i get a complaint

Cannot find module './bar' or its corresponding type declarations. [2307]

tide (or, really, iiuc, tsserver) appears to be, reasonably, looking for
/a/b/bar.ts, and not finding it.  but, i haven't been able to figure out
how to talk tide into looking elsewhere.

i've done things like add "rootDirs" to `tsconfig.json`, to no avail.  i
haven't been able to get lsp-mode [2] to work for this scenario, either.

anyway, in case anyone has done exactly that, i'm asking.

cheers, Greg

[1] tide: https://github.com/ananthakumaran/tide
[2] lsp:  https://github.com/emacs-lsp/lsp-mode/


ps -- scrounging around trying to deal with this, i stumbled on

https://github.com/justbur/emacs-which-key

which i find a treat.



Re: transclusion, tangling, flycheck/flymake, etc.

2021-11-03 Thread Greg Minshall
Ihor,

thanks for the clarification.

maybe, in that ideal world, <> might expand, optionally.

another point: watching Noboru's "most recent" (9?) video, i see another
feature of his transclusion: a way to say, "this is *exactly* like a
source block -- with language, :results, :tangle, :var, etc.,
... except, the actual code is in some other file: when i hit =C-c C-c=
here, please set up (based on language), include that source, execute
it".

that also might be interesting.  if i were to think of that, i'd say the
verb might *not* be =#+transclude=, but, rather, something source
specific (=#+src_ref=?).  but, it might allow a =:transclude yes=
property.

cheers, Greg



transclusion, tangling, flycheck/flymake, etc.

2021-11-03 Thread Greg Minshall
Ihor,

(Noboru Ota -- i do find transclusion very interesting.)

> 2. A much faster tangle system. If we can directly transclude and sync
>contents of source blocks with actual programming language buffer,
>C-c ' can trivially support flycheck-mode and provide a more
>IDE-like experience while still benefiting from literate
>programming style.

in general, i would like to keep bits of my code in a single .org file,
maybe broken into separate source blocks, with preceding/succeeding
commentary.  then, pulled together in a tangle by a =:tangle= property
(within a subtree) and/or =<>= references.

my thought about flycheck, flymake, whatever, is that (optionally) a
silent, background, =tangle= and/or =<> expansion= would take
place to produce a "full source file buffer"[*], then the narrowed
version of that (corresponding to the part where =C-c '= was issued)
buffer is presented for the user's editing convenience.

your thought here, iiuc, is that source files would live in the file
system, and be transcluded into the .org file.  i can see the utility of
that.  but, i would miss =<>= and also the ability to break the
source code into small chunks for purposes of documentation.

obviously, the two approaches are not mutually exclusive.  but, partly
to make sure i understand your suggestion, i thought i'd mention it.

cheers, Greg

[*] in my scenario, i would find it convenient for the buffer the user
edits to have a file name, with the tangled file's extension; i have a
'package-in-waiting' which has to do some head standing to figure out
the appropriate language [parser] to send to a program =prettier=.

https://git.sr.ht/~minshall/prettied-diff 



Re: tangle option to not write a file with same contents?

2021-10-30 Thread Greg Minshall
Max,

thanks for the reply.

> In the meanwhile I realized that check for modification by user should
> be performed *before* tangle, and hash to detect changes is
> appropriate for such purpose. I think, a copy of tangled file just to
> detect modification will cause some tension from users.

i guess you mean org's current "cache" stuff?

> Comparison of earlier and current tangle results should be done at the
> end, so implementation should be independent. There is no point to use 
> hash, size + byte to byte comparison is fast and reliable.

that makes sense.

cheers, Greg



Re: tangle option to not write a file with same contents?

2021-10-29 Thread Greg Minshall
Max,

> > i wonder if it would be reasonable to add an option such that, when
> > tangling, `org-babel-tangle` would not write a file with the
> > already-existing contents of the target file?
> 
> Are you going to celebrate a decade of the feature request?
> I agree with you, make is wide spread and fast tool that is really
> convenient in simple cases.

hah -- i should have waited a few weeks!

> Some hash-based build systems are mentioned in that thread. Since that
> time more more similar tools have appeared, e.g. buck,
> reimplementations of DJB's redo https://cr.yp.to/redo.html

i think different people will settle on different build tools.

> It seems `compare-buffer-substrings` has more logic than just byte to
> byte comparison. Is it to handle alternatives for unicode character
> alternatives? For tangled buffer it should be size that is checked
> first...

you are right, it definitely makes sense to look first at size.  (which
is what, e.g., rsync(1) does.)  also, probably i needn't have mentioned
`compare-buffer-substrings` -- i was really just trying to suggest
"simple" (which maybe i anti-did?).

cheers, Greg



tangle option to not write a file with same contents?

2021-10-27 Thread Greg Minshall
hi.

i wonder if it would be reasonable to add an option such that, when
tangling, `org-babel-tangle` would not write a file with the
already-existing contents of the target file?

this would be helpful, e.g., for those of us who use make(1)-based work
flows.

then, if this might generally be thought useful, i wonder if this should
be implemented as specifically this, or whether we might implement a
callback at the appropriate point in `org-babel-tangle` asking whether
or not to proceed.  (then, the user's callback routine could do the
comparison.)

if we do "specifically this", i would suggest that this comparison be
dead simple: read in the existing file's contents into some hidden
buffer, and use `compare-buffer-substrings` to compare point-{min,max}
of both.

cheers, Greg



Re: Bug: font-lock error with - in code-mode [9.4.6 (9.4.6-gab9f2a @ /gnu/store/2pny4z6mbi2aybgzzxz0yrzkds7hbpmq-emacs-org-9.4.6/share/emacs/site-lisp/org-9.4.6/)]

2021-10-26 Thread Greg Minshall
> Actually, when I told my daughter I was programming "Woof!" as a tool
> to ensure that important emails where receiving enough attention from
> the community, she suggested I should program something for the "poor
> unimportant emails" out there... of course she'd call it "Mew!"
> 
> And I'm seriously considering this: something like an auto-bumper for
> bug reports and help requests that didn't get any anwer...

:)



Re: Bug: font-lock error with - in code-mode [9.4.6 (9.4.6-gab9f2a @ /gnu/store/2pny4z6mbi2aybgzzxz0yrzkds7hbpmq-emacs-org-9.4.6/share/emacs/site-lisp/org-9.4.6/)]

2021-10-26 Thread Greg Minshall
Bastien,

> PS: I'm not sure how to do this with Woof! but I'm working on the next
> version of Woof! where this will be possible.

i hope you will call the next version: Woof, woof!

:)



Re: Fwd: errors when using org-agenda

2021-10-24 Thread Greg Minshall
Tim,

> The key point to remember is that a mized installation is not about
> loading org sources from two different org versions. The problem is
> about compilation of org where some of the source definitions are
> already loaded (from existing installation) and result in output which
> is a combination of some of the source from the new version mixed with
> definitions from the old version.

hah.  i think you or others have mentioned this before, but i hadn't
understood until now (albeit still vaguely).

thanks!

cheers, Greg



Re: Fwd: errors when using org-agenda

2021-10-23 Thread Greg Minshall
Tim,

i wonder if the emacs variable `load-history` might be of (approximate)
help?  i submit a starter routine below.  as the comments say: caveat,
caveat, caveat.

i don't think something as uncertain as this would be a candidate for
normal run-time checking (and, i'm not even sure when one would want to
run such a thing -- maybe as each module is loaded, if it were faster).
but, maybe it could be run as part of `M-x org-submit-bug-report`?
either to notify the user, or to include with the bug report?

wdyt?  (such a nice acronym!)

cheers, Greg


notice the canned list of files.  one could, i suspect, go find where
org.el came from, then use all the .el files there.  (or the union of
all the files in *all* the directories that loaded an org.el.)


(defun org--check-load-history ( where)
  "check to see if there *appears* to *maybe* have be a \"mixed
  installation\" of org-mode running.  if there appear to be more than
  one directory holding org package(-like) files, the names of those
  directories, along with the relevant files in each, are returned as
  a vector of explanatory strings.  

  this routine is subject to both type I and type II errors (false
  positives, false negatives).  we have a canned list of org .el file
  names, and we look to see if those files exist in more than one
  directory that has been loaded (using the `load-list` variable).

  if there does not appear to be the possibility of a \"mixed
  installation\", the if the optional argument WHERE is non-nil, and
  there is only one directory containing org package(-like) files,
  that directory name is returned.  if WHERE is nil, nil is returned."
  (require 'seq)
  (require 's)

  (let* ((org-files
  '("ob-lob.el" "oc-bibtex.el" "org-crypt.el" "org-persist.el"
"ob-C.el" "ob-lua.el" "oc-csl.el" "org-ctags.el" "org-plot.el"
"ob-R.el" "ob-makefile.el" "oc-natbib.el" "org-datetree.el" 
"org-protocol.el"
"ob-awk.el" "ob-matlab.el" "oc.el" "org-duration.el" "org-refile.el"
"ob-calc.el" "ob-maxima.el" "ol-bbdb.el" "org-element.el" 
"org-src.el"
"ob-clojure.el" "ob-ocaml.el" "ol-bibtex.el" "org-entities.el" 
"org-table.el"
"ob-comint.el" "ob-octave.el" "ol-docview.el" "org-faces.el" 
"org-tempo.el"
"ob-core.el" "ob-org.el" "ol-doi.el" "org-feed.el" "org-timer.el"
"ob-css.el" "ob-perl.el" "ol-eshell.el" "org-footnote.el" 
"org-version.el"
"ob-ditaa.el" "ob-plantuml.el" "ol-eww.el" "org-goto.el" 
"org-version.el~"
"ob-dot.el" "ob-processing.el" "ol-gnus.el" "org-habit.el" "org.el"
"ob-emacs-lisp.el" "ob-python.el" "ol-info.el" "org-id.el" 
"ox-ascii.el"
"ob-eshell.el" "ob-ref.el" "ol-irc.el" "org-indent.el" 
"ox-beamer.el"
"ob-eval.el" "ob-ruby.el" "ol-man.el" "org-inlinetask.el" 
"ox-html.el"
"ob-exp.el" "ob-sass.el" "ol-mhe.el" "org-install.el" 
"ox-icalendar.el"
"ob-forth.el" "ob-scheme.el" "ol-rmail.el" "org-keys.el" 
"ox-koma-letter.el"
"ob-fortran.el" "ob-screen.el" "ol-w3m.el" "org-lint.el" 
"ox-latex.el"
"ob-gnuplot.el" "ob-sed.el" "ol.el" "org-list.el" "ox-man.el"
"ob-groovy.el" "ob-shell.el" "org-agenda.el" "org-loaddefs.el" 
"ox-md.el"
"ob-haskell.el" "ob-sql.el" "org-archive.el" "org-loaddefs.el~" 
"ox-odt.el"
"ob-java.el" "ob-sqlite.el" "org-attach-git.el" "org-macro.el" 
"ox-org.el"
"ob-js.el" "ob-table.el" "org-attach.el" "org-macs.el" 
"ox-publish.el"
"ob-julia.el" "ob-tangle.el" "org-capture.el" "org-mobile.el" 
"ox-texinfo.el"
"ob-latex.el" "ob.el" "org-clock.el" "org-mouse.el" "ox.el"
"ob-lilypond.el" "oc-basic.el" "org-colview.el" "org-num.el"
"ob-lisp.el" "oc-biblatex.el" "org-compat.el" "org-pcomplete.el"))
 (possibles
  (seq-map (lambda (x)
 (cons (file-name-directory (car x))
   (list (file-name-base (car x)
   (seq-filter
(lambda (x)
  (let ((bn (file-name-nondirectory (car x
(seq-contains-p org-files bn
(lambda (e elt) (s-match (concat "^" e 
"$") elt)
load-history
(let ((uniques (seq-uniq (seq-map 'car possibles
  (if (eq 1 (length uniques))
  (if where ; this is the good outcome
  (car uniques))
(seq-map
 (lambda (dir)
   (let ((joined
  (s-join " "
  (seq-map 'cadr
   (seq-filter
(lambda (e)
  (progn
(equal (car e) dir)))
possibles)
 (s-lex-format "from ${dir} have: 

Re: Fwd: errors when using org-agenda

2021-10-23 Thread Greg Minshall
Tim,

thanks.  i see that it is more complicated.

(and, after fifteen years of vi, and now 25 of emacs, i guess i'll skip
the spacemacs experience.  :)

cheers, Greg



Re: org-capture broken?

2021-10-23 Thread Greg Minshall
Ihor,

> > make of org mode?  (remote possibility: emacs?)
> 
> Org mode build process is not standard.  Org mode needs to create
> autoload file and generate documentation in addition to normal
> byte-compilation.

thanks.  does that mean running "make" in the org directory?

cheers, Greg



Re: Fwd: errors when using org-agenda

2021-10-23 Thread Greg Minshall
Tim, et al.,

> These types of errors are frequently caused by a 'mixed' installation
> of org versions. This will happen if you upgrade org when org is
> already loaded in the instance of emacs used to perform the upgrade.

a question: is there any way that we can, as org starts up, detect
either the actuality, or possibility, of a mixed installation?
maybe something like

(assert (eq 1
(length
 (seq-filter
  (lambda (d) (file-exists-p (concat d "/" "org.el")))
  load-path

or some such?  (well, maybe fail in a more user-friendly way... :)

cheers, Greg



Re: org-capture broken?

2021-10-21 Thread Greg Minshall
Ihor,

> Fixed on current main (5315773e8).

confirmed.  thanks!

from a previous e-mail (but, for my future reference):

> Are you on Emacs 24?

i'm on

GNU Emacs 27.2 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.27,
cairo version 1.17.4) of 2021-03-26


> Can you try to run make before your emacs -Q -L...?

make of org mode?  (remote possibility: emacs?)

cheers, Greg



Re: [BUG] "args out of range" on link heading completion [9.5 (9.5-gd361c7 @ /Users/carlos/.emacs.d/straight/build/org/)]

2021-10-21 Thread Greg Minshall
Carlos,

> > ps -- the org-version was
> > : Org mode version 9.5 (9.5-gdc154f @
> > /home/minshall/.emacs.d/straight/build/org/)

> What are these? Seemingly not git revisions. Can I checkout that
> version somehow? If not, pass me your git revision and I will rerun my
> recipe there.

my belief (fwiw) is that the "9.5" is the major release, and the
"dc154f" (after the "9.5-g") is the first 6 characters of the git commit
i happened to be running).

i see that Ihor has reproduced your problem.

cheers, Greg



org-capture broken?

2021-10-21 Thread Greg Minshall
hi.  with a recent org-mode (*), `org-capture` seems to crash with the
message:

Variable binding depth exceeds max-specpdl-size


this happens with (a suitably -L'd) `emacs -Q`
- M-x org-capture
- t
- then crashes

after this crash, i seem to be unable to enter the debugger, etc.
(`(setq debug-on-error t)`) doesn't work after this crash.  my only
recourse appears to be to exit emacs.

stepping through the code, the last routine
was`org-capture-fill-template`.

stepping through this routine, it gets as far as `(org-mode))` in (i
assume)

  (let ((org-inhibit-startup t)) 

and, in "that" routine, the (presumably) infinite recursion/loop
happens.

i'm loathe (intimidated) to follow the trail into the main code.  i
wonder if anyone might have any ideas?

cheers, Greg

(*)
Org mode version 9.5 (9.5-ga149fd @ /home/minshall/.emacs.d/straight/build/org/)



Re: [BUG] "args out of range" on link heading completion [9.5 (9.5-gd361c7 @ /Users/carlos/.emacs.d/straight/build/org/)]

2021-10-20 Thread Greg Minshall
Carlos,

fwiw, using

: emacs -Q -L ~/.emacs.d/straight/build/org foo.org

on my system, i don't seem to be able to recreate this problem.

cheers, Greg

ps -- the org-version was
: Org mode version 9.5 (9.5-gdc154f @ 
/home/minshall/.emacs.d/straight/build/org/)



Re: "begin_src R :session" opens R session when file first visited

2021-10-16 Thread Greg Minshall
Bill,

> I run Org from the source tree, and recently (a couple of weeks ago or
> so) something new started happening with my Org files with R source
> blocks:  when I open one up, an R session automatically starts,
> without me doing anything.

i don't see that behavior.  does it do this for 'emacs -Q' (suitably
tailored to load org mode, set `org-babel-load-languages`, etc.)?

cheers, Greg



Re: How to keep getting org updates

2021-10-13 Thread Greg Minshall
hi, Tim,

> I think it is always a mistake to google for answers without first
> checking what Emacs has in the built-in documentation and manual. What
> is in the Emacs manual or docstrings for variables and functions is
> guaranteed to be accurate for the version of Emacs your running. What
> you find googling and serching reddit, stack overflow, etc is more often
> than not outdated and from what I've seen, often incorrect. A little
> time getting to learn the help commands bound to C-h will save you much
> time in the long run.  

this is undoubtedly true, though i certainly find myself googling a fair
amount, comparing answers to see if there is consensus.  and, then,
often, using those results to dive into the manual (or the mailing list
archives) to see if i can find "official" guidance.

> Running C-h d v package-pinned-packages shows the following, which
> explains how to set the variable for pinning packages.

for example, i might google, and find that `package-pinned-packages` was
a variable of interest.

i strongly agree that staying an "out-of-the-box" user, setting options
with Emacs' customization interface (and, i guess, using ELPA), is the
way to go if you want to be spared of many details (which can be
daunting, and are approximately infinite :).

but, all that said, didn't some of us on the list (even, iiuc, "out of
the box" users) have problems upgrading from previous ELPA'ish versions
of org-mode to the 9.5 version, because of the confusion of ELPA (?)
non-semantic version numbers appearing to be greater than "9.5"?  that
was really what i was considering, and wondering how to document that
issue in the info pages, so the official documentation will, in fact,
help people upgrade.  (though maybe the answer here is, "stay with the
non-gnu ELPA [or base Emacs] version of org-mode you are currently using
until you upgrade to Emacs 28, at which point you will automatically
follow the box to org-mode 9.5"?)

cheers, Greg



Re: How to keep getting org updates

2021-10-13 Thread Greg Minshall
> The install instructions on the main org page were not very clear, to
> say the least.

yes, that does sound messy.  sorry your experience was so unfortunate.

i guess one question for the list: is there a general solution to the
"20200912" > "9.5" issue?  or, "now" that we are only distributing via
[git repository and] gnu elpa, will that issue disappear?  does this
new-fangled concept of "semantic versioning" come into play here?

possibly in the info pages we could have a section on
"re-installing/upgrading", to help people navigate this process.  (once
we, ourselves, have a map.)

cheers, Greg



Re: How to keep getting org updates

2021-10-11 Thread Greg Minshall
Lawrence,

in case it helps, my *straight.el* (not package.el) recipe looks like
this:

(org :type git :repo
 "https://git.savannah.gnu.org/git/emacs/org-mode.git; :local-repo "org"
 :depth full :pre-build (straight-recipes-org-elpa--build) :build (:not
 autoloads) :files (:defaults "lisp/*.el" ("etc/styles/"
 "etc/styles/*")))


cheers, Greg



Re: Someone to help merging orgmode.org/contribute.html and orgmode.org/worg/org-contribute.html ?

2021-10-08 Thread Greg Minshall
Bastien,

> I added you, you can now clone g...@git.sr.ht:~bzg/worg 
> and push commits.

thanks.

cheers, Greg



Re: Someone to help merging orgmode.org/contribute.html and orgmode.org/worg/org-contribute.html ?

2021-10-08 Thread Greg Minshall
Bastien,

> Applied, thanks a lot!  Let me know if you have a user on git.sr.ht, I
> can add you as a regular committer on https://git.sr.ht/~bzg/worg

thanks.  i'm "minshall" there, too.

cheers, Greg



Re: Inequalities in math blocks

2021-10-08 Thread Greg Minshall
Rudolf,

> I do not understand. As Max pointed out, inequalities break HTML
> export in \( and \) as well.

my apologies for not having understood where we were in the discussion!

cheers, Greg



Re: Someone to help merging orgmode.org/contribute.html and orgmode.org/worg/org-contribute.html ?

2021-10-08 Thread Greg Minshall
Bastien,

> thanks a lot for volunteering, but I did the merge a few days ago.

great!

> Perhaps you can still carefully proofread
> https://orgmode.org/worg/org-contribute.html and enhance it?

sure.  some comments and a patch (and, without the nice css, the .html
file it generates, just for ease of reviewing).

i was thinking of (more or less) sorting the "ways to contribute" in
terms of difficulty/level of expertise required.  the below patch tries
to do this (ysomv -- your sort order may vary).

other than that, i did a bit of editing, added a few links and
footnotes, etc.

nit: i don't know how widespread this is, or whether it matters when someone
is looking on worg about how to contribute, but my setup (arch linux,
qutebrowser) doesn't include
: "C-x 8 RET 1f984" or "C-x 8 RET UNICORN FACE"

hope it's of use.

cheers, Greg

>From 8cf98908c94c2f8bbc0abcfc5cf948dc0a0820e3 Mon Sep 17 00:00:00 2001
From: Greg Minshall 
Date: Fri, 8 Oct 2021 15:08:17 +0300
Subject: [PATCH 2/2] org-contribute.org: Edit and re-organize slightly

---
 org-contribute.org | 90 --
 1 file changed, 48 insertions(+), 42 deletions(-)

diff --git a/org-contribute.org b/org-contribute.org
index a21c5223..d684ccdb 100644
--- a/org-contribute.org
+++ b/org-contribute.org
@@ -19,48 +19,54 @@
 
 The Org codebase is large, and contributing can be daunting at first,
 but don't hesitate to call for directions on [[file:org-mailing-list.org][the mailing list]].  If you
-are willing to help, there is plenty of low-hanging fruits for you and
+are willing to help, there is plenty of low-hanging fruit for you, and
 the community will welcome your contribution.
 
-: When contributing, always beware of the maintenance burden:
-: are you alleviating it or are you adding to it?
+: When contributing, always keep the maintenance burden in mind:
+: are you alleviating it, or are you adding to it?
 
 * Ways to contribute 濾
 :PROPERTIES:
 :CUSTOM_ID: types-of-contributions
 :END:
 
-- *Maintain an Org file*: If a file in the git repository does not have
-  a maintainer, and you want to help by maintaining it, please read
-  more on [[file:org-maintenance.org][how Org is maintained]] and let us know by sending an email to
-  [[file:org-mailing-list.org][the mailing list]].
+** Ways that do not involve programming
 
-- *Check the [[https://updates.orgmode.org/#help][requests for help]]*: If you want to help with one of these
-  tasks, say so on the list.
-
-- *Check the [[https://updates.orgmode.org/#bugs][list of confirmed bugs]]*: Even if you just provide more
-  information or ideas on how to fix them, this helps.
+- *Send bug reports*.  Before sending a bug report, make sure you read
+  the section of the manual on how to provide useful [[https://orgmode.org/org.html#Feedback][feedback]] or this
+  other great text: [[http://www.chiark.greenend.org.uk/~sgtatham/bugs.html][How to Send Bug Reports Effectively]].
 
 - *Try to reproduce bugs*: That's always very helpful.  Do subscribe to
   [[https://lists.gnu.org/mailman/listinfo/emacs-orgmode][Org's mailing list]] and monitor new unreferenced bugs.  Try to
   reproduce them.  If you can reproduce a bug, reply to the original
-  poster and add =X-Woof-Bug: confirmed= to your mail headers, and the
+  poster and add [[https://github.com/bzg/woof][=X-Woof-Bug: confirmed=]] to your mail headers, and the
   bug will then be shown on [[https://updates.orgmode.org/#bugs][updates.orgmode.org]].
 
 - *Help other users by replying to their questions* [[file:org-mailing-list.org][on the mailing list]]
   or on [[file:org-web-social.org][other web places]].
 
-- *Send bug reports*.  Before sending a bug report, make sure you read
-  the section of the manual on how to provide useful [[https://orgmode.org/org.html#Feedback][feedback]] or this
-  other great text: [[http://www.chiark.greenend.org.uk/~sgtatham/bugs.html][How to Send Bug Reports Effectively]].
-
-- *Submit patches* to the mailing list.  See how to format [[#first-patch][your first
-  patch]] and [[#patches][details on how to submit it]].
-
 - *Contribute to Worg*.  Worg is collaborative documentation made of Org
   files.  It's very easy to contribute to it.  Learn more [[file:worg-about.org][about Worg]]
   and [[file:worg-about.org::*How to use git for Worg][how to contribute]].
 
+- *Share ideas and feature requests*.  Org is already mature, but new
+  ideas keep popping up.  If you want to request a feature, first dig
+  into [[file:org-mailing-list.org][the mailing list]] to find similar proposals.  If you cannot find
+  any, subscribe to the list, read it for a while, then make your
+  proposal.  Formulate it with as much detail as possible, especially
+  with examples.
+
+** Ways that involve programming
+
+- *Check the [[https://updates.orgmode.org/#help][requests for help]]*: If you want to help with one of these
+  tasks, say so on the list.
+
+- *Che

Re: Someone to help merging orgmode.org/contribute.html and orgmode.org/worg/org-contribute.html ?

2021-10-07 Thread Greg Minshall
hi, Bastien,

in the absence of any other volunteer, i'd be happy to produce a merge
for review.  (though it might take a few weeks.)

cheers, Greg

> as the subject says: 
> 
> https://orgmode.org/contribute.html is very straightforward and
> https://orgmode.org/worg/org-contribute.html is very complete.
> 
> I think we should merge both pages into worg/org-contribute.org,
> the page that we recommand users to read in general.
> 
> The page would start with simple "calls to action" and progress
> toward more informative sections.
> 
> It's a delicate balance to have -- but having two pages for the
> same purpose isn't very good today.
> 
> Anyone?
> 
> -- 
>  Bastien
> 



Re: Inequalities in math blocks

2021-10-07 Thread Greg Minshall
Timothy,

> I’m thinking we should perhaps update the docs to more strongly
> recommend `\( ... \)' over `$ ... $'. So that someone coming from say,
> Markdown + $-math or (not-La)TeX doesn’t just go “cool, $ works, I’ll
> keep on using that”.

i think that would be a helpful change.

cheers, Greg



Re: Inequalities in math blocks

2021-10-07 Thread Greg Minshall
Rudolf,

> FYI: I have just discovered that this bug screwed up a paper I
> submitted to university this week. In the paper, I wrote the
> following: "[…] every term $t\in{}q$ with $idf(t)>c$ for some constant
> $c$ […]", and the "idf(t) > c" part got exported as "idf(t)". I cannot
> fix the paper at this point. Uh-oh!

oof.  \(...\) is the way to go.

cheers, Greg



Re: Grabbing the link to a message on the archive

2021-10-01 Thread Greg Minshall
Max,

yeah, interesting -- thanks for the elaboration/exploration!

cheers, Greg



Re: [PATCH] Don't fill displayed equations

2021-10-01 Thread Greg Minshall
hi, Timothy, et al.,

like Tim, i can see both sides here.  but, a fundamental of org-mode is
this statement of Nicolas', "Org is not a LaTeX front-end."

i ran into this precisely with $...$, i.e., the restrictions that
org-mode requires, in order to protect from confusing a currency
indicator with an equation.

my "take away" from that issue (a long time ago) was that i needed to
drop the idea of "org mode latex syntax support" == "latex syntax
support".  but, i remember to not finding the conclusion pleasant
(though, by now, i no longer notice it).

cheers, Greg



Re: Grabbing the link to a message on the archive

2021-09-30 Thread Greg Minshall
Timothy,

> If you use mu4e, the following may be of some interest:
> ┌
> │ (defun +mu4e-ml-message-link (msg)
> │   (cond
> │((string= "emacs-orgmode.gnu.org" (mu4e-message-field msg :mailing-list))
> │ (message "Link %s copied to clipboard" (gui-select-text (format 
> "https://list.orgmode.org/%s; (mu4e-message-field msg :message-id)
> │(t (user-error "Mailing list %s not supported" (mu4e-message-field msg 
> :mailing-list)
> │ (add-to-list 'mu4e-view-actions (cons "link to message ML" 
> #'+mu4e-ml-message-link t))
> └

awesome!  i didn't realize that the Message-ID was the key to the
specific e-mail at list.orgmode.org!

cheers, Greg



Re: orgmode.org setup

2021-09-29 Thread Greg Minshall
Bastien,

thanks very much for all of this information.

> I plan to work on improving Woof! in the next months to make it more
> stable and (hopefully) usable and useful, but it helps a lot already.

if Woof! is even part of how you have managed to keep track, and manage,
the myriad of mailing list requests, it's already more valuable than its
weight in whatever measure.  watching over the last couple of weeks as
you've wrangled through the set of issues has been awe-inspiring.

> https://list.orgmode.org is the public-inbox archive of the mailing
> list.  It's hosted and maintained by Kyle.  The mailing list archives
> are also here: https://lists.gnu.org/archive/html/emacs-orgmode/

i love the searching on list.orgmode.org, but i have this recurrent
dream: that some day each e-mail message will come with a header listing
the URL for that message on https://list.orgmode.org.  (though i also
worry this might open us up to some sort of spam, or other, attack?)

and, i'll add my thanks and congratulations on 9.5!

cheers, Greg



Re: [PATCH] Treat :tangle-mode as an octal value not integer

2021-09-29 Thread Greg Minshall
Tomas,

in fact, i'm quite used to doing `chmod 755 foo.org`.  i do it now in
bash, used to do it in csh, and it seems to work (as expected, afaict)
also in sh.  all on arch linux.  (`chmod +755 foo.org` *does* seem to
give odd results. :)

cheers, Greg



Re: [PATCH] Treat :tangle-mode as an octal value not integer

2021-09-29 Thread Greg Minshall
Tomas,

> Why not recommend Elisp's explicit syntax for octal representation,
> i.e. :tangle-mode #o660? And put a prominent note in the docs,
> of course.

as much as my fingers are used to "0660 ==> octal", this probably makes
sense.

on the other hand, to protect users, might it be worthwhile ("just due
to the context") to flag ":tangle-mode 0..." integers as an error for
the user to deal with?  (and point them at, e.g., #o660.)

cheers, Greg



Re: Bug: :session results in unfriendly error reporting

2021-09-27 Thread Greg Minshall
(all -- just re-sending this with the WOOF header... the original thread
is at https://list.orgmode.org/87ee9aquje@gnu.org/T/#t )

Tim,

thanks.

> It isn't so much that nothing is possible but rather nobody has
> implemented a consistent model which can be adopted and has been
> implemented by all backends. This is why I consider this to be a
> feature request and not a bug report. This is not expected/defined
> behaviour which is not behaving according to spec - this is new
> unimplemented behaviour, a new feature which needs to be designed and
> implemented across all backends.

yes, i agree this is really a feature request.  in general, as far as i
can see, consistency across languages "at the fringes", is pretty much
"a work in progress" (or not, as the case might be).

if there is ever the chance to detect and propagate errors in :session,
that would be great.  (and, again "in general", trying to reduce the
[reducible] gap between non- and :session, across languages, would be a
nice goal.)

cheers, Greg



Re: [PATCH] Re: worg patch: R usage of :colnames for :results

2021-09-27 Thread Greg Minshall
Bastien,

> Applied, thanks, but I removed the reference to X-Woof-Patch here.

thanks.  yes, makes sense -- i was hesitant to mention it, on a
"beginner" page.

cheers, Greg



[PATCH] Re: worg patch: R usage of :colnames for :results

2021-09-26 Thread Greg Minshall
Bastien,

> I'm not sure what you mean, can you elaborate?

if a picture is worth a thousand words, what's a patch worth?  :)

thanks for the pointer to the orgweb sources.

cheers, Greg

>From 2594db749de7ae5ec9400b4397b0ba21d9526c9b Mon Sep 17 00:00:00 2001
From: Greg Minshall 
Date: Mon, 27 Sep 2021 08:03:42 +0300
Subject: [PATCH] contribute.html: Suggest '[PATCH]' on Subject: line when
 submitting patches

contribute.org: Modify text.

Also pointer to X-Woof-Patch as an alternative.
---
 contribute.org | 9 ++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/contribute.org b/contribute.org
index 41ef346..bad79e4 100644
--- a/contribute.org
+++ b/contribute.org
@@ -120,10 +120,13 @@ More formally,
 
 ** Sending patches
 
-Use ~git diff~ or ~git format-patch~ to generate the patch files and then
-include them in an email to [[mailto:emacs-orgmode@gnu.org][emacs-orgmode@gnu.org]] describing what
+Use ~git diff~ or ~git format-patch~ to generate the patch files and
+then include them in an email to [[mailto:emacs-orgmode@gnu.org][emacs-orgmode@gnu.org]] describing what
 you've done.  If you have configured git to use [[https://git-send-email.io/][send-email]], then you
-can use that.
+can use that.  If you are able to add the phrase =[PATCH]= to the
+beginning of the Subject: line of your e-mail, that will help to
+manage your submission.[fn:: Adding a [[https://github.com/bzg/woof]["X-Woof-Patch;]] header to your
+e-mail can also accomplish this.]
 
 If your mail has not appeared on [[https://list.orgmode.org/][the list]] after waiting at least 15
 minutes, it may have been flagged as spam by the robot email
-- 
2.32.0



Re: [PATCH] async process in R

2021-09-26 Thread Greg Minshall
hi, Jeremie,

> Many thanks for the feedback, assigning yes or no to async will work
> as expected.

thanks for the answer.

> I am not sure if it is a desirable feature or not.

if this is not already idiomatic for org mode, i'd vote to require the
"yes" or "no".  just my 2 cents.

cheers, Greg



Re: [PATCH] async process in R

2021-09-26 Thread Greg Minshall
Jeremie,

a question.  in

> #+begin_src R :session *R* :results value :async :colnames yes
> Sys.sleep(10)
> as.list(1:5)
> #+end_src

i was surprised by =:async= standing alone, i.e., with no following
"yes" or "no".  is that an org-mode "idiom"?  i.e., unadorned header
arguments default to (some form of) "yes"?

cheers, Greg



Re: worg patch: R usage of :colnames for :results

2021-09-26 Thread Greg Minshall
Bastien,


> Applied againt worg, thanks!

thanks.

> You simply need to add [PATCH] to the subject of your email, it will
> be listed in https://updates.orgmode.org.  You can also manually add
> X-Woof-Patch: yes -- see https://github.com/bzg/woof for details.

maybe some comments/links at https://orgmode.org/contribute.html ?  i'm
not sure where those sources live, or i'd X-Woof a [PATCH].  :)

cheers, Greg



worg patch: R usage of :colnames for :results

2021-09-26 Thread Greg Minshall
hi.  i occasionally need to look up how to get header lines on tables
resulting from an evaluation of an R source block.  the answer is
=:colnames yes=.  here's a patch that minimally documents that.

cheers, Greg

ps -- i have some vague memory i'm supposed to hack in a "woof" header.
but, it's not mentioned on https://orgmode.org/contribute.html so i've
lazily not.

>From e0978a33a70a885db9d3383621c6ccfa97e5519a Mon Sep 17 00:00:00 2001
From: Greg Minshall 
Date: Sun, 26 Sep 2021 17:50:01 +0300
Subject: [PATCH] Add mention of :colnames effect on :results

org-contrib/babel/languages/ob-doc-R.org: added paragraph about effect
of `:colnames' on output.
---
 org-contrib/babel/languages/ob-doc-R.org | 4 
 1 file changed, 4 insertions(+)

diff --git a/org-contrib/babel/languages/ob-doc-R.org b/org-contrib/babel/languages/ob-doc-R.org
index 79d79bf2..16ee2ba6 100644
--- a/org-contrib/babel/languages/ob-doc-R.org
+++ b/org-contrib/babel/languages/ob-doc-R.org
@@ -138,6 +138,10 @@ both 32bit and 64bit binaries. The above path points to the 32bit paths; for
 
 There are no R-specific /default/ header arguments.
 
+The =:colnames= header argument is used to specify that both *input*
+tables (via a =:var= header argument), and output tables (via
+=:results=) (should) have headers.
+
 If a =:file filename.ext= header argument is provided to an R source
 block, then the output from the source block will go to the named
 file. What that output is depends on the value of the =:results=
-- 
2.32.0



Re: [PATCH] extra space at the end of lines in source

2021-09-26 Thread Greg Minshall
Bastien,

> Applied, thanks!

thank *you*!



Re: [PATCH] Include support for evaluating julia code

2021-09-24 Thread Greg Minshall
Timothy, Pedro,

would it make sense to consider Pedro's patch as being against the one
in org-contrib?  (i'm not sure how such patches work.)

cheers, Greg



Re: Bug Re: Greater than, less than bug in emacs-lisp source block

2021-09-05 Thread Greg Minshall
hi, all.

Arthur Miller  wrote:

> Well, in this case it is a tool deficiency, if you don't like gt, than use
> use "greater-than", it can't be more clear intent? After all, this is a lisp, 
> and
> '>' is just a symbol name, like any other. For the inclusion of code, yes, but
> that is why we have (with-eval-after-load 'org ...).

i'll note that in R, the assignment operator is (most often) "<-".  i
see issues there, also, in inline source blocks.  i then use [C-c '] to
open a source block, and can balance my parentheses to my heart's
content.  it's somewhat of an annoyance.

also, there's something called "polymode" (?) which might someday
provide this "multi-major" service in .org files.  i haven't been able
to make it work with org mode, and i think i've heard that same thing
from others on this list.

cheers, Greg



Re: [PATCH] Re: New source block results option for attaching file to node

2021-09-02 Thread Greg Minshall
Ryan, et al.,

i'm not entirely following the discussion, as i don't use "attaching".
but, fwiw, if i did, i can imagine wanting to have input files and
output files in separate directories.  (for ease in "make clean", if for
no other conceptual reason.)  (but, probably i don't understand.)

cheers, Greg



Re: forms and org-mode

2021-08-21 Thread Greg Minshall
Ihor,

> A possible alternative to forms could be using custom capture templates
> for table lines. You can restrict the captured information to a specific
> list or a function (like org-read-date).

wasn't there also some talk a while back about whatever form'ish
technology "magit" uses?  my sense was it provides something similar to
Emacs forms.

cheers, Greg



Re: Bug: :session results in unfriendly error reporting

2021-08-17 Thread Greg Minshall
Tim,

thanks.

> It isn't so much that nothing is possible but rather nobody has
> implemented a consistent model which can be adopted and has been
> implemented by all backends. This is why I consider this to be a
> feature request and not a bug report. This is not expected/defined
> behaviour which is not behaving according to spec - this is new
> unimplemented behaviour, a new feature which needs to be designed and
> implemented across all backends.

yes, i agree this is really a feature request.  in general, as far as i
can see, consistency across languages "at the fringes", is pretty much
"a work in progress" (or not, as the case might be).

if there is ever the chance to detect and propagate errors in :session,
that would be great.  (and, again "in general", trying to reduce the
[reducible] gap between non- and :session, across languages, would be a
nice goal.)

cheers, Greg



Re: Bug: :session results in unfriendly error reporting

2021-08-16 Thread Greg Minshall
Charles,

being sympathetic with the idea of better error reporting, i'm curious
about the following.

> Right. But there is no error as far as babel is concerned. R has
> handled the condition. So there is nothing for babel to see/do.
...
> Running R in this fashion starts a fresh process which signals an
> error that babel can handle.  I see no easy way to get sessions to
> sends signals that babel can process.

what is going on here?  is the issue that in the no-session case, the R
process exits with a non-zero exit code, and that is how "babel" picks
up on it?

i put "babel" in quotes ("\"babel\"" :) above, because, in my simple
mind, babel isn't just the main bit that runs inside org/emacs, but also
some glue bits that run in the various languages' environments.  things
like initializing variables, and harvesting results.  so, might one not
argue that checking execution status, in a session environment, could
also be part of babel?

cheers, Greg



Re: return column from table as a column

2021-08-13 Thread Greg Minshall
> > t(data=s1[,3])

(sorry, i thought we were in R-land... :(



Re: return column from table as a column

2021-08-13 Thread Greg Minshall
Roger,

> Is there some means of changing 'data=s1[,3]' to accomplish this?

there may be some more formal way (and i think some of the
data.frame.alternative packages, like data.table:: or dplyr::, have
their own ways), but you might try transposing

> t(data=s1[,3])

cheers, Greg



Re: Library of Babel usage of other programming languages than elisp

2021-08-09 Thread Greg Minshall
Zelphir,

> So I still have not understood, what the actual issue is with the
> timediff function. Perhaps it is something about the imports.
>
> Thanks for taking the time to try and reproduce the behavior!

you're welcome.  if there's something else i might try, i'll be happy to
try (to try).

good luck.

cheers, Greg



Re: Library of Babel usage of other programming languages than elisp

2021-08-09 Thread Greg Minshall
Zelphir,

actually...

Everybody,

i have an awkwardness about not being clear of the meaning of "Library
of Babel".  my sense is it a collection of "subroutines".

in my typical use of Org mode for programming, all my code blocks are
defined in the same .org file, and executed in that file, or tangled to
external files (normally, scripts).  i do use <> to include bits
from one part of the same file to the code in another part.  i don't
know if this means i am using the Library of Babel or not.

then, on to...

Zelphir,

i also don't know what is going on.  but, installing geiser,
geiser-guile, and running your code from the source block, looking at
the output results, i get an error that might mean something to you?
see below.  (notice i embedded your call to =org-lob-timediff= at the
end of your source code.)

in addition to with elisp, i use org src blocks with R, shell scripts,
awk, etc.  but, never (till now!) with scheme.

hth.  good luck.  i'll be curious what your next steps are.

cheers, Greg


#+HEADER: :var dt1="uninitialized1" dt2="uninitialized2"
#+name: org-lob-timediff
#+begin_src scheme :results output
  (import
   (ice-9 format)
   (srfi srfi-19))


  (define org-timestamp->time-utc
(λ (timestamp-string)
  (let ([parsed-date (string->date timestamp-string "[~Y-~m-~d ~a ~H:~M]")])
(date->time-utc parsed-date


  (define duration->hours
(λ (duration)
  ;; 1h = 60min = 3600s
  (/ (time-second duration) 3600)))


  (define org-lob-timediff
(λ (org-dt1 org-dt2)
  ;; formatting float:

  ;; ~@width, decimals, scale, overflowchar, padchar

  ;; ~ placeholder is following
  ;; @ with sign if negative
  ;; width: minimum width
  ;; decimals: minimum number of digits after decimal point
  ;; scale: ???
  ;; overflowchar: ???
  ;; padchar: char to use for padding

  (format #f
  "~,2f"
  (number->string
   (exact->inexact
(duration->hours
 (time-difference (org-timestamp->time-utc org-dt2)
  (org-timestamp->time-utc org-dt1
  (org-lob-timediff "[2021-01-01 Fri 00:00]" "[2021-01-01 Fri 01:45]")
#+end_src

#+RESULTS: org-lob-timediff
: ice-9/boot-9.scm:222:17: In procedure map1:
: Syntax error:
: unknown file:12:0: definition in expression context, where definitions are 
not allowed, in form (define org-timestamp->time-utc (λ (timestamp-string) (let 
((parsed-date (string->date timestamp-string "[~Y-~m-~d ~a ~H:~M]"))) 
(date->time-utc parsed-date
: 
: Entering a new prompt.  Type `,bt' for a backtrace or `,q' to continue.
: scheme@(guile-user) [1]> 



Re: Help requested: Support for basic Org mode support in tools outside of Emacs

2021-08-03 Thread Greg Minshall
Karl,

orgtbl-query is a script for querying tables in .org files.  it doesn't
do any special text formatting.

https://gitlab.com/minshall/orqtbl-query

cheers, Greg



Re: org-cite-list-bibliography-files

2021-07-25 Thread Greg Minshall
Bruce,

from the outside here.  just wondering.

> Maybe this should be flipped, so we can still have the flexibility to
> combine both, but default is local has precedence?
> 
> So in other words, one has to explicitly turn on the global
> bibliography locally.
> 
> org-cite-global-bibliography: t

is a reasonable approach: if local, use just that; if no local, use
global (if it exists).

then, the "alternative" might be: use both local and global?

cheers, Greg



Re: Influence the table separator in a code block

2021-07-13 Thread Greg Minshall
fwiw, this may depend on the source language (rather than -- solely? --
on org interpretation of the output block:

#+begin_src R
  data.frame(a=c("this", "is", "a", "test"), b=c("tset", "a", "si", "oot, 
siht"))
#+end_src

#+RESULTS:
| this | tset  |
| is   | a |
| a| si|
| test | oot, siht |



Re: [PATCH] extra space at the end of lines in source

2021-07-10 Thread Greg Minshall
hi.  i don't know who might merge Sébastien Miquel's fix into the source
code, but i'd be a promoter of this happening whenever it's convenient.

cheers, Greg

Sébastien Miquel  wrote:

> Greg Minshall writes:
> > thanks.  my trivial test shows this works*except*  in the particular
> > case where, when closing the Org Src buffer, `point` is on an empty
> > line.  in this case, that one empty line is given extra spaces.
> Yes, I was aware of this, but didn't think we could do better in this
> case. I've
> thought about it some more, and came up with a solution.
> 
> Here's a new patch that's smarter about indenting the current line,
> and resolves
> this remaining issue.
> 
> Regards,
> 
> -- 
> Sébastien Miquel
> 



Re: Citations merged!

2021-07-09 Thread Greg Minshall
Nicolas,

> It took years, but citations are now full part of Org syntax.

as others are saying and thinking, thank you all very much.  being an
ignorant observer of this process, i was (not surprised, but, still) in
amazement at all the expertise and technical work so many put in to
developing and refining this feature.  a wonderful example.

cheers, Greg



Re: [wip-cite-new] Merging tomorrow?

2021-07-08 Thread Greg Minshall
Matt Price  wrote:

> Really, I feel like there should be a parade.

+1



Re: [R example for org-table with ifs]

2021-07-08 Thread Greg Minshall
Uwe,

> Thanks but I have to disappoint you the correct result should be 10.1

ah, well.  :)

i realized you probably wanted the table back.  below it is, with your
explanation of "@3$3".

> Thanks I will play around a bit, but for the moment I think I have to
> stick with calc

well, takes all kinds.  :)

cheers, Gerg



#+begin_src R :var some=thing :session R :colnames yes
  ## in imported colnames, spaces are replaced with periods
  some[, "Result"] <-
ifelse(some[, "DMNI.H"] > 10, (some[, "DMNI.H"] - 10.0) *
 (some[X == "Weight:", "Weight2"]),
   0.0) +
(min(10, some[, "DMNI.H"]) * some[X == "Weight:", "ExNDM.I"]) +
(ifelse(some[, "ExNDNM.J"] > 10, some[, "ExNDNM.J"] - 10 *
 some[X == "Weight:", "DMNI.H"], 0)) +
(min(10, some[, "ExNDNM.J"]) *
 some[X == "Weight:", "ExNDNM.J"]) +
(some[X == "Weight:", "Result"] *
 some[, "Result"])

  some
#+end_src

#+RESULTS:
| X   | DMI.G | DMNI.H | ExNDM.I | ExNDNM.J | Result | Weight2 |
|-+---++-+--++-|
| Weight: | 1 |0.2 |   1 |  0.1 || 0.1 |
| User1   | 0 |  0 |  11 |0 |   10.1 | |



Re: [R example for org-table with ifs] (was: [External] : Re: export org table to other formats (gnumeric or scalc or xlsx))

2021-07-07 Thread Greg Minshall
Uwe,

well, *i* no longer remember how to read calc-like expressions.  and,
i'm a notoriously poor R coders.  assuredly the following is not doing
what you want, but possibly you'll get the idea.  (if 102.01 is, indeed,
the correct answer, feel free to buy me a hot fudge sundae some day. :)

cheers, Greg

#+name: thing
| / | <>  |<> | <> |  <> |   <> | <> | <>  |
|   | | DMI G | DMNI H | ExNDM I | ExNDNM J | Result | Weight2 |
|   | Weight: | 1 |0.2 |   1 |  0.1 || 0.1 |
|---+-+---++-+--++-|
|   | User1   | 0 |  0 |  11 |0 | 10.1   | |
|---+-+---++-+--++-|
#+TBLFM: $7=if($3>10,($3-10)*@3$8,0)+ min(10,$3)*@3$3+ min(10,$4)*@3$4 + 
if($5>10,($5-10)*@3$8,0)+min(10,$5)*@3$5 +@3$6*$6;f1::

- does "@3$3" mean the third column in the third row?
  - is that the "DMNI H" column?
  - is that the "User1" row?

i replace "@3" with the last row of the input table.

#+begin_src R :var some=thing :session R :colnames yes
  ## in imported colnames, spaces are replaced with periods
  some[,"Result"] <- ifelse(some[,"DMNI.H"] > 10, (some[, "DMNI.H"] - 10.0) *
 (some[nrow(some), "Weight2"]),
0.0) +
(min(10, some[, "DMNI.H"]) * some[nrow(some), "ExNDM.I"]) +
(ifelse(some[, "ExNDNM.J"] > 10, some[, "ExNDNM.J"] - 10 * some[nrow(some), 
"DMNI.H"], 0)) +
(min(10, some[, "ExNDNM.J"]) * some[nrow(some), "ExNDNM.J"]) +
(some[nrow(some), "Result"] * some[, "Result"])
#+end_src

#+RESULTS:
|  x |
||
||
| 102.01 |



Re: how to avoid 0.0 in an org-table

2021-07-07 Thread Greg Minshall
Uwe,

your mileage may vary, but try
: #+TBLFM: $5=vsum($1..$4);f1::$6=min(10,$4)*0.1;%0.1g

(=man 3 printf= sort of implies that behavior might work for =%g=.)

cheers, Greg



Re: [PATCH] Allow tangling to a list of files

2021-07-07 Thread Greg Minshall
Vladimir,

> I couldn't find in Org manual how tangling should work if there are
> several source code blocks with the same file name for ':tangle'. The
> Org manual section "15.8 Extracting Source Code" is a bit
> obscure. There are these two sentences

i think what Tim answered is correct.  but, i believe the "desired"
approach is to put all those blocks to be tangled to the same file under
a headline with a property drawer containing something like:

:header-args+::tangle "submsim.jl"


i believe this is for performance of tangling, but possibly the
"multiple source blocks to same :tangle'd file" feature may disappear?

cheers, Greg



Re: [PATCH] Allow tangling to a list of files

2021-07-05 Thread Greg Minshall
hi, Jacopo,

i'm not convinced this is needed over and above your old "solution" of
using <> witn N-different source blocks, each :tangle'ing to a
different file.

but, i'm curious -- in the example you sent, did you miss a ":tangle" on
the "#+begin_src" line?

> #+begin_src sh '("filename1" "filename2")
> #my script
> #+end_src

cheers, Greg



Re: [External] : Re: export org table to other formats (gnumeric or scalc or xlsx)

2021-07-05 Thread Greg Minshall
Eric,

> But I feel your pain.  I have to collaborate with people using Excel &
> co. and it is a nightmare.

to be fair, though (though, who says you have to?), imagine some poor
excel user receiving your .org file and trying to decode
org/calc-inspired formulae!  :)

cheers, Greg



Re: using previous =#+results= when =:eval never=

2021-07-03 Thread Greg Minshall
Chuck,

thanks.  (i'm not surprised at an e-lisp suggestion from you! :)

i worry about accidental modification of the base case results during
the chaos of development.  it occurs to me (reading through
(org-babel-ref-resolve)) to keep my base case source blocks marked with
[:results silent], which should prevent accidental modification. (*)

then, i would change [:results silent] to, e.g., [:results silentx], in
the base case source blocks whenever i wanted to re-create those
results.

for, e.g., inspecting the results when things differ, it would be nice
to stay in the language of the rest of the code.  but i suspect i'll be
able to do some e-lisp magic on the RHS of a :var, e.g., crudely

: #+begin_src R :var basecaseresults=(org-babel-read-named-result 
"testcountsdecompose")

i'll play around with it.  (i suspect i'll be motivated to use an e-lisp
macro, to eliminate the quotes, for example.)

again, thanks.

cheers, Greg

(*) this relies on current org-mode behavior, where
(org-babel-read-result) will return results from a result block from a
source block marked [:results silent].  i have no idea how likely this
behavior is to change in the long run.



using previous =#+results= when =:eval never=

2021-07-03 Thread Greg Minshall
hi.

i am trying to simplify adding regression test cases to a program.

to generate the base, "compared-to" results, i want to write some code
in a source block, then evaluate it, producing the "true" value.

then, later during development, i want to check if the code that ran in
that block gives the same results.  to do this, i preface the test check
block with, e.g., =:var fu=bar=.  obviously, i do *not* want to
re-create the base results; so, after producing the base case results, i
tried marking the source block that produces the results =:eval never=.

but, doing that, using `:var fu=bar` on a test check source block, fu's
value is nil. (*)

is there a way to convince org-mode to, in the face of =:eval never=, go
ahead and pass the *previous* results?  or, some other idea of how to do
this?  there will be a large number of these test cases.

cheers, Greg

(*) this is sort of confusing, so here's an example:

#+begin_src org
  ,#+name: testcountsdecompose
  ,#+begin_src R :eval never
mtcars[1:3,]
  ,#+end_src
  
  ,#+RESULTS: testcountsdecompose
  |   21 | 6 | 160 | 110 |  3.9 |  2.62 | 16.46 | 0 | 1 | 4 | 4 |
  |   21 | 6 | 160 | 110 |  3.9 | 2.875 | 17.02 | 0 | 1 | 4 | 4 |
  | 22.8 | 4 | 108 |  93 | 3.85 |  2.32 | 18.61 | 1 | 1 | 4 | 1 |
  
  ,#+name: testcounts
  ,#+header: :var testcountsdecompose=testcountsdecompose :results output
  ,#+begin_src R
str(testcountsdecompose)
  ,#+end_src
  
  ,#+RESULTS: testcounts
  :  chr "nil"
#+end_src

whereas, if the =testcountsdecompose= source block does *not* have
=:eval never=, my =testcountsdecompse= variable has all the rows and
columns i was hoping for.



Re: The git repo for contrib packages

2021-06-30 Thread Greg Minshall
Vikas,

i *believe* this to be the current org-contrib repo

https://git.sr.ht/~bzg/org-contrib


cheers, Greg



Re: do not attempt to clean the (no-longer-existent) ./contrib directory

2021-06-26 Thread Greg Minshall
Nicolas,

> Oops, this one had almost fallen through the cracks! Applied. Thank you

thank you!  Greg



Re: [PATCH] extra space at the end of lines in source

2021-06-26 Thread Greg Minshall
Sébastien Miquel,

> > thanks.  my trivial test shows this works*except*  in the particular
> > case where, when closing the Org Src buffer, `point` is on an empty
> > line.  in this case, that one empty line is given extra spaces.
> Yes, I was aware of this, but didn't think we could do better in this
> case. I've
> thought about it some more, and came up with a solution.
> 
> Here's a new patch that's smarter about indenting the current line,
> and resolves this remaining issue.

indeed, this seems to work as advertised.  thank you very much for
spending time on this issue.

Greg



Re: [PATCH] extra space at the end of lines in source

2021-06-24 Thread Greg Minshall
Sébastien Miquel,


> If I try your original examples with `emacs -q' I do not get extra
> whitespace in the org src buffer. Those two spaces in the original org
> buffer -- that are due to `org-edit-src-content-indentation' -- are
> removed in the org src buffer. If you do not find it to be the case,
> then I'm missing something.

i apologize, i think i described the problem badly.  the problem i saw
is not extra spaces in the Org Src buffer; it is the appearance of the
extra spaces in the original .org file after closing (C-c ') the Org Src
buffer that i see as problematic.

> Anyway, here's a patch that cleans up blank lines, except the current
> one. It preserves the fix for the original issue.

thanks.  my trivial test shows this works *except* in the particular
case where, when closing the Org Src buffer, `point` is on an empty
line.  in this case, that one empty line is given extra spaces.

if i try my test with
: Org mode version 9.4.4 (release_9.4.4 @ /usr/share/emacs/27.2/lisp/org/)
i do not see the extra spaces in the .org file.

the test src block is

#+BEGIN_SRC bash
  echo hello, world

  echo 23


#+END_SRC

(modulo any e-mail mangling).

again, thanks.  Greg



Re: extra space at the end of lines in source

2021-06-22 Thread Greg Minshall
Sébastien Miquel,

thanks for the reply.

> > it's long-term emacs behavior to eliminate spaces
> > at the end of lines, at least in programming modes.

(Tim -- i guess i should have said, "it's my long-term experience with
emacs...".)

> As for the `org-src--content-indentation' spaces, they are quite
> peculiar. Note that they are removed when you call =C-c '= and when
> you tangle (they should, but I haven't tested it), so strictly
> speaking, they are removed in programming modes. What if your org
> block itself is indented, do you also expect blank lines to be
> entirely empty ?

there are two "practical" issues, plus one aesthetic issue, for me:

- because of the changes to source blocks i've edited, but not, in fact,
  tried to change, i'm getting loads of diffs when checking in a new
  version of the .org file

- the next time i open the Org Src buffer, whatever lint-like process is
  running for that language may complain about extra spaces at the end
  of a line.  (does that mean my experience is different from yours, or
  at least from your expectation?)

- "aesthetically" (or, "conditioned", by years of some expected
  behavior), i find the thought that there may be lines like these in
  the file somewhat distressing.

i'm resigned to the extra spaces when an org block is indented, so
wouldn't find the existence of spaces there any more worrisome.
(though, i would expect the spaces to be up to the indentation of the
org block, not all the way up to "the programming level".)

i do think the default should be to *not* add these spaces.  if
possible.

cheers, Greg




Re: extra space at the end of lines in source

2021-06-22 Thread Greg Minshall
hi, Sebastien,

thanks for the reply.  i remember that thread, but obviously i wasn't
paying enough attention.

> The downside is that, unless ~org-src--preserve-indentation~ is `t`,
> when editing a src block, every empty line will be indented with
> spaces (according to ~org-edit-src-content-indentation~ + the
> indentation of the #+begin_src line). I think this is reasonable, but
> perhaps some might disagree.

indeed.  i disagree.  it's long-term emacs behavior to eliminate spaces
at the end of lines, at least in programming modes.  i don't know what
would be involved to keep the fix for the original problem (which i was
also seeing), without adding these extra spaces.  but, i suspect it
would be worth it, if feasible.

cheers, Greg



extra space at the end of lines in source

2021-06-22 Thread Greg Minshall
hi.  i can't date it exactly, but in the last week or so, editing a
source buffer (with =C-c '=) adds spaces (to the "tab location") of
previously blank lines.

i.e., the second line in each of the following source blocks is empty,
but if i =C-c '= then =C-c '=, each will end up with a few spaces on it.

#+BEGIN_SRC R
  cat("hello, world\n")

  23
#+END_SRC


#+BEGIN_SRC bash
  echo hello, world

  echo 23
#+END_SRC

i'm running
: Org mode version 9.4.6 (release_9.4.6-559-g5e4815 @ 
/home/minshall/.emacs.d/straight/build/org/)
via
: emacs -Q --eval "(add-to-list 'load-path \"~/.emacs.d/straight/build/org\")" 
foo.org

any thoughts?

cheers, Greg



Re: example paper written in org completely

2021-06-17 Thread Greg Minshall
Eric,

thanks very much for sharing.  it's nice that you also provide the .org
file on arXiv -- good marketing material!  :) ah, and mention in the
code appendix.  it's very useful to have the .org file as a model of how
to do various things.

i don't know if this is you, or is arXiv, but the ancillary files
("details" on the main page) claims to get .tar.gz (and, indeed,
downloads as a .tar.gz file) but is, in fact, an uncompressed .tar file.

cheers, Greg



Re: literate programming, development log -- ideas?

2021-06-14 Thread Greg Minshall
Samuel,

> I just wanted to put this here in the Literate Programming thread, DistroTube 
> just did a video on why Emacs rules, but the following timestamps are pretty 
> dang useful for literate programming for still-always learning newbies like 
> myself, just wanted to mention them here for reference:
> Timestamps:
> 7:20
> 11:46
> 15:35
> 17:36

thanks, that's very nice.



Re: literate programming, development log -- ideas? (ominbus reply)

2021-06-14 Thread Greg Minshall
Tim,, again thanks for your workflow/org-growth, and also for the git
tutorial in your separate reply to S Banya.  cheers, Greg



Re: literate programming, development log -- ideas? (ominbus reply)

2021-06-12 Thread Greg Minshall
Tim,

thanks for your comments.

> A lot depends on whether what you want is an org file which documents
> the current state of play or one which is more similar to a lab book
> which contains a more chronological type evolution of ideas and
> experiments. I often setup completely separate org 'projects' which will
> consist of multiple org files and will move things between different
> files as the project evolves. In some extreme cases, I may even have
> multiple git branches and will often use git tags to mark specific
> 'milestones'.
>
> How I decide whether to use a date tree with notes, branches, tags,
> archive sections/files, separate org files etc is typically determined
> by how likely I might be to want to review or go back through previous
> work/experiments/decisions. Working this out can take a bit of time and
> experimentation, but in general, I rarely need to checkout old versions
> or even open archive trees/files. I do have a journal file for each
> major project which has lots of ideas, random thoughts and even small
> experiments (with source blokcs) and I tend ot have a large 'reference'
> file which contains notes and links to external references and then a
> 'main' org file, which reflects the current state. 

my current curiosity is in how to integrate lab book, brain storming,
functionality into my projects.  it seems as if, in an extreme case, you
might possibly have
- a lab book sort of file (i.e., date order, minimal "going back and
  correcting entries")
- a journal file, unstructured, not-infrequently updated, notes, URLs,
  etc.
- the "main" org file -- that which "ships".
- an archive file (one per each of the other?)

for any given project, is the evolution from =foo.org= to this larger
number sort of organic, in the sense that you start with one file, then,
at some point, say, "okay, i need to put these bits in a new journal
file"?

and, trying to leverage the brain cells of others, have you tended to
settle on any sort of consistent naming scheme for the different files?
=-log=, =-notes=, etc.?

i suspect that if my brain were more git-shaped, i'd find the idea of
separate files easier.  i.e., my instinct is to think of each of these
files as having a version-path independent of the others.  rather than
the git-view, which is that the version-path is the commit-path, and
each commit includes the (mostly-temporally) related versions of each of
the files.  more [C-x v d], less [C-x v v].

again, thanks!  Greg



Re: literate programming, development log -- ideas? (ominbus reply)

2021-06-10 Thread Greg Minshall
Maxim,

thanks for =git log -G...=.

cheers, Greg



Re: literate programming, development log -- ideas? (ominbus reply)

2021-06-08 Thread Greg Minshall
Juan Manuel, Eric, Jack, Arne,

thank you all very much for your thoughts.

i've sort of come to grips with Jack's + Arne's, solution, and defined a
"capture template" that adds something to a pre-named headline.  (note
and capture are among the org features of which i have maintained to
date a studied ignorance; alas, or a-luck, no more.)

i realized i would like to have headlines (mostly to have the
convenience of =consult-org-heading=), which i think rules out putting
my logs inside property drawers.

Eric, when you use something RCS-like as your version control system, i
assume that makes grepping to find some old note easy enough.  but,
these days i tend to use git.  when (assuming) you use git, do you have
some easy way to say "well, i had this code that looked sort of like
this... where was it?"?  (sorry, that's really a git question, but ...)

cheers, Greg

ps -- for completeness, or code review...

("l"
 "add a logbook entry"
 entry
 (file+olp+datetree buffer-file-name "Logbook")
 "* lbe: %?logbook entry\n  :PROPERTIES:\ncreation-date: %t\n
  :END:"
 :empty-lines 1
 :tree-type month)  




Re: literate programming, development log -- ideas?

2021-06-08 Thread Greg Minshall
Brian,

> ** A more generalized system that is based on CWeb is NoWeb--useful
> not just for C/C++ code but for every language: Recommend using NoWeb
> for Literate Programming: "NoWeb — A Simple, Extensible Tool for
> Literate Programming":

thanks.  in fact, i also make extensive use of =<>= in my
programming.  and, also, when i found it, =<>= (as it were), to
include the *results* of the execution of the named block -- very cool.

cheers, Greg



Re: literate programming, development log -- ideas?

2021-06-08 Thread Greg Minshall
Samuel,

> Neat stuff, will bookmark this, thanks Greg!

you're welcome.  i should mention that i don't recommend the .org files
in my gitlab repositories as exemplars of structure/style.  but, they
might give an idea.  the .org file related to the ESS video is probably
more manageable.

cheers, Greg



Re: literate programming, development log -- ideas?

2021-06-07 Thread Greg Minshall
Samuel,

> Can anyone post any video links to this kind of style of programming
> being used directly in Emacs?

there was an effort recently, that i'm tardy on reporting on here, to do
an introduction to "emacs for R programmers".

https://ess-intro.github.io/


as part of that, i did a (either too short, or too long) video on Org
mode, which, in reality, is pretty neutral w.r.t. programming language.
you might find that of interest.  it's linked at the above ESS intro
site.

i hadn't known of Harry Schwartz's efforts -- thanks for that.

> I know some people had mentioned in this thread that they use a .org
> file for their given project, but can anyone link to any repos where
> this is actually being used?

many people here probably have repos with software.  two of mine are

https://gitlab.com/minshall/covid-19
https://gitlab.com/minshall/photoTagger


cheers, Greg



literate programming, development log -- ideas?

2021-06-07 Thread Greg Minshall
hi, all.

i write most of my code in a (per-project) .org file, which is typically
tangled into source or script files.  i have a question about how people
structure their .org files for this sort of use.

some of the non-source bits surrounding my source blocks are for
"classical" literate programming text, i.e., introductions to sections
of code, maybe with links to external pages for libraries or packages i
use in the associated code block.

but i also feel a need for something that might be called a lab
notebook, a development log, of ideas, including dead ends, i pursue
during the development process, with links, etc..  but, i'm not really
sure how to structure this bit, how to integrate it in the rest of the
.org file -- i.e., as a separate heading, or related to the code section
that (originally) was under development when the notes were created.
or...?  etc.

i'm wondering if people do this, especially the development log, and if
there are any hints or practices people might feel would be of interest
to share.

(sorry for the non-specificness of the question.)

cheers, Greg



Re: suggestion to change default org-latex-pdf-process to latexmk

2021-06-02 Thread Greg Minshall
Bruce,

> > I really don't understand why the changed is needed.
> 
> I've stated it twice, I believe, but it's now a longer thread, so:
> 
> Org is set to get native citation support.
> 
> Once that's merged, people who use this feature will be disappointed
> to know that when using the natbib or biblatex export processors,
> their citations and bibliographies will not render.
> 
> As in, from their perspective, it will be broken upfront.

thanks.

one important thing will be the manual section describing the new
capability -- it should highlight the desirability of using latexmk ("or
some process with similar behavior"), and describe the results one will
get without it.  presumably, people will initially need to read this
section to figure out the syntax, etc.?

i worry about breaking people's currently working setups.

it seems there are N classes of users:

1.  not using citation engine.
2.  using citation engine
2a. ... and using default latex-to-pdf processing
2b. ... having customized that processing
2bi. ... in a way that works with new citation engine
2bii. .. in a way that does *not* work with new citation engine

class 1 could likely benefit from latexmk, but it's optional.

class 2a is probably the main class that would find it really helpful to
have an automated latexmk.

from *our* (the org-mode provider) point of view, i guess the 2b
subclasses are indistinguishable.  so, if the user finds herself in
2bii, she will have to grep the manual or the web.  again, it would be
good if information in the manual stuck out.  maybe a "TROUBLESHOOTING"
sub-section for the new feature?

i wonder if we could detect 2a, and offer them the customization dialog?
(one would want the user to be able to click the "do not show me this
again" button, or equivalent.)

packaging.  :)

cheers, Greg



Re: import xls(x) into org on MacOS

2021-06-01 Thread Greg Minshall
Uwe,

i don't know if it will work for you, but on my linux box i use
=ssconvert= from the =gnumeric= package to convert from .xls to .csv.
in one project, the make rule looks like

${BDIRCSVS}/%.csv: xlsxs/%.xlsx
ssconvert -T Gnumeric_stf:stf_csv $< fd://1 | \
awk '{ \
line = line $$0; \
ol = line; \
gsub("[^\"]", "", ol); \
if (length(ol)%2==0) { \
print line; \
line = "" \
} \
}' | \
grep '^,' | \
grep -v '^,,*$$' > $@

(i could probably puzzle out why the awk and greps, but i don't recall
at the moment.)

cheers, Greg



Re: Bug: async latex export fails due to post-process lambda [9.4.4 (release_9.4.4-188-ga8df76 @ /home/mohkale/.config/emacs/lisp/straight/build/org/)]

2021-05-30 Thread Greg Minshall
Mohsin,

> Hmmm... that's strange. Running:
> 1. `emacs -nw`
> ...

you might want to start off with
: emacs -nw -Q
to eliminate any dependency on your personal .emacs file, etc.

cheers, Greg



do not attempt to clean the (no-longer-existent) ./contrib directory

2021-05-30 Thread Greg Minshall
Nicolas,

> Sure. Please go ahead.

ahead and went.  cheers, Greg

>From 27d06a8a0411125edc7ebf3f0bba24ff8df607a0 Mon Sep 17 00:00:00 2001
From: Greg Minshall 
Date: Sun, 30 May 2021 14:18:52 +0300
Subject: [PATCH 2/2] Build process: Do not attempt to clean =contrib/=

mk/targets.mk: Remove "contrib" from 'CLEANDIRS'.
---
 mk/targets.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mk/targets.mk b/mk/targets.mk
index fc5bed134..693e3781f 100644
--- a/mk/targets.mk
+++ b/mk/targets.mk
@@ -5,7 +5,7 @@ DISTFILES_extra=  Makefile request-assign-future.txt contrib etc
 
 LISPDIRS  = lisp
 OTHERDIRS = doc etc
-CLEANDIRS = contrib testing mk
+CLEANDIRS = testing mk
 SUBDIRS   = $(OTHERDIRS) $(LISPDIRS)
 INSTSUB   = $(SUBDIRS:%=install-%)
 ORG_MAKE_DOC ?= info html pdf
-- 
2.31.1



Re: Minor org-plot update, can now use with #+results

2021-05-28 Thread Greg Minshall
Timothy,

> However, there's an implication to this change that I think deserves
> mentioning (and will be in this months TMIO). This now means that you
> can put a #+plot line before #+results and it will actually work!

very nice -- thanks!

Greg



bug#48676: Arbitrary code execution in Org export macros

2021-05-26 Thread Greg Minshall
Glenn,

thanks for the report.

i guess my take is that macro-evaluation, and that of other forms,
should be subject to the same restrictions as that of source block
evaluation.  i.e., prompting for permission to execute, subject to
=org-confirm-babel-evaluate= (or, more specific variables).

cheers, Greg

> Package: emacs,org-mode
> Version: 28.0.50
> Severity: important
> Tags: security
> 
> emacs -Q hello.org, where hello.org contains:
> 
> #+macro: hello (eval (shell-command-to-string "touch /tmp/HELLO"))
> Hello. {{{hello}}}
> 
> Then:
> M-x org-export-dispatch
> t A
> 
> -> now /tmp/HELLO exist, with no prompting.
> 
> This seems contrary to normal Emacs practice for risky local variables,
> and to the section "Code Evaluation and Security Issues" in the Org manual
> (which does not mention macros).





Re: declaring :var in a property drawer

2021-05-24 Thread Greg Minshall
Eric,

> I would suggest it is intentional: setting a header property means it
> applies to *all* src blocks.

thanks.  but, in this case, all source blocks are being tangled to the
same file.  which, for many (most?) languages (but not elisp), means the
variable is going to be defined (and re-defined) at (the particular
language's version of) global scope.  which seems mostly redundant.

that was what i was wondering about.

cheers, Greg



Re: Question Regarding Yasnippet With Org Mode (Emacs 27.2)

2021-05-23 Thread Greg Minshall
hi, Sam,

i was thinking you might be happier, or at least experiment, *without*
=org-tempo=.  so, if you customize =org-modules=, and see =org-tempo=
enabled there, you might try disabling it.  (to move one more chance Org
is getting in the way of yasnippet.)

but, i don't know if this will help.  also, the advice from Sébastien
Miquel seems based on more actual knowledge.

cheers, Greg



Re: Question Regarding Yasnippet With Org Mode (Emacs 27.2)

2021-05-23 Thread Greg Minshall
Samuel,

i think that by default, Org no longer listens to, e.g., =

declaring :var in a property drawer

2021-05-23 Thread Greg Minshall
hi.  i noticed the following behavior, and am curious if it is
intentional.

if i declare a :tangle and a :var in a property drawer and then, in that
subtree, have N>1 source blocks (which will all end up in the same
tangled file), the :var'iable will be assigned a value N times.  below i
have an example using bash source blocks, where it doesn't make sense,
afaics(ee).  (when exporting elisp blocks, each :var'iable is assigned a
value in a =let= form that surrounds the code for that block, so i guess
it makes sense.)

cheers, Greg

* :var's and property drawers
:properties:
:header-args: :tangle "foo.bar"
:header-args+: :var x=1
:end:

#+begin_src bash
  echo x is $x
#+end_src

#+begin_src bash
echo "'x.*=.*1' occurences:"
grep 'x.*=.*1' foo.bar | grep -v grep
#+end_src



Re: Org mode manual export

2021-05-22 Thread Greg Minshall
Thomas, indeed, aloha.

while waiting for authoritative information, i'll notice that the
Makefile calls an elisp function

(defun org-make-manuals ()
  "Generate the Texinfo files out of Org manuals."
  (require 'ox-texinfo)
  (dolist (manual '("../doc/org-manual.org" "../doc/org-guide.org"))
(find-file manual)
(org-texinfo-export-to-texinfo)))


and, (org-texinfo-export-to-texinfo) (in ox-texinfo.el) seems a
fully-functioning export module, and i don't see any reference to pandoc
in it.  (but, i've never looked at that code before.)

cheers, Greg



  1   2   3   >