[Top][All Lists]

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

org-link-set-parameters :complete how to prompt for description?

From: TRS-80
Subject: org-link-set-parameters :complete how to prompt for description?
Date: Wed, 26 Aug 2020 11:29:20 -0400
User-agent: Roundcube Webmail/1.3.13

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: "
           (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.


reply via email to

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