emacs-orgmode
[Top][All Lists]
Advanced

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

Re: contrib - ol-todo


From: Tyler Grinn
Subject: Re: contrib - ol-todo
Date: Thu, 22 Sep 2022 08:46:57 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)

Ihor Radchenko <yantar92@gmail.com> writes:

I've moved the project to gitlab:

https://gitlab.com/tygrdev/org-todo-link

> Why don't just modify :activate-func in the ordinary file links?

I like this idea, in fact so much I got rid of the todo style link. But
one thing that's still problematic is that I'd like org-todo-link-mode
to be a local mode but for some reason make-local-variable isn't working
how I expect for org-link-parameters:

(define-minor-mode org-todo-link-mode
  "Display TODO keyword, if it exists, for all file+heading links."
  :lighter " todo-link"
  (if org-todo-link-mode
      (progn
        (make-local-variable 'org-link-parameters)
        (org-link-set-parameters "file"
                                 :activate-func #'org-todo-link-activate)
        (org-restart-font-lock))
    (kill-local-variable 'org-link-parameters)
    (org-with-wide-buffer
     (mapc #'delete-overlay
           (seq-filter
            (lambda (ov) (overlay-get ov 'ol-todo))
            (overlays-in (point-min) (point-max)))))
    (org-restart-font-lock)))


What I expect to happen is that in the current buffer, the file link
type will have the activate-func, but in other buffers not. Instead
org-link-parameters is modified globally.

Maybe this is a better question for emacs-devel, but do you know of a
way to set org-link-parameters buffer-locally?



reply via email to

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