branch: scratch/editorconfig-cc commit c02d94298babd6e5a01db4a3b80c1f3c791eff38 Author: 10sr <8slashes+...@gmail.com> Commit: Stefan Monnier <monn...@iro.umontreal.ca>
Add editorocnfig-display-current-properties A function useful for debugging. --- editorconfig.el | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/editorconfig.el b/editorconfig.el index 3ea489d7a2..e1de827889 100644 --- a/editorconfig.el +++ b/editorconfig.el @@ -256,6 +256,25 @@ It calls `editorconfig-get-properties-from-exec' if (editorconfig-get-propergies-from-exec) (editorconfig-core-get-properties-hash))) +(defun editorconfig-display-current-properties () + "Display EditorConfig properties extracted for current buffer." + (interactive) + (if editorconfig-properties-hash + (let ( + (buf (get-buffer-create "*EditorConfig Properties*")) + (file buffer-file-name) + (props editorconfig-properties-hash)) + (with-current-buffer buf + (erase-buffer) + (insert (format "# EditorConfig for %s\n" file)) + (maphash (lambda (k v) + (insert (format "%S = %s\n" k v))) + props)) + (display-buffer buf)) + (message "Properties are not applied to current buffer yet.") + nil)) + +;;;###autoload (defun editorconfig-apply () "Apply EditorConfig properties for current buffer." (interactive)