diff options
| author | Karoly Lorentey | 2005-05-03 03:01:09 +0000 |
|---|---|---|
| committer | Karoly Lorentey | 2005-05-03 03:01:09 +0000 |
| commit | 97c57fb2b8d271b2beba317c6213ab34190bfac7 (patch) | |
| tree | c91313543365d663d8cf3ee6905043380514dcd4 /README.multi-tty | |
| parent | 2f420fa825c961636dd4d0cf183b919bc4fe457a (diff) | |
| download | emacs-97c57fb2b8d271b2beba317c6213ab34190bfac7.tar.gz emacs-97c57fb2b8d271b2beba317c6213ab34190bfac7.zip | |
Support for ttys with different character locale settings.
* lisp/server.el (server-process-filter): Set locale environment
variables from client while creating tty frames.
* lisp/faces.el (tty-create-frame-with-faces): Call set-locale-environment.
* lisp/international/mule-cmds.el (set-display-table-and-terminal-coding-system):
Add DISPLAY parameter. Pass it to set-terminal-coding-system.
(set-locale-environment): Add DISPLAY parameter.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-340
Diffstat (limited to 'README.multi-tty')
| -rw-r--r-- | README.multi-tty | 170 |
1 files changed, 89 insertions, 81 deletions
diff --git a/README.multi-tty b/README.multi-tty index c5230c0ca54..4ad9f990a82 100644 --- a/README.multi-tty +++ b/README.multi-tty | |||
| @@ -257,69 +257,72 @@ extremely unstable X server for some time while I was developing these | |||
| 257 | patches, and running Emacs this way has saved me a number of M-x | 257 | patches, and running Emacs this way has saved me a number of M-x |
| 258 | recover-session invocations.) | 258 | recover-session invocations.) |
| 259 | 259 | ||
| 260 | I use the following two bash functions to handle my Emacs sessions: | 260 | I use the following two bash scripts to handle my Emacs sessions: |
| 261 | 261 | ||
| 262 | ,----[ ~/.bash_profile | 262 | -------------------------------------------------------connect-emacs-- |
| 263 | | # Usage: preload_emacs <name> [<waitp>] | 263 | #!/bin/bash |
| 264 | | # | 264 | # Usage: connect-emacs <name> <args>... |
| 265 | | # Preloads the Emacs instance called NAME in a detached screen | 265 | # |
| 266 | | # session. Does nothing if the instance is already running. If WAITP | 266 | # Connects to the Emacs instance called NAME. Starts up the instance |
| 267 | | # is non-empty, the function waits until the server starts up and | 267 | # if it is not already running. The rest of the arguments are passed |
| 268 | | # creates its socket; otherwise it returns immediately. | 268 | # to emacsclient. |
| 269 | | function preload_emacs { | 269 | |
| 270 | | local name="$1" | 270 | name="$1" |
| 271 | | local waitp="$2" | 271 | shift |
| 272 | | local screendir="/var/run/screen/S-$USER" | 272 | |
| 273 | | local serverdir="/tmp/emacs$UID" | 273 | if [ -z "$name" ]; then |
| 274 | | local emacs=emacs # Or wherever you installed your multi-tty Emacs | 274 | echo "Usage: connect_emacs <name> <args>..." >&2 |
| 275 | | | 275 | exit 1 |
| 276 | | if [ -z "$name" ]; then | 276 | fi |
| 277 | | echo "Usage: preload_emacs <name> [<waitp>]" >&2 | 277 | preload-emacs "$name" wait |
| 278 | | return 1 | 278 | /usr/bin/emacsclient.emacs-multi-tty -s "$name" "$@" |
| 279 | | fi | 279 | ---------------------------------------------------------------------- |
| 280 | | | 280 | |
| 281 | | if [ ! -e "$screendir"/*."$name" ]; then | 281 | -------------------------------------------------------preload-emacs-- |
| 282 | | if [ -e "$serverdir/$name" ]; then | 282 | #!/bin/bash |
| 283 | | # Delete leftover socket (for the wait option) | 283 | # Usage: preload-emacs <name> [<waitp>] |
| 284 | | rm "$serverdir/$name" | 284 | # |
| 285 | | fi | 285 | # Preloads the Emacs instance called NAME in a detached screen |
| 286 | | screen -dmS "$name" "$emacs" -nw --eval "(setq server-name \"$name\")" -f server-start | 286 | # session. Does nothing if the instance is already running. If WAITP |
| 287 | | fi | 287 | # is non-empty, the function waits until the server starts up and |
| 288 | | if [ ! -z "$waitp" ]; then | 288 | # creates its socket; otherwise it returns immediately. |
| 289 | | while [ ! -e "$serverdir/$name" ]; do sleep 0.1; done | 289 | |
| 290 | | fi | 290 | name="$1" |
| 291 | | return 0 | 291 | waitp="$2" |
| 292 | | } | 292 | screendir="/var/run/screen/S-$USER" |
| 293 | | | 293 | serverdir="/tmp/emacs$UID" |
| 294 | | # Usage: connect_emacs <name> <args>... | 294 | emacs=/usr/bin/emacs-multi-tty # Or wherever you installed your multi-tty Emacs |
| 295 | | # | 295 | |
| 296 | | # Connects to the Emacs instance called NAME. Starts up the instance | 296 | if [ -z "$name" ]; then |
| 297 | | # if it is not already running. The rest of the arguments are passed | 297 | echo "Usage: preload_emacs <name> [<waitp>]" >&2 |
| 298 | | # to emacsclient. | 298 | exit 1 |
| 299 | | function connect_emacs { | 299 | fi |
| 300 | | local name="$1" | 300 | |
| 301 | | shift | 301 | if [ ! -e "$screendir"/*."$name" ]; then |
| 302 | | | 302 | if [ -e "$serverdir/$name" ]; then |
| 303 | | if [ -z "$name" ]; then | 303 | # Delete leftover socket (for the wait option) |
| 304 | | echo "Usage: connect_emacs <name> <args>..." >&2 | 304 | rm "$serverdir/$name" |
| 305 | | fi | 305 | fi |
| 306 | | preload_emacs "$name" wait | 306 | screen -dmS "$name" "$emacs" -nw --eval "(setq server-name \"$name\")" -f server-start |
| 307 | | emacsclient -s "$name" "$@" | 307 | fi |
| 308 | | } | 308 | if [ ! -z "$waitp" ]; then |
| 309 | | | 309 | while [ ! -e "$serverdir/$name" ]; do sleep 0.1; done |
| 310 | | export -f preload_emacs connect_emacs | 310 | fi |
| 311 | | | 311 | ---------------------------------------------------------------------- |
| 312 | | # Preload editor and gnus sessions for speedy initial connects. | 312 | |
| 313 | | preload_emacs editor | 313 | I have the following in my profile to have two instances automatically |
| 314 | | preload_emacs gnus | 314 | preloaded for editing and email: |
| 315 | `---- | 315 | |
| 316 | 316 | preload-emacs editor | |
| 317 | ,----[ ~/.bashrc | 317 | preload-emacs gnus |
| 318 | | alias gnus="connect_emacs gnus" | 318 | |
| 319 | | alias edit="connect_emacs editor" | 319 | It is useful to set up short aliases for connect-emacs. I use the |
| 320 | | alias et="connect_emacs editor -t" | 320 | following: |
| 321 | | alias e=edit | 321 | |
| 322 | `---- | 322 | alias edit="connect-emacs editor" |
| 323 | alias e=edit | ||
| 324 | alias et="connect-emacs editor -t" | ||
| 325 | alias gnus="connect-emacs gnus" | ||
| 323 | 326 | ||
| 324 | 327 | ||
| 325 | NEWS | 328 | NEWS |
| @@ -406,21 +409,23 @@ THINGS TO DO | |||
| 406 | ** rif->flush_display_optional (NULL) calls should be replaced by a | 409 | ** rif->flush_display_optional (NULL) calls should be replaced by a |
| 407 | new global function. | 410 | new global function. |
| 408 | 411 | ||
| 409 | ** Support multiple character locales. | 412 | ** The set-locale-environment hack (adding the DISPLAY option) should |
| 413 | be replaced with a clean design. | ||
| 410 | 414 | ||
| 411 | (1) A version of `set-locale-environment' needs to be written | 415 | ** standard-display-table should be display-local. |
| 412 | for setting up display-local settings on ttys. I think | 416 | standard-display-european should be display-local. |
| 413 | calling set-display-table-and-terminal-coding-system and | ||
| 414 | set-keyboard-coding-system would be enough. The language | ||
| 415 | environment itself should remain a global setting. | ||
| 416 | 417 | ||
| 417 | (2) Have a look at Vlocale_coding_system. Seems like it would | 418 | ** Fix set-input-mode for multi-tty. It's a truly horrible interface; |
| 418 | be a tedious job to localize it, although most references | 419 | what if we'd blow it up into several separate functions (with a |
| 419 | use it for interfacing with libc and are therefore OK with | 420 | compatibility definition)? |
| 420 | the global definition. | ||
| 421 | 421 | ||
| 422 | Exceptions found so far: x-select-text and | 422 | ** Have a look at Vlocale_coding_system. Seems like it would be a |
| 423 | x-cut-buffer-or-selection-value. | 423 | tedious job to localize it, although most references use it for |
| 424 | interfacing with libc and are therefore OK with the global | ||
| 425 | definition. | ||
| 426 | |||
| 427 | Exceptions found so far: x-select-text and | ||
| 428 | x-cut-buffer-or-selection-value. | ||
| 424 | 429 | ||
| 425 | ** Have a look at fatal_error_hook. | 430 | ** Have a look at fatal_error_hook. |
| 426 | 431 | ||
| @@ -440,10 +445,6 @@ THINGS TO DO | |||
| 440 | 445 | ||
| 441 | (This is likely an error in the CVS trunk.) | 446 | (This is likely an error in the CVS trunk.) |
| 442 | 447 | ||
| 443 | ** Fix set-input-mode for multi-tty. It's a truly horrible interface; | ||
| 444 | what if we'd blow it up into several separate functions (with a | ||
| 445 | compatibility definition)? | ||
| 446 | |||
| 447 | ** The terminal customization files in term/*.el tend to change global | 448 | ** The terminal customization files in term/*.el tend to change global |
| 448 | parameters, which may confuse Emacs with multiple displays. Change | 449 | parameters, which may confuse Emacs with multiple displays. Change |
| 449 | them to tweak only frame-local settings, if possible. (They tend | 450 | them to tweak only frame-local settings, if possible. (They tend |
| @@ -497,8 +498,6 @@ THINGS TO DO | |||
| 497 | that's why raw terminal support is broken again. I really do need | 498 | that's why raw terminal support is broken again. I really do need |
| 498 | to understand input.) | 499 | to understand input.) |
| 499 | 500 | ||
| 500 | ** Maybe standard-display-table should be display-local. | ||
| 501 | |||
| 502 | DIARY OF CHANGES | 501 | DIARY OF CHANGES |
| 503 | ---------------- | 502 | ---------------- |
| 504 | 503 | ||
| @@ -1042,4 +1041,13 @@ DIARY OF CHANGES | |||
| 1042 | 1041 | ||
| 1043 | (Nothing to do. It doesn't seem ugly any more. It's rather clever.) | 1042 | (Nothing to do. It doesn't seem ugly any more. It's rather clever.) |
| 1044 | 1043 | ||
| 1044 | -- Support multiple character locales. A version of | ||
| 1045 | `set-locale-environment' needs to be written for setting up | ||
| 1046 | display-local settings on ttys. I think calling | ||
| 1047 | set-display-table-and-terminal-coding-system and | ||
| 1048 | set-keyboard-coding-system would be enough. The language | ||
| 1049 | environment itself should remain a global setting. | ||
| 1050 | |||
| 1051 | (Done, by an ugly hack.) | ||
| 1052 | |||
| 1045 | ;;; arch-tag: 8da1619e-2e79-41a8-9ac9-a0485daad17d | 1053 | ;;; arch-tag: 8da1619e-2e79-41a8-9ac9-a0485daad17d |