help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Incremental search of a package


From: egarrulo
Subject: Re: Incremental search of a package
Date: Sat, 23 Jul 2016 23:33:33 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0

On 23/07/16 22:09, Emanuel Berg wrote:
egarrulo wrote:

Is there a more straightforward way? If not,
is it possible to write a command that
performs the steps 1 and 2, so that you only
need to start typing the name of the package?

... why can't you just do that?

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


reply via email to

[Prev in Thread] Current Thread [Next in Thread]