-(defun el-search-hl-post-command-fun (buf)
- (letrec ((fun (lambda ()
- (when (buffer-live-p buf)
- (unless (or el-search-keep-hl
- (eq this-command 'el-search-query-replace)
- (eq this-command 'el-search-pattern))
- (with-current-buffer buf
- (el-search-hl-remove)
- (remove-hook 'post-command-hook fun t)))))))
- fun))
+(defun el-search-hl-post-command-fun ()
+ (unless (or el-search-keep-hl
+ (eq this-command 'el-search-query-replace)
+ (eq this-command 'el-search-pattern))
+ (el-search-hl-remove)
+ (remove-hook 'post-command-hook 'el-search-hl-post-command-fun t)))