From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.bugs Subject: bug#12785: [octave-mod] Changed behaviour of octave-mark-block? Date: Wed, 05 Dec 2012 00:30:47 -0500 Message-ID: References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1354685464 7370 80.91.229.3 (5 Dec 2012 05:31:04 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 5 Dec 2012 05:31:04 +0000 (UTC) Cc: 12785-done@debbugs.gnu.org To: Mark Hepburn Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Dec 05 06:31:16 2012 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 1Tg7Zi-0002iz-G6 for geb-bug-gnu-emacs@m.gmane.org; Wed, 05 Dec 2012 06:31:14 +0100 Original-Received: from localhost ([::1]:58531 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tg7ZW-0001Hr-Ia for geb-bug-gnu-emacs@m.gmane.org; Wed, 05 Dec 2012 00:31:02 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:50848) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tg7ZT-0001Hh-I7 for bug-gnu-emacs@gnu.org; Wed, 05 Dec 2012 00:31:00 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Tg7ZR-0000sM-1B for bug-gnu-emacs@gnu.org; Wed, 05 Dec 2012 00:30:59 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:43828) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tg7ZQ-0000sC-UQ for bug-gnu-emacs@gnu.org; Wed, 05 Dec 2012 00:30:56 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1Tg7ZW-0000lk-3r for bug-gnu-emacs@gnu.org; Wed, 05 Dec 2012 00:31:02 -0500 Resent-From: Stefan Monnier Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: bug-gnu-emacs@gnu.org Resent-Date: Wed, 05 Dec 2012 05:31:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: cc-closed 12785 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Mail-Followup-To: 12785@debbugs.gnu.org, monnier@iro.umontreal.ca, mark.hepburn@gmail.com Original-Received: via spool by 12785-done@debbugs.gnu.org id=D12785.13546854562943 (code D ref 12785); Wed, 05 Dec 2012 05:31:01 +0000 Original-Received: (at 12785-done) by debbugs.gnu.org; 5 Dec 2012 05:30:56 +0000 Original-Received: from localhost ([127.0.0.1]:54077 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Tg7ZQ-0000lQ-IL for submit@debbugs.gnu.org; Wed, 05 Dec 2012 00:30:56 -0500 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.182]:21085) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Tg7ZO-0000lI-RK for 12785-done@debbugs.gnu.org; Wed, 05 Dec 2012 00:30:55 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Ai0FAG6Zu09soXOY/2dsb2JhbABEsEiDSYEIghUBAQQBViMFCws0EhQYDSSIHAW6CZBEA4hCmnGBWIMH X-IronPort-AV: E=Sophos;i="4.75,637,1330923600"; d="scan'208";a="209105691" Original-Received: from 108-161-115-152.dsl.teksavvy.com (HELO pastel.home) ([108.161.115.152]) by ironport2-out.teksavvy.com with ESMTP/TLS/ADH-AES256-SHA; 05 Dec 2012 00:30:48 -0500 Original-Received: by pastel.home (Postfix, from userid 20848) id 0F7AE58C73; Wed, 5 Dec 2012 00:30:47 -0500 (EST) In-Reply-To: (Mark Hepburn's message of "Wed, 5 Dec 2012 10:23:22 +1100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.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:67955 Archived-At: > Regarding the "end|" case, the old mode wouldn't mark the block, and I feel > that's correct behaviour. In the "|for" case as I mentioned, the old mode > _did_ mark the block (not the enclosing one), but I agree that marking the > enclosing block is probably preferable and more consistent. Indeed, the code tried to reproduce this "mark the block after point instead of the enclosing one" but had a bug in it. I've fixed the "starting within a token" problem as well as the above check (so the inner `for' will be marked if you're right in front of it). Stefan === modified file 'lisp/progmodes/octave-mod.el' --- lisp/progmodes/octave-mod.el 2012-09-17 05:41:04 +0000 +++ lisp/progmodes/octave-mod.el 2012-12-05 05:21:07 +0000 @@ -794,11 +794,14 @@ "Put point at the beginning of this Octave block, mark at the end. The block marked is the one that contains point or follows point." (interactive) + (if (and (looking-at "\\sw\\|\\s_") + (looking-back "\\sw\\|\\s_" (1- (point)))) + (skip-syntax-forward "w_")) (unless (or (looking-at "\\s(") (save-excursion (let* ((token (funcall smie-forward-token-function)) (level (assoc token smie-grammar))) - (and level (null (cadr level)))))) + (and level (not (numberp (cadr level))))))) (backward-up-list 1)) (mark-sexp))