unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Comments on man/calendar.texi.
@ 2004-11-30 15:07 ` Matt Hodges
  2004-11-30 16:30   ` Glenn Morris
  2004-11-30 19:00   ` Ed Reingold
  0 siblings, 2 replies; 3+ messages in thread
From: Matt Hodges @ 2004-11-30 15:07 UTC (permalink / raw


[-- Attachment #1: Type: text/plain, Size: 1592 bytes --]

I've read through man/calendar.texi and have some comments.

(1) The documentation of calendar-week-start-day doesn't mention that
    if this variable is changed, redraw-calendar needs calling for the
    effect to be visible. Also, until the calendar is redrawn, the
    movement commands (e.g., calendar-forward-day) don't work
    correctly. This situation is confusing and should at least be
    mentioned in the variable documentation; better still if
    customizing the variable redraws the calendar automatically.

(2) The resizing of the calendar window that can occur with, for
    example, calendar-forward-month can be distracting, so a
    customizable minimum window height may be useful.

(3) In Calendar mode, SPC is bound to scroll-other-window, so binding
    DEL to scroll-other-window-down seems natural (cf. view-mode).

(4) The error message "Months before February, 1 AD are not available"
    looks a bit strange if you do, for example, C-u calendar RET 1 RET
    February RET then M-v (scroll-calendar-right-three-months). I
    guess that the message refers specifically to using C-u M-x
    calendar, but there are other routes to generate-calendar, and
    maybe something like "Months before January, 1 AD cannot be
    displayed" would be more informative.

(5) The earliest Mayan long count date appears to be 7.17.18.13.3,
    rather than 7.17.18.13.1. (This needs to be checked.)

(6) Mention timeclock-change, and fix the documentation for the
    default behaviour of timeclock-ask-before-exiting.

See attached patch for suggested changes. Thanks,

Matt


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Calendar patch. --]
[-- Type: text/x-patch, Size: 10053 bytes --]

Index: man/calendar.texi
===================================================================
RCS file: /cvsroot/emacs/emacs/man/calendar.texi,v
retrieving revision 1.23
diff -u -r1.23 calendar.texi
--- man/calendar.texi	19 Oct 2004 09:57:49 -0000	1.23
+++ man/calendar.texi	30 Nov 2004 14:57:31 -0000
@@ -291,7 +291,9 @@
 @item C-c C-l
 Regenerate the calendar window (@code{redraw-calendar}).
 @item SPC
-Scroll the next window (@code{scroll-other-window}).
+Scroll the next window up (@code{scroll-other-window}).
+@item DEL
+Scroll the next window down (@code{scroll-other-window-down}).
 @item q
 Exit from calendar (@code{exit-calendar}).
 @end table
@@ -314,8 +316,9 @@
 
 @kindex SPC @r{(Calendar mode)}
   In Calendar mode, you can use @kbd{SPC} (@code{scroll-other-window})
-to scroll the other window.  This is handy when you display a list of
-holidays or diary entries in another window.
+to scroll the other window up and @kbd{DEL} (@code{scroll-other-window-down})
+to scroll the other window down.  This is handy when you display a list
+of holidays or diary entries in another window.
 
 @kindex q @r{(Calendar mode)}
 @findex exit-calendar
@@ -437,8 +440,8 @@
 @findex list-calendar-holidays
   To get even more detailed information, use the @kbd{a} command, which
 displays a separate buffer containing a list of all holidays in the
-current three-month range.  You can use @key{SPC} in the calendar window
-to scroll that list.
+current three-month range.  You can use @key{SPC} and @key{DEL} in the
+calendar window to scroll that list up and down.
 
 @findex holidays
   The command @kbd{M-x holidays} displays the list of holidays for the
@@ -861,7 +864,7 @@
 @noindent
 Thus, the long count date 12.16.11.16.6 means 12 baktun, 16 katun, 11
 tun, 16 uinal, and 6 kin.  The Emacs calendar can handle Mayan long
-count dates as early as 7.17.18.13.1, but no earlier.  When you use the
+count dates as early as 7.17.18.13.3, but no earlier.  When you use the
 @kbd{g m l} command, type the Mayan long count date with the baktun,
 katun, tun, uinal, and kin separated by periods.
 
@@ -1510,11 +1513,14 @@
 
 @findex timeclock-in
 @findex timeclock-out
+@findex timeclock-change
 @findex timeclock-workday-remaining
 @findex timeclock-when-to-leave
   Use the @kbd{M-x timeclock-in} command when you start working on a
 project, and @kbd{M-x timeclock-out} command when you're done.  Each
-time you do this, it adds one time interval to the record of the project.
+time you do this, it adds one time interval to the record of the
+project.  You can change to working on a different project with @kbd{M-x
+timeclock-change}.
 
   Once you've collected data from a number of time intervals, you can use
 @kbd{M-x timeclock-workday-remaining} to see how much time is left to
@@ -1529,12 +1535,13 @@
 @code{t}, or invoke the @kbd{M-x timeclock-modeline-display} command.
 
 @vindex timeclock-ask-before-exiting
-  Terminating the current Emacs session might or might not mean that
-you have stopped working on the project.  If you'd like Emacs to ask
-you about this, set the value of the variable
-@code{timeclock-ask-before-exiting} to @code{t} (via @kbd{M-x
-customize}).  By default, only an explicit @kbd{M-x timeclock-out}
-tells Emacs that the current interval is over.
+  Terminating the current Emacs session might or might not mean that you
+have stopped working on the project and, by default, Emacs queries this.
+However, you can set the value of the variable
+@code{timeclock-ask-before-exiting} to @code{nil} (via @kbd{M-x
+customize}) to avoid this behaviour; then, only an explicit @kbd{M-x
+timeclock-out} or @kbd{M-x timeclock-change} will tell Emacs that the
+current interval is over.
 
 @cindex @file{.timelog} file
 @vindex timeclock-file
Index: man/ChangeLog
===================================================================
RCS file: /cvsroot/emacs/emacs/man/ChangeLog,v
retrieving revision 1.386
diff -u -r1.386 ChangeLog
--- man/ChangeLog	29 Nov 2004 15:58:15 -0000	1.386
+++ man/ChangeLog	30 Nov 2004 14:57:31 -0000
@@ -1,3 +1,11 @@
+2004-11-30  Matt Hodges <MPHodges@member.fsf.org>
+	
+	* calendar.texi (General Calendar): Document binding of
+	scroll-other-window-down.
+	(Mayan Calendar): Fixed earliest date.
+	(Time Intervals): Document timeclock-change.
+	(Time Intervals): Fix timeclock-ask-before-exiting documentation.
+
 2004-11-29  Reiner Steib  <Reiner.Steib@gmx.de>
 
 	* custom.texi (File Variables): Add `unibyte' and make it more
Index: lisp/calendar/calendar.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/calendar/calendar.el,v
retrieving revision 1.159
diff -u -r1.159 calendar.el
--- lisp/calendar/calendar.el	4 Oct 2004 23:46:42 -0000	1.159
+++ lisp/calendar/calendar.el	30 Nov 2004 14:57:31 -0000
@@ -140,12 +140,25 @@
   :prefix "calendar-"
   :group 'calendar)
 
+(defconst calendar-buffer "*Calendar*"
+  "Name of the buffer used for the calendar.")
 
 ;;;###autoload
 (defcustom calendar-week-start-day 0
   "*The day of the week on which a week in the calendar begins.
-0 means Sunday (default), 1 means Monday, and so on."
+0 means Sunday (default), 1 means Monday, and so on.
+
+If you change this variable directly after starting `calendar',
+you should call `redraw-calendar' to update the calendar display
+to reflect the change, otherwise movement commands will not work
+correctly."
   :type 'integer
+  :set (lambda (sym val)
+         (set sym val)
+         (let ((buffer (get-buffer calendar-buffer)))
+           (when (buffer-live-p buffer)
+             (with-current-buffer buffer
+               (redraw-calendar)))))
   :group 'calendar)
 
 ;;;###autoload
@@ -1303,9 +1316,6 @@
   :type 'sexp
   :group 'holidays)
 
-(defconst calendar-buffer "*Calendar*"
-  "Name of the buffer used for the calendar.")
-
 (defconst holiday-buffer "*Holidays*"
   "Name of the buffer used for the displaying the holidays.")
 
@@ -1572,6 +1582,11 @@
           (const :tag "use current frame" nil))
   :group 'calendar)
 
+(defcustom calendar-minimum-window-height 8
+  "Minimum height that the calendar window should use."
+  :type 'integer
+  :group 'calendar)
+
 ;;;###autoload
 (defun calendar (&optional arg)
   "Choose between the one frame, two frame, or basic calendar displays.
@@ -2032,28 +2047,33 @@
           (or (not mon)
               (let ((offset (calendar-interval mon yr month year)))
                 (and (<= offset 1) (>= offset -1)))))
-         (day-in-week (calendar-day-of-week today)))
+         (day-in-week (calendar-day-of-week today))
+         (in-calendar-window (eq (window-buffer (selected-window))
+                                 (get-buffer calendar-buffer))))
     (update-calendar-mode-line)
     (if mon
         (generate-calendar mon yr)
-        (generate-calendar month year))
+      (generate-calendar month year))
     (calendar-cursor-to-visible-date
      (if today-visible today (list displayed-month 1 displayed-year)))
     (set-buffer-modified-p nil)
-    (if (or (one-window-p t) (/= (frame-width) (window-width)))
-	;; Don't mess with the window size, but ensure that the first
-	;; line is fully visible
-	(set-window-vscroll nil 0)
-      ;; Adjust the window to exactly fit the displayed calendar
-      (fit-window-to-buffer))
-    (sit-for 0)
+    ;; Don't do any window-related stuff if we weren't called from a
+    ;; window displaying the calendar
+    (when in-calendar-window
+      (if (or (one-window-p t) (/= (frame-width) (window-width)))
+          ;; Don't mess with the window size, but ensure that the first
+          ;; line is fully visible
+          (set-window-vscroll nil 0)
+        ;; Adjust the window to exactly fit the displayed calendar
+        (fit-window-to-buffer nil nil calendar-minimum-window-height))
+      (sit-for 0))
     (if (and (boundp 'font-lock-mode)
 	     font-lock-mode)
 	(font-lock-fontify-buffer))
     (and mark-holidays-in-calendar
 ;;;         (calendar-date-is-legal-p today) ; useful for BC dates
          (mark-calendar-holidays)
-         (sit-for 0))
+         (when in-calendar-window (sit-for 0)))
     (unwind-protect
         (if mark-diary-entries-in-calendar (mark-diary-entries))
       (if today-visible
@@ -2067,7 +2087,7 @@
 ;;; stands, almost all other calendar functions (eg holidays) would 
 ;;; at best have unpredictable results for such dates.
   (if (< (+ month (* 12 (1- year))) 2)
-      (error "Months before February, 1 AD are not available"))
+      (error "Months before January, 1 AD cannot be displayed"))
   (setq displayed-month month
         displayed-year year)
   (erase-buffer)
@@ -2222,6 +2242,7 @@
   (define-key calendar-mode-map "S"   'calendar-sunrise-sunset)
   (define-key calendar-mode-map "M"   'calendar-phases-of-moon)
   (define-key calendar-mode-map " "   'scroll-other-window)
+  (define-key calendar-mode-map "\C-?" 'scroll-other-window-down)
   (define-key calendar-mode-map "\C-c\C-l" 'redraw-calendar)
   (define-key calendar-mode-map "."   'calendar-goto-today)
   (define-key calendar-mode-map "o"   'calendar-other-month)
Index: lisp/ChangeLog
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/ChangeLog,v
retrieving revision 1.6694
diff -u -r1.6694 ChangeLog
--- lisp/ChangeLog	30 Nov 2004 11:07:29 -0000	1.6694
+++ lisp/ChangeLog	30 Nov 2004 14:57:33 -0000
@@ -1,3 +1,15 @@
+2004-11-30  Matt Hodges <MPHodges@member.fsf.org>
+
+	* calendar/calendar.el (calendar-buffer): Moved above
+	calendar-week-start-day.
+	(calendar-week-start-day): Doc fix.  Added :set function.
+	(generate-calendar-window): Don't resize window if selected-window
+	is not displaying the calendar buffer.
+	(calendar-minimum-window-height): New variable.
+	(generate-calendar-window): Use it.
+	(calendar-mode-map): Bind DEL to scroll-other-window-down.
+	(generate-calendar): More precise error message.
+
 2004-11-30  Andre Spiegel  <spiegel@gnu.org>
 
 	* vc-hooks.el (vc-recompute-state): Moved here from vc.el.

[-- Attachment #3: Type: text/plain, Size: 142 bytes --]

_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-devel

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Comments on man/calendar.texi.
  2004-11-30 15:07 ` Comments on man/calendar.texi Matt Hodges
@ 2004-11-30 16:30   ` Glenn Morris
  2004-11-30 19:00   ` Ed Reingold
  1 sibling, 0 replies; 3+ messages in thread
From: Glenn Morris @ 2004-11-30 16:30 UTC (permalink / raw
  Cc: emacs-devel


Many thanks for these comments - I will review them (assuming no else
beats me to it) and get back to you.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Comments on man/calendar.texi.
  2004-11-30 15:07 ` Comments on man/calendar.texi Matt Hodges
  2004-11-30 16:30   ` Glenn Morris
@ 2004-11-30 19:00   ` Ed Reingold
  1 sibling, 0 replies; 3+ messages in thread
From: Ed Reingold @ 2004-11-30 19:00 UTC (permalink / raw
  Cc: emacs-devel

All of these comments are on the money!  Will somebody fix the .texi files?

> I've read through man/calendar.texi and have some comments.
> 
> (1) The documentation of calendar-week-start-day doesn't mention that
>     if this variable is changed, redraw-calendar needs calling for the
>     effect to be visible. Also, until the calendar is redrawn, the
>     movement commands (e.g., calendar-forward-day) don't work
>     correctly. This situation is confusing and should at least be
>     mentioned in the variable documentation; better still if
>     customizing the variable redraws the calendar automatically.
> 
> (2) The resizing of the calendar window that can occur with, for
>     example, calendar-forward-month can be distracting, so a
>     customizable minimum window height may be useful.
> 
> (3) In Calendar mode, SPC is bound to scroll-other-window, so binding
>     DEL to scroll-other-window-down seems natural (cf. view-mode).
> 
> (4) The error message "Months before February, 1 AD are not available"
>     looks a bit strange if you do, for example, C-u calendar RET 1 RET
>     February RET then M-v (scroll-calendar-right-three-months). I
>     guess that the message refers specifically to using C-u M-x
>     calendar, but there are other routes to generate-calendar, and
>     maybe something like "Months before January, 1 AD cannot be
>     displayed" would be more informative.
> 
> (5) The earliest Mayan long count date appears to be 7.17.18.13.3,
>     rather than 7.17.18.13.1. (This needs to be checked.)
> 
> (6) Mention timeclock-change, and fix the documentation for the
>     default behaviour of timeclock-ask-before-exiting.
> 
> See attached patch for suggested changes. Thanks,
> 
> Matt
> 
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2004-11-30 19:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <MPHodges@member.fsf.org>
2004-11-30 15:07 ` Comments on man/calendar.texi Matt Hodges
2004-11-30 16:30   ` Glenn Morris
2004-11-30 19:00   ` Ed Reingold

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).