From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stephen Leake Newsgroups: gmane.emacs.devel Subject: Add cl-defgeneric project-name; first use case eglot Date: Sun, 20 Nov 2022 14:09:49 -0800 Message-ID: <86zgcll1le.fsf@stephe-leake.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="36762"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: =?utf-8?B?Sm/Do28gVMOhdm9yYQ==?= To: emacs-devel Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun Nov 20 23:12:25 2022 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 1owsY4-0009KJ-OF for ged-emacs-devel@m.gmane-mx.org; Sun, 20 Nov 2022 23:12:24 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1owsXY-0003kE-3r; Sun, 20 Nov 2022 17:11:52 -0500 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 1owsXV-0003jS-DJ for emacs-devel@gnu.org; Sun, 20 Nov 2022 17:11:49 -0500 Original-Received: from qproxy6-pub.mail.unifiedlayer.com ([69.89.23.12]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1owsXT-0003TE-1q for emacs-devel@gnu.org; Sun, 20 Nov 2022 17:11:49 -0500 Original-Received: from gproxy4-pub.mail.unifiedlayer.com (unknown [69.89.23.142]) by qproxy6.mail.unifiedlayer.com (Postfix) with ESMTP id CA6798031675 for ; Sun, 20 Nov 2022 22:11:43 +0000 (UTC) Original-Received: from cmgw15.mail.unifiedlayer.com (unknown [10.0.90.130]) by progateway6.mail.pro1.eigbox.com (Postfix) with ESMTP id DFD72100471E1 for ; Sun, 20 Nov 2022 22:09:51 +0000 (UTC) Original-Received: from host2007.hostmonster.com ([67.20.76.71]) by cmsmtp with ESMTP id wsVbocCbwkPukwsVbopBkV; Sun, 20 Nov 2022 22:09:51 +0000 X-Authority-Reason: nr=8 X-Authority-Analysis: v=2.4 cv=Lev5VhTi c=1 sm=1 tr=0 ts=637aa5af a=dWLzHQi6WpdymmZIwiVdBw==:117 a=Fln8i1WyhtedwaIJAdHvmw==:17 a=dLZJa+xiwSxG16/P+YVxDGlgEgI=:19 a=9xFQ1JgjjksA:10:nop_rcvd_month_year a=vvvmwbhNdt4A:10:endurance_base64_authed_username_1 a=S-MQnom6NlLHOMQPC4gA:9 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=stephe-leake.org; s=default; h=Content-Type:MIME-Version:Message-ID:Date: Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=QH74d5pqMm5CXKmw1NZmSOMfWhLmKmt6VTsTZafSTbw=; b=nPvaQPaz+YeQ26t+jwESlOBio4 XiUs+oVWO3uWq5QrE9Dd7FsT1XB1FP7ILos9ejZgpNG3zoTnqK3NRayFo0xAbZ4VGdduC8PMpvPbi D/F9qTy0Ihpz1l0F5XiPRRsFVWu9o6/Pd42+skNqla8RCGSRxztw6a/8tMPASZ2DZ8uTDmI0bIOyV d7VMmg6ZoIjPSeaBYM81/ftatsp4qDB2UvR+b11gGn6gJz3SzLtn/UJMhX533y2gb/E5ARss9JVL/ Kswg9b6ifVTcJu99PFuIAjhMR1YbijSAw8Yh6Vd/+4ukrgw7+15g+7c1PPaoYlz67atyLmpPxNdY+ VyvCPTRA==; Original-Received: from 135-180-197-170.fiber.dynamic.sonic.net ([135.180.197.170]:50264 helo=DESKTOP-G20DCG1) by host2007.hostmonster.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1owsVb-001eWQ-GR; Sun, 20 Nov 2022 15:09:51 -0700 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - host2007.hostmonster.com X-AntiAbuse: Original Domain - gnu.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - stephe-leake.org X-BWhitelist: no X-Source-IP: 135.180.197.170 X-Source-L: No X-Exim-ID: 1owsVb-001eWQ-GR X-Source-Sender: 135-180-197-170.fiber.dynamic.sonic.net (DESKTOP-G20DCG1) [135.180.197.170]:50264 X-Source-Auth: stephen_leake@stephe-leake.org X-Email-Count: 1 X-Source-Cap: c3RlcGhlbGU7c3RlcGhlbGU7aG9zdDIwMDcuaG9zdG1vbnN0ZXIuY29t X-Local-Domain: yes Received-SPF: pass client-ip=69.89.23.12; envelope-from=stephen_leake@stephe-leake.org; helo=qproxy6-pub.mail.unifiedlayer.com X-Spam_score_int: 16 X-Spam_score: 1.6 X-Spam_bar: + X-Spam_report: (1.6 / 5.0 requ) BAYES_00=-1.9, DKIM_INVALID=0.1, DKIM_SIGNED=0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, RCVD_IN_SBL_CSS=3.335, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no 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:300274 Archived-At: eglot builds a name for a server using the root directory of the project - in effect: (file-name-base (directory-file-name (project-root (project-current)))) That name shows up in the elgot mode line, to tell the user which server the buffer is connected to, in progress report messages, and in the name of the EGLOT log buffer, which is useful for debugging things. If the project root directory happens to have a meaningful name, that's fine. In my use cases, it's usually not meaningful. For example, I have two worktrees of my wisitoken project, one for the main branch, one for a work branch. The eglot names, and the ones I'd like to see, are: default desired "build" "wisitoken main" "build" "wisitoken work" Similarly, the name for the ada_language_server worktree is: "gnat" "als main" There are probably other situations where providing a more meaningful name for a project would be useful. So I'd like to add a new cl-defgeneric to project.el: (cl-defgeneric project-name (project) "A human-readable name for the project." (file-name-base (directory-file-name (project-root project)))) Then I can override that in my projects, and eglot will use my desired name. -- -- Stephe