From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: John Mastro Newsgroups: gmane.emacs.help Subject: Re: Disable warning from irony for PHP files Date: Wed, 14 Oct 2015 12:51:04 -0700 Message-ID: References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: ger.gmane.org 1444852382 16761 80.91.229.3 (14 Oct 2015 19:53:02 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 14 Oct 2015 19:53:02 +0000 (UTC) Cc: Sanjeev Sariya To: "help-gnu-emacs@gnu.org" Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Oct 14 21:53:01 2015 Return-path: Envelope-to: geh-help-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 1ZmS6e-0007ge-K4 for geh-help-gnu-emacs@m.gmane.org; Wed, 14 Oct 2015 21:53:00 +0200 Original-Received: from localhost ([::1]:44271 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZmS6e-0001x9-3G for geh-help-gnu-emacs@m.gmane.org; Wed, 14 Oct 2015 15:53:00 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:44388) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZmS57-0001R2-Eq for help-gnu-emacs@gnu.org; Wed, 14 Oct 2015 15:51:26 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZmS56-00070U-Gl for help-gnu-emacs@gnu.org; Wed, 14 Oct 2015 15:51:25 -0400 Original-Received: from mail-yk0-x22e.google.com ([2607:f8b0:4002:c07::22e]:35024) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZmS56-0006ze-CL for help-gnu-emacs@gnu.org; Wed, 14 Oct 2015 15:51:24 -0400 Original-Received: by ykaz22 with SMTP id z22so32278384yka.2 for ; Wed, 14 Oct 2015 12:51:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=JmN/gzTlF2rywxjvTlU1f8DWTGdvvlO35C9yNdJz3cE=; b=CYcbwGTq2TlwFh94ae2M2tRAZ+gm9sumV8Plv6XkXBlny4UTM9KXMFjCgGYYXlShu2 +SIav6+wXN+wRmTtnsjmLITpuEGVrqdO01jLP1dwYkzCdKc5mTyOc34um8NarSTsILfQ DTCXipY6S7wBKMiwlJgtC5/igW4pvvE0C7fHlMgdEtNpJN/R32lDefliu6FPaQHXEtr6 KYRfkFcEYG24hCbGU3TiU3nRh6+/kM9heCugSpMyh/RzQC7gUC10dULpcmFAUYtdllym lVQPhwQDecPzzmJmFApXwmvgWF4d7wWo3upNsZJi2ZOqMybkGmOHyfG3yWcy8G/gQnSv 08Fw== X-Received: by 10.129.41.65 with SMTP id p62mr4179899ywp.91.1444852283898; Wed, 14 Oct 2015 12:51:23 -0700 (PDT) Original-Received: by 10.37.214.143 with HTTP; Wed, 14 Oct 2015 12:51:04 -0700 (PDT) In-Reply-To: X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2607:f8b0:4002:c07::22e X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 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-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:107644 Archived-At: Sanjeev Sariya wrote: > I've irony, and company-irony mode added in my init.el, for which > init.el looks like: > > (eval-after-load 'company > '(add-to-list 'company-backends 'company-irony)) > > (require 'irony) > (add-hook 'after-init-hook #'global-company-mode) > (add-hook 'c++-mode-hook 'irony-mode) > (add-hook 'c-mode-hook 'irony-mode) > > When I open alpha.php, I get following warning: > > Warning (irony): Major mode is unknown to Irony, see > `irony-supported-major-modes'. > > I know irony doesn't support php file. How can I disable irony to work > while working with .php or any other language, or say restrict it to > c, cpp, .h, .hpp files? I'm guessing it's because `company-irony' is being added to the global `company-backends'. That's harmless (it won't produce any results, so another backend will be used), but you could instead configure things like this to avoid the warning: (require 'irony) (add-hook 'after-init-hook #'global-company-mode) (defun my-company-irony () (irony-mode) (unless (memq 'company-irony company-backends) (setq-local company-backends (cons 'company-irony company-backends)))) (add-hook 'c-mode-hook #'my-company-irony) (add-hook 'c++-mode-hook #'my-company-irony) The idea is that, instead of modifying the global `company-backends', you give it a separate value in c-mode and c++-mode buffers and add the `company-irony' backend there. -- john