From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.devel Subject: Re: exposing the effective mode in a multi-mode Date: Thu, 21 Sep 2017 17:19:52 +0300 Message-ID: <964f1d15-9a2c-8059-a3db-1699fd35d172@yandex.ru> References: <874ls0c40s.fsf@tromey.com> <7db25c04-9899-605a-e349-016b2a78d92e@yandex.ru> <87lgla9f57.fsf@tromey.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: blaine.gmane.org 1506003655 12683 195.159.176.226 (21 Sep 2017 14:20:55 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 21 Sep 2017 14:20:55 +0000 (UTC) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:56.0) Gecko/20100101 Thunderbird/56.0 Cc: Emacs discussions To: Tom Tromey Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Sep 21 16:20:48 2017 Return-path: Envelope-to: ged-emacs-devel@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 1dv2LL-0002Z9-Dk for ged-emacs-devel@m.gmane.org; Thu, 21 Sep 2017 16:20:43 +0200 Original-Received: from localhost ([::1]:53951 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dv2LS-0001RX-R0 for ged-emacs-devel@m.gmane.org; Thu, 21 Sep 2017 10:20:50 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:45031) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dv2Kg-0001MQ-St for emacs-devel@gnu.org; Thu, 21 Sep 2017 10:20:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dv2Kc-0000yx-QR for emacs-devel@gnu.org; Thu, 21 Sep 2017 10:20:02 -0400 Original-Received: from mail-wr0-x231.google.com ([2a00:1450:400c:c0c::231]:45664) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dv2Kc-0000xf-Jd for emacs-devel@gnu.org; Thu, 21 Sep 2017 10:19:58 -0400 Original-Received: by mail-wr0-x231.google.com with SMTP id m18so4700230wrm.2 for ; Thu, 21 Sep 2017 07:19:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=95QnlkQeC2sqMcRzM1FQ8IJJBeWVamgQi57CDhXGfXQ=; b=vWdDXdymRo7jHxdHwekssMLL62hhkF7v84riPBtgsmCOiJyXqvhaLBsA0Py5sYoUyX Jdcd57N1xdepOjJPgRJiYt4Fk25ahNL6qOZZBZ7D+2Z8+uLDbj0QmaaNpI6PlFvm9mwr dZ37TvV/LJagTrogtXiVzbEkFkH10S64CePaXF+Jbsso3tFe0MoKvOpfMgzeOyR4KkC6 6eUtyAqGf2DsjRYOdFdch3pK/e3fgIYRVATRzhJmNGKFsNxRPFY0W6iQC0BYZvjxX/8c Q+T+UX0sjQFzc85gQJ9SRThcgkWV1JdvFhVLyMPjooZC3pJ/LMjVx+NDnX8/w7jTHuZo Ffzw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:subject:to:cc:references:from:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=95QnlkQeC2sqMcRzM1FQ8IJJBeWVamgQi57CDhXGfXQ=; b=EQ3NZMmZfO+yH+dtFHuhlMgFc+rzsyqy1dmigyao5xU/d9qsjuoWMKjePWcG2HOrmu 4s2SIEuf3tuCgHJ2XjOvbajfWtvZ2/3mcgdfS3u1GKuGeY8d5jnHsRRJBgsvC6AvwcNY RY89ULv1yjnS/zCVTqaoM6B6nsxAsKQ8P93yTGE1Ez1m0HIERYIGO73GaopuCsTcqju/ F+SoLD/ar4/80fzbeZxC5d8Sz9TFaHyK1aixMuQK6KHdotOg3rCC5+ElkV44r6YvxQjX iZO/7FK2kEXuxrEejblwwVNTsvg8vtZSru4j8Zh4l+bI7JO0IjxtxodVDz5KHynXU/R0 8WrA== X-Gm-Message-State: AHPjjUhYnfoZr5t8UFwaxWVGU7mhQrkdI/TGFgjx9misd+YX5fGrTk8E qj4MfoTw9535/dbck3IEN/kyrwpY X-Google-Smtp-Source: AOwi7QCZSOJdGf1CMrrLxzFvt126/7ce50dAdQPnYjRqcA8uYrgSAvX2zlVMdQ+dBxyW6/6eTini0A== X-Received: by 10.223.163.18 with SMTP id c18mr2147426wrb.211.1506003596026; Thu, 21 Sep 2017 07:19:56 -0700 (PDT) Original-Received: from [192.168.0.133] (static-nbl2-118.cytanet.com.cy. [212.31.107.118]) by smtp.googlemail.com with ESMTPSA id o11sm1387954wrg.5.2017.09.21.07.19.53 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 21 Sep 2017 07:19:54 -0700 (PDT) In-Reply-To: <87lgla9f57.fsf@tromey.com> Content-Language: en-US X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c0c::231 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:218630 Archived-At: On 9/20/17 7:18 AM, Tom Tromey wrote: >>>>>> "Dmitry" == Dmitry Gutov writes: > > Dmitry> So I thought it might be useful to return the name of the language > Dmitry> instead of the mode. The default implementation could look like this: > > Are there modes that can adapt to multiple different major modes for > language, but without knowing the details of the major mode? I don't > know but it seems iffy to me. Do you know many cases where this isn't true? Its the usual case in company-mode backends, I think. E.g., company-clang only cares that the edited language is one from a given list, not about the current major mode. Same for third-party backends for JS, and company-css, of course. There might be some problems about unknown major modes setting the syntax table to unreasonable values, but we could treat those as bugs in those major modes. Anyway, my suggestion makes things more complex. I'm not seeing a lot of reaction to it, so maybe disregard for now. We could add some major-mode->language mapping later down the road.