egarrulo wrote:
> I have tried, but the following code makes
> Emacs loop on an error (therefore save your
> work before trying it):
>
> (defun isearch-forward-package ()
> (interactive)
> (add-hook 'isearch-mode-hook 'yank-package-line-regexp nil t)
> (unwind-protect
> (isearch-forward-regexp)
> (remove-hook 'isearch-mode-hook 'yank-package-line-regexp t)))
>
> (defun yank-package-line-regexp ()
> (isearch-yank-string "^ "))
No, I mean, why can't you just search for the
package name? Without any additional Elisp?
Otherwise I'd doe something like this:
(defun search-package (pack)
(interactive "sPackage: ")
(let ((regexp (format "^ %s" pack)))
(if (search-forward-regexp regexp (point-max) t) ; NOERROR
(back-to-indentation)
(message "No package: %s" pack) )))