* progmodes/octave.el (octave-beginning-of-line)

(octave-end-of-line): Check before using up-list because it jumps
out of more syntactic contructs since moving to smie.
This commit is contained in:
Leo Liu 2013-05-11 11:50:34 +08:00
parent 5d10860617
commit 083fe0d743
2 changed files with 34 additions and 30 deletions

View file

@ -1,3 +1,9 @@
2013-05-11 Leo Liu <sdl.web@gmail.com>
* progmodes/octave.el (octave-beginning-of-line)
(octave-end-of-line): Check before using up-list because it jumps
out of more syntactic contructs since moving to smie.
2013-05-11 Glenn Morris <rgm@gnu.org>
* faces.el (internal-face-x-get-resource):
@ -89,7 +95,7 @@
2013-05-09 Leo Liu <sdl.web@gmail.com>
* progmodes/octave.el (inferior-octave-completion-at-point):
Restore the broken file completion. (Bug#14300)
Restore file completion. (Bug#14300)
(inferior-octave-startup): Fix incorrect highlighting for the
first prompt.

View file

@ -1107,45 +1107,43 @@ On success, return 0. Otherwise, go as far as possible and return -1."
If on an empty or comment line, go to the beginning of that line.
Otherwise, move backward to the beginning of the first Octave code line
which is not inside a continuation statement, i.e., which does not
follow a code line ending in `...' or `\\', or is inside an open
follow a code line ending with `...' or is inside an open
parenthesis list."
(interactive)
(beginning-of-line)
(if (not (looking-at "\\s-*\\($\\|\\s<\\)"))
(while (or (condition-case nil
(progn
(up-list -1)
(beginning-of-line)
t)
(error nil))
(and (or (looking-at "\\s-*\\($\\|\\s<\\)")
(save-excursion
(if (zerop (octave-previous-code-line))
(looking-at octave-continuation-regexp))))
(zerop (forward-line -1)))))))
(unless (looking-at "\\s-*\\($\\|\\s<\\)")
(while (or (when (cadr (syntax-ppss))
(goto-char (cadr (syntax-ppss)))
(beginning-of-line)
t)
(and (or (looking-at "\\s-*\\($\\|\\s<\\)")
(save-excursion
(if (zerop (octave-previous-code-line))
(looking-at octave-continuation-regexp))))
(zerop (forward-line -1)))))))
(defun octave-end-of-line ()
"Move point to end of current Octave line.
If on an empty or comment line, go to the end of that line.
Otherwise, move forward to the end of the first Octave code line which
does not end in `...' or `\\' or is inside an open parenthesis list."
does not end with `...' or is inside an open parenthesis list."
(interactive)
(end-of-line)
(if (save-excursion
(beginning-of-line)
(looking-at "\\s-*\\($\\|\\s<\\)"))
()
(while (or (condition-case nil
(progn
(up-list 1)
(end-of-line)
t)
(error nil))
(and (save-excursion
(beginning-of-line)
(or (looking-at "\\s-*\\($\\|\\s<\\)")
(looking-at octave-continuation-regexp)))
(zerop (forward-line 1)))))
(unless (save-excursion
(beginning-of-line)
(looking-at "\\s-*\\($\\|\\s<\\)"))
(while (or (when (cadr (syntax-ppss))
(condition-case nil
(progn
(up-list 1)
(end-of-line)
t)
(error nil)))
(and (save-excursion
(beginning-of-line)
(or (looking-at "\\s-*\\($\\|\\s<\\)")
(looking-at octave-continuation-regexp)))
(zerop (forward-line 1)))))
(end-of-line)))
(defun octave-mark-block ()