Re: [O] function for inserting a block

2017-11-10 Thread stardiviner
I agree. I hope this feature too.

+1


On 11/10/2017 05:31 PM, Rasmus wrote:
> Hi Eric,
>
> Eric Abrahamsen  writes:
>
>>> Also, Eric, it seems that org-structure-template-alist only supports a
>>> single letter for short-hands (the car of an entry in
>>> org-structure-template-alist is a char).  I used to have blocks like ">> expanding to an "abstract" special-block, which I guess isn’t possible
>>> anymore?
>> I hadn't thought of that. Really, all I ever wanted was to wrap things
>> in blocks...
>>
>> I don't see any reason why org-structure-template-alist couldn't go back
>> to using string keys. Then we could use read-string, and wouldn't have
>> to have special  behavior -- a string that didn't exist in the
>> alist could just be used literally to make a block.
> I’d prefer that.  For some special blocks, a few characters might makes it
> more intuitive, e.g. "def" → "definition", "hyp" → "hypothesis" etc.
>
> Thanks,
> Rasmus
>




Re: [O] The new function org-insert-structure-template is not following option org-babel-capitalize-example-region-markers

2017-11-10 Thread stardiviner
Yes, sure, currently the Git master branch last commit does not support
this new option yet. Hope be added in next patch. Thanks really.


On 11/11/2017 01:34 AM, Eric Abrahamsen wrote:
> "numbch...@gmail.com"  writes:
>
>> RT.
>> Hope Org-mode can fix this issue.
> It looks like that option has been obsoleted by
> `org-babel-uppercase-example-markers'. I added that in and it compiled
> and tested fine, so I guess it's available. I can make that part of the
> next patch.
>
>




Re: [O] Org mode notes collapse parser brittle

2017-11-10 Thread Kaushal Modi
On Fri, Nov 10, 2017 at 3:44 PM Cody Goodman 
wrote:

> Does anyone else use notes extensively with src blocks and results
> drawers? It seems that the regex to parse src blocks and collapse them
> breaks on drawer :END: markers and possibly other things.
>
> Here's an image of the error: https://i.imgur.com/dqDsO5g.png
>

I don't use LOGBOOK, but I was able to confirm this problem based on your
example.

But then I looked in the manual, and in (org) Drawers node, it's mentioned:

> Sometimes you want to keep information associated with an entry, but you
> normally don’t want to see it.  For this, Org mode has _drawers_.  They
> can contain anything but a headline and another drawer.

*They can contain anything but a headline and another drawer.*

So I guess you have hit a limitation.

-- 

Kaushal Modi


[O] Org mode notes collapse parser brittle

2017-11-10 Thread Cody Goodman
Does anyone else use notes extensively with src blocks and results drawers?
It seems that the regex to parse src blocks and collapse them breaks on
drawer :END: markers and possibly other things.

Here's an image of the error: https://i.imgur.com/dqDsO5g.png

And the example that it happens with:


Begin EXAMPLE

* IN-PROGRESS Minimal example
  :LOGBOOK:
  - Note taken on [2017-11-10 Fri 12:01] \\

As soon as you add a drawer result though, the LOGBOOK no longer
collapses correctly and stops at the first drawer's END. Ideally when
collapsing LOGBOOK =#+RESULTS\n\s+:RESULTS:[^:END:]+:END:= could not
be counted as the end of a logbook or end of a note.

#+BEGIN_SRC shell :async :results raw drawer :dir ~/hacking-yi/yi-rope
 ls -larth default.nix
#+END_SRC

#+RESULTS:
:RESULTS:
-rw-r--r-- 1 cody users 520 Nov 10 12:04 default.nix
:END:


  - Note taken on [2017-11-10 Fri 11:49] \\

Notes like this are fine and collapse correctly both at the note
level and the logbook level

 #+BEGIN_SRC shell :async :results raw
 mkdir ~/hacking-yi
 #+END_SRC

 #+RESULTS:

  CLOCK: [2017-11-10 Fri 11:49]
  :END:

End Example


Thanks,

Cody


Re: [O] org-babel oz?

2017-11-10 Thread Nick Dokos
Johannes Brauer  writes:

> Hi,
>
> I am looking for a working configuration for using oz code blocks in org-mode 
> file. I've installed
> Mozart2 on macOS 10.12.6 and use org-mode version 9.0.9. I've put
> (org-babel-do-load-languages
>  'org-babel-load-languages
>  '((emacs-lisp . t)
>(oz . t)))
> into my Aquamacs initialization and the ob-z.el in a path where Emacs can 
> read it.
> If I try to execute (C-C C-C) the following code block
>
> #+begin_src oz :results value
>   39 + 3
> #+end_src
>
> I get the following error messages:
>
> executing Oz code block...
> Org-babel: executing Oz expression
> Create OPI socket for evaluating expressions
> open-network-stream: make client process failed: Connection refused, :name, 
> *Org-babel-OPI-socket*,
> :buffer, nil, :host, localhost, :service, 6001, :nowait, nil
>
> I cannot figure out, what to do?
> Any hints?
>

[this "answer" is uncontaminated by such mundane things as testing - I know
 nothing about Oz except what I read in contrib/lisp/ob-oz.el and I don't have
 Mozart installed on my machine (except for various pieces in my Music folder)]

You need to start the server using the contrib/scripts/StartOzServer.oz
script.

-- 
Nick




Re: [O] The new function org-insert-structure-template is not following option org-babel-capitalize-example-region-markers

2017-11-10 Thread Eric Abrahamsen
"numbch...@gmail.com"  writes:

> RT.
> Hope Org-mode can fix this issue.

It looks like that option has been obsoleted by
`org-babel-uppercase-example-markers'. I added that in and it compiled
and tested fine, so I guess it's available. I can make that part of the
next patch.




Re: [O] function for inserting a block

2017-11-10 Thread Eric Abrahamsen
Rasmus  writes:

> Hi Eric,
>
> Eric Abrahamsen  writes:
>
>>> Also, Eric, it seems that org-structure-template-alist only supports a
>>> single letter for short-hands (the car of an entry in
>>> org-structure-template-alist is a char).  I used to have blocks like ">> expanding to an "abstract" special-block, which I guess isn’t possible
>>> anymore?
>>
>> I hadn't thought of that. Really, all I ever wanted was to wrap things
>> in blocks...
>>
>> I don't see any reason why org-structure-template-alist couldn't go back
>> to using string keys. Then we could use read-string, and wouldn't have
>> to have special  behavior -- a string that didn't exist in the
>> alist could just be used literally to make a block.
>
> I’d prefer that.  For some special blocks, a few characters might makes it
> more intuitive, e.g. "def" → "definition", "hyp" → "hypothesis" etc.

Here's the simplest solution. 

There still remains the fact that `org-structure-template-alist' has
changed format, and `org-try-structure-completion' no longer exists.
That may still annoy some people who were using the internals of the
process, but...

diff --git a/lisp/org.el b/lisp/org.el
index f873f1021..7c451d525 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -11857,42 +11857,40 @@ keywords relative to each registered export back-end."
 "TITLE:" "TODO:" "TYP_TODO:" "SELECT_TAGS:" "EXCLUDE_TAGS:"))
 
 (defcustom org-structure-template-alist
-  '((?a . "export ascii")
-(?c . "center")
-(?C . "comment")
-(?e . "example")
-(?E . "export")
-(?h . "export html")
-(?l . "export latex")
-(?q . "quote")
-(?s . "src")
-(?v . "verse"))
+  '(("a" . "export ascii")
+("c" . "center")
+("C" . "comment")
+("e" . "example")
+("E" . "export")
+("h" . "export html")
+("l" . "export latex")
+("q" . "quote")
+("s" . "src")
+("v" . "verse"))
   "Structure completion elements.
 This is an alist of characters and values.  When
-`org-insert-structure-template' is called, an additional key is
-read.  The key is first looked up in this alist, and the
-corresponding structure is inserted, with \"#+BEGIN_\" and
-\"#+END_\" added automatically."
+`org-insert-structure-template' is called, a string key is read.
+The key is first looked up in this alist, and the corresponding
+structure is inserted, with \"#+BEGIN_\" and \"#+END_\" added
+automatically."
   :group 'org-completion
   :type '(repeat
-	  (cons (character :tag "Key")
+	  (cons (string :tag "Key")
 		(string :tag "Template")))
   :package-version '(Org . "9.2"))
 
 (defun org-insert-structure-template (type)
   "Insert a block structure of the type #+begin_foo/#+end_foo.
-First read a character, which can be one of the keys in
-`org-structure-template-alist'.  When it is , prompt the
-user for a string to use.  With an active region, wrap the region
-in the block.  Otherwise, insert an empty block."
+First read a string, which is used as a lookup key in
+`org-structure-template-alist' or, failing that, used literally.
+With an active region, wrap the region in the block.  Otherwise,
+insert an empty block."
   (interactive
(list
-(let* ((key (read-key "Key: "))
+(let* ((key (read-string "Key: "))
 	   (struct-string
-	(or (cdr (assq key org-structure-template-alist))
-		(and (= key ?\t)
-		 (read-string "Structure type: "))
-		(user-error "`%c' has no structure definition" key
+	(or (cdr (assoc-string key org-structure-template-alist))
+		key)))
   struct-string)))
   (let* ((region? (use-region-p))
 	 (s (if region? (region-beginning) (point)))


[O] How to use case sensitive org-search-view?

2017-11-10 Thread Alain . Cochard

Hello.  Sorry about this seemingly basic question, but I spent several
hours (literally) googling and experimenting without any progress...

Suppose I have an org file with

* FOO
* foo

I would like to use org-search-view (C-c a s) so as to (say) list only
the first entry.

Among other things I tried using +FOO, +"FOO", +{FOO}, +{\bFOO\b},
with case-fold-search being t or nil, with several emacs+org versions,
but each time it lists both headlines.

Is there a way to perform what I want?

Thank you.
Alain

PS: by contrast, 'C-c a / FOO' does only list the 1st entry.

-- 
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] function for inserting a block

2017-11-10 Thread Rasmus
Hi Eric,

Eric Abrahamsen  writes:

>> Also, Eric, it seems that org-structure-template-alist only supports a
>> single letter for short-hands (the car of an entry in
>> org-structure-template-alist is a char).  I used to have blocks like "> expanding to an "abstract" special-block, which I guess isn’t possible
>> anymore?
>
> I hadn't thought of that. Really, all I ever wanted was to wrap things
> in blocks...
>
> I don't see any reason why org-structure-template-alist couldn't go back
> to using string keys. Then we could use read-string, and wouldn't have
> to have special  behavior -- a string that didn't exist in the
> alist could just be used literally to make a block.

I’d prefer that.  For some special blocks, a few characters might makes it
more intuitive, e.g. "def" → "definition", "hyp" → "hypothesis" etc.

Thanks,
Rasmus

-- 
Warning: Everything saved will be lost