{"push_id":2864493556,"size":2,"distinct_size":1,"ref":"refs/heads/master","head":"9a844ee1252d496bbec7c2be280c73089d802d58","before":"36c005d5617a944f19853649344a915a48f6b9a0","commits":[{"sha":"3194005d9cc3f1bffded67701e467268b76a751f","author":{"name":"Wilfred Hughes","email":"959425acc855493d16e2c143eb73cfe00506ccfc@fb.com"},"message":"Improve syntax highlighting by removing dependency on c-mode\n\nThis changes syntax highlighting in hack-mode to be a standalone mode\nwithout using c-mode. This simplifies the logic, as we don't need to\ntell Emacs to ignore c-mode features that aren't applicable to\nhack-mode, such as the C preprocessor.\n\nIt also fixes Emacs 26 support, as some c-mode APIs have\nchanged (e.g. c-font-lock-declarators now takes another argument) and\nwould reliably crash when opening Hack files:\n\n    Debugger entered--Lisp error: (wrong-type-argument stringp nil)\n      search-forward-regexp(nil 138 bound)\n      c-depropertize-CPP(1 138)\n      #f(compiled-function (fn) #<bytecode 0x41f57035>)(c-depropertize-CPP)\n      mapc(#f(compiled-function (fn) #<bytecode 0x41f57035>) (c-extend-region-for-CPP c-depropertize-CPP c-invalidate-macro-cache c-truncate-bs-cache c-parse-quotes-before-change))\n      c-common-init(hack-mode)\n      (let ((delay-mode-hooks t)) (c-mode) (setq major-mode 'hack-mode) (setq mode-name \"Hack\") (progn (if (get 'c-mode 'mode-class) (put 'hack-mode 'mode-class (get 'c-mode 'mode-class))) (if (keymap-parent hack-mode-map) nil (set-keymap-parent hack-mode-map (current-local-map))) (let ((parent (char-table-parent hack-mode-syntax-table))) (if (and parent (not (eq parent (standard-syntax-table)))) nil (set-char-table-parent hack-mode-syntax-table (syntax-table)))) (if (or (abbrev-table-get hack-mode-abbrev-table :parents) (eq hack-mode-abbrev-table local-abbrev-table)) nil (abbrev-table-put hack-mode-abbrev-table :parents (list local-abbrev-table)))) (use-local-map hack-mode-map) (set-syntax-table hack-mode-syntax-table) (setq local-abbrev-table hack-mode-abbrev-table) (c-initialize-cc-mode t) (funcall (function (lambda nil (require 'cc-langs) (let ((c-buffer-is-cc-mode 'hack-mode) (init (append (cdr c-emacs-variable-inits) (cdr c-lang-variable-inits))) current-var) (progn (make-local-variable 'comment-start) (make-local-variable 'comment-end) (make-local-variable 'comment-start-skip) (make-local-variable 'comment-end-can-be-escaped) (make-local-variable 'beginning-of-defun-function) (make-local-variable 'end-of-defun-function)) (condition-case err (let ((--dolist-tail-- init)) (while --dolist-tail-- (let ((var-init (car --dolist-tail--))) (setq current-var (car var-init)) (set (car var-init) (eval (car (cdr var-init)))) (setq --dolist-tail-- (cdr --dolist-tail--))))) (error (if current-var (message \"Eval error in the `c-lang-defvar' or `c-lang-setver' for `%s' (source eval): %S\" current-var err) (signal (car err) (cdr err))))))))) (c-common-init 'hack-mode) (set (make-local-variable 'font-lock-maximum-decoration) t) (set (make-local-variable 'case-fold-search) t) (set (make-local-variable 'compile-command) (concat hack-client-program-name \" --from emacs\")) (set (make-local-variable 'indent-line-function) (function hack-xhp-indent-line)) (c-set-style \"hack\") (run-mode-hooks 'c-mode-common-hook 'hack-mode-hook) (c-update-modeline))\n      (progn (make-local-variable 'delay-mode-hooks) (let ((delay-mode-hooks t)) (c-mode) (setq major-mode 'hack-mode) (setq mode-name \"Hack\") (progn (if (get 'c-mode 'mode-class) (put 'hack-mode 'mode-class (get 'c-mode 'mode-class))) (if (keymap-parent hack-mode-map) nil (set-keymap-parent hack-mode-map (current-local-map))) (let ((parent (char-table-parent hack-mode-syntax-table))) (if (and parent (not (eq parent (standard-syntax-table)))) nil (set-char-table-parent hack-mode-syntax-table (syntax-table)))) (if (or (abbrev-table-get hack-mode-abbrev-table :parents) (eq hack-mode-abbrev-table local-abbrev-table)) nil (abbrev-table-put hack-mode-abbrev-table :parents (list local-abbrev-table)))) (use-local-map hack-mode-map) (set-syntax-table hack-mode-syntax-table) (setq local-abbrev-table hack-mode-abbrev-table) (c-initialize-cc-mode t) (funcall (function (lambda nil (require 'cc-langs) (let ((c-buffer-is-cc-mode 'hack-mode) (init (append (cdr c-emacs-variable-inits) (cdr c-lang-variable-inits))) current-var) (progn (make-local-variable 'comment-start) (make-local-variable 'comment-end) (make-local-variable 'comment-start-skip) (make-local-variable 'comment-end-can-be-escaped) (make-local-variable 'beginning-of-defun-function) (make-local-variable 'end-of-defun-function)) (condition-case err (let ((--dolist-tail-- init)) (while --dolist-tail-- (let ((var-init (car --dolist-tail--))) (setq current-var (car var-init)) (set (car var-init) (eval (car (cdr var-init)))) (setq --dolist-tail-- (cdr --dolist-tail--))))) (error (if current-var (message \"Eval error in the `c-lang-defvar' or `c-lang-setver' for `%s' (source eval): %S\" current-var err) (signal (car err) (cdr err))))))))) (c-common-init 'hack-mode) (set (make-local-variable 'font-lock-maximum-decoration) t) (set (make-local-variable 'case-fold-search) t) (set (make-local-variable 'compile-command) (concat hack-client-program-name \" --from emacs\")) (set (make-local-variable 'indent-line-function) (function hack-xhp-indent-line)) (c-set-style \"hack\") (run-mode-hooks 'c-mode-common-hook 'hack-mode-hook) (c-update-modeline)))\n      hack-mode()\n      funcall-interactively(hack-mode)\n      call-interactively(hack-mode record nil)\n      command-execute(hack-mode record)\n\nSyntax highlighting is now based on the lexer used by Hack, ensuring\nthat we have full coverage (e.g. nonnull was missing\nbefore). Variables $foo are highlighted, but the $ itself is not, to\nmake it easy to focus on the name (the same as php-mode).\n\nFunction and method names are now also highlighted.","distinct":false,"url":"https://api.github.com/repos/hhvm/hack-mode/commits/3194005d9cc3f1bffded67701e467268b76a751f"},{"sha":"9a844ee1252d496bbec7c2be280c73089d802d58","author":{"name":"John Allen","email":"84b5b5ae64931c0e314916d48a15fa54978e0e69@users.noreply.github.com"},"message":"Merge pull request #2 from hhvm/dont_use_c_mode\n\nImprove syntax highlighting by removing dependency on c-mode","distinct":true,"url":"https://api.github.com/repos/hhvm/hack-mode/commits/9a844ee1252d496bbec7c2be280c73089d802d58"}]}
{"actor":{"display_login":"jra3"}}