branch: elpa/gnuplot
commit 7f295784100d89e858c6a760c6a902a409e31555
Author: Jonathan Oddie <[email protected]>
Commit: Jonathan Oddie <[email protected]>

    Minor improvements to movement-by-command functions
---
 gnuplot.el | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/gnuplot.el b/gnuplot.el
index d7d6a1d..186aa94 100644
--- a/gnuplot.el
+++ b/gnuplot.el
@@ -2374,21 +2374,22 @@ If there are no continuation lines, returns 
point-at-eol."
 (defun gnuplot-beginning-of-command ()
   "Move point to beginning of command containing point."
   (let ((limit (gnuplot-point-at-beginning-of-continuation)))
-    (search-backward ";" limit 'lim)
     (while
-       (gnuplot-in-string-or-comment)
-      (search-backward ";" limit 'lim)))
-  (skip-chars-forward ";")
-  (skip-syntax-forward "-"))
+       (and
+        (search-backward ";" limit 'lim)
+        (gnuplot-in-string-or-comment)))
+    (skip-chars-forward ";")
+    (skip-syntax-forward "-")))
 
 (defun gnuplot-end-of-command ()
   "Move point to end of command containing point."
   (let ((limit (gnuplot-point-at-end-of-continuation)))
-    (search-forward ";" limit 'lim)
     (while
-       (gnuplot-in-string-or-comment)
-      (search-forward ";" limit 'lim)))
-  (backward-char))
+       (and
+        (search-forward ";" limit 'lim)
+        (gnuplot-in-string-or-comment)))
+    (skip-chars-backward ";")
+    (skip-syntax-backward "-")))
 
 (defun gnuplot-point-at-beginning-of-command ()
   "Return position at the beginning of command containing point."

Reply via email to