From 1e15841e9c69db915fe4c99bbfce8000782c4adc Mon Sep 17 00:00:00 2001 From: Mikael Kermorgant Date: Tue, 2 Jul 2019 17:56:04 +0300 Subject: [PATCH 1/5] change mini-window height during phpactor-status fixes #123 --- phpactor.el | 1 + 1 file changed, 1 insertion(+) diff --git a/phpactor.el b/phpactor.el index 449a52c..a47e850 100644 --- a/phpactor.el +++ b/phpactor.el @@ -659,6 +659,7 @@ function." (defun phpactor-status () "Execute Phpactor RPC status command, and pop to buffer." (interactive) + (setq max-mini-window-height 17) (apply #'phpactor-action-dispatch (phpactor--rpc "status" []))) ;;;###autoload From 2761df25bc1a023dc14e10d50dd58d76c8c69eec Mon Sep 17 00:00:00 2001 From: Mikael Kermorgant Date: Tue, 2 Jul 2019 18:03:10 +0300 Subject: [PATCH 2/5] 18 lines for phpactor-status is better --- phpactor.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpactor.el b/phpactor.el index a47e850..c7f91d6 100644 --- a/phpactor.el +++ b/phpactor.el @@ -659,7 +659,7 @@ function." (defun phpactor-status () "Execute Phpactor RPC status command, and pop to buffer." (interactive) - (setq max-mini-window-height 17) + (setq max-mini-window-height 18) (apply #'phpactor-action-dispatch (phpactor--rpc "status" []))) ;;;###autoload From 2b6dfd4d23355becaa3232baf9597853ba0000ba Mon Sep 17 00:00:00 2001 From: Mikael Kermorgant Date: Fri, 5 Jul 2019 07:41:00 +0300 Subject: [PATCH 3/5] extract "magic value" to constant --- phpactor.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/phpactor.el b/phpactor.el index c7f91d6..8751e39 100644 --- a/phpactor.el +++ b/phpactor.el @@ -93,6 +93,7 @@ "Hook called after the file is updated by phpactor.") ;;; Constants +(defconst phpactor--status-output-height 18) (defconst phpactor-command-name "phpactor") (defconst phpactor--supported-rpc-version "1.0.0") (defconst phpactor--lisp-directory @@ -659,7 +660,7 @@ function." (defun phpactor-status () "Execute Phpactor RPC status command, and pop to buffer." (interactive) - (setq max-mini-window-height 18) + (setq max-mini-window-height phpactor--status-output-height) (apply #'phpactor-action-dispatch (phpactor--rpc "status" []))) ;;;###autoload From 5946ef17cdca83b7261a59978291505c5bf9226e Mon Sep 17 00:00:00 2001 From: Mikael Kermorgant Date: Fri, 5 Jul 2019 07:55:58 +0300 Subject: [PATCH 4/5] fixup! extract "magic value" to constant --- phpactor.el | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/phpactor.el b/phpactor.el index 8751e39..1ec93b2 100644 --- a/phpactor.el +++ b/phpactor.el @@ -65,13 +65,19 @@ (defcustom phpactor-install-directory (eval-when-compile (expand-file-name (locate-user-emacs-file "phpactor/"))) - "Directory for setup Phactor. (default `~/.emacs.d/phpactor/')." + "Directory for setup Phpactor. (default `~/.emacs.d/phpactor/')." :type 'directory) (defcustom phpactor-use-native-json t "If non-nil, use native json parsing if available." :group 'phpactor :type 'boolean) + +(defcustom phpactor-status-output-height 18 + "Custom value for 'max-mini-window-height', allowing phpactor-status to show its output completely." + :link '(variable-link max-mini-window-height) + :group 'phpactor + :type '(integer float)) ;; Variables ;;;###autoload @@ -93,7 +99,6 @@ "Hook called after the file is updated by phpactor.") ;;; Constants -(defconst phpactor--status-output-height 18) (defconst phpactor-command-name "phpactor") (defconst phpactor--supported-rpc-version "1.0.0") (defconst phpactor--lisp-directory @@ -660,7 +665,7 @@ function." (defun phpactor-status () "Execute Phpactor RPC status command, and pop to buffer." (interactive) - (setq max-mini-window-height phpactor--status-output-height) + (setq max-mini-window-height phpactor-status-output-height) (apply #'phpactor-action-dispatch (phpactor--rpc "status" []))) ;;;###autoload From 1cd8776f15d3a2a8c9039bdf9537ad16cf0fe76c Mon Sep 17 00:00:00 2001 From: Mikael Kermorgant Date: Fri, 5 Jul 2019 08:08:50 +0300 Subject: [PATCH 5/5] fixup! fixup! extract "magic value" to constant --- README.org | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/README.org b/README.org index 067cc7b..f2ed8a1 100644 --- a/README.org +++ b/README.org @@ -104,6 +104,18 @@ You could for example limit yourself to only one by using [[https://github.com/m ("u" "Install" phpactor-install-or-update)]]) #+END_SRC +*** mini-buffer / echo area height + invoking `phpactor-status` will change the value of `max-mini-window-height` + + Rationale: `phpactor-status` gives a quite long output, and some + part of it would be hidden in certain circumstances with emacs + default settings. + + As `max-mini-window-height` is modified at a global level, this + might conflict with your settings. In that case, you could + customize `phpactor-status-output-height` to be equal to + `max-mini-window-height` (PR with a better solution also welcome) + ** Troubleshooting You can run ``phpactor-status`` while visiting a project file.