608 |
The return value is of the form |
The return value is of the form |
609 |
(WINDOW BUFFER-POSITION (X . Y) TIMESTAMP) |
(WINDOW BUFFER-POSITION (X . Y) TIMESTAMP) |
610 |
The `posn-' functions access elements of such lists." |
The `posn-' functions access elements of such lists." |
611 |
(nth 1 event)) |
(if (consp event) (nth 1 event) |
612 |
|
(list (selected-window) (point) '(0 . 0) 0))) |
613 |
|
|
614 |
(defsubst event-end (event) |
(defsubst event-end (event) |
615 |
"Return the ending location of EVENT. EVENT should be a click or drag event. |
"Return the ending location of EVENT. EVENT should be a click or drag event. |
617 |
The return value is of the form |
The return value is of the form |
618 |
(WINDOW BUFFER-POSITION (X . Y) TIMESTAMP) |
(WINDOW BUFFER-POSITION (X . Y) TIMESTAMP) |
619 |
The `posn-' functions access elements of such lists." |
The `posn-' functions access elements of such lists." |
620 |
(nth (if (consp (nth 2 event)) 2 1) event)) |
(if (consp event) (nth (if (consp (nth 2 event)) 2 1) event) |
621 |
|
(list (selected-window) (point) '(0 . 0) 0))) |
622 |
|
|
623 |
(defsubst event-click-count (event) |
(defsubst event-click-count (event) |
624 |
"Return the multi-click count of EVENT, a click or drag event. |
"Return the multi-click count of EVENT, a click or drag event. |
625 |
The return value is a positive integer." |
The return value is a positive integer." |
626 |
(if (integerp (nth 2 event)) (nth 2 event) 1)) |
(if (and (consp event) (integerp (nth 2 event))) (nth 2 event) 1)) |
627 |
|
|
628 |
(defsubst posn-window (position) |
(defsubst posn-window (position) |
629 |
"Return the window in POSITION. |
"Return the window in POSITION. |
1035 |
:type '(choice (const 8) (const 10) (const 16)) |
:type '(choice (const 8) (const 10) (const 16)) |
1036 |
:group 'editing-basics) |
:group 'editing-basics) |
1037 |
|
|
1038 |
|
(defun read-key (&optional prompt) |
1039 |
|
"Read a key from the keyboard. |
1040 |
|
Contrary to `read-event' this will not return a raw event but will |
1041 |
|
obey `function-key-map' and `key-translation-map' instead." |
1042 |
|
(let ((overriding-terminal-local-map (make-sparse-keymap))) |
1043 |
|
(aref (read-key-sequence prompt nil t) 0))) |
1044 |
|
|
1045 |
(defun read-quoted-char (&optional prompt) |
(defun read-quoted-char (&optional prompt) |
1046 |
"Like `read-char', but do not allow quitting. |
"Like `read-char', but do not allow quitting. |
1047 |
Also, if the first character read is an octal digit, |
Also, if the first character read is an octal digit, |
1063 |
or the octal character code. |
or the octal character code. |
1064 |
RET terminates the character code and is discarded; |
RET terminates the character code and is discarded; |
1065 |
any other non-digit terminates the character code and is then used as input.")) |
any other non-digit terminates the character code and is then used as input.")) |
1066 |
(setq char (read-event (and prompt (format "%s-" prompt)) t)) |
(setq char (read-key (and prompt (format "%s-" prompt)))) |
1067 |
(if inhibit-quit (setq quit-flag nil))) |
(if inhibit-quit (setq quit-flag nil))) |
|
;; Translate TAB key into control-I ASCII character, and so on. |
|
|
(and char |
|
|
(let ((translated (lookup-key function-key-map (vector char)))) |
|
|
(if (arrayp translated) |
|
|
(setq char (aref translated 0))))) |
|
1068 |
(cond ((null char)) |
(cond ((null char)) |
1069 |
((not (integerp char)) |
((not (integerp char)) |
1070 |
(setq unread-command-events (list char) |
(setq unread-command-events (this-single-command-raw-keys) |
1071 |
done t)) |
done t)) |
1072 |
((/= (logand char ?\M-\^@) 0) |
((/= (logand char ?\M-\^@) 0) |
1073 |
;; Turn a meta-character into a character with the 0200 bit set. |
;; Turn a meta-character into a character with the 0200 bit set. |
1084 |
((and (not first) (eq char ?\C-m)) |
((and (not first) (eq char ?\C-m)) |
1085 |
(setq done t)) |
(setq done t)) |
1086 |
((not first) |
((not first) |
1087 |
(setq unread-command-events (list char) |
(setq unread-command-events (this-single-command-raw-keys) |
1088 |
done t)) |
done t)) |
1089 |
(t (setq code char |
(t (setq code char |
1090 |
done t))) |
done t))) |
1956 |
(defun make-temp-file (prefix &optional dir-flag suffix) |
(defun make-temp-file (prefix &optional dir-flag suffix) |
1957 |
"Create a temporary file. |
"Create a temporary file. |
1958 |
The returned file name (created by appending some random characters at the end |
The returned file name (created by appending some random characters at the end |
1959 |
of PREFIX, and expanding against `temporary-file-directory' if necessary, |
of PREFIX, and expanding against `temporary-file-directory' if necessary), |
1960 |
is guaranteed to point to a newly created empty file. |
is guaranteed to point to a newly created empty file. |
1961 |
You can then use `write-region' to write new data into the file. |
You can then use `write-region' to write new data into the file. |
1962 |
|
|