Re: [O] How to handle an inline multiline noweb reference

2018-12-01 Thread Grant Rettke
On Fri, Nov 30, 2018 at 11:25 AM Marcin Borkowski  wrote:
> On 2018-11-28, at 03:08, Grant Rettke  wrote:
> > On Tue, Nov 27, 2018 at 3:57 AM Marcin Borkowski  wrote:
> >> but it's fairly complicated.  Any better ideas?
> >
> > What is the part that you think is too complicated?
>
> I hoped that I could somehow skip the "manually replace newlines with
> spaces" step.

Thank you for explaining!



Re: [O] How to handle an inline multiline noweb reference

2018-11-28 Thread Grant Rettke
On Wed, Nov 28, 2018 at 1:08 AM Eric S Fraga  wrote:
> Check out the :post option for src blocks.  May be exactly what you
> want.

Thanks for sharing that!



Re: [O] How to handle an inline multiline noweb reference

2018-11-27 Thread Grant Rettke
On Tue, Nov 27, 2018 at 3:57 AM Marcin Borkowski  wrote:
> but it's fairly complicated.  Any better ideas?

What is the part that you think is too complicated?



Re: [O] Getting feedback from a website created with OrgMode ??

2018-11-19 Thread Grant Rettke
On Sun, Nov 18, 2018 at 4:54 PM David Masterson 
wrote:

> What options do I have for doing this in OrgMode??
>

Your best option is to find a website platform that has all the features
that you want. For example
Hugo or Jekyll or WordPress or you name it there are plenty of options.Then
figure out how you can
"publish to" it. That way you still get the power of Org and the platform
to which you are publishing.

I do that with WordPress and love it albeit for a blog which is different
than what you want but
maybe in the same universe of possibilities.


Re: [O] Help with sharing emacs-org presentation

2018-10-30 Thread Grant Rettke
On Mon, Oct 29, 2018 at 7:53 AM Feiming Chen  wrote:
> Hi, I am an enthusiastic emacs-org user. Thanks for making this great tool!   
> I gave a talk on emacs-org in a local
> workshop (Government Advances in Statistical Programming) in Washington D.C. 
> yesterday.  I'd like to share the slides
> and org source file with the community (see attached).  Please help.  Thanks!

Very cool thanks for sharing that!



Re: [O] org-mode: Would like to add custom chars as org-list bullets

2018-10-24 Thread Grant Rettke
On Sat, Oct 13, 2018 at 1:56 AM Colin Baxter  wrote:
>
> > Tom Burbage  writes:
>
> > When I use simple lists, I would like to be able to mix in '!' and
> > '?'  with '-' as these are sometimes more expressive of what the
> > list item represents.  My request is that the list of characters
> > org-list recognizes as being a valid "bullet" be customizable by
> > the user.
>
> Have a look at 
> https://emacs.stackexchange.com/questions/35626/how-to-make-my-own-org-mode-text-emphasis-work-again.

Which code are you recommending?



Re: [O] org-babel-detangle issue on 9.1.14

2018-10-05 Thread Grant Rettke
On Thu, Oct 4, 2018 at 10:53 AM Brad Knotwell  wrote:
> Thanks for the response.  At a minimum, I'd recommend changing the error 
> message from "Not in a source block" to something more descriptive
> as most people's initial response will be, "uhhh, but it looks like I am."

Consider submitting your suggestion as a patch so it is super easy to
know what change you are suggesting.

If you never submitted one before I am glad to help.

> Ideally, an additional comment marker would delineate the source block from 
> the meta-programmed variables to allow the edited source code's
> verbatim replacement.  Or it might make sense to have a setting that 
> separates the tangled source file from the meta programmed variables.
> Using your example above, it could tangle to something like the following:
>
> #!/bin/sh
> # 
> [[file:~/tmp/test.org::org_gcr_2018-10-04T08-35-43-05-00_cosmicality_CCEACAA2-A6B3-4FDD-9259-7F633316F0CE][org_gcr_2018-10-04T08-35-43-05-00_cosmicality_CCEACAA2-A6B3-4FDD-9259-7F633316F0CE]]
> . ./noideahowtonamethesegenerically.sh# the naming seems tricky to me
> echo $x
> # 
> org_gcr_2018-10-04T08-35-43-05-00_cosmicality_CCEACAA2-A6B3-4FDD-9259-7F633316F0CE
> ends here

One way is that you can keep the values in an external file and load
it before each source block in the preamble code?

I'm thinking pretty simply but depending on what you wan to do here
there might be an easy solution.



Re: [O] org-babel-detangle issue on 9.1.14

2018-10-04 Thread Grant Rettke
On Thu, Oct 4, 2018 at 2:09 AM Brad Knotwell  wrote:
> I've been playing with org-babel-detangle and I've noticed something that's 
> either a bug or a limitation.  It's confusing enough that
> it's worth writing down if it's expected.  Basically, it doesn't work if 
> there are variables defined in the begin_src header.  I've
> attached an example below.  The first one won't detangle and the last two 
> will.

That is expected behavior. Org can only detangle the content of source
blocks. It can't deduce how that
source code got in there.

Maybe this example says it better:

#+begin_src sh sh :tangle hw.sh :var x=(random) :shebang #!/bin/sh
:comments link
echo $x
#+end_src

Tangles to

#!/bin/sh
# 
[[file:~/tmp/test.org::org_gcr_2018-10-04T08-35-43-05-00_cosmicality_CCEACAA2-A6B3-4FDD-9259-7F633316F0CE][org_gcr_2018-10-04T08-35-43-05-00_cosmicality_CCEACAA2-A6B3-4FDD-9259-7F633316F0CE]]
x='422131055910453451'
echo $x
# 
org_gcr_2018-10-04T08-35-43-05-00_cosmicality_CCEACAA2-A6B3-4FDD-9259-7F633316F0CE
ends here



Re: [O] org-babel: capturing the output of a shell command that does not return

2018-10-04 Thread Grant Rettke
On Wed, Sep 19, 2018 at 3:35 PM  wrote:
> Maybe there is another way to run the shell command and extract the file name 
> I need (in elisp?), but I don't know how.

What if you start Emacs, have it create a temp file, then in a
separate terminal start Jupyter with stdout redirected to that file.

Is that in the right direction of what you are describing?



Re: [O] Literate programming: Org mode and Scala

2018-09-18 Thread Grant Rettke
On Sun, Sep 9, 2018 at 2:43 PM Andrea Giugliano  wrote:
> I wonder: is the org-mode community planning to make scala-mode work in
> a literate way without workarounds?

Are you saying that there are two versions of scala-mode out there:
one that works and one that doesn't work?



Re: [O] Highlighting list item bullets

2018-09-18 Thread Grant Rettke
On Tue, Sep 18, 2018 at 8:25 AM Alex Helfet  wrote:
> I have a very early prototype working and wanted some feedback about whether 
> you would be interested in this feature upstream, or perhaps
> including it in a package would be a better bet.

That looks great.

There are already more than a few snippets out there to do something
like that that but they all probably do it differently. For example
mine just because I wanted em-dashes

(font-lock-add-keywords
 'org-mode
 '(("^[[:space:]]*\\(-\\) "
0 (prog1 () (compose-region (match-beginning 1) (match-end 1) "—")

So you've got my vote for putting it in a package:



Re: [O] :comments org doesn't export comments below code

2018-07-14 Thread Grant Rettke
On Sat, Jul 14, 2018 at 3:10 AM, Nicolas Goaziou  wrote:
> Ken Mankoff  writes:
> > Is there a way to get more of the Org file embedded in the tangled
> > code?
> I don't think so.

What did you want to add to it?



Re: [O] org-utf-to-xetex - Teach Org-Mode And XeTeX How To Handle Non-Latin Unicode Characters

2018-06-29 Thread Grant Rettke
On Fri, Jun 29, 2018 at 7:21 AM, Van L  wrote:
>
>> https://github.com/grettke/org-utf-to-xetex
>>
>> please share feedback.
>
> I’ve been meaning to try XeTeX in org-mode to
> create PDF from plaintex and latex.
>
>   https://orgmode.org/elpa.html
>
> Having followed the instructions above,
> how do I disable the builtin Emacs 26.1 Org Mode?

Usually the problem is that the version of Org-Mode distributed with
Emacs get's loaded before
the version that /you/ want loaded. A giveaway is when you call
org-version and emacs-version you see

Org-mode version 8.2.10 (this is on GNU Emacs 25.3.1).

The solution is to load Org-Mode 9 early on in your startup process.

> Then, which of the following to install?
>
>   org9.1.13available  gnu
>   org20180625  available  org
>   org-edna   1.0beta6  available  gnu
>   org-plus-contrib   20180625  available  org

This package ought to work with any of them that are version 9 and above.

Tested it on Org mode version 9.1.13 (release_9.1.13-836-g58b512



[O] org-utf-to-xetex - Teach Org-Mode And XeTeX How To Handle Non-Latin Unicode Characters

2018-06-28 Thread Grant Rettke
Hi,

This package

https://github.com/grettke/org-utf-to-xetex

makes it easy to use Emoticons and other Non-Latin characters with XeTeX.

"It works fine on my box."

There is probably a lot of room for improvement, so, please share feedback.

Does something like this already exist?

Sincerely,

Grant Rettke



Re: [O] Patch adding from-logo commentary ox-koma-letter.el

2018-06-28 Thread Grant Rettke
On Wed, Jun 27, 2018 at 9:28 AM, Nicolas Goaziou  wrote:
> Grant Rettke  writes:
>> From: Grant Rettke 
>> +;; provides the 'includegraphics' command to tell LaTeX where to find
>> +;; the logo. 'includegraphics' needs to know the logo's directory and
>
> I added two spaces after the periods.

Thank you I will do that in the future.

Have a great day.



Re: [O] Babel Edit Code Whole Session Context

2018-06-24 Thread Grant Rettke
Hi Kevin,

On Sun, Jun 24, 2018 at 9:50 AM, Kevin Foley  wrote:
> Is there anyway to edit a source code block with the context of all other
> source code blocks in the same session?  Specifically when working with
> Python I'd like features like company to be able to use the rest of the code
> in the session.

I hear you and think I understand what you say. I also know it can be
irritating when
somebody answers a slightly different question question you asked. If
you humor me,
I'm about to do that.

I don't know how to do what you ask. However, I have something to do
that I would be
pretty happy.

1. Set the default headers args to noweb :tangle
2. Develop blocks normally, without Company.
3. When I am ready to work on the whole codebase with company, tangle
to a file.
4. Go to that file. Leverage Company and make changes. When you are
done detangle.
5. Iterate

That way you can get what you need albeit not how you wanted it to work.



Re: [O] Patch adding from-logo commentary ox-koma-letter.el

2018-06-23 Thread Grant Rettke
On Thu, Jun 21, 2018 at 4:37 AM, Nicolas Goaziou  wrote:
> Grant Rettke  writes:
>> If you like the additional documentation, then I will update it with
>> this and send a new patch.
>
> Let's first merge the complete documentation, then apply it, if you
> don't mind.

Happy to, mistakenly said patch.

Here is the new version. I included detail and examples.

The first one I sent was, well, woefully inadequate!


0001-ox-koma-letter.el-Adds-FROM_LOGO-example.patch
Description: Binary data


Re: [O] Patch adding from-logo commentary ox-koma-letter.el

2018-06-20 Thread Grant Rettke
On Tue, Jun 19, 2018 at 3:11 AM, Nicolas Goaziou  wrote:
> Hello,
>
> Grant Rettke  writes:
>
>> Although the function document ion mentions the markup to use, it
>> doesn't explain that the user needs to provide a logo file in the same
>> directory as the letter.
>
> Is it really necessary?

If you are comfortable with LaTeX, then it probably isn't necessary
because you already know how \includegraphics{logo} works, or you
would look it up.

When I wrote this, I felt like because ox-koma-letter makes it so easy
for non LaTeX Org users, that a reminder would help because this
variable is I think the only one that requires any LaTeX knowledge.

That was the context for my statement. I'm making a big assumption
that non latex org users would benefit here.

> Couldn't you use, e.g., \includegraphics{subdir/logo}

Yes.

If you like the additional documentation, then I will update it with
this and send a new patch.

WDYT?



[O] Patch adding from-logo commentary ox-koma-letter.el

2018-06-18 Thread Grant Rettke
On Sat, Apr 28, 2018 at 1:32 AM, Bastien  wrote:
> Hi Grant,
>
> Grant Rettke  writes:
>
>> Here is how it works, the same way as the other ones:
>
> If needed, don't hesitate to advertize this in the comment section
> of the code.

Here is a patch to a commentary on how to use FROM_LOGO.


0001-exporters-koma-letter-export.org-Add-FROM_LOGO-comme.patch
Description: Binary data


[O] Want to automatically specify different mainfont in XeTeX and wondering if a custom exporter is the right way

2018-06-15 Thread Grant Rettke
Good evening,

A few months ago I migrated my Org-Mode configuration from PDFLaTeX to XeTeX.
It is great using "real fonts" and Unicode symbols, and my Org-Mode
configuration only needed a few changes to use XeTeX. Although I didn't read
any documentation on XeTeX, I know enough about LaTeX to stay out of trouble.
When I got around to choosing my primary fonts though I got a taste of my lack
of Unicode knowledge.

The fontspec let's you set up the three main fonts like this

\setmainfont{DejaVu Serif}
\setsansfont{DejaVu Sans}[Scale=MatchLowercase]
\setmonofont{DejaVu Sans Mono}[Scale=MatchLowercase]

And I figured those would cover at least the emoticon Unicode block. Nope!
Empty boxes appear the first time I want to use a . Sheesh. Never knew how
much work font authors face to cover the code blocks. Now I do. Anyway I am
left scratching my head how to use emoticons in my documents without changing
my three font configurations. And I'm not the only one.

The ucharclass https://github.com/Pomax/ucharclasses packages exists to solve
this topic. It detects the Unicode block for the characters and changes the
font in place. However #1 I couldn't get it working and #2 the package has no
maintainer. After looking at it I don't think I can do it so I looked for
another way to handle this.

This post
https://tex.stackexchange.com/questions/25249/how-do-i-use-a-particular-font-for-a-small-section-of-text-in-my-document
explains how to change the font for a particular region. It works great. I
tested it out for my use cases and it works fine. Here is an example file:

\documentclass[]{article}
\usepackage{fontspec}
\newfontfamily\xxtx{Symbola}
\begin{document}
The domino doesn't exist in my default font.
{\xxtx But it does in here: .}
\end{document}

The ability to use Unicode in Org-Mode and seamlessly export it to PDF via
XeTeX is so nice. And it looks pretty easy to handle different fontx in the
code. So I figured I could write an exporter that extends ox-latex exporter to
do this for me.

The exporter would be basic: it would look at every single character, figure out
if it is in a "special to me" block, and if it is use a different font. My
plan is that simple.

Questions for you:

- What do you think of this?
- What would you do here?
- Would you use it?

My use case is pretty simple, being able to use emoticons and APL characters
and stuff. And I can't be the only one that would use it. I'm reaching out
here though because I'm pretty out of touch in regards to other Org-Mode XeTeX
users.

Regards,

Grant



Re: [O] Proposal: references from code to text.

2018-06-15 Thread Grant Rettke
On Wed, May 16, 2018 at 9:25 AM, John Kitchin  wrote:
> #+NAME: DOC-OF-ADD
> We use the function add to calculate the sum of two numbers.
>
> #+NAME: add-options
> - one
> - two
> - three
> - and of course "optional things"
>
>
> We use a block like this to get the contents of an org-element by name as a
> string, and possibly transform it some how, e.g. in this case I escape
> quotes. I guess you could also use an exporter to convert it to what ever
> form you want. You might bury this block at the end in an appendix so it
> isn't in the middle of your document like this.
>
> #+name: get-string
> #+BEGIN_SRC emacs-lisp :var name="add-options"
> (let ((el (org-element-map (org-element-parse-buffer)
> org-element-all-elements
> (lambda (el)
>   (when (string= (org-element-property :name el) name)
> el))
> nil t)))
>   (let ((s (buffer-substring (org-element-property :contents-begin el)
>  (org-element-property :contents-end el
> (replace-regexp-in-string "\\\"" "\"" s)))
> #+END_SRC
>
>
> Now, we can use those elements in a src-block like this.
>
> #+NAME: ADD
> #+BEGIN_SRC emacs-lisp -n -r :noweb yes :tangle test.el
> (defun add (x y)
>   "One line description of adding X and Y.
>   <> ;; code to code
>   <>"
>   ;; [[id:BAD97113-3561-4A4A-BA07-0CD5BF6BA35F][There is a reason we only
> support two args]] code to text
>   (+ x y) (ref:add)
>   ;; it appears the coderef needs to be on it's own line, otherwise you get
> a org-link-search: No match for coderef: add when you click on the link.
>   )
> #+END_SRC

This thread is great. Got me thinking about "true" one-time
documentation definitions in the file itself. The blog post laid it
all out very nicely.

It got me wondering if I (or anybody) would like something like this
style of use where you write your documentation in-line of the
document using a macro that might look like this:

Add a macro that you could use in the documentation like this both to
define the string and include it in the export

"The document adding function is pretty important to the doc function Add. .

#+MACRO: add-string (eval (add-string "$1" "$2")

Add a file buffer-local variable of key/value pairs for strings named 'strings'.

Add helper functions with the same names here "get-string, add-string"
to use it (pseudo code follows)

#+name: add-string
#+begin_src emacs-lisp :var key="default" :var value="default
;; if the key doesn't exist in the hashmap then add it and return the value
;; otherwise just return the value so it doesn't stomp on the existing value
#+end_src

Add would return the string, and that would get inserted in the export.

Get-string would just get they key's value from the hashmap

#+name: get-string
#+begin_src emacs-lisp :var key="default"
;; if the key exists then return its value
;; otherwise return "UNDEFINED"
#+end_src

To use that documentation in the source block it would work the same as above

It would be easy to add prettification to cut down on the "noise" of
the syntax to use the macro and do the literate call, too that people
might like.

This is all pseudo code but I think it is in the same spirit of this
thread. Do you?



Re: [O] Issues with org-babel-detangle and :comments noweb

2018-06-15 Thread Grant Rettke
On Mon, May 28, 2018 at 12:32 PM, Frederick Giasson  wrote:
> Hi Everybody,
>
> I am trying to have noweb references working with org-babel-detangle. Let's
> use this example:
>
> ```
> #+NAME: a
> #+BEGIN_SRC clojure
>
> (def a "a")
>
> #+END_SRC
>
> #+NAME: b
> #+BEGIN_SRC clojure
>
> (def a "b")
>
> #+END_SRC
>
> #+NAME: c
> #+BEGIN_SRC clojure
>
> (def a "c")
>
> #+END_SRC
>
> #+NAME: a
> #+BEGIN_SRC clojure
>
> (def a "a")
>
> #+END_SRC
>
>
> #+NAME: test
> #+BEGIN_SRC clojure :tangle test.clj :mkdirp yes :noweb yes :padline yes
> :results silent :comments noweb
>
> <>
> <>
> <>
>
> #+END_SRC
>
> ```
>
>
> Once tangled, the test.clj file looks like:
>
> ```
> ;; [[file:test.org::test][test]]
> ;; [[file:test.org::a][a]]
>
> (def a "a")
>
> ;; a ends here
> ;; [[file:test.org::a][a]]
>
> (def a "a")
>
> ;; a ends here
> ;; [[file:test.org::b][b]]
>
> (def a "b")
>
> ;; b ends here
> ;; [[file:test.org::c][c]]
>
> (def a "c")
>
> ;; c ends here
> ;; test ends here
> ```
>
> If I perform org-babel-tangle-jump-to-org  everything works fine, I jump to
> the block codes.
>
> However if I perform org-babel-detangle, when I get the message "Not in
> tangle code". The problem appears to be that the references are "embedded"
> in the tangled block code. If I move the "test ends here" above, then it
> works, but then when the tangled block code get detangled, I loose the noweb
> references.
>
> Any idea if there is a work around for that? I would like to use
> org-babel-tangle-jump-to-org and org-babel-detangle while being about to
> change the order of the code within the block codes in the tangled file.

Hi Fred,

I took your example and changed the language but that doesn't affect
the example.

All of the examples include what is the minimum amount necessary.

Here is my version of the org file

=

#+NAME: a
#+BEGIN_SRC clojure
(def a "a")
#+END_SRC
#+NAME: b
#+BEGIN_SRC clojure
(def b "b")
#+END_SRC
#+NAME: c
#+BEGIN_SRC clojure
(def c "c")
#+END_SRC
#+NAME: test
#+BEGIN_SRC emacs-lisp :tangle test.el
⟪a⟫
⟪b⟫
⟪c⟫
#+END_SRC

=

Here is the generated code

;; [[file:~/tmp/frederick.org::test][test]]
;; [[file:~/tmp/frederick.org::a][a]]
(def a "a")
;; a ends here
;; [[file:~/tmp/frederick.org::b][b]]
(def b "b")
;; b ends here
;; [[file:~/tmp/frederick.org::c][c]]
(def c "c")
;; c ends here
;; test ends here


=

If I go the the tangled code

;; [[file:~/tmp/frederick.org::c][c]]
(def c "c") <--- and put the cursor here
;; c ends here
;; test ends here

And call org-babel-tangle-jump-to-org

#+NAME: c
#+BEGIN_SRC clojure
(def c "c") <--- then the cursor jumps here
#+END_SRC

=

If I go the the tangled code

;; [[file:~/tmp/frederick.org::test][test]] <--- and put the cursor here
;; [[file:~/tmp/frederick.org::a][a]]
(def a "a")
;; a ends here

And call org-babel-tangle-jump-to-org

#+NAME: test
#+BEGIN_SRC emacs-lisp :tangle test.el <--- then the cursor jumps here
<>
<>
<>
#+END_SRC

=

It seems like Org "knows what to do here".

Here is my question:

If I take the tangled code and change the source block so the order is
reverse and the content of c has changed

;; [[file:~/tmp/frederick.org::test][test]]
;; [[file:~/tmp/frederick.org::c][c]]
(def c "CADILLAC")
;; c ends here
;; [[file:~/tmp/frederick.org::b][b]]
(def b "b")
;; b ends here
;; [[file:~/tmp/frederick.org::a][a]]
(def a "a")
;; a ends here
;; test ends here

And I detangle that file:

Then do you want the code in the source file to look like this?

#+NAME: c
#+BEGIN_SRC clojure
(def c "Cadillac")
#+END_SRC

#+NAME: test
#+BEGIN_SRC emacs-lisp :tangle test.el
⟪c⟫
⟪b⟫
⟪a⟫
#+END_SRC

=

Does the jumping to org working the same here for you as for me?

Is the detangling behavior example I wrote what you are thinking of?

I am asking because I want to know if I understand correctly or not.



Re: [O] General advice beyond Org

2018-06-15 Thread Grant Rettke
On Wed, Jun 6, 2018 at 3:58 AM, Marco  wrote:
> I started as post-doc almost 10 years ago,

Thanks for your share Marco.



Re: [O] New org-count-words function

2018-06-15 Thread Grant Rettke
On Tue, Jun 12, 2018 at 2:58 PM, Adam Porter  wrote:
> I think it's an improvement over the functions I've seen that do this.
> Hope someone finds it useful.

Thank you that is very nice.

Got me thinking that it would be fun to write some code that would
report file statistics by element.



Re: [O] How to use em-dash as a bullet for plain text lists?

2018-06-14 Thread Grant Rettke
>> What could be possible, however, is to add UTF-8 characters as overlays
>> on top of standard bullets. I think "org-bullet" does something like
>> that.

This seems to work:

(font-lock-add-keywords
 'org-mode
 '(("^[[:space:]]*\\(-\\) "
0 (prog1 () (compose-region (match-beginning 1) (match-end 1) "—")



Re: [O] How to use em-dash as a bullet for plain text lists?

2018-06-14 Thread Grant Rettke
Sincerely,

Grant Rettke

On Thu, Jun 14, 2018 at 9:14 AM, Nicolas Goaziou  wrote:
>
> Hello,
>
> Grant Rettke  writes:
>
> > Hi,
> >
> > I want to use em-dash as a bullet for plain lists.
> >
> > I read the documentation and didn't see a customization option.
>
> >
> > I read org-list.el only enough to get a rough idea of how it
> > works. org-at-item-p, org-at-item-bullet-p, org-item-re seem important for
> > understanding the structure.
> >
> > Before I go any further (studying or coding)
> >
> > 1. How would you go about this?
> > 2. Is it worth me going further on figuring out how this works and how to
> > do it?
>
> This is not supported and I think it shouldn't be. Since its inception,
> Org syntax focuses on ASCII characters. em dashes do not belong to that
> class.
>
> What could be possible, however, is to add UTF-8 characters as overlays
> on top of standard bullets. I think "org-bullet" does something like
> that.

Thanks! That helps to know about its focus.



[O] How to use em-dash as a bullet for plain text lists?

2018-06-13 Thread Grant Rettke
Hi,

I want to use em-dash as a bullet for plain lists.

I read the documentation and didn't see a customization option.

I read org-list.el only enough to get a rough idea of how it
works. org-at-item-p, org-at-item-bullet-p, org-item-re seem important for
understanding the structure.

Before I go any further (studying or coding)

1. How would you go about this?
2. Is it worth me going further on figuring out how this works and how to
do it?

Sincerely,

Grant Rettke


Re: [O] org-detangle seems broken

2018-06-06 Thread Grant Rettke
On Wed, Jun 6, 2018 at 7:31 AM, Frederick Giasson  wrote:
> If this is really the behavior, then I think that a new option should be 
> added to it such that we can choose one behavior or the other. If a function 
> that jump from a code
> block to its tangled source is created, then we could use it with that option 
> in `org-babel-detangle` to switch back to the source if it is the wish of the 
> user.

It sounds like org-babel-tangle-jump-to-org is what you want.



Re: [O] org-detangle seems broken

2018-06-05 Thread Grant Rettke
On Tue, Jun 5, 2018 at 7:18 AM, Frederick Giasson  wrote:
> There is one last thing related to =org-babel-detangle= that seems "broken"
> is that as far as I can see, the top =save-excursion= should save the
> position of the cursor of the source file and keep the buffer at that
> position when we perform a detangling on it, no?
>
> Right now, the behavior is that when we do a detangle from a source file,
> the org file get opened in the buffer of the source file.
>
> However, I think that the right behavior is that when we detangle that the
> remain at the same position in the source file otherwise this gets confusing
> in my opinion.
>
> Is that a bug or the expected behavior?

I think it is expected. The code looks like this:

(when (setq new-body (org-babel-tangle-jump-to-org))
  (org-babel-update-block-body new-body))

The first time I detangled I was surprised, too.

But then it hit me: if you are detangling then you probably might want to
1. See the updated code
2. Commit the updated code

So now I like it.



Re: [O] Moving from Jekyll to Orgmode

2018-04-29 Thread Grant Rettke
On Sat, Apr 28, 2018 at 4:05 PM, ST  wrote:
> 3. is there a free modern "corporate" style theme for org-mode?

Twitter Bootstrap https://github.com/marsmining/ox-twbs and
and these themes https://github.com/fniessen/org-html-themes are corporate-ish.



Re: [O] Patch adding from-logo to ox-koma-letter.el

2018-04-27 Thread Grant Rettke
On Fri, Apr 27, 2018 at 11:30 PM, Grant Rettke <g...@wisdomandwonder.com> wrote:
> Tested it manually with Elisp and also in buffer properties. There are
> four combinations (both in properties, both in Elisp, and then the two
> permutations).

Here is how it works, the same way as the other ones:

#+name: 
org_gcr_2018-04-27T22-46-38-05-00_mara_081C9DD8-1C37-4A55-833C-1BEC6AA754FF
#+begin_src sh
#+FROM_LOGO: \includegraphics{wnw-from-logo-1inx1in}
#+OPTIONS: from-logo:t
#+end_src

#+name: 
org_gcr_2018-04-27T22-46-38-05-00_mara_F28B56C1-0226-4AFB-B044-702315603A99
#+begin_src emacs-lisp
(setq org-koma-letter-from-logo "\\includegraphics{wnw-from-logo-1inx1in}")
(setq org-koma-letter-use-from-logo t)
#+end_src

If eventually this patch is accepted then I will update Worg with this variable.



[O] Patch adding from-logo to ox-koma-letter.el

2018-04-27 Thread Grant Rettke
Hi,

This patch adds from-logo support to ox-koma-letter.el.

Tested it manually with Elisp and also in buffer properties. There are
four combinations (both in properties, both in Elisp, and then the two
permutations).

It was a copy-and-paste job so I marked it as a tinychange even though
it was more than 15 lines.

Ran the system tests and they pass.

Sincerely,

Grant Rettke


0001-ox-koma-letter.el-Adds-from-logo-variable.patch
Description: Binary data


Re: [O] [RFC] Add new export backend for Jekyll

2018-03-18 Thread Grant Rettke
On Sat, Mar 17, 2018 at 4:45 PM, Łukasz Stelmach  wrote:

> This is kind of work-in-progress version. "Kind of" because it satisfies
> my needs and I would like to ask what others think or need.
>
> How to test this module?
>
> Please comment.


That looks great.

Best way to start is to put it on GitHub so others can try it out.

Also be sure to search melpa.org/#/ and GitHub (and the Internet) for
anything to do with Org-Mode and Jekyll. If there is similar work, it might
be a good opportunity for collaboration.


Re: [O] Specifying the tangle filename based on the source filename?

2018-01-28 Thread Grant Rettke
On Sun, Jan 28, 2018 at 7:54 AM, Diego Zamboni  wrote:

> Hi,
>
> I’ve been converting many of my configuration files to org-mode to better
> document them (examples: https://github.com/zzamboni/dot_emacs/blob/
> master/init.org, https://github.com/zzamboni/dot_elvish/blob/master/rc.org).
> Usually I have a line like the following at the top of each org file:
>
> #+PROPERTY: header-args:emacs-lisp :tangle init.el
>
> So that all the code blocks in the file are, by default, tangled to the
> corresponding config file. I was wondering if it might be possible to avoid
> hardcoding the output file (“init.el” in this example) and instead derive
> it from the source filename (“init.org” in this case). I’ve looked a bit
> through the manual and although I found the macro, I couldn’t get it to
> work.
>
> #+PROPERTY: header-args :tangle (concat (file-name-sans-extension
(buffer-file-name)) ".el")

#+NAME: org_gcr_2018-01-25_mara_5AA14ABD-5F82-4515-893A-B2370B6F4321
#+BEGIN_SRC emacs-lisp
(message "Text")
#+END_SRC


Re: [O] babel header argument :var is not expanded when tangling

2017-12-27 Thread Grant Rettke
They work differently. Try this example:

#+BEGIN_SRC emacs-lisp :var x="hi"
(message x)
#+END_SRC

tangles to

(let ((x (quote "hi")))
(message x))

but this

#+NAME: x
#+BEGIN_SRC emacs-lisp
"hi"
#+END_SRC

#+BEGIN_SRC emacs-lisp
(message «x»)
#+END_SRC

tangles to this

(message "hi"


Sincerely,

Grant Rettke

On Mon, Dec 25, 2017 at 6:45 AM, numbch...@gmail.com <numbch...@gmail.com>
wrote:

>
> I see. I will use noweb style for now.
> But should tangle expand :var variables when tangling? I think this is the
> correct behaviour.
>
> [stardiviner] GPG key ID: 47C32433
> IRC(freeenode): stardiviner Twitter:  @numbchild
> Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
> Blog: http://stardiviner.github.io/
>
> On Sun, Dec 24, 2017 at 11:40 PM, Grant Rettke <g...@wisdomandwonder.com>
> wrote:
>
>> > Here is a quick test:
>> >
>> > * Test tangle will auto expand and substitute :var
>> >
>> > #+begin_src js :tangle kk.js
>> > console.log("hello, world!");
>> > #+end_src
>> >
>> > #+begin_src js :var name="chris" :tangle require-kk.js
>> > // require("kk.js");
>> > console.log("Hi, ", name);
>> > #+end_src
>> >
>> > #+RESULTS:
>> > : Hi,  chris
>> >
>> > #+NAME: check whether tangle expand and substitute :var
>> > #+begin_src shell
>> > cat require-kk.js
>> > #+end_src
>> >
>> > #+RESULTS: check whether tangle expand and substitute :var
>> > : var name="chris";
>> > : console.log("Hi, ", name);
>> >
>> > The upper result should be: ~console.log("Hi, ", "chris");~.
>>
>> Here are your two source blocks. They each do literate programming,
>> one with Variable style and the other with Noweb style. When you
>> evaluate them you get an identical result. When you tangle them you
>> get two different pieces of code, that generate the same result. You
>> can peek at what the tangled code will look like by calling
>> org-babel-expand-src-block inside the source block. That is how it
>> will look in the tangled file. I think that want Noweb style.
>>
>> When I use the Variable approach like this
>>
>> #+begin_src js :var name="chris" :tangle kk.js
>> console.log("Hi, ", name);
>> #+end_src
>>
>> I get this in the tangled output file
>>
>> var name="chris";
>> console.log("Hi, ", name);
>>
>> When I use the the Noweb approach like this
>>
>> #+NAME: name
>> #+BEGIN_SRC emacs-lisp
>> chris
>> #+END_SRC
>>
>> #+NAME: org_gcr_2017-12-23_mara_3D887FDD-163D-4BE1-80E8-464BF29DABEA
>> #+BEGIN_SRC js :tangle noweb-kk.js :comments no
>> console.log("Hi, ", "«name»");
>> #+END_SRC
>>
>> I get this in the tangled  output file
>>
>> console.log("Hi, ", "chris");
>>
>> WDYT?
>>
>
>


Re: [O] babel header argument :var is not expanded when tangling

2017-12-24 Thread Grant Rettke
> Here is a quick test:
>
> * Test tangle will auto expand and substitute :var
>
> #+begin_src js :tangle kk.js
> console.log("hello, world!");
> #+end_src
>
> #+begin_src js :var name="chris" :tangle require-kk.js
> // require("kk.js");
> console.log("Hi, ", name);
> #+end_src
>
> #+RESULTS:
> : Hi,  chris
>
> #+NAME: check whether tangle expand and substitute :var
> #+begin_src shell
> cat require-kk.js
> #+end_src
>
> #+RESULTS: check whether tangle expand and substitute :var
> : var name="chris";
> : console.log("Hi, ", name);
>
> The upper result should be: ~console.log("Hi, ", "chris");~.

Here are your two source blocks. They each do literate programming,
one with Variable style and the other with Noweb style. When you
evaluate them you get an identical result. When you tangle them you
get two different pieces of code, that generate the same result. You
can peek at what the tangled code will look like by calling
org-babel-expand-src-block inside the source block. That is how it
will look in the tangled file. I think that want Noweb style.

When I use the Variable approach like this

#+begin_src js :var name="chris" :tangle kk.js
console.log("Hi, ", name);
#+end_src

I get this in the tangled output file

var name="chris";
console.log("Hi, ", name);

When I use the the Noweb approach like this

#+NAME: name
#+BEGIN_SRC emacs-lisp
chris
#+END_SRC

#+NAME: org_gcr_2017-12-23_mara_3D887FDD-163D-4BE1-80E8-464BF29DABEA
#+BEGIN_SRC js :tangle noweb-kk.js :comments no
console.log("Hi, ", "«name»");
#+END_SRC

I get this in the tangled  output file

console.log("Hi, ", "chris");

WDYT?



Re: [O] advice please: best way to export to DOC(X) with maths

2017-12-17 Thread Grant Rettke
On Sun, Dec 17, 2017 at 10:55 AM, Scott Randby <sran...@gmail.com> wrote:
>
> On 12/15/2017 01:43 PM, Grant Rettke wrote:
> > Write it in Org. Export to Pandoc file pandoc-A.
> >
> > Export Pandoc file pandoc-A to Word file word-A. Send that to your
> > peers for review.
> >
> > Export Word file word-A to Pandoc file pandoc-B.
> >
> > Get the Word from your peers, the file with changes from their review,
> > word-C. Export it to pandoc-C
> >
> > Do a diff between pandoc-B and pandoc-C. Integrate the results into
> > your original Org file.
>
> I'm confused. My understanding is that Pandoc converts between file formats, 
> so I don't understand what you mean by a Pandoc file. What is the file format 
> of pandoc-A?
>
> Is this what you mean?
>
> Pandoc: Org -> word-A
> Pandoc: word-A -> pandoc-B.org
> Pandoc: word-C -> pandoc-C.org

Pandoc has their own markup language "Pandoc Markdown". That is what I
meant by "Pandoc". And that was totally wrong in regards to your
question. Sorry my mistake.

You said it right, yes. It makes it easy to diff the "reverse
engineered" Org fils to see what changed from the reviewers.



Re: [O] advice please: best way to export to DOC(X) with maths

2017-12-15 Thread Grant Rettke
Write it in Org. Export to Pandoc file pandoc-A.

Export Pandoc file pandoc-A to Word file word-A. Send that to your
peers for review.

Export Word file word-A to Pandoc file pandoc-B.

Get the Word from your peers, the file with changes from their review,
word-C. Export it to pandoc-C

Do a diff between pandoc-B and pandoc-C. Integrate the results into
your original Org file.
Sincerely,

Grant Rettke

(accidentally replied off list)
Sincerely,

Grant Rettke


On Fri, Dec 15, 2017 at 8:54 AM, Tim O'Callaghan <t...@linux.com> wrote:
> Does anyone know of a good round trip/review workflow for word documents?
> I'm interested in generating documents and processing feedback/comments,
> especially with word document tracking.
>
> On 15 December 2017 at 14:30, Eric S Fraga <esfli...@gmail.com> wrote:
>>
>> On Friday, 15 Dec 2017 at 13:58, Fabrice Popineau wrote:
>> > The best way  is probably to generate a PDF with LaTeX
>> > and to open it with MS-Word. Yes, it can do that, and the math import
>> > is quite good (for what I have seen, at least as good as any other
>> > alternative option).
>>
>> Interesting.  I don't use MS Word (I'm on Linux on all of my systems)
>> but may ask somebody to check this out for me.  LibreOffice almost works
>> importing the PDF generated via LaTeX but not quite.  OneDrive (web
>> interface) doesn't quite work either.
>>
>> But pandoc is handling most of what I need.
>>
>> thanks,
>> eric
>>
>> --
>> Eric S Fraga via Emacs 27.0.50, Org release_9.1.4-214-ge8b71b
>
>



Re: [O] can't get org-mode noweb tangle to work

2017-12-01 Thread Grant Rettke
On Fri, Nov 24, 2017 at 11:38 PM, Martin Alsinet 
wrote:

> Hello Charlie:
>
> I have found that I like better to use a combination of tangle and import
> instead of noweb syntax.
>
> #+BEGIN_SRC python :tangle board.py
> def init_board(args)
> return [[-1 for x in range(3)] for y in range(3)]
> #+END_SRC
>
> #+BEGIN_SRC python
> import sys
> import os
> from board import init_board
>
> def main(args):
> init_board(args)
>
> if __name__ == "__main__":
> main(sys.argv)
> #+END_SRC
>
> Then, you do a *M-x org-babel-tangle* and org will write the first block
> into board.py. Then you go into the second block and run it with *C-c C-c* and
> it will load the init_board function from the tangled file.
>
> Writing it this way forces you to modularize your code blocks to be able
> to call them from other blocks and you can even build your whole
> application tangling the source blocks into files.
>
> The :noweb syntax seems to me to be a templating solution used for a code
> module problem.
>

It can be if you like that style. You can define re-usable and callable
source blocks and tangle them to their own file and to other files, too.
For example using the example above you can use both approaches:

#+NAME: init
#+BEGIN_SRC python :tangle board.py :comments no
def init_board(args)
return [[-1 for x in range(3)] for y in range(3)]
#+END_SRC

#+NAME: org_gcr_2017-11-30_mara_1BB0EB7B-1693-458D-B1AD-CE44ED9961C1
#+BEGIN_SRC python :comments no :tangle program.py
import sys
import os

«init»

def main(args):
init_board(args)

if __name__ == "__main__":
main(sys.argv)
#+END_SRC

Calling `org-babel-expand-src-block'


Re: [O] RFC better Unicode support - Unicode Characters causing problems with TAGs etc.

2017-12-01 Thread Grant Rettke
On Fri, Dec 1, 2017 at 2:40 AM, Tim O'Callaghan
 wrote:
>
> Also, are other people using Unicode, and if so, how? especially with 
> visually consistent tables,

For some characters you can handle it by using
[[http://orgmode.org/manual/Special-symbols.html][Special symbols]] in
the tables
for example this lines up correctly:

| hi | there | a | b | c |
|+---+---+---+---|
| \laquo{}  | \raquo{} | \pi{} | \check{} |   |

[[http://orgmode.org/worg/org-symbols.html][Here]] are the symbols.

You can also list them by calling `org-entities-help'.

> does anyone have a a good mono-spaced to recommend?

DejaVuSansMono.

With Symbola as a fallback:

(set-fontset-font "fontset-default" nil
  (font-spec :size 20 :name "Symbola"))



Re: [O] Multi-layer ergonomic keyboard and org-mode

2017-10-26 Thread Grant Rettke
On Thu, Oct 26, 2017 at 6:33 AM, Roland Everaert  wrote:
> This organization depends on your workflow, but their is surely some standard 
> key arrangement to improve our typing with our favorite editor an module.

A keyboard like that easily provides more keybinding "namespaces", for
keys where c=control, m=meta, s=super, h=hyper.

For one you get a hyper key. So you go from 6 namespaces (c, m, s, cm,
cs, ms) to 24 (if you are willing to use all of the combinations).

You can easily configure a single key to be any of those 24
combinations so you don't need to worry about finger strain. For
example you can have a single key that is C-M-s-H. That namespace is
wide open. You can also add Shift to double things.

Another valuable feature is the ability to configure a key for
"strike" versus "hold". For example strike the enter key and send
enter. Hold the enter key and make it the Control modifier.

Configuring the keyboard can become a hobby in itself.



Re: [O] OT: TUI applications

2017-10-18 Thread Grant Rettke
On Wed, Oct 18, 2017 at 8:23 AM, Russell Adams 
wrote:

> Given the unique user base of Org, I wanted to ask a question.
>
> Has anyone seen any modern development libraries for TUI (console /
> character cell) applications? Ncurses the library is
> not an answer as you have to start from scratch. There are thousands of
> web frameworks, and yet console is infinitely
> simpler than a LAMP stack, but there are no prepackaged libraries for
> working with it (ie: forms, widgets, etc).
>
> I frequently find myself in the position to need a small custom database
> application for this or that (contacts,
> invoicing, recipes!). Python (or similar) + SQLite seems like a no
> brainer, except I don't want webapps or a giant GUI
> program like libreoffice Base. I'd use something that was text forms based
> like an old dBase product.
>
> I've looked at Emacs forms, but they appear to be only for editing CSV
> data.
>
> Any ideas?
>
>
> https://www.gnu.org/software/emacs/manual/html_mono/widget.html


Re: [O] Bug?? #+begin_src sh :file

2017-09-16 Thread Grant Rettke
On Sat, Sep 16, 2017 at 9:09 AM, Charles Millar  wrote:
> The following ECL is based on Grant Rettke's Org Scraps -

Correction: They are Eric Schulte's (https://www.cs.unm.edu/~eschulte/)



Re: [O] How to create tables with multi-rows/columns cells?

2017-09-12 Thread Grant Rettke
If you set the column width like this

http://orgmode.org/manual/Column-width-and-alignment.html#Column-width-and-alignment

then you can hit C-` to edit the cell and that works nicely.

Sincerely,

Grant Rettke

On Mon, Sep 11, 2017 at 4:47 AM, Eric S Fraga <esfli...@gmail.com> wrote:

> On Monday, 11 Sep 2017 at 04:36, jiewuza wrote:
> > It is quite common to have multi-rows/columns cells in talbe. But as far
> > as I know, it seems impossible with the org built-in table editor.
>
> org does not support multi-row/column cells in tables.  When you say:
>
> > It works.
>
> what do you mean?  If I edit your example, org does not recognise it as
> a table (or, at least, not a properly defined one).
>
> --
> : Eric S Fraga via Emacs 24.5.1, Org release_9.1-57-gc6e563
>


Re: [O] Release 9.1

2017-09-08 Thread Grant Rettke
On Wed, Sep 6, 2017 at 5:07 AM, Rasmus  wrote:
>
> Bastien  writes:
>
> > Org-mode 9.1 is out!
> >
> > http://orgmode.org/Changes.html
>
> Great news!
>
> Thank you Nicolas, Kyle, Marco, Bastien, Kaushal, Achim and other code-
> and mailing list contributors.

Thank you generous and kind people.



Re: [O] Add-Easy-Template-for-COMMENT-C to org.el

2017-08-08 Thread Grant Rettke
Hi,

On Mon, Aug 7, 2017 at 4:47 AM, Nicolas Goaziou <m...@nicolasgoaziou.fr> wrote:
> Grant Rettke <g...@wisdomandwonder.com> writes:
>
>> Attached is a patch to an Easy Template binding `C' for `COMMENT'.
> Thank you. Would you mind also adding an entry in ORG-NEWS about it?

Done.

>> The tests had the same 1 failure before and after I made the change
>> "1 unexpected results:
>>FAILED  test-org/refile-get-targets"
>
> FWIW, I do not see the same. Have you set
> `org-refile-target-verify-function' or some other refile-related
> variable that would be different from `org-refile-use-outline-path'?

Yes in my init file I changed a lot of those settings.

Does my init file get used during execution of the tests?


0001-Add-Easy-Template-for-COMMENT-C.patch
Description: Binary data


Re: [O] Happily exporting LaTeX, now want to export to text and HTML, can't figure how to handle latex markup

2017-08-06 Thread Grant Rettke
On Wed, Aug 2, 2017 at 11:15 AM, Berry, Charles <ccbe...@ucsd.edu> wrote:
>> On Aug 1, 2017, at 10:20 PM, Grant Rettke <g...@wisdomandwonder.com> wrote:
>>
>> I'm happily exporting an Org-Mode document to LaTeX using the nifty
>> `letterine' package. An example is attached. Writing using it has been
> Putting together a macro seems like the best option.  Recall that you can use 
> elisp in macros by placing it between `(eval’ and `)', so the following emits 
> “def’ in all but latex exports and “abc” for latex.
>
> #+BEGIN_SRC emacs-lisp
> (defun foo (a b) (if (eq 'latex org-export-current-backend) a b))
> #+END_SRC
>
>
> #+MACRO: bar (eval (foo $1 $2))
>
>
> {{{bar("abc" "def")}}}

Thank you. That helps a lot.



Re: [O] exporting org to latex, execute matlab before exporting

2017-08-06 Thread Grant Rettke
On Wed, Aug 2, 2017 at 7:08 AM, Uwe Brauer  wrote:
> Which is what I want. When I convert the org file to latex I am again
> asked to execute the src block, which I don't want since it is already
> executed. How can I avoid this question, without deleting the src block.
> This is important if I have a lot of blocks which I already have
> executed, and want to export the file without denying is executing every
> time I am asked.

Never evaluate source-blocks or in-line-source-blocks *on export*.

#+NAME: org_gcr_2017-05-12_mara_FE5C21BF-9766-4277-A413-B3AF5C255C39
#+BEGIN_SRC emacs-lisp
(help/set-org-babel-default-header-args :eval "never-export")
(help/set-org-babel-default-inline-header-args :eval "never-export")
#+END_SRC

Never evaluate in-line-source-blocks *on export*.

#+NAME: org_gcr_2017-05-12_mara_DB816700-04B3-45D0-9847-490BBFE9DBA0
#+BEGIN_SRC emacs-lisp
(setq org-export-babel-evaluate nil)
#+END_SRC



[O] Add-Easy-Template-for-COMMENT-C to org.el

2017-08-06 Thread Grant Rettke
Good afternoon,

Attached is a patch to an Easy Template binding `C' for `COMMENT'.

The tests had the same 1 failure before and after I made the change
"1 unexpected results:
   FAILED  test-org/refile-get-targets"

I'm already in the FSF assignment book.

Sincerely,

Grant Rettke


0001-Add-Easy-Template-for-COMMENT-C.patch
Description: Binary data


[O] Happily exporting LaTeX, now want to export to text and HTML, can't figure how to handle latex markup

2017-08-01 Thread Grant Rettke
Good morning,

I'm happily exporting an Org-Mode document to LaTeX using the nifty
`letterine' package. An example is attached. Writing using it has been
so fun that naturally now I want to export it both to text and HTML.
My source document looks like this for reference and all of this works
fine:

> start
#+TITLE: A Poem Title
#+AUTHOR:
#+DATE:
#+OPTIONS: num:nil
#+LATEX: \pagenumbering{gobble}

#+BEGIN_CENTER
@@latex:\lettrine[lines=1]{T}{this}@@ is line 1.

@@latex:\lettrine[lines=1]{H}{ere}@@ is line 2.

@@latex:\lettrine[lines=1]{O}{ver}@@ there is line 3.
#+END_CENTER
> end

Now I'm left be wondering how I can using a single document and export
it correctly to LaTeX, HTML and text. Here are some ideas I came up
with:

- Write the same line two times, one for each exporter. Redundant but
it would work.
- Use a source block that takes a line of text, checks the type of
exporter running, and returns an appropriate markup then on export it
works right.
- Maybe there is a macro for this?
- I'm out of ideas

My Internet search results found a lot of answers about easy stuff.
However this article

https://emacs.stackexchange.com/questions/18636/create-a-custom-block-in-org-mode-that-exports-to-latex-and-html

looked interesting. I haven't started coding anything up yet and I
wanted to talk to you before that.

Thank you.


poem.pdf
Description: Adobe PDF document


Re: [O] ANN: org-web-tools

2017-07-21 Thread Grant Rettke
On Fri, Jul 21, 2017 at 3:09 PM, Eric S Fraga  wrote:
>
> On Friday, 21 Jul 2017 at 17:53, Adam Porter wrote:
> > Hi friends,
> >
> > I've just uploaded a package containing some code that I've been using
> > in my personal Emacs config for a while.  It has commands and functions
> > useful for retrieving web page content and processing it into Org-mode
> > content.
>
> Sounds very useful.  Thanks.  Where have you uploaded this to?

https://github.com/alphapapa/org-web-tools



Re: [O] Org-mode icon license

2017-07-16 Thread Grant Rettke
On Sun, Jul 16, 2017 at 6:49 PM, Konstantin Kliakhandler
 wrote:
> I would like to inquire regarding the copyright/license status of the 
> org-mode icon, and specifically as to whether it is
> permissible to use it in (org-mode related) OSS projects, such as browser 
> capture extensions.

Great question. There are 165 org-mode packages on MELPA. Org2Blog is
one of them https://github.com/org2blog/org2blog and I want a logo for
that, too. So maybe there are 163 other groups also looking for an
icon, or already have one. I'm not a graphic designer so I would be
hiring out the work. I need to tell them something like "It can't look
anything like this (Org-Mode's icon), or it can use the colors and
image, or it can include the image or...".

Hopefully there is a precedent for something like this to which we can
conform? Or maybe we don't need to worry about it at all? Or maybe we
figure it out in this thread?



Re: [O] [PATCH] ox-koma-letter.el: Add support for fromurl variable

2017-07-13 Thread Grant Rettke
On Mon, Jan 9, 2017 at 3:42 AM, Rasmus  wrote:

> The default description is "Url" and it does not have a corresponding
> "symbolicname".
>
> In general, descriptors are used in headers or footers which would
> typically be set up in a separate LCO file, I’d guess.  E.g.
>
>   \ifkomavarempty{fromurl}{}{\usekomavar*{fromurl}\usekomavar{fromurl}}

I set it in the LCO file like this

\setkomavar{fromurl}{\href{the ur}{the description}}

And then enable/disable or override it in the Org document.



Re: [O] [PATCH] ox-koma-letter.el: Add support for url variable

2017-07-13 Thread Grant Rettke
On Wed, Jan 4, 2017 at 4:57 PM, Nicolas Goaziou <m...@nicolasgoaziou.fr> wrote:
> Grant Rettke <g...@wisdomandwonder.com> writes:
> > The next change that I want to make is to include the description for
> > the fromurl like this:
> >
> > \setkomavar{fromurl}[description]{content}
> >
> > I haven't figured out how to do that yet.
>
> What is "description" supposed to do?
>
> > Subject: [PATCH] ox-koma-letter.el: Add support for fromurl variable
>
> Thank you.
>
> You need to add :inbuffer-url and :inbuffer-with-url keywords.  See,
> e.g., `:inbuffer-phone-number' and `:inbuffer-with-phone'.

Gotcha. Attached.


0001-ox-koma-letter.el-Add-support-for-url-variable.patch
Description: Binary data


Re: [O] org-plus-contrib, where is library-of-babel.org?

2017-07-11 Thread Grant Rettke
On Tue, Jul 11, 2017 at 5:13 AM, Rasmus  wrote:
>
> Bastien Guerry  writes:
> > Kyle Meyer  writes:
> >>> It will be in the next release (in /emacs/etc/org/).  If there's a license
> >>> issue it needs to be removed.
> >
> > The reason why this library-of-babel.org was not in Emacs is not
> > because of its lack of license.  I guess it's because Carsten and
> > Eric didn't think of it as something that should land in Emacs.
>
> Fine by me, but then let’s remove the references to it in the manual.

Maybe the feature could be referred to "Babel Libraries" or "Code
Block Libraries". Because they provide re-usable libraries. The
"library of babel" reads like there is just one of them, but there are
as many as you wish aka "Libraries of Babel". I skimmed over this
feature, skipping the part that you can load *anything*. It doesn't
stand out but it is a *big deal* for users coming to Org-Mode to know
that they can share/re-use libraries.

If you like a name then I will submit a pull request with a
documentation change.

The code change would rename functions and documentation. Is it too
soon to submit function name changes, too?



Re: [O] mimetype for orgmode files

2017-06-21 Thread Grant Rettke
On Wed, Jun 21, 2017 at 9:52 AM, John Kitchin  wrote:
> Is there an official mimetype for orgmode files?

In `mailcap-mime-extensions' there is a value `(".org"   . "text/x-org")'.

Maybe that is for Org-Mode.



[O] Offtopic: Auto Loading org2blog Mode

2017-06-12 Thread Grant Rettke
Good evening,

org2blog users:

Add #+ORG2BLOG: to your blog post or page and org2blog will get auto loaded...

after you get the latest code and make the following changes:

https://github.com/punchagan/org2blog#auto-loading-org2blog-mode

Let me know how it goes.

Sincerely,

Grant Rettke



Re: [O] Custom keymaps on org blocks

2017-06-07 Thread Grant Rettke
On Wed, Jun 7, 2017 at 8:50 AM, John Kitchin  wrote:
> On the other hand, there are times when I am working on a document that has
> a lot of short code blocks, e.g. for lecture notes or blog posts, where it
> is sufficiently tedious to me to switch in and out of the special edit mode

These bindings make source block navigation and editing really fast and fun!

(define-key org-mode-map (kbd "s-j") #'org-babel-next-src-block)
(define-key org-mode-map (kbd "s-k") #'org-babel-previous-src-block)
(define-key org-mode-map (kbd "s-l") #'org-edit-src-code)
(define-key org-src-mode-map (kbd "s-l") #'org-edit-src-exit)

Here the 'l' key binding is the most important. It makes for fast
entry and exit of the source block.

For my mind the default bindings "C-c '" interrupts my mental flow. It
is like hearing the sound of a cash register drawer sliding out, doing
some work there and then getting shoved back in every single time.
Ouch.

On the other hand, "s-l" both to enter and exit the source blocks, is
like hearing a gentle breath of air to cool a cup of tea that is a
tiny bit too warm, doing your work and then another gentle breath when
you leave the block.

That is the best way I can describe how much difference the two
bindings make. It is really a "feels" thing, and it feels a lot
better.

Seriously, these bindings might make you fall in love with source
block editing all the time.



Re: [O] Custom keymaps on org blocks

2017-06-07 Thread Grant Rettke
On Wed, Jun 7, 2017 at 7:49 AM, John Kitchin <jkitc...@andrew.cmu.edu> wrote:
> Grant Rettke writes:
>
>> You want Polymode: https://github.com/vspinu/polymode
>
> I have never been able to get polymode to work. Do have an incantation
> that works?

I forgot that I set it up for R markdown files. But it did work on my
machine after manually installing the `polymode' package.

https://github.com/grettke/home/blob/master/.emacs.el#L1992-L2005

>> It is confusing alternating between the Org major a mode and the
>> source block major mode as you scroll through documents. One second
>> you are an author for humans and the other an author for the computer.
>> That is how literate programming is defined in theory, but in practice
>> I don't do it like that because it is mentally jarring.
>
> Interesting perspective. I find switching to special edit mode jarring,
> particularly when it is just for the key bindings, e.g. lispy mode, or
> getting python indentation to work.

We are both surprised!



Re: [O] Custom keymaps on org blocks

2017-06-06 Thread Grant Rettke
On Mon, Jun 5, 2017 at 4:53 PM, John Kitchin  wrote:
> Is there any interest in having custom keymaps on org blocks?
>
> The idea I had is to have the option to make the major-mode keymaps be
> active on the src blocks.

You want Polymode: https://github.com/vspinu/polymode

> I have tried this, and seems ok, and I wondered if anyone had an opinion
> for or against this idea.

It is confusing alternating between the Org major a mode and the
source block major mode as you scroll through documents. One second
you are an author for humans and the other an author for the computer.
That is how literate programming is defined in theory, but in practice
I don't do it like that because it is mentally jarring.

I spell check my Org-Mode Literate Documents. But the spell checker
does not check source blocks. That is up to the major mode for that
source block, not for the containing literate document. When you think
about it, probably every Org-Mode literate programming has it set up
this way, otherwise the spell checker would go crazy on typical source
code. That is revealing. The source blocks are very different "things"
than the containing document.

For me the source block is another cognitive workspace that I enter
consciously. I am digging deeper into the document itself. For me the
source block is a window into that world of the source block. In the
top level document I write literature about things, including the
various source blocks. Then I jump into editing the source block
itself.

John you once had a discussion (or answered a (my?) question) about
making source blocks not-editable. That is how I would like it to work
all the time. That is why I don't fontify source blocks natively and
that is why I wouldn't enjoy what you describe.



Re: [O] VM for org-based reproducible environment?

2017-03-26 Thread Grant Rettke
On Mon, Jan 23, 2017 at 4:57 PM, Matt Price  wrote:

> Is anyone already doing this? I remember maybe John K. saying something
> along these lines a year or so ago, but can't find the details right away.
>

Not quite yet but it will be Ubuntu, VirtualBox and Packer when I do so it
is easy for every OS that supports vbox.


[O] [PATCH] ox-koma-letter.el: Add support for fromurl variable

2017-01-04 Thread Grant Rettke
Good morning,

I want to use the fromurl variable in KOMA so I copied how the phone
variable works.

The next change that I want to make is to include the description for
the fromurl like this:

\setkomavar{fromurl}[description]{content}

I haven't figured out how to do that yet.

Maybe the simplest thing is to let the user define it as a list with
url and description like this:

#+URL (url description)

The code can check if it a list or not when it generates the LaTeX code.

If this patch is accepted then I will figure out how to update Worg
with the fromurl variable.


0001-ox-koma-letter.el-Add-support-for-fromurl-variable.patch
Description: Binary data


Re: [O] Using an org based init file slows down emacs startup by 50x..help needed :(

2016-12-12 Thread Grant Rettke
On Sat, Dec 10, 2016 at 2:36 AM, Xebar Saram  wrote:
> So after a few months of frustration today i discovered the issue that's
> been bothering me for a long time..the REALLY slow emacs startup

I tangled it on my box like this:

Start Emacs default

emacs --no-init-file

(emacs-version)

"GNU Emacs 24.5.1 (x86_64-apple-darwin15.4.0, NS apple-appkit-1404.46)
 of 2016-06-08 on vela"

(org-version)

"8.2.10"

In Emacs I evaluated

(defmacro measure-time ( body)
  "Measure the time it takes to evaluate BODY."
  `(let ((time (current-time)))
 ,@body
 (message "%.06f" (float-time (time-since time)

And timed and tangled it.

It took approximately 8 minutes.

When I tangle it using my config it takes approximately 11 seconds.

I would start with a bisection of the file to try and narrow down when
and where the slowdown occurs.



Re: [O] Org-mode 9.0 : set tangle file in document PROPERTY

2016-11-26 Thread Grant Rettke
On Fri, Nov 25, 2016 at 5:23 PM, mcg  wrote:
> What is the syntax to set tangling for the whole file?
> #+PROPERTY: tangle ~/filepath.R does not work anymore...

Via http://orgmode.org/manual/Header-arguments-in-Org-mode-properties.html

#+PROPERTY: header-args:tangle ~/filepath.R



Re: [O] commands to get org mode running

2016-11-11 Thread Grant Rettke
On Fri, Nov 11, 2016 at 6:32 PM, Matthew Pritchard <
wintermute2...@icloud.com> wrote:

> What do I type in emacs to start org mode on OS X.
>
>
Here is one way to start:

https://emacsformacosx.com/

and

http://orgmode.org/manual/


Re: [O] Release 9.0

2016-11-03 Thread Grant Rettke
Hear, hear!

Thank you maintainers.
Sincerely,

Grant Rettke


On Wed, Nov 2, 2016 at 12:34 PM, Bastien Guerry <b...@bzg.fr> wrote:
> Hi all,
>
> Org 9.0 is out!  See the release notes here:
>
> http://orgmode.org/Changes.html
>
> Thanks to Nicolas, the non-official but real maintainer
> and to all who contributed to this long-awaited release.
>
> As usual, enjoy!
>
> --
>  Bastien
>
>



Re: [O] Orgmode for managing OS configuration

2016-11-03 Thread Grant Rettke
On Thu, Nov 3, 2016 at 6:44 AM, Giacomo M  wrote:
>
> Does anybody have experience with this?


Yes. Here is my top level provisioning document at the correct headline:

https://github.com/grettke/osx-provision/blob/master/El-Capitan/provisioning.md#provisioning

And here are all of the tangled files:

https://github.com/grettke/osx-provision/tree/master/El-Capitan

The scripts are all in Bash for the computer and Org-Mode for the
human (there are manual steps required).

This is for OS X and the concepts all apply to Linux.
>
> Is the experience positive or negative?


Positive. It makes it easy to break up your provisioning into separate
scripts. My scripts are supposed to be idempotent so it is easy to
play around and try new stuff. The Org document makes it easy to make
sense of everything.



Re: [O] trying to automatically refresh inline images after org-babel-execute:ditaa

2016-10-11 Thread Grant Rettke
On Tue, Oct 11, 2016 at 12:01 PM, Stig Brautaset  wrote:
> Hello!
>
> I'm trying to automatically update inline ditaa images, by adding this
> advice:
>
> ,
> |   (advice-add 'org-babel-execute:ditaa
> |   :after
> |   (lambda (a  b)
> | (message "my sage advice")
> | (org-redisplay-inline-images)))
> `
>
> When hitting =C-c C-c= in a =#+begin_src ditaa= block I *do* get my sage
> advice printed to *Messages*, but inline images just blinks out of
> existence. Is the image overlay removed at a higher level?
>
> Any advice (hah!) welcome.

(defun help/org-babel-after-execute-hook ()
  "HELP settings for the `org-babel-after-execute-hook'.

This does not interfere with exports.

Attribution: URL
`https://lists.gnu.org/archive/html/emacs-orgmode/2015-01/msg00534.html'"
  (interactive)
  (org-redisplay-inline-images))

(add-hook 'org-babel-after-execute-hook #'help/org-babel-after-execute-hook)



Re: [O] Leslie Lamport has a foot in the 21st century

2016-10-08 Thread Grant Rettke
On Sat, Oct 8, 2016 at 3:40 AM, Thierry Banel  wrote:
> But... Is Leslie killing LaTex?

No. LaTeX is a markup/programming-language and it /could/ be compiled
directly to whatever new ideal format arises, too.



Re: [O] Bug? org-export-babel-evaluate setting breaks :exports results

2016-10-03 Thread Grant Rettke
On Mon, Oct 3, 2016 at 8:22 PM, William Denton  wrote:
> There's always something new to learn in Org---and something new to be
> learned from this mailing list.

Never evaluating on export or tangle is my favorite way, too:

https://www.wisdomandwonder.com/article/10400/the-fifteen-questions-that-you-must-answer-in-your-org-mode-literate-programming-configuration



Re: [O] Bug? org-export-babel-evaluate setting breaks :exports results

2016-10-01 Thread Grant Rettke
This setting is one of the gems for developing a personal workflow.

My workflow is to never evaluate during export because I want the
document to serve as the "master" or the "one source of truth" that is
stored in version control.

The other perspective is never to store it which is what some people want, too!
Sincerely,

Grant Rettke


On Thu, Sep 29, 2016 at 3:34 PM, Charles C. Berry <ccbe...@ucsd.edu> wrote:
> On Thu, 29 Sep 2016, William Denton wrote:
>
>> I'm working on a big Org file on a slow machine, so I set
>> org-export-babel-evaluate to nil so exporting to PDF just generates the file
>> from what's in the buffer, without doing any calculating.
>>
>
> Actually it does a lot LESS than that.
>
> The docstring notes that:
>
> "When set to nil no code will be evaluated as part of the export
> process and no header argumentss will be obeyed."
>
> and advises:
>
> "Users who wish to avoid evaluating code on export should use the header
> argument ‘:eval never-export’."
>
> which sounds like what you wanted.
>
> Chuck



Re: [O] Dynamic tangle target?

2016-09-22 Thread Grant Rettke
Most things that you can image are also listed here:

https://eschulte.github.io/org-scraps/

Awesome reading for Org-Mode Literate Programmers.
Sincerely,

Grant Rettke


On Wed, Sep 21, 2016 at 8:06 PM, Charles C. Berry <ccbe...@ucsd.edu> wrote:
> On Wed, 21 Sep 2016, Philip Hudson wrote:
>
>> AFAICT :tangle takes only "yes", "no", or a literal pathname.
>
>
> Stuff like
>
>:tangle (my-lisp-function arg1 arg2)
>
> will work.
>
>> How
>> might I dynamically generate a pathname for :tangle? I suppose what I
>> want is some kind of escape syntax for eval'ing a Lisp form, like
>> maybe:
>>
>>:tangle %(my-dynamic-filename-generator)
>
>
> Try this:
>
> #+BEGIN_SRC R :tangle (concat "my-" "file" ".R")
> abs <- def
> #+END_SRC
>
> just as an example.
>
> BTW, org-babel-view-src-block-info (C-c C-v C-i) will show you what header
> args evaluate as without the need to eval or tangle them.
>
> HTH,
>
> Chuck
>



Re: [O] mailing list search given problems with gmane?

2016-09-07 Thread Grant Rettke
On Wed, Sep 7, 2016 at 5:32 PM, Charles Millar  wrote:
> Great! Then I can find who first reported that lists.gnu.org search was not
> working and when. I know that it wasn't me.

So you aren't saying that just the list for org-mode is broken you are
saying that all GNU mailing list archives are broken?!



Re: [O] mailing list search given problems with gmane?

2016-09-05 Thread Grant Rettke
On Mon, Sep 5, 2016 at 10:50 AM, Eric S Fraga  wrote:
> do we have any alternative means to search the mailing list given the
> current problems with gmane?

https://lists.gnu.org/archive/html/emacs-orgmode/



Re: [O] Bug: Org-babel-detangle does not work for subtrees [8.3.5 (8.3.5-elpaplus @ /home/andrea/.emacs.d/elpa/org-plus-contrib-20160808/)]

2016-08-30 Thread Grant Rettke
On Tue, Aug 30, 2016 at 12:25 PM, Andrea Giugliano  wrote:
> I think that the ideal solution is to allow an user to make
> org-babel-detangle rely on header IDs, since this not only assures
> detangle to find the correct header every time, but also push the user
> to use IDs through org-id (that seems good practice).
> What do you think?

Yes you should set a ID on every Headline and source-block
automatically using org-id so that detangling always works.

When you want a custom ID it is easily changed.



Re: [O] Should a human ever set the ID property? Should a human only ever set the CUSTOM_ID property?

2016-08-27 Thread Grant Rettke
On Thu, Aug 25, 2016 at 3:50 AM, Karl Voit  wrote:
> What is org-uuid and

http://orgmode.org/w/?p=org-mode.git;a=blob_plain;f=lisp/org-id.el;hb=HEAD

";;; org-id.el --- Global identifiers for Org entries"

> why should I have automatically generated IDs?

I do because I want `org-babel-detangle' to make sense whether the
reader has Emacss+Org-Mode, or not, and whether the writer has set ID
on headlines and NAME on codeblocks, or not. It is tedious to set
allocate a name for every single code block and headline when each of
them simply doesn't need a name or id. It is easier to give it a
default a name and id.



Re: [O] Emacs+org on Windows 7 pro

2016-08-22 Thread Grant Rettke
I found Cygwin to make things more difficult for Emacs so I installed
the plain old Windows Emacs and did the following:

https://github.com/grettke/help/blob/master/help.md#windows

https://www.wisdomandwonder.com/article/5647/enabling-png-jpg-and-gif-in-emacs-on-windows

I got Org from Git did the setup as described

https://github.com/grettke/help/blob/master/help.md#help-enables-literate-programming

And then everything else "just worked".
Sincerely,

Grant Rettke


On Mon, Aug 22, 2016 at 9:55 AM, Eric S Fraga <e.fr...@ucl.ac.uk> wrote:
> Hello all,
>
> I am asking a n00b question here: what the is best way to get org (+
> emacs obviously) on an MS Windows 7 pro system for use by more than one
> user on the system (multiple accounts with users not having
> Administrator accounts)?  I don't need bleeding edge versions of either
> org or emacs but hopefully something relatively up to date.
>
> The few times I have had to use a Windows system (luckily very seldom
> ;-), I have simply installed cygwin and gone from there.  This is not a
> viable solution in this case due to the users concerned.
>
> Thanks,
> eric
>
> --
> : Eric S Fraga (0xFFFCF67D), Emacs 25.0.94.1, Org release_8.3.5-1070-g190476
>



Re: [O] Should a human ever set the ID property? Should a human only ever set the CUSTOM_ID property?

2016-08-20 Thread Grant Rettke
On Thu, Aug 18, 2016 at 12:08 AM, Eric Abrahamsen
 wrote:
>
> My understanding (and I may be grokking things *incorrectly* here) is
> that CUSTOM_ID is mostly useful when you expect to be to be typing the
> ID itself (ie when linking to a headline), or when it's otherwise
> important that the text of the ID be some precise string, and not a
> random string.
>
> If all you want to do is ensure that all headlines have an ID, I would
> assume that the regular built-in functions would do the trick just fine.
>
> Lots of assumptions there!

Thank you Eric. Agreed. For my use case, they are perfect. If I want
to change them, too, I can change them in the document itself.
CUSTOM_ID seems to be used more for links and capturing.



[O] Should a human ever set the ID property? Should a human only ever set the CUSTOM_ID property?

2016-08-17 Thread Grant Rettke
Good evening,

Just learned about CUSTOM_ID property. It seems like if you want to
define a custom identifier, then you do it here and that identifier
will get used correctly in all of the weavers. It also seems like a
human should never set the value of the ID property.

The reason I ask is that I've got code that makes sure that every
headline has an ID property set unique because org-uuid makes it so
easy. At the time CUSTOM_ID didn't exist. It kind of looks like I
ought to refactor all of it to use CUSTOM_ID because it will "just
work" in the rest of org mode.

Am I grokking things correctly here?

Sincerely,

Grant Rettke



Re: [O] Tangling the same file in v8.2 and v.8.5 produces different results?

2016-08-04 Thread Grant Rettke
On Thu, Aug 4, 2016 at 1:48 PM, Charles C. Berry <ccbe...@ucsd.edu> wrote:
> On Wed, 3 Aug 2016, Grant Rettke wrote:
>
>> Good evening,
>>
>> I'm tangling this example in a file named test3.org
>>
>> --snip--
>> #+BEGIN_SRC sh :tangle yes :noweb yes :shebang #!/bin/sh
>> <>
>> #+END_SRC
>> * the mount point of the fullest disk
>>  :PROPERTIES:
>>  :noweb-ref: fullest-disk
>>  :END:
>
>
> First, see
>
> ./org-mode/etc/ORG-NEWS::*Old Babel header properties are no longer
> supported

That is exactly it.

It needs to be.

  :PROPERTIES:
  :header-args: :noweb-ref fullest-disk
  :END:

Sorry I forgot to check ORG-NEWS; I will remember now!



[O] Tangling the same file in v8.2 and v.8.5 produces different results?

2016-08-03 Thread Grant Rettke
Good evening,

I'm tangling this example in a file named test3.org

--snip--
#+BEGIN_SRC sh :tangle yes :noweb yes :shebang #!/bin/sh
<>
#+END_SRC
* the mount point of the fullest disk
  :PROPERTIES:
  :noweb-ref: fullest-disk
  :END:
** query all mounted disks
#+BEGIN_SRC sh
  df \
#+END_SRC
** strip the header row
#+BEGIN_SRC sh
  |sed '1d' \
#+END_SRC
** sort by the percent full
#+BEGIN_SRC sh
  |awk '{print $5 " " $6}'|sort -n |tail -1 \
#+END_SRC
** extract the mount point
#+BEGIN_SRC sh
  |awk '{print $2}'
#+END_SRC
--snip--

with

GNU Emacs 24.5.1 (x86_64-apple-darwin15.4.0, NS apple-appkit-1404.46)

and

Org-mode version 8.2.10 (release_8.2.10 @
/usr/local/Cellar/emacs/24.5/share/emacs/24.5/lisp/org/)

started like this

open /Applications/Emacs.app -n --args --no-init-file

and when I run `org-babel-tangle' it create a file test3.sh which
contains the following

--snip--
#!/bin/sh

df \
|sed '1d' \
|awk '{print $5 " " $6}'|sort -n |tail -1 \
|awk '{print $2}'
--snip--

I am trying to tangle the same file test3.org in the Git version of
Org-Mode and get a different result.

Here is how I started Emacs this time:

open /Applications/Emacs.app -n --args --quick --load
~/src/help/.org-mode-ecm.emacs.el

Here are the contents of .org-mode-ecm.emacs.el right now

--snip--
(setq load-prefer-newer t)
(add-to-list 'load-path "~/src/org-mode/lisp")
(add-to-list 'load-path "~/src/org-mode/contrib/lisp")
;;(setq org-list-allow-alphabetical t)
;;(setq org-enforce-todo-checkbox-dependencies t)
;;(setq org-babel-noweb-wrap-start "«")
;;(setq org-babel-noweb-wrap-end "»")
(require 'org)
--snip--

The Org mode version is

Org-mode version 8.3.5 (release_8.3.5-1032-g9798da-git @
/Users/gcr/src/org-mode/lisp/)

When I tangle the file it's output to test3.sh is

--snip--
#!/bin/sh
--snip--

I expected the contents of test3.sh to be the same when I tangled it
in Org 8.5 as in Org 8.2 but instead they were not.

Do you know if what setting changed to cause this or if I am doing
something incorrectly here what is the right approach?

Sincerely,

Grant Rettke



Re: [O] Can one tangle only the current blocks under header ?

2016-07-31 Thread Grant Rettke
You can `:tangle no' on the source block to exclude it from tangling.

You can even tangle one source block to a different or as many files
as you like during tangling.
Sincerely,

Grant Rettke


On Sat, Jul 30, 2016 at 1:38 PM, Joon Ro <joon...@outlook.com> wrote:
> can one tangle only the current blocks under header or  can you only tangle
> the whole file?
> the issue is again for dotfiles managed by org that these files are not
> proper org babel languages and look like this:
>
> #+BEGIN_SRC conf :mkdirp yes :tangle ~/.config/mpv/mpv.conf
> softvol-max=600
> #+END_SRC
>
> the manual (http://orgmode.org/manual/Extracting-source-code.html) only
> shows how to tangle the whole file
>
> any ideas?
>
>
> If you read the help for org-babel-tangle:
>
> With one universal prefix argument, only tangle the block at point.
> When two universal prefix arguments, only tangle blocks for the
> tangle file of the block at point.
>
>
> So if you do c-u first before org-babel-tangle, it will only tangle the code
> block at point.
> I use this a lot so I have the following in my init file:
>
> (defun org-babel-tangle-block()
>   (interactive)
>   (let ((current-prefix-arg '(4)))
>  (call-interactively 'org-babel-tangle)))
>
> (eval-after-load "org"
>   '(progn
>  (define-key org-mode-map (kbd "C-c b") 'org-babel-tangle-block)))
>
>
> So I can just do C-c b and it will just tangle the code block at point.
>
> And I agree with you I with the manual
> (http://orgmode.org/manual/Extracting-source-code.html) has this
> information.
>
> Hope this helps,
> Joon
>



Re: [O] how to speed up an org-mode file?

2016-07-11 Thread Grant Rettke
Try approaching this the same way that you would prepare an ECM:

http://orgmode.org/worg/org-faq.html

Start Emacs with a stable version of Org-Mode, without any additional
configuration.

Is the performance what you expect?

FWIW: two things that sped up my rather small in comparison Org-Mode files
were:
- Switching from linum to nlinum
- #+STARTUP: showeverything


Sincerely,

Grant Rettke

On Sun, Jul 10, 2016 at 9:37 AM, Sharon Kimble <boudic...@skimble.plus.com>
wrote:

>
> I'm working on an org-mode file about cancer which is 945.1kb, is
> converted to a tex file of 1.0mb and a pdf of 2.0mb with 505 pages. The
> conversion is done through this code snippet '(global-set-key (kbd
> "s-#") 'org-latex-export-to-latex)'. There is no problem with the
> conversion to tex or conversion to pdf.
>
> However, the org-mode file is increasingly slowing down and becoming
> difficult to move about within the file, and also enter new information
> within it.
>
> How then can I speed it up within the org file please?
>
> Thanks
> Sharon.
> --
> A taste of linux = http://www.sharons.org.uk
> TGmeds = http://www.tgmeds.org.uk
> Debian 8.4, fluxbox 1.3.7, emacs 25.0.95
>


Re: [O] org-install?

2016-06-14 Thread Grant Rettke
On Tue, Jun 14, 2016 at 12:06 PM, Rustom Mody  wrote:
> What is the setup procedure recommended for git-installed org?

1. Clone it to ~/src
2. Generate autoloads and Compiling Org without make:
http://orgmode.org/worg/org-hacks.html
3. Before the packaging stuff loads and runs in your config:
4. Always load the newest file: (setq load-prefer-newer t)
5. Load Org-Mode
(add-to-list 'load-path "~/src/org-mode/lisp")
(add-to-list 'load-path "~/src/org-mode/contrib/lisp")
(require 'org)




Re: [O] exporting documents w/ babel results w/o evaluating babel blocks

2016-05-23 Thread Grant Rettke
On Sun, May 22, 2016 at 4:52 PM, Charles C. Berry  wrote:
> TL;DR: Org babel headers give excellent control over what gets run,
> when it gets run, and how. Users should use them.

Definitely!

> Don't reset `org-export-babel-evaluate'.

Why not?

It can be nice to disable org-export-babel-evaluate by setting it to `nil'.

That way you separate your workflow into two distinct steps: one for
execution and one for weaving.

It would be fun to "see" everyone's Org-Mode workflows; I bet there
are a lot of nice approaches.



Re: [O] speed keys for plain lists?

2016-05-18 Thread Grant Rettke
On Tue, May 17, 2016 at 10:54 AM, Bill White  wrote:
> Could you post an example?

Sure. I wanted to refer to my heading by UID rather than name since I
wasn't sure of the final format:

https://raw.githubusercontent.com/grettke/help/master/help.org

Karl provided a format for your example using properties. I would
approach it the same way.

The folks that use Org-Mode to maintain bibliographies and BBDB
databases might have some feedback for you here, too.



Re: [O] speed keys for plain lists?

2016-05-16 Thread Grant Rettke
On Thu, May 12, 2016 at 12:12 PM, Bill White  wrote:
> But I'm open to suggestions & discussion - now's the time to play around
> with formats to find the right balance between playing with words and
> slogging through markup.  Perhaps this isn't the right mailing list for
> that discussion, though.

If it isn't then please post the name of that list when you find it.

I started out using only lists too because they are exactly as you
describe them.

Eventually I wanted to attach metadata to the lists, and now I love headings.

The case for Org-Mode only as a markup alone isn't very interesting
because it is competing against everything from SGML to ASCIIDoc. When
you throw in the community and infrastructure of tools and literature
then Org-Mode wins. It takes some time for it all to sink in though.

My gut reaction to learning Org-Mode (all aspects listed above) was
recalling this quote from Eric Weisstein:

"Created, developed, and nurtured by Eric Weisstein at Wolfram
Research" [http://mathworld.wolfram.com/]

Org-Mode makes it easy to do that with whatever document you are nurturing.



Re: [O] export to markdown: a simpler version which is more suited for github etc

2016-03-19 Thread Grant Rettke
On Sat, Mar 12, 2016 at 12:21 PM, Uwe Brauer  wrote:
> So the question is simply this could the converter be configured to use
> a simpler conversion?

Have you tried

http://orgmode.org/cgit.cgi/org-mode.git/plain/contrib/lisp/ox-gfm.el

?

It was made for Github and friends; we use it on Bitbucket, too.



Re: [O] Cannot export bash src

2016-02-25 Thread Grant Rettke
On Tue, Feb 23, 2016 at 4:23 AM, Giuseppe Lipari  wrote:
> Anybody has any idea of what is going on? I am available to give you more
> information (my init.org, and the whole org file, if necessary).

Depending on your version of Org try:

#+BEGIN_SRC shell bash



Re: [O] missing fancy character when using org-bullets

2016-02-02 Thread Grant Rettke
https://github.com/rolandwalker/unicode-fonts helps Emacs use all
available fonts' characters.


Sincerely,

Grant Rettke


On Tue, Feb 2, 2016 at 9:51 AM, Bingo UV <right...@gmail.com> wrote:
> On Tue, 2 Feb 2016 15:22:09 +0100
> Giacomo M <jackja...@gmail.com> wrote:
>
>> Dear all,
>> at work I have Windows 7, at home Windows 10. I use the same emacs
>> configuration, and Consolas as the default font face.
>> I indulge myself using org-bullets. At work it works. At home the
>> pretty symbol for 3-rd level outlines is missing. An empty rectangle
>> is showing instead. Other symbols, like those for the first two
>> levels headlines or things like \lambda, work.
>>
>> Did anybody experience anything similar?
>>
>> Thanks,
>>
>> Giacomo
>>
>
> Yes, I faced it too - on CentOS 6.5. I moved to Debian stable to get
> rid of the problem, I couldn't find any other solution.
>



Re: [O] Exporting Source Blocks with Symbols

2016-01-19 Thread Grant Rettke
Thank you for sharing your solution.

My current solution: avoid the issue entirely and don't use Unicode in
your source code, use pretty-mode instead:
https://github.com/akatov/pretty-mode

A future option: switch from PDFLaTeX to XeLaTeX of LuaLaTeX.

Both are great. The latter is ideal, and does the "right thing" for
just about every language out there and if it doesn't, it is added
quickly.
Sincerely,

Grant Rettke


On Sun, Jan 17, 2016 at 2:10 PM, Michael Gauland <mikely...@gmail.com> wrote:
> Just following up with my solution, in case anyone else is interested
> (thanks to John Kitchin for pointing me in the right direction). First, I
> should note that 'µ' exported correctly because I was using the unicode
> element 'MICRO SYMBOL' instead of 'GREEK SMALL LETTER MU' (which looks the
> same, but doesn't export).
>
> The 'listings' package can only handle 8-bit characters, but you can tell it
> to escape to LaTeX. The code block below adds a hook to escape the
> characters I'm interested in, and adds the listing option to identify the
> escape character (a symbol I've never used for anything else).
>
> This code could certainly be improved, but it serves my needs, and may be
> useful as a starting point for anyone trying to do something similar.
> --Michael Gauland
>
> #+BEGIN_SRC emacs-lisp :session :results value silent :exports none
> ;; Set up a filter to preserve greek symbols in code blocks
> (setq org-export-filter-src-block-functions
>   (list
> (lambda (text backend info)
>(replace-regexp-in-string "\\([σβ]\\)" "§$\\1$§" text
>
> (setq org-latex-listings-options '(("escapechar" "§")))
> #+END_SRC
>



Re: [O] How define a hook function for `org-babel-post-tangle-hook' for a single file?

2016-01-06 Thread Grant Rettke
On Sun, Jan 3, 2016 at 1:08 PM, John Kitchin  wrote:
> It sounds a little circular.

Just a little.

> This org-file adds a hook function when loaded. Maybe you can adapt
> something like this? ymmv...

Thank you!



Re: [O] just discovered how well NLinum-mode works with large orgmode files

2016-01-05 Thread Grant Rettke
On Tue, Jan 5, 2016 at 9:13 AM, Xebar Saram  wrote:
> just wanted to share a discovery (non newbs like me probably know this
> already)
>
> for a few months i have been struggling with linum mode after it keeps
> freezing emacs on large files. today i discovered this:
>
> http://elpa.gnu.org/packages/nlinum.html
>
> its amazing how we it works even in huge orgmode file

Thank you.

Now I can expand and collapse all of the headings in my favorite 6063
Org-Mode file with only a little slowdown; with linum it was
impossible.



Re: [O] disqus

2016-01-04 Thread Grant Rettke
What did you want to have happen in what context?
Sincerely,

Grant Rettke


On Mon, Jan 4, 2016 at 9:10 AM, David Arroyo Menéndez
<davi...@es.gnu.org> wrote:
>
> Hi all,
>
> Some tutorial about disqus using orgmode?
>
> Regards!
>
>



[O] How define a hook function for `org-babel-post-tangle-hook' for a single file?

2016-01-03 Thread Grant Rettke
Good morning,

* Desire

- I've got a file X
- I've got a hook function H
  - It does post-processing, copying the tangled results to different
directories
- I want to defined H in X
- I want H to be evaluated and run when X is tangled

* Research

- Emacs 25, Org Git current
- org-babel-post-tangle-hook
- File local variables and eval

* Question

What is the best way to do something like this?

Sincerely,

Grant Rettke



Re: [O] Base 64 inline images in html export

2015-12-22 Thread Grant Rettke
Since you too are exploring packaging, this might give you some test:

http://kitchingroup.cheme.cmu.edu/blog/2014/03/05/Creating-a-transportable-zip-archive-of-an-org-file/
Sincerely,

Grant Rettke


On Mon, Dec 7, 2015 at 6:15 AM, Greg Sexton <gsex...@amazon.co.uk> wrote:
> Hi,
>
> I did find a post about this from around 2009 but I'm not sure it went
> anywhere. It's very useful for me to be able to export a single html
> file that I can distribute around. Base 64 encoding images directly in
> to the exported html makes this possible.
>
> The feature seems fairly well supported by browsers these days.[1]
>
> I've hacked up this ugly proof of concept. I guess it wouldn't take too
> much to productionize this and make the behavior configurable. Any
> thoughts?
>
> --8<---cut here---start->8---
> (defun gs/b64-img (file-uri)
>   (let ((file (s-replace "file://" "" file-uri)))
> (if (f-exists? file)
> ;; src="data:image/png;base64,iVBORw0KGgoNSUh..."
> (s-concat "data:image/"
>   (f-ext file)
>   ";base64,"
>   (base64-encode-string (f-read-bytes file)))
>   file-uri)))
>
> (defun org-html--format-image (source attributes info)
>   "Return \"img\" tag with given SOURCE and ATTRIBUTES.
> SOURCE is a string specifying the location of the image.
> ATTRIBUTES is a plist, as returned by
> `org-export-read-attribute'.  INFO is a plist used as
> a communication channel."
>   (org-html-close-tag
>"img"
>(org-html--make-attribute-string
> (org-combine-plists
>  (list :src (gs/b64-img source)   ; <-- interesting line is here
>:alt (if (string-match-p "^ltxpng/" source)
> (org-html-encode-plain-text
>  (org-find-text-property-in-string 'org-latex-src source))
>   (file-name-nondirectory source)))
>  attributes))
>info))
> --8<---cut here---end--->8---
>
>
> [1]: http://stackoverflow.com/questions/1207190/embedding-base64-images
>
> --
>  Greg
>
>
>
> Amazon Development Centre (London) Ltd. Registered in England and Wales with 
> registration number 04543232 and which has its registered office at 
> Leadenhall Court, One Leadenhall Street, London EC3V 1PP, United Kingdom.
>
>



Re: [O] a post-processing export hook?

2015-12-17 Thread Grant Rettke
On Wed, Dec 2, 2015 at 5:33 AM, Rasmus  wrote:
> The documentation is mostly in the source of ox.el.

Worg also has this:

http://orgmode.org/worg/doc.html

One cold and dreary evening I quickly browsed the list of hooks in
org-mode when I was curious about tangling hooks.

It is a pretty decent read and very educational; it gives you a
picture into the "eventspace" or org.



Re: [O] Error "No :file header argument given"

2015-12-17 Thread Grant Rettke
On Tue, Dec 1, 2015 at 10:02 AM, Loris Bennett
 wrote:
> Is it possible to have a variable as part of the :file specification?

Not sure how your ECM might look but header arguments can be populated
by Emacs Lisp calls so you use whatever variables you want.



Re: [O] README for bitbucket - export to which format?

2015-12-17 Thread Grant Rettke
On Fri, Dec 4, 2015 at 6:38 AM, Rainer M Krug  wrote:

Most Git sites using the Github Flavored Markdown, and there is a
package for that in contrib: =ox-gfm=

http://orgmode.org/cgit.cgi/org-mode.git/plain/contrib/lisp/ox-gfm.el



Re: [O] Org-babel shell evaluate with session does not return results

2015-11-28 Thread Grant Rettke
On Thu, Nov 19, 2015 at 12:28 PM, Giri Prashanth
 wrote:
> Any reason why org babel execute for shell with session does not terminate ?
> Thank you very much in advance for any response,

Just ran this code and got the following results...

#+NAME: 4AFF24E4-43CF-4FFF-A9E9-4896630C977D
#+BEGIN_SRC shell :session test
echo foo
#+END_SRC

#+RESULTS: 4AFF24E4-43CF-4FFF-A9E9-4896630C977D
#+BEGIN_EXAMPLE
| foo |
#+END_EXAMPLE

Org version from Git: “8.3.2”

Emacs version: “24.5.1”

What versions are you on?



  1   2   3   4   >