emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Tyler Grinn <tylergrinn@gmail.com>
To: emacs-orgmode@gnu.org
Subject: Re: contrib - ol-todo
Date: Thu, 22 Sep 2022 08:46:57 -0400	[thread overview]
Message-ID: <87o7v7injy.fsf@gmail.com> (raw)
In-Reply-To: <87y1ueqwwz.fsf@localhost> (Ihor Radchenko's message of "Tue, 20 Sep 2022 16:20:44 +0800")

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	other threads:[~2022-09-22 13:39 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-16 23:47 contrib - ol-todo Tyler Grinn
2022-09-20  8:20 ` Ihor Radchenko
2022-09-22 12:46   ` Tyler Grinn [this message]
2022-09-22 14:25     ` Max Nikulin
2022-09-22 22:28       ` Tyler Grinn

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=87o7v7injy.fsf@gmail.com \
    --to=tylergrinn@gmail.com \
    --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).