From: Stefan Monnier <monnier@iro.umontreal.ca>
To: Mark Hepburn <mark.hepburn@gmail.com>
Cc: 12785-done@debbugs.gnu.org
Subject: bug#12785: [octave-mod] Changed behaviour of octave-mark-block?
Date: Wed, 05 Dec 2012 00:30:47 -0500 [thread overview]
Message-ID: <jwv8v9doyso.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <CAG1hmhi2LdU8V=JycotcR7W8Zr60eKbzwo2_+8Lvn4hZ1Z_Gpw@mail.gmail.com> (Mark Hepburn's message of "Wed, 5 Dec 2012 10:23:22 +1100")
> 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))
next prev parent reply other threads:[~2012-12-05 5:30 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-11-02 7:42 bug#12785: [octave-mod] Changed behaviour of octave-mark-block? Mark Hepburn
2012-12-04 22:02 ` Stefan Monnier
2012-12-04 23:23 ` Mark Hepburn
2012-12-05 5:30 ` Stefan Monnier [this message]
2012-12-05 12:04 ` Mark Hepburn
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=jwv8v9doyso.fsf-monnier+emacs@gnu.org \
--to=monnier@iro.umontreal.ca \
--cc=12785-done@debbugs.gnu.org \
--cc=mark.hepburn@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.