From 75cc53b981dd689595ba66f8723b84d927fe7fa9 Mon Sep 17 00:00:00 2001 From: Andreas Gerler Date: Tue, 14 Jul 2015 21:57:30 +0200 Subject: [PATCH] new version of twittering-mode. --- bba.org | 4 +- .../twittering-mode-pkg.el | 1 - .../twittering-mode-autoloads.el | 13 +- .../twittering-mode-pkg.el | 1 + .../twittering-mode.el | 756 ++++++++++++------ 5 files changed, 537 insertions(+), 238 deletions(-) delete mode 100644 elpa/twittering-mode-20150105.333/twittering-mode-pkg.el rename elpa/{twittering-mode-20150105.333 => twittering-mode-20150131.708}/twittering-mode-autoloads.el (60%) create mode 100644 elpa/twittering-mode-20150131.708/twittering-mode-pkg.el rename elpa/{twittering-mode-20150105.333 => twittering-mode-20150131.708}/twittering-mode.el (96%) diff --git a/bba.org b/bba.org index d020bae4..9174b969 100644 --- a/bba.org +++ b/bba.org @@ -98,7 +98,7 @@ Keep track of your important stuff! *** async #+BEGIN_SRC emacs-lisp - (if (>= emacs-major-version 24) + (if (>= emacs-major-version 25) (progn (add-to-list 'load-path "~/.emacs.d/elpa/async-20150412.2207") (require 'async) @@ -971,7 +971,7 @@ With this you can do /sudo:ssh-host:file-on-ssh-host *** [[http://www.twmode.sourceforge.net/][twitter]] #+BEGIN_SRC emacs-lisp - (add-to-list 'load-path "~/.emacs.d/elpa/twittering-mode-20150105.333") + (add-to-list 'load-path "~/.emacs.d/elpa/twittering-mode-20150131.708") (require 'twittering-mode) (cond ((string-equal system-type "gnu/linux") diff --git a/elpa/twittering-mode-20150105.333/twittering-mode-pkg.el b/elpa/twittering-mode-20150105.333/twittering-mode-pkg.el deleted file mode 100644 index d262ae0c..00000000 --- a/elpa/twittering-mode-20150105.333/twittering-mode-pkg.el +++ /dev/null @@ -1 +0,0 @@ -(define-package "twittering-mode" "20150105.333" "Major mode for Twitter" (quote nil)) diff --git a/elpa/twittering-mode-20150105.333/twittering-mode-autoloads.el b/elpa/twittering-mode-20150131.708/twittering-mode-autoloads.el similarity index 60% rename from elpa/twittering-mode-20150105.333/twittering-mode-autoloads.el rename to elpa/twittering-mode-20150131.708/twittering-mode-autoloads.el index 1d7bc128..9893b1ad 100644 --- a/elpa/twittering-mode-20150105.333/twittering-mode-autoloads.el +++ b/elpa/twittering-mode-20150131.708/twittering-mode-autoloads.el @@ -1,10 +1,10 @@ ;;; twittering-mode-autoloads.el --- automatically extracted autoloads ;; ;;; Code: - +(add-to-list 'load-path (or (file-name-directory #$) (car load-path))) -;;;### (autoloads (twit) "twittering-mode" "twittering-mode.el" (21685 -;;;;;; 21202 0 0)) +;;;### (autoloads nil "twittering-mode" "twittering-mode.el" (21908 +;;;;;; 14167 0 0)) ;;; Generated autoloads from twittering-mode.el (autoload 'twit "twittering-mode" "\ @@ -14,16 +14,9 @@ Start twittering-mode. ;;;*** -;;;### (autoloads nil nil ("twittering-mode-pkg.el") (21685 21202 -;;;;;; 231505 0)) - -;;;*** - -(provide 'twittering-mode-autoloads) ;; Local Variables: ;; version-control: never ;; no-byte-compile: t ;; no-update-autoloads: t -;; coding: utf-8 ;; End: ;;; twittering-mode-autoloads.el ends here diff --git a/elpa/twittering-mode-20150131.708/twittering-mode-pkg.el b/elpa/twittering-mode-20150131.708/twittering-mode-pkg.el new file mode 100644 index 00000000..57f592c2 --- /dev/null +++ b/elpa/twittering-mode-20150131.708/twittering-mode-pkg.el @@ -0,0 +1 @@ +(define-package "twittering-mode" "20150131.708" "Major mode for Twitter" 'nil :url "http://twmode.sf.net/" :keywords '("twitter" "web")) diff --git a/elpa/twittering-mode-20150105.333/twittering-mode.el b/elpa/twittering-mode-20150131.708/twittering-mode.el similarity index 96% rename from elpa/twittering-mode-20150105.333/twittering-mode.el rename to elpa/twittering-mode-20150131.708/twittering-mode.el index 07d4001e..68414c5c 100644 --- a/elpa/twittering-mode-20150105.333/twittering-mode.el +++ b/elpa/twittering-mode-20150131.708/twittering-mode.el @@ -1,15 +1,19 @@ ;;; twittering-mode.el --- Major mode for Twitter -;; Copyright (C) 2007, 2009, 2010 Yuto Hayamizu. +;; Copyright (C) 2009-2015 Tadashi MATSUO +;; 2007, 2009-2011 Yuto Hayamizu. ;; 2008 Tsuyoshi CHO +;; 2014, 2015 Xavier Maillard -;; Author: Y. Hayamizu +;; Author: Tadashi MATSUO +;; Y. Hayamizu ;; Tsuyoshi CHO ;; Alberto Garcia +;; Xavier Maillard ;; Created: Sep 4, 2007 -;; Version: 20150105.333 -;; X-Original-Version: HEAD -;; Identity: $Id: 3900030719827789c5fe196feacaa78b4ea5a702 $ +;; Version: HEAD +;; Package-Version: 20150131.708 +;; Identity: $Id: f0574b157c4e8ac5e3b25e0385a7131681260343 $ ;; Keywords: twitter web ;; URL: http://twmode.sf.net/ @@ -84,8 +88,12 @@ ad-do-it))) (require 'url) +(defgroup twittering-mode nil + "Settings for twittering-mode." + :group 'hypermedia) + (defconst twittering-mode-version "HEAD") -(defconst twittering-mode-identity "$Id: 3900030719827789c5fe196feacaa78b4ea5a702 $") +(defconst twittering-mode-identity "$Id: f0574b157c4e8ac5e3b25e0385a7131681260343 $") (defvar twittering-api-host "api.twitter.com") (defvar twittering-api-search-host "search.twitter.com") (defvar twittering-web-host "twitter.com") @@ -105,14 +113,22 @@ (message "%s" version-string) version-string))) -(defvar twittering-auth-method 'oauth - "*Authentication method for `twittering-mode'. -The symbol `basic' means Basic Authentication. The symbol `oauth' means -OAuth Authentication. The symbol `xauth' means xAuth Authentication. +(defcustom twittering-auth-method 'oauth + "*Authentication method to use with `twittering-mode'. + +Choose between symbols `oauth' (default), `basic' or `xauth'. + OAuth Authentication requires `twittering-oauth-consumer-key' and -`twittering-oauth-consumer-secret'. Additionally, it requires an external -command `curl' or another command included in `tls-program', which may be -`openssl' or `gnutls-cli', for SSL.") +`twittering-oauth-consumer-secret'. + +Additionally, it requires an external command `curl' or another +command included in `tls-program', which may be `openssl' or +`gnutls-cli', for SSL." + :group 'twittering-mode + :type '(choice :tag "Twitter authentication method" + (const :tag "Basic authentication" :value basic) + (const :tag "OAuth authentication" :value oauth) + (const :tag "xAuth authentication" :value xauth))) (defvar twittering-account-authorization nil "State of account authorization for `twittering-username' and @@ -121,11 +137,17 @@ nil -- The account have not been authorized yet. queried -- The authorization has been queried, but not finished yet. authorized -- The account has been authorized.") -(defvar twittering-oauth-use-ssl t - "*Whether to use SSL on authentication via OAuth. Twitter requires SSL -on authorization via OAuth.") -(defvar twittering-oauth-invoke-browser nil - "*Whether to invoke a browser on authorization of access key automatically.") +(defcustom twittering-oauth-use-ssl t + "*If non-nil, use SSL authentication for OAuth. + +Twitter requires SSL on authorization via OAuth." + :group 'twittering-mode + :type 'boolean) + +(defcustom twittering-oauth-invoke-browser nil + "*If non-nil, invoke a browser on authorization of access key automatically." + :type 'boolean + :group 'twittering-mode) (defvar twittering-oauth-consumer-key nil) (defvar twittering-oauth-consumer-secret nil) @@ -134,17 +156,37 @@ on authorization via OAuth.") (defconst twittering-max-number-of-tweets-on-retrieval 200 "The maximum number of `twittering-number-of-tweets-on-retrieval'.") -(defvar twittering-number-of-tweets-on-retrieval 20 - "*The number of tweets which will be retrieved in one request. -The upper limit is `twittering-max-number-of-tweets-on-retrieval'.") +(defcustom twittering-number-of-tweets-on-retrieval 20 + "*Number of tweets which will be retrieved in one request. + +The upper limit is `twittering-max-number-of-tweets-on-retrieval'." + :type 'integer + :group 'twittering-mode) + +(defcustom twittering-tinyurl-service 'tinyurl + "*Shorten URI service to use. -(defvar twittering-tinyurl-service 'tinyurl - "*The service to shorten URI. This must be one of key symbols of `twittering-tinyurl-services-map'. -To use 'bit.ly or 'j.mp, you have to configure `twittering-bitly-login' and -`twittering-bitly-api-key'.") -(defvar twittering-tinyurl-services-map +To use bit.ly or j.mp services, you have to configure +`twittering-bitly-login' and `twittering-bitly-api-key'." + :type '(radio (symbol :tag "bit.ly" + :value bit.ly) + (symbol :tag "goo.gl" + :value goo.gl) + (symbol :tag "is.gd" + :value is.gd) + (symbol :tag "j.mp" + :value j.mp) + (symbol :tag "migre.me" + :value migre.me) + (symbol :tag "tinyurl" + :value tinyurl) + (symbol :tag "toly" + :value toly)) + :group 'twittering-mode) + +(defcustom twittering-tinyurl-services-map '((bit.ly twittering-make-http-request-for-bitly (lambda (service reply) (if (string-match "\n\\'" reply) @@ -193,12 +235,21 @@ request. If the second element is nil, the reply is directly used as a shortened URL. If the second element is a function, it is called as `(funcall THE-SECOND-ELEMENT service-symbol HTTP-reply-string)' and its result is used -as a shortened URL.") - -(defvar twittering-bitly-login nil - "*The login name for URL shortening service bit.ly and j.mp.") -(defvar twittering-bitly-api-key nil - "*The API key for URL shortening service bit.ly and j.mp.") +as a shortened URL." + :type 'alist + :group 'twittering-mode) + +(defcustom twittering-bitly-login nil + "*The login name for URL shortening service bit.ly and j.mp." + :type '(choice (const nil) + string) + :group 'twittering-mode) + +(defcustom twittering-bitly-api-key nil + "*API key for `bit.ly' and `j.mp' URL shortening services." + :type '(choice (const nil) + string) + :group 'twittering-mode) (defvar twittering-mode-map (make-sparse-keymap)) (defvar twittering-mode-menu-on-uri-map (make-sparse-keymap "Twittering Mode")) @@ -218,10 +269,12 @@ as a shortened URL.") "Timer object for timeline refreshing will be stored here. DO NOT SET VALUE MANUALLY.") -(defvar twittering-timer-interval 90 - "The interval of auto reloading. You should use 60 or more -seconds for this variable because the number of API call is -limited by the hour.") +(defcustom twittering-timer-interval 90 + "Number of seconds to wait before an auto-reload occurs. + +Number of API calls per hour is limited so this value should be 60 or more." + :type 'integer + :group 'twittering-mode) (defvar twittering-timer-for-redisplaying nil "Timer object for timeline redisplay statuses will be stored here. @@ -232,28 +285,37 @@ DO NOT SET VALUE MANUALLY.") Each time Emacs remains idle for the interval, twittering-mode updates parts requiring to be redrawn.") -(defvar twittering-username nil - "*An username of your Twitter account.") +(defcustom twittering-username nil + "*A username of your Twitter account." + :type '(choice (const nil) + string) + :group 'twittering-mode) -(defvar twittering-password nil +(defcustom twittering-password nil "*A password of your Twitter account. Leave it blank is the recommended way because writing a password in .emacs file is so -dangerous.") +dangerous." + :type '(choice (const nil) + string) + :group 'twittering-mode) -(defvar twittering-initial-timeline-spec-string ":home" +(defcustom twittering-initial-timeline-spec-string ":home" "*An initial timeline spec string or a list of timeline spec strings. This specifies one or more initial timeline spec strings, which are automatically visited when invoking `twittering-mode' or `twit'. If it is a string, it specifies a timeline spec string. -If it is a list of strings, it specifies multiple timeline spec strings.") +If it is a list of strings, it specifies multiple timeline spec strings." + :type '(choice (const nil) + string) + :group 'twittering-mode) (defvar twittering-timeline-spec nil "The timeline spec for the current buffer.") (defvar twittering-timeline-spec-string "" "The timeline spec string for the current buffer.") -(defvar twittering-timeline-spec-alias nil +(defcustom twittering-timeline-spec-alias nil "*Alist for aliases of timeline spec. Each element is (NAME . SPEC-STRING), where NAME is a string and SPEC-STRING is a string or a function that returns a timeline spec string. @@ -274,7 +336,9 @@ For example, if you specify \":home\")))), then you can use \"$FRIENDS\" and \"$related-to(USER)\" as \"my-account/friends-list\" and \":search/to:USER OR from:USER OR @USER/\", -respectively.") +respectively." + :type 'alist + :group 'twittering-mode) (defvar twittering-current-timeline-spec-string nil "The current timeline spec string. This variable should not be referred @@ -294,11 +358,15 @@ directly. Use `twittering-current-timeline-spec-string' or (defvar twittering-timeline-spec-to-api-table '() "Alist of a timeline spec and an API identifier for retrieving the timeline.") +(defcustom twittering-mode-init-hook nil + "*Hook run after initializing global variables for `twittering-mode'." + :type 'hook + :group 'twittering-mode) -(defvar twittering-mode-init-hook nil - "*Hook run after initializing global variables for `twittering-mode'.") -(defvar twittering-mode-hook nil - "*Hook run every time a buffer is initialized as a twittering-mode buffer.") +(defcustom twittering-mode-hook nil + "*Hook run every time a buffer is initialized as a `twittering-mode' buffer." + :type 'hook + :group 'twittering-mode) (defvar twittering-cookie-alist nil "Alist for stroing cookies for each account. @@ -316,11 +384,13 @@ a pair of a cookie name and value.") "New tweet status messages, when `twittering-new-tweets-hook' is run.") -(defvar twittering-new-tweets-hook nil +(defcustom twittering-new-tweets-hook nil "*Hook run when new tweets are received. You can read `twittering-new-tweets-count' or `twittering-new-tweets-spec' -to get the number of new tweets received when this hook is run.") +to get the number of new tweets received when this hook is run." + :type 'hook + :group 'twittering-mode) (defvar twittering-rendered-new-tweets-spec nil "A timeline spec of newly rendered tweets. @@ -340,10 +410,10 @@ You can refer to a property of a tweet alist as (cdr (assq PROPERTY-SYMBOL TWEET-ALIST)). Valid symbols are following; id, text, user-name, user-screen-name, user-id, source, source-uri. -In the list, tweets are placed in order of time. The car of the list is the +In the list, tweets are placed in order of time. The car of the list is the latest one, and the last is the oldest one.") -(defvar twittering-new-tweets-rendered-hook nil +(defcustom twittering-new-tweets-rendered-hook nil "*Hook run when new tweets are rendered. When the registered functions are called, the current buffer is the buffer that the new tweets are just rendered on. @@ -353,7 +423,9 @@ The functions can refer to the timeline spec and timeline spec string as Hooks can also use the local variable `twittering-rendered-new-tweets' as a list of rendered tweets. For the detail of the representation of tweets, see the variable -`twittering-rendered-new-tweets'.") +`twittering-rendered-new-tweets'." + :type 'hook + :group 'twittering-mode) (defvar twittering-active-mode nil "Non-nil if new statuses should be retrieved periodically. @@ -362,13 +434,22 @@ Do not modify this variable directly. Use `twittering-activate-buffer', `twittering-set-active-flag-for-buffer'.") (defvar twittering-jojo-mode nil) -(defvar twittering-reverse-mode nil - "*Non-nil means tweets are aligned in reverse order of `http://twitter.com/'.") -(defvar twittering-display-remaining nil - "*If non-nil, display remaining of rate limit on the mode-line.") -(defvar twittering-display-connection-method t - "*If non-nil, display the current connection method on the mode-line.") -(defvar twittering-status-format "%i %s, %@:\n%FILL[ ]{%T // from %f%L%r%R}\n " +(defcustom twittering-reverse-mode nil + "*Non-nil means tweets are aligned in reverse order of `http://twitter.com/'." + :type 'boolean + :group 'twittering-mode) + +(defcustom twittering-display-remaining nil + "*If non-nil, display remaining of rate limit on the mode-line." + :type 'boolean + :group 'twittering-mode) + +(defcustom twittering-display-connection-method t + "*If non-nil, display the current connection method on the mode-line." + :type 'boolean + :group 'twittering-mode) + +(defcustom twittering-status-format "%i %s, %@:\n%FILL[ ]{%T // from %f%L%r%R}\n " "Format string for rendering statuses. Ex. \"%i %s, %@:\\n%FILL{ %T // from %f%L%r%R}\n \" @@ -392,7 +473,7 @@ Items: %p - protected? %c - created_at (raw UTC string) %C{time-format-str} - created_at (formatted with time-format-str) - %@ - X seconds ago + %@{time-format-str} - X seconds ago (formatted with time-format-str) %T - raw text %t - text filled as one paragraph %' - truncated @@ -411,10 +492,11 @@ Items: squeeze a series of white spaces. You can use any other specifiers in braces. %f - source - %# - id -") + %# - id" + :type 'string + :group 'twittering-mode) -(defvar twittering-retweet-format '(nil _ " RT: %t (via @%s)") +(defcustom twittering-retweet-format '(nil _ " RT: %t (via @%s)") "*A format string or a skeleton for retweet. If the value is a string, it means a format string for generating an initial string of a retweet. The format string is converted with the below replacement @@ -435,49 +517,73 @@ Replacement table: %t - The text of the cited tweet. %u - The URL of the cited tweet. %# - The ID of the cited tweet. - %% - % itself.") - -(defvar twittering-fill-column nil - "*The fill-column used for \"%FILL{...}\" in `twittering-status-format'. -If nil, the fill-column is automatically calculated.") - -(defvar twittering-show-replied-tweets t + %% - % itself." + :type 'sexp + :group 'twittering-mode) + +(defcustom twittering-fill-column nil + "*The `fill-column' used for \"%FILL{...}\" in `twittering-status-format'. +If nil, the fill-column is automatically calculated." + :type '(choice (const nil) + integer) + :group 'twittering-mode) + +(defcustom twittering-show-replied-tweets t "*The number of replied tweets which will be showed in one tweet. If the value is not a number and is non-nil, show all replied tweets which is already fetched. -If the value is nil, doesn't show replied tweets.") +If the value is nil, doesn't show replied tweets." -(defvar twittering-default-show-replied-tweets nil - "*The number of default replied tweets which will be showed in one tweet. + :type '(choice (const :tag "Do not show replied tweets" + :value nil) + (const :tag "Show all replied tweets" + :value t) + (integer :tag "Number of replied tweet")) + :group 'twittering-mode) + +(defcustom twittering-default-show-replied-tweets nil + "*The number of default replied tweets which will be shown in one tweet. This value will be used only when showing new tweets. -See `twittering-show-replied-tweets' for more details.") +See `twittering-show-replied-tweets' for more details." + :type '(choice (const nil) + integer) + :group 'twittering-mode) -(defvar twittering-disable-overlay-on-too-long-string nil +(defcustom twittering-disable-overlay-on-too-long-string nil "*If non-nil, disable overlay on too long string on edit buffer. If nil, `twittering-edit-mode' puts an overlay `twittering-warning-overlay' on characters following the 140th character. On some environments, some input methods seem to interfere the update of the -overlay. In such case, you may avoid the problems by setting this variable to -non-nil.") +overlay. In such case, you may avoid the problems by setting this variable to +non-nil." + :type 'boolean + :group 'twittering-mode) -(defvar twittering-use-show-minibuffer-length t +(defcustom twittering-use-show-minibuffer-length t "*Show current length of minibuffer if this variable is non-nil. We suggest that you should set to nil to disable the showing function -when it conflict with your input method (such as AquaSKK, etc.)") +when it conflict with your input method (such as AquaSKK, etc.)" + :type 'boolean + :group 'twittering-mode) (defvar twittering-notify-successful-http-get t) -(defvar twittering-use-ssl t - "Use SSL connection if this variable is non-nil. +(defcustom twittering-use-ssl t + "*Use SSL connection if this variable is non-nil. + +SSL connections use an external command as a backend." + :type 'boolean + :group 'twittering-mode) -SSL connections use 'curl' command as a backend.") -(defvar twittering-allow-insecure-server-cert nil - "*If non-nil, twittering-mode allows insecure server certificates.") +(defcustom twittering-allow-insecure-server-cert nil + "*If non-nil, `twittering-mode' allows insecure server certificates." + :type 'boolean + :group 'twittering-mode) (defvar twittering-curl-program nil "Cache a result of `twittering-find-curl-program'. @@ -490,31 +596,65 @@ DO NOT SET VALUE MANUALLY.") "Cache a result of `twittering-find-wget-program'. DO NOT SET VALUE MANUALLY.") -(defvar twittering-tls-program nil +(defcustom twittering-tls-program nil "*List of strings containing commands to start TLS stream to a host. Each entry in the list is tried until a connection is successful. %h is replaced with server hostname, %p with port to connect to. Also see `tls-program'. If nil, this is initialized with a list of valied entries extracted from -`tls-program'.") +`tls-program'." + :type '(repeat string) + :group 'twittering-mode) -(defvar twittering-connection-type-order - '(curl wget urllib-http native urllib-https)) +(defcustom twittering-connection-type-order + '(curl wget urllib-http native urllib-https) "*A list of connection methods in the preferred order." - -(defvar 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)) + :type 'list + :group 'twittering-mode) + +(defun twittering-connection-build-customize-option () + "Generate a valid `defcustom' entry to build `twittering-connection-type-table' variable." + (list 'repeat + (list + 'cons :tag "Connection" + '(symbol :tag "Name" :value "") + '(repeat + :tag "Connection method definition" + (choice + (cons :tag "Check test method" + (const :format "" check) + (choice :value t (const :tag "Do not check" t) + (function :tag "Check function"))) + (cons :tag "Display name" + (const :format "" display-name) + string) + (cons :tag "HTTPS connection method" + (const :format "" https) + (choice :value nil (const :tag "None" nil) + (const :tag "True" t) + (function :tag "HTTPS test function"))) + (cons :tag "Send HTTP request function" + (const :format "" send-http-request) + function) + (cons :tag "Pre process buffer" + (const :format "" pre-process-buffer) + function)))))) + +(defcustom twittering-connection-type-table + '((native + (check . t) + (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 . ignore) + (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) @@ -527,7 +667,9 @@ If nil, this is initialized with a list of valied entries extracted from (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.") + "A list of alist of connection methods." + :group 'twittering-mode + :type (twittering-connection-build-customize-option)) (defvar twittering-format-status-function-source "" "The status format string that has generated the current @@ -540,16 +682,27 @@ which is a lambda expression without being compiled.") (defvar twittering-timeline-data-table (make-hash-table :test 'equal)) -(defvar twittering-username-face 'twittering-username-face) -(defvar twittering-uri-face 'twittering-uri-face) +(defcustom twittering-username-face 'twittering-username-face + "*Face used to display USERNAME." + :type 'face + :group 'twittering-mode) + +(defcustom twittering-uri-face 'twittering-uri-face + "*Face used to display URIs." + :type 'face + :group 'twittering-mode) -(defvar twittering-use-native-retweet nil - "Post retweets using native retweets if this variable is non-nil.") +(defcustom twittering-use-native-retweet nil + "*If non-nil, post retweet using native retweets." + :type 'boolean + :group 'twittering-mode) -(defvar twittering-update-status-function +(defcustom twittering-update-status-function 'twittering-update-status-from-pop-up-buffer - "The function used to posting a tweet. It takes 5 arguments, -INIT-STR, REPLY-TO-ID, USERNAME, TWEET-TYPE, CURRENT-SPEC. + "*The function which is used to post a tweet. + +It takes the following 5 arguments, INIT-STR, REPLY-TO-ID, USERNAME, +TWEET-TYPE and CURRENT-SPEC. The first argument INIT-STR is nil or an initial text to be edited. REPLY-TO-ID and USERNAME are an ID and a user-screen-name of a tweet to which you are going to reply. If the tweet is not a reply, they are nil. @@ -559,18 +712,32 @@ CURRENT-SPEC means on which timeline the function is called. Twittering-mode provides two functions for updating status: * `twittering-update-status-from-minibuffer': edit tweets in minibuffer -* `twittering-update-status-from-pop-up-buffer': edit tweets in pop-up buffer") - -(defvar twittering-request-confirmation-on-posting nil - "*If *non-nil*, confirmation will be requested on posting a tweet edited in -pop-up buffer.") - -(defvar twittering-use-master-password nil - "*Wheter to store private information encrypted with a master password.") -(defvar twittering-private-info-file - (expand-file-name "~/.twittering-mode.gpg") - "*File for storing encrypted private information when -`twittering-use-master-password' is non-nil.") +* `twittering-update-status-from-pop-up-buffer': edit tweets in pop-up buffer" + :type '(choice (const :tag "built-in: from minibuffer" + twittering-update-status-from-minibuffer) + (const :tag "built-in: from a popup buffer" + twittering-update-status-from-pop-up-buffer) + (function :tag "Your own function")) + :group 'twittering-mode) + +(defcustom twittering-request-confirmation-on-posting nil + "*If non-nil, confirmation will be requested on posting a tweet edited in +pop-up buffer." + :type 'boolean + :group 'twittering-mode) + +(defcustom twittering-use-master-password nil + "*If non-nil, store private information encrypted with a master password." + :type 'boolean + :group 'twittering-mode) + +(defcustom twittering-private-info-file (expand-file-name "~/.twittering-mode.gpg") + "*File for storing encrypted private information. + + Only used when `twittering-use-master-password' is non-nil." + :group 'twittering-mode + :type 'file) + (defvar twittering-private-info-file-loaded nil "Whether the private info file has been loaded or not.") (defvar twittering-variables-stored-with-encryption @@ -580,12 +747,7 @@ pop-up buffer.") (defvar twittering-search-api-method "search") (defvar twittering-web-path-prefix "") -(defvar twittering-service-method 'twitter-api-v1.1 - "*Service method for `twittering-mode'. -The symbol `twitter' means Twitter Service. The symbol `statusnet' means -StatusNet Service.") - -(defvar twittering-service-method-table +(defconst twittering-service-method-table '((twitter (status-url . twittering-get-status-url-twitter) (search-url . twittering-get-search-url-twitter)) (twitter-api-v1.1 @@ -595,32 +757,66 @@ StatusNet Service.") (search-url . twittering-get-search-url-statusnet))) "A list of alist of service methods.") -(defvar twittering-timeline-header-face 'twittering-timeline-header-face +(defcustom twittering-service-method 'twitter-api-v1.1 + "*Service method for `twittering-mode'. + +The symbol `twitter' means Twitter Service. +The symbol `statusnet' means StatusNet Service. + +Default to `twitter-api-v1.1' which is an alias for `twitter'. + +See also `twittering-service-method-table'." + :type (if (> (length (mapcar #'car twittering-service-method-table)) 0) + `(choice ,@(mapcar (lambda (entry) `(const ,(car entry))) + twittering-service-method-table)) + 'symbol) + :group 'twittering-mode) + +(defcustom twittering-timeline-header-face 'twittering-timeline-header-face "*Face for the header on `twittering-mode'. -The face is used for rendering `twittering-timeline-header'.") -(defvar twittering-timeline-footer-face 'twittering-timeline-footer-face + +The face is used for rendering `twittering-timeline-header'." + :type 'face + :group 'twittering-mode) + +(defcustom twittering-timeline-footer-face 'twittering-timeline-footer-face "*Face for the footer on `twittering-mode'. -The face is used for rendering `twittering-timeline-footer'.") -(defvar twittering-timeline-header "-- Press Enter here to update --\n" + +The face is used for rendering `twittering-timeline-footer'." + :type 'face + :group 'twittering-mode) + +(defcustom twittering-timeline-header "-- Press Enter here to update --\n" "*Timeline header string on `twittering-mode'. + The string is rendered on the beginning of a `twittering-mode' buffer. -Its face is specified by `twittering-timeline-header-face'.") -(defvar twittering-timeline-footer "-- Press Enter here to update --" +Its face is specified by `twittering-timeline-header-face'." + :type 'string + :group 'twittering-mode) + +(defcustom twittering-timeline-footer "-- Press Enter here to update --" "*Timeline footer string on `twittering-mode'. + The string is rendered on the end of a `twittering-mode' buffer. -Its face is specified by `twittering-timeline-footer-face'.") +Its face is specified by `twittering-timeline-footer-face'." + :type 'string + :group 'twittering-mode) -(defvar twittering-pop-to-buffer-function +(defcustom twittering-pop-to-buffer-function 'twittering-pop-to-buffer-in-bottom-largest-window "*Function being invoked by `twittering-pop-to-buffer'. + It will receive an argument, the buffer being selected. For example, the following functions can be used; `pop-to-buffer', `twittering-pop-to-buffer-simple', `twittering-pop-to-buffer-in-current-window', `twittering-pop-to-buffer-in-largest-window', and -`twittering-pop-to-buffer-in-bottom-largest-window'.") +`twittering-pop-to-buffer-in-bottom-largest-window'." + :type 'function + :group 'twittering-mode) -(defvar twittering-relative-retrieval-interval-alist +;; FIXME: change to something better than alist +(defcustom twittering-relative-retrieval-interval-alist '(("\\`:direct.*\\'" 4) (":home" ":mentions" 1) (t 1)) @@ -642,7 +838,9 @@ An interval for a timeline is determined as follows; RELATIVE-INTERVAL times as long as `twittering-timer-interval'. If RELATIVE-INTERVAL is zero, the interval is infinity. - The timeline is not retrieved automatically.") + The timeline is not retrieved automatically." + :type 'alist + :group 'twittering-mode) (defvar twittering-relative-retrieval-count-alist '() "An alist for counting retrieval of primary timelines.") @@ -829,14 +1027,14 @@ as a list of a string on Emacs21." ;; completing-read() of Emacs21 does not accepts candidates as ;; a list. Candidates must be given as an alist. (let* ((collection (twittering-remove-duplicates collection)) - (collection - (if (and (> 22 emacs-major-version) - (listp collection) - (stringp (car collection))) - (mapcar (lambda (x) (cons x nil)) collection) - collection))) + (collection + (if (and (> 22 emacs-major-version) + (listp collection) + (stringp (car collection))) + (mapcar (lambda (x) (cons x nil)) collection) + collection))) (completing-read prompt collection predicate require-match - initial-input hist def inherit-input-method))) + initial-input hist def inherit-input-method))) (defun twittering-add-to-history (history-var elt &optional maxelt keep-all) (if (functionp 'add-to-history) @@ -937,42 +1135,65 @@ defined in Emacs21." ;;;; Proxy setting / functions ;;;; -(defvar twittering-proxy-use nil) -(defvar twittering-proxy-server nil +(defgroup twittering-proxy nil + "Subgroup handling `twittering-mode' proxy setup." + :group 'twittering-mode) + +(defcustom twittering-proxy-use nil + "*If non-nil, use PROXY. + +See also `twittering-proxy-server' for documentation." + :type 'boolean + :group 'twittering-mode) + +(defcustom twittering-proxy-server nil "*Proxy server for `twittering-mode'. + If both `twittering-proxy-server' and `twittering-proxy-port' are non-nil, the variables `twittering-proxy-*' have priority over other variables `twittering-http-proxy-*' or `twittering-https-proxy-*' regardless of HTTP or HTTPS. To use individual proxies for HTTP and HTTPS, both `twittering-proxy-server' -and `twittering-proxy-port' must be nil.") -(defvar twittering-proxy-port nil +and `twittering-proxy-port' must be nil." + :group 'twittering-proxy + :type '(choice (const nil) string)) + +(defcustom twittering-proxy-port nil "*Port number for `twittering-mode'. + If both `twittering-proxy-server' and `twittering-proxy-port' are non-nil, the variables `twittering-proxy-*' have priority over other variables `twittering-http-proxy-*' or `twittering-https-proxy-*' regardless of HTTP or HTTPS. To use individual proxies for HTTP and HTTPS, both `twittering-proxy-server' -and `twittering-proxy-port' must be nil.") +and `twittering-proxy-port' must be nil." + :group 'twittering-proxy + :type '(choice (const nil) + integer)) + (defvar twittering-proxy-keep-alive nil) -(defvar twittering-proxy-user nil +(defcustom twittering-proxy-user nil "*Username for `twittering-proxy-server'. NOTE: If both `twittering-proxy-server' and `twittering-proxy-port' are non-nil, the variables `twittering-proxy-*' have priority over other variables `twittering-http-proxy-*' or `twittering-https-proxy-*' regardless of HTTP or HTTPS.") -(defvar twittering-proxy-password nil + +(defcustom twittering-proxy-password nil "*Password for `twittering-proxy-server'. NOTE: If both `twittering-proxy-server' and `twittering-proxy-port' are non-nil, the variables `twittering-proxy-*' have priority over other variables `twittering-http-proxy-*' or `twittering-https-proxy-*' -regardless of HTTP or HTTPS.") +regardless of HTTP or HTTPS." + :group 'twittering-proxy + :type '(choice (const nil) + string)) -(defvar twittering-http-proxy-server nil +(defcustom twittering-http-proxy-server nil "*HTTP proxy server for `twittering-mode'. If nil, it is initialized on entering `twittering-mode'. The port number is specified by `twittering-http-proxy-port'. @@ -982,8 +1203,12 @@ and `twittering-https-proxy-port' is used. NOTE: If both `twittering-proxy-server' and `twittering-proxy-port' are non-nil, the variables `twittering-proxy-*' have priority over other variables `twittering-http-proxy-*' or `twittering-https-proxy-*' -regardless of HTTP or HTTPS.") -(defvar twittering-http-proxy-port nil +regardless of HTTP or HTTPS." + :group 'twittering-proxy + :type '(choice (const nil) + string)) + +(defcustom twittering-http-proxy-port nil "*Port number of a HTTP proxy server for `twittering-mode'. If nil, it is initialized on entering `twittering-mode'. The server is specified by `twittering-http-proxy-server'. @@ -993,25 +1218,39 @@ and `twittering-https-proxy-port' is used. NOTE: If both `twittering-proxy-server' and `twittering-proxy-port' are non-nil, the variables `twittering-proxy-*' have priority over other variables `twittering-http-proxy-*' or `twittering-https-proxy-*' -regardless of HTTP or HTTPS.") -(defvar twittering-http-proxy-keep-alive nil - "*If non-nil, the Keep-alive is enabled. This is experimental.") -(defvar twittering-http-proxy-user nil +regardless of HTTP or HTTPS." + :group 'twittering-proxy + :type '(choice (const nil) + integer)) + +(defcustom twittering-http-proxy-keep-alive nil + "*If non-nil, the Keep-alive is enabled. This is experimental." + :group 'twittering-proxy + :type 'boolean) + +(defcustom twittering-http-proxy-user nil "*Username for `twittering-http-proxy-server'. NOTE: If both `twittering-proxy-server' and `twittering-proxy-port' are non-nil, the variables `twittering-proxy-*' have priority over other variables `twittering-http-proxy-*' or `twittering-https-proxy-*' -regardless of HTTP or HTTPS.") -(defvar twittering-http-proxy-password nil +regardless of HTTP or HTTPS." + :group 'twittering-proxy + :type '(choice (const nil) + string)) + +(defcustom twittering-http-proxy-password nil "*Password for `twittering-http-proxy-server'. NOTE: If both `twittering-proxy-server' and `twittering-proxy-port' are non-nil, the variables `twittering-proxy-*' have priority over other variables `twittering-http-proxy-*' or `twittering-https-proxy-*' -regardless of HTTP or HTTPS.") +regardless of HTTP or HTTPS." + :group 'twittering-proxy + :type '(choice (const nil) + string)) -(defvar twittering-https-proxy-server nil +(defcustom twittering-https-proxy-server nil "*HTTPS proxy server for `twittering-mode'. If nil, it is initialized on entering `twittering-mode'. The port number is specified by `twittering-https-proxy-port'. @@ -1021,8 +1260,12 @@ and `twittering-http-proxy-port' is used. NOTE: If both `twittering-proxy-server' and `twittering-proxy-port' are non-nil, the variables `twittering-proxy-*' have priority over other variables `twittering-http-proxy-*' or `twittering-https-proxy-*' -regardless of HTTP or HTTPS.") -(defvar twittering-https-proxy-port nil +regardless of HTTP or HTTPS." + :group 'twittering-proxy + :type '(choice (const nil) + string)) + +(defcustom twittering-https-proxy-port nil "*Port number of a HTTPS proxy server for `twittering-mode'. If nil, it is initialized on entering `twittering-mode'. The server is specified by `twittering-https-proxy-server'. @@ -1032,23 +1275,37 @@ and `twittering-http-proxy-port' is used. NOTE: If both `twittering-proxy-server' and `twittering-proxy-port' are non-nil, the variables `twittering-proxy-*' have priority over other variables `twittering-http-proxy-*' or `twittering-https-proxy-*' -regardless of HTTP or HTTPS.") -(defvar twittering-https-proxy-keep-alive nil - "*If non-nil, the Keep-alive is enabled. This is experimental.") -(defvar twittering-https-proxy-user nil +regardless of HTTP or HTTPS." + :group 'twittering-proxy + :type '(choice (const nil) + integer)) + +(defcustom twittering-https-proxy-keep-alive nil + "*If non-nil, the Keep-alive is enabled. This is experimental." + :group 'twittering-proxy + :type 'boolean) + +(defcustom twittering-https-proxy-user nil "*Username for `twittering-https-proxy-server'. NOTE: If both `twittering-proxy-server' and `twittering-proxy-port' are non-nil, the variables `twittering-proxy-*' have priority over other variables `twittering-http-proxy-*' or `twittering-https-proxy-*' -regardless of HTTP or HTTPS.") -(defvar twittering-https-proxy-password nil +regardless of HTTP or HTTPS." + :group 'twittering-proxy + :type '(choice (const nil) + string)) + +(defcustom twittering-https-proxy-password nil "*Password for `twittering-https-proxy-server'. NOTE: If both `twittering-proxy-server' and `twittering-proxy-port' are non-nil, the variables `twittering-proxy-*' have priority over other variables `twittering-http-proxy-*' or `twittering-https-proxy-*' -regardless of HTTP or HTTPS.") +regardless of HTTP or HTTPS." + :group 'twittering-proxy + :type '(choice (const nil) + string)) (defun twittering-normalize-proxy-vars () "Normalize the type of `twittering-http-proxy-port' and @@ -1128,26 +1385,26 @@ SCHEME must be \"http\" or \"https\"." ((require 'url-methods nil t) (url-scheme-register-proxy scheme) (let* ((proxy-service (assoc scheme url-proxy-services)) - (proxy (if proxy-service (cdr proxy-service) nil))) + (proxy (if proxy-service (cdr proxy-service) nil))) (if (and proxy - (string-match "^\\([^:]+\\):\\([0-9]+\\)$" proxy)) - (let ((host (match-string 1 proxy)) + (string-match "^\\([^:]+\\):\\([0-9]+\\)$" proxy)) + (let ((host (match-string 1 proxy)) (port (string-to-number (match-string 2 proxy)))) - (cons host port)) - nil))) + (cons host port)) + nil))) (t (let* ((env-var (concat scheme "_proxy")) - (env-proxy (or (getenv (upcase env-var)) - (getenv (downcase env-var)))) + (env-proxy (or (getenv (upcase env-var)) + (getenv (downcase env-var)))) (default-port (if (string= "https" scheme) "443" "80"))) (if (and env-proxy (string-match "^\\(https?://\\)?\\([^:/]+\\)\\(:\\([0-9]+\\)\\)?/?$" env-proxy)) - (let* ((host (match-string 2 env-proxy)) + (let* ((host (match-string 2 env-proxy)) (port-str (or (match-string 4 env-proxy) default-port)) (port (string-to-number port-str))) - (cons host port)) + (cons host port)) nil))))) (defun twittering-setup-proxy () @@ -1189,8 +1446,13 @@ SCHEME must be \"http\" or \"https\"." ;;;; Functions for URL library ;;;; -(defvar twittering-url-show-status nil - "*Whether to show a running total of bytes transferred.") +(defcustom twittering-url-show-status nil + "*If non-nil, show a running total of bytes transferred by urllib. + +This has effect only if either \"urllib-httpp\" or \"urllib-https\" is used +as the connection method." + :group 'twittering-mode + :type 'boolean) ;;;; ;;;; CA certificate @@ -1830,8 +2092,8 @@ The alist consists of pairs of field-name and field-value, such as '((\"Content-Type\" . \"application/xml\; charset=utf-8\") (\"Content-Length\" . \"2075\"))." (let* ((lines (split-string header-str "\r?\n")) - (status-line (car lines)) - (header-lines (cdr lines))) + (status-line (car lines)) + (header-lines (cdr lines))) (when (string-match "^\\(HTTP/1\.[01]\\) \\([0-9][0-9][0-9]\\) \\(.*\\)$" status-line) @@ -3179,29 +3441,29 @@ encoding, which we can generate as follows: For keys and values that are already unibyte, the `encode-coding-string' calls just return the same string." ;;; Return an HMAC-SHA1 authentication code for KEY and MESSAGE. -;;; +;;; ;;; KEY and MESSAGE must be unibyte strings. The result is a unibyte ;;; string. Use the function `encode-hex-string' or the function ;;; `base64-encode-string' to produce human-readable output. -;;; +;;; ;;; See URL: for more information ;;; on the HMAC-SHA1 algorithm. -;;; +;;; ;;; The Emacs multibyte representation actually uses a series of ;;; 8-bit values under the hood, so we could have allowed multibyte ;;; strings as arguments. However, internal 8-bit values don't ;;; correspond to any external representation \(at least for major ;;; version 22). This makes multibyte strings useless for generating ;;; hashes. -;;; +;;; ;;; Instead, callers must explicitly pick and use an encoding for ;;; their multibyte data. Most callers will want to use UTF-8 ;;; encoding, which we can generate as follows: -;;; +;;; ;;; (let ((unibyte-key (encode-coding-string key 'utf-8 t)) ;;; (unibyte-value (encode-coding-string value 'utf-8 t))) ;;; (hmac-sha1 unibyte-key unibyte-value)) -;;; +;;; ;;; For keys and values that are already unibyte, the ;;; `encode-coding-string' calls just return the same string. ;;; @@ -4060,7 +4322,7 @@ numeric character reference." (defun twittering-set-window-end (window pos) (let* ((height (window-text-height window)) - (n (- (- height 1)))) + (n (- (- height 1)))) (while (progn (setq n (1+ n)) (set-window-start window @@ -6991,7 +7253,7 @@ If the authorization failed, return nil." (let ((entry-list (apply 'append (mapcar (lambda (x) - (if (eq (car-safe x) 'entry) `(,x) nil)) + (if (eq (car-safe x) 'entry) `(,x) nil)) (cdar atom-xmltree))))) (mapcar 'twittering-atom-xmltree-to-status-datum entry-list))) @@ -7901,43 +8163,68 @@ icon mode; otherwise, turn off icon mode." icon and the value is a hash. The key of the child hash is URL and its value is the display property for the icon.") -(defvar twittering-convert-program (executable-find "convert")) -(defvar twittering-convert-fix-size 48) -(defvar twittering-use-convert (not (null twittering-convert-program)) - "*This variable makes a sense only if `twittering-convert-fix-size' -is non-nil. If this variable is non-nil, icon images are converted by -invoking \"convert\". Otherwise, cropped images are displayed.") +(defcustom twittering-convert-program (executable-find "convert") + "*A path of the command which is invoked for image conversion. -(defvar twittering-fallback-image-format 'xpm +The default is determined by searching \"convert\" in `exec-path'. +The command must be compatible with \"convert\" of ImageMagick." + :group 'twittering-mode + :type 'file) + +(defcustom twittering-convert-fix-size 48 + "*Size of an icon image. + +If nil, an icon image is displayed as is." + :group 'twittering-mode + :type '(choice (const nil) + integer)) + +(defcustom twittering-use-convert (not (null twittering-convert-program)) + "*If non-nil, use \"convert\" for converting or resizing icon images." + :group 'twittering-mode + :type 'boolean) + +(defcustom twittering-fallback-image-format 'xpm "*Fallback format used for displaying an image without a supproted format. Images which Emacs does not supports are converted into the fallback image -format.") +format." + :group 'twittering-mode + :type 'symbol) -(defvar twittering-use-profile-image-api nil +(defcustom twittering-use-profile-image-api nil "*Whether to use `profile_image' API for retrieving scaled icon images. -NOTE: This API is rate limited and is obsolete in the Twitter REST API v1.1.") +NOTE: This API is rate limited and is obsolete in the Twitter REST API v1.1." + :group 'twittering-mode + :type 'boolean) -(defvar twittering-icon-storage-file +(defcustom twittering-icon-storage-file (expand-file-name "~/.twittering-mode-icons.gz") "*The file to which icon images are stored. `twittering-icon-storage-limit' determines the number icons stored in the file. -The file is loaded with `with-auto-compression-mode'.") +The file is loaded with `with-auto-compression-mode'." + :group 'twittering-mode + :type 'file) -(defvar twittering-use-icon-storage nil +(defcustom twittering-use-icon-storage nil "*Whether to use the persistent icon storage. If this variable is non-nil, icon images are stored to the file specified -by `twittering-icon-storage-file'.") +by `twittering-icon-storage-file'." + :group 'twittering-mode + :type 'boolean) (defvar twittering-icon-storage-recent-icons nil "List of recently rendered icons.") -(defvar twittering-icon-storage-limit 500 +(defcustom twittering-icon-storage-limit 500 "*How many icons are stored in the persistent storage. If `twittering-use-icon-storage' is nil, this variable is ignored. If a positive integer N, `twittering-save-icon-properties' saves N icons that have been recently rendered. -If nil, the function saves all icons.") +If nil, the function saves all icons." + :group 'twittering-mode + :type '(choice (const nil) + integer)) (defconst twittering-error-icon-data-pair '(xpm . "/* XPM */ @@ -8998,7 +9285,9 @@ If FORMAT-STR is invalid as a format, an error is signaled and (defun twittering-format-status (status &optional prefix) "Format a STATUS by using `twittering-format-status-function'. -Specification of FORMAT-STR is described in the document for the +PREFIX is the prefix that will be added to the result of this function. +PREFIX is used in order to calculate appropriate width for filling texts. +Specification of the format is described in the document for the variable `twittering-status-format'." (funcall twittering-format-status-function status prefix)) @@ -10336,9 +10625,14 @@ Then, return non-nil if they has been satisfied and return nil otherwise." ;;;; Edit mode skeleton ;;;; -(defvar twittering-edit-skeleton-footer "") +(defcustom twittering-edit-skeleton-footer "" + "*String to be used as the footer in the edit skeleton." + :group 'twittering-mode + :type 'string) + (defvar twittering-edit-skeleton-footer-history nil) -(defvar twittering-edit-skeleton-alist + +(defcustom twittering-edit-skeleton-alist '((none . nil) (footer . ((nil _ twittering-edit-skeleton-footer))) (footer-only-normal @@ -10390,12 +10684,24 @@ If the value is a vector, each element is performed in order of elements in the vector. Note that the effective skeleton is invoked after inserting a -recipient.") -(defvar twittering-edit-skeleton 'none +recipient." + :group 'twittering-mode + :type 'alist) + +(defcustom twittering-edit-skeleton 'none "*A symbol specifying an effective skeleton. -It must be one of a symbol in `twittering-edit-skeleton-alist'. + +The list of valid value is defined in `twittering-edit-skeleton-alist'. +To be valid, an entry should be added to `twittering-edit-skeleton-alist' +first. + When entering `twittering-edit-mode', the skeletons in the specified -entry in `twittering-edit-skeleton-alist' are performed.") +entry in `twittering-edit-skeleton-alist' are performed." + :group 'twittering-mode + :type (if (> (length (mapcar #'car twittering-edit-skeleton-alist)) 0) + `(choice ,@(mapcar (lambda (entry) `(const ,(car entry))) + twittering-edit-skeleton-alist)) + 'symbol)) (defun twittering-switch-edit-skeleton () (interactive) @@ -11974,16 +12280,16 @@ Otherwise, return a positive integer less than POS." "Go to previous status of user." (interactive) (let ((user-name (twittering-get-username-at-pos (point))) - (prev-pos (point)) + (prev-pos (point)) (pos (twittering-get-previous-status-head (point)))) (while (and (not (eq pos nil)) - (not (eq pos prev-pos)) + (not (eq pos prev-pos)) (not (equal (twittering-get-username-at-pos pos) user-name))) (setq prev-pos pos) (setq pos (twittering-get-previous-status-head pos))) (if (and pos - (not (eq pos prev-pos)) - (equal (twittering-get-username-at-pos pos) user-name)) + (not (eq pos prev-pos)) + (equal (twittering-get-username-at-pos pos) user-name)) (goto-char pos) (if user-name (message "Start of %s's status." user-name) @@ -12165,7 +12471,7 @@ and a tweet is pointed, the URI to the tweet is insteadly pushed." `(cdr (assq ,y (nth 5 ,x)))))) (defun twittering-revive:twittering () - "Restore twittering-mode timeline buffer with `revive.el'. + "Restore `twittering-mode' timeline buffer with `revive.el'. The Emacs LISP program `revive.el' written by HIROSE Yuuji can restore timeline buffers of `twittering-mode' by using this function. There are two ways of configurations as follows; -- 2.47.3