From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: John Magolske Newsgroups: gmane.emacs.help Subject: Challenges around displaying phase of moon in calfw Date: Sun, 28 May 2017 01:23:13 -0700 Message-ID: <20170528081730.GA17308@s70206.gridserver.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1495959773 7176 195.159.176.226 (28 May 2017 08:22:53 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 28 May 2017 08:22:53 +0000 (UTC) User-Agent: Mutt/1.5.23 (2014-03-12) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun May 28 10:22:49 2017 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dEtTM-0001kr-E1 for geh-help-gnu-emacs@m.gmane.org; Sun, 28 May 2017 10:22:48 +0200 Original-Received: from localhost ([::1]:43131 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dEtTR-0006CL-Qj for geh-help-gnu-emacs@m.gmane.org; Sun, 28 May 2017 04:22:53 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:54041) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dEtSr-0006C4-UG for help-gnu-emacs@gnu.org; Sun, 28 May 2017 04:22:18 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dEtSo-0008Kc-Mw for help-gnu-emacs@gnu.org; Sun, 28 May 2017 04:22:17 -0400 Original-Received: from mail6.webfaction.com ([74.55.86.74]:56521 helo=smtp.webfaction.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dEtSo-0008KH-Hn for help-gnu-emacs@gnu.org; Sun, 28 May 2017 04:22:14 -0400 Original-Received: from localhost (142-254-78-28.dsl.dynamic.fusionbroadband.com [142.254.78.28]) by smtp.webfaction.com (Postfix) with ESMTP id 0F7D7207EA23 for ; Sun, 28 May 2017 08:21:39 +0000 (UTC) Content-Disposition: inline X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x [fuzzy] X-Received-From: 74.55.86.74 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.org gmane.emacs.help:113200 Archived-At: To display phases of the moon in calfw, I placed this in a file in my org-agenda-files directory: %%(diary-lunar-phases) And set this: ;; shorter moon phase names to better fit into calfw. Using =E2=97=AF= for ;; "New Moon" and =E2=97=8F for "Full moon" as this for a light text = on dark ;; background terminal, reverse these for dark text on light backgrou= nd (setq lunar-phase-names '("=E2=97=AF New" "=E2=97=90 q1=E2=86=91" "=E2= =97=8F Full" "=E2=97=91 q3=E2=86=93")) Which works nicely -- the lunar phases show up in calfw, but for some reason the time is displayed twice, like so: 19:48 =E2=97=90 q1=E2=86=91 7:48pm (PDT) 14:40 =E2=97=8F Full 2:40pm (PDT) 12:46 =E2=97=AF New 12:46pm (PDT) I think what's going on is that each phase is considered an event which somehow gets prefixed with its time in 24hr format...but I can't figure out what to set to turn that off. For now I just remove the time stamps altogether by placing a modified version of diary-lunar-phases in my init file: (with-eval-after-load 'lunar (defun diary-lunar-phases (&optional mark) (let* ((index (lunar-index date)) (phase (lunar-phase index))) (while (calendar-date-compare phase (list date)) (setq index (1+ index) phase (lunar-phase index))) (if (calendar-date-equal (car phase) date) (cons mark (lunar-phase-name (nth 2 phase))))))) The original from lunar.el looks like this: ;; To be called from diary-list-sexp-entries, where DATE is bound. ;;;###diary-autoload (defun diary-lunar-phases (&optional mark) "Moon phases diary entry. An optional parameter MARK specifies a face or single-character strin= g to use when highlighting the day in the calendar." (let* ((index (lunar-index date)) (phase (lunar-phase index))) (while (calendar-date-compare phase (list date)) (setq index (1+ index) phase (lunar-phase index))) (if (calendar-date-equal (car phase) date) (cons mark (concat (lunar-phase-name (nth 2 phase)) " " (cadr phase)))))) It would be nice to keep the time of day for lunar phases, with something like this displayed: =E2=97=90 q1=E2=86=91 7:48pm (PDT) =E2=97=8F Full 2:40pm (PDT) =E2=97=AF New 12:46pm (PDT) Any suggestions much appreciated. John --=20 John Magolske http://b79.net/contact