Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix call to help-setup-xref and cosmetic changes #956

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 26 additions & 24 deletions smartparens.el
Original file line number Diff line number Diff line change
Expand Up @@ -110,47 +110,49 @@ 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))
(read-only-mode -1)
(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)
Expand Down