emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Dmitry Logvinenko <dmlogv@gmail.com>
To: Ihor Radchenko <yantar92@posteo.net>
Cc: Dmitry Logvinenko <dmlogv@gmail.com>, emacs-orgmode@gnu.org
Subject: Re: [POLL] Will it be ok to allow HABIT property inheritance? (optionally) (was: [BUG] org-habit does not respect STYLE property inheritance)
Date: Thu, 22 Jun 2023 20:08:33 +0300	[thread overview]
Message-ID: <CAB+pTYnY2n+E_FX922637voye10xW8+TD3AxyDLjV=eUGyOoyA@mail.gmail.com> (raw)
In-Reply-To: <87a5wzkaep.fsf@localhost>

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

Thank you for your comments, fixed.

[-- Attachment #2: 0001-lisp-org-habit.el-Inherit-habit-style-property.patch --]
[-- Type: application/octet-stream, Size: 2143 bytes --]

From 6a1814a8b0d7189b397790b90fb5a6979a6b66cb Mon Sep 17 00:00:00 2001
From: Dmitry Logvinenko <dmlogv@gmail.com>
Date: Thu, 15 Jun 2023 19:47:51 +0300
Subject: [PATCH] lisp/org-habit.el: Inherit habit style property

* lisp/org-habit.el (org-is-habit-p):  Use `org-entry-get' with
'selective option to optionally find habit subheadings.
* etc/ORG-NEWS: Describe a breaking change.

 etc/ORG-NEWS      | 15 +++++++++++++++
 lisp/org-habit.el |  2 +-
 2 files changed, 16 insertions(+), 1 deletion(-)

diff --git a/etc/ORG-NEWS b/etc/ORG-NEWS
index 01d2975d3..cb4bc632b 100644
--- a/etc/ORG-NEWS
+++ b/etc/ORG-NEWS
@@ -74,6 +74,20 @@ the iCalendar spec demands a start date, and
 To revert to the old behavior, set
 ~org-icalendar-todo-unscheduled-start~ to ~current-datetime~.
+*** =org-habit.el= now optionally inherits ~:STYLE: habit~ properties
+Currently, the ~STYLE~ property of habits is not inherited when searching
+for entries.
+This change allows the property to be inherited optionally by customizing
+the ~org-use-property-inheritance~ variable.
+This change aims to provide more flexibility in managing habits, allowing
+users to dedicate separate subtrees or files to habits without manually
+setting the ~STYLE~ property for each sub-task.
+The change is breaking when ~org-use-property-inheritance~ is set to ~t~.
 ** New and changed options
 *** Commands affected by ~org-fold-catch-invisible-edits~ can now be customized
@@ -556,6 +570,7 @@ After:
 : ("simple" "list")
 ** New features
 *** Clock table can now produce quarterly reports
diff --git a/lisp/org-habit.el b/lisp/org-habit.el
index ea935fe7c..b7ba6e349 100644
--- a/lisp/org-habit.el
+++ b/lisp/org-habit.el
@@ -170,7 +170,7 @@ means of creating calendar-based reminders."
 (defun org-is-habit-p (&optional pom)
   "Is the task at POM or point a habit?"
-  (string= "habit" (org-entry-get (or pom (point)) "STYLE")))
+  (string= "habit" (org-entry-get (or pom (point)) "STYLE" 'selective)))
 (defun org-habit-parse-todo (&optional pom)
   "Parse the TODO surrounding point for its habit-related data.

  reply	other threads:[~2023-06-22 17:09 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-03 13:03 [BUG] org-habit does not respect STYLE property inheritance Дмитрий Логвиненко
2023-05-04  9:53 ` [POLL] Will it be ok to allow HABIT property inheritance? (optionally) (was: [BUG] org-habit does not respect STYLE property inheritance) Ihor Radchenko
2023-05-18 10:38   ` Ihor Radchenko
2023-05-18 16:10     ` [POLL] Will it be ok to allow HABIT property inheritance? (optionally) Colin Baxter
2023-05-18 16:25       ` Ihor Radchenko
2023-05-18 16:32         ` Colin Baxter
2023-06-15 17:11     ` [POLL] Will it be ok to allow HABIT property inheritance? (optionally) (was: [BUG] org-habit does not respect STYLE property inheritance) Dmitry Logvinenko
2023-06-16  9:45       ` Ihor Radchenko
2023-06-22 17:08         ` Dmitry Logvinenko [this message]
2023-06-23 10:51           ` Ihor Radchenko

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:

  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='CAB+pTYnY2n+E_FX922637voye10xW8+TD3AxyDLjV=eUGyOoyA@mail.gmail.com' \
    --to=dmlogv@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=yantar92@posteo.net \


* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox


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