diff --git a/smartparens.el b/smartparens.el index ab9c9349..16674404 100644 --- a/smartparens.el +++ b/smartparens.el @@ -110,27 +110,31 @@ the previous/next entry. Examples are fontified using the `font-lock-string-face' for better orientation." (interactive "P") - (setq arg (not arg)) - (let ((do-not-display '( - smartparens-mode - smartparens-global-mode - turn-on-smartparens-mode - turn-off-smartparens-mode - sp-wrap-cancel - sp-remove-active-pair-overlay - sp-splice-sexp-killing-around ;; is aliased to `sp-raise-sexp' - show-smartparens-mode - show-smartparens-global-mode - turn-on-show-smartparens-mode - turn-off-show-smartparens-mode - )) - (do-not-display-with-arg '( - sp-use-paredit-bindings - sp-use-smartparens-bindings - )) - (commands (cl-loop for i in (cdr (assoc-string (file-truename (locate-library "smartparens")) load-history)) + (let ((commands (cl-loop for i in (cdr (assoc-string (file-truename (locate-library "smartparens")) load-history)) if (and (consp i) (eq (car i) 'defun) (commandp (cdr i))) collect (cdr i)))) + (setq commands + (-difference commands + '( + smartparens-mode + smartparens-global-mode + turn-on-smartparens-mode + turn-off-smartparens-mode + sp-wrap-cancel + sp-remove-active-pair-overlay + sp-splice-sexp-killing-around ;; is aliased to `sp-raise-sexp' + show-smartparens-mode + show-smartparens-global-mode + turn-on-show-smartparens-mode + turn-off-show-smartparens-mode + ))) + (unless arg + (setq commands + (-difference commands + '( + sp-use-paredit-bindings + sp-use-smartparens-bindings + )))) (with-current-buffer (get-buffer-create "*Smartparens cheat sheet*") (let ((standard-output (current-buffer)) (help-xref-following t)) @@ -138,19 +142,17 @@ better orientation." (erase-buffer) (help-mode) (smartparens-mode 1) - (help-setup-xref (list #'sp-cheat-sheet) + (help-setup-xref (list #'sp-cheat-sheet arg) (called-interactively-p 'interactive)) (read-only-mode -1) - (--each (--remove (or (memq it do-not-display) - (and arg (memq it do-not-display-with-arg))) - commands) + (--each commands (unless (equal (symbol-name it) "advice-compilation") (let ((start (point)) kill-from) (insert (propertize (symbol-name it) 'face 'font-lock-function-name-face)) (insert " is ") (describe-function-1 it) (save-excursion - (when arg + (unless arg (goto-char start) (forward-paragraph 1) (forward-line 1)