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] exporting LaTeX to ODT with custom symbols

2017-06-06 Thread edgar

On 2017-06-05 07:00, ed...@openmail.cc wrote:

I managed to get the special symbols by

1. M-x customize-variable org-preview-latex-process-alist
2. Doing [Ins] into the dvipng (or imagemagick) section
3. typing :latex-header in the Key: field
4. typing "\\input{./symbols.tex}" in the Value: field



Not working for other symbols. Sorry...

-

ONLY AT VFEmail! - Use our Metadata Mitigator to keep your email out of the 
NSA's hands!
$24.95 ONETIME Lifetime accounts with Privacy Features!  
15GB disk! No bandwidth quotas!
Commercial and Bulk Mail Options!  



Re: [O] [PATCH] ox-html.el: Fix display of language indicators for source blocks

2017-06-06 Thread N. Raghavendra
At 2017-06-06T20:50:21+05:30, N. Raghavendra wrote:

> CSS rules like
>
> pre.src-awk:before { content: 'Awk'; }
>
> in `org-html-style-default' don't work in the current Org version,
> because the class attribute has been moved from the `pre' element to a
> `code' child of that element.

It appears that this change was introduced in commit
d5bbf365533ba45d72ebed8121c7612c860ea944.  It also introduced the
insertion of the attribute "data-editor-type" in the HTML export, when

  1. `org-html-klipsify-src' is true, and

  2. an HTML source block is being exported.

Now, "data-editor-type" is not a valid attribute with respect to the
XHTML1 Strict DTD (or any other W3C X/HTML DTD).  Therefore, when 1 and
2 are true, this attribute renders the exported HTML files invalid with
respect to the DTDs in `org-html-doctype-alist'.  I think this would
count as a drawback to those who care about HTML validation, especially
since ox-html indicates its concern for validation through
`org-html-validation-link', etc.

I don't know what is the best way to deal with this problem.  One
possibility is to put a warning in the documentation of
`org-html-klipsify-src' that setting it to true would lead to invalid
HTML exports when the Org file contains an HTML source block.

Cheers,
Raghu.

-- 
N. Raghavendra , http://www.retrotexts.net/
Harish-Chandra Research Institute, http://www.hri.res.in/



Re: [O] clock start time is gone

2017-06-06 Thread Samuel Wales
On 6/6/17, Nicolas Goaziou  wrote:
> This is odd, as this shouldn't be usual.

just curious but why does it unless actually gone?  can't it just
check logbook drawer top line for a clock line?

> It is possible if you have really large clock drawers, i.e., hundreds of
> clocks in it.

no.

> It would be nice to have an ECM for this report, with emphasis on the
> "M".

agreed, but unlike my insufficient ad hoc report, ecm is definitely
not within my physical capacity at this time.  was hoping it would
inspire an idea or more a priori things to check.

-- 
The Kafka Pandemic: 

The disease DOES progress. MANY people have died from it. And ANYBODY
can get it at any time.

"You’ve really gotta quit this and get moving, because this is murder
by neglect." ---
.



Re: [O] Custom keymaps on org blocks

2017-06-06 Thread Nicolas Goaziou
Hello,

John Kitchin  writes:

> 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.

There is already `org-babel-do-key-sequence-in-edit-buffer', i.e., C-c
C-v C-x.

Regards,

-- 
Nicolas Goaziou



[O] Custom keymaps on org blocks

2017-06-06 Thread John Kitchin
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.

For example, you might want to use something like this to use the elpy
in ipython blocks and lispy-mode-map in emacs-lisp blocks

(defcustom org-src-block-keymaps
  `(("ipython" . ,(let* ((map (copy-keymap elpy-mode-map)))
(define-key map (kbd "C-c C-c") 'org-ctrl-c-ctrl-c)
(define-key map (kbd "C-c '") 'org-edit-special)
map))
("emacs-lisp" . ,(let* ((map (copy-keymap lispy-mode-map)))
   (define-key map (kbd "C-c C-c") 'org-ctrl-c-ctrl-c)
   (define-key map (kbd "C-c '") 'org-edit-special)
   map)))
  "alist of custom keymaps for src blocks.")

The implementation is pretty simple, you just modify
org-fontify-meta-lines-and-blocks-1 with a line like this:

(when (assoc (org-no-properties lang) org-src-block-keymaps)
  (add-text-properties
   beg end `(local-map ,(cdr (assoc (org-no-properties lang)
  org-src-block-keymaps)


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

--
Professor John Kitchin
Doherty Hall A207F
Department of Chemical Engineering
Carnegie Mellon University
Pittsburgh, PA 15213
412-268-7803
@johnkitchin
http://kitchingroup.cheme.cmu.edu



[O] [PATCH] ox-html.el: Fix display of language indicators for source blocks

2017-06-06 Thread N. Raghavendra
CSS rules like

pre.src-awk:before { content: 'Awk'; }

in `org-html-style-default' don't work in the current Org version,
because the class attribute has been moved from the `pre' element to a
`code' child of that element.  As a result, the name of the language
isn't dipslayed when hovering over a source block in the HTML file.  I
am currently doing

(setq org-html-keep-old-src t)

but I think it's a kludge.

A better way out would be to move back the `class' attribute from the
`code' element to its `pre' parent in `org-src-html-block', or to change
the CSS selectors in `org-html-style-default'.  This patch does the
former.  (As for the latter, AFAIK there is no CSS selector which picks
precisely those `pre' elements that have `code' children with attributes
`src' and `src-LANG'.)

Cheers,
Raghu.

--

* lisp/ox-html.el (org-html-src-block): Move the `class' attribute of
  the `code' element to its parent `pre' element.

TINYCHANGE
---
 lisp/ox-html.el | 15 ++-
 1 file changed, 10 insertions(+), 5 deletions(-)

diff --git a/lisp/ox-html.el b/lisp/ox-html.el
index 3ad3ffe..857775b 100644
--- a/lisp/ox-html.el
+++ b/lisp/ox-html.el
@@ -3394,12 +3394,17 @@ contextual information."
  listing-number
  (org-trim (org-export-data caption info))
;; Contents.
-   (let ((open (if org-html-keep-old-src ""
+ (if (and klipsify
+  (string= lang "html"))
+ " data-editor-type=\"html\""
+   "")
  (close (if org-html-keep-old-src "" 
"")))
- (format "%s class=\"src src-%s\"%s%s>%s%s"
- open lang label (if (and klipsify (string= lang 
"html"))
- " data-editor-type=\"html\"" "")
- code close)))
+ (concat open code close)))
 
  Statistics Cookie
 
-- 
2.7.4

--
-- 
N. Raghavendra , http://www.retrotexts.net/
Harish-Chandra Research Institute, http://www.hri.res.in/



[O] multiple agenda views -- sticky agendas?, buffer renaming?

2017-06-06 Thread Alain . Cochard

Hello.

I want my *Org Agenda* buffer to be open at all times, but I still
want to be able to (say) match as many different tags as desired.

Googling and searching the archives suggested 2 possible ways: (1)
use of sticky agenda views and (2) use 'M-x rename-uniquely'.  

Use of sticky agendas does not seem to be suited for my need (but
maybe I am missing something), while renaming the buffer seems more
promising except that it partly fails -- again, maybe I am missing
something or there is a bug.

(1) Trying with sticky agendas, I do:

M-x org-agenda * a

M-x make-frame

In the newly created frame: M-x org-agenda m some_tag

so far, so good.

But If, in that same newly created frame, I want to search for another
tag, as soon as I do 'M-x org-agenda m', I get the message "Sticky
Agenda buffer, use `r' to refresh".

Sure, I can refresh, bug cannot search for another tag.

Am I doing something wrong?

(2) Trying renaming the buffer, I do:

M-x org-agenda a

M-x rename-uniquely

M-x make-frame

In the newly created frame: M-x org-agenda m some_tag

At this point, the behavior is as I expect in the newly created agenda
view: pressing  on a given line of the agenda view puts the point
at the proper place of the proper buffer in the other window.

But it does not work that way in the initial agenda view: pressing
 generates the message "Wrong type argument: integer-or-marker-p,
nil". 

Again, am I doing something wrong?

Are there other ways of doing what I want?

NB: I have used an extremely minimal setup, both with Org version
8.2.10, which is the default for my GNU Emacs 24.5.1 installation, and
with Org version 9.0.8-elpa.

I have tried with M-x rename-buffer instead of M-x rename-uniquely,
but the result is the same.


Thank you for any help.

Alain



-- 
EOST (École et Observatoire des Sciences de la Terre) 
IPG (Institut de Physique du Globe) | alain.coch...@unistra.fr
5 rue René Descartes   [bureau 106] | Phone: +33 (0)3 68 85 50 44 
F-67084 Strasbourg Cedex, France| Fax:   +33 (0)3 68 85 01 25 


Re: [O] Moving and resetting attachments

2017-06-06 Thread Florian Lindner
Am 05.06.2017 um 01:25 schrieb Eric Abrahamsen:
> Nicolas Goaziou  writes:
> 
>> Hello,
>>
>> Eric Abrahamsen  writes:
>>
>>> What I meant was, first ask the user for a directory, then cycle through
>>> the files and ask whether to move each file to that directory. The user
>>> wouldn't specify the directory itself for each file. And with
>>> `map-y-or-n-p', the user can just hit "!" to take care of all files.
>>>
>>> Am I misunderstanding your concern? The only time the ID attachment
>>> directory scheme (which is indeed opaque) would come into play is when
>>> the command was called with a prefix argument -- ie, when removing a
>>> custom directory, and reverting to the automatic directory. In that
>>> case, the directory would be automatically derived, and the user would
>>> simply be presented with the choice to move each file there, or not.
>>
>> When asking for each file if it should be moved or not, you can end up
>> with files in both the old and the new directory. My concern is that,
>> when the old directory is a default ID directory, there is no simple way
>> to get the files back. So, I think we should automatically move files in
>> this case.
>>
>> I also agree with your special case described above.
> 
> Okay, makes sense. I hope we haven't totally scared off Florian...
> 
> Florian, are you interested in doing another version of the patch?

Haha, I couldn't follow everything in your discussion, but I'm happy to hear, 
that you two deem that a worthy feature to
integrate.

I will try to modify my code accordingly and count on your assistance!

Best,
Florian




Re: [O] No operator defined for property header-args

2017-06-06 Thread Nicolas Goaziou
Hello,

Kevin Foley  writes:

> I've attached an ECM and below is my attempt at the backtrace.  Let me know
> if I missed something.
>
> * org-at-property-p()
> * #[0 "\301 \204 \302\303!\210\304\305!\306 \210\307\310 \311#8\204
> \302\312 \"\210\313 !\207" [org-columns-current-fmt-compiled
> org-at-property-p user-error "Not at a property" match-string-no-properties
> 2 org-columns-get-format-and-top-level 3 assoc-string t "No operator
> defined for property %s" org-columns-compute] 6
> ("/home/kevin/.emacs.d/lib/org/lisp/org.elc"
> . 550375) nil]()
> * apply(#[0 "\301 \204 \302\303!\210\304\305!\306 \210\307\310 \311#8\204
> \302\312 \"\210\313 !\207" [org-columns-current-fmt-compiled
> org-at-property-p user-error "Not at a property" match-string-no-properties
> 2 org-columns-get-format-and-top-level 3 assoc-string t "No operator
> defined for property %s" org-columns-compute] 6
> ("/home/kevin/.emacs.d/lib/org/lisp/org.elc"
> . 550375) nil] nil)
> * org-compute-property-at-point()
>   funcall-interactively(org-compute-property-at-point)
>   call-interactively(org-compute-property-at-point)
>   org-property-action()
>   funcall-interactively(org-property-action)
>   call-interactively(org-property-action)
>   org-ctrl-c-ctrl-c(nil)
>   funcall-interactively(org-ctrl-c-ctrl-c nil)
>   call-interactively(org-ctrl-c-ctrl-c nil nil)
>   command-execute(org-ctrl-c-ctrl-c)

AFAIU, when you are offered the `org-property-action' menu, you press
"c", for `org-compute-property-at-point'.

As a consequence, the error is expected since there is nothing to
compute here. What did you expect instead?

Regards,

-- 
Nicolas Goaziou



Re: [O] No operator defined for property header-args

2017-06-06 Thread Kevin Foley
I've attached an ECM and below is my attempt at the backtrace.  Let me know
if I missed something.

* org-at-property-p()
* #[0 "\301 \204 \302\303!\210\304\305!\306 \210\307\310 \311#8\204
\302\312 \"\210\313 !\207" [org-columns-current-fmt-compiled
org-at-property-p user-error "Not at a property" match-string-no-properties
2 org-columns-get-format-and-top-level 3 assoc-string t "No operator
defined for property %s" org-columns-compute] 6
("/home/kevin/.emacs.d/lib/org/lisp/org.elc"
. 550375) nil]()
* apply(#[0 "\301 \204 \302\303!\210\304\305!\306 \210\307\310 \311#8\204
\302\312 \"\210\313 !\207" [org-columns-current-fmt-compiled
org-at-property-p user-error "Not at a property" match-string-no-properties
2 org-columns-get-format-and-top-level 3 assoc-string t "No operator
defined for property %s" org-columns-compute] 6
("/home/kevin/.emacs.d/lib/org/lisp/org.elc"
. 550375) nil] nil)
* org-compute-property-at-point()
  funcall-interactively(org-compute-property-at-point)
  call-interactively(org-compute-property-at-point)
  org-property-action()
  funcall-interactively(org-property-action)
  call-interactively(org-property-action)
  org-ctrl-c-ctrl-c(nil)
  funcall-interactively(org-ctrl-c-ctrl-c nil)
  call-interactively(org-ctrl-c-ctrl-c nil nil)
  command-execute(org-ctrl-c-ctrl-c)

Thanks,
Kevin Foley

On Mon, Jun 5, 2017 at 5:00 PM, Nicolas Goaziou 
wrote:

> Hello,
>
> Kevin Foley  writes:
>
> > I'm getting the error "No operator defined for property header-args" when
> > trying to run `org-property-action` on the `header-args` property below:
> >
> > * outline header
> > :PROPERTIES:
> > :header-args:bash::tangle yes
> > :END:
> >
> > I'm able to set the same properties using
> >
> > #+PROPERTY: header-args:bash :tangle yes
> >
> > I've tried running `emacs -Q` and get the same error.  I'm using
> > org-version is 9.0.7
>
> I'm not able to reproduce it. Could you post an ECM and a backtrace?
>
> Regards,
>
> --
> Nicolas Goaziou
>


header-args-ecm.org
Description: Binary data


Re: [O] Org-mode link returned path is truncated when contains space

2017-06-06 Thread Nicolas Goaziou
Hello,

"numbch...@gmail.com"  writes:

> I checked Org-mode package version with `org-version`, get `9.0.7`, still
> have this issue. I updated to latest org-mode ELPA version.

Odd. You may have better luck with Org 9.0.8 then. In particular, commit
2d29269bb1b9af08011e091913798b6598e4b156 should prevent path from being
truncated.

Please report back if it works better (or not).

Regards,

-- 
Nicolas Goaziou



Re: [O] clock start time is gone

2017-06-06 Thread Nicolas Goaziou
Hello,

Samuel Wales  writes:

> recent maint.
>
> just wondering what i could be doing wrong.
>
> it is /usually/ the case that i get clock start tmie is gone when i
> try to clock out.

This is odd, as this shouldn't be usual.

> it isn't gone.  so i do org-clock-cancel, which is slow.  this leaves
> the start time.
>
> so i do org-clock-in, which presents me with all the options.  i
> choose K because i want to be clocked out.
>
> but it ignores the K and keeps me clocked in.
>
> so i clock out.  btw, clocking out is slow.
> org-clock-remove-empty-clock-drawer takes up 95% of the time.

It is possible if you have really large clock drawers, i.e., hundreds of
clocks in it.

> and this leaves me with a correct clock line and a new clock line with
> 0 time on it.
>
> so then i have to kill the new clock line.

It would be nice to have an ECM for this report, with emphasis on the
"M".

Regards,

-- 
Nicolas Goaziou



Re: [O] org to static site?

2017-06-06 Thread Fabrice Popineau
I do the same, albeit I won't qualify my setup as 'simple'.
I export all my teaching stuff, personal web page and so on from Org files,
one file per
course or topic. I export html files, reveal presentations, pdf files for
exams or reference documents,
even IPython notebooks (thanks to John Kitchin).
I haven' t found an easy way to rely on ox-publish  for subtree publishing
with this scheme where you keep everything in the same Org file.
The problem was with navigation. I use a templating system
where I compute menus and body documents that are inserted in
some html template. So I had to write all the functions that will
do this computation and resolve cross links (not yet perfect in this are).



2017-06-04 20:26 GMT+02:00 Scott Randby :

> On 05/31/2017 11:00 AM, Matt Price wrote:
> > I'm trying to wean myself off of Wordpress for next year's teaching
> > websites, and am wondering what solutions other people are using for
> > turning a collection of org pages and/or subtrees into a static html
> > site. I am leaning towards Hugo but honestly not for any sensible
> > reason; I've seen other people use Jekyll, though the fact that Github
> > doesn't support direct conversion from org-mode removes some of Jekyll's
> > appeal; and I know there are a number of other solutions too.
> >
> > So, I would love to hear what you all recommend.
>
> Maybe this is too primitive, but I keep all the content in one Org file
> and export the text under each top-level headline as a single HTML page.
> I use some simple macros if I need to export more than one top-level
> headline. I keep the CSS code in a separate file. Keeping all the
> content in one file makes it really easy to add new pages and edit old
> pages. I use a preamble for site navigation.
>
> Scott Randby
>
>


-- 
Fabrice Popineau
-
SUPELEC
Département Informatique
3, rue Joliot Curie
91192 Gif/Yvette Cedex
Tel direct : +33 (0) 169851950
Standard : +33 (0) 169851212
--