diff options
| author | Simeon Simeonov | 2018-03-12 11:06:20 +0100 |
|---|---|---|
| committer | Simeon Simeonov | 2018-03-12 11:06:20 +0100 |
| commit | eeee6220a7d0fcd8cfa9be2381ed95dca96350b6 (patch) | |
| tree | 37bcb2c9fcd9611f874d96c47b0d7d9b38922415 /.emacs.d/lisp | |
| parent | f12ad4ea469aa95a4f8a5c42a1899b375fa405b6 (diff) | |
Update php-project.el and yasnippet.el
Diffstat (limited to '.emacs.d/lisp')
| -rw-r--r-- | .emacs.d/lisp/php-mode.el | 4 | ||||
| -rw-r--r-- | .emacs.d/lisp/yasnippet.el | 31 |
2 files changed, 19 insertions, 16 deletions
diff --git a/.emacs.d/lisp/php-mode.el b/.emacs.d/lisp/php-mode.el index 2e23642..70e7efc 100644 --- a/.emacs.d/lisp/php-mode.el +++ b/.emacs.d/lisp/php-mode.el | |||
| @@ -934,13 +934,13 @@ this ^ lineup" | |||
| 934 | 934 | ||
| 935 | (eval-and-compile | 935 | (eval-and-compile |
| 936 | (defconst php-heredoc-start-re | 936 | (defconst php-heredoc-start-re |
| 937 | "<<<\\(?:\\w+\\|'\\w+'\\)$" | 937 | "<<<\\(?:\\_<.+?\\_>\\|'\\_<.+?\\_>'\\|\"\\_<.+?\\_>\"\\)$" |
| 938 | "Regular expression for the start of a PHP heredoc.")) | 938 | "Regular expression for the start of a PHP heredoc.")) |
| 939 | 939 | ||
| 940 | (defun php-heredoc-end-re (heredoc-start) | 940 | (defun php-heredoc-end-re (heredoc-start) |
| 941 | "Build a regular expression for the end of a heredoc started by the string HEREDOC-START." | 941 | "Build a regular expression for the end of a heredoc started by the string HEREDOC-START." |
| 942 | ;; Extract just the identifier without <<< and quotes. | 942 | ;; Extract just the identifier without <<< and quotes. |
| 943 | (string-match "\\w+" heredoc-start) | 943 | (string-match "\\_<.+?\\_>" heredoc-start) |
| 944 | (concat "^\\(" (match-string 0 heredoc-start) "\\)\\W")) | 944 | (concat "^\\(" (match-string 0 heredoc-start) "\\)\\W")) |
| 945 | 945 | ||
| 946 | (defun php-syntax-propertize-function (start end) | 946 | (defun php-syntax-propertize-function (start end) |
diff --git a/.emacs.d/lisp/yasnippet.el b/.emacs.d/lisp/yasnippet.el index 5f17465..b36c422 100644 --- a/.emacs.d/lisp/yasnippet.el +++ b/.emacs.d/lisp/yasnippet.el | |||
| @@ -4302,23 +4302,26 @@ The SNIPPET's markers are preserved." | |||
| 4302 | (setq yas--indent-markers nil)) | 4302 | (setq yas--indent-markers nil)) |
| 4303 | ;; Now do stuff for `fixed' and `auto'. | 4303 | ;; Now do stuff for `fixed' and `auto'. |
| 4304 | (save-excursion | 4304 | (save-excursion |
| 4305 | ;; We need to be at end of line, so that `forward-line' will only | ||
| 4306 | ;; report 0 if it actually moves over a newline. | ||
| 4307 | (end-of-line) | ||
| 4305 | (cond ((eq yas-indent-line 'fixed) | 4308 | (cond ((eq yas-indent-line 'fixed) |
| 4306 | (forward-line 1) | 4309 | (when (= (forward-line 1) 0) |
| 4307 | (let ((indent-line-function | 4310 | (let ((indent-line-function |
| 4308 | (lambda () | 4311 | (lambda () |
| 4309 | ;; We need to be at beginning of line in order to | 4312 | ;; We need to be at beginning of line in order to |
| 4310 | ;; indent existing whitespace correctly. | 4313 | ;; indent existing whitespace correctly. |
| 4311 | (beginning-of-line) | 4314 | (beginning-of-line) |
| 4312 | (indent-to-column yas--indent-original-column)))) | 4315 | (indent-to-column yas--indent-original-column)))) |
| 4316 | (yas--indent-region (line-beginning-position) | ||
| 4317 | (point-max) | ||
| 4318 | snippet)))) | ||
| 4319 | ((eq yas-indent-line 'auto) | ||
| 4320 | (when (or yas-also-auto-indent-first-line | ||
| 4321 | (= (forward-line 1) 0)) | ||
| 4313 | (yas--indent-region (line-beginning-position) | 4322 | (yas--indent-region (line-beginning-position) |
| 4314 | (point-max) | 4323 | (point-max) |
| 4315 | snippet))) | 4324 | snippet)))))) |
| 4316 | ((eq yas-indent-line 'auto) | ||
| 4317 | (unless yas-also-auto-indent-first-line | ||
| 4318 | (forward-line 1)) | ||
| 4319 | (yas--indent-region (line-beginning-position) | ||
| 4320 | (point-max) | ||
| 4321 | snippet))))) | ||
| 4322 | 4325 | ||
| 4323 | (defun yas--collect-snippet-markers (snippet) | 4326 | (defun yas--collect-snippet-markers (snippet) |
| 4324 | "Make a list of all the markers used by SNIPPET." | 4327 | "Make a list of all the markers used by SNIPPET." |
