emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Copy Drawer Parameter Value
@ 2014-05-23 13:22 Esben Stien
  2014-05-23 13:24 ` Bastien
  0 siblings, 1 reply; 4+ messages in thread
From: Esben Stien @ 2014-05-23 13:22 UTC (permalink / raw)
  To: emacs-orgmode

Are there any functions that copies the value of a parameter in drawers,
like: 

:PROPERTIES:
:FOO: bar
:END:

With mark over the line with :FOO:, is there a function that just copies "bar"?

-- 
Esben Stien is b0ef@e     s      a             
         http://www. s     t    n m
          irc://irc.  b  -  i  .   e/%23contact
           sip:b0ef@   e     e 
           jid:b0ef@    n     n

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Copy Drawer Parameter Value
  2014-05-23 13:22 Copy Drawer Parameter Value Esben Stien
@ 2014-05-23 13:24 ` Bastien
  2014-05-23 14:48   ` Eric Abrahamsen
  0 siblings, 1 reply; 4+ messages in thread
From: Bastien @ 2014-05-23 13:24 UTC (permalink / raw)
  To: Esben Stien; +Cc: emacs-orgmode

Esben Stien <b0ef@esben-stien.name> writes:

> Are there any functions that copies the value of a parameter in drawers,
> like: 
>
> :PROPERTIES:
> :FOO: bar
> :END:
>
> With mark over the line with :FOO:, is there a function that just
> copies "bar"?

Nope.

-- 
 Bastien

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Copy Drawer Parameter Value
  2014-05-23 13:24 ` Bastien
@ 2014-05-23 14:48   ` Eric Abrahamsen
  2014-05-23 18:54     ` Esben Stien
  0 siblings, 1 reply; 4+ messages in thread
From: Eric Abrahamsen @ 2014-05-23 14:48 UTC (permalink / raw)
  To: emacs-orgmode

Bastien <bzg@gnu.org> writes:

> Esben Stien <b0ef@esben-stien.name> writes:
>
>> Are there any functions that copies the value of a parameter in drawers,
>> like: 
>>
>> :PROPERTIES:
>> :FOO: bar
>> :END:
>>
>> With mark over the line with :FOO:, is there a function that just
>> copies "bar"?
>
> Nope.

I've wanted this for a bit.

(defun org-property-value-save (&optional prop)
  (interactive)
  (let* ((props (org-entry-properties))
	 (prop (or prop
		   (when (org-at-property-p)
		     (org-match-string-no-properties 2))
		   (org-completing-read
		    "Get property: "
		    props t)))
	 (val (org-entry-get-with-inheritance prop)))
    (if val (progn
	      (kill-new val)
	      (message "Saved: %s" val))
      (message "No valid value for %s" prop))))

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Copy Drawer Parameter Value
  2014-05-23 14:48   ` Eric Abrahamsen
@ 2014-05-23 18:54     ` Esben Stien
  0 siblings, 0 replies; 4+ messages in thread
From: Esben Stien @ 2014-05-23 18:54 UTC (permalink / raw)
  To: emacs-orgmode

Eric Abrahamsen <eric@ericabrahamsen.net> writes:

> (defun org-property-value-save (&optional prop)
>   (interactive)
>   (let* ((props (org-entry-properties))
> 	 (prop (or prop
> 		   (when (org-at-property-p)
> 		     (org-match-string-no-properties 2))
> 		   (org-completing-read
> 		    "Get property: "
> 		    props t)))
> 	 (val (org-entry-get-with-inheritance prop)))
>     (if val (progn
> 	      (kill-new val)
> 	      (message "Saved: %s" val))
>       (message "No valid value for %s" prop))))

Perfect;) Thanks a lot.

-- 
Esben Stien is b0ef@e     s      a             
         http://www. s     t    n m
          irc://irc.  b  -  i  .   e/%23contact
           sip:b0ef@   e     e 
           jid:b0ef@    n     n

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-05-23 18:54 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-05-23 13:22 Copy Drawer Parameter Value Esben Stien
2014-05-23 13:24 ` Bastien
2014-05-23 14:48   ` Eric Abrahamsen
2014-05-23 18:54     ` Esben Stien

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).