comparison lisp/frame.el @ 83259:cf4b5d1da82f

Merged from miles@gnu.org--gnu-2005 (patch 119) Patches applied: * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-119 Update from CVS git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-299
author Karoly Lorentey <lorentey@elte.hu>
date Wed, 23 Feb 2005 11:24:05 +0000
parents e9810bf10871 261ebd199f28
children 7d309d464f83
comparison
equal deleted inserted replaced
83258:73700d004690 83259:cf4b5d1da82f
1 ;;; frame.el --- multi-frame management independent of window systems 1 ;;; frame.el --- multi-frame management independent of window systems
2 2
3 ;; Copyright (C) 1993, 1994, 1996, 1997, 2000, 2001, 2003, 2004 3 ;; Copyright (C) 1993, 1994, 1996, 1997, 2000, 2001, 2003, 2004, 2005
4 ;; Free Software Foundation, Inc. 4 ;; Free Software Foundation, Inc.
5 5
6 ;; Maintainer: FSF 6 ;; Maintainer: FSF
7 ;; Keywords: internal 7 ;; Keywords: internal
8 8
1325 (defvar blink-cursor-timer nil 1325 (defvar blink-cursor-timer nil
1326 "Timer started from `blink-cursor-start'. 1326 "Timer started from `blink-cursor-start'.
1327 This timer calls `blink-cursor-timer-function' every 1327 This timer calls `blink-cursor-timer-function' every
1328 `blink-cursor-interval' seconds.") 1328 `blink-cursor-interval' seconds.")
1329 1329
1330 ;; The strange sequence below is meant to set both the right temporary 1330 ;; We do not know the standard _evaluated_ value yet, because the standard
1331 ;; value and the right "standard expression" , according to Custom, 1331 ;; expression uses values that are not yet set. The correct evaluated
1332 ;; for blink-cursor-mode. We do not know the standard _evaluated_ 1332 ;; standard value will be installed in startup.el using exactly the same
1333 ;; value yet, because the standard expression uses values that are not 1333 ;; expression as in the defcustom.
1334 ;; yet set. Evaluating it now would yield an error, but we make sure 1334 (define-minor-mode blink-cursor-mode
1335 ;; that it is not evaluated, by ensuring that blink-cursor-mode is set
1336 ;; before the defcustom is evaluated and by using the right :initialize
1337 ;; function. The correct evaluated standard value will be installed
1338 ;; in startup.el using exactly the same expression as in the defcustom.
1339 (defvar blink-cursor-mode)
1340 (unless (boundp 'blink-cursor-mode) (setq blink-cursor-mode nil))
1341 (defcustom blink-cursor-mode
1342 (not (or noninteractive
1343 emacs-quick-startup
1344 (eq system-type 'ms-dos)
1345 (not (memq initial-window-system '(x w32)))))
1346 "*Non-nil means Blinking Cursor mode is active."
1347 :group 'cursor
1348 :tag "Blinking cursor"
1349 :type 'boolean
1350 :initialize 'custom-initialize-set
1351 :set #'(lambda (symbol value)
1352 (set-default symbol value)
1353 (blink-cursor-mode (or value 0))))
1354
1355 (defvaralias 'blink-cursor 'blink-cursor-mode)
1356 (make-obsolete-variable 'blink-cursor 'blink-cursor-mode "22.1")
1357
1358 (defun blink-cursor-mode (arg)
1359 "Toggle blinking cursor mode. 1335 "Toggle blinking cursor mode.
1360 With a numeric argument, turn blinking cursor mode on iff ARG is positive. 1336 With a numeric argument, turn blinking cursor mode on iff ARG is positive.
1361 When blinking cursor mode is enabled, the cursor of the selected 1337 When blinking cursor mode is enabled, the cursor of the selected
1362 window blinks. 1338 window blinks.
1363 1339
1364 Note that this command is effective only when Emacs 1340 Note that this command is effective only when Emacs
1365 displays through a window system, because then Emacs does its own 1341 displays through a window system, because then Emacs does its own
1366 cursor display. On a text-only terminal, this is not implemented." 1342 cursor display. On a text-only terminal, this is not implemented."
1367 (interactive "P") 1343 :init-value (not (or noninteractive
1368 (let ((on-p (if (null arg) 1344 emacs-quick-startup
1369 (not blink-cursor-mode) 1345 (eq system-type 'ms-dos)
1370 (> (prefix-numeric-value arg) 0)))) 1346 (not (memq initial-window-system '(x w32)))))
1371 (if blink-cursor-idle-timer 1347 :global t
1372 (cancel-timer blink-cursor-idle-timer)) 1348 (if blink-cursor-idle-timer (cancel-timer blink-cursor-idle-timer))
1373 (if blink-cursor-timer 1349 (if blink-cursor-timer (cancel-timer blink-cursor-timer))
1374 (cancel-timer blink-cursor-timer)) 1350 (setq blink-cursor-idle-timer nil
1375 (setq blink-cursor-idle-timer nil 1351 blink-cursor-timer nil)
1376 blink-cursor-timer nil 1352 (if blink-cursor-mode
1377 blink-cursor-mode nil) 1353 (progn
1378 (if on-p 1354 ;; Hide the cursor.
1379 (progn 1355 ;;(internal-show-cursor nil nil)
1380 ;; Hide the cursor. 1356 (setq blink-cursor-idle-timer
1381 ;(internal-show-cursor nil nil) 1357 (run-with-idle-timer blink-cursor-delay
1382 (setq blink-cursor-idle-timer 1358 blink-cursor-delay
1383 (run-with-idle-timer blink-cursor-delay 1359 'blink-cursor-start)))
1384 blink-cursor-delay 1360 (internal-show-cursor nil t)))
1385 'blink-cursor-start)) 1361
1386 (setq blink-cursor-mode t)) 1362 (defvaralias 'blink-cursor 'blink-cursor-mode)
1387 (internal-show-cursor nil t)))) 1363 (make-obsolete-variable 'blink-cursor 'blink-cursor-mode "22.1")
1388 1364
1389 (defun blink-cursor-start () 1365 (defun blink-cursor-start ()
1390 "Timer function called from the timer `blink-cursor-idle-timer'. 1366 "Timer function called from the timer `blink-cursor-idle-timer'.
1391 This starts the timer `blink-cursor-timer', which makes the cursor blink 1367 This starts the timer `blink-cursor-timer', which makes the cursor blink
1392 if appropriate. It also arranges to cancel that timer when the next 1368 if appropriate. It also arranges to cancel that timer when the next
1450 1426
1451 (substitute-key-definition 'suspend-emacs 'suspend-frame global-map) 1427 (substitute-key-definition 'suspend-emacs 'suspend-frame global-map)
1452 1428
1453 (provide 'frame) 1429 (provide 'frame)
1454 1430
1455 ;;; arch-tag: 82979c70-b8f2-4306-b2ad-ddbd6b328b56 1431 ;; arch-tag: 82979c70-b8f2-4306-b2ad-ddbd6b328b56
1456 ;;; frame.el ends here 1432 ;;; frame.el ends here