Show
Ignore:
Timestamp:
09/09/06 16:30:10 (2 years ago)
Author:
miyoshi
Message:

Sync up with Emacs CVS HEAD.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/lisp/frame.el

    r4131 r4161  
    10841084      (frame-width (if (framep display) display (selected-frame))))))) 
    10851085 
     1086(defcustom display-mm-dimensions-alist nil 
     1087  "Alist for specifying screen dimensions in millimeters. 
     1088The dimensions will be used for `display-mm-height' and 
     1089`display-mm-width' if defined for the respective display. 
     1090 
     1091Each element of the alist has the form (display . (width . height)), 
     1092e.g. (\":0.0\" . (287 . 215)). 
     1093 
     1094If `display' equals t, it specifies dimensions for all graphical 
     1095displays 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 
    10861104(defun display-mm-height (&optional display) 
    10871105  "Return the height of DISPLAY's screen in millimeters. 
     1106System values can be overriden by `display-mm-dimensions-alist'. 
    10881107If the information is unavailable, value is nil." 
    10891108  (and (memq (framep-on-display display) '(x w32 mac)) 
    1090        (x-display-mm-height display))) 
     1109       (or (cddr (assoc (or display (frame-parameter nil 'display)) 
     1110                        display-mm-dimensions-alist)) 
     1111           (cddr (assoc t display-mm-dimensions-alist)) 
     1112           (x-display-mm-height display)))) 
    10911113 
    10921114(defun display-mm-width (&optional display) 
    10931115  "Return the width of DISPLAY's screen in millimeters. 
     1116System values can be overriden by `display-mm-dimensions-alist'. 
    10941117If the information is unavailable, value is nil." 
    10951118  (and (memq (framep-on-display display) '(x w32 mac)) 
    1096        (x-display-mm-width display))) 
     1119       (or (cadr (assoc (or display (frame-parameter nil 'display)) 
     1120                        display-mm-dimensions-alist)) 
     1121           (cadr (assoc t display-mm-dimensions-alist)) 
     1122           (x-display-mm-width display)))) 
    10971123 
    10981124(defun display-backing-store (&optional display) 
     
    12541280`blink-cursor-interval' seconds.") 
    12551281 
     1282(defun blink-cursor-start () 
     1283  "Timer function called from the timer `blink-cursor-idle-timer'. 
     1284This starts the timer `blink-cursor-timer', which makes the cursor blink 
     1285if appropriate.  It also arranges to cancel that timer when the next 
     1286command 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. 
     1302This is installed as a pre-command hook by `blink-cursor-start'. 
     1303When run, it cancels the timer `blink-cursor-timer' and removes 
     1304itself 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 
    12561311(define-minor-mode blink-cursor-mode 
    12571312  "Toggle blinking cursor mode. 
     
    12711326  :global t 
    12721327  (if blink-cursor-idle-timer (cancel-timer blink-cursor-idle-timer)) 
    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)))) 
    12851337 
    12861338(define-obsolete-variable-alias 'blink-cursor 'blink-cursor-mode "22.1") 
    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  
    13151339  
    13161340;; Hourglass pointer