From e53052d3bf33296268db3aadcf5531f69f8e55ae Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Fri, 26 Apr 2013 10:34:26 -0400 Subject: [PATCH] * lisp/progmodes/octave.el (octave-smie-forward-token): Properly skip \n and comment, even if it's not an implicit ;. Fixes: debbugs:14218 --- lisp/ChangeLog | 11 ++++++++--- lisp/progmodes/octave.el | 11 ++++++----- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 340dc41a744..e236b923932 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2013-04-26 Stefan Monnier + + * progmodes/octave.el (octave-smie-forward-token): Properly skip + \n and comment, even if it's not an implicit ; (bug#14218). + 2013-04-26 Glenn Morris * subr.el (read-number): Once more use `read' rather than @@ -20,7 +25,7 @@ * progmodes/octave.el (octave-submit-bug-report): Obsolete. (octave-mode, inferior-octave-mode): Use setq-local. - (octave-not-in-string-or-comment-p): Renamed to + (octave-not-in-string-or-comment-p): Rename to octave-in-string-or-comment-p. (octave-in-comment-p, octave-in-string-p) (octave-in-string-or-comment-p): Replace defsubst with defun. @@ -36,8 +41,8 @@ 2013-04-25 Leo Liu - * progmodes/octave.el (octave-completion-at-point-function): Make - use of inferior octave process. + * progmodes/octave.el (octave-completion-at-point-function): + Make use of inferior octave process. (octave-initialize-completions): Remove. (inferior-octave-completion-table): New function. (inferior-octave-completion-at-point): Use it. diff --git a/lisp/progmodes/octave.el b/lisp/progmodes/octave.el index 640775bfe8b..c5f83a50654 100644 --- a/lisp/progmodes/octave.el +++ b/lisp/progmodes/octave.el @@ -461,11 +461,12 @@ Non-nil means always go to the next Octave code line after sending." (forward-comment 1)) (cond ((and (looking-at "$\\|[%#]") - (not (smie-rule-bolp)) - ;; Ignore it if it's within parentheses. - (prog1 (let ((ppss (syntax-ppss))) - (not (and (nth 1 ppss) - (eq ?\( (char-after (nth 1 ppss)))))) + ;; Ignore it if it's within parentheses or if the newline does not end + ;; some preceding text. + (prog1 (and (not (smie-rule-bolp)) + (let ((ppss (syntax-ppss))) + (not (and (nth 1 ppss) + (eq ?\( (char-after (nth 1 ppss))))))) (forward-comment (point-max)))) ;; Why bother distinguishing \n and ;? ";") ;;"\n" -- 2.39.2