dakrone / es-mode

An Emacs major mode for interacting with Elasticsearch
GNU General Public License v3.0
195 stars 34 forks source link

es-command-center cause other package url request error #63

Open stardiviner opened 6 years ago

stardiviner commented 6 years ago

After I execute command [M-x es-command-center]. Then I open sx.el (An Stack Exchange in Emacs client). Emacs reports error:

Debugger entered--Lisp error: (wrong-number-of-arguments #f(compiled-function (plist-a &rest plist-b) #<bytecode 0x5b2aa35>) 0)
  es-cc--plist-merge()
  -reduce(es-cc--plist-merge nil)
  es-cc--build-map-from-nodes-stats("{\"error\":\"Content-Type header [application/x-www-form-urlencoded] is not supported\",\"status\":406}")
  es-cc--process-nodes-stats((:error (error http 406)) "*ES-CC: http://localhost:9200/*")
  apply(es-cc--process-nodes-stats ((:error (error http 406)) "*ES-CC: http://localhost:9200/*"))
  url-http-activate-callback()
  url-http-content-length-after-change-function(118 236 118)
  url-http-wait-for-headers-change-function(1 241 240)
  url-http-generic-filter(#<process localhost<6>> "HTTP/1.1 406 Not Acceptable\015\ncontent-type: application/json; charset=UTF-8\015\ncontent-encoding: gzip\015\ncontent-length: 117\015\n\015\n\037\213\010\0\0\0\0\0\0\0\004\301\261\n\2040\f\0\320_\011\231-:\210\203\353\375\202\2338\024\233\343\n^\022\322\224*\342\277\373\336\215d&\2063~\204\235\330\303r)\301\217b\"\2035\252\036y\217\236\205\3733\264\326\302W\354\037\252\035\304\273$J\033\344\002,\016\245\252\2129%\354\260x\364Zp\036\207\351y\001\0\0\377\377\003\0\333\235<\005a\0\0\0")
  accept-process-output(#<process api.stackexchange.com> 1)
  url-retrieve-synchronously("https://api.stackexchange.com/2.2/search/advanced?site=emacs")
  sx-request-make("search/advanced?site=emacs" ((pagesize . 100) (filter . "!OflFMmBkiTqeGnV(4AGdFUBcUpzPXn0GvCrDO8J0Noj") (page . 1) (q) (tagged) (nottagged) (order . desc) (sort . activity)) get sx-request-response-get-items)
  sx-method-call(search/advanced :keywords ((page . 1) (q) (tagged) (nottagged) (order . desc) (sort . activity)) :site "emacs" :auth t :filter ((question\.body_markdown question\.bounty_amount question\.comments question\.creation_date question\.closed_reason question\.closed_date question\.closed_details question\.answers question\.answer_count question\.score question\.title question\.owner question\.tags question\.last_editor question\.last_activity_date question\.accepted_answer_id question\.link question\.upvoted question\.downvoted question\.question_id question\.share_link user\.display_name user\.link user\.accept_rate user\.reputation shallow_user\.display_name shallow_user\.link shallow_user\.accept_rate shallow_user\.reputation comment\.owner comment\.body_markdown comment\.body comment\.link comment\.edited comment\.creation_date comment\.upvoted comment\.score comment\.post_type comment\.post_id comment\.comment_id answer\.answer_id answer\.creation_date answer\.last_editor answer\.last_activity_date answer\.link answer\.share_link answer\.score answer\.owner answer\.body_markdown answer\.upvoted answer\.downvoted answer\.comments \.backoff \.error_id \.error_message \.error_name \.has_more \.items \.page \.page_size \.quota_max \.quota_remaining) nil nil))
  sx-search-get-questions("emacs" 1 nil nil nil (order . desc) (sort . activity))
  #f(compiled-function (page) #<bytecode 0x33e56d5>)(1)
  sx-question-list-refresh(redisplay)
  sx-search("emacs" nil nil nil)
  funcall-interactively(sx-search "emacs" nil nil nil)
  call-interactively(sx-search nil nil)
  #f(compiled-function (cmd &optional record-flag keys special) "Execute CMD as an editor command.\nCMD must be a symbol that satisfies the `commandp' predicate.\nOptional second arg RECORD-FLAG non-nil\nmeans unconditionally put this command in the variable `command-history'.\nOtherwise, that is done only if an arg is read using the minibuffer.\nThe argument KEYS specifies the value to use instead of (this-command-keys)\nwhen reading the arguments; if it is nil, (this-command-keys) is used.\nThe argument SPECIAL, if non-nil, means that this command is executing\na special event, so ignore the prefix argument and don't clear it." #<bytecode 0x24e27b>)(sx-search nil nil nil)
  ad-Advice-command-execute(#f(compiled-function (cmd &optional record-flag keys special) "Execute CMD as an editor command.\nCMD must be a symbol that satisfies the `commandp' predicate.\nOptional second arg RECORD-FLAG non-nil\nmeans unconditionally put this command in the variable `command-history'.\nOtherwise, that is done only if an arg is read using the minibuffer.\nThe argument KEYS specifies the value to use instead of (this-command-keys)\nwhen reading the arguments; if it is nil, (this-command-keys) is used.\nThe argument SPECIAL, if non-nil, means that this command is executing\na special event, so ignore the prefix argument and don't clear it." #<bytecode 0x24e27b>) sx-search)
  apply(ad-Advice-command-execute #f(compiled-function (cmd &optional record-flag keys special) "Execute CMD as an editor command.\nCMD must be a symbol that satisfies the `commandp' predicate.\nOptional second arg RECORD-FLAG non-nil\nmeans unconditionally put this command in the variable `command-history'.\nOtherwise, that is done only if an arg is read using the minibuffer.\nThe argument KEYS specifies the value to use instead of (this-command-keys)\nwhen reading the arguments; if it is nil, (this-command-keys) is used.\nThe argument SPECIAL, if non-nil, means that this command is executing\na special event, so ignore the prefix argument and don't clear it." #<bytecode 0x24e27b>) sx-search)
  command-execute(sx-search)

After I killed this es-command-center buffer, and cancel the corresponding timer. Problem fixed. Is there a better way to implement this es-command-center?

dakrone commented 6 years ago

Okay, I'm able to reproduce this, I'll look into this, thanks @stardiviner