From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Bjarte Johansen Newsgroups: gmane.emacs.bugs Subject: bug#22855: 24.5; `url-mime-accept-string' not set in asynchronous call Date: Mon, 29 Feb 2016 17:39:08 +0000 Message-ID: <8DA46E18-FE72-4CE2-9BFA-E49F22A5A841@gmail.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 (Mac OS X Mail 9.2 \(3112\)) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1456768825 1504 80.91.229.3 (29 Feb 2016 18:00:25 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 29 Feb 2016 18:00:25 +0000 (UTC) To: 22855@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Feb 29 19:00:14 2016 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1aaS7A-00073R-SB for geb-bug-gnu-emacs@m.gmane.org; Mon, 29 Feb 2016 19:00:13 +0100 Original-Received: from localhost ([::1]:38177 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aaS7A-0000Hp-G8 for geb-bug-gnu-emacs@m.gmane.org; Mon, 29 Feb 2016 13:00:12 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:49340) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aaS75-0000ED-TD for bug-gnu-emacs@gnu.org; Mon, 29 Feb 2016 13:00:09 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aaS70-00059o-P0 for bug-gnu-emacs@gnu.org; Mon, 29 Feb 2016 13:00:07 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:56856) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aaS70-00059j-MJ for bug-gnu-emacs@gnu.org; Mon, 29 Feb 2016 13:00:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84) (envelope-from ) id 1aaS70-0002Bb-HM for bug-gnu-emacs@gnu.org; Mon, 29 Feb 2016 13:00:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Bjarte Johansen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 29 Feb 2016 18:00:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 22855 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.14567687658323 (code B ref -1); Mon, 29 Feb 2016 18:00:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 29 Feb 2016 17:59:25 +0000 Original-Received: from localhost ([127.0.0.1]:53983 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aaS6P-0002AB-DF for submit@debbugs.gnu.org; Mon, 29 Feb 2016 12:59:25 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:52425) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aaRn2-0001el-PA for submit@debbugs.gnu.org; Mon, 29 Feb 2016 12:39:25 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aaRmw-0000Aj-7t for submit@debbugs.gnu.org; Mon, 29 Feb 2016 12:39:19 -0500 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:38678) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aaRmw-0000Ae-4O for submit@debbugs.gnu.org; Mon, 29 Feb 2016 12:39:18 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:43394) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aaRmu-0002mE-Eg for bug-gnu-emacs@gnu.org; Mon, 29 Feb 2016 12:39:18 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aaRmq-000089-CM for bug-gnu-emacs@gnu.org; Mon, 29 Feb 2016 12:39:16 -0500 Original-Received: from mail-wm0-x22f.google.com ([2a00:1450:400c:c09::22f]:33556) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aaRmp-00007u-S1 for bug-gnu-emacs@gnu.org; Mon, 29 Feb 2016 12:39:12 -0500 Original-Received: by mail-wm0-x22f.google.com with SMTP id l68so1466255wml.0 for ; Mon, 29 Feb 2016 09:39:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:content-transfer-encoding:subject:message-id:date:to :mime-version; bh=I4SYsfObzKpXkQ+nG8CMFyY8qIEAgvocC+n03S4avrA=; b=slRi2hK6guMvvwY9W/wSxLl4uOXP1ONa3q3Dsob7sdwqpisPN3cztiQt2cnfPxUG1w TE9aKdGHaPFgsdCBNbP2er4sXWs5oVB3QEKM58bHSkussbngBHSGp6ihli+BuUqVDCKS ab/wZJQG0dMqSjwbfelSIv+1IXX+ulNThmF73/bxmJ8DjidWU8JX6dMYGvvfeOkFEZ0d Wxz8+y0ZQyEixUTKRCGFzQrnu73U9hkgWA19EfBpmaufqESiEno4xBh12Hw0SunDETxL yDE2LniXoccLdxcmm0tFq9L0KwOxPRgrCg/AMx81Ilmrnu4LGn2AiDWrG4ouQVeswCzp 7Kgw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:content-transfer-encoding:subject :message-id:date:to:mime-version; bh=I4SYsfObzKpXkQ+nG8CMFyY8qIEAgvocC+n03S4avrA=; b=cUf4XZUQujj4tkD0gNm28Aw9rYFZeHvvJcQZUCL+KKdd+03LYMRmGLBhAPSbgbwfZc i9K8D/QlxkebZhfxjQHzGzG3PV7KmyPKQmfy89UAMP64Uo5+vSSguFnBlUSeqwVkV8Eb W0Z6/ZUdtFiT7BlTVrEIp6oK1aMR2X24mrZxrTaDNnAm1zD/7ZgmJNX+yQIgeYktGlAt YW78tB3GCZgbevI+plgrFOouRu+aaBiZ0+QJj3A9cxKES8H+Jg4UghXrFrHIum1lyoAl belIMar0OoKmaIMq32K1WLmvZcvDcgSynEHedCyKjVWt/c9qsQ8/QZ6LBmud4KtQAE2H vuhQ== X-Gm-Message-State: AD7BkJJlQ9gBM4JvlY3qNWq+kMxdRpteetaJplHJmMm3SWk+XJXTZupR4SSg+fPFLR1Ctg== X-Received: by 10.28.184.137 with SMTP id i131mr2358011wmf.96.1456767550524; Mon, 29 Feb 2016 09:39:10 -0800 (PST) Original-Received: from [137.108.121.61] ([137.108.121.61]) by smtp.gmail.com with ESMTPSA id g126sm17360032wmf.16.2016.02.29.09.39.08 for (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 29 Feb 2016 09:39:08 -0800 (PST) X-Mailer: Apple Mail (2.3112) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Mailman-Approved-At: Mon, 29 Feb 2016 12:59:24 -0500 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:114152 Archived-At: Hi, Sending a http request asynchronously through url-retrieve I am not (always) able to dynamically bind url-mime-accept-string so I can set the Accept header. Setting url-request-extra-headers does not help as url-http-create-request sets "Accept: */*" and overrides any headers I would set in url-request-extra-headers. Example code: (let ((url-debug t) (url-request-method "POST") (url-request-extra-headers `(("Content-Type" . "application/x-www-form-urlencoded"))) (url-request-data = "query=3DSELECT%20%3FC%20WHERE%20%7B%5B%5D%20a%20%3FC%7D%20LIMIT%201%0A") (url-mime-accept-string "text/csv")) (url-retrieve "http://live.dbpedia.org/sparql/" #'(lambda (_) (message (buffer-string))))) This will sometimes return a csv file and sometimes an xml file (usually the first time). In *URL-DEBUG* you can see that the Accept header is not properly set. I believe that it fails as url-http-create-request is called in the asynchronous context and can therefore, sometimes, escape the let binding. In GNU Emacs 24.5.1 (x86_64-apple-darwin15.2.0, NS apple-appkit-1404.34) of 2016-01-18 on reventlov.local Windowing system distributor `Apple', version 10.3.1404 Configured using: `configure --prefix=3D/usr/local/Cellar/emacs/24.5 --enable-locallisppath=3D/usr/local/share/emacs/site-lisp --infodir=3D/usr/local/Cellar/emacs/24.5/share/info/emacs --with-xml2 --without-dbus --with-gnutls --with-ns --disable-ns-self-contained' Important settings: value of $LANG: en_US.UTF-8 locale-coding-system: utf-8-unix Major mode: Emacs-Lisp Minor modes in effect: helm-mode: t shell-dirtrack-mode: t smartparens-strict-mode: t smartparens-mode: t eldoc-mode: t elisp-slime-nav-mode: t highlight-symbol-nav-mode: t highlight-symbol-mode: t window-number-mode: t persp-mode: t projectile-global-mode: t projectile-mode: t global-company-mode: t company-mode: t show-paren-mode: t override-global-mode: t tooltip-mode: t electric-indent-mode: t mouse-wheel-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t column-number-mode: t line-number-mode: t transient-mark-mode: t Recent messages: Searching for url-http-create-request... Mark set Mark saved where search started user-error: No further undo information [2 times] Mark set Saving file = /usr/local/Cellar/emacs/24.5/share/emacs/24.5/lisp/url/url-http.el.gz... compressing url-http.el.gz...done Wrote = /usr/local/Cellar/emacs/24.5/share/emacs/24.5/lisp/url/url-http.el.gz Mark saved where search started Quit Features: (shadow mail-extr emacsbug sendmail misearch multi-isearch jka-compr eieio-opt speedbar sb-image ezimage dframe find-func view sort mm-archive message rfc822 mml mml-sec mailabbrev gmm-utils mailheader mm-decode mm-bodies mm-encode mail-utils network-stream starttls url-cache sparql-mode derived url-handlers url-http tls url-auth mail-parse rfc2231 rfc2047 rfc2045 ietf-drums url-gw helm-command helm-elisp helm-eval edebug image-file vc-git winner exec-path-from-shell helm-mode helm-projectile helm-files rx image-dired tramp tramp-compat tramp-loaddefs trampver shell pcomplete format-spec dired-x dired-aux ffap helm-tags helm-bookmark helm-adaptive helm-info bookmark pp helm-external helm-net browse-url xml url url-proxy url-privacy url-expand url-methods url-history url-cookie url-domsuf url-util url-parse auth-source gnus-util mm-util mail-prsvr password-cache url-vars mailcap helm-buffers helm-grep helm-regexp helm-plugin helm-elscreen helm-utils helm-locate helm-help helm-types helm helm-source eieio eieio-core helm-multi-match helm-lib dired smartparens-config smartparens eldoc elisp-slime-nav help-mode highlight-symbol finder-inf clojure-mode align imenu window-number smart-mode-line-respectful-theme smart-mode-line mule-util rich-minority saveplace persp-projectile cl-macs perspective cl gv byte-opt projectile advice help-fns grep compile comint ansi-color ibuf-ext ibuffer dash thingatpt company-oddmuse company-keywords company-etags etags ring company-gtags company-dabbrev-code company-dabbrev company-files company-capf company-cmake company-xcode company-clang company-semantic company-eclim company-template company-css company-nxml company-bbdb company pcase paren edmacro kmacro sanityinc-tomorrow-night-theme color-theme-sanityinc-tomorrow use-package diminish bytecomp byte-compile cl-extra cconv bind-key easy-mmode cl-loaddefs cl-lib go-mode-autoloads slime-autoloads info easymenu package epg-config time-date tooltip electric uniquify ediff-hook vc-hooks lisp-float-type mwheel ns-win tool-bar dnd fontset image regexp-opt fringe tabulated-list newcomment lisp-mode prog-mode register page menu-bar rfn-eshadow timer select scroll-bar mouse jit-lock font-lock syntax facemenu font-core frame cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese case-table epa-hook jka-cmpr-hook help simple abbrev minibuffer nadvice loaddefs button faces cus-face macroexp files text-properties overlay sha1 md5 base64 format env code-pages mule custom widget hashtable-print-readable backquote make-network-process cocoa ns multi-tty emacs) Memory information: ((conses 16 309551 388578) (symbols 48 37911 23) (miscs 40 186 1720) (strings 32 77048 171324) (string-bytes 1 2244791) (vectors 16 31697) (vector-slots 8 604233 182119) (floats 8 160 1012) (intervals 56 3074 2395) (buffers 960 35))