emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: TRS-80 <trs-80@isnotmyreal.name>
To: emacs-orgmode@gnu.org
Subject: org-link-set-parameters :complete how to prompt for description?
Date: Wed, 26 Aug 2020 11:29:20 -0400	[thread overview]
Message-ID: <63e143a961c8eec498b0cfe234794df6@isnotmyreal.name> (raw)

Good day, everyone!

I have been trying to create a new custom link type with
org-link-set-parameters, which in turn calls functions for the various
"methods" (for lack of a better term), like so:

   (org-link-set-parameters "zdlink"
			   :complete  #'my-zetteldeft-org-complete-link
			   :follow    #'my-zetteldeft-org-follow-link
			   :help-echo #'my-zetteldeft-org-help-echo
			   :store     #'my-zetteldeft-org-store-link)

The only one I seem to be having trouble with is :complete.  I can get 
it to
prompt me for completing-read, and it returns the link portion only, but 
how
to get it to also prompt for a description?  Here is my :complete 
function:

   (defun my-zetteldeft-org-complete-link ()
	"Link completion for Org zdlink type links"
	(let* ((file (completing-read "File to link to: "
		  (deft-find-all-files-no-prefix)))
	   (link (zetteldeft--lift-id file)))
    (unless link (user-error "No file selected"))
    (concat "zdlink:" link)))

I searched the Internet, this mailing list archives, etc. high and low, 
all
to no avail.  So I decide to join the mailing list today.  Probably long
overdue anyway.  :)

Any tips would be greatly appreciated.

Cheers,
TRS-80


             reply	other threads:[~2020-08-26 15:30 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-26 15:29 TRS-80 [this message]
2020-08-27 11:37 ` org-link-set-parameters :complete how to prompt for description? Ihor Radchenko
2020-08-27 20:10   ` TRS-80
2020-08-28  1:26     ` Ihor Radchenko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=63e143a961c8eec498b0cfe234794df6@isnotmyreal.name \
    --to=trs-80@isnotmyreal.name \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).