From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id KCJPIClqUmR5qQAASxT56A (envelope-from ) for ; Wed, 03 May 2023 16:05:29 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id +Cf8HylqUmSGFgEAauVa8A (envelope-from ) for ; Wed, 03 May 2023 16:05:29 +0200 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 5AFF5D908 for ; Wed, 3 May 2023 16:05:29 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1puD64-0004n9-5j; Wed, 03 May 2023 10:04:44 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <5diezfun@gmail.com>) id 1puC9A-0004hf-Av for emacs-orgmode@gnu.org; Wed, 03 May 2023 09:03:52 -0400 Received: from mail-pf1-x42e.google.com ([2607:f8b0:4864:20::42e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from <5diezfun@gmail.com>) id 1puC95-0001wx-AV for emacs-orgmode@gnu.org; Wed, 03 May 2023 09:03:52 -0400 Received: by mail-pf1-x42e.google.com with SMTP id d2e1a72fcca58-64115e652eeso4655583b3a.0 for ; Wed, 03 May 2023 06:03:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1683119025; x=1685711025; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=6tnwBEFDJ8cFQK6MGGhnEAPb8do9kkg/IWu+vlW2Hx4=; b=A25JapA9bs/JHj9S338fnQaNmepm/aCkl9ub8iI5lkniElW8t+qkpMUyHuvMoU9N2Z IGKPEjwG5Itr1MFt1OgtQBpT7Lw6vX1y8pt2gJHGPP9RfkD0Npq+VxNirrYNDklvC/dK hFVxYHdEN0UzGY8KFr+9RPEBmVy0To9ZqIgE6XuFWj/dyJLaVIQxN0Zhz6NBkiWPTLVL CKg+zSt68nzbJRvZ7JhJZHKW6ZYHas2OM6bwbLqDRhbi0C4OcPv/F0rbzfGiBDtNHmJl vp/rsTsUVFly3Hup+fcSNlLg0oJxnpDRQLr/F7BmFhu6vEfT97FEt/sr6N+JnzgA+JrD 9xGw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683119025; x=1685711025; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=6tnwBEFDJ8cFQK6MGGhnEAPb8do9kkg/IWu+vlW2Hx4=; b=AbaL9glaxw+x60wCZ0ryKqMm0VyiA6B2aQRoThthJFfZu2tWEk4CTnv7ClT1aDE/bC e2sQcOOQU6W9buEf1Y2WR3m0C41sDG6MMlyxvv8V0MK9koJMO26Co8fZAbQ5EZh52KaD DkHN/Hvv0wJaTevw8VGQIfULTkMV/LcmixihtGHduJYdZDO7oZhV7CSIxYFOMWmgq2hm xPUkLuthVwqcOSq4hss6pGwSWDyQMJxi0ny5ygYTRHL6/7+1VRXp62OE8nSG/jHe/KMA RGdSs/nRqW82jSLEjIXYZF0HUIc6NtI965p5C+J4it+wsaG/snDj0pznDzL7uG6vBGIr w+iQ== X-Gm-Message-State: AC+VfDwREuzOJDF4KBMpXfy7fYvRj4UY+J94eFvDJu0rWySe9WZnIX9F KALdkoepn47VOBHgFDNL4MYwHd+AV3leO2me2Ym7pGGkOwrOWl/W X-Google-Smtp-Source: ACHHUZ5b22cSGBGHU13X7ivzbpEIBGbnnbV08FVinxZehYffe9dY1+UFXL9WAQyclvEpRY/o9dt8lz9gNM0nHUwjuV4= X-Received: by 2002:a17:902:d48e:b0:1a9:68d2:e4ae with SMTP id c14-20020a170902d48e00b001a968d2e4aemr38411plg.2.1683119024769; Wed, 03 May 2023 06:03:44 -0700 (PDT) MIME-Version: 1.0 From: =?UTF-8?B?0JTQvNC40YLRgNC40Lkg0JvQvtCz0LLQuNC90LXQvdC60L4=?= Date: Wed, 3 May 2023 16:03:33 +0300 Message-ID: Subject: [BUG] org-habit does not respect STYLE property inheritance To: emacs-orgmode@gnu.org Content-Type: text/plain; charset="UTF-8" Received-SPF: pass client-ip=2607:f8b0:4864:20::42e; envelope-from=5diezfun@gmail.com; helo=mail-pf1-x42e.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Wed, 03 May 2023 10:04:33 -0400 X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: emacs-orgmode-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US ARC-Seal: i=1; s=key1; d=yhetil.org; t=1683122729; a=rsa-sha256; cv=none; b=sOAOQI7iuwwdvlOTFnh6uksaeUOioeY8TuGgj7f0EYdqt9/FAlNTHBquVwMfah5CAvmwNC hxMHpQl/6JKfNrFXbKk1t2nIcK9x0sHudZ9f9R2ecQJE3lDCfjfeQCqeKdFXQMlt6YaT6k VeBK56LeARxgdg2wn2HrCPQGpPH70TQvM8Q3FwHZQt0B0Y2P1jsb4xrEDpAvvzn2VhMF4k CF/Q1uw9X1AAne5lBueP1Q7Zn5zykiNTjRqbA1XDdnAI/epZyGp4rsKeqYq6yetz0O2RSu N6bdtkMjXVMH2TIoJECmflsG+5Tb0QhXbVj1mPE786nFnE5K/bjoCJ2aZusRFw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20221208 header.b=A25JapA9; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1683122729; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=6tnwBEFDJ8cFQK6MGGhnEAPb8do9kkg/IWu+vlW2Hx4=; b=Yj+zGVgtC9oxeNPhTNHmJqiCPnC3QV9Ku7zFhi0syTLjmQW9LAman38g/eBjTjpjiBnFEn Uat9EKurqQb1dEWgzUnTU4IeZ/w2pVLaxGaa4FgEWddDiSArWdUFL4C/xDWBkS6mIQYihf eLq0pjANKoqf4BShN7L/ovhWikVU82FIAc7kE0lyBMp14E6EXxMkN4jqcCpc9ROgXrDZ4t uCkAGoXh89BleMobfat9S3BDvc3390leD4kHfFz3M3qVPeqDMr0i/721hzMk/X75L+Jqhb f2Z1EB+KhfH4WruvRBe2k7Y/zNy11Uq00uHdODlNHfvxTkMYA/bJxLgQOENhWQ== X-Migadu-Scanner: scn1.migadu.com Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20221208 header.b=A25JapA9; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -6.41 X-Spam-Score: -6.41 X-Migadu-Queue-Id: 5AFF5D908 X-TUID: uMccll/alSGG Hi there, I've noticed that org-habits does not take an inherited STYLE property when it searches entries. Let me illustrate it: (setq org-use-property-inheritance t) (defun run-example () (with-temp-buffer (insert "\ * Habit group :PROPERTIES: :STYLE: habit :END: ** DONE Contribute to org SCHEDULED <2023-05-01 Mon +1w/2w> :PROPERTIES: :ID: deadbeef :END:") (delay-mode-hooks (org-mode)) (let ((entry (org-find-entry-with-id 'deadbeef))) `(,(org-entry-get entry "ITEM") ,(org-entry-get entry "TODO") ,(org-is-habit-p entry))))) ;; Original (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"))) (run-example) ;; => ("Contribute to org" "DONE" nil) ;; Proposed (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" 'selective))) (run-example) ;; => ("Contribute to org" "DONE" t) A little patch: diff --git a/lisp/org-habit.el b/lisp/org-habit.el index ea935fe..b7ba6e3 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. Emacs : GNU Emacs 28.2 (build 1, x86_64-apple-darwin22.1.0, Carbon Version 169 AppKit 2299) of 2022-12-05 Package: Org mode version 9.7 (9.7-??-5ec364a @ /Users/d.logvinenko/.emacs.d/.local/straight/build-28.2/org/)