From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Kangas Newsgroups: gmane.emacs.devel Subject: Re: [NonGNU ELPA] new package: clangd-inactive-regions Date: Sat, 2 Nov 2024 14:52:11 -0700 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="982"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Eli Zaretskii To: Filippo Argiolas , emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat Nov 02 22:53:14 2024 Return-path: Envelope-to: ged-emacs-devel@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 1t7M3V-000078-IH for ged-emacs-devel@m.gmane-mx.org; Sat, 02 Nov 2024 22:53:13 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t7M2b-0004q9-5N; Sat, 02 Nov 2024 17:52:17 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1t7M2Z-0004pz-Cn for emacs-devel@gnu.org; Sat, 02 Nov 2024 17:52:15 -0400 Original-Received: from mail-ed1-x531.google.com ([2a00:1450:4864:20::531]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1t7M2X-0003rs-OV; Sat, 02 Nov 2024 17:52:15 -0400 Original-Received: by mail-ed1-x531.google.com with SMTP id 4fb4d7f45d1cf-5c9693dc739so4027179a12.3; Sat, 02 Nov 2024 14:52:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1730584332; x=1731189132; darn=gnu.org; h=cc:to:subject:message-id:date:mime-version:references:in-reply-to :from:from:to:cc:subject:date:message-id:reply-to; bh=+MzEexCP25qpOdwjlHpWLOdYZmWTbtznfiyXIlAh/Y0=; b=CCPvqmQgzpOaWLy6uJIzmBtJamXoJymPStEGjmVxZIedgyFd1xf6kxdKUUok8e96qQ uBqKP/CNqx4/ElpSVRTuw+pxNNyTH1+SLwfiB9fGKPZcuBK5xH+b2KGi9ZcFDI+JYqsr aSVYCcGb93oU8Sv+HBV+YC2caBihOLax6AhkSwv6ZumL+w5VkcEj4CI0BLq4zZRlpYa0 yFygccH1w9gyVefR9iGxE57ebrPFqTARWz4eSjyfGVJkk610g6Dx5IgrtT302km4f7y2 cVkRAAInR4+SEUiuxkO6RCMGINvHXZXL4J14KxQr97Fkx6OzYU5UV9SdDesX4aPBloKd 7hQQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730584332; x=1731189132; h=cc:to:subject:message-id:date:mime-version:references:in-reply-to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=+MzEexCP25qpOdwjlHpWLOdYZmWTbtznfiyXIlAh/Y0=; b=u5mCnvNPWY5XZTaw6zL80evlCB/HqYnahMKNsbQd1NyygwTWXlqNXlVl/hSrwMxiZ4 SJmwbm46nVDztzcI9jOvT3WLUIq/4eFEHz7JoL9uc4MUK5/e10idITTX1l55ymGbrzj+ 2MrhUQI6Beih83Cl9Dzst565lcKSaIys0aHgMufGzVgTW/tmG6lNhqfOH040A4eSpWWb F2NcBHuHoG64MTPYGvq6AjtsDfYK/y9eBJcOKSfXBkLn0ZUvTgaXB+PDDrNbJMf162W/ DeEMgThPLRJYlb+Pns0aC0h1WDiBxJVd3OZnpDrhhR1Lbozi77B+0KUfARgLG+LlSD8s BE1g== X-Forwarded-Encrypted: i=1; AJvYcCXzPshyHTol+UAzHLuwQiFuAbJ6Xr8Yno7khW8vUa+SXRrIsYgPqD3J3V1OzeRy34H4DI188FH27bQpUw==@gnu.org X-Gm-Message-State: AOJu0Yx0RL7TB2lo4XWTNXmEgtFLsVkQXeHOmCmSgWQPkB5WQ3EoodiM xCLrmwqPWa2oToJgQYi/8HITe/0l4G4ljYlv24/dDr9dmfV82zzNpR2rUpxYUMY4ZHWzHc4wMgW +5GlabiBlMWT0UX0LqFPAwTEYiac= X-Google-Smtp-Source: AGHT+IFxmY/jJVx6h0WUZT9NwVuzVR2MIJTqsxd1yflCJDYJi9rfuNO6Cfx7hp3nhkYPsyw7ZmyoqSuxLqyNf4ww+ks= X-Received: by 2002:a05:6402:2546:b0:5ce:d1b6:b3d1 with SMTP id 4fb4d7f45d1cf-5ced1b6ba63mr1238897a12.36.1730584331711; Sat, 02 Nov 2024 14:52:11 -0700 (PDT) Original-Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Sat, 2 Nov 2024 14:52:11 -0700 In-Reply-To: Received-SPF: pass client-ip=2a00:1450:4864:20::531; envelope-from=stefankangas@gmail.com; helo=mail-ed1-x531.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: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 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-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:325030 Archived-At: Filippo Argiolas writes: > Just wanted to check if there's any interest in including my little > package in NonGNU ELPA: > > https://github.com/fargiolas/clangd-inactive-regions.el > > It's an eglot extension that listens to clangd inactiveRegions > notifications and shades inactive code accordingly. It's useful to > highlight disabled code sections in a LSP aware way, honoring current > building options and defines. > > It started as little more than an experiment but I've been using it on > the day job with a ifdef-heavy codebase and it has been serving me > well for more than a year. Thought it could be useful to other people > too. > > I'm not exactly an elisp expert, so feedback is very welcome! Thanks. It sounds useful, so I think we should add it. I'm interested to see how well this will work in Emacs itself, but I didn't have time to test it yet. How would you feel about adding this package to GNU ELPA instead? The main requirement would be copyright assignments to the FSF from all current and future contributors. I see that you're the sole contributor for now. I think that would be useful, since there seems to be a plan to suggest adding this to the LSP protocol, in which case we'd really want this in Eglot itself, I think.[1] One comment from reading the README is that it would be helpful to add a few sentences there about what the inactiveRegion LSP extension does. For example, it could say something like this: "inactiveRegions" is a clangd-specific extension to the LSP protocol that allows LSP clients to hide code that is in a currently inactive preprocessor branch. ...or something along those lines. On a side note, I also read this in the README: As far as I know Emacs doesn't have a way to set foreground text opacity. Best would be a face attribute so that you can set it in an overlay covering each inactive region and be done with it. Unfortunately there is no attribute for this yet. Would such a feature be hard to add to the display engine? Eli? Footnotes: [1] https://github.com/clangd/clangd/issues/132#issuecomment-1722327517