emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Problems with search
@ 2011-07-07 20:58 Henri-Paul Indiogine
  2011-07-07 21:16 ` Nick Dokos
  0 siblings, 1 reply; 8+ messages in thread
From: Henri-Paul Indiogine @ 2011-07-07 20:58 UTC (permalink / raw)
  To: emacs-org

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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Problems with search
  2011-07-07 20:58 Henri-Paul Indiogine
@ 2011-07-07 21:16 ` Nick Dokos
  2011-07-07 22:16   ` Henri-Paul Indiogine
  2011-07-07 23:18   ` Henri-Paul Indiogine
  0 siblings, 2 replies; 8+ messages in thread
From: Nick Dokos @ 2011-07-07 21:16 UTC (permalink / raw)
  To: hindiogine; +Cc: nicholas.dokos, emacs-org

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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Problems with search
  2011-07-07 21:16 ` Nick Dokos
@ 2011-07-07 22:16   ` Henri-Paul Indiogine
  2011-07-07 23:18   ` Henri-Paul Indiogine
  1 sibling, 0 replies; 8+ messages in thread
From: Henri-Paul Indiogine @ 2011-07-07 22:16 UTC (permalink / raw)
  To: emacs-org

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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Problems with search
  2011-07-07 21:16 ` Nick Dokos
  2011-07-07 22:16   ` Henri-Paul Indiogine
@ 2011-07-07 23:18   ` Henri-Paul Indiogine
  2011-07-08  2:25     ` Nick Dokos
  1 sibling, 1 reply; 8+ messages in thread
From: Henri-Paul Indiogine @ 2011-07-07 23:18 UTC (permalink / raw)
  To: emacs-org

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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Problems with search
  2011-07-07 23:18   ` Henri-Paul Indiogine
@ 2011-07-08  2:25     ` Nick Dokos
  2011-07-08  3:14       ` Henri-Paul Indiogine
  0 siblings, 1 reply; 8+ messages in thread
From: Nick Dokos @ 2011-07-08  2:25 UTC (permalink / raw)
  To: Henri-Paul Indiogine; +Cc: nicholas.dokos, emacs-org

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)
> 

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Problems with search
  2011-07-08  2:25     ` Nick Dokos
@ 2011-07-08  3:14       ` Henri-Paul Indiogine
  2011-07-08  3:45         ` Nick Dokos
  0 siblings, 1 reply; 8+ messages in thread
From: Henri-Paul Indiogine @ 2011-07-08  3:14 UTC (permalink / raw)
  To: nicholas.dokos; +Cc: emacs-org

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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Problems with search
  2011-07-08  3:14       ` Henri-Paul Indiogine
@ 2011-07-08  3:45         ` Nick Dokos
  0 siblings, 0 replies; 8+ messages in thread
From: Nick Dokos @ 2011-07-08  3:45 UTC (permalink / raw)
  To: Henri-Paul Indiogine; +Cc: nicholas.dokos, emacs-org

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.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Problems with search
       [not found] <CAPeR955y2+HF8wip7RB0g+pKUj6T0VqXPRGszTPv0NP4ExtDTg@mail.gmail.com>
@ 2011-08-02 18:27 ` Bianca Lutz
  0 siblings, 0 replies; 8+ messages in thread
From: Bianca Lutz @ 2011-08-02 18:27 UTC (permalink / raw)
  To: emacs-orgmode

> 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.

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2011-08-02 18:27 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <CAPeR955y2+HF8wip7RB0g+pKUj6T0VqXPRGszTPv0NP4ExtDTg@mail.gmail.com>
2011-08-02 18:27 ` Problems with search Bianca Lutz
2011-07-07 20:58 Henri-Paul Indiogine
2011-07-07 21:16 ` Nick Dokos
2011-07-07 22:16   ` Henri-Paul Indiogine
2011-07-07 23:18   ` Henri-Paul Indiogine
2011-07-08  2:25     ` Nick Dokos
2011-07-08  3:14       ` Henri-Paul Indiogine
2011-07-08  3:45         ` Nick Dokos

Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).