[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: How to debug modification to a variable value?
From: |
Davis Herring |
Subject: |
Re: How to debug modification to a variable value? |
Date: |
Wed, 27 Jan 2010 07:42:54 -0800 (PST) |
User-agent: |
SquirrelMail/1.4.8-5.7.lanl7 |
>> and that `tg-initialize' adds -that- to `eldoc-mode-hook' (globally!),
>> and that `tg-mode' calls -that-.
>
> No, `tg-eldoc-init' is added locally, but I guess you mean that as a
> result, `tg-init-schema' ends up globally in `after-save-hook' as soon
> as `eldoc-mode-hook' was run, and you are right.
Actually, I just didn't notice that one of the `add-hook's was local;
since I had noticed the other one was global, I didn't double-check this
one.
> Absolutely. How much time did you spend on that, and how did you debug
> it? Using a watchpoint in gdb as you suggested? While I clearly see
> that the global `add-hook' is plain wrong, I wouldn't have found it by
> looking carefully at the code.
Maybe 15 minutes? I wasn't counting. I just thought it was odd that the
"only" function that set `tg-schema-alist' wasn't even in the same file
where it was defvar-ed, so I looked in tg-mode.el, found `tg-init-schema'
(which I could really have guessed from `greql-set-graph'), and then
looked for references to that function. As soon as I saw it put on
`after-save-hook', it was obvious (though I had to look at the other hook
to understand the whole sequence). I never left the browser window
wherein I browsed your SVN repository except to check Emacs'
documentation.
> Thanks a lot, I evaled
>
> (cons "Davis Herring" list-of-extremely-helpful-guys).
Am I to be garbage collected, then? You need a `setq' (like `push' does);
perhaps I can still be rescued from `values'. ;)
Glad I could help,
Davis
PS - Your messages to me (and the list) bear the header
Mail-Followup-To: address@hidden, address@hidden
...which seems wrong (especially when I am the one replying!); surely
Mail-Followup-To: address@hidden, address@hidden
is what you want?
--
This product is sold by volume, not by mass. If it appears too dense or
too sparse, it is because mass-energy conversion has occurred during
shipping.
Re: How to debug modification to a variable value?, Davis Herring, 2010/01/25
Re: How to debug modification to a variable value?, alin.s, 2010/01/26