From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id iC2sL4EJYWKu3AAAbAwnHQ (envelope-from ) for ; Thu, 21 Apr 2022 09:36:33 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id WBDNLoEJYWJ0SgEAG6o9tA (envelope-from ) for ; Thu, 21 Apr 2022 09:36:33 +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 4587AA5A4 for ; Thu, 21 Apr 2022 09:36:33 +0200 (CEST) Received: from localhost ([::1]:55056 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nhRMe-0004iL-BC for larch@yhetil.org; Thu, 21 Apr 2022 03:36:32 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59536) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nhR33-0001e2-KN for emacs-orgmode@gnu.org; Thu, 21 Apr 2022 03:16:17 -0400 Received: from mail-qv1-xf35.google.com ([2607:f8b0:4864:20::f35]:41957) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nhR31-0004oV-JR for emacs-orgmode@gnu.org; Thu, 21 Apr 2022 03:16:17 -0400 Received: by mail-qv1-xf35.google.com with SMTP id a10so3072329qvm.8 for ; Thu, 21 Apr 2022 00:16:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=+L84nbPsV18cI788YAwXUT9OQebBPi7727BZSVUJ+7M=; b=H0PZh28I0WdSeWnHJT4gkB4WL4d8XnHR20s9OvgmLrWhuJFozvpgh6V/3FxEVgZqiN oi1Bj7hM5R6tlzSBhran3Hy6W8CpRuDrZj7qmhwMOG7Q0/wIVG69Ge99kMHe0LY3LRih mOzFPUtdrFmR6aX0evpRSGYg1CTHiN70SILmHoBao3YNWC2OGXnrnTEfAwTHOACqUBux M8KvdHnWQRs1XKsX2/X0txItUxNC/zvTJQCBQ7MXVOR+dq5okdQi4B0eQOwXzyl97BcL ZlWvxCkLYyYhKBXMsFDaW1bIbbdS7n4x04nR+KQovIkazykL1Xqr5PqJqwiWBZvyhOEV 49aQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=+L84nbPsV18cI788YAwXUT9OQebBPi7727BZSVUJ+7M=; b=Uswp6Td8fH3HtOYnRFw49M9jiFB2RY9W+RAjHUCPOyBNXLaOOS2J6pJd/MywJPY4R8 oIfK/lwR1YN7Ri5TdaBx1Pht8aHR9TzWBLyF88aklMYM+2yDrKSnu7hCtucmsCcEadFw qCySmJbXryWr1mXTRkwg9Lf7YQM8YsVG7RSDNWsWJUvNfjVUtF9jA4UHabf2z6PfMQDr ieOszNr6fIf7Q6nvt/BR292+KT/hjFUmMiSBooB0juYh9t/ih3x/iSMeXWftJ8U/xJPI FKIpJehuB1hGTIuDlvq83zzb4CJZFJNY+HZ85jXP3cErGKUKNrNx83X8C1fF2MssrQhr 4aFA== X-Gm-Message-State: AOAM5307mH+2WY+k+3O3B/YVFRXTRRqDpX/4h4LRJwKmQMAK/qljvdi5 W9tVoTdVjsUzRjjuT7EUt4syPJPoquA= X-Google-Smtp-Source: ABdhPJzmsj6p+JksoxDfsQWJ89YNgirAJy1m6wsZKR31bTw6oHj59ZHkwNBWqbYWwLDvw7cfq/Dc2Q== X-Received: by 2002:a05:6214:501d:b0:446:6596:7d97 with SMTP id jo29-20020a056214501d00b0044665967d97mr12051644qvb.79.1650525373287; Thu, 21 Apr 2022 00:16:13 -0700 (PDT) Received: from moondust.localdomain.nodomain.none (bras-base-toroon474qw-grc-79-174-92-60-96.dsl.bell.ca. [174.92.60.96]) by smtp.gmail.com with ESMTPSA id s4-20020ae9de04000000b0069c3a577b0asm2565253qkf.51.2022.04.21.00.16.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Apr 2022 00:16:12 -0700 (PDT) From: "N. Jackson" To: Ihor Radchenko Subject: Re: [PATCH] org-agenda: Use `window-max-chars-per-line' instead of `window-width' References: <874k2qwn92.fsf@moondust.localdomain> <87ee1ubje8.fsf@localhost> <87o80yqkhi.fsf@moondust.localdomain> <874k2ppxth.fsf@localhost> <87czhdqi9p.fsf_-_@moondust.localdomain> <87o80wz9le.fsf@localhost> <87ee1sjcf9.fsf@moondust.localdomain> <87wnfj3t4x.fsf@localhost> Date: Thu, 21 Apr 2022 03:16:11 -0400 In-Reply-To: <87wnfj3t4x.fsf@localhost> (Ihor Radchenko's message of "Thu, 21 Apr 2022 13:25:18 +0800") Message-ID: <87a6cekitg.fsf@moondust.localdomain> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=2607:f8b0:4864:20::f35; envelope-from=nljlistbox2@gmail.com; helo=mail-qv1-xf35.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 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_ENVFROM_END_DIGIT=0.25, 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-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: , Cc: emacs-orgmode@gnu.org Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1650526593; 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:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=+L84nbPsV18cI788YAwXUT9OQebBPi7727BZSVUJ+7M=; b=UNKDZejQObhrSsYnNzlO97FTglM7TQtbV6cdUmWBwX98XBzvoVJo1PAxMQGicy42VwmGeX WlOVDpTnY5Dw+bfAjHF4ZF6xBR2swNp7Zl3yqXk2eir5sBUtYQ5FY16Dvw81zclOPfIe8d ctmmbmh34XUqEM2sna7ylLhJ/yNTGG7IBAhYhHKfi7icB6BLgL/bwuhtE9iNN3EvpQzSAp qOLEoYBcXwG5hlGrroAp/SVEcQqo4F1MdPOryfzjXpJtuWeqbQvPMul601RCKSKWZFMoib VgbUwXdKtVp4wqIUHzzppATYewrZ147FGKpzKE6bQ9CcD5Uu+eSWYFkIOZgEvw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1650526593; a=rsa-sha256; cv=none; b=Ld5JYI+GL+2Bg5bqbyXSdiFZ6SrcFP+OLmB9QlGjUN3oC4e3TYBJU3hfpg6FqrmEuI30UN SSWkBUpJzO3TYUXltVq0P5CtzPkPLtTwAbVQvbmSZXmUBm9lN70LY9SVs3wIWGAfgxh3X3 htSiHTRE4/oij7FW3sx0++X7DaAHHyPchLWDDMYqrn3c8pbgGkXieC1b72AvOIjX6DAkQO BCSbJp06JfaXQPRV62yyJo5Dd26I/vL7Lgoisd0xTfn2OVoJ7tqSBjaKMOW1SuDgwK1JyR BeDCTd+LZw9vi6ZDYOkPsi212XjWWr8ab8qAlf8i0mGeGwMgfHLOTrkMDh4x9g== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=H0PZh28I; 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: -2.54 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=H0PZh28I; 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-Queue-Id: 4587AA5A4 X-Spam-Score: -2.54 X-Migadu-Scanner: scn1.migadu.com X-TUID: BC3Mi/5P/eK9 At 13:25 +0800 on Thursday 2022-04-21, Ihor Radchenko wrote: > > Attaching the patch. Great. I tested the patch (with Org mode version 9.5.3) and that fixes the problem for the block separator wrapping. However, the problem with the tags wrapping in Agenda (instead of being right aligned) remains. Thank you and best regards, N. > From 5de3de87872ddae994f5b68eba74d915d5f73201 Mon Sep 17 00:00:00 2001 > Message-Id: <5de3de87872ddae994f5b68eba74d915d5f73201.1650518543.git.yantar92@gmail.com> > From: Ihor Radchenko > Date: Thu, 21 Apr 2022 13:18:39 +0800 > Subject: [PATCH] org-agenda: Use `window-max-chars-per-line' instead of > `window-width' > > * lisp/org-agenda.el (org-agenda-prepare): > (org-todo-list): > (org-agenda-show-new-time): Calculate the maximum number of chars > fitting into window via `window-max-chars-per-line' instead of > `window-with'. The latter can return larger number when fringes are > disabled [1]. > > [1] https://debbugs.gnu.org/cgi/bugreport.cgi?bug=19395 > > Reported in https://orgmode.org/list/87czhdqi9p.fsf_-_@moondust.localdomain > --- > lisp/org-agenda.el | 9 +++------ > 1 file changed, 3 insertions(+), 6 deletions(-) > > diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el > index a09b53563..9ddee81ee 100644 > --- a/lisp/org-agenda.el > +++ b/lisp/org-agenda.el > @@ -3925,7 +3925,7 @@ (defun org-agenda-prepare (&optional name) > (insert "\n" > (if (stringp org-agenda-block-separator) > org-agenda-block-separator > - (make-string (window-width) org-agenda-block-separator)) > + (make-string (window-max-chars-per-line) org-agenda-block-separator)) > "\n")) > (narrow-to-region (point) (point-max))) > (setq org-done-keywords-for-agenda nil) > @@ -4944,7 +4944,7 @@ (defun org-todo-list (&optional arg) > (let ((n 0)) > (dolist (k kwds) > (let ((s (format "(%d)%s" (cl-incf n) k))) > - (when (> (+ (current-column) (string-width s) 1) (window-width)) > + (when (> (+ (current-column) (string-width s) 1) (window-max-chars-per-line)) > (insert "\n ")) > (insert " " s)))) > (insert "\n")) > @@ -10301,10 +10301,7 @@ (defun org-agenda-show-new-time (marker stamp &optional prefix) > (line-end-position) > '(display nil)) > (org-move-to-column > - (- (if (fboundp 'window-font-width) > - (/ (window-width nil t) (window-font-width)) > - ;; Fall back to pre-9.3.3 behavior on Emacs <25. > - (window-width)) > + (- (window-max-chars-per-line) > (length stamp)) > t) > (add-text-properties