emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/trunk r112489: * lisp/progmodes/octave.el (


From: Stefan Monnier
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r112489: * lisp/progmodes/octave.el (octave-smie-forward-token): Be more careful
Date: Tue, 07 May 2013 00:05:43 -0400
User-agent: Bazaar (2.6b2)

------------------------------------------------------------
revno: 112489
fixes bug: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=14218
committer: Stefan Monnier <address@hidden>
branch nick: trunk
timestamp: Tue 2013-05-07 00:05:43 -0400
message:
  * lisp/progmodes/octave.el (octave-smie-forward-token): Be more careful
  about implicit semi-colons.
modified:
  lisp/ChangeLog
  lisp/progmodes/octave.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2013-05-07 01:12:22 +0000
+++ b/lisp/ChangeLog    2013-05-07 04:05:43 +0000
@@ -1,3 +1,8 @@
+2013-05-07  Stefan Monnier  <address@hidden>
+
+       * progmodes/octave.el (octave-smie-forward-token): Be more careful
+       about implicit semi-colons (bug#14218).
+
 2013-05-07  YAMAMOTO Mitsuharu  <address@hidden>
 
        * frame.el (display-monitor-attributes-list)

=== modified file 'lisp/progmodes/octave.el'
--- a/lisp/progmodes/octave.el  2013-05-06 23:46:07 +0000
+++ b/lisp/progmodes/octave.el  2013-05-07 04:05:43 +0000
@@ -370,16 +370,18 @@
     (goto-char (match-end 1))
     (forward-comment 1))
   (cond
-   ((and (looking-at "$\\|[%#]")
-         ;; 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))))
+   ((and (looking-at "[%#\n]")
+         (not (or (save-excursion (skip-chars-backward " \t")
+                                  ;; Only add implicit ; when needed.
+                                  (or (bolp) (eq (char-before ?\;))))
+                  ;; Ignore it if it's within parentheses.
+                  (let ((ppss (syntax-ppss)))
+                    (and (nth 1 ppss)
+                         (eq ?\( (char-after (nth 1 ppss))))))))
+    (if (eolp) (forward-char 1) (forward-comment 1))
     ;; Why bother distinguishing \n and ;?
     ";") ;;"\n"
+   ((progn (forward-comment (point-max)) nil))
    ((looking-at ";[ \t]*\\($\\|[%#]\\)")
     ;; Combine the ; with the subsequent \n.
     (goto-char (match-beginning 1))


reply via email to

[Prev in Thread] Current Thread [Next in Thread]