changeset 26427:3b6cf16f3633

* calendar/calendar.el (calendar-remove-frame-by-deleting): New user variable. (calendar-hide-window): Use it. (increment-calendar-month, calendar-for-loop, calendar-sum): Use the new backquote syntax.
author Sam Steingold <sds@gnu.org>
date Fri, 12 Nov 1999 16:05:16 +0000
parents 89f3a23871fa
children f572944ca41f
files lisp/ChangeLog lisp/calendar/calendar.el
diffstat 2 files changed, 38 insertions(+), 21 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/ChangeLog	Fri Nov 12 14:35:43 1999 +0000
+++ b/lisp/ChangeLog	Fri Nov 12 16:05:16 1999 +0000
@@ -1,3 +1,11 @@
+1999-11-12  Sam Steingold  <sds@ksp.com>
+
+	* calendar/calendar.el (calendar-remove-frame-by-deleting):
+	New user variable.
+	(calendar-hide-window): Use it.
+	(increment-calendar-month, calendar-for-loop, calendar-sum):
+	Use the new backquote syntax.
+
 1999-11-12  Andrew Innes  <andrewi@gnu.org>
 
 	* select.el (x-set-selection): Call buffer-substring, not
@@ -8,7 +16,7 @@
 	* progmodes/ps-mode.el (ps-mode-submit-bug-report): Added list
 	of customizable variables to bug report message. Added
 	system-type to package name in bug report.
-	
+
 1999-11-12  Gerd Moellmann  <gerd@gnu.org>
 
 	* buff-menu.el (list-buffers-noselect): Use abbreviate-file-name
@@ -43,7 +51,7 @@
 
 1999-11-08  Markus Rost  <rost@ias.edu>
 
-	* wid-edit.el (widget-button-click): Wrap with save-excursion 
+	* wid-edit.el (widget-button-click): Wrap with save-excursion
 	to restore track-mouse in the correct buffer.
 
 1999-11-08  Gerd Moellmann  <gerd@gnu.org>
@@ -55,7 +63,7 @@
 	* progmodes/ps-mode.el (ps-mode-print-function): Changed default
 	lpr-command to "lp" for some system-types. (copied from lpr.el
 	Emacs version 20.2.1).
-	
+
 1999-11-04  Markus Rost  <rost@ias.edu>
 
 	* simple.el (comment-region): Strip off white space at end of
--- a/lisp/calendar/calendar.el	Fri Nov 12 14:35:43 1999 +0000
+++ b/lisp/calendar/calendar.el	Fri Nov 12 16:05:16 1999 +0000
@@ -191,6 +191,13 @@
   :type 'boolean
   :group 'diary)
 
+;;;###autoload
+(defcustom calendar-remove-frame-by-deleting nil
+  "*Determine how the calendar mode removes a frame no longer needed.
+If nil, make an icon of the frame.  If non-nil, delete the frame."
+  :type 'boolean
+  :group 'view)
+
 (when window-system
   (add-to-list 'facemenu-unlisted-faces 'diary-face)
   (defface diary-face
@@ -341,7 +348,7 @@
 (defcustom calendar-move-hook nil
   "*List of functions called whenever the cursor moves in the calendar.
 
-For example, 
+For example,
 
   (add-hook 'calendar-move-hook (lambda () (view-diary-entries 1)))
 
@@ -1130,24 +1137,24 @@
 (defmacro increment-calendar-month (mon yr n)
   "Move the variables MON and YR to the month and year by N months.
 Forward if N is positive or backward if N is negative."
-  (` (let (( macro-y (+ (* (, yr) 12) (, mon) -1 (, n) )))
-       (setq (, mon) (1+ (% macro-y 12) ))
-       (setq (, yr) (/ macro-y 12)))))
+  `(let ((macro-y (+ (* ,yr 12) ,mon -1 ,n)))
+    (setq ,mon (1+ (% macro-y 12)))
+    (setq ,yr (/ macro-y 12))))
 
 (defmacro calendar-for-loop (var from init to final do &rest body)
   "Execute a for loop."
-  (` (let (( (, var) (1- (, init)) ))
-       (while (>= (, final) (setq (, var) (1+ (, var))))
-         (,@ body)))))
+  `(let ((,var (1- ,init)))
+    (while (>= ,final (setq ,var (1+ ,var)))
+      ,@body)))
 
 (defmacro calendar-sum (index initial condition expression)
   "For INDEX = INITIAL et seq, as long as CONDITION holds, sum EXPRESSION."
-  (` (let (( (, index) (, initial))
-             (sum 0))
-       (while (, condition)
-         (setq sum (+ sum (, expression) ))
-         (setq (, index) (1+ (, index))))
-       sum)))
+  `(let ((,index ,initial)
+         (sum 0))
+    (while ,condition
+      (setq sum (+ sum ,expression))
+      (setq ,index (1+ ,index)))
+    sum))
 
 ;; The following are in-line for speed; they can be called thousands of times
 ;; when looking up holidays or processing the diary.  Here, for example, are
@@ -1333,7 +1340,7 @@
 
 (autoload 'calendar-two-frame-setup "cal-x"
   "Start calendar and diary in separate, dedicated frames.")
-  
+
 ;;;###autoload
 (defvar calendar-setup nil
   "The frame set up of the calendar.
@@ -1699,7 +1706,7 @@
 Optional prefix argument specifies number of weeks.
 Holidays are included if `cal-tex-holidays' is t.")
 
-(autoload 'cal-tex-cursor-week2 "cal-tex" 
+(autoload 'cal-tex-cursor-week2 "cal-tex"
   "Make a buffer with LaTeX commands for a two-page one-week calendar.
 It applies to the week that point is in.
 Optional prefix argument specifies number of weeks.
@@ -1726,13 +1733,13 @@
 (autoload 'cal-tex-cursor-filofax-week "cal-tex"
   "One-week-at-a-glance Filofax style calendar for week indicated by cursor.
 Optional prefix argument specifies number of weeks.
-Weeks start on Monday. 
+Weeks start on Monday.
 Diary entries are included if cal-tex-diary is t.
 Holidays are included if `cal-tex-holidays' is t.")
 
 (autoload 'cal-tex-cursor-filofax-daily "cal-tex"
   "Day-per-page Filofax style calendar for week indicated by cursor.
-Optional prefix argument specifies number of weeks.  Weeks start on Monday. 
+Optional prefix argument specifies number of weeks.  Weeks start on Monday.
 Diary entries are included if `cal-tex-diary' is t.
 Holidays are included if `cal-tex-holidays' is t.")
 
@@ -2139,7 +2146,9 @@
                                       (window-frame window))))))
           nil)
          ((and window-system (window-dedicated-p window))
-          (iconify-frame (window-frame window)))
+          (if calendar-remove-frame-by-deleting
+              (delete-frame (window-frame window))
+              (iconify-frame (window-frame window))))
          ((not (and (select-window window) (one-window-p window)))
           (delete-window window))
          (t (set-buffer buffer)