Changeset 6188d2e in dotfiles


Ignore:
Timestamp:
Nov 14, 2022, 2:31:09 PM (2 years ago)
Author:
w96k <w96k@…>
Branches:
master
Children:
a649060
Parents:
2f85958
Message:

Add php flycheck; Add javascript to org babel;

File:
1 edited

Legend:

Unmodified
Added
Removed
  • emacs/.emacs.d/.emacs-config.org

    r2f85958 r6188d2e  
    578578  ;;(add-hook 'prog-mode-hook 'flymake-mode)
    579579
     580  (require 'psalm)
     581
    580582  (define-prefix-command 'flymake-map)
    581583  (global-set-key (kbd "C-q") 'flymake-map)
     
    588590*** Flycheck
    589591#+BEGIN_SRC emacs-lisp :tangle init.el
     592  (require 'psalm)
     593
    590594  (when (package-loaded? "flycheck")
    591       (add-hook 'prog-mode-hook 'flycheck-mode))
     595
     596    (defun flycheck-phanclient-start-daemon ()
     597      "Start the phan daemon"
     598      (interactive)
     599      (let* ((default-directory (php-project-get-root-dir))
     600             (phan-executable (or flycheck-phanclient--phan-executable
     601                                  (if (file-exists-p "vendor/bin/phan")
     602                                      (concat default-directory "vendor/bin/phan")
     603                                    (executable-find "phan"))))
     604             (cmd (list phan-executable "--daemonize-tcp-port" "4846" "--quick")))
     605        (apply #'start-process "PhanDaemon" "*phan daemon*" cmd)))
     606
     607    (flycheck-define-checker php-phanclient
     608      :command ("phan_client" "-l" source-original "-f" source)
     609      :error-patterns
     610      ((warning line-start (or "Parse" "Fatal" "syntax" "Phan") " error" (any ":" ",") " " (message) " in " (file-name) " on line " line line-end))
     611      :modes (php-mode php+-mode))
     612    (flycheck-add-next-checker 'php '(warning . php-phanclient))
     613
     614    (add-to-list 'flycheck-checkers 'php-phanclient)
     615
     616
     617    (add-hook 'prog-mode-hook 'flycheck-mode))
    592618#+END_SRC
    593619
     
    13371363     (shell . t)
    13381364     (sql . t)
     1365     (js . t)
    13391366     (sqlite . t)))
    13401367
Note: See TracChangeset for help on using the changeset viewer.