From 353b076ab94a375f512c714a53fb0da0dc629002 Mon Sep 17 00:00:00 2001 From: Simeon Simeonov Date: Sat, 19 May 2018 22:41:07 +0200 Subject: Upgrade php-mode and yasnippet --- .emacs.d/lisp/php-mode.el | 67 ++++++++++++++++++++++---------------------- .emacs.d/lisp/php-project.el | 19 +++++-------- .emacs.d/lisp/yasnippet.el | 6 ++-- 3 files changed, 43 insertions(+), 49 deletions(-) diff --git a/.emacs.d/lisp/php-mode.el b/.emacs.d/lisp/php-mode.el index 38f1a1b..6b9e2ee 100644 --- a/.emacs.d/lisp/php-mode.el +++ b/.emacs.d/lisp/php-mode.el @@ -8,14 +8,14 @@ ;; Maintainer: USAMI Kenta ;; URL: https://github.com/ejmr/php-mode ;; Keywords: languages php -;; Version: 1.19.0 -;; Package-Requires: ((emacs "24") (cl-lib "0.5")) +;; Version: 1.19.1 +;; Package-Requires: ((emacs "24.3") (cl-lib "0.5")) ;; License: GPL-3.0-or-later -(defconst php-mode-version-number "1.19.0" +(defconst php-mode-version-number "1.19.1" "PHP Mode version number.") -(defconst php-mode-modified "2018-04-08" +(defconst php-mode-modified "2018-05-12" "PHP Mode build date.") ;; This file is free software; you can redistribute it and/or @@ -182,7 +182,7 @@ Turning this on will open it whenever `php-mode' is loaded." "Apply the list of extra constant keywords `VALUE'. This function is called when the custom variable php-extra-constants -is updated. The web-mode-extra-constants list is appended to the list +is updated. The web-mode-extra-constants list is appended to the list of constants when set." ;; remove old keywords (when (boundp 'php-extra-constants) @@ -350,7 +350,7 @@ Turning this on will force PEAR rules on all PHP files." (defcustom php-mode-warn-if-mumamo-off t "Warn once per buffer if you try to indent a buffer without -mumamo-mode turned on. Detects if there are any HTML tags in the +mumamo-mode turned on. Detects if there are any HTML tags in the buffer before warning, but this is is not very smart; e.g. if you have any tags inside a PHP string, it will be fooled." :type '(choice (const :tag "Warn" t) (const "Don't warn" nil))) @@ -1107,8 +1107,7 @@ this ^ lineup" (define-obsolete-face-alias 'php-annotations-annotation-face 'php-doc-annotation-tag "1.19.0") -(defvar php-mode--delayed-set-style nil) -(make-variable-buffer-local 'php-mode--delayed-set-style) +(defvar-local php-mode--delayed-set-style nil) (defun php-set-style (stylename &optional dont-override) "Set the current `php-mode' buffer to use the style STYLENAME. @@ -1188,6 +1187,7 @@ After setting the stylevars run hooks according to STYLENAME "Display informations useful for debugging PHP Mode." (interactive) (require 'cus-edit) + (require 'pkg-info nil t) (php-mode-debug--buffer 'init) (php-mode-debug--message "Feel free to report on GitHub what you noticed!") (php-mode-debug--message "https://github.com/ejmr/php-mode/issues/new") @@ -1197,10 +1197,13 @@ After setting the stylevars run hooks according to STYLENAME (php-mode-debug--message "--- PHP-MODE DEBUG BEGIN ---") (php-mode-debug--message "versions: %s; %s" (emacs-version) (php-mode-version)) (php-mode-debug--message "package-version: %s" - (let ((pkg (and (boundp 'package-alist) - (cadr (assq 'php-mode package-alist))))) - (when (and pkg (member (package-desc-status pkg) '("unsigned" "dependency"))) - (package-version-join (package-desc-version pkg))))) + (if (fboundp 'pkg-info) + (pkg-info-version-info 'php-mode) + (let ((pkg (and (boundp 'package-alist) + (cadr (assq 'php-mode package-alist))))) + (when (and pkg (member (package-desc-status pkg) '("unsigned" "dependency"))) + (package-version-join (package-desc-version pkg)))))) + (php-mode-debug--message "major-mode: %s" major-mode) (php-mode-debug--message "minor-modes: %s" (cl-loop for s in minor-mode-list @@ -1236,13 +1239,13 @@ After setting the stylevars run hooks according to STYLENAME (c-init-language-vars php-mode) (c-common-init 'php-mode) - (set (make-local-variable 'font-lock-string-face) 'php-string) - (set (make-local-variable 'font-lock-keyword-face) 'php-keyword) - (set (make-local-variable 'font-lock-builtin-face) 'php-builtin) - (set (make-local-variable 'c-preprocessor-face-name) 'php-php-tag) - (set (make-local-variable 'font-lock-function-name-face) 'php-function-name) - (set (make-local-variable 'font-lock-variable-name-face) 'php-variable-name) - (set (make-local-variable 'font-lock-constant-face) 'php-constant) + (setq-local font-lock-string-face 'php-string) + (setq-local font-lock-keyword-face 'php-keyword) + (setq-local font-lock-builtin-face 'php-builtin) + (setq-local c-preprocessor-face-name 'php-php-tag) + (setq-local font-lock-function-name-face 'php-function-name) + (setq-local font-lock-variable-name-face 'php-variable-name) + (setq-local font-lock-constant-face 'php-constant) (modify-syntax-entry ?_ "_" php-mode-syntax-table) (modify-syntax-entry ?` "\"" php-mode-syntax-table) @@ -1251,7 +1254,7 @@ After setting the stylevars run hooks according to STYLENAME (modify-syntax-entry ?\n "> b" php-mode-syntax-table) (modify-syntax-entry ?$ "'" php-mode-syntax-table) - (set (make-local-variable 'syntax-propertize-function) #'php-syntax-propertize-function) + (setq-local syntax-propertize-function #'php-syntax-propertize-function) (add-to-list (make-local-variable 'syntax-propertize-extend-region-functions) #'php-syntax-propertize-extend-region) @@ -1285,8 +1288,7 @@ After setting the stylevars run hooks according to STYLENAME ;; syntax-begin-function is obsolete in Emacs 25.1 (with-no-warnings - (set (make-local-variable 'syntax-begin-function) - 'c-beginning-of-syntax)) + (setq-local syntax-begin-function 'c-beginning-of-syntax)) ;; We map the php-{beginning,end}-of-defun functions so that they ;; replace the similar commands that we inherit from CC Mode. @@ -1294,17 +1296,14 @@ After setting the stylevars run hooks according to STYLENAME ;; following two local variables, but we keep them for now until we ;; are completely sure their removal will not break any current ;; behavior or backwards compatibility. - (set (make-local-variable 'beginning-of-defun-function) - 'php-beginning-of-defun) - (set (make-local-variable 'end-of-defun-function) - 'php-end-of-defun) - - (set (make-local-variable 'open-paren-in-column-0-is-defun-start) - nil) - (set (make-local-variable 'defun-prompt-regexp) - "^\\s-*function\\s-+&?\\s-*\\(\\(\\sw\\|\\s_\\)+\\)\\s-*") - (set (make-local-variable 'add-log-current-defun-header-regexp) - php-beginning-of-defun-regexp) + (setq-local beginning-of-defun-function 'php-beginning-of-defun) + (setq-local end-of-defun-function 'php-end-of-defun) + + (setq-local open-paren-in-column-0-is-defun-start nil) + (setq-local defun-prompt-regexp + "^\\s-*function\\s-+&?\\s-*\\(\\(\\sw\\|\\s_\\)+\\)\\s-*") + (setq-local add-log-current-defun-header-regexp + php-beginning-of-defun-regexp) (when (>= emacs-major-version 25) (with-silent-modifications @@ -1700,7 +1699,7 @@ a completion list." ;; Highlight return types in functions and methods. ("function.+:\\s-*\\??\\(\\(?:\\sw\\|\\s_\\)+\\)" 1 font-lock-type-face) - (")\\s-*:\\s-*\\??\\(\\(?:\\sw\\|\\s_\\)+\\)\\s-*\{" 1 font-lock-type-face) + (")\\s-*:\\s-*\\??\\(\\(?:\\sw\\|\\s_\\)+\\)\\s-*\\(?:\{\\|;\\)" 1 font-lock-type-face) ;; Highlight class names used as nullable type hints ("\\?\\(\\(:?\\sw\\|\\s_\\)+\\)\\s-+\\$" 1 font-lock-type-face) diff --git a/.emacs.d/lisp/php-project.el b/.emacs.d/lisp/php-project.el index d478d9e..53275b9 100644 --- a/.emacs.d/lisp/php-project.el +++ b/.emacs.d/lisp/php-project.el @@ -5,8 +5,8 @@ ;; Author: USAMI Kenta ;; Keywords: tools, files ;; URL: https://github.com/ejmr/php-mode -;; Version: 1.19.0 -;; Package-Requires: ((emacs "24") (cl-lib "0.5")) +;; Version: 1.19.1 +;; Package-Requires: ((emacs "24.3") (cl-lib "0.5")) ;; License: GPL-3.0-or-later ;; This program is free software; you can redistribute it and/or modify @@ -88,7 +88,7 @@ ;;;###autoload (progn - (defvar php-project-root 'auto + (defvar-local php-project-root 'auto "Method of searching for the top level directory. `auto' (default) @@ -101,42 +101,37 @@ STRING A file/directory name of top level marker. If the string is an actual directory path, it is set as the absolute path of the root directory, not the marker.") - (make-variable-buffer-local 'php-project-root) (put 'php-project-root 'safe-local-variable #'(lambda (v) (or (stringp v) (assq v php-project-available-root-files))))) ;;;###autoload (progn - (defvar php-project-bootstrap-scripts nil + (defvar-local php-project-bootstrap-scripts nil "List of path to bootstrap php script file. The ideal bootstrap file is silent, it only includes dependent files, defines constants, and sets the class loaders.") - (make-variable-buffer-local 'php-project-bootstrap-scripts) (put 'php-project-bootstrap-scripts 'safe-local-variable #'php-project--eval-bootstrap-scripts)) ;;;###autoload (progn - (defvar php-project-php-executable nil + (defvar-local php-project-php-executable nil "Path to php executable file.") - (make-variable-buffer-local 'php-project-php-executable) (put 'php-project-php-executable 'safe-local-variable #'(lambda (v) (and (stringp v) (file-executable-p v))))) ;;;###autoload (progn - (defvar php-project-phan-executable nil + (defvar-local php-project-phan-executable nil "Path to phan executable file.") - (make-variable-buffer-local 'php-project-phan-executable) (put 'php-project-phan-executable 'safe-local-variable #'php-project--eval-bootstrap-scripts)) ;;;###autoload (progn - (defvar php-project-coding-style nil + (defvar-local php-project-coding-style nil "Symbol value of the coding style of the project that PHP major mode refers to. Typically it is `pear', `drupal', `wordpress', `symfony2' and `psr2'.") - (make-variable-buffer-local 'php-project-coding-style) (put 'php-project-coding-style 'safe-local-variable #'symbolp)) diff --git a/.emacs.d/lisp/yasnippet.el b/.emacs.d/lisp/yasnippet.el index 87536a2..d478073 100644 --- a/.emacs.d/lisp/yasnippet.el +++ b/.emacs.d/lisp/yasnippet.el @@ -1,11 +1,11 @@ ;;; yasnippet.el --- Yet another snippet extension for Emacs. -;; Copyright (C) 2008-2017 Free Software Foundation, Inc. +;; Copyright (C) 2008-2018 Free Software Foundation, Inc. ;; Authors: pluskid , ;; João Távora , ;; Noam Postavsky ;; Maintainer: Noam Postavsky -;; Version: 0.12.2 +;; Version: 0.13.0 ;; X-URL: http://github.com/joaotavora/yasnippet ;; Keywords: convenience, emulation ;; URL: http://github.com/joaotavora/yasnippet @@ -546,7 +546,7 @@ override bindings from other packages (e.g., `company-mode')." ;;; Internal variables -(defconst yas--version "0.12.2") +(defconst yas--version "0.13.0") (defvar yas--menu-table (make-hash-table) "A hash table of MAJOR-MODE symbols to menu keymaps.") -- cgit v1.3