From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Dima Kogan Newsgroups: gmane.emacs.bugs Subject: bug#15580: [PATCH] 24.3.50; subword-capitalize at the end of a buffer jumps to the beginning Date: Tue, 15 Oct 2013 12:03:58 -0700 Message-ID: <87y55u2w69.fsf@secretsauce.net> References: <87y561obi5.fsf@secretsauce.net> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: ger.gmane.org 1381863919 15133 80.91.229.3 (15 Oct 2013 19:05:19 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 15 Oct 2013 19:05:19 +0000 (UTC) To: 15580@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Oct 15 21:05:23 2013 Return-path: Envelope-to: geb-bug-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 1VW9vj-0005Jr-U7 for geb-bug-gnu-emacs@m.gmane.org; Tue, 15 Oct 2013 21:05:20 +0200 Original-Received: from localhost ([::1]:43433 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VW9vj-0006DT-Fn for geb-bug-gnu-emacs@m.gmane.org; Tue, 15 Oct 2013 15:05:19 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:51042) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VW9va-00062d-DQ for bug-gnu-emacs@gnu.org; Tue, 15 Oct 2013 15:05:15 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VW9vV-0003oj-2u for bug-gnu-emacs@gnu.org; Tue, 15 Oct 2013 15:05:10 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:38089) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VW9vU-0003nt-NS for bug-gnu-emacs@gnu.org; Tue, 15 Oct 2013 15:05:05 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1VW9vU-000658-Eg for bug-gnu-emacs@gnu.org; Tue, 15 Oct 2013 15:05:04 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Dima Kogan Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 15 Oct 2013 19:05:04 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 15580 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 15580-submit@debbugs.gnu.org id=B15580.138186384423272 (code B ref 15580); Tue, 15 Oct 2013 19:05:04 +0000 Original-Received: (at 15580) by debbugs.gnu.org; 15 Oct 2013 19:04:04 +0000 Original-Received: from localhost ([127.0.0.1]:52101 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VW9uW-00063H-2P for submit@debbugs.gnu.org; Tue, 15 Oct 2013 15:04:04 -0400 Original-Received: from out1-smtp.messagingengine.com ([66.111.4.25]:39297) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VW9uU-00062x-6M for 15580@debbugs.gnu.org; Tue, 15 Oct 2013 15:04:02 -0400 Original-Received: from compute3.internal (compute3.nyi.mail.srv.osa [10.202.2.43]) by gateway1.nyi.mail.srv.osa (Postfix) with ESMTP id D746B237C8 for <15580@debbugs.gnu.org>; Tue, 15 Oct 2013 15:03:59 -0400 (EDT) Original-Received: from frontend1 ([10.202.2.160]) by compute3.internal (MEProxy); Tue, 15 Oct 2013 15:04:00 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=secretsauce.net; h=from:to:subject:references:in-reply-to:date:message-id :mime-version:content-type; s=mesmtp; bh=xeJ0VEg3lsp04TXWHlVAFFs 736w=; b=dNyJRRyRYlHxC73qV9mmuXtYT7cG/pagHb6s9/qf2Egt9HfAmCpKh86 gmx3pRNhdpyZbr32m1aPIGyzrQ+sNzMw8wnqKuuvsk3lF5m3N+cSpj5NRHVpCJCh 4UFi6bpp/4jHd5m+Z6QgWgy4Y0gaHITdHjIgL+ZXJLyWxP41NM9k= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=from:to:subject:references:in-reply-to :date:message-id:mime-version:content-type; s=smtpout; bh=xeJ0VE g3lsp04TXWHlVAFFs736w=; b=OFsDeD1njuXyjzddXUqfQTbxp7Hd+01R833ML7 CRXhW0N3GwtSpsHQ6utwA2FoiyZpn8coQLDfpNdaRqAqizwpX3KTUM4Xor16IV8P GGluOI+SQ6nOabo/F3Gi7VsUiFu5raDd0goUrgUepEeJ9v0qW1l2VSvSSRxMkcTq FzG18= X-Sasl-enc: 2td25EIwPZ0KkeAUSMWbtRyM5vXuTNu28jRzSJJIz/vs 1381863839 Original-Received: from shorty.local (unknown [76.169.247.77]) by mail.messagingengine.com (Postfix) with ESMTPA id A09DFC00E81 for <15580@debbugs.gnu.org>; Tue, 15 Oct 2013 15:03:59 -0400 (EDT) Original-Received: from dima by shorty.local with local (Exim 4.80) (envelope-from ) id 1VW9uQ-0006QY-IG for 15580@debbugs.gnu.org; Tue, 15 Oct 2013 12:03:58 -0700 User-agent: mu4e 0.9.9.5; emacs 24.3.50.1 In-reply-to: X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:79287 Archived-At: --=-=-= Content-Type: text/plain Stefan Monnier writes: > Thanks. I slightly simplified your patch (since re-search-forward > already signal search-failed if the 3rd arg is nil) and installed it. Hi. Thanks for looking at this. I tried the fix you made in the repo, and it has two issues: 1. search-failed is raised with (signal) not (throw), so it needs to be caught differently 2. You changed (re-search-forward) to (search-forward), however we still are searching for a regex, so it must remain re-search-forward. I'm attaching a patch to fix these two issues dima --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=0001-Correction-to-the-recent-subword-capitalize-fix.patch >From b3d45ce893aa51f9fd7175a70003dca5571be9d2 Mon Sep 17 00:00:00 2001 From: Dima Kogan Date: Tue, 15 Oct 2013 11:54:56 -0700 Subject: [PATCH] Correction to the recent subword-capitalize fix This applies to emacs bug 15580 --- lisp/progmodes/subword.el | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lisp/progmodes/subword.el b/lisp/progmodes/subword.el index 1232588..0d754d5 100644 --- a/lisp/progmodes/subword.el +++ b/lisp/progmodes/subword.el @@ -257,7 +257,7 @@ Optional argument ARG is the same as for `upcase-word'." See the command `subword-mode' for a description of subwords. Optional argument ARG is the same as for `capitalize-word'." (interactive "p") - (catch 'search-failed + (condition-case nil (let ((count (abs arg)) (start (point)) (advance (>= arg 0))) @@ -265,7 +265,7 @@ Optional argument ARG is the same as for `capitalize-word'." (dotimes (i count) (if advance (progn - (search-forward "[[:alpha:]]") + (re-search-forward "[[:alpha:]]") (goto-char (match-beginning 0))) (subword-backward)) (let* ((p (point)) @@ -275,7 +275,8 @@ Optional argument ARG is the same as for `capitalize-word'." (downcase-region pp np) (goto-char (if advance np p)))) (unless advance - (goto-char start))))) + (goto-char start))) + (search-failed nil))) -- 1.8.3.2 --=-=-=--