changeset 72484:f9400e50a0e5

(blink-cursor-end): Only ignore the error we care about. (blink-cursor-mode): Use blink-cursor-end to simplify the code.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Tue, 22 Aug 2006 01:35:45 +0000
parents a085a4e8fd54
children 030d7ce12631
files lisp/ChangeLog lisp/frame.el
diffstat 2 files changed, 39 insertions(+), 39 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/ChangeLog	Mon Aug 21 23:07:55 2006 +0000
+++ b/lisp/ChangeLog	Tue Aug 22 01:35:45 2006 +0000
@@ -2,7 +2,12 @@
 
 	* progmodes/gdb-ui.el (gdb-frame-memory-buffer): Make frame
 	a bit wider and remove fringes to fit initial output on line.
-	
+
+2006-08-21  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+	* frame.el (blink-cursor-end): Only ignore the error we care about.
+	(blink-cursor-mode): Use blink-cursor-end to simplify the code.
+
 2006-08-21  Richard Stallman  <rms@gnu.org>
 
 	* whitespace.el (whitespace-cleanup): Doc fix.
@@ -16,8 +21,8 @@
 	(rcirc-mode): Preserve the value of `rcirc-urls' across
 	connections.  Setup scroll function.
 	(rcirc-scroll-to-bottom): New function.
-	(rcirc-print): Use nick syntax around regexp work.  Notice
-	dim-nicks speaking only if they say our nick.
+	(rcirc-print): Use nick syntax around regexp work.
+	Notice dim-nicks speaking only if they say our nick.
 	(rcirc-update-activity-string): Do not show the modeline indicator
 	if there are no live rcirc processes.
 	(rcirc-cmd-ignore): Ignore case.
--- a/lisp/frame.el	Mon Aug 21 23:07:55 2006 +0000
+++ b/lisp/frame.el	Tue Aug 22 01:35:45 2006 +0000
@@ -1253,38 +1253,6 @@
 This timer calls `blink-cursor-timer-function' every
 `blink-cursor-interval' seconds.")
 
-(define-minor-mode blink-cursor-mode
-  "Toggle blinking cursor mode.
-With a numeric argument, turn blinking cursor mode on iff ARG is positive.
-When blinking cursor mode is enabled, the cursor of the selected
-window blinks.
-
-Note that this command is effective only when Emacs
-displays through a window system, because then Emacs does its own
-cursor display.  On a text-only terminal, this is not implemented."
-  :init-value (not (or noninteractive
-		       no-blinking-cursor
-		       (eq system-type 'ms-dos)
-		       (not (memq window-system '(x w32 mac)))))
-  :initialize 'custom-initialize-safe-default
-  :group 'cursor
-  :global t
-  (if blink-cursor-idle-timer (cancel-timer blink-cursor-idle-timer))
-  (if blink-cursor-timer (cancel-timer blink-cursor-timer))
-  (setq blink-cursor-idle-timer nil
-	blink-cursor-timer nil)
-  (if blink-cursor-mode
-      (progn
-	;; Hide the cursor.
-	;;(internal-show-cursor nil nil)
-	(setq blink-cursor-idle-timer
-	      (run-with-idle-timer blink-cursor-delay
-				   blink-cursor-delay
-				   'blink-cursor-start)))
-    (internal-show-cursor nil t)))
-
-(define-obsolete-variable-alias 'blink-cursor 'blink-cursor-mode "22.1")
-
 (defun blink-cursor-start ()
   "Timer function called from the timer `blink-cursor-idle-timer'.
 This starts the timer `blink-cursor-timer', which makes the cursor blink
@@ -1310,11 +1278,38 @@
 itself as a pre-command hook."
   (remove-hook 'pre-command-hook 'blink-cursor-end)
   (internal-show-cursor nil t)
-  (condition-case nil
-      (cancel-timer blink-cursor-timer)
-    (error nil))
-  (setq blink-cursor-timer nil))
+  (when blink-cursor-timer
+    (cancel-timer blink-cursor-timer)
+    (setq blink-cursor-timer nil)))
+
+(define-minor-mode blink-cursor-mode
+  "Toggle blinking cursor mode.
+With a numeric argument, turn blinking cursor mode on iff ARG is positive.
+When blinking cursor mode is enabled, the cursor of the selected
+window blinks.
 
+Note that this command is effective only when Emacs
+displays through a window system, because then Emacs does its own
+cursor display.  On a text-only terminal, this is not implemented."
+  :init-value (not (or noninteractive
+		       no-blinking-cursor
+		       (eq system-type 'ms-dos)
+		       (not (memq window-system '(x w32 mac)))))
+  :initialize 'custom-initialize-safe-default
+  :group 'cursor
+  :global t
+  (if blink-cursor-idle-timer (cancel-timer blink-cursor-idle-timer))
+  (setq blink-cursor-idle-timer nil)
+  (blink-cursor-end)
+  (when blink-cursor-mode
+    ;; Hide the cursor.
+    ;;(internal-show-cursor nil nil)
+    (setq blink-cursor-idle-timer
+          (run-with-idle-timer blink-cursor-delay
+                               blink-cursor-delay
+                               'blink-cursor-start))))
+
+(define-obsolete-variable-alias 'blink-cursor 'blink-cursor-mode "22.1")
 
 ;; Hourglass pointer