Mercurial > emacs
annotate lisp/case-table.el @ 1717:aa7d6d57504b
* frame.h (struct frame): New fields `can_have_scrollbars' and
`has_vertical_scrollbars'.
(FRAME_CAN_HAVE_SCROLLBARS, FRAME_HAS_VERTICAL_SCROLLBARS): New
accessors, for both the MULTI_FRAME and non-MULTI_FRAME.
(VERTICAL_SCROLLBAR_WIDTH, WINDOW_VERTICAL_SCROLLBAR,
WINDOW_VERTICAL_SCROLLBAR_COLUMN,
WINDOW_VERTICAL_SCROLLBAR_HEIGHT): New macros.
* window.h (struct window): New field `vertical_scrollbar'.
* xterm.h (struct x_display): vertical_scrollbars,
judge_timestamp, vertical_scrollbar_extra: New fields.
(struct scrollbar): New struct.
(VERTICAL_SCROLLBAR_PIXEL_WIDTH, VERTICAL_SCROLLBAR_PIXEL_HEIGHT,
VERTICAL_SCROLLBAR_LEFT_BORDER, VERTICAL_SCROLLBAR_RIGHT_BORDER,
VERTICAL_SCROLLBAR_TOP_BORDER, VERTICAL_SCROLLBAR_BOTTOM_BORDER,
CHAR_TO_PIXEL_WIDTH, CHAR_TO_PIXEL_HEIGHT, PIXEL_TO_CHAR_WIDTH,
PIXEL_TO_CHAR_HEIGHT): New accessors and macros.
* frame.c (make_frame): Initialize the `can_have_scrollbars' and
`has_vertical_scrollbars' fields of the frame.
* term.c (term_init): Note that TERMCAP terminals don't support
scrollbars.
(mouse_position_hook): Document new args.
(set_vertical_scrollbar_hook, condemn_scrollbars_hook,
redeem_scrollbar_hook, judge_scrollbars_hook): New hooks.
* termhooks.h: Declare and document them.
(enum scrollbar_part): New type.
(struct input_event): Describe the new form of the scrollbar_click
event type. Change `part' from a Lisp_Object to an enum
scrollbar_part. Add a new field `scrollbar'.
* keyboard.c (kbd_buffer_get_event): Pass appropriate new
parameters to *mouse_position_hook, and make_lispy_movement.
* xfns.c (x_set_vertical_scrollbar): New function.
(x_figure_window_size): Use new macros to calculate frame size.
(Fx_create_frame): Note that X Windows frames do support scroll
bars. Default to "yes".
* xterm.c: #include <X11/cursorfont.h> and "window.h".
(x_vertical_scrollbar_cursor): New variable.
(x_term_init): Initialize it.
(last_mouse_bar, last_mouse_bar_frame, last_mouse_part,
last_mouse_scroll_range_start, last_mouse_scroll_range_end): New
variables.
(XTmouse_position): Use them to return scrollbar movement events.
Take new arguments, for that purpose.
(x_window_to_scrollbar, x_scrollbar_create,
x_scrollbar_set_handle, x_scrollbar_remove, x_scrollbar_move,
XTset_scrollbar, XTcondemn_scrollbars, XTredeem_scrollbar,
XTjudge_scrollbars, x_scrollbar_expose,
x_scrollbar_background_expose, x_scrollbar_handle_click,
x_scrollbar_handle_motion): New functions to implement scrollbars.
(x_term_init): Set the termhooks.h hooks to point to them.
(x_set_window_size): Use new macros to calculate frame size. Set
vertical_scrollbar_extra field.
(x_make_frame_visible): Use the frame accessor
FRAME_HAS_VERTICAL_SCROLLBARS to decide if we need to map the
frame's subwindows as well.
(XTread_socket): Use new size-calculation macros from xterm.h when
processing ConfigureNotify events.
(x_wm_set_size_hint): Use PIXEL_TO_CHAR_WIDTH and
PIXEL_TO_CHAR_HEIGHT macros.
* ymakefile (xdisp.o): This now depends on termhooks.h.
(xterm.o): This now depends on window.h.
| author | Jim Blandy <jimb@redhat.com> |
|---|---|
| date | Thu, 24 Dec 1992 06:17:18 +0000 |
| parents | 08045dee5b71 |
| children | bd3c525fa6fc |
| rev | line source |
|---|---|
|
807
4f28bd14272c
*** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
696
diff
changeset
|
1 ;;; case-table.el ---code to extend the character set and support case tables. |
|
4f28bd14272c
*** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
696
diff
changeset
|
2 |
|
846
20674ae6bf52
*** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
807
diff
changeset
|
3 ;; Copyright (C) 1988 Free Software Foundation, Inc. |
|
20674ae6bf52
*** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
807
diff
changeset
|
4 |
|
807
4f28bd14272c
*** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
696
diff
changeset
|
5 ;; Author: Howard Gayle |
|
4f28bd14272c
*** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
696
diff
changeset
|
6 ;; Maintainer: FSF |
|
846
20674ae6bf52
*** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
807
diff
changeset
|
7 ;; Keywords: i14n |
| 36 | 8 |
| 9 ;; This file is part of GNU Emacs. | |
| 10 | |
| 11 ;; GNU Emacs is free software; you can redistribute it and/or modify | |
| 12 ;; it under the terms of the GNU General Public License as published by | |
|
807
4f28bd14272c
*** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
696
diff
changeset
|
13 ;; the Free Software Foundation; either version 2, or (at your option) |
| 36 | 14 ;; any later version. |
| 15 | |
| 16 ;; GNU Emacs is distributed in the hope that it will be useful, | |
| 17 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 18 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| 19 ;; GNU General Public License for more details. | |
| 20 | |
| 21 ;; You should have received a copy of the GNU General Public License | |
| 22 ;; along with GNU Emacs; see the file COPYING. If not, write to | |
| 23 ;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. | |
| 24 | |
|
807
4f28bd14272c
*** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
696
diff
changeset
|
25 ;;; Commentary: |
| 36 | 26 |
| 27 ;; Written by: | |
| 28 ;; TN/ETX/TX/UMG Howard Gayle UUCP : seismo!enea!erix!howard | |
| 29 ;; Telefonaktiebolaget L M Ericsson Phone: +46 8 719 55 65 | |
| 30 ;; Ericsson Telecom Telex: 14910 ERIC S | |
| 31 ;; S-126 25 Stockholm FAX : +46 8 719 64 82 | |
| 32 ;; Sweden | |
| 33 | |
|
807
4f28bd14272c
*** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
696
diff
changeset
|
34 ;;; Code: |
|
4f28bd14272c
*** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
696
diff
changeset
|
35 |
| 36 | 36 (defun describe-buffer-case-table () |
| 37 "Describe the case table of the current buffer." | |
| 38 (interactive) | |
| 39 (let ((vector (make-vector 256 nil)) | |
| 40 (case-table (current-case-table)) | |
| 41 (i 0)) | |
| 42 (while (< i 256) | |
| 43 (aset vector i | |
| 44 (cond ((/= ch (downcase ch)) | |
| 45 (concat "uppercase, matches " | |
| 46 (text-char-description (downcase ch)))) | |
| 47 ((/= ch (upcase ch)) | |
| 48 (concat "lowercase, matches " | |
| 49 (text-char-description (upcase ch)))) | |
| 50 (t "case-invariant"))) | |
| 860 | 51 (setq i (1+ i))) |
| 52 (with-output-to-temp-buffer "*Help*" | |
| 53 (describe-vector vector)))) | |
| 36 | 54 |
|
696
904853a03d9a
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
662
diff
changeset
|
55 (defun set-case-syntax-delims (l r string) |
| 36 | 56 "Make characters L and R a matching pair of non-case-converting delimiters. |
|
696
904853a03d9a
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
662
diff
changeset
|
57 Sets the entries for L and R in STRING, which is a downcasing table. |
|
904853a03d9a
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
662
diff
changeset
|
58 Also modifies `standard-syntax-table', and `text-mode-syntax-table' to |
|
904853a03d9a
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
662
diff
changeset
|
59 indicate left and right delimiters." |
|
904853a03d9a
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
662
diff
changeset
|
60 (aset string l l) |
|
904853a03d9a
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
662
diff
changeset
|
61 (aset string r r) |
| 36 | 62 (modify-syntax-entry l (concat "(" (char-to-string r) " ") |
| 63 (standard-syntax-table)) | |
| 64 (modify-syntax-entry l (concat "(" (char-to-string r) " ") | |
| 65 text-mode-syntax-table) | |
| 66 (modify-syntax-entry r (concat ")" (char-to-string l) " ") | |
| 67 (standard-syntax-table)) | |
| 68 (modify-syntax-entry r (concat ")" (char-to-string l) " ") | |
| 69 text-mode-syntax-table)) | |
| 70 | |
|
696
904853a03d9a
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
662
diff
changeset
|
71 (defun set-case-syntax-pair (uc lc string) |
| 36 | 72 "Make characters UC and LC a pair of inter-case-converting letters. |
|
696
904853a03d9a
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
662
diff
changeset
|
73 Sets the entries for characters UC and LC in STRING, which is a downcasing table. |
|
904853a03d9a
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
662
diff
changeset
|
74 Also modify `standard-syntax-table' and `text-mode-syntax-table' to indicate an |
| 584 | 75 (uppercase, lowercase) pair of letters." |
|
696
904853a03d9a
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
662
diff
changeset
|
76 (aset string uc lc) |
|
904853a03d9a
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
662
diff
changeset
|
77 (aset (car (cdr (standard-case-table))) lc uc) |
| 36 | 78 (modify-syntax-entry lc "w " (standard-syntax-table)) |
| 79 (modify-syntax-entry lc "w " text-mode-syntax-table) | |
| 80 (modify-syntax-entry uc "w " (standard-syntax-table)) | |
| 81 (modify-syntax-entry uc "w " text-mode-syntax-table)) | |
| 82 | |
|
696
904853a03d9a
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
662
diff
changeset
|
83 (defun set-case-syntax (c syntax string) |
| 36 | 84 "Make characters C case-invariant with syntax SYNTAX. |
|
696
904853a03d9a
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
662
diff
changeset
|
85 Sets the entries for character C in STRING, which is the downcasing table. |
|
904853a03d9a
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
662
diff
changeset
|
86 Also modify `standard-syntax-table' and `text-mode-syntax-table'. |
| 36 | 87 SYNTAX should be \" \", \"w\", \".\" or \"_\"." |
|
696
904853a03d9a
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
662
diff
changeset
|
88 (aset string c c) |
| 36 | 89 (modify-syntax-entry c syntax (standard-syntax-table)) |
| 90 (modify-syntax-entry c syntax text-mode-syntax-table)) | |
| 91 | |
| 92 (provide 'case-table) | |
|
662
8a533acedb77
*** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
584
diff
changeset
|
93 |
|
8a533acedb77
*** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents:
584
diff
changeset
|
94 ;;; case-table.el ends here |
