branch: externals/phps-mode commit 4b4a375072c32aff0c5149e7c83a841be42116bf Author: Christian Johansson <christ...@cvj.se> Commit: Christian Johansson <christ...@cvj.se>
Using lexical bindings for all files --- phps-automation.el | 4 ++-- phps-flycheck.el | 2 +- phps-flymake.el | 2 +- phps-font-lock.el | 2 +- phps-functions.el | 24 ++++++++++-------------- phps-lexer.el | 2 +- phps-map.el | 2 +- phps-mode.el | 2 +- phps-semantic.el | 2 +- phps-syntax-table.el | 2 +- phps-tags.el | 2 +- phps-test-functions.el | 2 +- phps-test-lexer.el | 2 +- phps-test-parser.el | 2 +- phps-test.el | 2 +- 15 files changed, 25 insertions(+), 29 deletions(-) diff --git a/phps-automation.el b/phps-automation.el index 46687fc..cfbeb21 100644 --- a/phps-automation.el +++ b/phps-automation.el @@ -1,4 +1,4 @@ -;;; phps-automation --- Generate a Wisent Parser file +;;; phps-automation --- Generate a Wisent Parser file -*- lexical-binding: t -*- ;;; Commentary: @@ -13,7 +13,7 @@ (add-to-list 'load-path (expand-file-name "~/.emacs.d/emacs-wisent-grammar-converter/")) -(require 'emacs-wisent-grammar-converter) +(autoload 'emacs-wisent-grammar-converter/generate-grammar-from-filename "emacs-wisent-grammar-converter") (let ((php-yacc-url "https://raw.githubusercontent.com/php/php-src/master/Zend/zend_language_parser.y") (php-yacc-file (expand-file-name "zend_language_parser.y")) diff --git a/phps-flycheck.el b/phps-flycheck.el index f736662..b86c200 100644 --- a/phps-flycheck.el +++ b/phps-flycheck.el @@ -1,4 +1,4 @@ -;;; phps-mode/phps-flycheck.el --- Flycheck support for PHP with Semantic integration +;;; phps-mode/phps-flycheck.el --- Flycheck support for PHP with Semantic integration -*- lexical-binding: t -*- ;; Author: Christian Johansson <github.com/cjohansson> ;; Maintainer: Christian Johansson <github.com/cjohansson> diff --git a/phps-flymake.el b/phps-flymake.el index 05dddca..8e7992b 100644 --- a/phps-flymake.el +++ b/phps-flymake.el @@ -1,4 +1,4 @@ -;;; phps-mode/phps-flymake.el --- Major mode for PHP with Semantic integration +;;; phps-mode/phps-flymake.el --- Major mode for PHP with Semantic integration -*- lexical-binding: t -*- ;; Author: Christian Johansson <github.com/cjohansson> ;; Maintainer: Christian Johansson <github.com/cjohansson> diff --git a/phps-font-lock.el b/phps-font-lock.el index 7b23db9..d34941f 100644 --- a/phps-font-lock.el +++ b/phps-font-lock.el @@ -1,4 +1,4 @@ -;;; phps-mode/phps-font-lock.el --- Font Lock for PHP Semantic +;;; phps-mode/phps-font-lock.el --- Font Lock for PHP Semantic -*- lexical-binding: t -*- ;; Author: Christian Johansson <github.com/cjohansson> ;; Maintainer: Christian Johansson <github.com/cjohansson> diff --git a/phps-functions.el b/phps-functions.el index 9c67d3a..052405e 100644 --- a/phps-functions.el +++ b/phps-functions.el @@ -1,4 +1,4 @@ -;;; phps-mode/phps-functions.el --- Mode functions for PHPs +;;; phps-mode/phps-functions.el --- Mode functions for PHPs -*- lexical-binding: t -*- ;; Author: Christian Johansson <github.com/cjohansson> ;; Maintainer: Christian Johansson <github.com/cjohansson> @@ -46,20 +46,16 @@ (in-scripting (nth 0 start))) ;; Are we in scripting? - (if in-scripting - (let* ((indent-start (* (+ (nth 1 start) (nth 2 start)) tab-width)) - (indent-end (* (+ (nth 1 end) (nth 2 end)) tab-width)) - (indent-diff 0)) - (when (and (> indent-start indent-end) - (looking-at-p "^[][ \t)(}{};]+\\($\\|?>\\)")) - (setq indent-diff (- indent-start indent-end))) - (setq indent-level (- indent-start indent-diff)) + (when in-scripting + (let ((indent-start (* (+ (nth 1 start) (nth 2 start)) tab-width)) + (indent-end (* (+ (nth 1 end) (nth 2 end)) tab-width)) + (indent-diff 0)) + (when (and (> indent-start indent-end) + (looking-at-p "^[][ \t)(}{};]+\\($\\|?>\\)")) + (setq indent-diff (- indent-start indent-end))) + (let ((indent-level (- indent-start indent-diff))) (message "inside scripting, start: %s, end: %s, indenting to column %s " start end indent-level) - (indent-line-to indent-level)) - (progn - ;; (message "Outside scripting %s" start) - ;; (indent-relative) - )))))) + (indent-line-to indent-level)))))))) (defun phps-mode/indent-region () "Indent region." diff --git a/phps-lexer.el b/phps-lexer.el index 2a2c9d1..c281b93 100644 --- a/phps-lexer.el +++ b/phps-lexer.el @@ -1,4 +1,4 @@ -;;; phps-mode/phps-lexer.wy -- Lexer for PHP +;;; phps-mode/phps-lexer.wy -- Lexer for PHP -*- lexical-binding: t -*- ;; Copyright (C) 2018 Free Software Foundation, Inc. ;; diff --git a/phps-map.el b/phps-map.el index e398e31..48fd26a 100644 --- a/phps-map.el +++ b/phps-map.el @@ -1,4 +1,4 @@ -;; phps-mode/phps-map.el --- Map for major mode +;; phps-mode/phps-map.el --- Map for major mode -*- lexical-binding: t -*- ;; Author: Christian Johansson <github.com/cjohansson> ;; Maintainer: Christian Johansson <github.com/cjohansson> diff --git a/phps-mode.el b/phps-mode.el index 0d5c19d..d950c00 100644 --- a/phps-mode.el +++ b/phps-mode.el @@ -1,4 +1,4 @@ -;;; phps-mode.el --- Major mode for PHP with Semantic integration +;;; phps-mode.el --- Major mode for PHP with Semantic integration -*- lexical-binding: t -*- ;; Author: Christian Johansson <github.com/cjohansson> ;; Maintainer: Christian Johansson <github.com/cjohansson> diff --git a/phps-semantic.el b/phps-semantic.el index 0840283..a7e4d1a 100644 --- a/phps-semantic.el +++ b/phps-semantic.el @@ -1,4 +1,4 @@ -;;; phps-mode/phps-semantic.el --- Semantic functions for PHP +;;; phps-mode/phps-semantic.el --- Semantic functions for PHP -*- lexical-binding: t -*- ;; Copyright (C) 2017 Christian Johansson diff --git a/phps-syntax-table.el b/phps-syntax-table.el index b482143..6ca5812 100644 --- a/phps-syntax-table.el +++ b/phps-syntax-table.el @@ -1,4 +1,4 @@ -;;; phps-mode/phps-syntax-table.el --- Major mode for PHP with Semantic integration +;;; phps-mode/phps-syntax-table.el --- Major mode for PHP with Semantic integration -*- lexical-binding: t -*- ;; Author: Christian Johansson <github.com/cjohansson> ;; Maintainer: Christian Johansson <github.com/cjohansson> diff --git a/phps-tags.el b/phps-tags.el index 892d76d..3cb54a8 100644 --- a/phps-tags.el +++ b/phps-tags.el @@ -1,4 +1,4 @@ -;;; phps-mode/phps-tags.el --- PHP LALR parser for Emacs +;;; phps-mode/phps-tags.el --- PHP LALR parser for Emacs -*- lexical-binding: t -*- ;; Copyright (C) 2001-2006, 2009-2018 Free Software Foundation, Inc. diff --git a/phps-test-functions.el b/phps-test-functions.el index 003ea4d..d207c62 100644 --- a/phps-test-functions.el +++ b/phps-test-functions.el @@ -1,4 +1,4 @@ -;;; phps-test-functions.el --- Tests for functions +;;; phps-test-functions.el --- Tests for functions -*- lexical-binding: t -*- ;; Author: Christian Johansson <github.com/cjohansson> ;; Maintainer: Christian Johansson <github.com/cjohansson> diff --git a/phps-test-lexer.el b/phps-test-lexer.el index aabd220..db5fb53 100644 --- a/phps-test-lexer.el +++ b/phps-test-lexer.el @@ -1,4 +1,4 @@ -;;; phps-test-lexer.el --- Tests for Semantic Lexer +;;; phps-test-lexer.el --- Tests for Semantic Lexer -*- lexical-binding: t -*- ;; Author: Christian Johansson <github.com/cjohansson> ;; Maintainer: Christian Johansson <github.com/cjohansson> diff --git a/phps-test-parser.el b/phps-test-parser.el index ad873ba..1aab194 100644 --- a/phps-test-parser.el +++ b/phps-test-parser.el @@ -1,4 +1,4 @@ -;;; phps-test-parser.el --- Tests for Semantic parser +;;; phps-test-parser.el --- Tests for Semantic parser -*- lexical-binding: t -*- ;; Author: Christian Johansson <github.com/cjohansson> ;; Maintainer: Christian Johansson <github.com/cjohansson> diff --git a/phps-test.el b/phps-test.el index 60b73b2..595fcf9 100644 --- a/phps-test.el +++ b/phps-test.el @@ -1,4 +1,4 @@ -;;; phps-test.el --- Commons for tests +;;; phps-test.el --- Commons for tests -*- lexical-binding: t -*- ;; Author: Christian Johansson <github.com/cjohansson> ;; Maintainer: Christian Johansson <github.com/cjohansson>