Last active
          December 8, 2018 13:35 
        
      - 
      
- 
        Save twlz0ne/2eb14047df67b4e8e631ba5da3f3a04c to your computer and use it in GitHub Desktop. 
    Test dart-mode, reproduce the issue 69. #emacs #dart-mode
  
        
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | ;;; Test dart-mode, reproduce the issue #69 | |
| ;; | |
| ;;; Date: 2018-10-24_16.02.30 | |
| ;; | |
| ;;; Enviroment | |
| ;; - macOS 10.11.6 | |
| ;; - Emacs 27.0.50 | |
| ;; - dart-mode-20181012.346 | |
| ;; - dash-20180910.1856 | |
| ;; - epl-20180205.2049 | |
| ;; - flycheck-20181018.1021 pkg-info-20150517.1143 s-20180406.808 | |
| ;; | |
| ;;; Reproduce | |
| ;; ⋊> emacs-nightly -Q -nw -l ~/.scratch/emacs/test-dart-mode-issue69.el ~/flutter/examples/platform_channel/lib/main.dart | |
| ;; | |
| ;; (toggle-debug-on-error) | |
| (global-set-key (kbd "C-h") 'delete-backward-char) | |
| (global-set-key (kbd "M-h") 'backward-kill-word) | |
| (global-set-key (kbd "<f1>") 'help-command) | |
| (define-key isearch-mode-map "\C-h" 'isearch-delete-char) | |
| ;; ------------------------------------------------------------------ | |
| ;; elpa | |
| (setq user-emacs-directory (format "~/.emacs.d/%s/%s/" (file-name-base load-file-name) emacs-version)) | |
| (setq package-user-dir (concat user-emacs-directory "elpa/")) | |
| (unless (load "~/.emacs.d/elpa.el" t) | |
| (setq package-archives | |
| '(("gnu" . "https://elpa.gnu.org/packages/") | |
| ("melpa" . "https://melpa.org/packages/")))) | |
| (package-initialize) | |
| (defun require-packages (&rest packages) | |
| (dolist (pkg packages) | |
| (unless (package-installed-p pkg) | |
| (package-refresh-contents) | |
| (package-install pkg)) | |
| (require pkg))) | |
| ;; ------------------------------------------------------------------ | |
| ;; el-get | |
| ;; (setq el-get-dir (concat user-emacs-directory "el-get/")) | |
| ;; (add-to-list 'load-path (concat el-get-dir "el-get")) | |
| ;; | |
| ;; (setq el-get-git-shallow-clone t) | |
| ;; (setq el-get-byte-compile nil) | |
| ;; (setq el-get-bundle-byte-compile nil) | |
| ;; (setq el-get-install-skip-emacswiki-recipes t) | |
| ;; | |
| ;; (unless (require 'el-get nil 'noerror) | |
| ;; (with-current-buffer | |
| ;; (url-retrieve-synchronously | |
| ;; "https://raw.githubusercontent.com/dimitri/el-get/master/el-get-install.el") | |
| ;; (goto-char (point-max)) | |
| ;; (eval-print-last-sexp))) | |
| ;; | |
| ;; (remove-hook 'el-get-post-install-hooks 'el-get-post-install-notification) | |
| ;; ------------------------------------------------------------------ | |
| ;; configuration | |
| (require-packages | |
| 'dart-mode | |
| ) | |
| (add-hook 'after-init-hook | |
| (lambda () | |
| (setq dart-sdk-path (expand-file-name "~/flutter")) | |
| (setq dart-enable-analysis-server t) | |
| (unless noninteractive | |
| (view-echo-area-messages)) | |
| )) | |
| (run-hooks 'after-init-hook) | |
| ;;; test-dart-mode-issue69.el ends here | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | ;;; Test dart-mode, reproduce the jit lock function issue | |
| ;; | |
| ;;; Date: 2018-12-08 15.53.17 | |
| ;; | |
| ;;; Enviroment | |
| ;; - macOS 10.11.6 | |
| ;; - Emacs 27.0.50 | |
| ;; - Flutter 1.0.0 channel beta (revision 5391447fae • 2018-11-29 19:41:26 -0800) | |
| ;; - Dart 2.1.0 (build 2.1.0-dev.9.4 f9ebf21297) | |
| ;; - dart-mode-20181012.346 | |
| ;; - dash-20180910.1856 | |
| ;; - epl-20180205.2049 | |
| ;; - flycheck-20181127.1510 | |
| ;; - pkg-info-20150517.1143 | |
| ;; - s-20180406.808 | |
| ;; | |
| ;;; Reproduce | |
| ;; ⋊> emacs-nightly -Q -nw -l ~/.scratch/emacs/test-dart-mode-jit-lock-function-issue.el | |
| ;; | |
| ;; (toggle-debug-on-error) | |
| (global-set-key (kbd "C-h") 'delete-backward-char) | |
| (global-set-key (kbd "M-h") 'backward-kill-word) | |
| (global-set-key (kbd "<f1>") 'help-command) | |
| (define-key isearch-mode-map "\C-h" 'isearch-delete-char) | |
| ;; ------------------------------------------------------------------ | |
| ;; elpa | |
| (setq user-emacs-directory (format "~/.emacs.d/%s/%s/" (file-name-base load-file-name) emacs-version)) | |
| (setq package-user-dir (concat user-emacs-directory "elpa/")) | |
| (unless (load "~/.emacs.d/elpa.el" t t) | |
| (setq package-archives | |
| '(("gnu" . "https://elpa.gnu.org/packages/") | |
| ("melpa" . "https://melpa.org/packages/")))) | |
| (package-initialize) | |
| (defun require-packages (&rest packages) | |
| (dolist (pkg packages) | |
| (unless (package-installed-p pkg) | |
| (package-refresh-contents) | |
| (package-install pkg)) | |
| (require pkg))) | |
| ;; ------------------------------------------------------------------ | |
| ;; el-get | |
| ;; (setq el-get-dir (concat user-emacs-directory "el-get/")) | |
| ;; (add-to-list 'load-path (concat el-get-dir "el-get")) | |
| ;; | |
| ;; (setq el-get-git-shallow-clone t) | |
| ;; (setq el-get-byte-compile nil) | |
| ;; (setq el-get-bundle-byte-compile nil) | |
| ;; (setq el-get-install-skip-emacswiki-recipes t) | |
| ;; | |
| ;; (unless (require 'el-get nil 'noerror) | |
| ;; (with-current-buffer | |
| ;; (url-retrieve-synchronously | |
| ;; "https://raw.githubusercontent.com/dimitri/el-get/master/el-get-install.el") | |
| ;; (goto-char (point-max)) | |
| ;; (eval-print-last-sexp))) | |
| ;; | |
| ;; (remove-hook 'el-get-post-install-hooks 'el-get-post-install-notification) | |
| ;; ------------------------------------------------------------------ | |
| ;; configuration | |
| (require-packages | |
| 'dart-mode | |
| ) | |
| (defconst dart-log-file (format-time-string "~/dart_%Y-%m-%d_%H.%M.%S.log")) | |
| (define-advice dart-log (:after (msg) append-to-file) | |
| (with-temp-buffer | |
| (let ((message-log-max nil)) | |
| (insert msg) | |
| (insert "\n") | |
| (append-to-file (point-min) (point-max) dart-log-file)))) | |
| (add-hook 'after-init-hook | |
| (lambda () | |
| (setq dart-sdk-path (expand-file-name "~/flutter/bin/cache/dart-sdk/")) | |
| (setq dart-enable-analysis-server t) | |
| (setq dart-debug t) | |
| (unless noninteractive | |
| (view-echo-area-messages)) | |
| ;; simulate user operations | |
| (find-file "~/flutter/examples/platform_channel/lib/main.dart") | |
| (when (search-forward-regexp "^[\s]*void initState() {$" nil t) | |
| (goto-char (point-at-eol)) | |
| (insert "\n")) | |
| )) | |
| (run-hooks 'after-init-hook) | |
| ;;; test-dart-mode-jit-lock-function-issue.el ends here | 
      
      
  Author
  
  
        
      
            twlz0ne
  
      
      
      commented 
        Dec 8, 2018 
      
    
  
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment