I have added a line to my Agenda to display how many first-level items my inbox.org has. I put stuff in there from mobile devices quickly, so I needed a reminder to process things once I get back home.

As you see, it's a link. I can click on it and the inbox file is visited. But I cannot get to the entry via tab. I don't want to move my right hand the couple of inches required to reach for my mouse. I think y'all can relate to this severe problem.

How can I tab-ify the link in org-agenda?

Existing Code to Create this Info Line

(defun ct/count-org-items (filePath)
  "Return a list of lines of a file at filePath."
    (insert-file-contents filePath)
    (let* ((start 0)
           (counted 0))
      (while (string-match "^* " (buffer-string) start)
           (setq start (match-end 0))
           ;; (message "Found!")
           (setq counted (+ 1 counted)))

(defun ct/org-agenda-show-inbox-counter (&rest _ignore)
    (let* ((file org-default-notes-file)
           (counter (ct/count-org-items file))
           (label (cond ((eq 1 counter) "Item") (t "Items"))))
       (if (eq counter 0)
           (insert "Inbox Empty!\n")
           (insert (concat "[[file:" file "][" (number-to-string counter) " " label " in the Inbox]]\n")))))

And then the link-creation function is used in my custom agenda:

(setq org-agenda-custom-commands
  (quote (("d" "Daily Action List"
            ((ct/org-agenda-show-inbox-counter "" nil)
             (agenda "" ((org-agenda-span 'day)
                         (org-agenda-ndays 1)
                           (org-agenda-sorting-strategy (quote ((agenda time-up priority-down tag-up) )))
                         (org-deadline-warning-days 0)
                         (org-agenda-compact-blocks t)
             ; ...

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.