Commit b8a02560 authored by Mats Lidell's avatar Mats Lidell Committed by Sameer Ajmani

go-mode: Works for both GNU-Emacs and XEmacs-21.5

Fixes some portability issues between the Emacsen.

R=golang-dev, sameer, bradfitz, ryanb
CC=golang-dev
https://golang.org/cl/6206043
parent 6f3ffd4d
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
(modify-syntax-entry ?+ "." st) (modify-syntax-entry ?+ "." st)
(modify-syntax-entry ?- "." st) (modify-syntax-entry ?- "." st)
(modify-syntax-entry ?* ". 23" st) ; also part of comments (modify-syntax-entry ?* ". 23" st) ; also part of comments
(modify-syntax-entry ?/ ". 124b" st) ; ditto (modify-syntax-entry ?/ (if (featurep 'xemacs) ". 1456" ". 124b") st) ; ditto
(modify-syntax-entry ?% "." st) (modify-syntax-entry ?% "." st)
(modify-syntax-entry ?& "." st) (modify-syntax-entry ?& "." st)
(modify-syntax-entry ?| "." st) (modify-syntax-entry ?| "." st)
...@@ -442,7 +442,7 @@ if no further tokens of the type exist." ...@@ -442,7 +442,7 @@ if no further tokens of the type exist."
(when (search-forward "\n" (cdr cs) t) (when (search-forward "\n" (cdr cs) t)
(put-text-property (put-text-property
(car cs) (cdr cs) 'font-lock-multline t)) (car cs) (cdr cs) 'font-lock-multline t))
(set-match-data (list (car cs) (cdr cs) (current-buffer))) (set-match-data (list (car cs) (copy-marker (cdr cs))))
(goto-char (cdr cs)) (goto-char (cdr cs))
(setq result t)) (setq result t))
;; Wrong type. Look for next comment/string after this one. ;; Wrong type. Look for next comment/string after this one.
...@@ -554,7 +554,7 @@ token on the line." ...@@ -554,7 +554,7 @@ token on the line."
(defun go-mode-whitespace-p (char) (defun go-mode-whitespace-p (char)
"Is newline, or char whitespace in the syntax table for go." "Is newline, or char whitespace in the syntax table for go."
(or (eq char ?\n) (or (eq char ?\n)
(eq 32 (char-syntax char)))) (= (char-syntax char) ?\ )))
(defun go-mode-backward-skip-comments () (defun go-mode-backward-skip-comments ()
"Skip backward over comments and whitespace." "Skip backward over comments and whitespace."
......
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