emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [FEATURE request] hope `org-agenda-custom-commands` can support propertiezed-text.
@ 2023-03-07  5:09 stardiviner
  2023-03-07 14:01 ` Ihor Radchenko
  0 siblings, 1 reply; 4+ messages in thread
From: stardiviner @ 2023-03-07  5:09 UTC (permalink / raw)
  To: Org-mode

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

I want to display text icon using "all-the-icons" package to beautify
org-mode commands interface.

In `org-capture-templates`, I can set description text with propertied text
like this:

```elisp
(setq org-capture-templates
      `(("c" ,(format "%s\tsticky note" (all-the-icons-faicon
"sticky-note-o" :face 'all-the-icons-green :v-adjust 0.01))
         entry (file "")
         ;; select todo keyword interactively from `org-todo-keywords'.
         ;; The `org-todo-keywords-for-agenda' variable is fullfilled with
value AFTER generated Agenda.
         "* %(completing-read \"Todo keyword: \"
org-todo-keywords-for-agenda nil t) %^{Capture} [/] \n:PROPERTIES:\n:TIME:
%U\n:END: \n%i\n%a\n\n%?\n"
         ;; :time-prompt t
         :empty-lines 1 :jump-to-captured t))
```

But I can't do similar in `org-agenda-custom-commands` description part
like this:
```elisp
(add-to-list
   'org-agenda-custom-commands
   '("c" (format "%s Today [c]locked tasks." (all-the-icons-faicon
"hourglass-start"))
     ((agenda ""
              ((org-agenda-ndays 1)
               (org-agenda-span-1)
               (org-agenda-use-time-grid t)
               (org-agenda-include-diary nil)
               (org-agenda-show-log (quote clockcheck))
               (org-agenda-clockreport t))))))
```
This upper code will report error.

[stardiviner]           <Hack this world!>      GPG key ID: 47C32433
IRC(freeenode): stardiviner                     Twitter:  @numbchild
Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [FEATURE request] hope `org-agenda-custom-commands` can support propertiezed-text.
  2023-03-07  5:09 [FEATURE request] hope `org-agenda-custom-commands` can support propertiezed-text stardiviner
@ 2023-03-07 14:01 ` Ihor Radchenko
  2023-03-08  5:20   ` [SOLVED] " stardiviner
  0 siblings, 1 reply; 4+ messages in thread
From: Ihor Radchenko @ 2023-03-07 14:01 UTC (permalink / raw)
  To: stardiviner; +Cc: Org-mode

stardiviner <numbchild@gmail.com> writes:

> But I can't do similar in `org-agenda-custom-commands` description part
> like this:
> ```elisp
> (add-to-list
>    'org-agenda-custom-commands
>    '("c" (format "%s Today [c]locked tasks." (all-the-icons-faicon
> "hourglass-start"))
>      ((agenda ""
>               ((org-agenda-ndays 1)
>                (org-agenda-span-1)
>                (org-agenda-use-time-grid t)
>                (org-agenda-include-diary nil)
>                (org-agenda-show-log (quote clockcheck))
>                (org-agenda-clockreport t))))))
> ```
> This upper code will report error.

Does `("c" ,(format ...) ...) work?

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [SOLVED] Re: [FEATURE request] hope `org-agenda-custom-commands` can support propertiezed-text.
  2023-03-07 14:01 ` Ihor Radchenko
@ 2023-03-08  5:20   ` stardiviner
  2023-03-08  6:40     ` Ruijie Yu via General discussions about Org-mode.
  0 siblings, 1 reply; 4+ messages in thread
From: stardiviner @ 2023-03-08  5:20 UTC (permalink / raw)
  To: Ihor Radchenko; +Cc: Org-mode

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

[stardiviner]           <Hack this world!>      GPG key ID: 47C32433
IRC(freeenode): stardiviner                     Twitter:  @numbchild
Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/


On Tue, Mar 7, 2023 at 9:59 PM Ihor Radchenko <yantar92@posteo.net> wrote:

> stardiviner <numbchild@gmail.com> writes:
>
> > But I can't do similar in `org-agenda-custom-commands` description part
> > like this:
> > ```elisp
> > (add-to-list
> >    'org-agenda-custom-commands
> >    '("c" (format "%s Today [c]locked tasks." (all-the-icons-faicon
> > "hourglass-start"))
> >      ((agenda ""
> >               ((org-agenda-ndays 1)
> >                (org-agenda-span-1)
> >                (org-agenda-use-time-grid t)
> >                (org-agenda-include-diary nil)
> >                (org-agenda-show-log (quote clockcheck))
> >                (org-agenda-clockreport t))))))
> > ```
> > This upper code will report error.
>
> Does `("c" ,(format ...) ...) work?
>
>
This macro-style expanded string works. I'm curious why have to be expanded?



> --
> Ihor Radchenko // yantar92,
> Org mode contributor,
> Learn more about Org mode at <https://orgmode.org/>.
> Support Org development at <https://liberapay.com/org-mode>,
> or support my work at <https://liberapay.com/yantar92>
>

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [SOLVED] Re: [FEATURE request] hope `org-agenda-custom-commands` can support propertiezed-text.
  2023-03-08  5:20   ` [SOLVED] " stardiviner
@ 2023-03-08  6:40     ` Ruijie Yu via General discussions about Org-mode.
  0 siblings, 0 replies; 4+ messages in thread
From: Ruijie Yu via General discussions about Org-mode. @ 2023-03-08  6:40 UTC (permalink / raw)
  To: stardiviner; +Cc: Ihor Radchenko, emacs-orgmode


stardiviner <numbchild@gmail.com> writes:

> [...]
>>  Does `("c" ,(format ...) ...) work?
>
> This macro-style expanded string works. I'm curious why have to be expanded?

The reason is that org does not expect to run arbitrary sexp (in your
case, the (format ...) expression); instead with the backtick and
unquote, you are passing in a propertized string to org, which org can
understand and make use of.

--
Best,


RY


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-03-08  6:44 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-07  5:09 [FEATURE request] hope `org-agenda-custom-commands` can support propertiezed-text stardiviner
2023-03-07 14:01 ` Ihor Radchenko
2023-03-08  5:20   ` [SOLVED] " stardiviner
2023-03-08  6:40     ` Ruijie Yu via General discussions about Org-mode.

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).