all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Ken Manheimer" <ken.manheimer@gmail.com>
Subject: blink-cursor-end sometimes fails and disrupts pre-command-hook
Date: Fri, 18 Aug 2006 18:30:29 -0400	[thread overview]
Message-ID: <2cd46e7f0608181530l1c1a18f7k1923f610edf73f59@mail.gmail.com> (raw)

i've been having a hell of a time tracking down a
user-configuration-sensitive blink-cursor error, and can't even report
a case to reproduce it.  i do have a simple change which prevents the
problem and which i think is proper, though i couldn't swear to that.

i'm attaching the patch below.

after my first keystroke in an emacs session, i find the error message
in the *Messages* buffer:

Error in pre-command-hook: (error Invalid timer)

deactivation of the pre-command-hook disrupts my editor session, of
course, disabling all activity on the pre-command-hook.

after a bunch of searching, i determined the problem was happening in
blink-cursor-end running off of the pre-command-hook.  i was unable to
determine the combination of packages and settings from my emacs rc
file necessary to trigger it (and i spent a few hours adding things in
and out, aaargh).

it started happening about a week ago, with upgrade to a recent
version of emacs 22.

one incidental point.

i would really, really, *really* have liked to backtraces to help
track this down, but emacs backtraces are useless for that by design.
you have to know where to put them to get the backtrace from an error
at that point.  that is terrible - more than half the usefulness of a
backtrace is in pinpointing where an error occurred.  i can understand
not wanting to produce a backtrace on every error, if it's an
expensive operation.  however, i can't understand not having a mode -
eg, with a `debug-on-error' style variable, eg
`retain-backtrace-on-error' - for retaining backtraces on any error,
to be replaced when the next error happens.   i have no C chops, so
can't implement this, but would love it if someone were interested in
doing so.  (if this kind of thing is already possible, please someone
clue me in, and my apologies for my rant.)

here's the change which prevents the blink-cursor problem.  the
condition is similar to that used in blink-cursor-mode, and i'm pretty
sure is not harmful.  it may be covering over some kind of timing
sensitivity in changes to pre-command-hook, but i've been unable to
track that down.
-- 
ken
ken.manheimer@gmail.com
http://myriadicity.net

--- frame.el	21 Jul 2006 03:42:52 -0400	1.237
+++ frame.el	18 Aug 2006 17:58:18 -0400	
@@ -1308,7 +1308,8 @@
 itself as a pre-command hook."
   (remove-hook 'pre-command-hook 'blink-cursor-end)
   (internal-show-cursor nil t)
-  (cancel-timer blink-cursor-timer)
+  (if blink-cursor-timer
+      (cancel-timer blink-cursor-timer))
   (setq blink-cursor-timer nil))

             reply	other threads:[~2006-08-18 22:30 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-08-18 22:30 Ken Manheimer [this message]
2006-08-19 15:07 ` blink-cursor-end sometimes fails and disrupts pre-command-hook Chong Yidong
     [not found] ` <87veoo95zy.fsf@furball.mit.edu>
     [not found]   ` <2cd46e7f0608190731j6247e8bbr7f7f8d1ecb6ac3ce@mail.gmail.com>
     [not found]     ` <87r6zc9475.fsf@furball.mit.edu>
     [not found]       ` <2cd46e7f0608190805x70bd8715n6f1b552d57a80a5c@mail.gmail.com>
2006-08-19 15:16         ` Chong Yidong
2006-08-19 15:58           ` Ken Manheimer
2006-08-19 16:15             ` Chong Yidong
2006-08-19 16:59               ` Ken Manheimer
2006-08-21 15:36                 ` Stuart D. Herring
2006-08-20 12:05 ` Richard Stallman
2006-08-20 22:49   ` Ken Manheimer
2006-08-21  7:15     ` David Kastrup
2006-08-21 11:13     ` Richard Stallman
2006-08-21 15:31       ` Ken Manheimer
2006-08-21 17:23         ` Stuart D. Herring
2006-08-22 21:12           ` Ken Manheimer
2006-08-23 14:45             ` Richard Stallman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2cd46e7f0608181530l1c1a18f7k1923f610edf73f59@mail.gmail.com \
    --to=ken.manheimer@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.