Re: [O] org-capture/remember in Emacs 24.4.1?

2014-10-27 Thread Marco Wahl
Hi Benjamin,

Benjamin Slade  writes:

> I had the following snippets in my .emacs which allowed me to call up a
> mini-emacsclient frame to quickly add notes and TODOs etc.  It doesn't
> seem to work anymore (it comes up, but as soon as I choose [t], [n]
> etc. it disappears).  Is there an updated recommendation on how to do
> this?
>
> ###
> (defcustom remember-frame-alist nil
> "Additional frame parameters for dedicated remember frame."
> :type 'alist
> :group 'remember)
>
> (defadvice remember (around remember-frame-parameters activate)
> "Set some frame parameters for the remember frame."
> (let ((default-frame-alist (append remember-frame-alist default-frame-alist)))
> ad-do-it))
>
> ;;;
>
> (defun make-remember-frame ()
>   "turn the current frame into a small popup frame for remember mode;
>  this is meant to be called with 
>   emacsclient -c -e '(make-remember-frame)'"
>   (modify-frame-parameters nil
>  '( (name . "*Remember*") ;; must be same as in 
> mode-hook below  
> (width .  80)
> (height . 20)
> (vertical-scroll-bars . nil)
> (menu-bar-lines . nil)
> (tool-bar-lines . nil)))
>   (set-frame-parameter (selected-frame) 'alpha '(85 50))
>   (org-capture)
>   (when (fboundp 'x-focus-frame) (x-focus-frame nil)) ;; X only
>   (delete-other-windows)
>   ) 
>
> ;; when we're in such a remember-frame, close it when done. (doesn't work 
> when cancelled...)
> (add-hook 'org-capture-mode-hook
> (lambda()
>   (define-key org-capture-mode-map (kbd "C-c C-c")
> '(lambda()(interactive)
>(let ((capture-frame-p 
>   (string= (frame-parameter nil 'name) "*Remember*")))
>  (when capture-frame-p (make-frame-invisible))  ;; hide 
> quickly
>  (org-capture-finalize)
>  (when capture-frame-p (delete-frame)))
>
>
> (setq org-capture-templates
>   '(("t" "Todo" entry (file+headline "~/Documents/Org/ToDo.org" "Captured 
> Tasks")
>"* TODO %?\n  %i\n  %a")
> ("n" "Notes" entry (file+headline "~/Documents/Org/Notes.org" 
> "Captured Notes")
>"* %?\nEntered on %U\n  %i\n  %a")
>   ("m" "Meetings" entry (file "~/Documents/Org/Meetings.org" )
>"* %?\n %i\n  %a")
>   ("c" "Clipboard" entry (file+headline "~/Documents/Org/Notes.org" 
> "Captured Notes")
>"* %x %?\nEntered on %U\n  %i\n  %a")))

Your code works for me (Emacs 25 with a current Org from the git
repo).

Just guessing: Do you have installed a further hook for deleting frames
in certain situations which might be the wrongdoer?


HTH,  Marco
-- 
http://www.wahlzone.de
GPG: 0x0A3AE6F2




Re: [O] Org Babel Clojure No Prettyprint

2014-10-27 Thread Oleh
Hi,

I've just pushed a fix for this.
See if works now.

regards,
Oleh


On Wed, Oct 22, 2014 at 3:42 AM, Prathyush  wrote:
> Hi,
>
> I was trying to use org-babel-clojure to pretty print a collection and found
> out that it always evaluated to:
>
> "Code block produced no output."
>
> Here's some sample code:
>
> #+begin_src clojure :results pp
> (println "Hello")
> #+end_src
>
> Similar issue was reported few weeks back and I guess it could be related
> to the API change that broke it as mentioned here:
> http://lists.gnu.org/archive/html/emacs-orgmode/2014-10/msg00100.htmle
>
>



[O] [PATCH] New version of org-velocity

2014-10-27 Thread Paul Rodriguez
This is a new version of org-velocity. Principally it differs in using
cl-lib and lexical binding, but there are also some minor bugfixes for
presenting results on very large screens and compatibility with evil-mode.

Also, for anyone interested in org-velocity: there is now a development
repository on GitHub: .

Paul Rodriguez
From 5cac25a0d21867bce9c6a24e10dff190ed92b566 Mon Sep 17 00:00:00 2001
From: "Paul M. Rodriguez" 
Date: Sun, 26 Oct 2014 17:13:18 -0500
Subject: [PATCH] New version of Org-Velocity

---
 contrib/lisp/org-velocity.el |  309 ++
 1 file changed, 163 insertions(+), 146 deletions(-)

diff --git a/contrib/lisp/org-velocity.el b/contrib/lisp/org-velocity.el
index e6788c6..a7820f1 100644
--- a/contrib/lisp/org-velocity.el
+++ b/contrib/lisp/org-velocity.el
@@ -1,10 +1,10 @@
-;;; org-velocity.el --- something like Notational Velocity for Org.
+;;; org-velocity.el --- something like Notational Velocity for Org. -*- lexical-binding: t -*-
 
 ;; Copyright (C) 2010-2014 Paul M. Rodriguez
 
 ;; Author: Paul M. Rodriguez 
 ;; Created: 2010-05-05
-;; Version: 3.0
+;; Version: 4.0
 
 ;; This file is not part of GNU Emacs.
 
@@ -64,7 +64,7 @@
 (require 'button)
 (require 'electric)
 (require 'dabbrev)
-(eval-when-compile (require 'cl))
+(require 'cl-lib)
 
 (defgroup org-velocity nil
   "Notational Velocity-style interface for Org."
@@ -133,9 +133,9 @@ file."
   "Match on whole phrase, any word, or all words?"
   :group 'org-velocity
   :type '(choice
-	  (const :tag "Match whole phrase" phrase)
-	  (const :tag "Match any word" any)
-	  (const :tag "Match all words" all)
+  (const :tag "Match whole phrase" phrase)
+  (const :tag "Match any word" any)
+  (const :tag "Match all words" all)
   (const :tag "Match a regular expression" regexp))
   :safe (lambda (v) (memq v '(phrase any all regexp
 
@@ -152,6 +152,17 @@ See the documentation for `org-capture-templates'."
   :group 'org-velocity
   :type (or (get 'org-capture-templates 'custom-type) 'list))
 
+(defcustom org-velocity-heading-level 1
+  "Only match headings at this level or higher.
+0 means to match headings at any level."
+  :group 'org-velocity
+  :type 'integer
+  :safe (lambda (x)
+  (and (integerp x)
+   (>= x 0
+
+(defvar crm-separator)  ;Ensure dynamic binding.
+
 (defsubst org-velocity-grab-preview ()
   "Grab preview of a subtree.
 The length of the preview is determined by `window-width'.
@@ -172,14 +183,14 @@ Replace all contiguous whitespace with single spaces."
 (point-max
  " ")))
 
-(defstruct org-velocity-heading buffer position name level preview)
+(cl-defstruct org-velocity-heading buffer position name level preview)
 
 (defsubst org-velocity-nearest-heading (position)
   "Return last heading at POSITION.
 If there is no last heading, return nil."
   (save-excursion
 (goto-char position)
-(re-search-backward org-velocity-heading-regexp)
+(re-search-backward (org-velocity-heading-regexp))
 (let ((components (org-heading-components)))
   (make-org-velocity-heading
:buffer (current-buffer)
@@ -191,15 +202,18 @@ If there is no last heading, return nil."
 
 (defconst org-velocity-index
   (eval-when-compile
-(nconc (number-sequence 49 57) 	;numbers
+(nconc (number-sequence 49 57)  ;numbers
(number-sequence 97 122)	;lowercase letters
(number-sequence 65 90)))	;uppercase letters
   "List of chars for indexing results.")
 
 (defconst org-velocity-match-buffer-name "*Velocity matches*")
 
-(defconst org-velocity-heading-regexp "^\\* "
-  "Regexp to match only top-level headings.")
+(cl-defun org-velocity-heading-regexp (&optional (level org-velocity-heading-level))
+  "Regexp to match headings at LEVEL or deeper."
+  (if (zerop level)
+  "^\\*+ "
+(format "^\\*\\{1,%d\\} " level)))
 
 (defvar org-velocity-search nil
   "Variable to bind to current search.")
@@ -223,12 +237,6 @@ of the base buffer; in the latter, return the file name of
   (with-current-buffer (window-buffer (active-minibuffer-window))
 (minibuffer-contents
 
-(defsubst org-velocity-singlep (object)
-  "Return t when OBJECT is a list or sequence of one element."
-  (if (consp object)
-  (null (cdr object))
-(= (length object) 1)))
-
 (defun org-velocity-bucket-file ()
   "Return the proper file for Org-Velocity to search.
 If `org-velocity-always-use-bucket' is t, use bucket file;
@@ -260,17 +268,22 @@ use it."
   "Return the proper buffer for Org-Velocity to display in."
   (get-buffer-create org-velocity-match-buffer-name))
 
+(defsubst org-velocity-match-window ()
+  (get-buffer-window (org-velocity-match-buffer)))
+
+(defsubst org-velocity-match-staging-buffer ()
+  (get-buffer-create " Velocity matches"))
+
 (defun org-velocity-beginning-of-headings ()
   "Goto the start of the first heading."
 

Re: [O] refiling as child with function-filing-location

2014-10-27 Thread Per Unneberg
Hi Eric,

Eric Abrahamsen  writes:

> I'm messing about with some similar template-placement routines, so I
> tried your recipe below, and it worked for me... Capture by default

Odd, as I still can't get it to work. I tried it out with emacs -Q, just
defining that org-capture template and running it on a simple example.

> will create a child of the heading point is on, so I really don't see
> why this wouldn't work. You've stepped through the function and
> confirmed that the (goto-char (point-at-bol)) line leaves you at the
> "Log" heading?

Yes, it leaves point at the very beginnig of that heading. The template
itself is always inserted at point, so it ends up as a sibling just
before the Log heading. Actually, the only way I can get it to work is
if Log has a child, and I add a (org-goto-first-child) after locating
the Log heading.

>
> Is the tree structure folded or open at the time? You might try an
> (org-reveal) after the (org-clock-goto); I'm still not really clear on
> the interaction between visibility and heading insertion.

Me neither, but unfortunately changing visibility doesn't help. 

>
> Anyway, I can't reproduce the problem -- do try messing with
> visibility...

Ok, thanks anyway for your input, I'll figure it out some other way.

Cheers,

Per



[O] An Org-mode LaTeX class?

2014-10-27 Thread Marcin Borkowski
Hi all,

I have a dream;-).

Imagine someone wrote a dedicated Org-mode LaTeX class, and the LaTeX
exporter got an option to export to this class.  The class modifies
LaTeX so that it supports all Org's elements and objects, and things
like tags, timestamps, checkboxes etc.  Moreover, the look of these
elements is configurable on the LaTeX end, and further by means of Org
options.  This way, we drop the "generic LaTeX" thing (which is nice for
people sending articles to journals etc. – so my dream should not
replace the current LaTeX exporter, only constitute a variant!), but
instead we gain a beautiful, configurable pdf rendering of Org buffers.

What do you think?

-- 
Marcin Borkowski
http://octd.wmi.amu.edu.pl/en/Marcin_Borkowski
Adam Mickiewicz University



Re: [O] org-capture/remember in Emacs 24.4.1? (Marco Wahl)

2014-10-27 Thread Benjamin Slade
>Your code works for me (Emacs 25 with a current Org from the git
> repo).
> 
> Just guessing: Do you have installed a further hook for deleting frames
> in certain situations which might be the wrongdoer?

I don't seem to. I can't find anything else which seems to do anything
with deleting frames.

(side stepping the problem:) Perhaps there's a simpler way to set up a
remember-frame like this in 24.4?


~
Dr Benjamin Slade
pgp fingerprint: 21BA 2AE1 28F6 DF36 110A 0E9C A320 BBE8 2B52 EE19
~
{sent by mu4e on Emacs running under GNU/Linux}
(Choose Linux, Choose Freedom)