branch: externals/phps-mode commit 9507e85c28b6b08ce0e6921eef2e3eabe6e8361a Author: Christian Johansson <christ...@cvj.se> Commit: Christian Johansson <christ...@cvj.se>
Optimized error-handling emacs-26 and emacs-27 --- phps-mode-lex-analyzer.el | 9 +++------ phps-mode-serial.el | 18 ++++++------------ phps-mode.el | 4 ++-- 3 files changed, 11 insertions(+), 20 deletions(-) diff --git a/phps-mode-lex-analyzer.el b/phps-mode-lex-analyzer.el index 30ca9cf..89f79c1 100644 --- a/phps-mode-lex-analyzer.el +++ b/phps-mode-lex-analyzer.el @@ -2418,12 +2418,9 @@ SQUARE-BRACKET-LEVEL and ROUND-BRACKET-LEVEL." (setq phps-mode-lex-analyzer--tokens (semantic-lex-buffer)))) - (error (progn - (kill-buffer) - (signal 'error (cdr conditions)))) - (t (progn - (kill-buffer) - (signal 'error (cdr conditions))))) + ((error t) (progn + (kill-buffer) + (signal 'error (cdr conditions))))) ;; Copy variables outside of buffer (setq state phps-mode-lexer--state) diff --git a/phps-mode-serial.el b/phps-mode-serial.el index 9f0dff8..1dc7d19 100644 --- a/phps-mode-serial.el +++ b/phps-mode-serial.el @@ -92,8 +92,7 @@ (progn (let ((start-return (funcall start))) (list 'success start-return start-time))) - (error (list 'error (cdr conditions) start-time)) - (t (list 'error (cdr conditions) start-time)))) + ((error t) (list 'error (cdr conditions) start-time)))) (lambda (start-return) (let ((status (car start-return)) (value (car (cdr start-return))) @@ -118,8 +117,7 @@ (progn (let ((return (funcall end value))) (setq end-return (list 'success return start-time)))) - (error (setq end-return (list 'error (cdr conditions) start-time))) - (t (setq end-return (list 'error (cdr conditions) start-time)))) + ((error t) (setq end-return (list 'error (cdr conditions) start-time)))) ;; Profile execution in debug mode (when phps-mode-serial--profiling @@ -161,8 +159,7 @@ (condition-case conditions (let ((return (funcall start))) (setq start-return (list 'success return start-time))) - (error (setq start-return (list 'error (cdr conditions) start-time))) - (t (setq start-return (list 'error (cdr conditions) start-time)))) + ((error t) (setq start-return (list 'error (cdr conditions) start-time)))) ;; Profile execution in debug mode (when phps-mode-serial--profiling @@ -184,8 +181,7 @@ (condition-case conditions (let ((return (funcall end value))) (setq end-return (list 'success return start-time))) - (error (setq end-return (list 'error (cdr conditions) start-time))) - (t (setq end-return (list 'error (cdr conditions) start-time)))) + ((error t) (setq end-return (list 'error (cdr conditions) start-time)))) ;; Profile execution (when phps-mode-serial--profiling @@ -224,8 +220,7 @@ (progn (let ((return (funcall start))) (setq start-return (list 'success return start-time)))) - (error (setq start-return (list 'error (cdr conditions) start-time))) - (t (setq start-return (list 'error (cdr conditions) start-time)))) + ((error t) (setq start-return (list 'error (cdr conditions) start-time)))) ;; Profile execution in debug mode (when phps-mode-serial--profiling @@ -248,8 +243,7 @@ (condition-case conditions (let ((return (funcall end value))) (setq end-return (list 'success return start-time))) - (error (setq end-return (list 'error (cdr conditions) start-time))) - (t (setq end-return (list 'error (cdr conditions) start-time)))) + ((error t) (setq end-return (list 'error (cdr conditions) start-time)))) ;; Profile execution in debug mode (when phps-mode-serial--profiling diff --git a/phps-mode.el b/phps-mode.el index 1fe68cc..b3db1aa 100644 --- a/phps-mode.el +++ b/phps-mode.el @@ -5,8 +5,8 @@ ;; Author: Christian Johansson <christ...@cvj.se> ;; Maintainer: Christian Johansson <christ...@cvj.se> ;; Created: 3 Mar 2018 -;; Modified: 11 May 2020 -;; Version: 0.3.47 +;; Modified: 12 May 2020 +;; Version: 0.3.48 ;; Keywords: tools, convenience ;; URL: https://github.com/cjohansson/emacs-phps-mode