|
16 | 16 | ;;; Code:
|
17 | 17 |
|
18 | 18 | (eval-when-compile (require 'rx))
|
19 |
| -(eval-when-compile (require 'url-vars)) |
20 | 19 |
|
21 | 20 | (require 'json)
|
22 | 21 | (require 'thingatpt)
|
@@ -54,16 +53,6 @@ When nil, `where' will be aligned with `fn' or `trait'."
|
54 | 53 | :group 'rust-mode
|
55 | 54 | :safe #'booleanp)
|
56 | 55 |
|
57 |
| -(defcustom rust-playpen-url-format "https://play.rust-lang.org/?code=%s" |
58 |
| - "Format string to use when submitting code to the playpen." |
59 |
| - :type 'string |
60 |
| - :group 'rust-mode) |
61 |
| - |
62 |
| -(defcustom rust-shortener-url-format "https://is.gd/create.php?format=simple&url=%s" |
63 |
| - "Format string to use for creating the shortened link of a playpen submission." |
64 |
| - :type 'string |
65 |
| - :group 'rust-mode) |
66 |
| - |
67 | 56 | (defcustom rust-match-angle-brackets t
|
68 | 57 | "Whether to enable angle bracket (`<' and `>') matching where appropriate."
|
69 | 58 | :type 'boolean
|
@@ -1621,37 +1610,6 @@ This is written mainly to be used as `end-of-defun-function' for Rust."
|
1621 | 1610 |
|
1622 | 1611 | ;;; Secondary Commands
|
1623 | 1612 |
|
1624 |
| -(defun rust-playpen-region (begin end) |
1625 |
| - "Create a shareable URL for the region from BEGIN to END on the Rust playpen." |
1626 |
| - (interactive "r") |
1627 |
| - (let* ((data (buffer-substring begin end)) |
1628 |
| - (escaped-data (url-hexify-string data)) |
1629 |
| - (escaped-playpen-url (url-hexify-string |
1630 |
| - (format rust-playpen-url-format escaped-data)))) |
1631 |
| - (if (> (length escaped-playpen-url) 5000) |
1632 |
| - (error "encoded playpen data exceeds 5000 character limit (length %s)" |
1633 |
| - (length escaped-playpen-url)) |
1634 |
| - (let ((shortener-url (format rust-shortener-url-format escaped-playpen-url)) |
1635 |
| - (url-request-method "POST")) |
1636 |
| - (url-retrieve shortener-url |
1637 |
| - (lambda (state) |
1638 |
| - ;; filter out the headers etc. included at the |
1639 |
| - ;; start of the buffer: the relevant text |
1640 |
| - ;; (shortened url or error message) is exactly |
1641 |
| - ;; the last line. |
1642 |
| - (goto-char (point-max)) |
1643 |
| - (let ((last-line (thing-at-point 'line t)) |
1644 |
| - (err (plist-get state :error))) |
1645 |
| - (kill-buffer) |
1646 |
| - (if err |
1647 |
| - (error "failed to shorten playpen url: %s" last-line) |
1648 |
| - (message "%s" last-line))))))))) |
1649 |
| - |
1650 |
| -(defun rust-playpen-buffer () |
1651 |
| - "Create a shareable URL for the contents of the buffer on the Rust playpen." |
1652 |
| - (interactive) |
1653 |
| - (rust-playpen-region (point-min) (point-max))) |
1654 |
| - |
1655 | 1613 | (defun rust-promote-module-into-dir ()
|
1656 | 1614 | "Promote the module file visited by the current buffer into its own directory.
|
1657 | 1615 |
|
|
0 commit comments