;;; xwin.el --- stuff specific to X11

;;----------------------------------------------
;; Joerg Arndt's  emacs startup files
;; ... online at http://www.jjj.de/
;; your feedback is welcome  mailto: arndt (AT) jjj.de
;; version: 2012-March-24 (09:25)
;;----------------------------------------------


;;; Commentary:
;; 

;;; History:
;; 

;;; Code:

;;; STUFF FOR NON X11:
(if (not (eq window-system 'x))
  (progn
    ;; Text-mode emulation of looking and choosing from a menubar:
    (global-set-key [(f10)] 'tmm-menubar)

    ;; paren matching on:
    (require 'paren)
    ) )


;;; STUFF FOR X11:
(if (eq window-system 'x)
    (progn

      ;; hide toolbar with emacs version >=21:
      ;; (see settings.el )
;;      (if (>= emacs-major-version 21) (tool-bar-mode -1))

      ;; Specify whether to have vertical scroll bars, and on which side.
      ;; Possible values are nil (no scroll bars), `left' (scroll bars on left)
      ;; and `right' (scroll bars on right).
      (set-scroll-bar-mode 'left)

;;      (require 'paren)
;;      (require 'mic-paren)
      (require 'stig-paren)

;;      (setq blink-matching-paren t)
      (setq paren-dingaling-mode t)
;;      ;; Non-nil causes paren-command-hook to highlight whole S-expressions:
      (setq paren-sexp-mode nil) ;; colorize space between parens
;;      (global-set-key [(control \()] 'stig-paren-toggle-dingaling-mode)
;;      (global-set-key [(control \))] 'stig-paren-toggle-sexp-mode)

      ;;      (setq paren-mismatch-face 'underline)
      (make-face 'jjj-paren-mismatch-face)
      (set-face-background 'jjj-paren-mismatch-face "DeepPink")
      ;;      (set-face-underline-p 'jjj-paren-mismatch-face t)
      ;;      (set-face-stipple 'jjj-paren-mismatch-face '(8 8 "A5A5A5A5A5"))
      (setq paren-mismatch-face 'jjj-paren-mismatch-face)
;;      (setq show-paren-mismatch-face 'jjj-paren-mismatch-face)
      ;;
      (make-face 'jjj-paren-match-face)
      (set-face-background 'jjj-paren-match-face "cyan")
      (setq paren-match-face 'jjj-paren-match-face)
      ;;


;;;;      ;; hilit used only for html-helper-mode (obsolete by now):
;;      (setq hilit-mode-enable-list  '(html-helper-mode))
;;      (load "my-hilit.el")  ;; customize hl319.el
;;;;      ;; /usr/share/emacs/site-lisp/hl319.el


      ;; ------- set font: -------
      ;; cf. /usr/X11R6/lib/X11/fonts/misc/fonts.alias

      (defconst jj-normal-font "8x13bold")
      ;; 8x13bold     -misc-fixed-bold-r-normal--13-120-75-75-c-80-iso8859-1
      (global-set-key [(control kp-enter)] '(lambda () (interactive)
                                         (set-default-font jj-normal-font)))

;;      (defconst jj-small-font "6x13")
      (defconst jj-small-font "lucidasanstypewriter-12")
;;      (defconst jj-small-font "-B&H-LucidaTypewriter-Medium-R-Normal-Sans-12-120-75-75-M-70-iso10646-1")
      ;; 6x13 == -misc-fixed-medium-r-normal--13-120-75-75-c-80-iso8859-1
      (global-set-key [(control kp-add)] '(lambda () (interactive)
                                         (set-default-font jj-small-font)))

      (defconst jj-bold-font2 "9x15bold")
      ;; 9x15bold == -misc-fixed-bold-r-normal--15-140-75-75-c-90-iso8859-1
      (global-set-key [(control kp-subtract)] '(lambda () (interactive)
                                         (set-default-font jj-bold-font2)))

      (defconst jj-tiny-font "6x10")
      ;; 6x10 == -misc-fixed-medium-r-normal--10-100-75-75-c-60-iso8859-1
      (global-set-key [(control kp-divide)] '(lambda () (interactive)
                                       (set-default-font jj-tiny-font)))

      (defconst jj-big-font "-adobe-courier-*-r-normal-*-18-*-*-*-m-*-iso8859-1")
      ;; 10x20 == -misc-fixed-medium-r-normal--20-200-75-75-c-100-iso8859-1
      (global-set-key [(control kp-multiply)] '(lambda () (interactive)
                                         (set-default-font jj-big-font)))

      (defconst jj-huge-font "-adobe-courier-*-r-normal--*-240-*-*-m-*-iso8859-1")
      ;;
      (global-set-key [(control kp-insert)] '(lambda () (interactive)
                                         (set-default-font jj-huge-font)))

      (defconst jj-test-font "5x8")
      (global-set-key [(control kp-delete)] '(lambda () (interactive)
                                       (set-default-font jj-test-font)))


      (set-default-font jj-normal-font)
      ;; ------- end (set font) -------


      ;; self-explanatory:
      (set-mouse-color "red")
      (set-background-color "white")
      (set-foreground-color "black")
      ;;      (set-border-color "green")
      (set-cursor-color "red") ;; use "darkslateblue" if "red" hurts your eyes


      (setq initial-frame-alist
            '((width . 95)
              (height . 57)
              (menu-bar-lines . 1)
              (background-color . "white")
              ;;        (name . " %b ")  ;; leave unset, cf. frame-title-format
              (mouse-color . "red")
              (cursor-color . "red")
              (foreground-color . "black")
              ;;        (border-color "green")
;;              (font . "8x13bold")  ;; do NOT give font!
;;              (font . jj-normal-font)
              ) )
      ;; make this the default:
      (setq default-frame-alist initial-frame-alist)

      ;; frame title:
      ;; This variable has the same structure as `mode-line-format'
      ;; 1) you@host.domain.org:
;;      (setq frame-title-format '("%b  (" user-login-name "@" system-name ")"))
      ;; 2) you@host:
;;      (setq frame-title-format '("%b  (" user-login-name "@" hostname ")"))
      (setq frame-title-format
            '("E: %b  (" user-login-name "@" hostname ")    [" emacs-version "]"))
      ;; cf. variable mode-line-format

      ;; same title for icon:
;;      (setq icon-title-format frame-title-format)
      ;; shortened title for icon:
      (setq icon-title-format '("E: %b"))

      ;;      (modify-frame-parameters FRAME '((name . "voodoo")))
      ;;      (setq after-make-frame-hook 'my-after-make-frame-hook)

      ;;      (require 'xfonts)
      ) )


;;(provide 'xwin)

;;; xwin.el ends here

