Hey Solofo,

Thanks for reading; will take your comments in order:

1. As to why I made it, I found that regexp's were not expressive enough
for what I like to do. A few examples of things I can now do with my
trunking:

1.a. I would like to be able to select groups of tasks based on more than
simple regexps; for instance, I like to reserve my early mornings for focus
tasks; I accomplish this with the following defun:

(defun mgh/plan/select-focus-tasks (projects page priority taskno
                                             status description date
                                             pages)
  ;; In PROJECTS and incomplete and priority [AB] @focused.
  ;; In PROJECTS and incomplete and priority A and widget-cranking
  (and (cl-intersection projects pages :test 'string=)
       (string-match "[_oP]" status)
       (or (and (string-match "[AB]" priority)
                (member "EnergyFocused" pages))
           (and (string= "A" priority)
                (member "EnergyWidgetCranking" pages)))))

1.a. I would like to trunk day pages differently based on whether the day
is a weekend or a weekday; to continue the example above, the set of
projects on which I want to focus changes depending on whether the day is a
weekday or not, so my planner-trunk-rule-list can have entries like:

         (list 'weekend nil
               (list
                (list (lambda (page priority taskno status description date
pages)
                        (mgh/plan/select-focus-tasks
mgh-plan-personal-projects
                                                     page priority taskno
status
                                                     description date
pages))
                      "@first-up")
         ...
         (list 'weekday nil
               (list
                (list (lambda (page priority taskno status description date
pages)
                        (mgh/plan/select-focus-tasks mgh-plan-work-projects
                                                     page priority taskno
status
                                                     description date
pages))
                      "@first-up")

So on weekdays, mgh/plan/select-focus-tasks will be called with the
variable mgh-plan-work-projects, which is a list of projects I'm dealing
with at work. On weekends, the same logic will apply, but to a different
set of projects.

To your case, you could continue to do what you're doing now, or refactor
the differences between trunking at home & work into a single list whose
selectors include knowledge of the current host:

(setq planner-trunk-rule-list
  (list
    (list 'i-am-at-home nil
      ...
    (list...

probably depends on how much overlap your trunking rules have between home
& work, but I wouldn't presume to say.

2. planner-trunk-list-regexp, since this was in the group labelled
"Internal variables and utility functions", I assumed that I was under no
obligation to retain the defun. But happy to throw that out to the group--
what is the convention here?

3. Yah, good point-- will try to do that, but do you have any suggestions
as to how to do that conveniently (I'm not a git jockey)?

4. No profiling, yet

5. Damn, that's embarrassing-- thanks. Will be corrected in next patch.

Anyone else? John Sullivan, are you out there?

-- 
Michael




On Tue, Jan 10, 2017 at 10:52 PM, Soso Rktmb <[email protected]> wrote:

> Hi Michael,
>
> On Mon, Jan 9, 2017 at 5:24 AM, Michael <[email protected]> wrote:
> > I'm posting my proposed patch & soliciting feedback.
> [...]
> > Comments, criticism &c welcome.
>
> Thanks you for posting your patch!
> It is so refreshing to see new features on planner!
> I have not tested it yet, but I like it so far (FWIW).
>
> Could you comment more on why you made it, how you use it and what you
> think is possible to do with it?
>
> For example, I configure trunking like this because I find it easier
> to split home and work trunking:
> (defvar at-home
>   (string-match "machine1\\|machine2\\|machine3" system-name))
> (defvar at-work
>   (not at-home))
>
> (defvar planner-trunk-rule-list-home
>  [...]
> )
> (defvar planner-trunk-rule-list-work
>  [...]
> )
> (if at-home
>   (setq planner-trunk-rule-list planner-trunk-rule-list-home)
>   (setq planner-trunk-rule-list planner-trunk-rule-list-work)
> )
>
> But I have the feeling that with this patch it is possible to do more
> dynamic configurations, which would make day and plan pages less boring.
>
> Other comments:
> - Since the patch rename planner-trunk-list-regexp into
>   planner-trunk-list-selector, can it break some configuration?
>
> - Maybe it would be better to split the patch, so that whitespace
>   fixes are separated?
>
> - Did you do some profiling? Trunking may be slow.
>
> - Some typos: curernt, correspoding, correpsonding (x2)
>
> Hope this helps, regards,
> --
> solofo
>
> _______________________________________________
> Planner-el-discuss mailing list
> [email protected]
> https://mail.gna.org/listinfo/planner-el-discuss
>
_______________________________________________
Planner-el-discuss mailing list
[email protected]
https://mail.gna.org/listinfo/planner-el-discuss

Reply via email to