Last active
August 29, 2015 14:12
-
-
Save xmaillard/36e277e5cce310be2671 to your computer and use it in GitHub Desktop.
twittering-connection-type-table as a defcustom entry
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; First attempt: | |
(defun twittering-connection-build-customize-option () | |
(list 'repeat | |
(list | |
'list :tag "Configure connection method" | |
'(repeat | |
:tag "Name" | |
(choice | |
(cons :tag "Check test method" | |
(const :format "" :check) | |
(set (const :tag "No matter what" t) | |
function)) | |
(cons :tag "Display name" | |
(const :format "" :display-name) | |
string) | |
(cons :tag "HTTPS connection method" | |
(const :format "" :https) | |
(set (const :tag "None" nil) | |
function)) | |
(cons :tag "Send HTTP request function" | |
(const :format "" :send-http-request) | |
function) | |
(cons :tag "Pre process buffer" | |
(const :format "" :pre-process-buffer) | |
function)))))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defcustom twittering-connection-type-table | |
'((native (check . t) | |
(https . twittering-start-http-session-native-tls-p) | |
(send-http-request . twittering-send-http-request-native) | |
(pre-process-buffer . twittering-pre-process-buffer-native)) | |
(curl (check . twittering-start-http-session-curl-p) | |
(https . twittering-start-http-session-curl-https-p) | |
(send-http-request . twittering-send-http-request-curl) | |
(pre-process-buffer . twittering-pre-process-buffer-curl)) | |
(wget (check . twittering-start-http-session-wget-p) | |
(https . t) | |
(send-http-request . twittering-send-http-request-wget) | |
(pre-process-buffer . twittering-pre-process-buffer-wget)) | |
(urllib-http | |
(display-name . "urllib") | |
(check . twittering-start-http-session-urllib-p) | |
(https . nil) | |
(send-http-request . twittering-send-http-request-urllib) | |
(pre-process-buffer . twittering-pre-process-buffer-urllib)) | |
(urllib-https | |
(display-name . "urllib") | |
(check . twittering-start-http-session-urllib-p) | |
(https . twittering-start-http-session-urllib-https-p) | |
(send-http-request . twittering-send-http-request-urllib) | |
(pre-process-buffer . twittering-pre-process-buffer-urllib))) | |
"A list of alist of connection methods." | |
:group 'twittering-mode | |
:type (twittering-connection-build-customize-option)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Here is another attempt:
This will generate an acceptable value. Could it be better written ?