From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id E/T5Oa9dumBNwAAAgWs5BA (envelope-from ) for ; Fri, 04 Jun 2021 19:06:55 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id SDPwNK9dumCkGwAA1q6Kng (envelope-from ) for ; Fri, 04 Jun 2021 17:06:55 +0000 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 264D71ADEC for ; Fri, 4 Jun 2021 19:06:55 +0200 (CEST) Received: from localhost ([::1]:57644 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lpDHZ-0008HF-Bb for larch@yhetil.org; Fri, 04 Jun 2021 13:06:53 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58504) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lpCfP-0004rb-1D for emacs-orgmode@gnu.org; Fri, 04 Jun 2021 12:27:27 -0400 Received: from dun.jabatus.fr ([109.234.163.29]:42683) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lpCfM-0000Ao-9X for emacs-orgmode@gnu.org; Fri, 04 Jun 2021 12:27:26 -0400 X-MailPropre-MailScanner-From: victor@svictor.net X-MailPropre-MailScanner-SpamCheck: not spam, SpamAssassin (not cached, score=-6.03, required 5, autolearn=disabled, RCVD_IN_DNSWL_HI -5.00, SPF_HELO_PASS -0.10, SPF_PASS -1.00, SUKA_10 0.01, SUKB_10 0.01, SUKB_11 0.01, SUKC_2 0.01, SUKD_2 0.01, SUKD_4 0.01, SUKE_2 0.01) X-MailPropre-MailScanner: Not scanned: please contact your Internet E-Mail Service Provider for details X-MailPropre-MailScanner-ID: 8BDFE1000BB.A1766 X-MailPropre-MailScanner-Information: Please contact the ISP for more information DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=svictor.net ; s=default; h=Content-Transfer-Encoding:Content-Type:MIME-Version:Date: In-reply-to:Message-ID:Subject:To:From:References:Sender:Reply-To:Cc: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=7nssLhtOVNGWRwkPlF5zgHHUnzpF7P2/2M5oqx/Z0hs=; b=V0wZ+UHlw8anQ9bXSBwM4CSo8L p1JJvHHqwk86T+XmMC82yWEpFk5s3dqX5FVNHE9xzSFSa7cfcgwACQQmIxiPcLnaUEQ+G9CaA1MuH o4o/xyu0t+A7iq6eYvQOEtdU5/XzmINFtMHnQJyIBzLJNsvZVRAG+WyEU1HmWxp3D7EU=; References: <87o8cm6kw0.fsf@svictor.net> From: "Victor A. Stoichita" To: emacs-orgmode Subject: Re: viewing appointments while scheduling event Message-ID: <871r9h7qzh.fsf@svictor.net> In-reply-to: <87o8cm6kw0.fsf@svictor.net> Date: Fri, 04 Jun 2021 18:25:56 +0200 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - pam.o2switch.net X-AntiAbuse: Original Domain - gnu.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - svictor.net X-Get-Message-Sender-Via: pam.o2switch.net: authenticated_id: victor@svictor.net X-Authenticated-Sender: pam.o2switch.net: victor@svictor.net X-Source: X-Source-Args: X-Source-Dir: Received-SPF: pass client-ip=109.234.163.29; envelope-from=victor@svictor.net; helo=dun.jabatus.fr 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, 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.23 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" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1622826415; 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: 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=7nssLhtOVNGWRwkPlF5zgHHUnzpF7P2/2M5oqx/Z0hs=; b=fq82wu5q7xfl8ESamKAuWIw2F+GkmSPFFiCiFkDJlMU4YSao3CctPcGqHLnG3dZ4uzHzgE mpdhE3qipOkNOKOep+7cDPSWLDK04TcMrPFIHBi3qXaVvxb1HZeAL3Ic54QSPunMBYGuWZ xgy+azRCCSxgo2FhMDRSCfyFt4dTCf/N104mFMnYoTDUSZqjv+GQm1NY0f94rxKsh1YGim BkhDSPdFec3xsvXQQ12af50jkJwCC+SQAa2MAuUXaEWdvBNtvtn0yCsRAucPTha2yDYZQn KZaBcWH2a0bwS480/2B413lqPQVWk/cj25d+xxveAg0vRhDUdJ9qJY0QmqB3yA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1622826415; a=rsa-sha256; cv=none; b=Apn1pt9gkG8O5S0MSXpyixZDJPE2TmZh5L4nATNAb+3yzZH85yxORYjU1vf/EwWRonw5oY C8Uc9kkk+4tIOPJLnHOJSVFRwXRsqTj8JjTROjnLFcWW+3ECfvixhYzS4lXKSMV86sbyuH oWfeHeH7SV+taS0X9D1jEyrr+uDRntmxwcOhEpZxsX/nwLBa8nCbRRBLcpICPh7SwfO6VY mu5PEjrWDCjw5jOO0lCnGHcuxiiDlu+TBDQDyzXgKwdy0YZG6doQjRpjuUnFjVYc0uhC8e oaI448a3zjdHzvTDFdrutFyOoLXFo6Ypr22AYaE73Cm629iIc+jv/XHqtaGGag== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=svictor.net header.s=default header.b=V0wZ+UHl; dmarc=none; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Spam-Score: -1.43 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=svictor.net header.s=default header.b=V0wZ+UHl; dmarc=none; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Queue-Id: 264D71ADEC X-Spam-Score: -1.43 X-Migadu-Scanner: scn0.migadu.com X-TUID: UapHk5HGTe2q I found something that seems to work. I=E2=80=99m posting it here in case anyone is interested or has better suggestions.=20 First, I understood that my diary file should read: &%%(org-diary) ~/calendriers/victor.org This was clearly explained in the docstring of org-diary (if it was also in the org-mode manual, then I missed it there). With this set, one can hit "!" from the minibuffer while scheduling an event to view the diary for the corresponding date. I found it a bit cumbersome though to hit "!" after each move in the calendar. So I ended up with the following code. Pressing "!" now toggles following the diary when the cursor moves in the calendar. #+begin_src emacs-lisp ;;;;; Follow diary from calendar when scheduling events (defvar-local vic/org-read-date-diary t "Whether to display diary for current calendar date when scheduling an ev= ent from org-mode") (defun vic/org-read-date-calendar-display-diary (&rest arg) "Used as advice after `org-eval-in-calendar'. Display diary for that day = if `vic/org-read-date-diary' is non nil." (when (and vic/org-read-date-diary ;; Check that the cursor was actually moved ;; Otherwise too many calls=20 (member arg '(((calendar-goto-today)) ((calendar-backward-day 1)) ((calendar-forward-day 1)) ((calendar-backward-week 1)) ((calendar-forward-week 1)) ((calendar-backward-month 1)) ((calendar-forward-month 1)) ((calendar-backward-year 1)) ((calendar-forward-year 1))))) (org-eval-in-calendar '(diary-view-entries)) (message ""))) (advice-add 'org-eval-in-calendar :after 'vic/org-read-date-calendar-displa= y-diary) (defun vic/org-read-date-toggle-diary () "Toggle following diary from calendar when scheduling events." (interactive) (if vic/org-read-date-diary (setq vic/org-read-date-diary nil) (setq vic/org-read-date-diary t))) (define-key org-read-date-minibuffer-local-map (kbd "!") 'vic/org-read-date-toggle-diary) #+end_src It=E2=80=99s a bit hackish I suppose, partly because I could not find an ea= sy way to advise the functions in org-read-date-minibuffer-local-map which are all lambdas. But it seems to work. I=E2=80=99m still interested in learning from more advanced setups that peo= ple might have for the same purpose (which is: display existing events for the date that is currently selected in the org-schedule minibuffer/calendar). Cheers Victor