From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Danny YUE Newsgroups: gmane.emacs.help Subject: Re: help correcting web-mode configuration Date: Sun, 12 Mar 2017 21:26:08 +0800 Message-ID: <87efy2d3tb.fsf@gmail.com> References: <8737ei28k7.fsf@gmail.com> <4aa2cd16-09f4-f786-eab5-cd0456911ee3@openmailbox.org> <87inneade1.fsf@gmail.com> <15149b53-695b-bcc9-567b-5c44eabf02ca@openmailbox.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1489325258 1575 195.159.176.226 (12 Mar 2017 13:27:38 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 12 Mar 2017 13:27:38 +0000 (UTC) User-Agent: mu4e 0.9.18; emacs 25.2.1 Cc: "help-gnu-emacs@gnu.org" , Danny YUE To: Krishnakant Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun Mar 12 14:27:33 2017 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cn3X0-0007yz-93 for geh-help-gnu-emacs@m.gmane.org; Sun, 12 Mar 2017 14:27:30 +0100 Original-Received: from localhost ([::1]:47090 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cn3X6-0001PS-6z for geh-help-gnu-emacs@m.gmane.org; Sun, 12 Mar 2017 09:27:36 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:33881) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cn3Wg-0001PB-9v for help-gnu-emacs@gnu.org; Sun, 12 Mar 2017 09:27:11 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cn3Wd-0005XR-5T for help-gnu-emacs@gnu.org; Sun, 12 Mar 2017 09:27:10 -0400 Original-Received: from mail-pf0-x242.google.com ([2607:f8b0:400e:c00::242]:35214) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cn3Wc-0005XL-Vw for help-gnu-emacs@gnu.org; Sun, 12 Mar 2017 09:27:07 -0400 Original-Received: by mail-pf0-x242.google.com with SMTP id 67so16099583pfg.2 for ; Sun, 12 Mar 2017 06:27:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=references:user-agent:from:to:cc:subject:in-reply-to:date :message-id:mime-version; bh=0P/H8gADWLIonTLeY1ZIzT0Ct8yRtq9ysa/7WgAYqaw=; b=ToWNX+rTonyvCMRZuZnj7jWycM13AiybfOUrLTZmqGdA1l0iEUwDAGqqolR6b8C2su wpl1jwwNaAsQ925JlcFvsgBTQjBk0rq9z384dHQdSKt/KoGL0+ps7Zle/nOrywYVVUEJ RTEzRzA/oj8WD2Zs+6Ka6CbIUDgmPwzU2TuKagdKFtXHQ7om8l3PpHhM3XKeRJHfMDLs L4vdfJ69MiwXcCerl1ijN5HMG75c8nkmKUTT6YMHE1nMFulvKVLdcrHFjD/Z0CzMyxSF nIxWNiJRiU0uk5HeVE8/eABBwx/Qth2NxpISrDfL/fmr+/6v06YeH57C1IlvhW/w4q/K OvZg== 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:cc:subject :in-reply-to:date:message-id:mime-version; bh=0P/H8gADWLIonTLeY1ZIzT0Ct8yRtq9ysa/7WgAYqaw=; b=cZh8e6cI3DUg0m655ofAXlfFWkeN31kyi+q6XF6HJHRkSqwI9dHfl+mPZJKARBvMcM Gqh2MlvSEnLR8kn5lcDFJzOUtyRiZQGaj4RnSf//6F1adL/Np5mSwYj/gpXbXoeKrFhS xnmr/yDx3eWnEnuIejgmPmZoepzD1QQ5UM3dH+XV7w7TTbAiYn3UYPjfSIaJ5CLkK+rK UBTDYh3cgPWtl0CfJJuPZJ649wJ2EuRedw/QiTtbWexmkK4uF2xI5r3Lu2fkzsHvVtey NPyJLLR1mSYUz2LkXfPq5gIfqAQmpNSLAfmqrbDVa6sWZplVvTeZ9M+ZHKeC+RomlWz8 /0cA== X-Gm-Message-State: AMke39kXBphRHW6LGEtD/GMeh7K3J6tMZiKv9xTxu+yLLdtCvATMt8FtDZ4lChFK5uh5mQ== X-Received: by 10.99.103.133 with SMTP id b127mr31615480pgc.29.1489325225937; Sun, 12 Mar 2017 06:27:05 -0700 (PDT) Original-Received: from localhost (23.83.238.120.16clouds.com. [23.83.238.120]) by smtp.gmail.com with ESMTPSA id s20sm28545867pfg.11.2017.03.12.06.27.03 (version=TLS1_2 cipher=AES128-GCM-SHA256 bits=128/128); Sun, 12 Mar 2017 06:27:04 -0700 (PDT) In-reply-to: <15149b53-695b-bcc9-567b-5c44eabf02ca@openmailbox.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2607:f8b0:400e:c00::242 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.21 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.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.org gmane.emacs.help:112549 Archived-At: But it seems to be correct, isn't it? Because anyway the company-mode returns something that seems reasonable. What's exactly your problem now? The completion does not start automatically or something? Danny On 2017-03-12 12:43, Krishnakant wrote: > Sorry my stupidity, > > I hadn't started typing when I did company-diag. > > here is the output when I try to start > > Used backend: company-web-html > Prefix: "htm" > Completions: > #("html" 0 4 (annotation "html")) " -> html" > > > I guess the completions are not correct. > > Happy hacking. > > Krishnakant. > > > On Sunday 12 March 2017 05:57 PM, Danny YUE wrote: >> This is really strange... >> >> You see, if 'company-diag' says that your back-end gives no completion, >> which is actually wrong because 'company-web-something' does work as you >> said... >> >> Wait, why the "Prefix" is nil? It should be a string storing the >> characters you have typed when invoking the command. >> >> In Emacs Lisp mode if I type "(add" then invoke 'company-diag, I get: >> Prefix: "add" >> which is correct... >> >> By the way are you using this pacakge? >> https://github.com/osv/company-web >> >> Danny >> >> On 2017-03-12 10:27, Krishnakant wrote: >>> Hi Danny >>> >>> >>> >>> On Sunday 12 March 2017 02:09 PM, Danny YUE wrote: >>>> Hi, >>>> >>>> I barely use web-mode because I seldom write HTML etc, but I use >>>> company-mode a lot and find it sometimes tricky to setup. >>>> >>>> I noticed that you set company-backends locally, but you have to make >>>> sure it's actually being called. >>>> >>>> You can tackle it down by 2 steps: >>>> 1. Try command 'company-web-html' or something provided by your company >>>> web-mode package. If it's giving you the completions, this step is >>>> passed. Otherwise, you have problem setting up the package itself. >>>> >>>> >>>> 2. Try command 'company-diag' to see what back-end it's using currently, >>>> and if the back-end it's using is not what you want, maybe you have to >>>> set the company-backends without append. For example: >>>> >>>> (defun web-mode-setup-company () >>>> (make-local-variable 'company-backends) >>>> (setq company-backends '(company-web-html))) >>>> (add-hook 'web-mode-hook 'web-mode-setup-company) >>>> >>> This is the output from company-diag >>> >>> Used backend: company-web-html >>> Prefix: nil >>> Completions: none >>> I get same result of company-diag even after adding your code to init.el >>> Happy hacking. >>> Krishnakant. >>