From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms13.migadu.com with LMTPS id CNgpLTvejmbbGAAAqHPOHw:P1 (envelope-from ) for ; Wed, 10 Jul 2024 19:17:15 +0000 Received: from aspmx1.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0.migadu.com with LMTPS id CNgpLTvejmbbGAAAqHPOHw (envelope-from ) for ; Wed, 10 Jul 2024 21:17:15 +0200 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=D1wtYifJ; dmarc=pass (policy=none) header.from=posteo.net; 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=1720639035; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=hLv4MSHN15qcjHbkbWTpwsFye9qxbzxSL4kXttYuGfA=; b=DnWLYqbTN8jQcvKgSKE/mo3ckcy1NlXMj3AjoXfxSUgH9AgZ8BOW+D3hIw7yJG6Yj2mFcD MJGloW6UBUSJu7xh5A2dp1NeU+Wt5pRBbNce6pUeJl45TffhBpcj5d2CCB9A55Juk5fPpE t5FNTQ3kEG0+wPs8R089L1+z2eMy92NM9Wnyvv3xP+mgKVS1m5dchOyMkTcNOZfiLKnfta evvrRehiRhL0jQANMUnLb/eV51fgCeTizA3SY/WcDtDVZZ2IQZrFn4o/HPRGTiiGkd9Ygu gkKbAP1MvM7aHFunajZOSDMyGJNcYudLHlGzZYLDVdzJ78h75uAKMTuEOoFW0g== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1720639035; a=rsa-sha256; cv=none; b=uGQP8zhgtmiltPo5WLvexNmx5vkS/m7VDvv6vq5rVOHbP9ouV37QDb5WlqHy3LC7gg4U4X ResogRTJeoDCDCRtk/XOXZapLuxA9bhbZzfkd1MxyRQTFgj05q8d3qA/HeFZWrdu4tiO5b AZkAmHikI2Un2A/wk/xsRzPb8SuLKQ6skgI9VNhxnRZNs3hinUVLjYQnEv57So/nFF7M17 CkYjh6DT83amM76Vx0sFqI37WiTaongmO6dwg2gelyqtHnYUUZb8TTPNR+OO23b2ORD1vC 2uV9si8Xpc3y7uWhiKApXk+VgKXfokppn03hyG0KFMXDGMdaR80WCNKvzh+FVA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=D1wtYifJ; dmarc=pass (policy=none) header.from=posteo.net; 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" 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 0521A13397 for ; Wed, 10 Jul 2024 21:17:15 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sRcni-0007gx-RR; Wed, 10 Jul 2024 15:16:26 -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 ) id 1sRcnh-0007gm-56 for emacs-orgmode@gnu.org; Wed, 10 Jul 2024 15:16:25 -0400 Received: from mout01.posteo.de ([185.67.36.65]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sRcnd-0008Dm-P3 for emacs-orgmode@gnu.org; Wed, 10 Jul 2024 15:16:23 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id 84874240027 for ; Wed, 10 Jul 2024 21:16:19 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1720638979; bh=P3mhvblFTCOfrggP52HeovleG4CpXhrzYsq6oIJeEWI=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type: Content-Transfer-Encoding:From; b=D1wtYifJfvZyEzNaHnqKk0l0RwZDjvxg2RoIh/4hbJWbeJDs3t/SeX6A7QcmCw1P9 +B5/1bBSiA4gbKzbKe1sVtfUu44sbSvbkEPW/+cdcSy6pw5grDEEcjA+QmsO670KdS wFrs0vaGWdLSxhWMXlLDTAfdQnndCa7pnoFTcP9oRo21QSKBbBBXJHgyU6BQ1C7huV k4Y9NIi95ITIdPft6QdV5wBoBldhcDMuTXMNVvmSt8B34wakX+3H8S1lAZi4ZflxuL PKO3OnZ0eyNaFJtPqL51K3kbzO6SzkKgBBxmWLiCzjLKXCjG+KJjauhxKFUE4ANHz4 cqaElBymFg9cA== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4WK6z70QVcz6tvJ; Wed, 10 Jul 2024 21:16:19 +0200 (CEST) From: Ihor Radchenko To: Patrick Nicodemus Cc: emacs-orgmode@gnu.org Subject: Re: Treat habits as ordinary tasks In-Reply-To: References: Date: Wed, 10 Jul 2024 19:17:48 +0000 Message-ID: <87v81d5a5f.fsf@localhost> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=185.67.36.65; envelope-from=yantar92@posteo.net; helo=mout01.posteo.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 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, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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 X-Migadu-Queue-Id: 0521A13397 X-Migadu-Scanner: mx12.migadu.com X-Migadu-Spam-Score: -9.63 X-Spam-Score: -9.63 X-TUID: ZYbRP8N0o1bX Patrick Nicodemus writes: > Any task which is a habit is listed in a special portion of the agenda for > consistency tracking. This is useful and convenient. However, this > apparently conflicts with scheduling the habit for a certain time. For > example, if I want to go for a run on Tuesday at 5pm, I would like to have > the option to schedule my running habit for 5pm on Tuesday and have it > appear in the agenda at that position. > > Ideally I would like to toggle the features of the habit module on and of= f, > so that in the agenda view, habits are treated either as normal tasks at a > particular time, or they appear in the consistency tracker window rather > than the schedule. Is there a way to accomplish this? > > Note that I don't want to filter (remove) the habits from the agenda. I am > familiar with this functionality. This is no built-in way to toggle this, but I can give you pointers how to achieve what you want. The reason why habits are grouped together is the default value of `org-agenda-sorting-strategy': org-agenda-sorting-strategy is a variable defined in =E2=80=98org-agenda-so= rt.el=E2=80=99. Its value is ((agenda habit-down time-up urgency-down category-keep) (todo urgency-down category-keep) (tags urgency-down category-keep) (search category-keep)) As you can see, for "agenda" blocks, the first sorting key is "habit-down" causing all habits go after non-habits. To get the habits sorted by time (I assume that you are looking for your habits to appear in the time grid), you need to remove "habit-down" from the sorting strategy. You can write a small helper command to do this: (defvar my/org-agenda-sorting-strategy-pre nil "Previous value of `org-agenda-sorting-strategy'.") (defun my/org-agenda-toggle-habit-grouping () "Toggle grouping of habits in agendas. Does not work when custom agenda command defines local sorting strategy." (interactive) (org-agenda-check-type t 'agenda) (if my/org-agenda-sorting-strategy-pre (progn (setq org-agenda-sorting-strategy my/org-agenda-sorting-strategy-pre) (setq my/org-agenda-sorting-strategy-pre nil) (org-agenda-redo) (message "Habit grouping ON")) (let ((old-strategy (alist-get 'agenda org-agenda-sorting-strategy))) (if (not (or (memq 'habit-up old-strategy) (memq 'habit-down old-stra= tegy))) (user-error "Habits are not grouped in agendas: %S" old-strategy) (setq my/org-agenda-sorting-strategy-pre (copy-alist org-agenda-sorting-st= rategy)) (setf (alist-get 'agenda org-agenda-sorting-strategy) (delete 'habi= t-up (delete 'habit-down old-strategy))) (org-agenda-redo) (message "Habit grouping OFF"))))) --=20 Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at . Support Org development at , or support my work at