changeset 83277:886073e54ccb

Fix some superflous deviations from CVS, plus apply some cosmetics. * etc/TODO: Fix deviation from CVS. * lisp/emulation/viper-util.el: Ditto. * lisp/international/mule-cmds.el: Ditto. * lisp/progmodes/gdb-ui.el: Ditto. * src/termchar.h: Ditto. * src/xfns.c (Fx_create_frame): Ditto. * lisp/term/rxvt.el: Don't embed `(require 'server)' in eval-when-compile. * lisp/term/xterm.el: Ditto. * src/xterm.c (x_delete_display): Cosmetic change. * src/xterm.c (x_create_frame_display): Cosmetic change. git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-317
author Karoly Lorentey <lorentey@elte.hu>
date Wed, 23 Mar 2005 12:53:42 +0000
parents 26c9034f3533
children b2bde606bcf7
files etc/TODO lisp/emulation/viper-util.el lisp/international/mule-cmds.el lisp/progmodes/gdb-ui.el lisp/term/rxvt.el lisp/term/x-win.el lisp/term/xterm.el src/termchar.h src/xfns.c src/xterm.c
diffstat 10 files changed, 84 insertions(+), 146 deletions(-) [+]
line wrap: on
line diff
--- a/etc/TODO	Wed Mar 23 10:40:00 2005 +0000
+++ b/etc/TODO	Wed Mar 23 12:53:42 2005 +0000
@@ -152,7 +152,7 @@
   thread has processed the MENU_BAR_ACTIVATE_EVENT and regenerated
   the whole menu bar.  In the mean time, it should process other messages.
 
-** Get some major packages installed: W3/url (development version needs
+** Get some major packages installed: W3 (development version needs
   significant work), PSGML.  Check the assignments file for other
   packages which might go in and have been missed.
 
--- a/lisp/emulation/viper-util.el	Wed Mar 23 10:40:00 2005 +0000
+++ b/lisp/emulation/viper-util.el	Wed Mar 23 12:53:42 2005 +0000
@@ -100,9 +100,10 @@
    (fset 'viper-int-to-char (symbol-function 'identity))
    (if (viper-window-display-p)
        (fset 'viper-iconify (symbol-function 'iconify-or-deiconify-frame)))
-   (fset 'viper-get-face (symbol-function 'internal-get-face))
-   (fset 'viper-color-defined-p (symbol-function 'x-color-defined-p))
-          )
+   (cond ((viper-has-face-support-p)
+	  (fset 'viper-get-face (symbol-function 'internal-get-face))
+	  (fset 'viper-color-defined-p (symbol-function 'x-color-defined-p))
+	  )))
  )
 
 
--- a/lisp/international/mule-cmds.el	Wed Mar 23 10:40:00 2005 +0000
+++ b/lisp/international/mule-cmds.el	Wed Mar 23 12:53:42 2005 +0000
@@ -141,7 +141,7 @@
   t)
 (define-key-after set-coding-system-map [set-terminal-coding-system]
   '(menu-item "For Terminal" set-terminal-coding-system
-	      :enable (null (memq window-system '(x w32 mac)))
+	      :enable (null (memq initial-window-system '(x w32 mac)))
 	      :help "How to encode terminal output")
   t)
 (define-key-after set-coding-system-map [separator-3]
@@ -2337,115 +2337,6 @@
 	    (pop cs)))
 	(if c (coding-system-base c)))))
 
-(defun set-locale-translation-file-name ()
-  "Set up the locale-translation-file-name on the current system.
-
-This needs to be done at runtime for the sake of binaries
-possibly transported to a system without X."
-  (setq locale-translation-file-name
-	(let ((files
-	       '("/usr/lib/X11/locale/locale.alias" ; e.g. X11R6.4
-		 "/usr/X11R6/lib/X11/locale/locale.alias" ; XFree86, e.g. RedHat 4.2
-		 "/usr/openwin/lib/locale/locale.alias" ; e.g. Solaris 2.6
-		 ;;
-		 ;; The following name appears after the X-related names above,
-		 ;; since the X-related names are what X actually uses.
-		 "/usr/share/locale/locale.alias" ; GNU/Linux sans X
-		 )))
-	  (while (and files (not (file-exists-p (car files))))
-	    (setq files (cdr files)))
-	  (car files))))
-
-(defun get-locale-real-name (&optional locale-name)
-  "Return the canonicalized name of locale LOCALE-NAME.
-
-LOCALE-NAME should be a string which is the name of a locale supported
-by the system.  Often it is of the form xx_XX.CODE, where xx is a
-language, XX is a country, and CODE specifies a character set and
-coding system.  For example, the locale name \"ja_JP.EUC\" might name
-a locale for Japanese in Japan using the `japanese-iso-8bit'
-coding-system.  The name may also have a modifier suffix, e.g. `@euro'
-or `@cyrillic'.
-
-If LOCALE-NAME is nil, its value is taken from the environment
-variables LC_ALL, LC_CTYPE and LANG (the first one that is set).
-On server frames, the environment of the emacsclient process is
-used.
-
-See also `set-locale-environment'."
-  (unless locale-name
-    ;; Use the first of these three environment variables
-    ;; that has a nonempty value.
-    (let ((vars '("LC_ALL" "LC_CTYPE" "LANG")))
-      (while (and vars
-		  (= 0 (length locale-name))) ; nil or empty string
-	(setq locale-name (server-getenv (pop vars))))))
-
-    (when locale-name
-      ;; Translate "swedish" into "sv_SE.ISO8859-1", and so on,
-      ;; using the translation file that many systems have.
-      (when locale-translation-file-name
-	(with-temp-buffer
-	  (insert-file-contents locale-translation-file-name)
-	  (when (re-search-forward
-		 (concat "^" (regexp-quote locale-name) ":?[ \t]+") nil t)
-	    (setq locale-name (buffer-substring (point) (line-end-position)))))))
-    locale-name)
-
-(defun get-locale-coding-system (&optional locale)
-  "Return the coding system corresponding to locale LOCALE."
-  (setq locale (or locale (get-locale-real-name nil)))
-  (when locale
-    (or (locale-name-match locale locale-preferred-coding-systems)
-	(when locale
-	  (if (string-match "\\.\\([^@]+\\)" locale)
-	      (locale-charset-to-coding-system
-	       (match-string 1 locale)))))))
-
-(defun configure-display-for-locale (&optional locale)
-  "Set up terminal for locale LOCALE.
-
-The display table, the terminal coding system and the keyboard
-coding system of the current display device are set up for the
-given locale."
-  (setq locale (or locale (get-locale-real-name nil)))
-
-  (when locale
-    (let ((language-name
-	   (locale-name-match locale locale-language-names))
-	  (charset-language-name
-	   (locale-name-match locale locale-charset-language-names))
-	  (coding-system
-	   (get-locale-coding-system locale)))
-
-      ;; Give preference to charset-language-name over language-name.
-      (if (and charset-language-name
-	       (not
-		(equal (get-language-info language-name 'charset)
-		       (get-language-info charset-language-name 'charset))))
-	  (setq language-name charset-language-name))
-
-      (when language-name
-
-	;; If default-enable-multibyte-characters is nil,
-	;; we are using single-byte characters,
-	;; so the display table and terminal coding system are irrelevant.
-	(when default-enable-multibyte-characters
-	  ;; Override default-terminal-coding-system in case the
-	  ;; display coding can not be derived from the language
-	  ;; environment.
-	  (let ((default-terminal-coding-system coding-system))
-	    (set-display-table-and-terminal-coding-system language-name)))
-
-	;; Set the `keyboard-coding-system' if appropriate (tty
-	;; only).  At least X and MS Windows can generate
-	;; multilingual input.
-	(unless window-system
-	  (let ((kcs (or coding-system
-			 (car (get-language-info language-name
-						 'coding-system)))))
-	    (if kcs (set-keyboard-coding-system kcs))))))))
-
 ;; Fixme: This ought to deal with the territory part of the locale
 ;; too, for setting things such as calendar holidays, ps-print paper
 ;; size, spelling dictionary.
@@ -2465,8 +2356,6 @@
 
 If LOCALE-NAME is nil, its value is taken from the environment
 variables LC_ALL, LC_CTYPE and LANG (the first one that is set).
-On server frames, the environment of the emacsclient process is
-used.
 
 The locale names supported by your system can typically be found in a
 directory named `/usr/share/locale' or `/usr/lib/locale'.  LOCALE-NAME
@@ -2477,10 +2366,43 @@
 `locale-preferred-coding-systems' and `locale-coding-system'."
   (interactive "sSet environment for locale: ")
 
-  (let ((locale (get-locale-real-name locale-name)))
+  ;; Do this at runtime for the sake of binaries possibly transported
+  ;; to a system without X.
+  (setq locale-translation-file-name
+	(let ((files
+	       '("/usr/lib/X11/locale/locale.alias" ; e.g. X11R6.4
+		 "/usr/X11R6/lib/X11/locale/locale.alias" ; XFree86, e.g. RedHat 4.2
+		 "/usr/openwin/lib/locale/locale.alias" ; e.g. Solaris 2.6
+		 ;;
+		 ;; The following name appears after the X-related names above,
+		 ;; since the X-related names are what X actually uses.
+		 "/usr/share/locale/locale.alias" ; GNU/Linux sans X
+		 )))
+	  (while (and files (not (file-exists-p (car files))))
+	    (setq files (cdr files)))
+	  (car files)))
+
+  (let ((locale locale-name))
+
+    (unless locale
+      ;; Use the first of these three environment variables
+      ;; that has a nonempty value.
+      (let ((vars '("LC_ALL" "LC_CTYPE" "LANG")))
+	(while (and vars
+		    (= 0 (length locale))) ; nil or empty string
+	  (setq locale (getenv (pop vars))))))
 
     (when locale
 
+      ;; Translate "swedish" into "sv_SE.ISO8859-1", and so on,
+      ;; using the translation file that many systems have.
+      (when locale-translation-file-name
+	(with-temp-buffer
+	  (insert-file-contents locale-translation-file-name)
+	  (when (re-search-forward
+		 (concat "^" (regexp-quote locale) ":?[ \t]+") nil t)
+	    (setq locale (buffer-substring (point) (line-end-position))))))
+
       ;; Leave the system locales alone if the caller did not specify
       ;; an explicit locale name, as their defaults are set from
       ;; LC_MESSAGES and LC_TIME, not LC_CTYPE, and the user might not
@@ -2491,14 +2413,16 @@
 
       (setq locale (downcase locale))
 
-      (configure-display-for-locale locale)
-
       (let ((language-name
 	     (locale-name-match locale locale-language-names))
 	    (charset-language-name
 	     (locale-name-match locale locale-charset-language-names))
 	    (coding-system
-	     (get-locale-coding-system locale)))
+	     (or (locale-name-match locale locale-preferred-coding-systems)
+		 (when locale
+		   (if (string-match "\\.\\([^@]+\\)" locale)
+		       (locale-charset-to-coding-system
+			(match-string 1 locale)))))))
 
 	(if (consp language-name)
 	    ;; locale-language-names specify both lang-env and coding.
@@ -2518,6 +2442,21 @@
 	  ;; to do it for both unibyte and multibyte modes.
 	  (set-language-environment language-name)
 
+	  ;; If default-enable-multibyte-characters is nil,
+	  ;; we are using single-byte characters,
+	  ;; so the display table and terminal coding system are irrelevant.
+	  (when default-enable-multibyte-characters
+	    (set-display-table-and-terminal-coding-system language-name))
+
+	  ;; Set the `keyboard-coding-system' if appropriate (tty
+	  ;; only).  At least X and MS Windows can generate
+	  ;; multilingual input.
+	  (unless window-system
+	    (let ((kcs (or coding-system
+			   (car (get-language-info language-name
+						   'coding-system)))))
+	      (if kcs (set-keyboard-coding-system kcs))))
+
 	  (setq locale-coding-system
 		(car (get-language-info language-name 'coding-priority))))
 
--- a/lisp/progmodes/gdb-ui.el	Wed Mar 23 10:40:00 2005 +0000
+++ b/lisp/progmodes/gdb-ui.el	Wed Mar 23 12:53:42 2005 +0000
@@ -1156,9 +1156,9 @@
   "Icon for disabled breakpoint in display margin.")
 
 ;; Bitmap for breakpoint in fringe
-(when (fboundp 'define-fringe-bitmap)
-  (define-fringe-bitmap 'breakpoint
-    "\x3c\x7e\xff\xff\xff\xff\x7e\x3c"))
+(and (display-images-p)
+     (define-fringe-bitmap 'breakpoint
+       "\x3c\x7e\xff\xff\xff\xff\x7e\x3c"))
 
 (defface breakpoint-enabled
   '((((type tty))
--- a/lisp/term/rxvt.el	Wed Mar 23 10:40:00 2005 +0000
+++ b/lisp/term/rxvt.el	Wed Mar 23 12:53:42 2005 +0000
@@ -26,7 +26,7 @@
 
 ;;; Code:
 
-(eval-when-compile (require 'server))
+(require 'server)
 
 ;; Set up function-key-map entries that termcap and terminfo don't know.
 (let ((map (make-sparse-keymap)))
--- a/lisp/term/x-win.el	Wed Mar 23 10:40:00 2005 +0000
+++ b/lisp/term/x-win.el	Wed Mar 23 12:53:42 2005 +0000
@@ -83,8 +83,7 @@
 (require 'menu-bar)
 (require 'fontset)
 (require 'x-dnd)
-
-(eval-when-compile (require 'server))
+(require 'server)
 
 (defvar x-invocation-args)
 
@@ -2242,7 +2241,7 @@
     (if text
 	(remove-text-properties 0 (length text) '(foreign-selection nil) text))
     text))
-
+      
 ;;; Return the value of the current X selection.
 ;;; Consult the selection, and the cut buffer.  Treat empty strings
 ;;; as if they were unset.
--- a/lisp/term/xterm.el	Wed Mar 23 10:40:00 2005 +0000
+++ b/lisp/term/xterm.el	Wed Mar 23 12:53:42 2005 +0000
@@ -26,7 +26,7 @@
 
 ;;; Code:
 
-(eval-when-compile (require 'server))
+(require 'server)
 
 (let ((map (make-sparse-keymap)))
   (define-key map "\e[A" [up])
--- a/src/termchar.h	Wed Mar 23 10:40:00 2005 +0000
+++ b/src/termchar.h	Wed Mar 23 12:53:42 2005 +0000
@@ -1,5 +1,5 @@
 /* Flags and parameters describing terminal's characteristics.
-   Copyright (C) 1985, 1986, 2003 Free Software Foundation, Inc.
+   Copyright (C) 1985, 1986 Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
--- a/src/xfns.c	Wed Mar 23 10:40:00 2005 +0000
+++ b/src/xfns.c	Wed Mar 23 12:53:42 2005 +0000
@@ -4756,7 +4756,7 @@
   x_default_parameter (f, parms, Qborder_width, make_number (2),
 		       "borderWidth", "BorderWidth", RES_TYPE_NUMBER);
 
-  /* This defaults to 1 in order to match xterm.  We recognize either
+  /* This defaults to 2 in order to match xterm.  We recognize either
      internalBorderWidth or internalBorder (which is what xterm calls
      it).  */
   if (NILP (Fassq (Qinternal_border_width, parms)))
--- a/src/xterm.c	Wed Mar 23 10:40:00 2005 +0000
+++ b/src/xterm.c	Wed Mar 23 12:53:42 2005 +0000
@@ -482,6 +482,7 @@
   /* Nothing to do.  */
 }
 
+
 /* Start update of window W.  Set the global variable updated_window
    to the window being updated and set output_cursor to the cursor
    position of W.  */
@@ -7542,7 +7543,7 @@
 {
   Lisp_Object first = XCAR (old_val);
   Display *dpy = XSAVE_VALUE (first)->pointer;
-  
+
   /* The display may have been closed before this function is called.
      Check if it is still open before calling XSync.  */
   if (x_display_info_for_display (dpy) != 0)
@@ -10618,17 +10619,15 @@
      struct x_display_info *dpyinfo;
 {
   int i;
-  
-  {
-    /* Delete the generic struct display for this X display. */
-    struct display *d;
-    for (d = display_list; d; d = d->next_display)
-      if (d->type == output_x_window && d->display_info.x == dpyinfo)
-        {
-          delete_display (d);
-          break;
-        }
-  }
+  struct display *d;
+
+  /* Delete the generic struct display for this X display. */
+  for (d = display_list; d; d = d->next_display)
+    if (d->type == output_x_window && d->display_info.x == dpyinfo)
+      {
+        delete_display (d);
+        break;
+      }
     
   delete_keyboard_wait_descriptor (dpyinfo->connection);
 
@@ -10826,11 +10825,11 @@
   display->delete_display_hook = x_delete_frame_display;
   
   display->rif = &x_redisplay_interface;
-  display->scroll_region_ok = 1; /* We'll scroll partial frames. */
+  display->scroll_region_ok = 1;    /* We'll scroll partial frames. */
   display->char_ins_del_ok = 1;
-  display->line_ins_del_ok = 1;        /* We'll just blt 'em. */
-  display->fast_clear_end_of_line = 1; /* X does this well. */
-  display->memory_below_frame = 0; /* We don't remember what scrolls
+  display->line_ins_del_ok = 1;         /* We'll just blt 'em. */
+  display->fast_clear_end_of_line = 1;  /* X does this well. */
+  display->memory_below_frame = 0;   /* We don't remember what scrolls
                                         off the bottom. */
 
   return display;