Commit ebd3fa6b authored by Michaël Cadilhac's avatar Michaël Cadilhac
Browse files

(meta-indent-unfinished-line): Do not say that a `%' in a string is

a comment-start.
(meta-indent-previous-line): Fix style.
parent 89c19c1e
......@@ -5,6 +5,8 @@
(meta-comment-indent, meta-indent-previous-line)
(meta-indent-unfinished-line, meta-beginning-of-defun)
(meta-end-of-defun, meta-common-initialization): Handle \f.
(meta-indent-unfinished-line): Do not handle a `%' in a string as
a comment-start.
* files.el (file-modes-char-to-who, file-modes-char-to-right)
(file-modes-rights-to-number): Auxiliary functions for symbolic to
......@@ -652,15 +652,19 @@ If the list was changed, sort the list and remove duplicates first."
;; Ignore comments.
(while (and (looking-at comment-start) (not (bobp)))
(skip-chars-backward "\n\t\f ")
(if (not (bobp))
(move-to-column (current-indentation)))))
(when (not (bobp))
(move-to-column (current-indentation)))))
(defun meta-indent-unfinished-line ()
"Tell if the current line of code ends with an unfinished expression."
;; Skip backward the comments.
(while (search-backward comment-start (point-at-bol) t))
(let ((point-not-in-string (point)))
(while (search-backward comment-start (point-at-bol) t)
(unless (meta-indent-in-string-p)
(setq point-not-in-string (point))))
(goto-char point-not-in-string))
;; Search for the end of the previous expression.
(if (search-backward ";" (point-at-bol) t)
(progn (while (and (meta-indent-in-string-p)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment