Function: landmark-init-display

landmark-init-display is a byte-compiled function defined in landmark.el.gz.

Signature

(landmark-init-display N M)

Documentation

Display an N by M Landmark board.

Source Code

;; Defined in /usr/src/emacs/lisp/obsolete/landmark.el.gz
  (sit-for 0))	; Display NOW

(defun landmark-init-display (n m)
  "Display an N by M Landmark board."
  (buffer-disable-undo (current-buffer))
  (let ((inhibit-read-only t)
	(point (point-min)) opoint
	(i m) j x)
    ;; Try to minimize number of chars (because of text properties)
    (setq tab-width
	  (if (zerop (% landmark-x-offset landmark-square-width))
	      landmark-square-width
	    (max (/ (+ (% landmark-x-offset landmark-square-width)
		       landmark-square-width 1) 2) 2)))
    (erase-buffer)
    (insert-char ?\n landmark-y-offset)
    (while (progn
	     (setq j n
		   x (- landmark-x-offset landmark-square-width))
	     (while (>= (setq j (1- j)) 0)
	       (insert-char ?\t (/ (- (setq x (+ x landmark-square-width))
				      (current-column))
				   tab-width))
               (insert-char ?\s (- x (current-column)))
	       (and (zerop j)
		    (= i (- m 2))
		    (progn
		      (while (>= i 3)
			(append-to-buffer (current-buffer) opoint (point))
			(setq i (- i 2)))
		      (goto-char (point-max))))
	       (setq point (point))
	       (insert ?=)
	       (add-text-properties point (point)
				    '(mouse-face highlight help-echo "\
mouse-1: get robot moving, mouse-2: play on this square")))
	     (> (setq i (1- i)) 0))
      (if (= i (1- m))
	  (setq opoint point))
      (insert-char ?\n landmark-square-height))
    (insert-char ?\n))
  (landmark-goto-xy (/ (1+ n) 2) (/ (1+ m) 2)) ; center of the board
  (sit-for 0))				; Display NOW