* poe.el (current-fill-column): New emulating function.
[elisp/apel.git] / poe-18.el
index 93bc836..e5e3d5d 100644 (file)
--- a/poe-18.el
+++ b/poe-18.el
@@ -355,10 +355,8 @@ and from `file-attributes'."
       (setq lyear (and (zerop (% yyyy 4))
                       (or (not (zerop (% yyyy 100)))
                           (zerop (% yyyy 400)))))
-      (while (> (- dd (nth mm mdays)) 0)
-       (if (and (= mm 1) lyear)
-           (setq dd (- dd 29))
-         (setq dd (- dd (nth mm mdays))))
+      (while (> (- dd  (if (and lyear (= mm 1)) 29 (nth mm mdays))) 0)
+       (setq dd (- dd (if (and lyear (= mm 1)) 29 (nth mm mdays))))
        (setq mm (1+ mm)))
       (setq HH (/ low 3600)
            low (% low 3600)
@@ -452,7 +450,7 @@ resolution finer than a second."
 ;;; @@ Floating point numbers.
 ;;;
 
-(defalias 'numberp 'integerp)
+(defalias-maybe 'numberp 'integerp)
 
 (defun abs (arg)
   "Return the absolute value of ARG."
@@ -467,7 +465,7 @@ With optional DIVISOR, return the largest integer no greater than ARG/DIVISOR."
       (- (/ (- divisor 1 arg) divisor))
     (/ arg divisor)))
 
-(defalias 'mod '%)
+(defalias-maybe 'mod '%)
 
 ;;; @ Basic lisp subroutines.
 ;;;
@@ -514,12 +512,35 @@ With optional non-nil ALL, force redisplay of all mode-lines."
 ;;;
 
 ;; 18.55 does not have these variables.
-(defvar buffer-undo-list nil)
-(defvar-maybe auto-fill-function nil)
-(defvar-maybe unread-command-event nil)
-(defvar-maybe unread-command-events nil)
+(defvar-maybe buffer-undo-list nil
+  "List of undo entries in current buffer.
+poe-18.el provides this as dummy for a compatibility.")
+
+(defvar-maybe auto-fill-function nil
+  "Function called (if non-nil) to perform auto-fill.
+poe-18.el provides this as dummy for a compatibility.")
+
+(defvar-maybe unread-command-event nil
+  "poe-18.el provides this as dummy for a compatibility.")
+(defvar-maybe unread-command-events nil
+  "List of events to be read as the command input.
+poe-18.el provides this as dummy for a compatibility.")
+
+;; (defvar-maybe minibuffer-setup-hook nil
+;;   "Normal hook run just after entry to minibuffer.")
+;; (defvar-maybe minibuffer-exit-hook nil
+;;   "Normal hook run just after exit from minibuffer.")
+
+(defvar-maybe minor-mode-map-alist nil
+  "Alist of keymaps to use for minor modes.
+poe-18.el provides this as dummy for a compatibility.")
+(defvar-maybe minor-mode-alist nil
+  "Alist saying how to show minor modes in the mode line.
+poe-18.el provides this as dummy for a compatibility.")
+(defvar-maybe minor-mode-overriding-map-alist nil
+  "Alist of keymaps to use for minor modes, in current major mode.
+poe-18.el provides this as dummy for a compatibility.")
 
-(defalias 'buffer-disable-undo 'buffer-flush-undo)
 (defalias 'insert-and-inherit 'insert)
 (defalias 'insert-before-markers-and-inherit 'insert-before-markers)
 (defalias 'number-to-string 'int-to-string)
@@ -604,6 +625,39 @@ Optional third argunemt ALL-FRAMES is ignored in this implementation."
                 (not (eq walk-windows-current walk-windows-start))))
       (select-window walk-windows-start))))
 
+(defun buffer-disable-undo (&optional buffer)
+  "Make BUFFER stop keeping undo information.
+No argument or nil as argument means do this for the current buffer."
+   (buffer-flush-undo (or buffer (current-buffer))))
+
+
+;;; @@ Frame (Emacs 18 cannot make frame)
+;;;
+;; The following four are frequently used for manupulating the current frame.
+;; frame.el has `screen-width', `screen-height', `set-screen-width' and
+;; `set-screen-height' for backward compatibility and declare them as obsolete.
+(defun frame-width (&optional frame)
+  "Return number of columns available for display on FRAME.
+If FRAME is omitted, describe the currently selected frame."
+  (screen-width))
+
+(defun frame-height (&optional frame)
+  "Return number of lines available for display on FRAME.
+If FRAME is omitted, describe the currently selected frame."
+  (screen-height))
+
+(defun set-frame-width (frame cols &optional pretend)
+  "Specify that the frame FRAME has COLS columns.
+Optional third arg non-nil means that redisplay should use COLS columns
+but that the idea of the actual width of the frame should not be changed."
+  (set-screen-width cols pretend))
+
+(defun set-frame-height (frame lines &optional pretend)
+  "Specify that the frame FRAME has LINES lines.
+Optional third arg non-nil means that redisplay should use LINES lines
+but that the idea of the actual height of the frame should not be changed."
+  (set-screen-height lines pretend))
+
 ;;; @@ Environment variables.
 ;;;