Greetings! I am having a problem with the GNU Emacs search function that makes it practically unusable. I think that it is related to org-mode because of the following lines in my *Messages* buffer: Error in post-command-hook: (void-variable org-ans1) nonincremental-search-forward: Search failed: "Apple " Error in post-command-hook: (void-variable org-ans1) nonincremental-search-forward: Search failed: "Payne " Basically, I start search with C-s and then when I enter a string if it includes 'n' or 'p' it interprets them as commands instead of characters of the string. E.g. "Apple" is accepts "A" then when I press "p" it starts a backward search. when I enter "n" it goes to the next match of the letters before 'n'. I run the latest git version compiled daily. Henri-Paul -- Henri-Paul Indiogine Email: hindiogine@gmail.com Running: Ubuntu Linux 10.10, Emacs 24.0.50.1, org-mode 7.5
Henri-Paul Indiogine <hindiogine@gmail.com> wrote:
> Greetings!
>
> I am having a problem with the GNU Emacs search function that makes it
> practically unusable. I think that it is related to org-mode because of
> the following lines in my *Messages* buffer:
>
> Error in post-command-hook: (void-variable org-ans1)
> nonincremental-search-forward: Search failed: "Apple "
> Error in post-command-hook: (void-variable org-ans1)
> nonincremental-search-forward: Search failed: "Payne "
>
>
> Basically, I start search with C-s and then when I enter a string if it
> includes 'n' or 'p' it interprets them as commands instead of characters
> of the string.
>
> E.g. "Apple" is accepts "A" then when I press "p" it starts a backward
> search.
>
> when I enter "n" it goes to the next match of the letters before 'n'.
>
> I run the latest git version compiled daily.
>
A few things to check and try:
o What does C-h v post-command-hook RET say?
o emacs -q and try incremental search. I expect no problem.
o comment out the loading of org from your emacs and restart emacs, then
try an incremental search. Still no problem?
o uncomment the previous and restart emacs: does the problem reappear?
If the problem does not reappear in the last case, then it is likely
that something happened in your current emacs instance that mangled the
value of post-command-hook, but it will be very difficult to find out
what: it depends on what you did at some (possibly distant) point in the
past. Possibly something was aborted and the cleanup action was never carried out.
I don't have any great suggestiong to offer in this case: just restart emacs and
keep a watchful eye.
In each case, check the value of post-command-hook. And post the results.
Nick
Hi Nick! Results so far: > o What does C-h v post-command-hook RET say? Before restarting: post-command-hook is a variable defined in `C source code'. Its value is nil Local in buffer agenda.org; global value is (global-font-lock-mode-check-buffers autopair-global-mode-check-buffers global-visual-line-mode-check-buffers) After restarting: post-command-hook is a variable defined in `C source code'. Its value is (t autopair-post-command-handler flyspell-post-command-hook) Local in buffer Proposal.org; global value is (global-font-lock-mode-check-buffers autopair-global-mode-check-buffers global-visual-line-mode-check-buffers djcb-set-cursor-according-to-mode) > o emacs -q and try incremental search. I expect no problem. Correct, no problem. Thanks, HP -- Henri-Paul Indiogine Curriculum & Instruction Texas A&M University TutorFind Learning Centre Email: hindiogine@gmail.com Skype: hindiogine Website: http://people.cehd.tamu.edu/~sindiogine
Hi Nick! 2011/7/7 Nick Dokos <nicholas.dokos@hp.com>: > o comment out the loading of org from your emacs and restart emacs, then > try an incremental search. Still no problem? No problem. > o uncomment the previous and restart emacs: does the problem reappear? Yes, it reappears. > In each case, check the value of post-command-hook. And post the results. Now, with the problem again the value is: post-command-hook is a variable defined in `C source code'. Its value is (t autopair-post-command-handler) Local in buffer .emacs; global value is (global-font-lock-mode-check-buffers autopair-global-mode-check-buffers global-visual-line-mode-check-buffers djcb-set-cursor-according-to-mode) Thanks, HP -- Henri-Paul Indiogine Curriculum & Instruction Texas A&M University TutorFind Learning Centre Email: hindiogine@gmail.com Skype: hindiogine Website: http://people.cehd.tamu.edu/~sindiogine
Henri-Paul Indiogine <hindiogine@gmail.com> wrote: > Hi Nick! > > 2011/7/7 Nick Dokos <nicholas.dokos@hp.com>: > > o comment out the loading of org from your emacs and restart emacs, then > > try an incremental search. Still no problem? > > No problem. > > > > o uncomment the previous and restart emacs: does the problem reappear? > > Yes, it reappears. > > > In each case, check the value of post-command-hook. And post the results. > > Now, with the problem again the value is: > > post-command-hook is a variable defined in `C source code'. > Its value is > (t autopair-post-command-handler) > This looks wrong: what's that t doing there? and where did it come from? Nick > Local in buffer .emacs; global value is > (global-font-lock-mode-check-buffers > autopair-global-mode-check-buffers > global-visual-line-mode-check-buffers > djcb-set-cursor-according-to-mode) >
Hi Nick! 2011/7/7 Nick Dokos <nicholas.dokos@hp.com>: >> post-command-hook is a variable defined in `C source code'. >> Its value is >> (t autopair-post-command-handler) >> > > This looks wrong: what's that t doing there? and where did it come from? I think it is from autopair.el (add-hook 'post-command-hook 'autopair-post-command-handler 'append 'local)) I have had this autopair function for quite a while, well before the search problem occurred. Also, if do not load autopair I still have the search problem. Thanks, HP -- Henri-Paul Indiogine Curriculum & Instruction Texas A&M University TutorFind Learning Centre Email: hindiogine@gmail.com Skype: hindiogine Website: http://people.cehd.tamu.edu/~sindiogine
Henri-Paul Indiogine <hindiogine@gmail.com> wrote:
> Hi Nick!
>
> 2011/7/7 Nick Dokos <nicholas.dokos@hp.com>:
> >> post-command-hook is a variable defined in `C source code'.
> >> Its value is
> >> (t autopair-post-command-handler)
> >>
> >
> > This looks wrong: what's that t doing there? and where did it come from?
>
> I think it is from autopair.el
>
> (add-hook 'post-command-hook 'autopair-post-command-handler
> 'append 'local))
>
> I have had this autopair function for quite a while, well before the
> search problem occurred. Also, if do not load autopair I still have
> the search problem.
>
No, it's not the autopair-post-command-handler that I wondered about[fn:1],
it's that *t*, the first element of the list: how did it get there?
Nick
Footnotes:
[fn:1] Well, I did wonder about it, but only because I never heard of
it; but I am more suspicious of that t.
> No, it's not the autopair-post-command-handler that I wondered about[fn:1],
> it's that *t*, the first element of the list: how did it get there?
>
> Nick
>
> Footnotes:
>
> [fn:1] Well, I did wonder about it, but only because I never heard of
> it; but I am more suspicious of that t.
>
Concerning that suspicious t I found the following in the
documentation of add-hook:
(add-hook HOOK FUNCTION &optional APPEND LOCAL)
[...]
The optional fourth argument, LOCAL, if non-nil, says to modify
the hook's buffer-local value rather than its default value.
This makes the hook buffer-local if needed, and it makes t a member
of the buffer-local value. That acts as a flag to run the hook
functions in the default value as well as in the local value.
Best regards, Bianca.