Join lines in region with M-^ in Org
Hello all, With my last tiny commit on master org-delete-indentation (M-^) behaves as good old plain delete-indentation in the case when a region is active. Concretely the lines get joined. Before the region has not been taken into account by org-delete-indentation. I guess and hope this change is consensual. If not, please speak out. Best regards, -- Marco
Re: Import Reusable org-babel snippet using #+SETUPFILE
Hey Doug, What types of things are in GeneralORGTools.org? Are those babel definitions? Or something else? -s- On Tue, Jun 16, 2020 at 11:21 AM Salomon Turgman wrote: > Thanks for the useful example. I will take a look. Didn't know about > org-sbe! > > -s- > > On Mon, 15 Jun 2020 15:52:16 -0400 > Douglas Perrin wrote: > > > Hi Salomon Turgman, > > I do this a lot and have had success using a combination of #+SETUPFILE > to > > bring in names and configuration, and org-sbe to do initialization. I mix > > emacs vars and org names in my source headers with back quoting. > > > > The following example has a template file containing user/local > > information. This is brought into the example file, on load, through > #:eval > > calling org-babel-lob-ingest and org-sbe, in addition, parameters are > > pulled in with #+SETUPFILE and the same template file name. The end > result > > for this example is a running docker image with access to local paths and > > "remote" execution via tramp. More complex orchestration and actions in > the > > template are certainly possible using org-sbe calls in the init elisp > > source blocks but hopefully, this shows the flavor of what can be done. > > > > In addition to avoiding code duplication, I have found this to be very > > effective when my group is all working from the same org file (via git) > but > > everyone has their own template file with credentials, local paths, and > org > > more preferences (ie showstars). > > Regards, > > Doug > > > > > - > > TemplatingExample.org > > > - > > #+SETUPFILE: Template-Loader.org > > > > * Init Code, run when file is opened > > #+name: Execute-On-Load > > #+begin_src elisp :results output > >;; for this the container and image have the same name > > (setq *DockerName* "ContanerName") > > #+end_src > > > > * Run Contaner > > #+begin_src bash :results raw drawer :var DockerName=`,*DockerName* > > DockerHubUID=`,*DockerHubUID* containerName=`,*DockerContainer* > > LocalWorkPath=`,*LocalWorkPath* LocalDataPath=`,*LocalDataPath* > >docker run --rm -d \ > > -v $LocalWorkPath:/root/Workdir \ > > -v $LocalDataPath:/root/Data \ > > --name $DockerName $DockerHubUID/$DockerName bash -c "tail -f > > /dev/null" > > #+end_src > > > > * run IN contaner > > #+begin_src bash :results output :dir (concat "/docker:" `,*DockerName* > > ":/root/Workdir/") > > ls > > #+end_src > > > > # Local Variables: > > # eval: (org-babel-lob-ingest "Template-Loader.org") > > # eval: (org-sbe "Init-Template") > > # eval: (org-sbe "Execute-On-Load") > > # End: > > > > > - > > Template-Loader.org > > > - > > #+STARTUP: showstars > > #+PROPERTY: header-args :mkdirp yes > > > > #+name: Init-Template > > #+begin_src emacs-lisp :results none > > ;; This is called expecitly via org-sbe in the buffer that will uses > the > > templating > > (setq *DockerHubUID* "MyUserName") > > (setq *LocalWorkPath* "/run/desktop/mnt/host/c/Users/.") > > (setq *LocalDataPath* "/run/desktop/mnt/host/d/devData/") > > > > ;; ingest + SBE can be used to bring in a hierarchy of templates > > (org-babel-lob-ingest "./GroupTools/GeneralORGTools.org") > > (org-sbe "GeneralORGTools.org") > > > > #+end_src > > > -- > Salomon Turgman >
Re: Question on contributing to Org-mode
Can someone help me please to improve ob-clojure for the next release. I'd like to add bababashka and clojure-cmd support. I've experimented with the code that's currently in master I so far I got to this. What I would like to propose: 1) Ability to override `org-babel-clojure-backend` with a src-block header parameter 2) Header argument for additional parameters so you could do things like this: #+begin_src clojure :args "-Sdeps '{:deps {inflections {:mvn/version "0.13.2"}}}'" (use 'inflections.core) (plural "word") #+end_src However, I don't know what's current convention about header parameters - naming, etc. What your thoughts about all that? diff --git a/lisp/ob-clojure.el b/lisp/ob-clojure.el index 299a326e4..de005c32b 100644 --- a/lisp/ob-clojure.el +++ b/lisp/ob-clojure.el @@ -224,6 +224,14 @@ (defun ob-clojure-eval-with-slime (expanded params) ,(buffer-substring-no-properties (point-min) (point-max))) (cdr (assq :package params) +(defun ob-clojure-eval-with-babashka (expanded params) + "Evaluate EXPANDED code block with PARAMS using babashka." + (org-babel-execute:shell (format "bb -e \"%s\"" expanded) params)) + +(defun ob-clojure-eval-with-clj (expanded params) + "Evaluate EXPANDED code block with PARAMS using clojure-cli." + (org-babel-execute:shell (format "clj -e \"%s\"" expanded) params)) + (defun org-babel-execute:clojure (body params) "Execute a block of Clojure code with Babel." (unless org-babel-clojure-backend @@ -238,7 +246,11 @@ (defun org-babel-execute:clojure (body params) ((eq org-babel-clojure-backend 'cider) (ob-clojure-eval-with-cider expanded params)) ((eq org-babel-clojure-backend 'slime) - (ob-clojure-eval-with-slime expanded params + (ob-clojure-eval-with-slime expanded params)) + ((eq org-babel-clojure-backend 'babashka) + (ob-clojure-eval-with-babashka expanded params)) + ((eq org-babel-clojure-backend 'clj-cli) + (ob-clojure-eval-with-clj expanded params (org-babel-result-cond result-params result (condition-case nil (org-babel-script-escape result) On Sat 13 Jun 2020 at 17:19, Kyle Meyer wrote: Ag Ibragimov writes: M-x emacs-version and org-version report: GNU Emacs 28.0.50 (build 1, x86_64-apple-darwin19.5.0, NS appkit-1894.50 Version 10.15.5 (Build 19F101)) of 2020-06-07 Org mode version 9.3.7 (9.3.7-2-g706970-elpaplus @ ~/.emacs.d/elpa/28.0/develop/org-plus-contrib-20200608/) Now I'm confused, what's in master of bzg/org-mode? It contains what will be the next feature release (9.4, at the moment). Notice that your reported version above contains a git revision: 706970. If you look that up in the repo, you'll find that it's a few commits back from the current tip of the maint branch. The maint branch is the source for the ELPA builds and is where bug fix releases are cut from. And if someone wants to send patches, which branch it should be based of? Bug fixes that apply to maint should ideally be based off of maint, and master is usually appropriate for everything else.
Re: Question on contributing to Org-mode
-BEGIN PGP SIGNED MESSAGE- Hash: SHA256 Ag Ibragimov writes: > Can someone help me please to improve ob-clojure for the next release. > > I'd like to add bababashka and clojure-cmd support. > > I've experimented with the code that's currently in master I so far I got to > this. > > What I would like to propose: > > 1) Ability to override `org-babel-clojure-backend` with a src-block header > parameter I like this idea, currently ob-clojure has many different backends support now, Use a header argument will be helpful for situations like use different backends in one org file and other cases. > 2) Header argument for additional parameters so you could do things like this: I would like propose header argument name ":backend" or ":clojure". ob-scheme.el has similar header argument named ":scheme". But I prefer ":backend", because it's more general. > > #+begin_src clojure :args "-Sdeps '{:deps {inflections {:mvn/version > "0.13.2"}}}'" > (use 'inflections.core) > (plural "word") > #+end_src > > However, I don't know what's current convention about header parameters - > naming, etc. > What your thoughts about all that? > > diff --git a/lisp/ob-clojure.el b/lisp/ob-clojure.el > index 299a326e4..de005c32b 100644 > --- a/lisp/ob-clojure.el > +++ b/lisp/ob-clojure.el > @@ -224,6 +224,14 @@ (defun ob-clojure-eval-with-slime (expanded params) >,(buffer-substring-no-properties (point-min) (point-max))) > (cdr (assq :package params) > > +(defun ob-clojure-eval-with-babashka (expanded params) > + "Evaluate EXPANDED code block with PARAMS using babashka." > + (org-babel-execute:shell (format "bb -e \"%s\"" expanded) params)) > + > +(defun ob-clojure-eval-with-clj (expanded params) > + "Evaluate EXPANDED code block with PARAMS using clojure-cli." > + (org-babel-execute:shell (format "clj -e \"%s\"" expanded) params)) > + > (defun org-babel-execute:clojure (body params) > "Execute a block of Clojure code with Babel." > (unless org-babel-clojure-backend > @@ -238,7 +246,11 @@ (defun org-babel-execute:clojure (body params) > ((eq org-babel-clojure-backend 'cider) > (ob-clojure-eval-with-cider expanded params)) > ((eq org-babel-clojure-backend 'slime) > - (ob-clojure-eval-with-slime expanded params > + (ob-clojure-eval-with-slime expanded params)) > +((eq org-babel-clojure-backend 'babashka) > + (ob-clojure-eval-with-babashka expanded params)) > +((eq org-babel-clojure-backend 'clj-cli) > + (ob-clojure-eval-with-clj expanded params > (org-babel-result-cond result-params > result > (condition-case nil (org-babel-script-escape result) > > On Sat 13 Jun 2020 at 17:19, Kyle Meyer wrote: > >> Ag Ibragimov writes: >> >>> M-x emacs-version and org-version report: >>> >>> GNU Emacs 28.0.50 (build 1, x86_64-apple-darwin19.5.0, NS appkit-1894.50 >>> Version 10.15.5 (Build 19F101)) of 2020-06-07 >>> Org mode version 9.3.7 (9.3.7-2-g706970-elpaplus @ >>> ~/.emacs.d/elpa/28.0/develop/org-plus-contrib-20200608/) >>> >>> Now I'm confused, what's in master of bzg/org-mode? >> >> It contains what will be the next feature release (9.4, at the moment). >> >> Notice that your reported version above contains a git revision: 706970. >> If you look that up in the repo, you'll find that it's a few commits >> back from the current tip of the maint branch. The maint branch is the >> source for the ELPA builds and is where bug fix releases are cut from. >> >>> And if someone wants to send patches, which branch it should be based >>> of? >> >> Bug fixes that apply to maint should ideally be based off of maint, and >> master is usually appropriate for everything else. - -- [ stardiviner ] I try to make every word tell the meaning that I want to express. Blog: https://stardiviner.github.io/ IRC(freenode): stardiviner, Matrix: stardiviner GPG: F09F650D7D674819892591401B5DF1C95AE89AC3 -BEGIN PGP SIGNATURE- iQFIBAEBCAAyFiEE8J9lDX1nSBmJJZFAG13xyVromsMFAl7rDs8UHG51bWJjaGls ZEBnbWFpbC5jb20ACgkQG13xyVromsMWVQf/YlHZw3Yga3dTlLPU0Xg0f+tJ0JJR oigjt4oOBsaMGshHny+4QBnO/QJTVWpYEm6j2oFp0Cb1CUn5TiTRDDyRVcX+I15u W4T+UqsamKQQoRoJccPN3apraQlwiYbwLzN5Qy0hefOkj+E285PNf4Uq1VMwy9sL n2zqY+cm+lrhv3wG08xXxWckg+Jx76s1M6j9QQH7nGNovYSl3YzpjtOPc2VE2ayv 8FQQX6PSH4gEW7ItyfYd18vYtIn65Zkum+L80d8+HtDVPkw0yDIq6uIkUbR5jCCY tdbUsl6EeZlb9CkjY9WtOsIGe2FzIHjjhFSYvamgarqs5GGd+GazSPUVKQ== =4JBP -END PGP SIGNATURE-