aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorKaroly Lorentey2005-03-23 12:53:42 +0000
committerKaroly Lorentey2005-03-23 12:53:42 +0000
commitdc2be2faa93c237c5645d83e7dbba9578232ab01 (patch)
tree67dd8ba5e1ca2c482e732ab705e9998de0a08867 /lisp
parent76acbdc50490034f233bc78d14a7cd5717d9432e (diff)
downloademacs-dc2be2faa93c237c5645d83e7dbba9578232ab01.tar.gz
emacs-dc2be2faa93c237c5645d83e7dbba9578232ab01.zip
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
Diffstat (limited to 'lisp')
-rw-r--r--lisp/emulation/viper-util.el7
-rw-r--r--lisp/international/mule-cmds.el171
-rw-r--r--lisp/progmodes/gdb-ui.el6
-rw-r--r--lisp/term/rxvt.el2
-rw-r--r--lisp/term/x-win.el5
-rw-r--r--lisp/term/xterm.el2
6 files changed, 66 insertions, 127 deletions
diff --git a/lisp/emulation/viper-util.el b/lisp/emulation/viper-util.el
index a9e908f1c9c..527a04084e2 100644
--- a/lisp/emulation/viper-util.el
+++ b/lisp/emulation/viper-util.el
@@ -100,9 +100,10 @@
100 (fset 'viper-int-to-char (symbol-function 'identity)) 100 (fset 'viper-int-to-char (symbol-function 'identity))
101 (if (viper-window-display-p) 101 (if (viper-window-display-p)
102 (fset 'viper-iconify (symbol-function 'iconify-or-deiconify-frame))) 102 (fset 'viper-iconify (symbol-function 'iconify-or-deiconify-frame)))
103 (fset 'viper-get-face (symbol-function 'internal-get-face)) 103 (cond ((viper-has-face-support-p)
104 (fset 'viper-color-defined-p (symbol-function 'x-color-defined-p)) 104 (fset 'viper-get-face (symbol-function 'internal-get-face))
105 ) 105 (fset 'viper-color-defined-p (symbol-function 'x-color-defined-p))
106 )))
106 ) 107 )
107 108
108 109
diff --git a/lisp/international/mule-cmds.el b/lisp/international/mule-cmds.el
index 3fac3ab6dd9..48434169ef5 100644
--- a/lisp/international/mule-cmds.el
+++ b/lisp/international/mule-cmds.el
@@ -141,7 +141,7 @@
141 t) 141 t)
142(define-key-after set-coding-system-map [set-terminal-coding-system] 142(define-key-after set-coding-system-map [set-terminal-coding-system]
143 '(menu-item "For Terminal" set-terminal-coding-system 143 '(menu-item "For Terminal" set-terminal-coding-system
144 :enable (null (memq window-system '(x w32 mac))) 144 :enable (null (memq initial-window-system '(x w32 mac)))
145 :help "How to encode terminal output") 145 :help "How to encode terminal output")
146 t) 146 t)
147(define-key-after set-coding-system-map [separator-3] 147(define-key-after set-coding-system-map [separator-3]
@@ -2337,115 +2337,6 @@ is returned. Thus, for instance, if charset \"ISO8859-2\",
2337 (pop cs))) 2337 (pop cs)))
2338 (if c (coding-system-base c))))) 2338 (if c (coding-system-base c)))))
2339 2339
2340(defun set-locale-translation-file-name ()
2341 "Set up the locale-translation-file-name on the current system.
2342
2343This needs to be done at runtime for the sake of binaries
2344possibly transported to a system without X."
2345 (setq locale-translation-file-name
2346 (let ((files
2347 '("/usr/lib/X11/locale/locale.alias" ; e.g. X11R6.4
2348 "/usr/X11R6/lib/X11/locale/locale.alias" ; XFree86, e.g. RedHat 4.2
2349 "/usr/openwin/lib/locale/locale.alias" ; e.g. Solaris 2.6
2350 ;;
2351 ;; The following name appears after the X-related names above,
2352 ;; since the X-related names are what X actually uses.
2353 "/usr/share/locale/locale.alias" ; GNU/Linux sans X
2354 )))
2355 (while (and files (not (file-exists-p (car files))))
2356 (setq files (cdr files)))
2357 (car files))))
2358
2359(defun get-locale-real-name (&optional locale-name)
2360 "Return the canonicalized name of locale LOCALE-NAME.
2361
2362LOCALE-NAME should be a string which is the name of a locale supported
2363by the system. Often it is of the form xx_XX.CODE, where xx is a
2364language, XX is a country, and CODE specifies a character set and
2365coding system. For example, the locale name \"ja_JP.EUC\" might name
2366a locale for Japanese in Japan using the `japanese-iso-8bit'
2367coding-system. The name may also have a modifier suffix, e.g. `@euro'
2368or `@cyrillic'.
2369
2370If LOCALE-NAME is nil, its value is taken from the environment
2371variables LC_ALL, LC_CTYPE and LANG (the first one that is set).
2372On server frames, the environment of the emacsclient process is
2373used.
2374
2375See also `set-locale-environment'."
2376 (unless locale-name
2377 ;; Use the first of these three environment variables
2378 ;; that has a nonempty value.
2379 (let ((vars '("LC_ALL" "LC_CTYPE" "LANG")))
2380 (while (and vars
2381 (= 0 (length locale-name))) ; nil or empty string
2382 (setq locale-name (server-getenv (pop vars))))))
2383
2384 (when locale-name
2385 ;; Translate "swedish" into "sv_SE.ISO8859-1", and so on,
2386 ;; using the translation file that many systems have.
2387 (when locale-translation-file-name
2388 (with-temp-buffer
2389 (insert-file-contents locale-translation-file-name)
2390 (when (re-search-forward
2391 (concat "^" (regexp-quote locale-name) ":?[ \t]+") nil t)
2392 (setq locale-name (buffer-substring (point) (line-end-position)))))))
2393 locale-name)
2394
2395(defun get-locale-coding-system (&optional locale)
2396 "Return the coding system corresponding to locale LOCALE."
2397 (setq locale (or locale (get-locale-real-name nil)))
2398 (when locale
2399 (or (locale-name-match locale locale-preferred-coding-systems)
2400 (when locale
2401 (if (string-match "\\.\\([^@]+\\)" locale)
2402 (locale-charset-to-coding-system
2403 (match-string 1 locale)))))))
2404
2405(defun configure-display-for-locale (&optional locale)
2406 "Set up terminal for locale LOCALE.
2407
2408The display table, the terminal coding system and the keyboard
2409coding system of the current display device are set up for the
2410given locale."
2411 (setq locale (or locale (get-locale-real-name nil)))
2412
2413 (when locale
2414 (let ((language-name
2415 (locale-name-match locale locale-language-names))
2416 (charset-language-name
2417 (locale-name-match locale locale-charset-language-names))
2418 (coding-system
2419 (get-locale-coding-system locale)))
2420
2421 ;; Give preference to charset-language-name over language-name.
2422 (if (and charset-language-name
2423 (not
2424 (equal (get-language-info language-name 'charset)
2425 (get-language-info charset-language-name 'charset))))
2426 (setq language-name charset-language-name))
2427
2428 (when language-name
2429
2430 ;; If default-enable-multibyte-characters is nil,
2431 ;; we are using single-byte characters,
2432 ;; so the display table and terminal coding system are irrelevant.
2433 (when default-enable-multibyte-characters
2434 ;; Override default-terminal-coding-system in case the
2435 ;; display coding can not be derived from the language
2436 ;; environment.
2437 (let ((default-terminal-coding-system coding-system))
2438 (set-display-table-and-terminal-coding-system language-name)))
2439
2440 ;; Set the `keyboard-coding-system' if appropriate (tty
2441 ;; only). At least X and MS Windows can generate
2442 ;; multilingual input.
2443 (unless window-system
2444 (let ((kcs (or coding-system
2445 (car (get-language-info language-name
2446 'coding-system)))))
2447 (if kcs (set-keyboard-coding-system kcs))))))))
2448
2449;; Fixme: This ought to deal with the territory part of the locale 2340;; Fixme: This ought to deal with the territory part of the locale
2450;; too, for setting things such as calendar holidays, ps-print paper 2341;; too, for setting things such as calendar holidays, ps-print paper
2451;; size, spelling dictionary. 2342;; size, spelling dictionary.
@@ -2465,8 +2356,6 @@ or `@cyrillic'.
2465 2356
2466If LOCALE-NAME is nil, its value is taken from the environment 2357If LOCALE-NAME is nil, its value is taken from the environment
2467variables LC_ALL, LC_CTYPE and LANG (the first one that is set). 2358variables LC_ALL, LC_CTYPE and LANG (the first one that is set).
2468On server frames, the environment of the emacsclient process is
2469used.
2470 2359
2471The locale names supported by your system can typically be found in a 2360The locale names supported by your system can typically be found in a
2472directory named `/usr/share/locale' or `/usr/lib/locale'. LOCALE-NAME 2361directory named `/usr/share/locale' or `/usr/lib/locale'. LOCALE-NAME
@@ -2477,10 +2366,43 @@ See also `locale-charset-language-names', `locale-language-names',
2477`locale-preferred-coding-systems' and `locale-coding-system'." 2366`locale-preferred-coding-systems' and `locale-coding-system'."
2478 (interactive "sSet environment for locale: ") 2367 (interactive "sSet environment for locale: ")
2479 2368
2480 (let ((locale (get-locale-real-name locale-name))) 2369 ;; Do this at runtime for the sake of binaries possibly transported
2370 ;; to a system without X.
2371 (setq locale-translation-file-name
2372 (let ((files
2373 '("/usr/lib/X11/locale/locale.alias" ; e.g. X11R6.4
2374 "/usr/X11R6/lib/X11/locale/locale.alias" ; XFree86, e.g. RedHat 4.2
2375 "/usr/openwin/lib/locale/locale.alias" ; e.g. Solaris 2.6
2376 ;;
2377 ;; The following name appears after the X-related names above,
2378 ;; since the X-related names are what X actually uses.
2379 "/usr/share/locale/locale.alias" ; GNU/Linux sans X
2380 )))
2381 (while (and files (not (file-exists-p (car files))))
2382 (setq files (cdr files)))
2383 (car files)))
2384
2385 (let ((locale locale-name))
2386
2387 (unless locale
2388 ;; Use the first of these three environment variables
2389 ;; that has a nonempty value.
2390 (let ((vars '("LC_ALL" "LC_CTYPE" "LANG")))
2391 (while (and vars
2392 (= 0 (length locale))) ; nil or empty string
2393 (setq locale (getenv (pop vars))))))
2481 2394
2482 (when locale 2395 (when locale
2483 2396
2397 ;; Translate "swedish" into "sv_SE.ISO8859-1", and so on,
2398 ;; using the translation file that many systems have.
2399 (when locale-translation-file-name
2400 (with-temp-buffer
2401 (insert-file-contents locale-translation-file-name)
2402 (when (re-search-forward
2403 (concat "^" (regexp-quote locale) ":?[ \t]+") nil t)
2404 (setq locale (buffer-substring (point) (line-end-position))))))
2405
2484 ;; Leave the system locales alone if the caller did not specify 2406 ;; Leave the system locales alone if the caller did not specify
2485 ;; an explicit locale name, as their defaults are set from 2407 ;; an explicit locale name, as their defaults are set from
2486 ;; LC_MESSAGES and LC_TIME, not LC_CTYPE, and the user might not 2408 ;; LC_MESSAGES and LC_TIME, not LC_CTYPE, and the user might not
@@ -2491,14 +2413,16 @@ See also `locale-charset-language-names', `locale-language-names',
2491 2413
2492 (setq locale (downcase locale)) 2414 (setq locale (downcase locale))
2493 2415
2494 (configure-display-for-locale locale)
2495
2496 (let ((language-name 2416 (let ((language-name
2497 (locale-name-match locale locale-language-names)) 2417 (locale-name-match locale locale-language-names))
2498 (charset-language-name 2418 (charset-language-name
2499 (locale-name-match locale locale-charset-language-names)) 2419 (locale-name-match locale locale-charset-language-names))
2500 (coding-system 2420 (coding-system
2501 (get-locale-coding-system locale))) 2421 (or (locale-name-match locale locale-preferred-coding-systems)
2422 (when locale
2423 (if (string-match "\\.\\([^@]+\\)" locale)
2424 (locale-charset-to-coding-system
2425 (match-string 1 locale)))))))
2502 2426
2503 (if (consp language-name) 2427 (if (consp language-name)
2504 ;; locale-language-names specify both lang-env and coding. 2428 ;; locale-language-names specify both lang-env and coding.
@@ -2518,6 +2442,21 @@ See also `locale-charset-language-names', `locale-language-names',
2518 ;; to do it for both unibyte and multibyte modes. 2442 ;; to do it for both unibyte and multibyte modes.
2519 (set-language-environment language-name) 2443 (set-language-environment language-name)
2520 2444
2445 ;; If default-enable-multibyte-characters is nil,
2446 ;; we are using single-byte characters,
2447 ;; so the display table and terminal coding system are irrelevant.
2448 (when default-enable-multibyte-characters
2449 (set-display-table-and-terminal-coding-system language-name))
2450
2451 ;; Set the `keyboard-coding-system' if appropriate (tty
2452 ;; only). At least X and MS Windows can generate
2453 ;; multilingual input.
2454 (unless window-system
2455 (let ((kcs (or coding-system
2456 (car (get-language-info language-name
2457 'coding-system)))))
2458 (if kcs (set-keyboard-coding-system kcs))))
2459
2521 (setq locale-coding-system 2460 (setq locale-coding-system
2522 (car (get-language-info language-name 'coding-priority)))) 2461 (car (get-language-info language-name 'coding-priority))))
2523 2462
diff --git a/lisp/progmodes/gdb-ui.el b/lisp/progmodes/gdb-ui.el
index c71f067ca2c..2a714e84b9a 100644
--- a/lisp/progmodes/gdb-ui.el
+++ b/lisp/progmodes/gdb-ui.el
@@ -1156,9 +1156,9 @@ static char *magick[] = {
1156 "Icon for disabled breakpoint in display margin.") 1156 "Icon for disabled breakpoint in display margin.")
1157 1157
1158;; Bitmap for breakpoint in fringe 1158;; Bitmap for breakpoint in fringe
1159(when (fboundp 'define-fringe-bitmap) 1159(and (display-images-p)
1160 (define-fringe-bitmap 'breakpoint 1160 (define-fringe-bitmap 'breakpoint
1161 "\x3c\x7e\xff\xff\xff\xff\x7e\x3c")) 1161 "\x3c\x7e\xff\xff\xff\xff\x7e\x3c"))
1162 1162
1163(defface breakpoint-enabled 1163(defface breakpoint-enabled
1164 '((((type tty)) 1164 '((((type tty))
diff --git a/lisp/term/rxvt.el b/lisp/term/rxvt.el
index 3dbea1d46b2..32f7900ed75 100644
--- a/lisp/term/rxvt.el
+++ b/lisp/term/rxvt.el
@@ -26,7 +26,7 @@
26 26
27;;; Code: 27;;; Code:
28 28
29(eval-when-compile (require 'server)) 29(require 'server)
30 30
31;; Set up function-key-map entries that termcap and terminfo don't know. 31;; Set up function-key-map entries that termcap and terminfo don't know.
32(let ((map (make-sparse-keymap))) 32(let ((map (make-sparse-keymap)))
diff --git a/lisp/term/x-win.el b/lisp/term/x-win.el
index 12e87e3bee5..aa0d1fa09c4 100644
--- a/lisp/term/x-win.el
+++ b/lisp/term/x-win.el
@@ -83,8 +83,7 @@
83(require 'menu-bar) 83(require 'menu-bar)
84(require 'fontset) 84(require 'fontset)
85(require 'x-dnd) 85(require 'x-dnd)
86 86(require 'server)
87(eval-when-compile (require 'server))
88 87
89(defvar x-invocation-args) 88(defvar x-invocation-args)
90 89
@@ -2242,7 +2241,7 @@ order until succeed.")
2242 (if text 2241 (if text
2243 (remove-text-properties 0 (length text) '(foreign-selection nil) text)) 2242 (remove-text-properties 0 (length text) '(foreign-selection nil) text))
2244 text)) 2243 text))
2245 2244
2246;;; Return the value of the current X selection. 2245;;; Return the value of the current X selection.
2247;;; Consult the selection, and the cut buffer. Treat empty strings 2246;;; Consult the selection, and the cut buffer. Treat empty strings
2248;;; as if they were unset. 2247;;; as if they were unset.
diff --git a/lisp/term/xterm.el b/lisp/term/xterm.el
index 042df933989..431825d181a 100644
--- a/lisp/term/xterm.el
+++ b/lisp/term/xterm.el
@@ -26,7 +26,7 @@
26 26
27;;; Code: 27;;; Code:
28 28
29(eval-when-compile (require 'server)) 29(require 'server)
30 30
31(let ((map (make-sparse-keymap))) 31(let ((map (make-sparse-keymap)))
32 (define-key map "\e[A" [up]) 32 (define-key map "\e[A" [up])