emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Nathan Neff <nathan.neff@gmail.com>
To: emacs-orgmode <emacs-orgmode@gnu.org>
Subject: Re: Custom block agendas: Set buffer name
Date: Sun, 20 Sep 2020 08:57:07 -0500	[thread overview]
Message-ID: <CAC=HedDkwnEZeGhYP3ZgTMXWEhJZABNgJBKn8AGTRm+tJQ_E9w@mail.gmail.com> (raw)
In-Reply-To: <CAC=HedCY5SFiRJodA3PUZDe2C4FZxpSY2Qru7dXSTTZA9c=FeQ@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 2306 bytes --]

I found it in this section of the docs:
https://orgmode.org/manual/Setting-options.html#Setting-options

I had unbalanced parenthesis in Feb. and gave up.  I was finally able to
find the right
place to put the options for all the commands (see org-agenda-buffer-name)
below.

I create variables and used functions to modularize my code - otherwise the
parenthesis
become unbearable IMHO.

(setq org-agenda-custom-commands '())
(defun njn-define-block-agenda()
    (setq njn-agenda '(("h" "Agenda and Projects (Home)"
        ((agenda )
         (tags "-projectA-projectB-projectC/next\|started"
((org-agenda-todo-ignore-with-date nil)))
         (tags "projectA-inactive/-cancelled-done"
            ((org-agenda-prefix-format " %?-12t% s")
             (org-agenda-sorting-strategy (quote (priority-down)))))
         (tags "projectA-inactive/-cancelled-done"
            ((org-agenda-prefix-format " %-16(njn-get-proj-property)
%?-12t% s")
             (org-tags-exclude-from-inheritance (remove "projectA"
org-tags-exclude-from-inheritance))
             (org-agenda-group-by-property "PROJ"))))
         ((org-agenda-buffer-name "Home")))))
    (setq org-agenda-custom-commands (append njn-agenda
org-agenda-custom-commands)))
(njn-define-block-agenda)

I realize this is opening a can of worms -- does anyone have
recommendations for formatting
Lisp code?  The above code is legible for me *right now* but in about 3
months the code will once
again be a paren-fest.

Thanks,
--Nate

On Wed, Feb 12, 2020 at 5:49 PM Nathan Neff <nathan.neff@gmail.com> wrote:

> Hello all,
>
> I'm playing with block agendas and I'm wondering how to set a
> specific buffer
> name.
>
> In non-block agendas, I can set the buffer name like this:
> (setq org-agenda-custom-commands (append
>   '(
>      ("p" "Simple list of active projects" tags-todo
> "PRIORITY<\"C\"+project-inactive/-cancelled-done"
>        ((org-agenda-prefix-format " %?-12t% s")
>         (org-agenda-buffer-name "Top Level Active Projects")
>         (org-agenda-sorting-strategy (quote (priority-down)))))
>
> But I can't find where to specify org-agenda-buffer-name in a custom block
> agenda - for example,
> in the docs:
> https://orgmode.org/manual/Block-agenda.html
>
> Where would I add the org-agenda-buffer-name?
>
> Thanks,
> --Nate
>

[-- Attachment #2: Type: text/html, Size: 3711 bytes --]

      reply	other threads:[~2020-09-20 13:56 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-12 23:49 Nathan Neff
2020-09-20 13:57 ` Nathan Neff [this message]

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='CAC=HedDkwnEZeGhYP3ZgTMXWEhJZABNgJBKn8AGTRm+tJQ_E9w@mail.gmail.com' \
    --to=nathan.neff@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --subject='Re: Custom block agendas: Set buffer name' \
    /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

Code repositories for project(s) associated with this 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).