GNU bug report logs - #12785
[octave-mod] Changed behaviour of octave-mark-block?

Previous Next

Package: emacs;

Reported by: Mark Hepburn <mark.hepburn <at> gmail.com>

Date: Fri, 2 Nov 2012 07:50:02 UTC

Severity: important

Done: Stefan Monnier <monnier <at> iro.umontreal.ca>

Bug is archived. No further changes may be made.

Full log


Message #18 received at 12785-done <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Mark Hepburn <mark.hepburn <at> gmail.com>
Cc: 12785-done <at> debbugs.gnu.org
Subject: Re: bug#12785: [octave-mod] Changed behaviour of octave-mark-block?
Date: Wed, 05 Dec 2012 00:30:47 -0500
> 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))
 





This bug report was last modified 12 years and 222 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.