From unknown Sat Jun 21 05:07:35 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#49995 <49995@debbugs.gnu.org> To: bug#49995 <49995@debbugs.gnu.org> Subject: Status: 28.0.50; EBDB Anniversaries do not appear marked in calendar Reply-To: bug#49995 <49995@debbugs.gnu.org> Date: Sat, 21 Jun 2025 12:07:35 +0000 retitle 49995 28.0.50; EBDB Anniversaries do not appear marked in calendar reassign 49995 emacs submitter 49995 Pankaj Jangid severity 49995 normal thanks From debbugs-submit-bounces@debbugs.gnu.org Wed Aug 11 03:13:51 2021 Received: (at submit) by debbugs.gnu.org; 11 Aug 2021 07:13:51 +0000 Received: from localhost ([127.0.0.1]:33136 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mDiQw-0000OB-Qi for submit@debbugs.gnu.org; Wed, 11 Aug 2021 03:13:51 -0400 Received: from lists.gnu.org ([209.51.188.17]:46666) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mDiQv-0000O3-2f for submit@debbugs.gnu.org; Wed, 11 Aug 2021 03:13:50 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46184) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mDiQu-0004K2-SV for bug-gnu-emacs@gnu.org; Wed, 11 Aug 2021 03:13:48 -0400 Received: from mail-pl1-x631.google.com ([2607:f8b0:4864:20::631]:42714) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mDiQs-0000ps-IL for bug-gnu-emacs@gnu.org; Wed, 11 Aug 2021 03:13:48 -0400 Received: by mail-pl1-x631.google.com with SMTP id t3so1458781plg.9 for ; Wed, 11 Aug 2021 00:13:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=codeisgreat-org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=5R6RtDLF+5WOojvh2SphZdAlllYAR4hbciwhG4z1NgU=; b=kl2yDKVQDluCqspEvShxZHfkz5bz77qxHhX3Pmx+pBgl0KW7ljR7vLJwzFLu7V3kTi KiKp5EkXpm6EZtD4S4Y3igRcSqZrTPWLfdJPl6a+v5tTUE5SH31nAC/8Lnq+DPr4C33w mbWYoIHZN9E3Y/aGgNzFTzdoksT5hFw53I+ueOkaQHnFVn5QAUZq3r0enWJolj26vECT 38U9EwMTCqlarSNMj70K1poVFmeSa16n3HY5v7yU0YJW4t06YHID4fijsH3O6jVPwrHt wYRxDqsCKgezB4JAORSs3F4kchbBHMWI2Jl4YUdR+WNympMtpwIB91pjUF24XlCXdHd3 3VKg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=5R6RtDLF+5WOojvh2SphZdAlllYAR4hbciwhG4z1NgU=; b=W83Oy5MUPAsOBeNWBCJlBQ/5idB3IbQl3tJ1fGy1Ny4+x83053rFHnn0Nhz1KSrYRM GJqLtHlN83SdRB9XlCTOxBdQXhdncQhPiLPIb/1TRI43ik/sveusm5wNhjaom4ODp9Er f0jFr13wlHxGfcWbz8gzIRHLxWG9uFhg2TqBQRXPzoyMoyprBUUFAqljTuGXeLNRN6OJ a7WwHvqxSjwsZW4QiP/K89s5CBxbvnaUnyc6Wx818w8SiYz94fM4Bfpg6yix7b7oXUnS GYIGMZhLuilWB+5oI77XCegdhnmaj6yCoTHdvyu9axPGpmWHhtXmJB7Fn5BYZSxgth74 8E3w== X-Gm-Message-State: AOAM530TD3+DUDsgrAw+ORU/XDALyK+ayOw9ASahSBP1oLul0I9lTzgW AKFG2l9ka9yHisVJBHfUkSoWHREdEmkjop1F X-Google-Smtp-Source: ABdhPJyrZR7TnwT/t9gqTLxO48zuiD4esxIejRqfcG6lIQVibz6X+afMNQcEh1IuAP2yRIE1UBaMmQ== X-Received: by 2002:a17:90b:3ec5:: with SMTP id rm5mr8912603pjb.132.1628666024926; Wed, 11 Aug 2021 00:13:44 -0700 (PDT) Received: from mb2.local ([2405:201:5c06:70a7:9d2a:f280:fca9:361a]) by smtp.gmail.com with ESMTPSA id in12sm3562576pjb.5.2021.08.11.00.13.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Aug 2021 00:13:44 -0700 (PDT) From: Pankaj Jangid To: bug-gnu-emacs@gnu.org Subject: 28.0.50; EBDB Anniversaries do not appear marked in calendar Date: Wed, 11 Aug 2021 12:43:39 +0530 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Received-SPF: none client-ip=2607:f8b0:4864:20::631; envelope-from=pankaj@codeisgreat.com; helo=mail-pl1-x631.google.com X-Spam_score_int: -15 X-Spam_score: -1.6 X-Spam_bar: - X-Spam_report: (-1.6 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-Spam-Score: -2.1 (--) X-Debbugs-Envelope-To: submit Cc: Eric Abrahamsen X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.1 (---) Prerequisite: setup EBDB with a few records with anniversaries. Steps: 1. M-x calendar RET 2. m (diary-mark-entries) Result: highlights the entries from diary but doesn=E2=80=99t mark the anniversaries from EBDB. However, pressing =E2=80=98d=E2=80=99 on a date wi= th anniversary shows the day=E2=80=99s calendar with the anniversary. Expectation: Anniversaries from EBDB must also be highlighted when (diary-mark-entries) is invoked. In GNU Emacs 28.0.50 (build 1, x86_64-apple-darwin20.6.0, NS appkit-2022.60= Version 11.5.1 (Build 20G80)) of 2021-08-11 built on mb2.local Repository revision: a8e89964f3553f40b8807617c3b181f42cd22fd9 Repository branch: master Windowing system distributor 'Apple', version 10.3.2022 System Description: macOS 11.5.1 Configured features: ACL DBUS GIF GLIB GMP GNUTLS JPEG JSON LCMS2 LIBXML2 MODULES NOTIFY KQUEUE NS PDUMPER PNG RSVG THREADS TIFF TOOLKIT_SCROLL_BARS XIM ZLIB Important settings: value of $LANG: en_US.UTF-8 locale-coding-system: utf-8-unix Major mode: Info Minor modes in effect: global-company-mode: t company-mode: t shell-dirtrack-mode: t savehist-mode: t desktop-save-mode: t show-paren-mode: t tooltip-mode: t global-eldoc-mode: t electric-indent-mode: t mouse-wheel-mode: t tool-bar-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t buffer-read-only: t column-number-mode: t line-number-mode: t indent-tabs-mode: t transient-mark-mode: t Load-path shadows: /Users/pankaj/.emacs.d/elpa/magit-20210810.800/magit-section-pkg hides /Use= rs/pankaj/.emacs.d/elpa/magit-section-20210806.1607/magit-section-pkg /Users/pankaj/.emacs.d/elpa/transient-20210809.1242/transient hides /Users/= pankaj/Applications/Emacs.app/Contents/Resources/lisp/transient Features: (shadow emacsbug magit-utils dash appt url-http url-gw url-auth smerge-mode diff gnus-html url-cache flow-fill shr-color color mailalias smtpmail flyspell ispell sort smiley gnus-cite mm-archive mail-extr gnus-async gnus-bcklg qp gnus-ml hl-line disp-table cursor-sensor nndraft nnmh utf-7 nnml nnfolder epa-file gnutls network-stream nsm gnus-agent gnus-srvr gnus-score score-mode nnvirtual nntp gnus-cache .gnus cal-persia cal-coptic cal-mayan cal-french cal-move rfc1345 misearch multi-isearch cl-print help-fns radix-tree cus-start compose quail cal-julian org-duration view cal-china lunar solar cal-dst cal-bahai cal-islam cal-hebrew holidays hol-loaddefs cal-iso face-remap org-agenda org-refile vc-dir diary-lib diary-loaddefs sh-script smie executable dired-aux bug-reference conf-mode hideshow vc-mtn vc-hg vc-bzr vc-src vc-sccs vc-svn vc-cvs vc-rcs vc eglot array jsonrpc ert pp ewoc debug backtrace imenu ol-eww eww xdg url-queue mm-url ol-rmail ol-mhe ol-irc ol-info ol-gnus nnselect gnus-search ol-docview doc-view image-mode exif ol-bibtex bibtex ol-bbdb ol-w3m autorevert filenotify checkdoc lisp-mnt vc-git diff-mode vc-dispatcher flymake-proc flymake compile warnings thingatpt elec-pair jka-compr company-oddmuse company-keywords company-etags etags fileloop xref project company-gtags company-dabbrev-code company-dabbrev company-files company-clang company-capf company-cmake company-semantic company-template company-bbdb company init my-init enet org-element avl-tree generator org org-macro org-footnote org-pcomplete org-list org-faces org-entities noutline outline easy-mmode org-version ob-plantuml ob-sql ob-css ob-js ob-java ob-C cc-mode cc-fonts cc-guess cc-menus cc-cmds cc-styles cc-align cc-engine cc-vars cc-defs ob-python python tramp-sh tramp tramp-loaddefs trampver tramp-integration files-x tramp-compat shell pcomplete ls-lisp ob-R ob ob-tangle org-src ob-ref ob-lob ob-table ob-exp ob-comint comint ansi-color ring ob-emacs-lisp ob-core ob-eval org-table ol org-keys org-compat advice org-macs org-loaddefs format-spec server edmacro kmacro modus-operandi-theme modus-themes exec-path-from-shell delight ebdb-message sendmail ebdb-gnus gnus-msg gnus-art mm-uu mml2015 mm-view mml-smime smime dig gnus-sum shr kinsoku svg dom gnus-group gnus-undo gnus-start gnus-dbus dbus xml gnus-cloud nnimap nnmail mail-source utf7 netrc nnoo parse-time iso8601 gnus-spec gnus-int gnus-range message rmc puny dired dired-loaddefs rfc822 mml mml-sec epa derived epg epg-config mm-decode mm-bodies mm-encode mail-parse rfc2231 gmm-utils mailheader gnus-win gnus nnheader gnus-util rmail rmail-loaddefs rfc2047 rfc2045 ietf-drums text-property-search time-date mail-utils mm-util mail-prsvr wid-edit ebdb-mua ebdb-com crm ebdb-format ebdb mailabbrev eieio-opt cl-extra help-mode speedbar ezimage dframe find-func eieio-base pcase cal-menu calendar cal-loaddefs timezone savehist desktop frameset avoid paren cus-load finder-inf tex-site info package browse-url url url-proxy url-privacy url-expand url-methods url-history url-cookie url-domsuf url-util mailcap url-handlers url-parse auth-source cl-seq eieio eieio-core cl-macs eieio-loaddefs password-cache json subr-x map url-vars seq byte-opt gv bytecomp byte-compile cconv cl-loaddefs cl-lib early-init iso-transl tooltip eldoc electric uniquify ediff-hook vc-hooks lisp-float-type mwheel term/ns-win ns-win ucs-normalize mule-util term/common-win tool-bar dnd fontset image regexp-opt fringe tabulated-list replace newcomment text-mode elisp-mode lisp-mode prog-mode register page tab-bar menu-bar rfn-eshadow isearch easymenu timer select scroll-bar mouse jit-lock font-lock syntax font-core term/tty-colors frame minibuffer cl-generic cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese composite charscript charprop case-table epa-hook jka-cmpr-hook help simple abbrev obarray cl-preloaded nadvice button loaddefs faces cus-face macroexp files window text-properties overlay sha1 md5 base64 format env code-pages mule custom widget hashtable-print-readable backquote threads dbusbind kqueue cocoa ns lcms2 multi-tty make-network-process emacs) Memory information: ((conses 16 837741 107231) (symbols 48 45628 3) (strings 32 198620 15218) (string-bytes 1 5983840) (vectors 16 96769) (vector-slots 8 1944827 135657) (floats 8 997 1126) (intervals 56 8961 8042) (buffers 992 72)) --=20 Regards ~Pankaj From debbugs-submit-bounces@debbugs.gnu.org Fri Aug 13 15:35:35 2021 Received: (at 49995) by debbugs.gnu.org; 13 Aug 2021 19:35:35 +0000 Received: from localhost ([127.0.0.1]:43104 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mEcxn-0003Vc-0f for submit@debbugs.gnu.org; Fri, 13 Aug 2021 15:35:35 -0400 Received: from mail.ericabrahamsen.net ([52.70.2.18]:51776) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mEcxh-0003VL-H0 for 49995@debbugs.gnu.org; Fri, 13 Aug 2021 15:35:29 -0400 Received: from localhost (c-71-197-184-122.hsd1.wa.comcast.net [71.197.184.122]) (Authenticated sender: eric@ericabrahamsen.net) by mail.ericabrahamsen.net (Postfix) with ESMTPSA id 0D8E5FA081; Fri, 13 Aug 2021 19:35:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ericabrahamsen.net; s=mail; t=1628883319; bh=DijageD3MawluC+lvVM5rJSpEueP8rzO3ZIKWU+R4ME=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=l3n6RfuKhh/h4XU2h04wLJvZYNqSv3jMFk/RzxYQznok/TvQrc/T5p6hLLVm5c5D6 EI6f7X7KtRm6r9AS/b3ILjZfUW/U3zgWNH7cGE5vlips6doUeLC9eaRQee2YnCOQZ8 mksDv6lnBahkzsZooxaZgH4YREDLX7PIFZljdaCU= From: Eric Abrahamsen To: Pankaj Jangid Subject: Re: bug#49995: 28.0.50; EBDB Anniversaries do not appear marked in calendar References: Date: Fri, 13 Aug 2021 12:35:17 -0700 In-Reply-To: (Pankaj Jangid's message of "Wed, 11 Aug 2021 12:43:39 +0530") Message-ID: <87h7ft5ea2.fsf@ericabrahamsen.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 49995 Cc: 49995@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Pankaj Jangid writes: > Prerequisite: setup EBDB with a few records with anniversaries. > > Steps: > > 1. M-x calendar RET > > 2. m (diary-mark-entries) > > Result: highlights the entries from diary but doesn=E2=80=99t mark the > anniversaries from EBDB. However, pressing =E2=80=98d=E2=80=99 on a date = with > anniversary shows the day=E2=80=99s calendar with the anniversary. > > Expectation: Anniversaries from EBDB must also be highlighted when > (diary-mark-entries) is invoked. Oof, EBDB's diary integration was "write once and back away slowly" code. I'm trying to understand diary-lib.el. So far as I can see, when you add diary entries to `diary-entry-list' that list is consulted when displaying entries for the day at point with "d" (as you note), but the list is ignored by the code that marks days in the calendar, so you don't see anything. I hope I'm wrong about that, but someone would have to tell me how. Another option would be to add something terrible to the `diary-mark-entries-hook', which manually marked the dates somehow. A third option would be switching up the approach altogether, and having EBDB write its own diary file, which can then be included in the user's master diary file. Perhaps that would be the best approach, rather than trying to "plug in" to the diary code at a lower level. From debbugs-submit-bounces@debbugs.gnu.org Sat Aug 14 11:21:19 2021 Received: (at 49995) by debbugs.gnu.org; 14 Aug 2021 15:21:19 +0000 Received: from localhost ([127.0.0.1]:45291 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mEvTK-0004LB-Vc for submit@debbugs.gnu.org; Sat, 14 Aug 2021 11:21:19 -0400 Received: from mout.web.de ([212.227.17.12]:59415) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mEvTF-0004Kt-Ls for 49995@debbugs.gnu.org; Sat, 14 Aug 2021 11:21:17 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=web.de; s=dbaedf251592; t=1628954457; bh=CscxfpxUxN4aGXJ65lQgvq81XBB6LJA7FV+9Hd2xgv0=; h=X-UI-Sender-Class:From:To:Cc:Subject:References:Date:In-Reply-To; b=kHup614pJrwCzVORp/9dBOd+WCZmT1t0zQcHs4nBPev+lU2DStLSGkU36jm4P48wR dBmt4GZTdqrsPiZKaCs3vOni3GUkR3YBjgtEEnMOs7TPxL+KQxV1go9skN14dVZLOw OCgDECmQhEUXT2GTwVeyLx7DLINthznT4EQSq4TU= X-UI-Sender-Class: c548c8c5-30a9-4db5-a2e7-cb6cb037b8f9 Received: from drachen.dragon ([88.66.201.45]) by smtp.web.de (mrweb105 [213.165.67.124]) with ESMTPSA (Nemesis) id 1M9Za2-1m9P9Z1Vdk-005b4E; Sat, 14 Aug 2021 17:20:57 +0200 From: Michael Heerdegen To: Eric Abrahamsen Subject: Re: bug#49995: 28.0.50; EBDB Anniversaries do not appear marked in calendar References: <87h7ft5ea2.fsf@ericabrahamsen.net> Date: Sat, 14 Aug 2021 17:20:56 +0200 In-Reply-To: <87h7ft5ea2.fsf@ericabrahamsen.net> (Eric Abrahamsen's message of "Fri, 13 Aug 2021 12:35:17 -0700") Message-ID: <877dgogihz.fsf@web.de> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K1:SXW7MaZNA+AVffb3mnAtajHwVx+3d8VtJ975LgC6CqH0o4SU7b+ 3iC41Vj8T9Aw0yHuvXbzgSvXANq4c9+IN2jFXROq9eo7EkABJfFC7o+w0Z/s/YDTuHAuXKX x6djyeemPo7nPBxHuUUW/vLEdeWPTNjlbdLsKeu/AgD9jHazoGIG2TG+TpvhxUlB3G/iIb2 YXRV2dlSdrwncFqcdDlcQ== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:KRNfNi4a8yQ=:sXFvJRtirQH7+M0Lh/qE5X iVif8KKg2nE+fD6CGesE3eblZ33Df6MYnKHhKx+7/C7sus2efenRRpfQSRNtBE4PQgTNB5PB4 GhmzFkAHYoP9/5ZODhibEle1g6A3pUp2IeuW/qohXjTrbPX43BPkSXoQezaaztyIaAtuIplho iShw8tNZVP+lnqQ9g9m/NZTQse2RNeeVHOElNC6QC3MqUqyjzojgoSzs9a8rce6hpx2x8fFcH sVPY5qvxgTMKnHDGjhXsNZbxNivZjtQxT40DTTwXa725JuA4aON0cZ7iJGL0zuHAL+PMjbjD/ mvE3PaRC2kg8m200brGGQLy2FRMqRBNR9Honng6qCIAgXAiXl1ayzWEq189y93HDhl1l9Xn2b nikXmDBzo6lldtql1opyansboFgEBu/QVWDhsODV+/iT1uwbcgjbN2k37RYuIWoUrjIO1rKSx hHAPQq/R/g/QvxfBbOECY7jzMKealSQtTL78K2vG0HeBojjaPDtzJ9qeeByNySiauBCAjx1mx TamWkdUAWrAE7mPIMtEjv/pmO5k3a8kRQHZIcyhO7BnzjnrBNKUtgmpQjPGtkREJY0e9ZrabK NVHO1Mfmz/2HxiwzpLn9d0zke77h8KSqLUxq9HEhEVdmzlezDbUVi6zWKd9R2lNToTShyD3wp W2NIjfOo0mRY9LEUwFha4nRgbprWBYFp43tmIu0NSp9h5WY99a7iXZZEmv1hom1BkBWBU65Ht AhSfRmMryP/SGa2/7LebdiHfyglTVjhfb6PDXr/PYOzfMWxbj/jGmfvDK8qAwMKXuy8QtDURG FZ15SsOjWxnhviZnwSX0/8y0J5eOF1N2GBRA0OeDiB7mvSyfaidXBBf/JRnGDyCyURImE8+Xe sKb0VNxA9FTuooIWqRRFuamZwpgo/+D9G05tXRk8kHrtFUv5Kkzt2AQR0a4UOPyoTzZLYR2R0 9zhOr/xQpwYQkOjkzlqmxhtWtrqwkTpayaUGlCRJ5KxcP/jADN53avbLhYATRqiM8edR6Iy8T YUd8QwoeSYfgzWPkWeUcN1Mj0gMbUT/PJMY35IS3ikj2sYpaOllniSk27XguMFM9ftGS0QIhT jR/iRvJdCAg9WBJsAjuqbEUaiV82VxFW64jrWroesivk4Mk7lB9Sn/mBw== X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 49995 Cc: 49995@debbugs.gnu.org, Pankaj Jangid X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Eric Abrahamsen writes: > Oof, EBDB's diary integration was "write once and back away slowly" > code. I'm trying to understand diary-lib.el. So far as I can see, when > you add diary entries to `diary-entry-list' [...] Suggestion: provide a new diary-sexp function, similar to `diary-lunar-phases'. Then marking would be handled by the diary. That function just has to return nil or a string (or a mark and a string) depending on the dynamical variable DATE. That's already the whole diary related part. People then have to add that function as sexp entry to their diary if they want. Michael. From debbugs-submit-bounces@debbugs.gnu.org Sat Aug 14 14:08:31 2021 Received: (at 49995) by debbugs.gnu.org; 14 Aug 2021 18:08:31 +0000 Received: from localhost ([127.0.0.1]:45387 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mEy55-0000ho-CB for submit@debbugs.gnu.org; Sat, 14 Aug 2021 14:08:31 -0400 Received: from mail.ericabrahamsen.net ([52.70.2.18]:50584) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mEy4z-0000hP-QD for 49995@debbugs.gnu.org; Sat, 14 Aug 2021 14:08:25 -0400 Received: from localhost (c-71-197-184-122.hsd1.wa.comcast.net [71.197.184.122]) (Authenticated sender: eric@ericabrahamsen.net) by mail.ericabrahamsen.net (Postfix) with ESMTPSA id 3019DFA08C; Sat, 14 Aug 2021 18:08:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ericabrahamsen.net; s=mail; t=1628964495; bh=kDc2m50wpBAb9io8SWLZ/J+LVmwp7u01v1lodmW+fTg=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=Qrm+RiOBPtquD8P/2exoaooQwq/bSnRNkmfWsqPvEFQyudIwocllBNv6ppznMmFoI TONzTdWD+gGFi3W436eEb+yX8HuDIYjXtWvmEizvTFpRYw7DjDYXLImjbwEwMAIeIT bNyPmUTkssFgIYv0LsOwWZnORtvUljBL0r3o74P0= From: Eric Abrahamsen To: Michael Heerdegen Subject: Re: bug#49995: 28.0.50; EBDB Anniversaries do not appear marked in calendar References: <87h7ft5ea2.fsf@ericabrahamsen.net> <877dgogihz.fsf@web.de> Date: Sat, 14 Aug 2021 11:08:13 -0700 In-Reply-To: <877dgogihz.fsf@web.de> (Michael Heerdegen's message of "Sat, 14 Aug 2021 17:20:56 +0200") Message-ID: <87y293527m.fsf@ericabrahamsen.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 49995 Cc: 49995@debbugs.gnu.org, Pankaj Jangid X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Michael Heerdegen writes: > Eric Abrahamsen writes: > >> Oof, EBDB's diary integration was "write once and back away slowly" >> code. I'm trying to understand diary-lib.el. So far as I can see, when >> you add diary entries to `diary-entry-list' [...] > > Suggestion: provide a new diary-sexp function, similar to > `diary-lunar-phases'. Then marking would be handled by the diary. > > That function just has to return nil or a string (or a mark and a > string) depending on the dynamical variable DATE. That's already the > whole diary related part. People then have to add that function as sexp > entry to their diary if they want. Oh, huh: sort of inverting the prior approach. I find all this a little confusing, I've never spent any time with the diary, and its integration with Org always seemed very mysterious to me. But I do think the calendar integration is very useful. So the idea is that there would be a `ebdb-diary-anniversaries' function, that looks sort of like: (defun ebdb-diary-anniversaries (&optional mark) (with-suppressed-warnings ((lexical date)) (defvar date)) (when-let ((anniv-today (ebdb-get-anniversaries-for-date date))) (cons mark (mapconcat #'identity anniv-today "\n")))) Something like that, anyway, and then users put %%(ebdb-diary-anniversaries) In their diary file? And that would get called once per visible date, so potentially a whole lot, so `ebdb-get-anniversaries-for-date' should be quick... Anyway, thanks for this alternate suggestion! This wouldn't have occurred to me. Eric From debbugs-submit-bounces@debbugs.gnu.org Sun Aug 15 00:01:38 2021 Received: (at 49995) by debbugs.gnu.org; 15 Aug 2021 04:01:38 +0000 Received: from localhost ([127.0.0.1]:45583 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mF7L7-00063b-Q3 for submit@debbugs.gnu.org; Sun, 15 Aug 2021 00:01:38 -0400 Received: from mail.ericabrahamsen.net ([52.70.2.18]:33928) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mF7L5-00063N-Ck for 49995@debbugs.gnu.org; Sun, 15 Aug 2021 00:01:36 -0400 Received: from localhost (c-71-197-184-122.hsd1.wa.comcast.net [71.197.184.122]) (Authenticated sender: eric@ericabrahamsen.net) by mail.ericabrahamsen.net (Postfix) with ESMTPSA id 7E4DAFA08C; Sun, 15 Aug 2021 04:01:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ericabrahamsen.net; s=mail; t=1629000089; bh=4v0Hh7fsyVdKqyI/16dagw2Se6DKNOqJg1BJliJxuKA=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=abYz+NeRiLvtZgunb0PP0YhzlFf1+rd2sd+Ut+2cRG6BK+EaHLzFgytJOQMvotzqu oBFGPtNHziZUExRWDRl+USsNRRog8tZWzQprOxIl+VBP4J3L3kMX47GkK0yNWxJIl2 PUiXbkYg/hIoHwEQz2SYVXcbDz6/w0hXJ0hamS90= From: Eric Abrahamsen To: Michael Heerdegen Subject: Re: bug#49995: 28.0.50; EBDB Anniversaries do not appear marked in calendar References: <87h7ft5ea2.fsf@ericabrahamsen.net> <877dgogihz.fsf@web.de> <87y293527m.fsf@ericabrahamsen.net> Date: Sat, 14 Aug 2021 21:01:27 -0700 In-Reply-To: <87y293527m.fsf@ericabrahamsen.net> (Eric Abrahamsen's message of "Sat, 14 Aug 2021 11:08:13 -0700") Message-ID: <87bl5zxso8.fsf@ericabrahamsen.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 49995 Cc: 49995@debbugs.gnu.org, Pankaj Jangid X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) --=-=-= Content-Type: text/plain Eric Abrahamsen writes: > Michael Heerdegen writes: > >> Eric Abrahamsen writes: >> >>> Oof, EBDB's diary integration was "write once and back away slowly" >>> code. I'm trying to understand diary-lib.el. So far as I can see, when >>> you add diary entries to `diary-entry-list' [...] >> >> Suggestion: provide a new diary-sexp function, similar to >> `diary-lunar-phases'. Then marking would be handled by the diary. >> >> That function just has to return nil or a string (or a mark and a >> string) depending on the dynamical variable DATE. That's already the >> whole diary related part. People then have to add that function as sexp >> entry to their diary if they want. > > Oh, huh: sort of inverting the prior approach. I find all this a little > confusing, I've never spent any time with the diary, and its integration > with Org always seemed very mysterious to me. But I do think the > calendar integration is very useful. Okay, here's a version of how it might work. I've learned a little bit more about the diary (and as a result will likely use it more! I'd always thought it was just a poor cousin to Org, but I see it has its own strengths), and have a solution that is a bit funky, but might be okay. If Michael or anyone with a better understanding of diary than me would comment on this, I'd very much appreciate it. So the user puts "%%(ebdb-diary-anniversaries)" as a sexp in their diary. That function gets called in two situations: marking dates in the calendar (it gets called *many* times but only has to return a boolean), and listing diary entries for a particular date (it only gets called once, but has to produce more detailed information). The function checks (bound-and-true-p 'original-date) to know which situation it's in. At load time EBDB builds some prep data in a hash table, and that data feels messy, but the strategy is to do a medium amount of work at load time, the absolute minimum amount of work when marking dates in the *Calendar* (essentially checks "does this hash key have a value"), and again a medium amount of work when displaying diary entries for a particular day. I would love some feedback on this! Eric --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=rework-ebdb-diary-anniversaries.diff diff --git a/ebdb.el b/ebdb.el index d3b7d9480a..b5075dfb86 100644 --- a/ebdb.el +++ b/ebdb.el @@ -282,6 +282,10 @@ do not set this to nil." "Customizations for EBDB utilities." :group 'ebdb) +(defgroup ebdb-utilities-anniv nil + "Customizations for EBDB anniversaries." + :group 'ebdb) + (defgroup ebdb-utilities-dialing nil "EBDB customizations for phone number dialing." :group 'ebdb-utilities) @@ -373,6 +377,10 @@ Emacs, always query before reverting." :group 'ebdb-utilities-anniv :type 'boolean) +(make-obsolete-variable + 'ebdb-use-diary + "Add %%(ebdb-diary-anniversaries) to your diary file instead" "0.8") + (defcustom ebdb-anniversary-md-format "%B %d" "Format string used for displaying month-day anniversary dates. See the docstring of `format-time-string' for the meaning of @@ -389,26 +397,12 @@ month, and day values are available." :group 'ebdb-utilities-anniv :type 'string) -(defvar ebdb-diary-entries nil - "A list of all anniversary diary entries. -Entries are added and removed in the `ebdb-init-field' and -`ebdb-delete-field' methods of the `ebdb-field-anniversary' -class, and added with the `ebdb-diary-add-entries' function. - -Each entry is a two-element list: a string representation of the -anniversary date, and the sexp (as a string): - -\(diary-anniversary MM DD YYYY) (the year is optional)") - -;; Dynamic var needed by `diary-sexp-entry'. -(defvar original-date) - -(defun ebdb-diary-add-entries () - "Add anniversaries from EBDB to the diary." - (pcase-dolist (`(,entry ,sexp) ebdb-diary-entries) - (let ((parsed (cdr-safe (diary-sexp-entry sexp entry original-date)))) - (when parsed - (diary-add-to-list original-date parsed sexp))))) +(defvar ebdb-diary-entries (make-hash-table :test #'equal) + "Hash table holding anniversary entries for the diary. +Keys are dates in the format (MONTH DAY YEAR), values are lists +of anniversary strings. Instances of `ebdb-field-anniversary' +fields can push descriptive strings into the hash entries for +their dates. Also see `ebdb-diary-anniversaries'.") (defcustom ebdb-before-load-hook nil "Hook run before loading databases." @@ -2199,12 +2193,31 @@ Eventually this method will go away." (list month day year)) obj))) +(defun ebdb-diary-anniversaries (&optional mark) + (with-no-warnings + (defvar date) + (defvar original-date)) + (when-let ((entries (gethash (seq-subseq date 0 2) ebdb-diary-entries))) + (cons mark + (mapconcat (pcase-lambda (`(,entry ,sexp)) + (if (bound-and-true-p original-date) + ;; If we have `original-date', we're + ;; displaying the diary list, so we need + ;; the detailed string. + (cdr (diary-sexp-entry + sexp entry original-date)) + ;; If not, we're just marking dates on the + ;; calendar, so any non-nil response value is + ;; fine. + entry)) + entries "; ")))) + ;; `ebdb-field-anniv-diary-entry' is defined below. (cl-defmethod ebdb-init-field ((anniv ebdb-field-anniversary) record) - (when ebdb-use-diary - (add-to-list - 'ebdb-diary-entries - (ebdb-field-anniv-diary-entry anniv record)))) + (let ((diary-entry (ebdb-field-anniv-diary-entry anniv record)) + (date (seq-subseq (slot-value anniv 'date) + 0 2))) + (push diary-entry (gethash date ebdb-diary-entries)))) (cl-defmethod ebdb-string ((ann ebdb-field-anniversary)) (let* ((date (slot-value ann 'date)) @@ -2226,11 +2239,17 @@ Eventually this method will go away." (cl-defmethod ebdb-delete-field ((anniv ebdb-field-anniversary) record &optional _unload) - (when ebdb-use-diary - (setq - ebdb-diary-entries - (delete (ebdb-field-anniv-diary-entry anniv record) - ebdb-diary-entries)))) + (let ((entry-car (car (ebdb-field-anniv-diary-entry anniv record))) + (date (seq-subseq (slot-value anniv 'date) + 0 2))) + (puthash date + (seq-remove (lambda (e) + ;; Use the car of the entry (the text with + ;; the record's name in it) as a key for + ;; removing the whole entry. + (equal entry-car (car e))) + (gethash date ebdb-diary-entries)) + ebdb-diary-entries))) ;;; Id field @@ -3219,18 +3238,17 @@ If FIELD doesn't specify a year, use the current year." (cl-defmethod ebdb-field-anniv-diary-entry ((field ebdb-field-anniversary) (record ebdb-record)) - "Add a diary entry for FIELD's date." - (let ((cal-date (slot-value field 'date))) + "Produce a diary entry for FIELD's date. +The return value is added to `ebdb-diary-entries' in the init +method for the field, and tailored for consumption by +`ebdb-diary-anniversaries'." + (pcase-let ((`(,month ,day ,year) (slot-value field 'date))) (list (concat (format "%s's " (ebdb-string record)) - (if (nth 2 cal-date) - "%d%s " - "%s ") + (if year "%d%s " "") (slot-value field 'label)) - (apply #'format (if (nth 2 cal-date) - "(diary-anniversary %s %s %s)" - "(diary-anniversary %s %s)") - cal-date)))) + (format "(diary-anniversary %s %s%s)" + month day (if year (format " %s" year) ""))))) ;;; `ebdb-record' subclasses @@ -4338,6 +4356,7 @@ process.") ebdb-record-tracker nil) (clrhash ebdb-org-hashtable) (clrhash ebdb-hashtable) + (clrhash ebdb-diary-entries) (clrhash ebdb-relation-hashtable)) ;; Changing which database a record belongs to. @@ -5372,8 +5391,6 @@ All the important work is done by the `ebdb-db-load' method." (cons db-file-regexp 'lisp-data-mode) auto-mode-alist)) (run-hooks 'ebdb-after-load-hook) - (when ebdb-use-diary - (add-hook 'diary-list-entries-hook #'ebdb-diary-add-entries)) (add-hook 'kill-emacs-hook #'ebdb-save-on-emacs-exit) (length ebdb-record-tracker))) --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Sun Aug 15 09:18:47 2021 Received: (at 49995) by debbugs.gnu.org; 15 Aug 2021 13:18:47 +0000 Received: from localhost ([127.0.0.1]:46126 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mFG2F-0002bT-6k for submit@debbugs.gnu.org; Sun, 15 Aug 2021 09:18:47 -0400 Received: from mout.web.de ([217.72.192.78]:51835) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mFG29-0002bB-9l for 49995@debbugs.gnu.org; Sun, 15 Aug 2021 09:18:42 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=web.de; s=dbaedf251592; t=1629033499; bh=Ve0ESEUit5f81fGZ6xK5u0SxNhxzdT5t2qQl3LhdMKw=; h=X-UI-Sender-Class:From:To:Cc:Subject:References:Date:In-Reply-To; b=Txm8U3UZqC6/YesgEto6hT27JCz5QnBf7vu8reFWQAqYoi5+bML/BjBeI0ReUdrnu Cn9K3SMJ34RfSN+iJG5gGwN/xMafcanEh4fzPmkbEGKkjk30hL1LFLumWCTGahI4iW m7QV0naUXdLifKnmND3VXDwnsX8ehPuZodpUVtA4= X-UI-Sender-Class: c548c8c5-30a9-4db5-a2e7-cb6cb037b8f9 Received: from drachen.dragon ([88.66.201.45]) by smtp.web.de (mrweb105 [213.165.67.124]) with ESMTPSA (Nemesis) id 1MsrdC-1n44OZ31SK-00t8eT; Sun, 15 Aug 2021 15:18:19 +0200 From: Michael Heerdegen To: Eric Abrahamsen Subject: Re: bug#49995: 28.0.50; EBDB Anniversaries do not appear marked in calendar References: <87h7ft5ea2.fsf@ericabrahamsen.net> <877dgogihz.fsf@web.de> <87y293527m.fsf@ericabrahamsen.net> <87bl5zxso8.fsf@ericabrahamsen.net> Date: Sun, 15 Aug 2021 15:18:18 +0200 In-Reply-To: <87bl5zxso8.fsf@ericabrahamsen.net> (Eric Abrahamsen's message of "Sat, 14 Aug 2021 21:01:27 -0700") Message-ID: <871r6uhmn9.fsf@web.de> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K1:7i8wzMDoRuUt8WiDIpdjNj8jdAfK2gJGFdyn/5XQu2Tudq/BYiY j7uj+/3fT3c+xdeRphcqVM3cHN8lPsb1fV3VG+1uSN3AP3Q2IQ9OkADAcibfksXrSbxhFYq tXKVu4NpQQO1C4eUjPW2MedDHAfQtXyPCH9xMi7V6txfH14t5dj6QaecaaL7ptwUnQ11ohG v+pDFwRireie5Jd06v0oA== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:HKAhupTIbjs=:4hpzs9LG7IczEnUx4WGG+S OOB0L5aMwpDIo46xWAHatov5UVrMd+OfCxqj10V4X/ZqREeNlaLwcPo4/Sz1NFpOJwpQGktNS GbJmJAWP1ihOcf5el1sz0L7VxLm7hknccn2DUEM9+o07Ug5mOPb8aX2+F9EvCMXCCQEt+1rkU Y58Z7Ld4nJRd0kH/CWErqF7AkjcJQ/ZWU2R6d6coAoWLoRVHkV8e8pMi2mUVuuysN4irSM4xE J5oRdXwskp9aXDu28gCyD7eNVN0aYdXvlHu2OSL247ulfW5SlGWYFpvFDcJfLaGww01gcw4jm 3UpLxFj1H4V8YsmJm+abWLpi+yQueBJTxX7QHpN4OuFc7DldMTjb0uIiJLos+uc/3xlq/HPYT PQc7rzxAIkV6j8SvFsqKr5croaplCAdysQUKpzowuH8/GnYzCxibC3AnOWIE3YrjmOhFnA1Gy 5X5lVjglmU1v4z5TqjOlWRL7EOeOcaoofAGaHAZI2pihKK4ktw6iUbYbhK1mxStAHFjKR0PKj 1uKDQykYNLJzU+iNSoX+eet5Le04r5WH+ZvqweMTi8uFtSR46eBw7pp0xtCkOSCXwyNvFtN7V xw4lOetiFtAbOSP8Ukgz/GrZSW8hnuGRv8CjOb/Jpi+TznsBsQQje4zByZXcfjr0gDhgkS+dP ZVFIgvXGlvSb/3zwyb8gz25W67BvWVCk7oCEn4qOgwdYuwsHVdA5cTpkfzVCGrgoPaKCkJyZ4 doETXChhBI3eyx8ov/GMXn7R1NdFXZNt/ZyUaX5jx28KXi3DQo8TIhBKNFKAP+oRjwE3/pzNp Y6h7ZDIuQ7u+VMV9GdvuzDr1Mg/SzV7EDhAXHeVusqJvXhYgkfNE1UqoCqxRE3GNlCZOWa3ip MqKiIPegqgVurdlIAAoAtMmdrCEJIG2LH+lu9kb6gIrJakJ3TjGwpdupAoZVKc/7PmAa5Qgwk DGQvlGhGOdmvwFIocOJ/tev6bJnMZiNTZvB4IIezeA2FCfberqjBHJA0uwchGon8/5F8oEAqw xAcG2vkh8ukSkBf/UqdHubkLlSJhdPCmkvck+/zCfb4JIQFq2/TCzN9Mglh5CjVEEmm2qxtJN s6A61KZsDxgGTlCs+41RSJ+oxnXfjPfOgB1IWR33PB5bbklPkYbrO4lMw== X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 49995 Cc: 49995@debbugs.gnu.org, Pankaj Jangid X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) Eric Abrahamsen writes: > Okay, here's a version of how it might work. I've learned a little bit > more about the diary (and as a result will likely use it more! I'd > always thought it was just a poor cousin to Org, but I see it has its > own strengths), and have a solution that is a bit funky, but might be > okay. Looks quite good. I would try to get rid of `diary-anniversary'. All it does is checking the date and calling `format' - things that you already do. You now effectively get `eval' inside `eval' when calling `diary', you have an extra layer. I hope removing that will also get rid of the need to look at `original-date'. [BTW: The only nontrivial thing `diary-anniversary' does is handling of birthdays on 2/28, you may want to have a look if you need to handle that case specially.] Regards, Michael. From debbugs-submit-bounces@debbugs.gnu.org Sun Aug 15 10:28:46 2021 Received: (at 49995) by debbugs.gnu.org; 15 Aug 2021 14:28:46 +0000 Received: from localhost ([127.0.0.1]:47568 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mFH82-00072W-L8 for submit@debbugs.gnu.org; Sun, 15 Aug 2021 10:28:46 -0400 Received: from mail.ericabrahamsen.net ([52.70.2.18]:46184) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mFH81-00072J-6o for 49995@debbugs.gnu.org; Sun, 15 Aug 2021 10:28:46 -0400 Received: from localhost (c-71-197-184-122.hsd1.wa.comcast.net [71.197.184.122]) (Authenticated sender: eric@ericabrahamsen.net) by mail.ericabrahamsen.net (Postfix) with ESMTPSA id A1C36FA07F; Sun, 15 Aug 2021 14:28:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ericabrahamsen.net; s=mail; t=1629037718; bh=SbfkTxVfKSIFZ8h9lOIl69/SqjhOZ3utggZMzQA7cQI=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=WVk3YDRrJHZ0EWTdb7qfD2VkWcBnrAEy3NvatMQxXBL/1e0athrf/UNkjErScjMzY OaXo8d3/y3B1bB3XQ+oK493NRmmAUmxDvzSrntwGL6bU5jJJ11jo+Qqcuwc8HusbWP Eoe16Tar4u1NL0xTtck5ppDdHQSfwkA1YyiqpDQQ= From: Eric Abrahamsen To: Michael Heerdegen Subject: Re: bug#49995: 28.0.50; EBDB Anniversaries do not appear marked in calendar References: <87h7ft5ea2.fsf@ericabrahamsen.net> <877dgogihz.fsf@web.de> <87y293527m.fsf@ericabrahamsen.net> <87bl5zxso8.fsf@ericabrahamsen.net> <871r6uhmn9.fsf@web.de> Date: Sun, 15 Aug 2021 07:28:37 -0700 In-Reply-To: <871r6uhmn9.fsf@web.de> (Michael Heerdegen's message of "Sun, 15 Aug 2021 15:18:18 +0200") Message-ID: <87y292wzmy.fsf@ericabrahamsen.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 49995 Cc: 49995@debbugs.gnu.org, Pankaj Jangid X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) On 08/15/21 15:18 PM, Michael Heerdegen wrote: > Eric Abrahamsen writes: > >> Okay, here's a version of how it might work. I've learned a little bit >> more about the diary (and as a result will likely use it more! I'd >> always thought it was just a poor cousin to Org, but I see it has its >> own strengths), and have a solution that is a bit funky, but might be >> okay. > > Looks quite good. Thanks for checking! > I would try to get rid of `diary-anniversary'. All it does is checking > the date and calling `format' - things that you already do. You now > effectively get `eval' inside `eval' when calling `diary', you have an > extra layer. I hope removing that will also get rid of the need to look > at `original-date'. > > [BTW: The only nontrivial thing `diary-anniversary' does is handling of > birthdays on 2/28, you may want to have a look if you need to handle > that case specially.] It seems to me that it isn't `diary-anniversary' that needs to be gotten rid of, so much as `diary-sexp-entry' -- that's the function that's basically just eval'ling a string. If I get rid of `diary-anniversary', I'll basically just end up re-writing it. At init time, instead of building up strings, I could just build up closures holding the appropriate dynamic value for DATE and ENTRY, and calling `diary-anniversary': essentially replace `diary-sexp-entry'. That's at least one less layer. I can get rid of the check for `original-date', but I'd still like to know if we're in a calendar-marking situation vs a listing-the-diary situation: how else would I do that? Thanks again, Eric From debbugs-submit-bounces@debbugs.gnu.org Sun Aug 15 11:58:19 2021 Received: (at 49995) by debbugs.gnu.org; 15 Aug 2021 15:58:19 +0000 Received: from localhost ([127.0.0.1]:47609 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mFIWd-000365-Hy for submit@debbugs.gnu.org; Sun, 15 Aug 2021 11:58:19 -0400 Received: from mail.ericabrahamsen.net ([52.70.2.18]:47846) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mFIWY-00035o-3a for 49995@debbugs.gnu.org; Sun, 15 Aug 2021 11:58:14 -0400 Received: from localhost (c-71-197-184-122.hsd1.wa.comcast.net [71.197.184.122]) (Authenticated sender: eric@ericabrahamsen.net) by mail.ericabrahamsen.net (Postfix) with ESMTPSA id BB05BFA07F; Sun, 15 Aug 2021 15:58:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ericabrahamsen.net; s=mail; t=1629043084; bh=wOT8b/6qWawZW3IGMRqBFv+hSEeY2eCHY+F3FtgJw2M=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=dJO204V6pFXdjStB0tRsRNpRQWqIgfMlXoAA8v6pmglV+hoLh5FvV7eQ772k4xuJV 56vML7JFfhVVWsIH6CAgpNQoZJTKoi2NeaxzBDo89dxUF+nMXzG/xDH68lLl3hxAS3 /AVq3mFS4scTWubkZuC5rPbXXen9puVf5ddYzAwM= From: Eric Abrahamsen To: Michael Heerdegen Subject: Re: bug#49995: 28.0.50; EBDB Anniversaries do not appear marked in calendar References: <87h7ft5ea2.fsf@ericabrahamsen.net> <877dgogihz.fsf@web.de> <87y293527m.fsf@ericabrahamsen.net> <87bl5zxso8.fsf@ericabrahamsen.net> <871r6uhmn9.fsf@web.de> <87y292wzmy.fsf@ericabrahamsen.net> Date: Sun, 15 Aug 2021 08:57:50 -0700 In-Reply-To: <87y292wzmy.fsf@ericabrahamsen.net> (Eric Abrahamsen's message of "Sun, 15 Aug 2021 07:28:37 -0700") Message-ID: <87tujqwvi9.fsf@ericabrahamsen.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 49995 Cc: 49995@debbugs.gnu.org, Pankaj Jangid X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) --=-=-= Content-Type: text/plain On 08/15/21 07:28 AM, Eric Abrahamsen wrote: > On 08/15/21 15:18 PM, Michael Heerdegen wrote: >> Eric Abrahamsen writes: >> >>> Okay, here's a version of how it might work. I've learned a little bit >>> more about the diary (and as a result will likely use it more! I'd >>> always thought it was just a poor cousin to Org, but I see it has its >>> own strengths), and have a solution that is a bit funky, but might be >>> okay. >> >> Looks quite good. > > Thanks for checking! > >> I would try to get rid of `diary-anniversary'. All it does is checking >> the date and calling `format' - things that you already do. You now >> effectively get `eval' inside `eval' when calling `diary', you have an >> extra layer. I hope removing that will also get rid of the need to look >> at `original-date'. >> >> [BTW: The only nontrivial thing `diary-anniversary' does is handling of >> birthdays on 2/28, you may want to have a look if you need to handle >> that case specially.] > > It seems to me that it isn't `diary-anniversary' that needs to be gotten > rid of, so much as `diary-sexp-entry' -- that's the function that's > basically just eval'ling a string. If I get rid of `diary-anniversary', > I'll basically just end up re-writing it. > > At init time, instead of building up strings, I could just build up > closures holding the appropriate dynamic value for DATE and ENTRY, and > calling `diary-anniversary': essentially replace `diary-sexp-entry'. > That's at least one less layer. Just for fun, here's a version with closures. The need for `calendar-dlet' (or something that does that job) is unfortunate, and maybe sufficient argument for writing my own version of `diary-anniversary'. But this was a fun experiment in understanding lexical binding and closures. --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=ebdb-diary-closures.diff diff --git a/ebdb.el b/ebdb.el index d3b7d9480a..7ffe41e097 100644 --- a/ebdb.el +++ b/ebdb.el @@ -282,6 +282,10 @@ do not set this to nil." "Customizations for EBDB utilities." :group 'ebdb) +(defgroup ebdb-utilities-anniv nil + "Customizations for EBDB anniversaries." + :group 'ebdb) + (defgroup ebdb-utilities-dialing nil "EBDB customizations for phone number dialing." :group 'ebdb-utilities) @@ -373,6 +377,10 @@ Emacs, always query before reverting." :group 'ebdb-utilities-anniv :type 'boolean) +(make-obsolete-variable + 'ebdb-use-diary + "Add %%(ebdb-diary-anniversaries) to your diary file instead" "0.8") + (defcustom ebdb-anniversary-md-format "%B %d" "Format string used for displaying month-day anniversary dates. See the docstring of `format-time-string' for the meaning of @@ -389,26 +397,12 @@ month, and day values are available." :group 'ebdb-utilities-anniv :type 'string) -(defvar ebdb-diary-entries nil - "A list of all anniversary diary entries. -Entries are added and removed in the `ebdb-init-field' and -`ebdb-delete-field' methods of the `ebdb-field-anniversary' -class, and added with the `ebdb-diary-add-entries' function. - -Each entry is a two-element list: a string representation of the -anniversary date, and the sexp (as a string): - -\(diary-anniversary MM DD YYYY) (the year is optional)") - -;; Dynamic var needed by `diary-sexp-entry'. -(defvar original-date) - -(defun ebdb-diary-add-entries () - "Add anniversaries from EBDB to the diary." - (pcase-dolist (`(,entry ,sexp) ebdb-diary-entries) - (let ((parsed (cdr-safe (diary-sexp-entry sexp entry original-date)))) - (when parsed - (diary-add-to-list original-date parsed sexp))))) +(defvar ebdb-diary-entries (make-hash-table :test #'equal) + "Hash table holding anniversary entries for the diary. +Keys are dates in the format (MONTH DAY YEAR), values are lists +of anniversary strings. Instances of `ebdb-field-anniversary' +fields can push descriptive strings into the hash entries for +their dates. Also see `ebdb-diary-anniversaries'.") (defcustom ebdb-before-load-hook nil "Hook run before loading databases." @@ -2199,12 +2193,30 @@ Eventually this method will go away." (list month day year)) obj))) +(defun ebdb-diary-anniversaries (&optional mark) + (with-no-warnings + (defvar date) + (defvar original-date)) + (when-let ((entries (gethash (seq-subseq date 0 2) ebdb-diary-entries))) + (cons mark + (mapconcat (pcase-lambda (`(,entry ,form)) + (if (bound-and-true-p original-date) + ;; If we have `original-date', we're + ;; displaying the diary list, so we need + ;; the detailed string. + (funcall form) + ;; If not, we're just marking dates on the + ;; calendar, so any non-nil response value is + ;; fine. + entry)) + entries "; ")))) + ;; `ebdb-field-anniv-diary-entry' is defined below. (cl-defmethod ebdb-init-field ((anniv ebdb-field-anniversary) record) - (when ebdb-use-diary - (add-to-list - 'ebdb-diary-entries - (ebdb-field-anniv-diary-entry anniv record)))) + (let ((diary-entry (ebdb-field-anniv-diary-entry anniv record)) + (date (seq-subseq (slot-value anniv 'date) + 0 2))) + (push diary-entry (gethash date ebdb-diary-entries)))) (cl-defmethod ebdb-string ((ann ebdb-field-anniversary)) (let* ((date (slot-value ann 'date)) @@ -2226,11 +2238,17 @@ Eventually this method will go away." (cl-defmethod ebdb-delete-field ((anniv ebdb-field-anniversary) record &optional _unload) - (when ebdb-use-diary - (setq - ebdb-diary-entries - (delete (ebdb-field-anniv-diary-entry anniv record) - ebdb-diary-entries)))) + (let ((entry-car (car (ebdb-field-anniv-diary-entry anniv record))) + (date (seq-subseq (slot-value anniv 'date) + 0 2))) + (puthash date + (seq-remove (lambda (e) + ;; Use the car of the entry (the text with + ;; the record's name in it) as a key for + ;; removing the whole entry. + (equal entry-car (car e))) + (gethash date ebdb-diary-entries)) + ebdb-diary-entries))) ;;; Id field @@ -3219,18 +3237,19 @@ If FIELD doesn't specify a year, use the current year." (cl-defmethod ebdb-field-anniv-diary-entry ((field ebdb-field-anniversary) (record ebdb-record)) - "Add a diary entry for FIELD's date." - (let ((cal-date (slot-value field 'date))) - (list (concat (format "%s's " - (ebdb-string record)) - (if (nth 2 cal-date) - "%d%s " - "%s ") - (slot-value field 'label)) - (apply #'format (if (nth 2 cal-date) - "(diary-anniversary %s %s %s)" - "(diary-anniversary %s %s)") - cal-date)))) + "Produce a diary entry for FIELD's date. +The return value is added to `ebdb-diary-entries' in the init +method for the field, and tailored for consumption by +`ebdb-diary-anniversaries'." + (pcase-let* ((`(,month ,day ,year) (slot-value field 'date)) + (entry (concat (format "%s's " + (ebdb-string record)) + (if year "%d%s " "") + (slot-value field 'label)))) + (list entry + (lambda () + (calendar-dlet ((entry entry)) + (cdr (diary-anniversary month day year))))))) ;;; `ebdb-record' subclasses @@ -4338,6 +4357,7 @@ process.") ebdb-record-tracker nil) (clrhash ebdb-org-hashtable) (clrhash ebdb-hashtable) + (clrhash ebdb-diary-entries) (clrhash ebdb-relation-hashtable)) ;; Changing which database a record belongs to. @@ -5372,8 +5392,6 @@ All the important work is done by the `ebdb-db-load' method." (cons db-file-regexp 'lisp-data-mode) auto-mode-alist)) (run-hooks 'ebdb-after-load-hook) - (when ebdb-use-diary - (add-hook 'diary-list-entries-hook #'ebdb-diary-add-entries)) (add-hook 'kill-emacs-hook #'ebdb-save-on-emacs-exit) (length ebdb-record-tracker))) --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Sun Aug 15 16:17:07 2021 Received: (at 49995) by debbugs.gnu.org; 15 Aug 2021 20:17:08 +0000 Received: from localhost ([127.0.0.1]:47833 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mFMZ9-0005cR-Di for submit@debbugs.gnu.org; Sun, 15 Aug 2021 16:17:07 -0400 Received: from mail.ericabrahamsen.net ([52.70.2.18]:53704) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mFMZ7-0005bM-Q7 for 49995@debbugs.gnu.org; Sun, 15 Aug 2021 16:17:06 -0400 Received: from localhost (c-71-197-184-122.hsd1.wa.comcast.net [71.197.184.122]) (Authenticated sender: eric@ericabrahamsen.net) by mail.ericabrahamsen.net (Postfix) with ESMTPSA id 4EE02FA086; Sun, 15 Aug 2021 20:16:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ericabrahamsen.net; s=mail; t=1629058619; bh=aSisskUWGpsWsyEINPakkAdI5++Yc7VUB32f54tf13c=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=Pp3kgr9XaifWjtlLg887nmkGBcDerjW5i2/qiaTOj2ThvJRhpCociuNVp0CFOm9MG W5zEhvOJe7ATKOMHFB0RuFLnA/AEXkkO8Sv4y3IV8Moqo9hfqZszi6eMK4tppoXbHb G8vl9u/1Q3hotGMli+/6Pccw2x5x2OgIXlxdQKWM= From: Eric Abrahamsen To: Michael Heerdegen Subject: Re: bug#49995: 28.0.50; EBDB Anniversaries do not appear marked in calendar References: <87h7ft5ea2.fsf@ericabrahamsen.net> <877dgogihz.fsf@web.de> <87y293527m.fsf@ericabrahamsen.net> <87bl5zxso8.fsf@ericabrahamsen.net> <871r6uhmn9.fsf@web.de> <87y292wzmy.fsf@ericabrahamsen.net> <87tujqwvi9.fsf@ericabrahamsen.net> Date: Sun, 15 Aug 2021 13:16:57 -0700 In-Reply-To: <87tujqwvi9.fsf@ericabrahamsen.net> (Eric Abrahamsen's message of "Sun, 15 Aug 2021 08:57:50 -0700") Message-ID: <87k0kmwjie.fsf@ericabrahamsen.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 49995 Cc: 49995@debbugs.gnu.org, Pankaj Jangid X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) --=-=-= Content-Type: text/plain On 08/15/21 08:57 AM, Eric Abrahamsen wrote: > On 08/15/21 07:28 AM, Eric Abrahamsen wrote: >> On 08/15/21 15:18 PM, Michael Heerdegen wrote: >>> Eric Abrahamsen writes: >>> >>>> Okay, here's a version of how it might work. I've learned a little bit >>>> more about the diary (and as a result will likely use it more! I'd >>>> always thought it was just a poor cousin to Org, but I see it has its >>>> own strengths), and have a solution that is a bit funky, but might be >>>> okay. >>> >>> Looks quite good. >> >> Thanks for checking! >> >>> I would try to get rid of `diary-anniversary'. All it does is checking >>> the date and calling `format' - things that you already do. You now >>> effectively get `eval' inside `eval' when calling `diary', you have an >>> extra layer. I hope removing that will also get rid of the need to look >>> at `original-date'. >>> >>> [BTW: The only nontrivial thing `diary-anniversary' does is handling of >>> birthdays on 2/28, you may want to have a look if you need to handle >>> that case specially.] >> >> It seems to me that it isn't `diary-anniversary' that needs to be gotten >> rid of, so much as `diary-sexp-entry' -- that's the function that's >> basically just eval'ling a string. If I get rid of `diary-anniversary', >> I'll basically just end up re-writing it. >> >> At init time, instead of building up strings, I could just build up >> closures holding the appropriate dynamic value for DATE and ENTRY, and >> calling `diary-anniversary': essentially replace `diary-sexp-entry'. >> That's at least one less layer. > > Just for fun, here's a version with closures. The need for > `calendar-dlet' (or something that does that job) is unfortunate, and > maybe sufficient argument for writing my own version of > `diary-anniversary'. But this was a fun experiment in understanding > lexical binding and closures. And, because I apparently have nothing else to do on a weekend, here's a version that just calls a function directly, nothing fancy. Some overlap with `diary-anniversary', but nothing terrible. This is probably the best approach. --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=ebdb-diary-function.diff diff --git a/ebdb.el b/ebdb.el index d3b7d9480a..3264c77f1e 100644 --- a/ebdb.el +++ b/ebdb.el @@ -62,8 +62,7 @@ (autoload 'widget-group-match "wid-edit") (autoload 'ebdb-migrate-from-bbdb "ebdb-migrate") (autoload 'eieio-customize-object "eieio-custom") -(autoload 'diary-sexp-entry "diary-lib") -(autoload 'diary-add-to-list "diary-lib") +(autoload 'diary-ordinal-suffix "diary-lib") (autoload 'org-agenda-list "org-agenda") (autoload 'org-make-tags-matcher "org") (defvar ebdb-i18n-countries) @@ -282,6 +281,10 @@ do not set this to nil." "Customizations for EBDB utilities." :group 'ebdb) +(defgroup ebdb-utilities-anniv nil + "Customizations for EBDB anniversaries." + :group 'ebdb) + (defgroup ebdb-utilities-dialing nil "EBDB customizations for phone number dialing." :group 'ebdb-utilities) @@ -373,6 +376,10 @@ Emacs, always query before reverting." :group 'ebdb-utilities-anniv :type 'boolean) +(make-obsolete-variable + 'ebdb-use-diary + "Add %%(ebdb-diary-anniversaries) to your diary file instead" "0.8") + (defcustom ebdb-anniversary-md-format "%B %d" "Format string used for displaying month-day anniversary dates. See the docstring of `format-time-string' for the meaning of @@ -389,26 +396,12 @@ month, and day values are available." :group 'ebdb-utilities-anniv :type 'string) -(defvar ebdb-diary-entries nil - "A list of all anniversary diary entries. -Entries are added and removed in the `ebdb-init-field' and -`ebdb-delete-field' methods of the `ebdb-field-anniversary' -class, and added with the `ebdb-diary-add-entries' function. - -Each entry is a two-element list: a string representation of the -anniversary date, and the sexp (as a string): - -\(diary-anniversary MM DD YYYY) (the year is optional)") - -;; Dynamic var needed by `diary-sexp-entry'. -(defvar original-date) - -(defun ebdb-diary-add-entries () - "Add anniversaries from EBDB to the diary." - (pcase-dolist (`(,entry ,sexp) ebdb-diary-entries) - (let ((parsed (cdr-safe (diary-sexp-entry sexp entry original-date)))) - (when parsed - (diary-add-to-list original-date parsed sexp))))) +(defvar ebdb-diary-entries (make-hash-table :test #'equal) + "Hash table holding anniversary entries for the diary. +Keys are dates in the format (MONTH DAY YEAR), values are lists +of anniversary strings. Instances of `ebdb-field-anniversary' +fields can push descriptive strings into the hash entries for +their dates. Also see `ebdb-diary-anniversaries'.") (defcustom ebdb-before-load-hook nil "Hook run before loading databases." @@ -2199,12 +2192,29 @@ Eventually this method will go away." (list month day year)) obj))) -;; `ebdb-field-anniv-diary-entry' is defined below. +(defun ebdb-diary-anniversaries (&optional mark) + (with-no-warnings + (defvar date) + (defvar original-date)) + (when-let ((entries (gethash (seq-subseq date 0 2) ebdb-diary-entries))) + (cons mark + (mapconcat (pcase-lambda (`(,field ,record)) + (if (bound-and-true-p original-date) + ;; If we have `original-date', we're + ;; displaying the diary list, so we need + ;; the detailed string. + (ebdb-field-anniv-diary-entry + field record (nth 2 date)) + ;; If not, we're just marking dates on the + ;; calendar, so any non-nil response value is + ;; fine. + entry)) + entries "; ")))) + (cl-defmethod ebdb-init-field ((anniv ebdb-field-anniversary) record) - (when ebdb-use-diary - (add-to-list - 'ebdb-diary-entries - (ebdb-field-anniv-diary-entry anniv record)))) + (with-slots (date) anniv + (push (list anniv record) + (gethash (seq-subseq date 0 2) ebdb-diary-entries)))) (cl-defmethod ebdb-string ((ann ebdb-field-anniversary)) (let* ((date (slot-value ann 'date)) @@ -2226,11 +2236,12 @@ Eventually this method will go away." (cl-defmethod ebdb-delete-field ((anniv ebdb-field-anniversary) record &optional _unload) - (when ebdb-use-diary - (setq - ebdb-diary-entries - (delete (ebdb-field-anniv-diary-entry anniv record) - ebdb-diary-entries)))) + (with-slots (date) anniv + (puthash (seq-subseq date 0 2) + (seq-remove (lambda (e) + (equal e (list anniv record))) + (gethash (seq-subseq date 0 2) ebdb-diary-entries)) + ebdb-diary-entries))) ;;; Id field @@ -3218,19 +3229,22 @@ If FIELD doesn't specify a year, use the current year." (format "%d-%d-%d" year (nth 0 date) (nth 1 date))))) (cl-defmethod ebdb-field-anniv-diary-entry ((field ebdb-field-anniversary) - (record ebdb-record)) - "Add a diary entry for FIELD's date." - (let ((cal-date (slot-value field 'date))) - (list (concat (format "%s's " - (ebdb-string record)) - (if (nth 2 cal-date) - "%d%s " - "%s ") - (slot-value field 'label)) - (apply #'format (if (nth 2 cal-date) - "(diary-anniversary %s %s %s)" - "(diary-anniversary %s %s)") - cal-date)))) + (record ebdb-record) + &optional now-year) + "Produce a diary entry for FIELD's date. +The entry is a string noting how many years have passed for +RECORD's FIELD anniversary, relative to NOW-YEAR." + ;; Essentially a re-write of `diary-anniversary'. + (pcase-let* ((`(,month ,day ,year) (slot-value field 'date)) + (label (slot-value field 'label)) + (num-years (when (and year now-year) + (- now-year year)))) + (concat (format "%s's " (ebdb-string record)) + (when year + (format "%d%s " num-years (diary-ordinal-suffix num-years))) + label + (unless (string= label "birthday") + " anniversary")))) ;;; `ebdb-record' subclasses @@ -4338,6 +4352,7 @@ process.") ebdb-record-tracker nil) (clrhash ebdb-org-hashtable) (clrhash ebdb-hashtable) + (clrhash ebdb-diary-entries) (clrhash ebdb-relation-hashtable)) ;; Changing which database a record belongs to. @@ -5372,8 +5387,6 @@ All the important work is done by the `ebdb-db-load' method." (cons db-file-regexp 'lisp-data-mode) auto-mode-alist)) (run-hooks 'ebdb-after-load-hook) - (when ebdb-use-diary - (add-hook 'diary-list-entries-hook #'ebdb-diary-add-entries)) (add-hook 'kill-emacs-hook #'ebdb-save-on-emacs-exit) (length ebdb-record-tracker))) --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Tue Aug 17 13:16:23 2021 Received: (at 49995) by debbugs.gnu.org; 17 Aug 2021 17:16:23 +0000 Received: from localhost ([127.0.0.1]:53991 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mG2hK-0004n6-UC for submit@debbugs.gnu.org; Tue, 17 Aug 2021 13:16:23 -0400 Received: from mout.web.de ([212.227.17.12]:54363) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mG2hF-0004mo-Pz for 49995@debbugs.gnu.org; Tue, 17 Aug 2021 13:16:21 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=web.de; s=dbaedf251592; t=1629220561; bh=7h9KGwK5UKy5WIdHWyjqQlpQGbIP+z7fhVDf48lWmk8=; h=X-UI-Sender-Class:From:To:Cc:Subject:References:Date:In-Reply-To; b=rQcGV7CDLxBlt004JIWDP0xry+fnLGAwZavQgctYOvAUw0Gu8qhfeqj/tCVYLt1Gi m64jooctqV/A8miZaX+ZW1ERBRtSNqbW4xsnrSArpwtMK1ZHP/mIVv/zGL6KH/YEbm Kub6PZtih9rnaETx2akV7Am1LH6plCskYXT6x7hQ= X-UI-Sender-Class: c548c8c5-30a9-4db5-a2e7-cb6cb037b8f9 Received: from drachen.dragon ([88.66.201.45]) by smtp.web.de (mrweb102 [213.165.67.124]) with ESMTPSA (Nemesis) id 0MGign-1mK9Qm0LvF-00DW3N; Tue, 17 Aug 2021 19:16:01 +0200 From: Michael Heerdegen To: Eric Abrahamsen Subject: Re: bug#49995: 28.0.50; EBDB Anniversaries do not appear marked in calendar References: <87h7ft5ea2.fsf@ericabrahamsen.net> <877dgogihz.fsf@web.de> <87y293527m.fsf@ericabrahamsen.net> <87bl5zxso8.fsf@ericabrahamsen.net> <871r6uhmn9.fsf@web.de> <87y292wzmy.fsf@ericabrahamsen.net> <87tujqwvi9.fsf@ericabrahamsen.net> <87k0kmwjie.fsf@ericabrahamsen.net> Date: Tue, 17 Aug 2021 19:16:00 +0200 In-Reply-To: <87k0kmwjie.fsf@ericabrahamsen.net> (Eric Abrahamsen's message of "Sun, 15 Aug 2021 13:16:57 -0700") Message-ID: <87r1es56wf.fsf@web.de> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K1:mQG/c4YO/T7RRVvVLHwHDpgQDosgHk6CEZ/raxdKeBB+ORr9N2i VqzbpIzl6DFao2zUO4+3A8HbxYTkk49fBMWJMCrlotIi7/jSOCWIiwjBVmkwYdhxPLfiohU uf6k+xbB0RNjGJ3yDWEE3HWanvc43lefEOftL/7SJ5GoGJptKlYZb7O8breXLqipYxSr+C4 dPZzzqKGloY8BvBnn3A+w== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:lSiFKaeCeXE=:xfbIG6jAbTgZa2QbxQW9bg QWjpz5oIxGcfXkxkxfHQ7r9mnsGpdxyXYo+I16KeCqLYiu7KfYkIoQ7iPFsY46I2438lJb0vT 2yUxC+rIAYhc4fb2DOGw/Iq13FZP6YhNiqA5IaTh03cH6lVIjbsBUtf8Ge4CXfbqqMYPMTWzA gMxlsMUMWPt/Nm6XC/MIn6qr1sml6suu10IoFituhg3LpzJNV1QHffsjVktyAUqc0XJnTHaIR oFhbJ/WalYp0kz8elHZy07gJ5OqoA/8qaJMuRfHVlOhM8QkN9G+ZHdQW3gu1zpf0EbBZ8DYD4 U4XBIKwZvw9nZzGJ3LZvw7MkX4udDRruGox7URN2lFHJlTCWlyaC5Dr5oXyYaxU1Do9MEumj7 LnAEqnrywqMl4g0SFz5IRtrQ5KMmGE7ea+FC78fb8OdH49t91OaJ/kxzkQPBvUIRTfMN5GICf +QiMHaIuhMh0I7xchEs39g8VtzrWgFjuXaZAXit/XvDtSFSJvCniXf8rkadvdGlSIYL7kS29o i4jawX1ZBpALB4TsRZ5WXCQpjLdqkWelprX860JAGbwLrlEgqEkiofstS/PcF9ax4iTtoaaKh YSfUAI1HE1m3NedtcxxXzb/5UTnndLORvrLk7WKGNm/Cm/QWe+gUfdjMdewjVC4/N0esb7Dwh +qjnR1v5xUt+9+aAxzU0k2HPokKJfSQktMQGtxlw5wMqlPpBwEFEX8SDGPI/iaCBmebOkzUL+ mvC1qtUJBRl0/wJa+qv5MyvH8r29J9UPE3IcVuARUHwygkqM8FoUz9KAUsYbAQfk3aqWukx7O IvY8mbKg/QLgCWo9E9JoZ0/FB+T53KshxiSO2v4kBvbqkh0pZ6+R0TCiJXZtCbFKCRVNAAvfb FyZH8iz1bLo0UpelaLQuSN0+b7BoTXLp0+umMIVyHFYyXsAa3/Qv/375+J8hoF9a+SW7PDzJC EeK8bRVOobh6nX/Rf+eSjEhr8v/plVRuDT4dOM1H3wsn94ZrTmhNtrtut4e6/TLnLtTUf3lMd rAU4ENT5ufSRe5iAhlPmmPy/rupKRmhqwcDyjXWm+pDzy97+pPPC3dLT2m/taZYAYzg1ojCXo cyVOrr+wHK9/dtYa5O/1FuGd4lChwSaImbK9TSxyW7UAvUBjpgENkRzVA== X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 49995 Cc: 49995@debbugs.gnu.org, Pankaj Jangid X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Eric Abrahamsen writes: > And, because I apparently have nothing else to do on a weekend, here's a > version that just calls a function directly, nothing fancy. Some overlap > with `diary-anniversary', but nothing terrible. This is probably the > best approach. Yes, looks like more or less what I had suggested. Hope it turns out it was the right advice. > -;; `ebdb-field-anniv-diary-entry' is defined below. > +(defun ebdb-diary-anniversaries (&optional mark) > + (with-no-warnings > + (defvar date) > + (defvar original-date)) > + (when-let ((entries (gethash (seq-subseq date 0 2) ebdb-diary-entries))) > + (cons mark > + (mapconcat (pcase-lambda (`(,field ,record)) > + (if (bound-and-true-p original-date) > + ;; If we have `original-date', we're > + ;; displaying the diary list, so we need > + ;; the detailed string. > + (ebdb-field-anniv-diary-entry > + field record (nth 2 date)) > + ;; If not, we're just marking dates on the > + ;; calendar, so any non-nil response value is > + ;; fine. > + entry)) > + entries "; ")))) Do you really expect that this if-clause has a measurable effect on performance? Most people will not have thousands of anniversaries in their database (and even then, they probably don't want to have them all listed). OTOH you now need to rely on an internal aspect of the implementation. Some more thoughts about this matter: Do have a version for the Org agenda? I see BBDB has `org-bbdb-anniversaries'. It handles the 2/29 problem btw. What I as a user would wish (for the Diary and Org) would be a way to control on a per-field basis (1) which anniversaries are listed, (2) how they are presented and (3) a way to allow reminders for some (I might need some weeks time to buy a present for some people, while I only want to congratulate others so I don't need a reminder for most). Regards, Michael. From debbugs-submit-bounces@debbugs.gnu.org Tue Aug 17 15:46:11 2021 Received: (at 49995) by debbugs.gnu.org; 17 Aug 2021 19:46:11 +0000 Received: from localhost ([127.0.0.1]:54167 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mG52J-0000Ol-0c for submit@debbugs.gnu.org; Tue, 17 Aug 2021 15:46:11 -0400 Received: from mail.ericabrahamsen.net ([52.70.2.18]:34290) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mG52E-0000O6-Ml for 49995@debbugs.gnu.org; Tue, 17 Aug 2021 15:46:09 -0400 Received: from localhost (75-172-126-110.tukw.qwest.net [75.172.126.110]) (Authenticated sender: eric@ericabrahamsen.net) by mail.ericabrahamsen.net (Postfix) with ESMTPSA id A76F7FA07F; Tue, 17 Aug 2021 19:45:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ericabrahamsen.net; s=mail; t=1629229559; bh=AyYfmt2pg+mNtgzd3t8OcshQPgtzEUVREaA3yLI6u20=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=X0SQ2/SUdbFheOofZIikv0X0x6E0EegXqiQy0xzHnk+uiWEWFLBdjJ0Gao3IxtusL zZGfnvVxHN7K/x14tphS6l72R4LE35BslzH6c4pRmBYU6gopGTLG7YUkQtYGD1W1c0 PeAUrISAczCHWHIZcZe/Vw7u8yLqfWbps+q4H3EA= From: Eric Abrahamsen To: Michael Heerdegen Subject: Re: bug#49995: 28.0.50; EBDB Anniversaries do not appear marked in calendar References: <87h7ft5ea2.fsf@ericabrahamsen.net> <877dgogihz.fsf@web.de> <87y293527m.fsf@ericabrahamsen.net> <87bl5zxso8.fsf@ericabrahamsen.net> <871r6uhmn9.fsf@web.de> <87y292wzmy.fsf@ericabrahamsen.net> <87tujqwvi9.fsf@ericabrahamsen.net> <87k0kmwjie.fsf@ericabrahamsen.net> <87r1es56wf.fsf@web.de> Date: Tue, 17 Aug 2021 12:45:58 -0700 In-Reply-To: <87r1es56wf.fsf@web.de> (Michael Heerdegen's message of "Tue, 17 Aug 2021 19:16:00 +0200") Message-ID: <87y28zua6h.fsf@ericabrahamsen.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 49995 Cc: 49995@debbugs.gnu.org, Pankaj Jangid X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) On 08/17/21 19:16 PM, Michael Heerdegen wrote: > Eric Abrahamsen writes: > >> And, because I apparently have nothing else to do on a weekend, here's a >> version that just calls a function directly, nothing fancy. Some overlap >> with `diary-anniversary', but nothing terrible. This is probably the >> best approach. > > Yes, looks like more or less what I had suggested. Hope it turns out it > was the right advice. I'm sure it will, I just had to waste a few hours trying out alternate approaches first :) >> -;; `ebdb-field-anniv-diary-entry' is defined below. >> +(defun ebdb-diary-anniversaries (&optional mark) >> + (with-no-warnings >> + (defvar date) >> + (defvar original-date)) >> + (when-let ((entries (gethash (seq-subseq date 0 2) ebdb-diary-entries))) >> + (cons mark >> + (mapconcat (pcase-lambda (`(,field ,record)) >> + (if (bound-and-true-p original-date) >> + ;; If we have `original-date', we're >> + ;; displaying the diary list, so we need >> + ;; the detailed string. >> + (ebdb-field-anniv-diary-entry >> + field record (nth 2 date)) >> + ;; If not, we're just marking dates on the >> + ;; calendar, so any non-nil response value is >> + ;; fine. >> + entry)) >> + entries "; ")))) > > Do you really expect that this if-clause has a measurable effect on > performance? Most people will not have thousands of anniversaries in > their database (and even then, they probably don't want to have them all > listed). OTOH you now need to rely on an internal aspect of the > implementation. Dunno, I just figured that, when marking, the function gets called ~90 times in a row, potentially over and over again as the user scrolls the Calendar. Other diary functions come with warnings about potential slowdowns during marking, and the user might have a large number of these various functions, so I thought I'd just try to make this as polite as possible. Probably I'm over-thinking it, but on the other hand, the code's already written... > Some more thoughts about this matter: > > Do have a version for the Org agenda? I see BBDB has > `org-bbdb-anniversaries'. It handles the 2/29 problem btw. Oops, I've already handled the 2/29 problem, it just didn't make it into the diff because I hadn't committed that bit yet. There's nothing explicit for the agenda, I guess `ebdb-diary-anniversaries' behaves pretty much the same as `org-bbdb-anniversaries': you can either stick it in your diary file, if you use the diary, or in an Org file, if you don't. > What I as a user would wish (for the Diary and Org) would be a way to > control on a per-field basis (1) which anniversaries are listed, (2) how > they are presented and (3) a way to allow reminders for some (I might > need some weeks time to buy a present for some people, while I only want > to congratulate others so I don't need a reminder for most). Okay, thanks for these suggestions! There are many, many aspects of EBDB where I know I could be doing more, and it's great to have some explicit requests. I'm thinking about how best to separate concerns. The user might want notifications about EBDB contacts, and might be using the diary, or Org, or maybe neither of those. EBDB fields should store basic information like: notify or don't notify, an optional custom notification string, and an optional number of days in advance to notify. If a field has a number of advance days, it puts itself in the hash table twice: on its own date, and on its advance date. Then there's a `ebdb-use-notifications' option: if non-nil, EBDB displays messages itself, at load time and also record display time. Otherwise, `ebdb-diary-anniversaries' works the way it does now, for only the diary, or in Org. Maybe, additionally, we provide a `ebdb-export-to-org' command that writes an Org file holding all our anniversaries as headings, with advance notifications implemented as DEADLINE lines with a warning period. I could use custom properties to identify headlines, so running the command multiple times would only add headings that aren't there already, allowing the user to edit the headlines or add more stuff after export. How does all of that sound? In the meantime, I'll get this code in and a new EBDB version released. I'm sure Pankaj has been thrilled to get dragged through this long thread, but that's no reason to delay :) Eric From debbugs-submit-bounces@debbugs.gnu.org Wed Aug 18 11:57:34 2021 Received: (at 49995) by debbugs.gnu.org; 18 Aug 2021 15:57:34 +0000 Received: from localhost ([127.0.0.1]:57362 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mGNwc-0000r1-5Y for submit@debbugs.gnu.org; Wed, 18 Aug 2021 11:57:34 -0400 Received: from mout.web.de ([212.227.15.3]:50285) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mGNwW-0000qj-KT for 49995@debbugs.gnu.org; Wed, 18 Aug 2021 11:57:32 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=web.de; s=dbaedf251592; t=1629302232; bh=i9/FkVlZT9aaGXksRxem3slMpDjufhOrgfdj3JUxIHM=; h=X-UI-Sender-Class:From:To:Cc:Subject:References:Date:In-Reply-To; b=m6YXH8XPTbvDnUlktTy/CxkTRYucKtveWNcsLmlkJ5+JqO0IHg8YItBnG0I6R2AZA 8pxoLMAmSBdQPgkHhX8LKkUKn/zhr8RVJ/eLVVDr6whLgwLkKt9mxkn6kaLFq1ReHQ SU4IcIfdv7l6E7OhWH908XyJK43IIk0++y+gmL1I= X-UI-Sender-Class: c548c8c5-30a9-4db5-a2e7-cb6cb037b8f9 Received: from drachen.dragon ([88.66.201.45]) by smtp.web.de (mrweb005 [213.165.67.108]) with ESMTPSA (Nemesis) id 1MMGu2-1mXV573olq-00JFyQ; Wed, 18 Aug 2021 17:57:11 +0200 From: Michael Heerdegen To: Eric Abrahamsen Subject: Re: bug#49995: 28.0.50; EBDB Anniversaries do not appear marked in calendar References: <87h7ft5ea2.fsf@ericabrahamsen.net> <877dgogihz.fsf@web.de> <87y293527m.fsf@ericabrahamsen.net> <87bl5zxso8.fsf@ericabrahamsen.net> <871r6uhmn9.fsf@web.de> <87y292wzmy.fsf@ericabrahamsen.net> <87tujqwvi9.fsf@ericabrahamsen.net> <87k0kmwjie.fsf@ericabrahamsen.net> <87r1es56wf.fsf@web.de> <87y28zua6h.fsf@ericabrahamsen.net> Date: Wed, 18 Aug 2021 17:57:11 +0200 In-Reply-To: <87y28zua6h.fsf@ericabrahamsen.net> (Eric Abrahamsen's message of "Tue, 17 Aug 2021 12:45:58 -0700") Message-ID: <874kbmwxt4.fsf@web.de> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K1:A0hOUKsoUKLUESEPyn2oWv/vV8+6tWpCafzF35F1tYrs1ASfALj WPYHLa1hptDr0ctWEQxHlWJuwUeeFoJPXCaxXDZHGbR844xpEL7254EexL9vNOxmtTc7GD/ 9Tc1IrpLdr2aXmf79xsq9niB0xlQ8SrS20tfpWg77wGXVy4ruc4x66rrWPHVN8a6lX3fbyb C3S3Cc/u7ilsPqbby21Qg== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:rGPXN2egSx8=:+v1m9q2rDA0toNoHutSUST mlJXA2HszrU5ip84m/6GO+JqqgBr4pZdxSYqKinGktkRg/RYzZoJNrjEVUlDTsk7JQofu69fj C8OvSzXfZYoIwjUgBCx4GoaH8HmWLhlE8whnenRkxaDvD+gC5eYncWQIgIMEkSs0cnajuHy+H wvRTG3U7uDYLlvrmVaMoWYpD3Gk4yfP3CVitfmZL7UP8ESxfXo0dsOvDawX+gyizTzl+wHczC GippWobiSdPI4QeYutLxTaIzBe097W4qeXQd2zJCAi+IZRuq3fnAy5VbVKlHpzsBb2rJpYYrk CDAlC4F0y7+pW1CJPyqISwrMgRy0nFWi1uGD1/7KHjPtGjv+bN8NUaf+p9yzeS44ZyDK7WSEA lHB0bHa7UlkZXedxIjKZW/3/bX3r3jdvl/OpbhT9h1pW29hiwKNN2iHlCKpKcXWrMNCULG4cN FUKthdRcqop/1bvyGq/rAf1PHLAFW4SA7X25x+Z8EQCuVIaSSt6UEbsQMDoh3cORoGuV5eAgH 1fFhStKZgJeqnKt026CoZzz6sZGBabo78PEYlrDZ4un5L+qODMyLsBU322pU7sOhc4SIO/Xqi +VzcIhSLU0Ys/9qVtCLcNZxuvDPq3aHqHZw33aS+/Rh2ehuZ2TXPFT3+o8QkmLCPd4wN5s8uS lP2nXon9kPkrcLE0y+sYRM7PrYy8rjgCTtxEgjZD5OrwqZm3jZv7/fhNhgF2rfIBYp5wxDITJ DG2TVVgYFSWqbaUlj0yM+qCjpRMnL8be4piOsATDLJtdwgqe6RrhUwtDdwgc4KlMFrZdWPEND EiHXPclBjWFSPQX/F73Wpwh/o1vwFrf6x8yAdCCGlC0ZgnoUT3mnxWp0izfBNr5FxRrwAfIo9 FlQCnmdXygMJvdB/KlW/MIlqp3xbk/VD9PvbBRomg35pcEqpxD4SGqDXpzXJCTQh8KL0Nggbl YzelhWZYqP+cpj+WajWZF6ClJh24pxA8X3T1+9BZHVKoJPEP6weDBweINnaQ3AdqHpP/QhtT1 KsRJ9V7vQrjUx1ANx2PNjiNyeN5WdE2kjyMiGqoWsYfEA5ujVrcwW9FvkaZfviKPQM39ZRIGA aZwqOAO1cfZANEfYlXEP0HuJH7ZYHYcwSkTAC6WZSkJzixda6fE4kqy/g== X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 49995 Cc: 49995@debbugs.gnu.org, Pankaj Jangid X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) Eric Abrahamsen writes: > Otherwise, `ebdb-diary-anniversaries' works the way it does now, for > only the diary, or in Org. Ok, great. > > Maybe, additionally, we provide a `ebdb-export-to-org' command that > writes an Org file holding all our anniversaries as headings, with > advance notifications implemented as DEADLINE lines with a warning > period. [...] While the idea has some charm, you would loose the speed advantages from using a hash table for lookup, right? Or would Org build and use one internally? Anyway, I think personally I would not want to have a second place for anniversaries - unless it would then be beneficial to use only that file in the future. > How does all of that sound? All of that sounded good, thanks for your time. Michael. From debbugs-submit-bounces@debbugs.gnu.org Wed Aug 18 13:13:16 2021 Received: (at 49995-done) by debbugs.gnu.org; 18 Aug 2021 17:13:16 +0000 Received: from localhost ([127.0.0.1]:57486 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mGP7r-0002t3-VP for submit@debbugs.gnu.org; Wed, 18 Aug 2021 13:13:16 -0400 Received: from mail.ericabrahamsen.net ([52.70.2.18]:33062) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mGP7p-0002sl-VV for 49995-done@debbugs.gnu.org; Wed, 18 Aug 2021 13:13:15 -0400 Received: from localhost (c-73-109-4-106.hsd1.wa.comcast.net [73.109.4.106]) (Authenticated sender: eric@ericabrahamsen.net) by mail.ericabrahamsen.net (Postfix) with ESMTPSA id C9E2AFA07F; Wed, 18 Aug 2021 17:13:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ericabrahamsen.net; s=mail; t=1629306788; bh=njkGwZd0m6iD/giJ2C8xncIvtg4qGZ3e8nHfo4tZ+hI=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=VSQ7p8cL6RjkpEO97NcifagAJVxdchDnNJhItc1PhVAGmqoOplnZ0GfPBb4XqzRPU eIr1y+B5TTNdPmsmGyhiLbLnPRqW37TmuAhkeIv7YeB0CMm+L2XioeuUMoGpwCobC7 YwMSV5KrzlRFOFxn8y0ALdcV3ux0S6ucfMULgmvw= From: Eric Abrahamsen To: Michael Heerdegen Subject: Re: bug#49995: 28.0.50; EBDB Anniversaries do not appear marked in calendar References: <87h7ft5ea2.fsf@ericabrahamsen.net> <877dgogihz.fsf@web.de> <87y293527m.fsf@ericabrahamsen.net> <87bl5zxso8.fsf@ericabrahamsen.net> <871r6uhmn9.fsf@web.de> <87y292wzmy.fsf@ericabrahamsen.net> <87tujqwvi9.fsf@ericabrahamsen.net> <87k0kmwjie.fsf@ericabrahamsen.net> <87r1es56wf.fsf@web.de> <87y28zua6h.fsf@ericabrahamsen.net> <874kbmwxt4.fsf@web.de> Date: Wed, 18 Aug 2021 10:13:06 -0700 In-Reply-To: <874kbmwxt4.fsf@web.de> (Michael Heerdegen's message of "Wed, 18 Aug 2021 17:57:11 +0200") Message-ID: <87v942llr1.fsf@ericabrahamsen.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 49995-done Cc: 49995-done@debbugs.gnu.org, Pankaj Jangid X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Michael Heerdegen writes: > Eric Abrahamsen writes: > >> Otherwise, `ebdb-diary-anniversaries' works the way it does now, for >> only the diary, or in Org. > > Ok, great. > >> >> Maybe, additionally, we provide a `ebdb-export-to-org' command that >> writes an Org file holding all our anniversaries as headings, with >> advance notifications implemented as DEADLINE lines with a warning >> period. [...] > > While the idea has some charm, you would loose the speed advantages from > using a hash table for lookup, right? Or would Org build and use one > internally? > > Anyway, I think personally I would not want to have a second place for > anniversaries - unless it would then be beneficial to use only that file > in the future. This would just be an alternate way of getting EBDB anniversaries into your Org agenda. Instead of sticking %%(ebdb-diary-anniversaries) somewhere in your Org files, EBDB would export a separate Org file holding its anniversaries as headings, which you would include in the Agenda. It would only make sense if the user wanted to make lots of edits to the anniversary entries. I'm probably just overthinking things! I've just pushed the changes so far, and released a new version, and now will work on further customization. I want to implement this for the ID field as well: I meant to do that quite a while ago, and my own passport expired because I hadn't yet gotten around to writing the code... :( From unknown Sat Jun 21 05:07:35 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Thu, 16 Sep 2021 11:24:08 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator