From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Sebastien Vauban" Newsgroups: gmane.emacs.devel Subject: Point at beginning of search pattern incompatible with M-p Date: Sat, 06 Oct 2012 11:04:52 +0200 Organization: Sebastien Vauban Message-ID: <80mx00ug23.fsf@somewhere.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1349528111 13135 80.91.229.3 (6 Oct 2012 12:55:11 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 6 Oct 2012 12:55:11 +0000 (UTC) To: emacs-devel-mXXj517/zsQ@public.gmane.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org-mXXj517/zsQ@public.gmane.org Sat Oct 06 14:55:17 2012 Return-path: Envelope-to: ged-emacs-devel@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 1TKTuX-0007yr-8U for ged-emacs-devel@m.gmane.org; Sat, 06 Oct 2012 14:55:17 +0200 Original-Received: from localhost ([::1]:49069 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TKTuR-0005CJ-GN for ged-emacs-devel@m.gmane.org; Sat, 06 Oct 2012 08:55:11 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:41851) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TKTuH-0004mD-R7 for emacs-devel-mXXj517/zsQ@public.gmane.org; Sat, 06 Oct 2012 08:55:02 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TKTuG-0000ld-VP for emacs-devel-mXXj517/zsQ@public.gmane.org; Sat, 06 Oct 2012 08:55:01 -0400 Original-Received: from plane.gmane.org ([80.91.229.3]:33256) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TKTuG-0000lK-Os for emacs-devel-mXXj517/zsQ@public.gmane.org; Sat, 06 Oct 2012 08:55:00 -0400 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1TKTuJ-0007pF-JX for emacs-devel-mXXj517/zsQ@public.gmane.org; Sat, 06 Oct 2012 14:55:03 +0200 Original-Received: from ip-83-101-44-240.customer.schedom-europe.net ([83.101.44.240]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 06 Oct 2012 14:55:03 +0200 Original-Received: from wxhgmqzgwmuf by ip-83-101-44-240.customer.schedom-europe.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 06 Oct 2012 14:55:03 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 42 Original-X-Complaints-To: usenet-dbVV3NMTNubNLxjTenLetw@public.gmane.org X-Gmane-NNTP-Posting-Host: ip-83-101-44-240.customer.schedom-europe.net X-Url: Under construction... X-Archive: encrypt User-Agent: Gnus/5.130006 (Ma Gnus v0.6) Emacs/24.1 (windows-nt) Cancel-Lock: sha1:VU2Ffa5VTBexjqCu+Z+6CvGyI7c= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 X-BeenThere: emacs-devel-mXXj517/zsQ@public.gmane.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org-mXXj517/zsQ@public.gmane.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org-mXXj517/zsQ@public.gmane.org Xref: news.gmane.org gmane.emacs.devel:154123 Archived-At: Hello, I had, for some time, the following code in my .emacs. The goal: always exit searches at the beginning of the expression found. --8<---------------cut here---------------start------------->8--- (add-hook 'isearch-mode-end-hook 'custom-goto-match-beginning) (defun custom-goto-match-beginning () "Use with isearch hook to end search at first char of match." (when isearch-forward (goto-char isearch-other-end))) --8<---------------cut here---------------end--------------->8--- Problem: when I want to reuse earlier search strings (with the command `M-p'), I get the following error: --8<---------------cut here---------------start------------->8--- Debugger entered--Lisp error: (wrong-type-argument integer-or-marker-p nil) goto-char(nil) (progn (goto-char isearch-other-end)) (if isearch-forward (progn (goto-char isearch-other-end))) (when isearch-forward (goto-char isearch-other-end)) custom-goto-match-beginning() run-hooks(isearch-mode-end-hook) isearch-done(t t) byte-code(...) byte-code(...) isearch-edit-string() isearch-ring-adjust(nil) isearch-ring-retreat() call-interactively(isearch-ring-retreat nil nil) --8<---------------cut here---------------end--------------->8--- Can this be fixed somehow, to enjoy both features (exiting searches at the beginning of the expression, and reusing earlier search strings) together? Best regards, Seb -- Sebastien Vauban