diff options
author | Artur Malabarba <bruce.connor.am@gmail.com> | 2015-02-26 16:02:23 -0300 |
---|---|---|
committer | Artur Malabarba <bruce.connor.am@gmail.com> | 2015-02-26 16:02:23 -0300 |
commit | 7ef768bce7a943a55774f225022d8883c95a523f (patch) | |
tree | dd24e8e91625a798eb683141b799b4c14964aae6 /sx-button.el | |
parent | b6fc510cf55b2847301c92acc2cd3c128e8a9dff (diff) | |
parent | 2f398913b77d190f2e0c96ba15296c231ba21e18 (diff) |
Merge pull request #258 from vermiculus/small-improvements
Small improvements
Diffstat (limited to 'sx-button.el')
-rw-r--r-- | sx-button.el | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/sx-button.el b/sx-button.el index 9f6d3b3..d32314d 100644 --- a/sx-button.el +++ b/sx-button.el @@ -77,23 +77,23 @@ This is usually a link's URL, or the content of a code block." (point) 'sx-button-copy-type) content))))) -(defun sx-button-edit-this (text-or-marker &optional major-mode) - "Open a temp buffer populated with the string TEXT-OR-MARKER using MAJOR-MODE. +(defun sx-button-edit-this (text-or-marker &optional majormode) + "Open a temp buffer populated with the string TEXT-OR-MARKER using MAJORMODE. When given a marker (or interactively), use the 'sx-button-copy and the 'sx-mode text-properties under the marker. These are usually part of a code-block." (interactive (list (point-marker))) ;; Buttons receive markers. (when (markerp text-or-marker) - (setq major-mode (get-text-property text-or-marker 'sx-mode)) + (setq majormode (get-text-property text-or-marker 'sx-mode)) (unless (setq text-or-marker (get-text-property text-or-marker 'sx-button-copy)) (sx-message "Nothing of interest here."))) (with-current-buffer (pop-to-buffer (generate-new-buffer "*sx temp buffer*")) (insert text-or-marker) - (when major-mode - (funcall major-mode)))) + (when majormode + (funcall majormode)))) (defun sx-button-follow-link (&optional pos) "Follow link at POS. If POS is nil, use `point'." |