| | 1086 | (defcustom display-mm-dimensions-alist nil |
|---|
| | 1087 | "Alist for specifying screen dimensions in millimeters. |
|---|
| | 1088 | The dimensions will be used for `display-mm-height' and |
|---|
| | 1089 | `display-mm-width' if defined for the respective display. |
|---|
| | 1090 | |
|---|
| | 1091 | Each element of the alist has the form (display . (width . height)), |
|---|
| | 1092 | e.g. (\":0.0\" . (287 . 215)). |
|---|
| | 1093 | |
|---|
| | 1094 | If `display' equals t, it specifies dimensions for all graphical |
|---|
| | 1095 | displays not explicitely specified." |
|---|
| | 1096 | :version "22.1" |
|---|
| | 1097 | :type '(alist :key-type (choice (string :tag "Display name") |
|---|
| | 1098 | (const :tag "Default" t)) |
|---|
| | 1099 | :value-type (cons :tag "Dimensions" |
|---|
| | 1100 | (integer :tag "Width") |
|---|
| | 1101 | (integer :tag "Height"))) |
|---|
| | 1102 | :group 'frames) |
|---|
| | 1103 | |
|---|
| | 1282 | (defun blink-cursor-start () |
|---|
| | 1283 | "Timer function called from the timer `blink-cursor-idle-timer'. |
|---|
| | 1284 | This starts the timer `blink-cursor-timer', which makes the cursor blink |
|---|
| | 1285 | if appropriate. It also arranges to cancel that timer when the next |
|---|
| | 1286 | command starts, by installing a pre-command hook." |
|---|
| | 1287 | (when (null blink-cursor-timer) |
|---|
| | 1288 | ;; Set up the timer first, so that if this signals an error, |
|---|
| | 1289 | ;; blink-cursor-end is not added to pre-command-hook. |
|---|
| | 1290 | (setq blink-cursor-timer |
|---|
| | 1291 | (run-with-timer blink-cursor-interval blink-cursor-interval |
|---|
| | 1292 | 'blink-cursor-timer-function)) |
|---|
| | 1293 | (add-hook 'pre-command-hook 'blink-cursor-end) |
|---|
| | 1294 | (internal-show-cursor nil nil))) |
|---|
| | 1295 | |
|---|
| | 1296 | (defun blink-cursor-timer-function () |
|---|
| | 1297 | "Timer function of timer `blink-cursor-timer'." |
|---|
| | 1298 | (internal-show-cursor nil (not (internal-show-cursor-p)))) |
|---|
| | 1299 | |
|---|
| | 1300 | (defun blink-cursor-end () |
|---|
| | 1301 | "Stop cursor blinking. |
|---|
| | 1302 | This is installed as a pre-command hook by `blink-cursor-start'. |
|---|
| | 1303 | When run, it cancels the timer `blink-cursor-timer' and removes |
|---|
| | 1304 | itself as a pre-command hook." |
|---|
| | 1305 | (remove-hook 'pre-command-hook 'blink-cursor-end) |
|---|
| | 1306 | (internal-show-cursor nil t) |
|---|
| | 1307 | (when blink-cursor-timer |
|---|
| | 1308 | (cancel-timer blink-cursor-timer) |
|---|
| | 1309 | (setq blink-cursor-timer nil))) |
|---|
| | 1310 | |
|---|
| 1273 | | (if blink-cursor-timer (cancel-timer blink-cursor-timer)) |
|---|
| 1274 | | (setq blink-cursor-idle-timer nil |
|---|
| 1275 | | blink-cursor-timer nil) |
|---|
| 1276 | | (if blink-cursor-mode |
|---|
| 1277 | | (progn |
|---|
| 1278 | | ;; Hide the cursor. |
|---|
| 1279 | | ;;(internal-show-cursor nil nil) |
|---|
| 1280 | | (setq blink-cursor-idle-timer |
|---|
| 1281 | | (run-with-idle-timer blink-cursor-delay |
|---|
| 1282 | | blink-cursor-delay |
|---|
| 1283 | | 'blink-cursor-start))) |
|---|
| 1284 | | (internal-show-cursor nil t))) |
|---|
| | 1328 | (setq blink-cursor-idle-timer nil) |
|---|
| | 1329 | (blink-cursor-end) |
|---|
| | 1330 | (when blink-cursor-mode |
|---|
| | 1331 | ;; Hide the cursor. |
|---|
| | 1332 | ;;(internal-show-cursor nil nil) |
|---|
| | 1333 | (setq blink-cursor-idle-timer |
|---|
| | 1334 | (run-with-idle-timer blink-cursor-delay |
|---|
| | 1335 | blink-cursor-delay |
|---|
| | 1336 | 'blink-cursor-start)))) |
|---|
| 1287 | | |
|---|
| 1288 | | (defun blink-cursor-start () |
|---|
| 1289 | | "Timer function called from the timer `blink-cursor-idle-timer'. |
|---|
| 1290 | | This starts the timer `blink-cursor-timer', which makes the cursor blink |
|---|
| 1291 | | if appropriate. It also arranges to cancel that timer when the next |
|---|
| 1292 | | command starts, by installing a pre-command hook." |
|---|
| 1293 | | (when (null blink-cursor-timer) |
|---|
| 1294 | | (add-hook 'pre-command-hook 'blink-cursor-end) |
|---|
| 1295 | | (internal-show-cursor nil nil) |
|---|
| 1296 | | (setq blink-cursor-timer |
|---|
| 1297 | | (run-with-timer blink-cursor-interval blink-cursor-interval |
|---|
| 1298 | | 'blink-cursor-timer-function)))) |
|---|
| 1299 | | |
|---|
| 1300 | | (defun blink-cursor-timer-function () |
|---|
| 1301 | | "Timer function of timer `blink-cursor-timer'." |
|---|
| 1302 | | (internal-show-cursor nil (not (internal-show-cursor-p)))) |
|---|
| 1303 | | |
|---|
| 1304 | | (defun blink-cursor-end () |
|---|
| 1305 | | "Stop cursor blinking. |
|---|
| 1306 | | This is installed as a pre-command hook by `blink-cursor-start'. |
|---|
| 1307 | | When run, it cancels the timer `blink-cursor-timer' and removes |
|---|
| 1308 | | itself as a pre-command hook." |
|---|
| 1309 | | (remove-hook 'pre-command-hook 'blink-cursor-end) |
|---|
| 1310 | | (internal-show-cursor nil t) |
|---|
| 1311 | | (cancel-timer blink-cursor-timer) |
|---|
| 1312 | | (setq blink-cursor-timer nil)) |
|---|
| 1313 | | |
|---|
| 1314 | | |
|---|