emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [PATCH] org-agenda.el: Rename org-agenda-format-item parameters
@ 2021-03-25 19:35 Renato Ferreira
  2021-03-30  3:20 ` Kyle Meyer
  0 siblings, 1 reply; 4+ messages in thread
From: Renato Ferreira @ 2021-03-25 19:35 UTC (permalink / raw)
  To: emacs-orgmode


* org-agenda.el (org-agenda-format-item): Rename parameters so they
don't clash with dynamic variables used by
`org-prefix-format-compiled'.

TINYCHANGE
---
 lisp/org-agenda.el | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el
index 33b3786f2..f22e6fa65 100644
--- a/lisp/org-agenda.el
+++ b/lisp/org-agenda.el
@@ -6654,14 +6654,14 @@ The flag is set if the currently compiled format contains a `%b'.")
 	  (cl-return (cadr entry))
 	(cl-return (apply #'create-image (cdr entry)))))))
 
-(defun org-agenda-format-item (extra txt &optional level category tags dotime
+(defun org-agenda-format-item (extra txt &optional with-level with-category tags dotime
 				     remove-re habitp)
   "Format TXT to be inserted into the agenda buffer.
 In particular, add the prefix and corresponding text properties.
 
 EXTRA must be a string to replace the `%s' specifier in the prefix format.
-LEVEL may be a string to replace the `%l' specifier.
-CATEGORY (a string, a symbol or nil) may be used to overrule the default
+WITH-LEVEL may be a string to replace the `%l' specifier.
+WITH-CATEGORY (a string, a symbol or nil) may be used to overrule the default
 category taken from local variable or file name.  It will replace the `%c'
 specifier in the format.
 DOTIME, when non-nil, indicates that a time-of-day should be extracted from
@@ -6698,7 +6698,7 @@ Any match of REMOVE-RE will be removed from TXT."
         (defvar breadcrumbs) (defvar category) (defvar category-icon)
         (defvar effort) (defvar extra)
         (defvar level) (defvar tag) (defvar time))
-      (let* ((category (or category
+      (let* ((category (or with-category
 			   (if buffer-file-name
 			       (file-name-sans-extension
 				(file-name-nondirectory buffer-file-name))
@@ -6796,7 +6796,7 @@ Any match of REMOVE-RE will be removed from TXT."
                                 time-grid-trailing-characters)))
 			 (t ""))
 	      category (if (symbolp category) (symbol-name category) category)
-	      level (or level ""))
+	      level (or with-level ""))
 	(if (string-match org-link-bracket-re category)
 	    (progn
 	      (setq l (string-width (or (match-string 2) (match-string 1))))
-- 
2.31.0



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

* Re: [PATCH] org-agenda.el: Rename org-agenda-format-item parameters
  2021-03-25 19:35 [PATCH] org-agenda.el: Rename org-agenda-format-item parameters Renato Ferreira
@ 2021-03-30  3:20 ` Kyle Meyer
  2021-03-30 20:21   ` Renato Ferreira
  0 siblings, 1 reply; 4+ messages in thread
From: Kyle Meyer @ 2021-03-30  3:20 UTC (permalink / raw)
  To: Renato Ferreira; +Cc: emacs-orgmode

Renato Ferreira writes:

> * org-agenda.el (org-agenda-format-item): Rename parameters so they
> don't clash with dynamic variables used by
> `org-prefix-format-compiled'.

Thanks.

Presumably you arrived at this patch because you hit into a particular
issue (related the lexical binding conversion in 129c33ddd).  Could you
provide a reproducer (or at least a description) for that problem?
That'd be useful for reviewing this patch, as well as assessing if the
conversion has other similar issues.


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

* Re: [PATCH] org-agenda.el: Rename org-agenda-format-item parameters
  2021-03-30  3:20 ` Kyle Meyer
@ 2021-03-30 20:21   ` Renato Ferreira
  2021-03-31  4:11     ` Kyle Meyer
  0 siblings, 1 reply; 4+ messages in thread
From: Renato Ferreira @ 2021-03-30 20:21 UTC (permalink / raw)
  To: Kyle Meyer; +Cc: emacs-orgmode

On Mon, 29 Mar 2021 23:20:02 -0400, Kyle Meyer <kyle@kyleam.com> said:

> Presumably you arrived at this patch because you hit into a particular
> issue (related the lexical binding conversion in 129c33ddd).
> Could you provide a reproducer (or at least a description) for that
> problem?  That'd be useful for reviewing this patch, as well as
> assessing if the conversion has other similar issues.

Sure:

```org

* TODO Header

** TODO Subheader

* Setup
#+begin_src emacs-lisp :results none
(setq org-agenda-prefix-format '((agenda  . " %i %-12:c%?-12t% s")
																 (todo  . "% l %i %-12:c")
																 (tags  . " %i %-12:c")
																 (search . " %i %-12:c"))
			org-agenda-files (list (buffer-file-name (current-buffer))))
(org-todo-list "TODO")
#+end_src

```

Note the "% l" on the todo format to use level variable.

Evaluating this will result in "if: Symbol’s value as variable is void:
level" in commit 68db6fc06.

-- 
Att.,
Renato Ferreira


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

* Re: [PATCH] org-agenda.el: Rename org-agenda-format-item parameters
  2021-03-30 20:21   ` Renato Ferreira
@ 2021-03-31  4:11     ` Kyle Meyer
  0 siblings, 0 replies; 4+ messages in thread
From: Kyle Meyer @ 2021-03-31  4:11 UTC (permalink / raw)
  To: Renato Ferreira; +Cc: emacs-orgmode

Renato Ferreira writes:

> On Mon, 29 Mar 2021 23:20:02 -0400, Kyle Meyer <kyle@kyleam.com> said:
>
>> Presumably you arrived at this patch because you hit into a particular
>> issue (related the lexical binding conversion in 129c33ddd).
>> Could you provide a reproducer (or at least a description) for that
>> problem?  That'd be useful for reviewing this patch, as well as
>> assessing if the conversion has other similar issues.
>
> Sure:
>
> ```org
>
> * TODO Header [...]

Great, thanks.  Pushed (6a50e41ea).



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

end of thread, other threads:[~2021-03-31  4:12 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-25 19:35 [PATCH] org-agenda.el: Rename org-agenda-format-item parameters Renato Ferreira
2021-03-30  3:20 ` Kyle Meyer
2021-03-30 20:21   ` Renato Ferreira
2021-03-31  4:11     ` Kyle Meyer

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