diff options
| author | Karoly Lorentey | 2005-11-07 14:17:18 +0000 |
|---|---|---|
| committer | Karoly Lorentey | 2005-11-07 14:17:18 +0000 |
| commit | 9684e4c92f12f7c31f5e6fda7742960b403395f6 (patch) | |
| tree | 7dd95b31d3bfecc050a31d791c654e8d3b9669fc | |
| parent | cd0cf71c4f41023a8d9c20b3a26e44b980992b5a (diff) | |
| download | emacs-9684e4c92f12f7c31f5e6fda7742960b403395f6.tar.gz emacs-9684e4c92f12f7c31f5e6fda7742960b403395f6.zip | |
Update frames-on-display-list to accept terminal id numbers.
* lisp/frame.el (frames-on-display-list): Use terminal-id to get the
display id.
(terminal-id): Also accept X display strings and tty device names.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-436
| -rw-r--r-- | README.multi-tty | 39 | ||||
| -rw-r--r-- | lisp/frame.el | 33 |
2 files changed, 44 insertions, 28 deletions
diff --git a/README.multi-tty b/README.multi-tty index 2bba1b9bcb5..ab43fc7c4e1 100644 --- a/README.multi-tty +++ b/README.multi-tty | |||
| @@ -424,9 +424,6 @@ THINGS TO DO | |||
| 424 | instead of delete-frame-functions), | 424 | instead of delete-frame-functions), |
| 425 | after-delete-terminal-functions, after-create-terminal-functions. | 425 | after-delete-terminal-functions, after-create-terminal-functions. |
| 426 | 426 | ||
| 427 | ** If the first key pressed on a new tty terminal is a function key, | ||
| 428 | it is not recognized correctly. May be related to the bug below. | ||
| 429 | |||
| 430 | ** Fix set-input-mode for multi-tty. It's a truly horrible interface; | 427 | ** Fix set-input-mode for multi-tty. It's a truly horrible interface; |
| 431 | what if we'd blow it up into several separate functions (with a | 428 | what if we'd blow it up into several separate functions (with a |
| 432 | compatibility definition)? | 429 | compatibility definition)? |
| @@ -472,20 +469,6 @@ THINGS TO DO | |||
| 472 | frame-display terminal-of-frame | 469 | frame-display terminal-of-frame |
| 473 | delete-display delete-terminal | 470 | delete-display delete-terminal |
| 474 | 471 | ||
| 475 | ** The semantics of terminal-local variables are confusing; it is not | ||
| 476 | clear what binding is in effect in any given time. See if | ||
| 477 | current_kboard (or at least the terminal-local bindings exported to | ||
| 478 | Lisp) might be changed to be tied to the selected frame instead. | ||
| 479 | Currently, `function-key-map' and `key-translation-map' may be | ||
| 480 | accessed reliably only using the hackish | ||
| 481 | `(set-)terminal-local-value' functions. | ||
| 482 | |||
| 483 | Perhaps there should be a difference between `last-command' &co. | ||
| 484 | and these more conventional configuration variables. | ||
| 485 | (E.g. `symbol-value' would use current_kboard to access | ||
| 486 | `last-command', but SELECTED_FRAME()->display->kboard to get the | ||
| 487 | value of `function-key-map'. | ||
| 488 | |||
| 489 | ** The single-keyboard mode of MULTI_KBOARD is extremely confusing | 472 | ** The single-keyboard mode of MULTI_KBOARD is extremely confusing |
| 490 | sometimes; Emacs does not respond to stimuli from other keyboards. | 473 | sometimes; Emacs does not respond to stimuli from other keyboards. |
| 491 | At least a beep or a message would be important, if the single-mode | 474 | At least a beep or a message would be important, if the single-mode |
| @@ -1261,5 +1244,27 @@ DIARY OF CHANGES | |||
| 1261 | 1244 | ||
| 1262 | (Done in patch-431.) | 1245 | (Done in patch-431.) |
| 1263 | 1246 | ||
| 1247 | -- The semantics of terminal-local variables are confusing; it is not | ||
| 1248 | clear what binding is in effect in any given time. See if | ||
| 1249 | current_kboard (or at least the terminal-local bindings exported to | ||
| 1250 | Lisp) might be changed to be tied to the selected frame instead. | ||
| 1251 | Currently, `function-key-map' and `key-translation-map' may be | ||
| 1252 | accessed reliably only using the hackish | ||
| 1253 | `(set-)terminal-local-value' functions. | ||
| 1254 | |||
| 1255 | Perhaps there should be a difference between `last-command' &co. | ||
| 1256 | and these more conventional configuration variables. | ||
| 1257 | (E.g. `symbol-value' would use current_kboard to access | ||
| 1258 | `last-command', but SELECTED_FRAME()->display->kboard to get the | ||
| 1259 | value of `function-key-map'. | ||
| 1260 | |||
| 1261 | (Fixed in patch-434.) | ||
| 1262 | |||
| 1263 | -- If the first key pressed on a new tty terminal is a function key, | ||
| 1264 | it is not recognized correctly. May be related to the bug below. | ||
| 1265 | |||
| 1266 | (Seems to have been fixed as a side effect of patch-434. "The bug | ||
| 1267 | below" was the set-input-mode madness.) | ||
| 1268 | |||
| 1264 | ;;; arch-tag: 8da1619e-2e79-41a8-9ac9-a0485daad17d | 1269 | ;;; arch-tag: 8da1619e-2e79-41a8-9ac9-a0485daad17d |
| 1265 | 1270 | ||
diff --git a/lisp/frame.el b/lisp/frame.el index 8342d8e6aac..fb494429fea 100644 --- a/lisp/frame.el +++ b/lisp/frame.el | |||
| @@ -696,17 +696,18 @@ setup is for focus to follow the pointer." | |||
| 696 | (function (lambda (frame) | 696 | (function (lambda (frame) |
| 697 | (eq frame (window-frame (minibuffer-window frame))))))) | 697 | (eq frame (window-frame (minibuffer-window frame))))))) |
| 698 | 698 | ||
| 699 | (defun frames-on-display-list (&optional display) | 699 | (defun frames-on-display-list (&optional terminal) |
| 700 | "Return a list of all frames on DISPLAY. | 700 | "Return a list of all frames on TERMINAL. |
| 701 | 701 | ||
| 702 | DISPLAY should be a display identifier (an integer), but it may | 702 | TERMINAL should be a terminal identifier (an integer), a frame, |
| 703 | also be a name of a display, a string of the form HOST:SERVER.SCREEN. | 703 | or a name of an X display (a string of the form |
| 704 | HOST:SERVER.SCREEN). | ||
| 704 | 705 | ||
| 705 | If DISPLAY is omitted or nil, it defaults to the selected frame's display." | 706 | If TERMINAL is omitted or nil, it defaults to the selected |
| 706 | (let* ((display (or display (frame-display))) | 707 | frame's terminal device." |
| 708 | (let* ((terminal (terminal-id terminal)) | ||
| 707 | (func #'(lambda (frame) | 709 | (func #'(lambda (frame) |
| 708 | (or (eq (frame-display frame) display) | 710 | (eq (frame-display frame) terminal)))) |
| 709 | (equal (frame-parameter frame 'display) display))))) | ||
| 710 | (filtered-frame-list func))) | 711 | (filtered-frame-list func))) |
| 711 | 712 | ||
| 712 | (defun framep-on-display (&optional display) | 713 | (defun framep-on-display (&optional display) |
| @@ -1430,13 +1431,23 @@ Use Custom to set this variable to get the display updated." | |||
| 1430 | (defun terminal-id (terminal) | 1431 | (defun terminal-id (terminal) |
| 1431 | "Return the numerical id of terminal TERMINAL. | 1432 | "Return the numerical id of terminal TERMINAL. |
| 1432 | 1433 | ||
| 1433 | TERMINAL can be a terminal id, a frame, or nil (meaning the | 1434 | TERMINAL can be a terminal id (an integer), a frame, or |
| 1434 | selected frame's terminal)." | 1435 | nil (meaning the selected frame's terminal). Alternatively, |
| 1436 | TERMINAL may be the name of an X display | ||
| 1437 | device (HOST.SERVER.SCREEN) or a tty device file." | ||
| 1435 | (cond | 1438 | (cond |
| 1436 | ((integerp terminal) | 1439 | ((integerp terminal) |
| 1437 | terminal) | 1440 | (if (display-live-p terminal) |
| 1441 | terminal | ||
| 1442 | (signal 'wrong-type-argument (list 'display-live-p terminal)))) | ||
| 1438 | ((or (null terminal) (framep terminal)) | 1443 | ((or (null terminal) (framep terminal)) |
| 1439 | (frame-display terminal)) | 1444 | (frame-display terminal)) |
| 1445 | ((stringp terminal) | ||
| 1446 | (let ((f (car (filtered-frame-list (lambda (frame) | ||
| 1447 | (or (equal (frame-parameter frame 'display) terminal) | ||
| 1448 | (equal (frame-parameter frame 'tty) terminal))))))) | ||
| 1449 | (or f (error "Display %s does not exist" terminal)) | ||
| 1450 | (frame-display f))) | ||
| 1440 | (t | 1451 | (t |
| 1441 | (error "Invalid argument %s in `terminal-id'" terminal)))) | 1452 | (error "Invalid argument %s in `terminal-id'" terminal)))) |
| 1442 | 1453 | ||