emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [PATCH] org.el: Remove undefined dynamic variable `org-log-states' from example
@ 2023-07-10 23:11 Evgenii Klimov
  2023-07-11  2:24 ` Max Nikulin
  2023-07-12 13:42 ` Ihor Radchenko
  0 siblings, 2 replies; 6+ messages in thread
From: Evgenii Klimov @ 2023-07-10 23:11 UTC (permalink / raw)
  To: emacs-orgmode@gnu.org

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

I added `org-summary-todo' example function, that are advertized in
`org-after-todo-statistics-hook', to my init file (with
lexical-binding: t) and got a compilation warning:

  Warning (bytecomp): Unused lexical variable `org-log-states'

since this variable is undefined. The command:

  git log -G 'org-log-states[^-]' --patch -- lisp/

shows its first appearance in commit
2c0812caf14e674d938d80d05678576c0cefcc83 but only in docstring.

Running ~find~ also didn't show its definition:

  find -H . -type f -exec grep --color=auto -i -nH --null \
    -e org-log-states\[\^-\] \{\} +

But there are =org-log-states-order-reversed=, but it doesn't seem to
be relevant.

PS: I didn't add TINYCHANGE since I have reached the contribution
limit but FSF didn't respond yet.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-org.el-Remove-undefined-dynamic-variable-org-log-sta.patch --]
[-- Type: text/x-diff, Size: 1794 bytes --]

From a3e50c5799acb216ccb2c1ae6883d73ac36e4291 Mon Sep 17 00:00:00 2001
From: Evgenii Klimov <eugene.dev@lipklim.org>
Date: Mon, 10 Jul 2023 23:00:41 +0100
Subject: [PATCH] org.el: Remove undefined dynamic variable `org-log-states'
 from example

* lisp/org.el (org-after-todo-statistics-hook): Remove undefined
dynamic variable `org-log-states' from docstring example.

* doc/org-manual.org (Breaking Down Tasks into Subtasks): The same
thing in doc example.

`org-log-states' was never defined throughout the whole repo history,
its removal helps to avoid compilation warning.
---
 doc/org-manual.org | 2 +-
 lisp/org.el        | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/doc/org-manual.org b/doc/org-manual.org
index 987a29354..8a58bb31e 100644
--- a/doc/org-manual.org
+++ b/doc/org-manual.org
@@ -4648,7 +4648,7 @@ all children are done, you can use the following setup:
 #+begin_src emacs-lisp
 (defun org-summary-todo (n-done n-not-done)
   "Switch entry to DONE when all subentries are done, to TODO otherwise."
-  (let (org-log-done org-log-states)   ; turn off logging
+  (let (org-log-done)   ; turn off logging
     (org-todo (if (= n-not-done 0) "DONE" "TODO"))))
 
 (add-hook 'org-after-todo-statistics-hook #'org-summary-todo)
diff --git a/lisp/org.el b/lisp/org.el
index 62278ec77..9df56c700 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -9755,7 +9755,7 @@ when there is a statistics cookie in the headline!
 
  (defun org-summary-todo (n-done n-not-done)
    \"Switch entry to DONE when all subentries are done, to TODO otherwise.\"
-   (let (org-log-done org-log-states)   ; turn off logging
+   (let (org-log-done)   ; turn off logging
      (org-todo (if (= n-not-done 0) \"DONE\" \"TODO\"))))")
 
 (defvar org-todo-statistics-hook nil
-- 
2.34.1


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

end of thread, other threads:[~2023-07-13 11:30 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-07-10 23:11 [PATCH] org.el: Remove undefined dynamic variable `org-log-states' from example Evgenii Klimov
2023-07-11  2:24 ` Max Nikulin
2023-07-11  9:11   ` Ihor Radchenko
2023-07-12 13:42 ` Ihor Radchenko
2023-07-12 20:53   ` Evgenii Klimov
2023-07-13 11:29     ` Ihor Radchenko

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