emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] property values and timestamps


From: Nick Dokos
Subject: Re: [O] property values and timestamps
Date: Fri, 14 Oct 2011 11:59:29 -0400

Skip Collins <address@hidden> wrote:

> > org-time-stamp-inactive uses the minibuffer, and calling
> > a function that uses the minibuffer *from* the minibuffer (as
> > org-set-property would do) make emacs unhappy.
> 
> Elisp does seem to allow recursive minibuffers:
> http://www.gnu.org/software/emacs/elisp/html_node/Recursive-Mini.html
> 
> Would the implementation of this for org-set-property be straightforward?
> 

Oh, very nice: I didn't know about that. Here's a proof-of-concept
snippet, redefining the org-completing-read function to bind
org-time-stamp-inactive to a key ("!" in the following, but you will
probably want to season to taste):

--8<---------------cut here---------------start------------->8---
(setq enable-recursive-minibuffers t)

(defun org-completing-read (&rest args)
  "Completing-read with SPACE being a normal character."
  (let ((minibuffer-local-completion-map
         (copy-keymap minibuffer-local-completion-map)))
    (org-defkey minibuffer-local-completion-map " " 'self-insert-command)
    (org-defkey minibuffer-local-completion-map "?" 'self-insert-command)
    (org-defkey minibuffer-local-completion-map "!" 'org-time-stamp-inactive)
    (apply 'org-icompleting-read args)))
--8<---------------cut here---------------end--------------->8---

It even seems to work!-)

Thanks,
Nick



reply via email to

[Prev in Thread] Current Thread [Next in Thread]