mirror of
https://git.savannah.gnu.org/git/emacs/org-mode.git
synced 2024-08-24 22:02:52 +00:00
lisp/ol.el: Make org-link-get-parameter' a valid PLACE for
setf'
* lisp/ol.el (org-link-get-parameter): Define setter. This allows modifying link parameters with `setf' and altering them via `add-function'. Link: https://orgmode.org/list/a123389c-8f86-4836-a4fe-1e3f4281d33b@app.fastmail.com
This commit is contained in:
parent
ae50b94e0e
commit
d545ad6068
|
@ -923,6 +923,13 @@ PARAMETERS should be keyword value pairs. See
|
|||
(org-link-make-regexps)
|
||||
(when (featurep 'org-element) (org-element-update-syntax)))))
|
||||
|
||||
;; This way, one can add multiple functions as, say, :follow parameter.
|
||||
;; For example,
|
||||
;; (add-function :before-until (org-link-get-parameter "id" :follow) #'my-function)
|
||||
;; See https://orgmode.org/list/a123389c-8f86-4836-a4fe-1e3f4281d33b@app.fastmail.com
|
||||
(gv-define-setter org-link-get-parameter (value type key)
|
||||
`(org-link-set-parameters ,type ,key ,value))
|
||||
|
||||
(defun org-link-make-regexps ()
|
||||
"Update the link regular expressions.
|
||||
This should be called after the variable `org-link-parameters' has changed."
|
||||
|
|
Loading…
Reference in a new issue