How can I change icicle-search-context-regexp variable in Emacs3 icicles

72 views Asked by At

I'd like to use icicle-comint-search in shell-mode, but it used to be failed with error message like this

byte-code: No search contexts for `\^\[\^#\$%>
]\*\[#\$%>] \*\\S-\.\*'

Of course my shell prompt in zsh does not meet that regular expression. B

I tried to change icicle-search-context-regexp via setq to meet my zsh prompt. But when I issue icicle-comint-search the error message comes again. When I examine variable value of icicle-search-context-regexp, it was reset to its default value again.

How could I change it to meet my zsh prompt?

1

There are 1 answers

2
Drew On

icicle-comint-search uses this regexp: (concat comint-prompt-regexp "\\S-.*").

So you can change the value of variable comint-prompt-regexp to change the search regexp. You can set that variable in a mode hook, for example (e.g., comint-mode-hook). Note that the doc string for comint-prompt-regexp says that it is used only if comint-use-prompt-regexp is non-nil, but for icicle-comint-search it is always used. I've updated the icicle-comint-search doc string to mention comint-prompt-regexp.