comparison lisp/startup.el @ 83018:1465425fe2d3

Romain Francoise's and Ami Fischman's bugfixes. src/term.c (create_tty_output): Fix syntax error. Reported by Ami Fischman (ami at fischman dot org). lisp/loadup.el: Load term/x-win.el if X is available. lisp/startup.el (handle-args-function-alist) (window-system-initialization-alist): New variables. (command-line): Don't load term/x-win.el, use the above variables. lisp/x-win.el: (x-initialize-window-system): New function, move X initialization here. (x-initialized): New variable. lisp/frame.el (make-frame-on-display): Don't initialize X twice, and make sure to pass the correct display parameter to x-open-connection. Reported by Romain Francoise (romain at orebokech dot com). git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-58
author Karoly Lorentey <lorentey@elte.hu>
date Thu, 22 Jan 2004 02:36:55 +0000
parents f5cadabb36dd
children 32bf8e7cc0c2
comparison
equal deleted inserted replaced
83017:4c6128c0d7e2 83018:1465425fe2d3
588 "Height in pixels of images in the tool bar.") 588 "Height in pixels of images in the tool bar.")
589 589
590 (defvar tool-bar-originally-present nil 590 (defvar tool-bar-originally-present nil
591 "Non-nil if tool-bars are present before user and site init files are read.") 591 "Non-nil if tool-bars are present before user and site init files are read.")
592 592
593 (defvar handle-args-function-alist '((nil . tty-handle-args))
594 "Functions for processing window-system dependent command-line arguments.
595 Window system startup files should add their own function to this
596 alist, which should parse the command line arguments. Those
597 pertaining to the window system should be processed and removed
598 from the returned command line.")
599
600 (defvar window-system-initialization-alist '((nil . ignore))
601 "Alist of window-system initialization functions.
602 Window-system startup files should add their own initialization
603 function to this list. The function should take no arguments,
604 and initialize the window system environment to prepare for
605 opening the first frame (e.g. open a connection to the server).")
606
593 ;; Handle the X-like command-line arguments "-fg", "-bg", "-name", etc. 607 ;; Handle the X-like command-line arguments "-fg", "-bg", "-name", etc.
594 (defun tty-handle-args (args) 608 (defun tty-handle-args (args)
595 (let (rest) 609 (let (rest)
596 (message "%s" args) 610 (message "%s" args)
597 (while (and args 611 (while (and args
707 (setq eol-mnemonic-dos "(DOS)" 721 (setq eol-mnemonic-dos "(DOS)"
708 eol-mnemonic-mac "(Mac)"))) 722 eol-mnemonic-mac "(Mac)")))
709 723
710 ;; Read window system's init file if using a window system. 724 ;; Read window system's init file if using a window system.
711 (condition-case error 725 (condition-case error
712 (if (and initial-window-system (not noninteractive)) 726 (unless noninteractive
713 (load (concat term-file-prefix 727 (if (and initial-window-system
714 (symbol-name initial-window-system) 728 (not (featurep
715 "-win") 729 (intern (concat (symbol-name initial-window-system)
716 ;; Every window system should have a startup file; 730 "-win")))))
717 ;; barf if we can't find it. 731 (error "Unsupported window system `%s'" initial-window-system))
718 nil t)) 732 ;; Process window-system specific command line parameters.
719 ;; If we can't read it, print the error message and exit. 733 (setq command-line-args
734 (funcall (or (cdr (assq initial-window-system handle-args-function-alist))
735 (error "Unsupported window system `%s'" initial-window-system))
736 command-line-args))
737 ;; Initialize the window system. (Open connection, etc.)
738 (funcall (or (cdr (assq initial-window-system window-system-initialization-alist))
739 (error "Unsupported window system `%s'" initial-window-system))))
740 ;; If there was an error, print the error message and exit.
720 (error 741 (error
721 (princ 742 (princ
722 (if (eq (car error) 'error) 743 (if (eq (car error) 'error)
723 (apply 'concat (cdr error)) 744 (apply 'concat (cdr error))
724 (if (memq 'file-error (get (car error) 'error-conditions)) 745 (if (memq 'file-error (get (car error) 'error-conditions))
732 (cdr error) ", ")))) 753 (cdr error) ", "))))
733 'external-debugging-output) 754 'external-debugging-output)
734 (terpri 'external-debugging-output) 755 (terpri 'external-debugging-output)
735 (setq initial-window-system nil) 756 (setq initial-window-system nil)
736 (kill-emacs))) 757 (kill-emacs)))
737
738 ;; Windowed displays do this inside their *-win.el.
739 (unless (or (display-graphic-p) noninteractive)
740 (setq command-line-args (tty-handle-args command-line-args)))
741 758
742 (set-locale-environment nil) 759 (set-locale-environment nil)
743 760
744 ;; Convert the arguments to Emacs internal representation. 761 ;; Convert the arguments to Emacs internal representation.
745 (let ((args (cdr command-line-args))) 762 (let ((args (cdr command-line-args)))