diff options
author | Tom Willemse | 2013-11-06 23:22:05 +0100 |
---|---|---|
committer | Tom Willemse | 2013-11-06 23:22:05 +0100 |
commit | 42d776690bea26d44b7fb891c2aa8ab2c3ed6adc (patch) | |
tree | 8fc404b8536fea100e45bc8d9444be655191fd02 | |
parent | 1b6093944977d2a3ad1a4524c3d6c05b99aefc74 (diff) | |
download | hypo-emacs-42d776690bea26d44b7fb891c2aa8ab2c3ed6adc.tar.gz hypo-emacs-42d776690bea26d44b7fb891c2aa8ab2c3ed6adc.zip |
Add customization option
-rw-r--r-- | NEWS | 3 | ||||
-rw-r--r-- | hypo.el | 16 |
2 files changed, 15 insertions, 4 deletions
@@ -1,5 +1,6 @@ # -*- mode: org; -*- * v0.2.0 - - Add =hypo-delete-last=, which deletes the last posted item of the current session. + - Add customization group and allow specification of the URL where + hypo runs. @@ -4,7 +4,7 @@ ;; Author: Tom Willemse <tom@ryuslash.org> ;; Keywords: tools -;; Version: 0.1.0 +;; Version: 0.1.0.3 ;; This program is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by @@ -31,6 +31,16 @@ (autoload 'beginning-of-sexp "thingatpt") (autoload 'end-of-sexp "thingatpt") +(defgroup hypo nil + "Customization options for `hypo'." + :group 'convenience) + +(defcustom hypo-instance-url "https://ryuslash.org/hypo" + "URL of the hypo instance to communicate with." + :group 'hypo + :risky t + :type 'string) + (defvar hypo--last-post nil "The hash of the last snippet sent to hypo. @@ -64,7 +74,7 @@ STATUS is ignored." (read-string "Filename: " (buffer-name)))))) (let ((url-request-data (buffer-substring-no-properties start end)) (url-request-method "PUT")) - (url-retrieve (concat "https://ryuslash.org/hypo/" filename) + (url-retrieve (format "%s/%s" hypo-instance-url filename) #'hypo--collect-and-kill))) ;;;###autoload @@ -108,7 +118,7 @@ STATUS is ignored." (interactive) (unless hypo--last-post (error "Nothing posted this session")) (let ((url-request-method "DELETE")) - (url-retrieve (concat "https://ryuslash.org/hypo/" hypo--last-post) + (url-retrieve (format "%s/%s" hypo-instance-url hypo--last-post) #'ignore) (setq hypo--last-post nil))) |