emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] master 98cb7d9: solar.el: Tweak sunrise-sunset output


From: Glenn Morris
Subject: [Emacs-diffs] master 98cb7d9: solar.el: Tweak sunrise-sunset output
Date: Fri, 20 Feb 2015 06:24:40 +0000

branch: master
commit 98cb7d9e4d7ff3e9cb8aad229e30dbd0a7963a8f
Author: Glenn Morris <address@hidden>
Commit: Glenn Morris <address@hidden>

    solar.el: Tweak sunrise-sunset output
    
    * lisp/calendar/solar.el (solar-sunrise-sunset-string): Shorten message a 
bit.
    (sunrise-sunset): Use message rather than a window.
    
    Fixes: debbugs:19859
---
 lisp/ChangeLog         |    4 ++++
 lisp/calendar/solar.el |   22 +++++++---------------
 2 files changed, 11 insertions(+), 15 deletions(-)

diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index b043198..dc62555 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,5 +1,9 @@
 2015-02-20  Glenn Morris  <address@hidden>
 
+       * calendar/solar.el (solar-sunrise-sunset-string):
+       Shorten message a little.
+       (sunrise-sunset): Use message rather than a window.  (Bug#19859)
+
        * progmodes/f90.el (f90-keywords-re, f90-procedures-re)
        (f90-font-lock-keywords-2): Some F2008 additions.
 
diff --git a/lisp/calendar/solar.el b/lisp/calendar/solar.el
index 46cd8d3..25a24ee 100644
--- a/lisp/calendar/solar.el
+++ b/lisp/calendar/solar.el
@@ -657,7 +657,7 @@ Corresponding value is nil if there is no sunrise/sunset."
 Optional NOLOCATION non-nil means do not print the location."
   (let ((l (solar-sunrise-sunset date)))
     (format
-     "%s, %s%s (%s hours daylight)"
+     "%s, %s%s (%s hrs daylight)"
      (if (car l)
          (concat "Sunrise " (apply 'solar-time-string (car l)))
        "No sunrise")
@@ -847,20 +847,12 @@ This function is suitable for execution in an init file."
          (date (if (< arg 4) (calendar-current-date) (calendar-read-date)))
          (date-string (calendar-date-string date t))
          (time-string (solar-sunrise-sunset-string date))
-         (msg (format "%s: %s" date-string time-string))
-         (one-window (one-window-p t)))
-    (if (<= (length msg) (frame-width))
-        (message "%s" msg)
-      (with-output-to-temp-buffer "*temp*"
-        (princ (concat date-string "\n" time-string)))
-      (message "%s"
-               (substitute-command-keys
-                (if one-window
-                    (if pop-up-windows
-                        "Type \\[delete-other-windows] to remove temp window."
-                      "Type \\[switch-to-buffer] RET to remove temp window.")
-                  "Type \\[switch-to-buffer-other-window] RET to restore old \
-contents of temp window."))))))
+         (msg (format "%s%s"
+                      (if (< arg 4) ""  ; don't print date if it's today's
+                        (format "%s: " date-string))
+                      time-string)))
+    (message "%s" msg)
+    msg))
 
 ;;;###cal-autoload
 (defun calendar-sunrise-sunset (&optional event)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]