aboutsummaryrefslogtreecommitdiffstats
path: root/lib/tools/emacs
diff options
context:
space:
mode:
authorSteve Vinoski <[email protected]>2014-01-07 23:12:19 -0500
committerSteve Vinoski <[email protected]>2014-01-07 23:19:14 -0500
commita94be31b40aa5505366b07ba7c8212b869453522 (patch)
tree341fd1b777e3b86796ea6738d14af1564bc9d1de /lib/tools/emacs
parent25237481ccccd3ddfa74582dc267632ad618ba30 (diff)
downloadotp-a94be31b40aa5505366b07ba7c8212b869453522.tar.gz
otp-a94be31b40aa5505366b07ba7c8212b869453522.tar.bz2
otp-a94be31b40aa5505366b07ba7c8212b869453522.zip
prevent errors from erlang.el
In erlang.el, add a line to evaluate the cl package at compile time so that the use of the block macro (such as on line 3750), which is an alias for cl-block, is evaluated correctly when erlang.el is compiled. Also modify comparisons against (point) in functions erlang-electric-lt and erlang-after-bitsyntax-close so that typing the characters '<' and '>' (without the quotes) at the beginning of a buffer does not cause errors. Thanks to user leo2007 in the #erlang channel on IRC for reporting these problems and providing fixes.
Diffstat (limited to 'lib/tools/emacs')
-rw-r--r--lib/tools/emacs/erlang.el6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/tools/emacs/erlang.el b/lib/tools/emacs/erlang.el
index c395d22356..767d086c61 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"
@@ -3926,7 +3928,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)) ?<)
@@ -3947,7 +3949,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)) ?>)