From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: egarrulo Newsgroups: gmane.emacs.help Subject: Re: Incremental search of a package Date: Sat, 23 Jul 2016 23:33:33 +0200 Message-ID: References: <86h9bgyv4b.fsf@student.uu.se> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1469309731 624 80.91.229.3 (23 Jul 2016 21:35:31 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 23 Jul 2016 21:35:31 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat Jul 23 23:35:30 2016 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1bR4a2-00079o-9M for geh-help-gnu-emacs@m.gmane.org; Sat, 23 Jul 2016 23:35:30 +0200 Original-Received: from localhost ([::1]:53768 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bR4a1-0001iM-Hz for geh-help-gnu-emacs@m.gmane.org; Sat, 23 Jul 2016 17:35:29 -0400 Original-Path: usenet.stanford.edu!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 22 Original-X-Trace: individual.net r6l93fegAwM+JPH4gp1MfwCXML4rcrsqZ+fUJVvTYhnRJFpW6l Cancel-Lock: sha1:v9mQ0d+J69P55XPLANPI0lxKqHU= User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 In-Reply-To: <86h9bgyv4b.fsf@student.uu.se> Original-Xref: usenet.stanford.edu gnu.emacs.help:218604 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.org gmane.emacs.help:110915 Archived-At: 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 "^ "))