From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Partha Pratim Ghosh Newsgroups: gmane.emacs.help Subject: Re: Garbled up html output Date: Sun, 22 Nov 2020 23:07:22 +0200 Message-ID: <87sg915cdx.fsf@gmail.com> References: <87k0ue1g4y.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="5941"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: mu4e 1.2.0; emacs 26.3 Cc: Help Gnu Emacs To: Pankaj Jangid Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Sun Nov 22 22:07:56 2020 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kgwaS-0001SX-E3 for geh-help-gnu-emacs@m.gmane-mx.org; Sun, 22 Nov 2020 22:07:56 +0100 Original-Received: from localhost ([::1]:43710 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kgwaR-0002S9-HM for geh-help-gnu-emacs@m.gmane-mx.org; Sun, 22 Nov 2020 16:07:55 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:51052) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kgwa1-0002Qn-E1 for help-gnu-emacs@gnu.org; Sun, 22 Nov 2020 16:07:29 -0500 Original-Received: from mail-ej1-x636.google.com ([2a00:1450:4864:20::636]:42552) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kgwZz-0001mj-AN for help-gnu-emacs@gnu.org; Sun, 22 Nov 2020 16:07:29 -0500 Original-Received: by mail-ej1-x636.google.com with SMTP id i19so20505815ejx.9 for ; Sun, 22 Nov 2020 13:07:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=references:user-agent:from:to:subject:cc:in-reply-to:date :message-id:mime-version; bh=Mv/VTB//OURbKVKHrErqxa9FOZi1NnvH/e6pae1pvlQ=; b=oE047biS0sfqvi+4Vw/GBzrm+7XgRuuHJpvP6+eNKU/vr5jE/fJ465Vy+rzEx0J8lX 6js/oV090NTZFjyNDn/bDoGaXi82HhyT2DAywNrXrGcM9StGdwcuwvtNRkd2N+XAUdCv uKapGeki4oJk/l8ujsv/a0Zx4hK3mwSGvzjL3bV9NLBbURcsmA1GMM5yDgDkvnPm3HP2 v4M6YhdavdAgSlJ3vFkUHDhdws87AqMhVwKRAoRoBrCa64N87+xixBS6QqgCYtyPYunH +xFzRCT1wcNoIoKEaq0n2BajJbD02GSD22LvVvd6CsqyqCE7VCfY+mS6EhHqJyP93cel oE7Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:references:user-agent:from:to:subject:cc :in-reply-to:date:message-id:mime-version; bh=Mv/VTB//OURbKVKHrErqxa9FOZi1NnvH/e6pae1pvlQ=; b=aOxvRZsGHYniVD3njgrdKgPFbu5engrZSshQBaAnUJQhWCymhc5w8lqunzIV65vjKo 7Q1MVpVjonhY2dajPc9wlgwzgV9AP17Umou+FHASUnGtf4Sh4Ds8QStRt7cWE5rHUJYU LSVNbKmca/NoXmzcnkNXTEbq9IqVeOcEefj5eqNfW+wy2gBwCfBz7QwZlkAz9r/CVE4n BDGqxXqK5bLR9XMTTL9tUCBCIJ6pEho9VKnPBVD5CdqpCyyAvw1j0iaQCDMvSDjYdwU/ DlDV2poy3yLThnRZbEIQZiCJYGTNlO3XD/yWcmnC+95nhfizOyCjXsa6d3/CjfXIVhrv BsQw== X-Gm-Message-State: AOAM531YSXr5Is0J04diNPnWMu5049ySpHPNtpqvSCgWonXwdYKTEY2p O4Le+8G27cypX6fWifvDj8M= X-Google-Smtp-Source: ABdhPJxe2AMJmnTSoj+cJAJQYEEkyTLU1NPcSRnqpkNaVt55TYOjXWCFyICrNevzGxK+8Z8QZoziCA== X-Received: by 2002:a17:906:3daa:: with SMTP id y10mr40786839ejh.23.1606079245722; Sun, 22 Nov 2020 13:07:25 -0800 (PST) Original-Received: from localhost (165-73-58-71.ip.afrihost.joburg. [165.73.58.71]) by smtp.gmail.com with ESMTPSA id h20sm3985317edw.12.2020.11.22.13.07.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 22 Nov 2020 13:07:24 -0800 (PST) In-reply-to: Received-SPF: pass client-ip=2a00:1450:4864:20::636; envelope-from=ghosh.parthapratim.unisa@gmail.com; helo=mail-ej1-x636.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.io gmane.emacs.help:125490 Archived-At: Dear Pankaj, Please accept my thanks for replying to the query. I tried to run your script from .emacs file. After this I tried _M-x wttrin_ and it returned the error: wrong argument type listp: "en-US,en;q=0.8,zh-CN;q=0.6,zh;q=0.4" Please can you suugest further changes and/help... With my regards and all the very best wishes, partha Pankaj Jangid writes: > Partha Pratim Ghosh writes: > >> I used _curl wttr.in_ on a terminal; it produced a nice formatted >> message. >> >> However _M-x wttrin_ inside emacs produces a buffer with html text; the >> table appears way down, but the output is not formatted. > > The package is not updated. Following two fragments need update. I have > also created a pull request on github and cc'ing the maintainer here. > > #+begin_src emacs-lisp > (defcustom wttrin-default-accept-language "en-US,en;q=0.8,zh-CN;q=0.6,zh;q=0.4" > "Specify default HTTP request Header for Accept-Language." > :group 'wttrin > :type '(list) > ) > > (defun wttrin-fetch-raw-string (query) > "Get the weather information based on your QUERY." > (let ((url-user-agent "curl") > (url-mime-language-string wttrin-default-accept-language)) > (with-current-buffer > (url-retrieve-synchronously > (concat "http://wttr.in/" query) > (lambda (status) (switch-to-buffer (current-buffer)))) > (decode-coding-string (buffer-string) 'utf-8)))) > #+end_src