diff options
author | Henrik Nord <[email protected]> | 2014-01-23 14:02:40 +0100 |
---|---|---|
committer | Henrik Nord <[email protected]> | 2014-01-23 14:02:54 +0100 |
commit | fb60686855fdc3285c559e21427481f07f8f129e (patch) | |
tree | aa1c5cfc6a52cdc15e1c835d1f4b02337c514048 /lib/tools/emacs/erlang.el | |
parent | e99633a51cbd22b16606c2669c575c22cf1c511f (diff) | |
parent | a90e55b77976e813e23eeadf80e5e89e7f5e7d78 (diff) | |
download | otp-fb60686855fdc3285c559e21427481f07f8f129e.tar.gz otp-fb60686855fdc3285c559e21427481f07f8f129e.tar.bz2 otp-fb60686855fdc3285c559e21427481f07f8f129e.zip |
Merge branch 'vinoski/emacs-fixes'
* vinoski/emacs-fixes:
fix emacs erlang skeleton indentation
fix indentation error from scan-sexp in erlang.el
prevent errors from erlang.el
fix erlang-mode erlang-get-function-arity
OTP-11601
Diffstat (limited to 'lib/tools/emacs/erlang.el')
-rw-r--r-- | lib/tools/emacs/erlang.el | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/lib/tools/emacs/erlang.el b/lib/tools/emacs/erlang.el index fd90e3a870..3a868f1300 100644 --- a/lib/tools/emacs/erlang.el +++ b/lib/tools/emacs/erlang.el @@ -73,6 +73,8 @@ ;; M-x set-variable RET debug-on-error RET t RET ;;; Code: +(eval-when-compile (require 'cl)) + ;; Variables: (defconst erlang-version "2.7" @@ -3043,7 +3045,7 @@ This assumes that the preceding expression is either simple \(i.e. an atom) or parenthesized." (save-excursion (or arg (setq arg 1)) - (forward-sexp (- arg)) + (ignore-errors (forward-sexp (- arg))) (let ((col (current-column))) (skip-chars-backward " \t") ;; Special hack to handle: (note line break) @@ -3650,6 +3652,10 @@ Normally used in conjunction with `erlang-beginning-of-clause', e.g.: (setq cont nil)) ((looking-at "\\s *\\($\\|%\\)") (forward-line 1)) + ((looking-at "\\s *<<[^>]*?>>") + (when (zerop res) + (setq res (+ 1 res))) + (goto-char (match-end 0))) ((looking-at "\\s *,") (setq res (+ 1 res)) (goto-char (match-end 0))) @@ -3931,7 +3937,7 @@ non-whitespace characters following the point on the current line." (self-insert-command arg) ;; Was this the second char in bit-syntax open (`<<')? - (unless (< (point) 2) + (unless (<= (point) 2) (save-excursion (backward-char 2) (when (and (eq (char-after (point)) ?<) @@ -3952,7 +3958,7 @@ non-whitespace characters following the point on the current line." (defun erlang-after-bitsyntax-close () "Return t if point is immediately after a bit-syntax close parenthesis (`>>')." - (and (>= (point) 2) + (and (>= (point) 3) (save-excursion (backward-char 2) (and (eq (char-after (point)) ?>) |