alphapapa / org-super-agenda

Supercharge your Org daily/weekly agenda by grouping items
GNU General Public License v3.0
1.38k stars 108 forks source link

Creating Functions - Example is Needed (instead of let) #178

Closed ugurbolat closed 4 years ago

ugurbolat commented 4 years ago

Hello,

I got into using Org Mode mainly because of the agenda capability. With the help of this package, I managed to customize my agenda greatly with little knowledge of Elisp. I now have certain customizations with org-super-agenda that are shared by different agenda views.

I would like to turn those shared customizations into functions but I currently have limited knowledge of Elisp. With that, I tried to implement the following simple example:

(defun my/agenda-goal-function (mytag)
      `((tags ,mytag ((org-super-agenda-groups '((:name ,mytag
                                                        :anything t
                                                        :order 1)))))))

Ideally, I would like to able to call this function a different agenda view

(setq org-agenda-custom-commands
      `(("p" "Personal Agenda" (,(my/agenda-goal-function "life_goal")))))

The following error is thrown: org-agenda-run-series: Wrong type argument: symbolp, (tags "life_goal" ((org-super-agenda-groups (quote ((:name "life_goal" :anything t :order 1))))))

I am aware that this is not directly related to this package, but I would love to have some suggestions.

alphapapa commented 4 years ago

Hello,

I'm glad to hear that this package is useful to you.

Your question seems to be about a matter of backquoting and unquoting lists. For that, I'd refer you to the Elisp manual, which explains all you need to know about it. If you need specific guidance, please post it in an appropriate forum, like https://old.reddit.com/r/emacs so that the burden of answering is not on one person and the benefit of learning is available to many.

Thanks.

ugurbolat commented 4 years ago

sure. here is the link to the Reddit post I've created for people who might be useful for learning as well.