From debbugs-submit-bounces@debbugs.gnu.org Fri Jun 28 10:13:12 2024 Received: (at submit) by debbugs.gnu.org; 28 Jun 2024 14:13:12 +0000 Received: from localhost ([127.0.0.1]:46002 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sNCLf-0004i0-QU for submit@debbugs.gnu.org; Fri, 28 Jun 2024 10:13:12 -0400 Received: from lists.gnu.org ([209.51.188.17]:32880) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sNCLd-0004hq-A7 for submit@debbugs.gnu.org; Fri, 28 Jun 2024 10:13:10 -0400 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 1sNCLc-0007uF-EG for bug-gnu-emacs@gnu.org; Fri, 28 Jun 2024 10:13:08 -0400 Received: from mxout5.mail.janestreet.com ([64.215.233.18]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sNCLZ-0008CP-2R for bug-gnu-emacs@gnu.org; Fri, 28 Jun 2024 10:13:07 -0400 From: Spencer Baugh To: bug-gnu-emacs@gnu.org Subject: 31.0.50; project-mode-line and eglot duplicate project-name in mode-line X-Debbugs-Cc: Date: Fri, 28 Jun 2024 10:13:03 -0400 Message-ID: MIME-Version: 1.0 Content-Type: text/plain DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=janestreet.com; s=waixah; t=1719583983; bh=oX34xhqt9Xo9rNDPWIiME/oJefTEFcmw0ttvScNLYBo=; h=From:To:Subject:Date; b=deLhJEIWv47c61B2hw34a2TRX1ub63mbSqCVJUE9IQc4cyXAuBEkx8NAF1mI4/j+S mUX353o90SlhE/BZ5M5TIJV5Ood+UhZcT2e9avMlhPToUOjTeb/S98MDVdYvxyT2IR 1kmYfsm9rFXLkGDSsiKMHx94j+mSayHN6qxn4dzqwBRnsEMo+qMNOdwjeVlkEsY6sR 7EFXiaqbxO4T7WXOG3pMpN8LXAJc4eh0Q3TDDMwI738ij+fcuN6L0WLftJyWc3KO00 nJxJsN76Ryr5OaCQ7irFHlwVwEdfhlttUMt1tko2Je2kZNY7h4dSpZlhe7D+Mc51si wDGj9Ojp1Uybw== Received-SPF: pass client-ip=64.215.233.18; envelope-from=sbaugh@janestreet.com; helo=mxout5.mail.janestreet.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, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.4 (-) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.4 (--) 1. emacs -Q 2. Open e.g. src/process.c in an Emacs git checkout named "emacs-30" 3. (setopt project-mode-line t) 4. Observe "emacs-30" is added to the modeline, naming the current project. 5. M-x eglot 6. Observe "[eglot:emacs-30]" is added to the modeline; the "emacs-30" part duplicates the project-mode-line. The project-name should be included only once; and since the project-mode-line entry is available in more places (e.g. it's available in dired, whereas eglot is not), that should be the one to be preserved. A patch to do this will follow. In GNU Emacs 31.0.50 (build 2, x86_64-pc-linux-gnu, X toolkit, cairo version 1.15.12, Xaw scroll bars) of 2024-06-28 built on igm-qws-u22796a Repository revision: d780a4d3aec82c96e12fa074d6bfc66599b95175 Repository branch: master Windowing system distributor 'The X.Org Foundation', version 11.0.12011000 System Description: Rocky Linux 8.9 (Green Obsidian) Configured using: 'configure --with-x-toolkit=lucid --without-gpm --without-gconf --without-selinux --without-imagemagick --with-modules --with-gif=no --with-cairo --with-rsvg --without-compress-install --with-native-compilation=aot --with-tree-sitter PKG_CONFIG_PATH=/usr/local/home/garnish/libtree-sitter/0.22.6-1/lib/pkgconfig/' Configured features: CAIRO DBUS FREETYPE GLIB GMP GNUTLS GSETTINGS HARFBUZZ JPEG LIBSYSTEMD LIBXML2 MODULES NATIVE_COMP NOTIFY INOTIFY PDUMPER PNG RSVG SECCOMP SOUND SQLITE3 THREADS TIFF TOOLKIT_SCROLL_BARS TREE_SITTER X11 XDBE XIM XINPUT2 XPM LUCID ZLIB Important settings: value of $LANG: en_US.UTF-8 locale-coding-system: utf-8-unix Major mode: Fundamental Minor modes in effect: tooltip-mode: t global-eldoc-mode: t show-paren-mode: t electric-indent-mode: t mouse-wheel-mode: t tool-bar-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t blink-cursor-mode: t minibuffer-regexp-mode: t buffer-read-only: t line-number-mode: t indent-tabs-mode: t transient-mark-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t Load-path shadows: None found. Features: (shadow sort mail-extr compile comint ansi-osc ansi-color ring comp-run bytecomp byte-compile comp-common rx emacsbug message mailcap yank-media puny dired dired-loaddefs rfc822 mml mml-sec password-cache epa derived epg rfc6068 epg-config gnus-util text-property-search time-date subr-x mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader cl-loaddefs cl-lib sendmail rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils rmc iso-transl tooltip cconv eldoc paren electric uniquify ediff-hook vc-hooks lisp-float-type elisp-mode mwheel term/x-win x-win term/common-win x-dnd touch-screen tool-bar dnd fontset image regexp-opt fringe tabulated-list replace newcomment text-mode lisp-mode prog-mode register page tab-bar menu-bar rfn-eshadow isearch easymenu timer select scroll-bar mouse jit-lock font-lock syntax font-core term/tty-colors frame minibuffer nadvice seq simple cl-generic indonesian philippine cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese composite emoji-zwj charscript charprop case-table epa-hook jka-cmpr-hook help abbrev obarray oclosure cl-preloaded button loaddefs theme-loaddefs faces cus-face macroexp files window text-properties overlay sha1 md5 base64 format env code-pages mule custom widget keymap hashtable-print-readable backquote threads dbusbind inotify dynamic-setting system-font-setting font-render-setting cairo x-toolkit xinput2 x multi-tty move-toolbar make-network-process native-compile emacs) Memory information: ((conses 16 110175 9082) (symbols 48 11064 0) (strings 32 30943 2909) (string-bytes 1 975127) (vectors 16 13768) (vector-slots 8 169832 8233) (floats 8 34 1) (intervals 56 453 15) (buffers 992 12)) From debbugs-submit-bounces@debbugs.gnu.org Fri Jun 28 10:15:52 2024 Received: (at 71823) by debbugs.gnu.org; 28 Jun 2024 14:15:52 +0000 Received: from localhost ([127.0.0.1]:46014 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sNCOG-0004n9-0S for submit@debbugs.gnu.org; Fri, 28 Jun 2024 10:15:52 -0400 Received: from mxout5.mail.janestreet.com ([64.215.233.18]:36549) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sNCOE-0004mu-Nb for 71823@debbugs.gnu.org; Fri, 28 Jun 2024 10:15:51 -0400 From: Spencer Baugh To: 71823@debbugs.gnu.org Subject: Re: bug#71823: 31.0.50; project-mode-line and eglot duplicate project-name in mode-line In-Reply-To: (Spencer Baugh's message of "Fri, 28 Jun 2024 10:13:03 -0400") References: Date: Fri, 28 Jun 2024 10:15:45 -0400 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=janestreet.com; s=waixah; t=1719584145; bh=20KvRDlWL2SbLBzVJeMmnXKw7QzSfkyt0AFg3h+VT1U=; h=From:To:Subject:In-Reply-To:References:Date; b=UeJNC0RIa7XMGlkdQbn27pm3RXVDLqq1l5bwHZ2veCs7PxkT3S0VnPUkkNGq579OJ s0nRkta+HBupW3A7wZtfr+kFm2KjpWv5qZrLxYOp0r72Brv8b7WWAQ87gXWcMlo5Ph AKhwCms45hwkxjG1SyqHlEln5ufYXItgN5XYzQ3S/Pj766CaNzSMrJbLMrCXEZZgng /8aRs83PfAHJr4VcyPQNXWjHSAWJpC0t2jqJE43epJbQLcVRrithIdNKfN7LpagZe6 3Li694K1AcqhSYndAqtlbnxvIfIX+xxFk3kRQqZY2TxzkEL3tB7BxfF3yZHeOkWhlu uXaf7icvIKGPA== X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 71823 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --=-=-= Content-Type: text/plain Patch fixing this: --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-Skip-eglot-project-name-when-project-mode-line-t.patch >From 928101e122725866ee95172730ebff03f4d54d5a Mon Sep 17 00:00:00 2001 From: Spencer Baugh Date: Fri, 28 Jun 2024 10:00:10 -0400 Subject: [PATCH] Skip eglot project-name when project-mode-line=t Both the eglot mode line entry and project-mode-line add project-name to the modeline. When both of them are enabled, this is unnecessary duplication. To fix, add the customization eglot-mode-line-project-name to allow disabling the project-name in eglot's mode-line entry. Furthermore, by default, set this customization so that eglot will check project-mode-line and omit the project-name if project-mode-line is non-nil. This allows a user to just set project-mode-line without having to separately customize eglot. * lisp/progmodes/eglot.el (eglot-mode-line-project-name): Add. (eglot--mode-line-format): Check eglot-mode-line-project-name. (bug#71823) --- lisp/progmodes/eglot.el | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el index df4cbe50dc0..60e68b323f6 100644 --- a/lisp/progmodes/eglot.el +++ b/lisp/progmodes/eglot.el @@ -2237,10 +2237,29 @@ eglot--mode-line-props keymap ,map help-echo ,(concat prepend blurb) mouse-face mode-line-highlight)))) +(defcustom eglot-mode-line-project-name + (if (version< "30" emacs-version) + ;; The project mode-line entry was added to `mode-line-format' in + ;; Emacs 30; before that, `project-mode-line' has no effect. + 'unless-project-mode-line + nil) + "If non-nil, the eglot mode-line entry may contain `project-name'. + +If t, the eglot mode-line entry always contains `project-name'; if nil, +it never contains `project-name'. + +If the symbol `unless-project-mode-line', the eglot mode-line entry only +contains `project-name' if `project-mode-line' is nil. (This avoids +showing `project-name' in the modeline twice.)") + (defun eglot--mode-line-format () "Compose Eglot's mode-line." (let* ((server (eglot-current-server)) (nick (and server (eglot-project-nickname server))) + (use-nick (cl-case eglot-mode-line-project-name + (nil nil) + (unless-project-mode-line (not (bound-and-true-p project-mode-line))) + (t t))) (pending (and server (jsonrpc-continuation-count server))) (last-error (and server (jsonrpc-last-error server)))) (append @@ -2253,9 +2272,9 @@ eglot--mode-line-format (define-key map [mode-line down-mouse-1] eglot-menu) map))) (when nick - `(":" + `(,(if use-nick ":" "") ,(propertize - nick + (if use-nick nick ":") 'face 'eglot-mode-line 'mouse-face 'mode-line-highlight 'help-echo (format "Project '%s'\nmouse-1: LSP server control menu" nick) -- 2.39.3 --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Fri Jun 28 10:41:08 2024 Received: (at 71823) by debbugs.gnu.org; 28 Jun 2024 14:41:09 +0000 Received: from localhost ([127.0.0.1]:46045 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sNCmi-0005Sa-GV for submit@debbugs.gnu.org; Fri, 28 Jun 2024 10:41:08 -0400 Received: from eggs.gnu.org ([209.51.188.92]:49204) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sNCmg-0005Rx-6k for 71823@debbugs.gnu.org; Fri, 28 Jun 2024 10:41:07 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sNCmZ-0007gb-Ll; Fri, 28 Jun 2024 10:40:59 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=mop5kr1AodbRnBID2vvQL+L9rzPCqTiaIhnLYLw+u9A=; b=p+1mQKAQ6Zu3GY8oJwom Eg869JZ6Csb1qcmlRqgiRksAKGpvBsnRGDBvzHwe0dG9z6y/HrYtdAQ2MHr2imLgkPmtMchJ/N6L9 iufe2aa5m1VYnmXQS5Vvo8t4C0IAbPR2pTbIVyjCSwP7T0aaZrOq9+fh/U8bFOzD8jrOgBDr3FQHv l3u5zgMH4sRDce2bGJ/0zgcYFaeewRSZgyBcSXn4w68R08SYr11+esNJUiUkbiO9YFCfSzpDcX4LK UQiY8qgF0ADiwfrvRGtYj1qavKb5YW9IZjhVlQfiHVnsYN8sxaWAXyiIWz0kW0kbtOLBVKzIyyrPx iWpcVftKFGSxMA==; Date: Fri, 28 Jun 2024 17:40:56 +0300 Message-Id: <86wmm9jfk7.fsf@gnu.org> From: Eli Zaretskii To: Spencer Baugh , =?iso-8859-1?Q?Jo=E3o_T=E1vora?= In-Reply-To: (message from Spencer Baugh on Fri, 28 Jun 2024 10:15:45 -0400) Subject: Re: bug#71823: 31.0.50; project-mode-line and eglot duplicate project-name in mode-line References: MIME-version: 1.0 Content-type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 71823 Cc: 71823@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Spencer Baugh > Date: Fri, 28 Jun 2024 10:15:45 -0400 > > >From 928101e122725866ee95172730ebff03f4d54d5a Mon Sep 17 00:00:00 2001 > From: Spencer Baugh > Date: Fri, 28 Jun 2024 10:00:10 -0400 > Subject: [PATCH] Skip eglot project-name when project-mode-line=t > > Both the eglot mode line entry and project-mode-line add > project-name to the modeline. When both of them are enabled, > this is unnecessary duplication. > > To fix, add the customization eglot-mode-line-project-name to > allow disabling the project-name in eglot's mode-line entry. > > Furthermore, by default, set this customization so that eglot > will check project-mode-line and omit the project-name if > project-mode-line is non-nil. This allows a user to just set > project-mode-line without having to separately customize eglot. > > * lisp/progmodes/eglot.el (eglot-mode-line-project-name): Add. > (eglot--mode-line-format): Check > eglot-mode-line-project-name. (bug#71823) > --- > lisp/progmodes/eglot.el | 23 +++++++++++++++++++++-- > 1 file changed, 21 insertions(+), 2 deletions(-) > > diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el > index df4cbe50dc0..60e68b323f6 100644 > --- a/lisp/progmodes/eglot.el > +++ b/lisp/progmodes/eglot.el > @@ -2237,10 +2237,29 @@ eglot--mode-line-props > keymap ,map help-echo ,(concat prepend blurb) > mouse-face mode-line-highlight)))) > > +(defcustom eglot-mode-line-project-name > + (if (version< "30" emacs-version) > + ;; The project mode-line entry was added to `mode-line-format' in > + ;; Emacs 30; before that, `project-mode-line' has no effect. > + 'unless-project-mode-line > + nil) > + "If non-nil, the eglot mode-line entry may contain `project-name'. > + > +If t, the eglot mode-line entry always contains `project-name'; if nil, > +it never contains `project-name'. > + > +If the symbol `unless-project-mode-line', the eglot mode-line entry only > +contains `project-name' if `project-mode-line' is nil. (This avoids > +showing `project-name' in the modeline twice.)") > + > (defun eglot--mode-line-format () > "Compose Eglot's mode-line." > (let* ((server (eglot-current-server)) > (nick (and server (eglot-project-nickname server))) > + (use-nick (cl-case eglot-mode-line-project-name > + (nil nil) > + (unless-project-mode-line (not (bound-and-true-p project-mode-line))) > + (t t))) > (pending (and server (jsonrpc-continuation-count server))) > (last-error (and server (jsonrpc-last-error server)))) > (append > @@ -2253,9 +2272,9 @@ eglot--mode-line-format > (define-key map [mode-line down-mouse-1] eglot-menu) > map))) > (when nick > - `(":" > + `(,(if use-nick ":" "") > ,(propertize > - nick > + (if use-nick nick ":") > 'face 'eglot-mode-line > 'mouse-face 'mode-line-highlight > 'help-echo (format "Project '%s'\nmouse-1: LSP server control menu" nick) > -- > 2.39.3 João, any comments? From debbugs-submit-bounces@debbugs.gnu.org Fri Jun 28 13:50:35 2024 Received: (at 71823) by debbugs.gnu.org; 28 Jun 2024 17:50:35 +0000 Received: from localhost ([127.0.0.1]:46311 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sNFk2-0005ET-TN for submit@debbugs.gnu.org; Fri, 28 Jun 2024 13:50:35 -0400 Received: from mail-lf1-f52.google.com ([209.85.167.52]:43410) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sNFk0-0005E7-PO for 71823@debbugs.gnu.org; Fri, 28 Jun 2024 13:50:33 -0400 Received: by mail-lf1-f52.google.com with SMTP id 2adb3069b0e04-52e7ad786dfso964815e87.1 for <71823@debbugs.gnu.org>; Fri, 28 Jun 2024 10:50:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1719596966; x=1720201766; darn=debbugs.gnu.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=qthbejtftFx6b45PmhDN0knlzEeD+aEDyVK89Zjgg54=; b=f7K7Ml3/bRXCljFrFso1IY4aaQaVkiD5TQqH0aPfR9TF+F+3i9bpOj0nJSB1bTI1eO r4GhwkTALJE7hsg6VCXUkDmmU29K+b/StYMPUzmcUAQxymq/03M8d2A6p97Rk/bo0DiE 1q7QDlhuG/AkjgCRIYZf1osvUtEtUBzMVn7SKI+0doRAPW1zhphcvOrvZEfnFsTi/wmO QZl6WKmde5OylKW/tbb8f9a9siTdwO4AF1f8Rvqtj8Ds8Y3WbVC/qDB7/aCnRud2B5RL 5dyWjNy62tTJ+ZDc/n7Qivbi3nNBWiXc61B5ps2tvwAXmlhO5BsMUQR0rDfIyLlIMSOp U1JQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719596966; x=1720201766; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=qthbejtftFx6b45PmhDN0knlzEeD+aEDyVK89Zjgg54=; b=frAULGFWwTIX3Lvzywh2E/zgNqnDhhTf/tyjS2JpurwpEFVCkWW8T4yluJxLPBJ/OO BOx7TtV4x+bbew3mvkGNgtUtMMMcDhvcFnY0HFrHMXIXR6tEoKpFJ56Yno/9jP04ul1V mAN0KqGivIvhP+lG4A/Y/WGQ+l+S5S9DyfumFwoASsk8Y4UtGnR2ADyP8wuf0QXMHXcg 1Qh7PTbxUl85CT/DJPVuPoYwbgZlq86+YxgTrtlicduTVO3qZuLCnJLc7xEu1nbEoSl/ YO/trdN4d+VZz8BGK2XTKYTbyFyRU7JI+Sj6Xkwy+bC02Pksj6kiRuV2CGZgatlV5EUU /kYA== X-Forwarded-Encrypted: i=1; AJvYcCUu6sS/Ek7hAgSiW6oGRBmQDeJwl/Y37tMxFvwI/daukgD/zT9cYEVo+pV3m3Xai9t5GoOdtAfEl99cAM8XPyIHjng9jxM= X-Gm-Message-State: AOJu0Yx+qjgRmsAUsUaAAcDnNBYJUZ1aK+68J9iQDOSibZRTzefxa52Z ND1Bsa1eC39UbRmYplyFJYvsxAlH84BBMhrfJ0FvGDXPAsGsgz98TcnQdMVXkYZ5s2/pDo6m9ho OI8ivIykmb1wH9Vys1daZbiCmJZQ= X-Google-Smtp-Source: AGHT+IFmzaDVDl+nxxqvei8D/UJfP9Cc0MKJOm2bR6qzQ4yw/Pxvfv6tbSiG5ZKSr/V5Hr7apkHX3CFm3aCph2BWv60= X-Received: by 2002:a05:6512:39c9:b0:52c:884a:96c7 with SMTP id 2adb3069b0e04-52e7b8ec02dmr885481e87.17.1719596966085; Fri, 28 Jun 2024 10:49:26 -0700 (PDT) MIME-Version: 1.0 References: <86wmm9jfk7.fsf@gnu.org> In-Reply-To: <86wmm9jfk7.fsf@gnu.org> From: =?UTF-8?B?Sm/Do28gVMOhdm9yYQ==?= Date: Fri, 28 Jun 2024 18:49:14 +0100 Message-ID: Subject: Re: bug#71823: 31.0.50; project-mode-line and eglot duplicate project-name in mode-line To: Eli Zaretskii Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 71823 Cc: Spencer Baugh , 71823@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) On Fri, Jun 28, 2024 at 3:41=E2=80=AFPM Eli Zaretskii wrote: > Jo=C3=A3o, any comments? Tiny switches for these customizations is not a good idea. It's complex, hard to find, and doesn't scale well For this and other use cases we need something more robust like in many packages, a user-customizable eglot-mode-line-format. You can e.g. use flymake-mode-like-format as an idea. Of course, the default value of eglot-mode-line-format would keep the Eglot mode-line exactly as it is. The default value would be something like ("[" eglot-mode-line-menu ":" eglot-mode-line-project-name eglot-mode-line-outstanding-requests "]") To fix this problem, users would just remove eglot-project-name from the va= r Many users want to get rid of the number of outstanding requests, this would help them too. Yet other users want to put the eglot mode-line menu somewhere else but without the brackets. You get the idea. Here's the Flymake default value, btw. Jo=C3=A3o flymake-mode-line-format is a variable defined in `flymake.el'. Its value is (" " flymake-mode-line-exception flymake-mode-line-counters) Mode line construct for customizing Flymake information. This variable may be risky if used as a file-local variable. You can customize this variable. Probably introduced at or before Emacs version 28.1. [back] From debbugs-submit-bounces@debbugs.gnu.org Fri Jun 28 18:24:39 2024 Received: (at 71823) by debbugs.gnu.org; 28 Jun 2024 22:24:39 +0000 Received: from localhost ([127.0.0.1]:36283 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sNK1G-0000Qn-NX for submit@debbugs.gnu.org; Fri, 28 Jun 2024 18:24:39 -0400 Received: from mxout1.mail.janestreet.com ([38.105.200.78]:49569) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sNK1D-0000QV-PW for 71823@debbugs.gnu.org; Fri, 28 Jun 2024 18:24:36 -0400 Received: from mail-ej1-f70.google.com ([209.85.218.70]) by mxgoog2.mail.janestreet.com with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) (Exim 4.97.1) id 1sNJm1-00000002Txm-2nrr for 71823@debbugs.gnu.org; Fri, 28 Jun 2024 18:08:53 -0400 Received: by mail-ej1-f70.google.com with SMTP id a640c23a62f3a-a725eed1cfeso75238566b.3 for <71823@debbugs.gnu.org>; Fri, 28 Jun 2024 15:08:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=janestreet.com; s=google; t=1719612532; x=1720217332; darn=debbugs.gnu.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=DM6jXLxtB1nODO5gjwSa0DFvPnX96boigN1a9P+7ZPg=; b=zCBSGHsmlQ5VotDy49bZH3FPPaiOKvQq5jWK1XTO/uUf4vHTAuRMxOGpj36EpGlj/z Xv/OOghyGZHv4+232+fxd0kbweGi98R5VkTfunR4duDhvKO5Etd4vOhUNkMatGBMTztJ gAU9a97fs+1qEafesMdizBm0t2OOp+jAer9F4= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=janestreet.com; s=waixah; t=1719612533; bh=DM6jXLxtB1nODO5gjwSa0DFvPnX96boigN1a9P+7ZPg=; h=References:In-Reply-To:From:Date:Subject:To:Cc; b=CFxg1DO2oQ6XUPgQqylWYPEIh2aWtsG/Cpvur6CDL8z50j67VyAOnqoLuHmiiGV4C J53U1ShVjuoL4Kj4ZbPqTlkxeVsPIuOPD+YBmjk0jCdxwBreKpHVIFMsMHTNIqR7Vu H7eqJkkZCQu2TWqdDsUYZ6tT09BVIdjJAfhyXF7m0pZu7bm6lEyXbrUjmjhpnKhwrS wkRJMEwNbRcyBQFYlrUC0nuHo977mD2/EeX/s3mvD4P592FmbftBn3XoCCTZFGkHeL Vog0HibsjMjLkVRd/B+9hUBSmCsZW4xjd/Hk6GAkkPtFEOcbk5SvaoqLCFyyCtfJr1 pbVSvg3/hUgQg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719612532; x=1720217332; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=DM6jXLxtB1nODO5gjwSa0DFvPnX96boigN1a9P+7ZPg=; b=wczhbLEPI+0aE3GHzfetJgheYCvwZZ3wlSuTksl+UgrZ7veoVEp5JmcncyWLuuabAx mW1OpdWAOCxVPIj2CyuwpEKJr+cMwgJInIUdytjjPH+wVbyRRGTvxRWOaF5MtBInHenA mreCq9CeosApuTEEk/WVOn8zVmlKZhDrry/ud67IrLFldiS4tGSZxW7w0Ab5e6P1m9+C kvKf5T3pZ2GdoPIK1ZeXto0BeG4bWOzciYq8taCV9VO70lNLzsQkGA4MQk2dz7sgfZxs HzuDht1ZFflZO7uWO+V4ecWE0w+1I5q7U1GqmX8YvGtrClZeIJAlvQWChnPAEPY4+RP1 wBTw== X-Forwarded-Encrypted: i=1; AJvYcCWs7BaxRmqSv1Qjv1w0BMk+UiNR94yMMaxmFMxun6DYZX0v5BHzYNXfDFcxfA29+jFB7mSUIX4AQglohSgb1J2XL+l1B90= X-Gm-Message-State: AOJu0YzfIO1a2PQRwlcTjcpVEg4wWHHQAlkeLqv//OhkPxH6ILi8a3Cc 6Jqs5mDWsIYEddVtLZRBlKnRZEaMXyrV9GWTLGn6NQcgP+9crY165tboKk6H+SmkiDDres9MxTF xLt8o95pAvmEdE1sSJu6iS+p36alst7GacY/k8/fKJP1xWfNaFDGfzULmMuc/LX3xHPfDM0I+WA 8T5BE4l1/5rDhPNANRzb0hdlc1gQ== X-Received: by 2002:a17:907:a681:b0:a72:80b8:ba64 with SMTP id a640c23a62f3a-a7280b8bdf7mr659991766b.25.1719612532703; Fri, 28 Jun 2024 15:08:52 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFAHsnBgQTh4W7Ei9UtVszsW/O/g+l6lsDJICeDKPpVRH1ZZUDWQmSCuMsNBOoTJsg4lC5X8C9Uf9MJ5Wl8t4c= X-Received: by 2002:a17:907:a681:b0:a72:80b8:ba64 with SMTP id a640c23a62f3a-a7280b8bdf7mr659990866b.25.1719612532358; Fri, 28 Jun 2024 15:08:52 -0700 (PDT) MIME-Version: 1.0 References: <86wmm9jfk7.fsf@gnu.org> In-Reply-To: From: Spencer Baugh Date: Fri, 28 Jun 2024 18:08:41 -0400 Message-ID: Subject: Re: bug#71823: 31.0.50; project-mode-line and eglot duplicate project-name in mode-line To: =?UTF-8?B?Sm/Do28gVMOhdm9yYQ==?= Content-Type: multipart/alternative; boundary="000000000000249764061bfa7eb8" X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 71823 Cc: Eli Zaretskii , 71823@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --000000000000249764061bfa7eb8 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Fri, Jun 28, 2024 at 1:49=E2=80=AFPM Jo=C3=A3o T=C3=A1vora wrote: > On Fri, Jun 28, 2024 at 3:41=E2=80=AFPM Eli Zaretskii wrot= e: > > > Jo=C3=A3o, any comments? > > Tiny switches for these customizations is not a good idea. It's complex, > hard to find, and doesn't scale well > > For this and other use cases we need something more robust like > in many packages, a user-customizable eglot-mode-line-format. You > can e.g. use flymake-mode-like-format as an idea. Of course, > the default value of eglot-mode-line-format would keep the > Eglot mode-line exactly as it is. > Yes, I agree. But my goal here isn't to make eglot-mode-line customizable, it's to add code to make the eglot mode line automatically avoid duplicating project-name. I figured some people might want to disable this code, so I made it customizable, but that customization is not essential. I'm happy to remove the customization, and just have the eglot modeline automatically remove the project-name when project-mode-line is set. That removes the need for any new customization variables, while still fixing the issue of duplication. Support for actual customization of the eglot mode line can be added later with an eglot-mode-line-format, as you suggest. --000000000000249764061bfa7eb8 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Fri, Jun 28, 2024 at 1:49=E2=80=AFPM J= o=C3=A3o T=C3=A1vora <joaotavora= @gmail.com> wrote:
On Fri, Jun 28, 2024 at 3:41=E2=80=AFP= M Eli Zaretskii <eliz@= gnu.org> wrote:

> Jo=C3=A3o, any comments?

Tiny switches for these customizations is not a good idea.=C2=A0 It's c= omplex,
hard to find, and doesn't scale well

For this and other use cases we need something more robust like
in many packages, a user-customizable eglot-mode-line-format. You
can e.g.=C2=A0 use flymake-mode-like-format as an idea.=C2=A0 Of course, the default value of eglot-mode-line-format would keep the
Eglot mode-line exactly as it is.

Yes, = I agree.

But my goal here isn't to make eglot-= mode-line customizable, it's to add code to make the eglot mode line au= tomatically avoid duplicating=C2=A0project-name.

I= figured some people might want to disable this code,=C2=A0so I made it cus= tomizable, but that customization is not essential.=C2=A0 I'm happy to = remove the customization, and just have the eglot modeline automatically re= move the project-name when project-mode-line is set.=C2=A0 That removes the= need for any new customization variables, while still fixing the issue of = duplication.

Support for actual customization of t= he eglot mode line can be added later with an eglot-mode-line-format, as yo= u suggest.
--000000000000249764061bfa7eb8-- From debbugs-submit-bounces@debbugs.gnu.org Sat Jun 29 03:14:45 2024 Received: (at 71823) by debbugs.gnu.org; 29 Jun 2024 07:14:45 +0000 Received: from localhost ([127.0.0.1]:36884 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sNSIH-0006QB-FZ for submit@debbugs.gnu.org; Sat, 29 Jun 2024 03:14:45 -0400 Received: from eggs.gnu.org ([209.51.188.92]:44998) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sNSIF-0006Pv-Kr for 71823@debbugs.gnu.org; Sat, 29 Jun 2024 03:14:44 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sNSG3-0008Mb-S8; Sat, 29 Jun 2024 03:12:27 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=Go05MgfrRbS+7lNgh2X0eDRN9svssKdbIdIaRBWkKVY=; b=mBaNdDRo2GfLYd5n7iq1 GqGhA2AxCMWGXu9oQNuMEYXkJqLg9ruWxM78Lf74pB/vP1pgGJUiLE0vsYlpmM9zn+otOzvJzQDmm SJ1qEz8L7LwZlgDIpUxtejItnDQBRWOexC8v1kUnI+CibR6JnLKpCVgRp0Qpeszbt0iaH3N++/YiW InWHWShfvh5P75gJQssQKBpxUdNaA2beJL1enw8r/bHlSN6ighyiEcD3t5w58+5YxzvjmWbTbysHB LNNphxTm3FlSDCCYxgnv6KTTNrXSU/JeD8LNJkgeIXepSLqW7x/z4EUv1fxrgSCgZWdsvKFwy4ucD gQNZ8XyReASfIQ==; Date: Sat, 29 Jun 2024 10:12:24 +0300 Message-Id: <86o77kjk87.fsf@gnu.org> From: Eli Zaretskii To: Spencer Baugh , Dmitry Gutov In-Reply-To: (message from Spencer Baugh on Fri, 28 Jun 2024 18:08:41 -0400) Subject: Re: bug#71823: 31.0.50; project-mode-line and eglot duplicate project-name in mode-line References: <86wmm9jfk7.fsf@gnu.org> MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 71823 Cc: joaotavora@gmail.com, 71823@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Spencer Baugh > Date: Fri, 28 Jun 2024 18:08:41 -0400 > Cc: Eli Zaretskii , 71823@debbugs.gnu.org > > On Fri, Jun 28, 2024 at 1:49 PM João Távora wrote: > > On Fri, Jun 28, 2024 at 3:41 PM Eli Zaretskii wrote: > > > João, any comments? > > Tiny switches for these customizations is not a good idea. It's complex, > hard to find, and doesn't scale well > > For this and other use cases we need something more robust like > in many packages, a user-customizable eglot-mode-line-format. You > can e.g. use flymake-mode-like-format as an idea. Of course, > the default value of eglot-mode-line-format would keep the > Eglot mode-line exactly as it is. > > Yes, I agree. > > But my goal here isn't to make eglot-mode-line customizable, it's to add code to make the eglot mode line > automatically avoid duplicating project-name. > > I figured some people might want to disable this code, so I made it customizable, but that customization is not > essential. I'm happy to remove the customization, and just have the eglot modeline automatically remove the > project-name when project-mode-line is set. That removes the need for any new customization variables, > while still fixing the issue of duplication. > > Support for actual customization of the eglot mode line can be added later with an eglot-mode-line-format, as > you suggest. Why not turn the table and consider this to be a problem of project.el, to be solved there? After all, the project-mode-line option belongs to project.el, so the fact that it adds the project name to the mode line too indiscriminately can legitimately be considered to be a problem with that option. Right? On top of that, project-mode-line is new in Emacs 30, whereas Eglot has been showing the project in its mode line before that. So once again, IMO the onus is on project.el to fix this somehow. For example, by not adding this to the mode line in Eglot-controlled buffers. Adding Dmitry to the discussion. From debbugs-submit-bounces@debbugs.gnu.org Sat Jun 29 07:59:22 2024 Received: (at 71823) by debbugs.gnu.org; 29 Jun 2024 11:59:22 +0000 Received: from localhost ([127.0.0.1]:37255 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sNWjh-0005hq-Tq for submit@debbugs.gnu.org; Sat, 29 Jun 2024 07:59:22 -0400 Received: from fhigh8-smtp.messagingengine.com ([103.168.172.159]:53329) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sNWjg-0005hb-KK for 71823@debbugs.gnu.org; Sat, 29 Jun 2024 07:59:21 -0400 Received: from compute7.internal (compute7.nyi.internal [10.202.2.48]) by mailfhigh.nyi.internal (Postfix) with ESMTP id 7BE3911402B0; Sat, 29 Jun 2024 07:59:15 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute7.internal (MEProxy); Sat, 29 Jun 2024 07:59:15 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gutov.dev; h=cc :cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm1; t=1719662355; x=1719748755; bh=XlLRqVHFl7d7YdIz7LZ35ufpsvvwdHgwbyqKo8JY3oQ=; b= nUDDpOv1oMslcH2Hm0YnbXr15pjaG1RoP24/nvTUQ1lhJq4QMnkJ8l+VIF5nCQ4Y Kztf+3bkT2L7RJCAhX9/TM94TWzgX4QQEkAoeGX8P7tRn7qeEH4SC9+Gd70MxKmG 2YEZ/xdxFTT28s0RVqz2GAH64zXi0FZ/K9CyQYxP1DQ7GmigBOC3RcUNzbiUqFN0 9w9jOBW6OLb4/pbNW1vxLNeXWFxDTUr327YHkiLitYVq1t4P/cG7X1Pfj5e0Jfoa Z9dDYQXeIm4soB8O6HlkzW8YovHzPOcQHH3RboEOZoXMw/zbc2vMFLM2wzwhRNN/ hnGqw8zjXC7HYNFRtDBR9w== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=1719662355; x= 1719748755; bh=XlLRqVHFl7d7YdIz7LZ35ufpsvvwdHgwbyqKo8JY3oQ=; b=p 8YFvU3CsccvQiB/UZfXdVFknXhEjZoj/93wVJQvpAr/jQN95+9gXAqZfrAFWm5PC x+o+O9JUmarQ8TaMuTZij65pG1kJMbUJNVO8ONLzBBMxkqv+cqfOC96oS283suuX JI6o772Ya7moIhZhldSuzHJ5mbRZo8f6n4ciTKYh50JMZSBNNi1f9Clut0S8HIzH yHwCY4HIv0VtVshVJKTOvjzymYbhGXwvjnZ2UWkGAyAALzLMfaUSs3EkUMF2qSIm drEaRbDt6pO9+ph2//BTpZV/0Z3WArp7Nm8zfUuzKwCVW7nGAtkyiXMHI8avSct/ X249q5JCnBy9l4k215y3g== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddrtdelgdegjecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefkffggfgfuvfevfhfhjggtgfesthejredttddvjeenucfhrhhomhepffhmihht rhihucfiuhhtohhvuceoughmihhtrhihsehguhhtohhvrdguvghvqeenucggtffrrghtth gvrhhnpeetudeljeegheetgfehgeejkeeuhedvveeikeeufedtvddtveefhfdvveegudej heenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegumh hithhrhiesghhuthhovhdruggvvh X-ME-Proxy: Feedback-ID: i0e71465a:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sat, 29 Jun 2024 07:59:13 -0400 (EDT) Message-ID: <5782856d-9c8f-4903-9d42-143a015fee14@gutov.dev> Date: Sat, 29 Jun 2024 14:59:10 +0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: bug#71823: 31.0.50; project-mode-line and eglot duplicate project-name in mode-line To: Eli Zaretskii , Spencer Baugh References: <86wmm9jfk7.fsf@gnu.org> <86o77kjk87.fsf@gnu.org> Content-Language: en-US From: Dmitry Gutov In-Reply-To: <86o77kjk87.fsf@gnu.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 71823 Cc: joaotavora@gmail.com, 71823@debbugs.gnu.org, Juri Linkov X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) On 29/06/2024 10:12, Eli Zaretskii wrote: > After all, the project-mode-line > option belongs to project.el, so the fact that it adds the project > name to the mode line too indiscriminately can legitimately be > considered to be a problem with that option. Right? It's "discriminate" and off by default. > On top of that, > project-mode-line is new in Emacs 30, whereas Eglot has been showing > the project in its mode line before that. So once again, IMO the onus > is on project.el to fix this somehow. For example, by not adding this > to the mode line in Eglot-controlled buffers. Hard-coding an "unless Eglot" condition seems like a bad idea in terms of abstraction and general code logic. But if you have some specific improvements to suggest, please go ahead. > Adding Dmitry to the discussion. Adding Juri as well. From debbugs-submit-bounces@debbugs.gnu.org Sat Jun 29 08:07:03 2024 Received: (at 71823) by debbugs.gnu.org; 29 Jun 2024 12:07:03 +0000 Received: from localhost ([127.0.0.1]:37272 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sNWr9-0005wC-CB for submit@debbugs.gnu.org; Sat, 29 Jun 2024 08:07:03 -0400 Received: from mail-lj1-f180.google.com ([209.85.208.180]:48358) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sNWqz-0005va-VB for 71823@debbugs.gnu.org; Sat, 29 Jun 2024 08:07:01 -0400 Received: by mail-lj1-f180.google.com with SMTP id 38308e7fff4ca-2ec5779b423so13718571fa.0 for <71823@debbugs.gnu.org>; Sat, 29 Jun 2024 05:06:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1719662753; x=1720267553; darn=debbugs.gnu.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=SSf9vagUNShnqc1/awTxXsHv3qz1KMLj0GErDScZKCo=; b=m6YMTm1AhponRv6Ovq3V24s+Pm/ck3ZAk6u0+VUlahPS/KWpf+43Dy8ZxM3r5yrv80 QmfPvXJqBDhXax7sJIDma0xP0UpZeOxwN7nua76CZg51qNkrsHqadOM8O780VkTrg7Pq XMAHOYGI76V0e56OSgHTD2dK8mYfPr3vfU5H2fKk3l028yC/xJcFcKmuDqy8VCDfZ+qU mrIZZwuEQoqBmzF1OXWA06oY5e/Q1gh2BjT2nLRRKZkTaPwKPjVDzi55gy4Ax3WdUYlH W+ysKIy/YqkIlzofUlmE4lrlyqktQ0CiLQTw6U3fHqXZKp9D8GSU/YGCnZhvX8He9kuR uvtg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719662753; x=1720267553; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=SSf9vagUNShnqc1/awTxXsHv3qz1KMLj0GErDScZKCo=; b=nxJs/FZiGxc+GaocSYYTpNJ/4ADp3XCK/On9SPe+A5G9X4wCxnK7X16n8iqCJOmmrF Oy0jebjGbVwmWJKMntNAzNafnFWXrEKPqJwEYfdbRWPBVgBJoGLv0evb/yYDlQoLHKWI LtWbGDRLulAv8WaDAH0+LXHn0gqpKEgsMdCGJ2qiP5kIPH30WxX6OnBy4jFjXJuhIx5N sSvZQuuLjEVM7Zv6EbVXPkmwMrEuNrRimS5oFhruAlhwBkfKgo0ldHL1EonadLVOzVWk KJcVwWC9mhcq3AAvWaFpG8bDPOyqGX7i2HiTL7DXhMYrO+XE1Xyks0iyU+t1NBsV15DO QpEA== X-Forwarded-Encrypted: i=1; AJvYcCVb4DQmmLZDAH5+S/DJjXm89a+9U9Vw5IG7fYGz6vOiKCS7gQU9F8v24Osee2JOVVqBnFWxwCl8Ez2XSixw82gD57Jb8/4= X-Gm-Message-State: AOJu0YwqizT25m4l0dCHoSNtolLx1BHAZUiQ0+9Nzwr6/SOw1XyUt8ei S6Qbb1CG3Ypaj5HxRoROr5TQJhgbw9FgcqmFsRde40F7Bt7Cfvpnp2D5XbosFKwvWF985V4QOqa 01YUCKIscJDmXJBKVMMnapsV50QQ= X-Google-Smtp-Source: AGHT+IGK+XSRj0sR/Dm9D52kUK+MtfDnfZobOMzwcBXG3qAEGwNP1F+8o1kfbYMW2/vg61NbZl+o+6wIKsBM36nBZjM= X-Received: by 2002:a05:6512:3b88:b0:52c:e180:4eba with SMTP id 2adb3069b0e04-52e8272ab82mr805430e87.62.1719662752727; Sat, 29 Jun 2024 05:05:52 -0700 (PDT) MIME-Version: 1.0 References: <86wmm9jfk7.fsf@gnu.org> <86o77kjk87.fsf@gnu.org> In-Reply-To: <86o77kjk87.fsf@gnu.org> From: =?UTF-8?B?Sm/Do28gVMOhdm9yYQ==?= Date: Sat, 29 Jun 2024 13:05:41 +0100 Message-ID: Subject: Re: bug#71823: 31.0.50; project-mode-line and eglot duplicate project-name in mode-line To: Eli Zaretskii Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 71823 Cc: Spencer Baugh , 71823@debbugs.gnu.org, Dmitry Gutov X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) On Sat, Jun 29, 2024 at 8:12=E2=80=AFAM Eli Zaretskii wrote: > Why not turn the table and consider this to be a problem of > project.el, to be solved there? After all, the project-mode-line That could make sense (and this is nowhere near a serious problem IMHO), but I have to admit that saying the onus being on Eglot is also defensible. The project name is eminently project.el property after all. What Eglot is showing there is the "project nickname": it happens to coincide with the project name for now but in rigour it would be a mnemonic for a "project/language" tuple. So it's not exactly the same thing. I've just never found a good way to express that. > But my goal here isn't to make eglot-mode-line customizable, it's to add = code to make the eglot mode line > automatically avoid duplicating project-name. I understand now, but I still think it's complex and makes the future eglot-mode-line-format implementation harder. In that mode-line-format the 'eglot-mlf-project' symbol could come paired with an optional 'eglot-mlf-project-maybe' that does the check you wnat. Jo=C3=A3o From debbugs-submit-bounces@debbugs.gnu.org Sat Jun 29 08:17:52 2024 Received: (at 71823) by debbugs.gnu.org; 29 Jun 2024 12:17:52 +0000 Received: from localhost ([127.0.0.1]:37311 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sNX1c-0006Fe-AD for submit@debbugs.gnu.org; Sat, 29 Jun 2024 08:17:52 -0400 Received: from fhigh8-smtp.messagingengine.com ([103.168.172.159]:54355) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sNX1a-0006FL-32 for 71823@debbugs.gnu.org; Sat, 29 Jun 2024 08:17:51 -0400 Received: from compute6.internal (compute6.nyi.internal [10.202.2.47]) by mailfhigh.nyi.internal (Postfix) with ESMTP id CCACD11402B6; Sat, 29 Jun 2024 08:17:44 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute6.internal (MEProxy); Sat, 29 Jun 2024 08:17:44 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gutov.dev; h=cc :cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm1; t=1719663464; x=1719749864; bh=euKe05E32MTeBXcPEImDLbIDd2hvVx4YVVKkPFXyHrI=; b= sCy3jp5cYHaizYVF1AWpHq/JFsBh2YG+Y108cgRGWG73nfMr8G9BlJV/CDTAr+6M YMTliw5QOKIPIiEK624Asj11rHresLKj5umIM1jaOCDqIm57v6p2c159sFpCVLGr MK5pItLTYcKjF3j4Ijxxs5GmDobMZKj37JfeesG3r/EU1L5srVzXcHIu1x5y1S9G 9uaot/xU3/STDdCA40A4u80NH0dASZEHBNkqXPCKELa7k1ZAvFH1f3oFj5lOEjGC u6o8zcv6ALoZeRlNLMassBaxaAXRv6OY0zbwhKANtDresoBUZqBVp7mat4eUMLpb FEYAfddabioXXEi4MaxpfQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=1719663464; x= 1719749864; bh=euKe05E32MTeBXcPEImDLbIDd2hvVx4YVVKkPFXyHrI=; b=U H0uyrzPeRY/I3M7z+5yarVUFLC0q9pJFk96m6MBq/SRkjsHo1KcDm/+3DMH2w+/a t8ffYMpYv5LeDe2KwhEeZezongcoFOnam19meaHYRO7A0jKwXRzUyKU/kRpBZBG5 73hW2pQUXR+Etfgwir6nI5A/8D7UkthPIuSAmu9qmMx4mftbbP9clUGiNf8I4FKZ pqlPs2ZDHIyZoWLQF6xRw6/MJRPXWhWbxvF3m0g4nKPWe5yN4OFyNcFSj6CiXwu2 czb+FSeorwGYQfO0BjbewmMeuxjz72Y/PTuf4dPCZYEiUz+axM9321wEUPTHUhmW yVg7SqAFdQunVKrCDUq1g== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddrtdelgdehudcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefkffggfgfuvfevfhfhjggtgfesthekredttddvjeenucfhrhhomhepffhmihht rhihucfiuhhtohhvuceoughmihhtrhihsehguhhtohhvrdguvghvqeenucggtffrrghtth gvrhhnpeegleefteekgffhvdfhtdegveevveetteegteevgeettdehhfdukeetheffueek keenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegumh hithhrhiesghhuthhovhdruggvvh X-ME-Proxy: Feedback-ID: i0e71465a:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sat, 29 Jun 2024 08:17:43 -0400 (EDT) Message-ID: <17183c60-1733-4938-9a85-f3351c87bcb9@gutov.dev> Date: Sat, 29 Jun 2024 15:17:41 +0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: bug#71823: 31.0.50; project-mode-line and eglot duplicate project-name in mode-line To: =?UTF-8?B?Sm/Do28gVMOhdm9yYQ==?= , Eli Zaretskii References: <86wmm9jfk7.fsf@gnu.org> <86o77kjk87.fsf@gnu.org> Content-Language: en-US From: Dmitry Gutov In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 71823 Cc: Spencer Baugh , 71823@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) On 29/06/2024 15:05, João Távora wrote: > On Sat, Jun 29, 2024 at 8:12 AM Eli Zaretskii wrote: > >> Why not turn the table and consider this to be a problem of >> project.el, to be solved there? After all, the project-mode-line > That could make sense (and this is nowhere near a serious problem IMHO), > but I have to admit that saying the onus being on Eglot is also defensible. > The project name is eminently project.el property after all. What Eglot > is showing there is the "project nickname": it happens to coincide with > the project name for now but in rigour it would be a mnemonic for a > "project/language" tuple. So it's not exactly the same thing. I've > just never found a good way to express that. Either way, it might make sense for Eglot to check out that project.el's variable and choose the format accordingly. But an independent way to customize it in Eglot can work fine too (like the customizable mode-line you proposed). From debbugs-submit-bounces@debbugs.gnu.org Sat Jun 29 08:22:39 2024 Received: (at 71823) by debbugs.gnu.org; 29 Jun 2024 12:22:39 +0000 Received: from localhost ([127.0.0.1]:37320 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sNX6F-0006Od-Bd for submit@debbugs.gnu.org; Sat, 29 Jun 2024 08:22:39 -0400 Received: from mail-lf1-f48.google.com ([209.85.167.48]:51376) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sNX6D-0006OO-9a for 71823@debbugs.gnu.org; Sat, 29 Jun 2024 08:22:37 -0400 Received: by mail-lf1-f48.google.com with SMTP id 2adb3069b0e04-52cdcd26d61so1623405e87.2 for <71823@debbugs.gnu.org>; Sat, 29 Jun 2024 05:22:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1719663691; x=1720268491; darn=debbugs.gnu.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=PmToIDPIlGS3kLsXaCK0ob0bgMpnbCz2BzTCJtWicZU=; b=Uike72b4lFPLVv3+uk6GX9vA2KJ8krS8+/U/VRJ8bN4rWNQwmu3pId7rxCIlUUvgKf 5oHuH5STe9mWv2L2s+V4irmn0AGOAJ3c/bz37IMaRjZTeKcMIzhCCNKbebFbDc1qq+a8 75A7Og2Y5DYghbeXcU7TZ1pLKK2O9JzzYseUf5TnRqsHPoiXpgaRcULJ04NDTLV8tlWL a8ZdqVV7oIXfy8fSeh+u5qvr1YEXVJ/I99zJFxfVmex8BDJJTGAD5Sp0gbG0NYLW09b5 NBG3KLJKiNEWv5zkGtj4jvtpMZFZDSYDZXSYsOi/s4gGrAaESXFAR5lZMTinMGdRnI20 WQQg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719663691; x=1720268491; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=PmToIDPIlGS3kLsXaCK0ob0bgMpnbCz2BzTCJtWicZU=; b=hMA6mlYBtBWAYUbHTuZlRkxJDXKeRfW+vVWqxzPL58g4Iig+dW6vfxOuTZGJ3lFjPC z3pMWC1ULALmu1Xb3Oo2xgT6KDb6Qcw05s1BePz8FaiXQ06hDnQg5+jP7uBx9NKoYCmJ F7oNtG4/2T3x680wZM/Qh0Z4H4o/aX9Npr6R9t4lYR68HegbA34eBqMP20+R17Nq/BaC barY0ytHqpeTz9qn89aIHJP/0htaIn60Qgq/xpE8cHu6qXBeByQPTVgSTyGPMBRUjKGc QthDx+TzORvKIonAgFpphKAVqU4IGZ7NBNyJEHC+gdJLUU3+xOrZiigcxbcvf7fTvmBf H5BA== X-Forwarded-Encrypted: i=1; AJvYcCWQvdAslNykD6htm9NOny7VpeTwr+HvgH7Og3RQJgRY7ENyV67dDSmgP5sX7O5OVEjpGPY4AppSrpU8NJGL/Fijyb8Fx20= X-Gm-Message-State: AOJu0YzXQQM+TO0v1veAMInNAaf2unFQq6k9DO+f9jD/0Z9t5KFfTVuO iuE8DkYInh/y5G6kDtxXToi6UtkAfPPNmMhBnn6fH89mFIXehaemJUGrRpwMLMNZRJjaMmjjQKw LoUEDDNIPnsheXsiYgtFvdmJhY9iqgQ== X-Google-Smtp-Source: AGHT+IG2b3GrmOnGk8RN0E3UUT4dqm6DQa33aKAHDKjN5Wf/PjUpOtOiBnv6kP2hXNBMILlrYKnpePBXYG8ujEYiQWc= X-Received: by 2002:a05:6512:61b:b0:52c:ea28:8442 with SMTP id 2adb3069b0e04-52e82666472mr578318e87.20.1719663691406; Sat, 29 Jun 2024 05:21:31 -0700 (PDT) MIME-Version: 1.0 References: <86wmm9jfk7.fsf@gnu.org> <86o77kjk87.fsf@gnu.org> <17183c60-1733-4938-9a85-f3351c87bcb9@gutov.dev> In-Reply-To: <17183c60-1733-4938-9a85-f3351c87bcb9@gutov.dev> From: =?UTF-8?B?Sm/Do28gVMOhdm9yYQ==?= Date: Sat, 29 Jun 2024 13:21:20 +0100 Message-ID: Subject: Re: bug#71823: 31.0.50; project-mode-line and eglot duplicate project-name in mode-line To: Dmitry Gutov Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 71823 Cc: Spencer Baugh , Eli Zaretskii , 71823@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) On Sat, Jun 29, 2024 at 1:17=E2=80=AFPM Dmitry Gutov wro= te: > Either way, it might make sense for Eglot to check out that project.el's > variable and choose the format accordingly. Yes, and that's what the proposed eglot-mlf-project-maybe element to the custom variable eglot-mode-line-format would do. From debbugs-submit-bounces@debbugs.gnu.org Sat Jun 29 08:42:01 2024 Received: (at 71823) by debbugs.gnu.org; 29 Jun 2024 12:42:01 +0000 Received: from localhost ([127.0.0.1]:37366 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sNXOz-0006wY-3N for submit@debbugs.gnu.org; Sat, 29 Jun 2024 08:42:01 -0400 Received: from mxout5.mail.janestreet.com ([64.215.233.18]:56093) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sNXOx-0006wI-8B for 71823@debbugs.gnu.org; Sat, 29 Jun 2024 08:41:59 -0400 Received: from mail-ed1-f71.google.com ([209.85.208.71]) by mxgoog2.mail.janestreet.com with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) (Exim 4.97.1) id 1sNXOr-000000034Tj-2cbi for 71823@debbugs.gnu.org; Sat, 29 Jun 2024 08:41:53 -0400 Received: by mail-ed1-f71.google.com with SMTP id 4fb4d7f45d1cf-584ef6c00c0so3503795a12.1 for <71823@debbugs.gnu.org>; Sat, 29 Jun 2024 05:41:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=janestreet.com; s=google; t=1719664912; x=1720269712; darn=debbugs.gnu.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=QMPiIcXqBeyocIRzLSQ3xnpHJMMVaFSBPSRejP7PQdk=; b=hdcvqvZ5xyf9XDcKeIMHlkS4YvTn0/rqH6Oo1P/HtHHsPM714vxXVzU7rmcylLqfG9 UXNEVwwFOBe9I3gEHfEcNbdyHT67wqNamVmLZCv1GLqSGqwEc/jbr6mqf2uBALyCD3Ay 5stfpcDBxn5nw3jAIjRv0HLKr2rnTPUSmvIDY= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=janestreet.com; s=waixah; t=1719664913; bh=QMPiIcXqBeyocIRzLSQ3xnpHJMMVaFSBPSRejP7PQdk=; h=References:In-Reply-To:From:Date:Subject:To:Cc; b=uI4FL+Mjc22YYDyKdUKNK7NGJWe++Wh/r2zoTzT7Qa/FrPcnQC9hD4H/o+2KfxnmG BJI9bzoWKuAPtPwdF4o61K7M25dPufYO0KLAbQ6b1gUSMKsHCWrQE+ql9pzVzZLSjc p3rGhecRHcQwIf8rS1+xzD579ZeXE3LSuukg8RaZ1YC28jmzw84ce8Ubb2JQPhsah1 /Vv8PGuDvJFxCcpU9/4V3NKV5w258809MbjD4Lsk1IDt4IF8mzRhDzqHO+0wqweebJ B6KwrhfKtED0WFNwbUAJxBUXJ6Be//8psFGVxwkGoQfEzKEqbzK1AZGrMei7BviTb8 b9wDC87Fok2MQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719664912; x=1720269712; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=QMPiIcXqBeyocIRzLSQ3xnpHJMMVaFSBPSRejP7PQdk=; b=FenS1T/llFdQNpjMGWNbCvqajVmD+gLXU22qUgs40d/1oNgAkuKfDgN6+b+E6wAUJ4 UYyJJcsTtvM/pa6Jt+8vqgMuy6VG3esIxDrwonwA74luA0aHMa91VvjpI+L/iVLKfJrE LLzv7cT5PqL8TP+axnZsMLGdBvZw85d8KebQNdU7phv1XkXlXXBFEyjAAi0s4uCy7my6 P2UVTUwRazSDTvHt0y55ZF0om5lkPEPxxtuINi5HNWWDGSpK/tiK6IYL8IjAovoiuji9 BbR9vKe36P13Nwgh/OMT6A0VHrBu6o960zjmjno0Hf8+uyD9twvk4/zuY9m51Eo/MC1q ZQhQ== X-Forwarded-Encrypted: i=1; AJvYcCWYPXcgpQxVwfjt+bmowQIYdsxgwi41yZJDSNcBgo30gBWX9VAkfZilSkW4tytZrb9mzY4PU2OYYMINHri40DzJ5NmLb3o= X-Gm-Message-State: AOJu0Yw7TfR1BNHEMk3xgdJMgYSJjwrVji5gbVQXiMPdBI+SISr9m0OG f/Ib5r1nZ+1/TEg1g4cutInnrZVpYamFZig6Eb0EsPBd8wFyAdB3FtUntX5iD7YX5xJKu3RpzzP iq/4RcB/tGAsdp+0L9ho6M9VcxMNvOcjJZK2wKWJwihrS+tiNH9PJidTWhiBxP3ZaPwlMyuL5Nn VfWFiIZxPbYmBAUUWWHP1yh5A/sw== X-Received: by 2002:a17:907:7ba1:b0:a6f:dbd1:b493 with SMTP id a640c23a62f3a-a72aee3ceb2mr415546866b.7.1719664912648; Sat, 29 Jun 2024 05:41:52 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG7cv43qwf9BbXpDVsO5WMXZ/p1cWDXing5RCa2RrCmptfh6ywqv6i5T/2XOw5zBb8hTvSDI4H8CZsTOdrUTmU= X-Received: by 2002:a17:907:7ba1:b0:a6f:dbd1:b493 with SMTP id a640c23a62f3a-a72aee3ceb2mr415545866b.7.1719664912227; Sat, 29 Jun 2024 05:41:52 -0700 (PDT) MIME-Version: 1.0 References: <86wmm9jfk7.fsf@gnu.org> <86o77kjk87.fsf@gnu.org> <17183c60-1733-4938-9a85-f3351c87bcb9@gutov.dev> In-Reply-To: From: Spencer Baugh Date: Sat, 29 Jun 2024 08:41:43 -0400 Message-ID: Subject: Re: bug#71823: 31.0.50; project-mode-line and eglot duplicate project-name in mode-line To: =?UTF-8?B?Sm/Do28gVMOhdm9yYQ==?= Content-Type: multipart/alternative; boundary="00000000000039f993061c06b0e2" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 71823 Cc: Dmitry Gutov , Eli Zaretskii , 71823@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --00000000000039f993061c06b0e2 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Sat, Jun 29, 2024, 8:21=E2=80=AFAM Jo=C3=A3o T=C3=A1vora wrote: > On Sat, Jun 29, 2024 at 1:17=E2=80=AFPM Dmitry Gutov w= rote: > > > Either way, it might make sense for Eglot to check out that project.el'= s > > variable and choose the format accordingly. > > Yes, and that's what the proposed eglot-mlf-project-maybe element to > the custom variable eglot-mode-line-format would do. > In the new variable, I think eglot-mlf-project-maybe should be the default, since it's essentially always the better behavior. If you agree it should be the default in the future customizable variable, can we just make the change now when it's not customizable? > --00000000000039f993061c06b0e2 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Sat, Jun 29, 2024, 8:21=E2=80=AFAM Jo=C3=A3o T=C3=A1vora &l= t;joaotavora@gmail.com> wrote:
On Sat, Jun 29, 2024 at 1:17=E2=80=AFPM Dmitry Gutov <dmit= ry@gutov.dev> wrote:

> Either way, it might make sense for Eglot to check out that project.el= 's
> variable and choose the format accordingly.

Yes, and that's what the proposed eglot-mlf-project-maybe element to the custom variable eglot-mode-line-format would do.
=

In the new variable, I = think eglot-mlf-project-maybe should be the default, since it's essenti= ally always the better behavior.=C2=A0

If you agree it should be the default in the future customiz= able variable, can we just make the change now when it's not customizab= le?
--00000000000039f993061c06b0e2-- From debbugs-submit-bounces@debbugs.gnu.org Sat Jun 29 08:43:46 2024 Received: (at 71823) by debbugs.gnu.org; 29 Jun 2024 12:43:47 +0000 Received: from localhost ([127.0.0.1]:37372 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sNXQR-0006zN-PO for submit@debbugs.gnu.org; Sat, 29 Jun 2024 08:43:46 -0400 Received: from eggs.gnu.org ([209.51.188.92]:43826) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sNXQP-0006z8-Th for 71823@debbugs.gnu.org; Sat, 29 Jun 2024 08:43:30 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sNXQJ-0000op-9O; Sat, 29 Jun 2024 08:43:23 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=Dkt2kEnPc01Dgvy2s/KZ5tFeKXUTMoMeqVe+pFKCrRA=; b=SMDzbH6iU7LcY/LaMVWw EM69LkyZkQRVMQyBMUIckfCF49tLnUpVixpaa60KeoWMtse90pu6uXpOSK9gzwjqhiKHM9Ha2fn6a aQpWanrDE3jQXmLs+bDqvybd5JepYRe1fMaMDMGNX6slbvzAkTZYo4Jx87VPblD4vH896vUYJRPEM S2CaJEBWepTZ8UoIfiWSriVwpGSB+y9ka+WvSo5jbRTp+IsPmtwgQnI85tOuH4ilVlx/JYfm6NMFz cHozWGBDffEozcjQBbomlU8wvbKtQC2qL5WvXKajqOi0NE5TAZnXMJSOfZf7zxmpTt6vxHRyXn4MD AVrrX3h7TdBS/g==; Date: Sat, 29 Jun 2024 15:43:17 +0300 Message-Id: <86sewvj4wq.fsf@gnu.org> From: Eli Zaretskii To: Dmitry Gutov In-Reply-To: <5782856d-9c8f-4903-9d42-143a015fee14@gutov.dev> (message from Dmitry Gutov on Sat, 29 Jun 2024 14:59:10 +0300) Subject: Re: bug#71823: 31.0.50; project-mode-line and eglot duplicate project-name in mode-line References: <86wmm9jfk7.fsf@gnu.org> <86o77kjk87.fsf@gnu.org> <5782856d-9c8f-4903-9d42-143a015fee14@gutov.dev> MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 71823 Cc: sbaugh@janestreet.com, joaotavora@gmail.com, 71823@debbugs.gnu.org, juri@linkov.net X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > Date: Sat, 29 Jun 2024 14:59:10 +0300 > Cc: joaotavora@gmail.com, 71823@debbugs.gnu.org, Juri Linkov > From: Dmitry Gutov > > On 29/06/2024 10:12, Eli Zaretskii wrote: > > After all, the project-mode-line > > option belongs to project.el, so the fact that it adds the project > > name to the mode line too indiscriminately can legitimately be > > considered to be a problem with that option. Right? > > It's "discriminate" In what way? > and off by default. Sure, I meant when the option is turned on. > > On top of that, > > project-mode-line is new in Emacs 30, whereas Eglot has been showing > > the project in its mode line before that. So once again, IMO the onus > > is on project.el to fix this somehow. For example, by not adding this > > to the mode line in Eglot-controlled buffers. > > Hard-coding an "unless Eglot" condition seems like a bad idea in terms > of abstraction and general code logic. I agree, but Spencer's patch did the same in the opposite direction. > But if you have some specific improvements to suggest, please go > ahead. I don't, but maybe someone else does. AFAIU, João suggested something like that as well. So we all agree about the way to solve it, and we "just" need a patch that implements such a solution. From debbugs-submit-bounces@debbugs.gnu.org Sat Jun 29 17:46:37 2024 Received: (at 71823) by debbugs.gnu.org; 29 Jun 2024 21:46:37 +0000 Received: from localhost ([127.0.0.1]:53885 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sNfu1-0001xo-3Y for submit@debbugs.gnu.org; Sat, 29 Jun 2024 17:46:37 -0400 Received: from mxout1.mail.janestreet.com ([38.105.200.78]:34759) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sNftz-0001xc-Lw for 71823@debbugs.gnu.org; Sat, 29 Jun 2024 17:46:36 -0400 Received: from mail-ed1-f72.google.com ([209.85.208.72]) by mxgoog2.mail.janestreet.com with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) (Exim 4.97.1) id 1sNYzz-000000038yE-3PWY for 71823@debbugs.gnu.org; Sat, 29 Jun 2024 10:24:19 -0400 Received: by mail-ed1-f72.google.com with SMTP id 4fb4d7f45d1cf-57cad3fa0a1so1510217a12.1 for <71823@debbugs.gnu.org>; Sat, 29 Jun 2024 07:24:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=janestreet.com; s=google; t=1719671058; x=1720275858; darn=debbugs.gnu.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=xBfRoQuUVFLkwQgxHSf7it/LOJCJrnezi7PCoXshhs4=; b=w0qu9T9LAri5Kdwgud88a3GGJU3hp4SOreJAab7EawV0kt89V7A9hMWxf4ES9MhSBs dSnpJXf1BfNtSqAKtYPqgEGA8wWGJBVwIF/3JAiEX7h5i6CW/JQD1E5u4VZ+nzKoKWNm uu2Tye85dGL8CQFWOM3cYVHEMzHIIgpzCYqsY= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=janestreet.com; s=waixah; t=1719671059; bh=xBfRoQuUVFLkwQgxHSf7it/LOJCJrnezi7PCoXshhs4=; h=References:In-Reply-To:From:Date:Subject:To:Cc; b=wz3B6ccvqYh037JmOPlyN1rTXaGtYa+OL1+98vYcUI5Asarra5dfxoDHHCcAaqsn1 0vhegLuhnkAvnFXt/BPIpNmVai2YxTPvEM3hC7WsaGjhgpWCZMyRR9z/dYCRi54HIN zJ0meH74A5dUvZlaxgE9MOsHPdUkW0ik/3RcY7Ypwpih/ZVVIn62PuuVDRLmjTBMMA Qs+Tu325Bo0Hy6HK30UwGWXzjdXHTWXAYGGVVNW+DYOeHB2sQrhnfcXE7yJQHrVn24 dWnGuFye/x5N4AgwEOmYhdtWFT3gWq5nsVmsbmckbTP/efD5ST8RAgw9rBETwLbOhN N0QNp3YOXGMAA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719671058; x=1720275858; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=xBfRoQuUVFLkwQgxHSf7it/LOJCJrnezi7PCoXshhs4=; b=D4NbCCehIjiW9Ad1ndnrx04mERRVbcHNHU13zzEG4oAPz+WDiNoBQ8h33h89PRw7LC GQFFp8jr6YCd+lkBicw9yJLVDIuGJUH2n6tYvfUd8wxl2V3LbqPgluDXz6Krj/ijLFaK RoFagA7KE1xj5OjPgghsZ71S0evzwNldNrYm+T6hECB0ACqxz7yqQixi9X3+TzMlIygH sVlqtFpmHJ0RSTZubfXYUYGWHU2gFW7HzfBmVhP5+SChaDqZyM5ap2tFgooDU55eSa8+ bC9ZsrIGJISLMxvMmi/5dODkXGGnV4fRoL56vyMK2hXXWgamQchMYQ3uSblar0lVIzar 2mew== X-Forwarded-Encrypted: i=1; AJvYcCX1m5rfdWrxAb7LCj7AM2551xN2N55P5t89NSOvrlUn4VPPt8RiXLdUQpFsft+rQb4WWsUTCP5WR9rrzy/UklGKgDeLCY0= X-Gm-Message-State: AOJu0YwCEdMcgv+TecgWM+gDOO9YGka0hb4kVRQsZOGJSgJoJuNBE6TT DNZRl72CNEIdFm0DmJl4JtnTNVAr6REuX9ExM+AmeT6fBmMoNjzmvjShbP/Y48QDQwG+QB2JPfZ 1U1prhTXGkA/KfiPvpMsvDcvnZ6c3NS1J1zeF8HtOiYgfqaonzZOINAJxidbXDy8AmA/Yja0xGo et5g6coxRPdmb6NE+WF6jCWGWA93BIGtvVcA== X-Received: by 2002:a17:907:988:b0:a6f:4fc8:2658 with SMTP id a640c23a62f3a-a751440b8eamr75196966b.14.1719671058662; Sat, 29 Jun 2024 07:24:18 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGDAOma2qWrjNN4O5Kw0lkHz3/O5+CUTeE89cO9nP3lacC16HryWN+C+1k8OR0pelnCfj+/LRHl2I2Cc5Hks+E= X-Received: by 2002:a17:907:988:b0:a6f:4fc8:2658 with SMTP id a640c23a62f3a-a751440b8eamr75195566b.14.1719671058214; Sat, 29 Jun 2024 07:24:18 -0700 (PDT) MIME-Version: 1.0 References: <86wmm9jfk7.fsf@gnu.org> <86o77kjk87.fsf@gnu.org> <17183c60-1733-4938-9a85-f3351c87bcb9@gutov.dev> In-Reply-To: From: Spencer Baugh Date: Sat, 29 Jun 2024 10:24:09 -0400 Message-ID: Subject: Re: bug#71823: 31.0.50; project-mode-line and eglot duplicate project-name in mode-line To: =?UTF-8?B?Sm/Do28gVMOhdm9yYQ==?= Content-Type: multipart/alternative; boundary="0000000000008e4a5b061c081e6f" X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 71823 Cc: Dmitry Gutov , Eli Zaretskii , 71823@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --0000000000008e4a5b061c081e6f Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Sat, Jun 29, 2024, 8:41=E2=80=AFAM Spencer Baugh = wrote: > On Sat, Jun 29, 2024, 8:21=E2=80=AFAM Jo=C3=A3o T=C3=A1vora wrote: > >> On Sat, Jun 29, 2024 at 1:17=E2=80=AFPM Dmitry Gutov = wrote: >> >> > Either way, it might make sense for Eglot to check out that project.el= 's >> > variable and choose the format accordingly. >> >> Yes, and that's what the proposed eglot-mlf-project-maybe element to >> the custom variable eglot-mode-line-format would do. >> > > In the new variable, I think eglot-mlf-project-maybe should be the > default, since it's essentially always the better behavior. > > If you agree it should be the default in the future customizable variable= , > can we just make the change now when it's not customizable? > Or, here's an alternative idea, more aggressive: What if Eglot just sets project-mode-line=3Dt in eglot-managed buffers, and removes the project-name from the Eglot entry entirely? Then the language identifier would be the major mode, the project identifier would be project-mode-line, and the eglot status indicator would just be for the status of the server. > --0000000000008e4a5b061c081e6f Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable



--0000000000008e4a5b061c081e6f-- From debbugs-submit-bounces@debbugs.gnu.org Sat Jun 29 20:26:54 2024 Received: (at 71823) by debbugs.gnu.org; 30 Jun 2024 00:26:54 +0000 Received: from localhost ([127.0.0.1]:54174 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sNiP8-0006lH-7V for submit@debbugs.gnu.org; Sat, 29 Jun 2024 20:26:54 -0400 Received: from mail-lf1-f49.google.com ([209.85.167.49]:50633) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sNiP5-0006l2-SX for 71823@debbugs.gnu.org; Sat, 29 Jun 2024 20:26:52 -0400 Received: by mail-lf1-f49.google.com with SMTP id 2adb3069b0e04-52cdbc20faeso2599640e87.1 for <71823@debbugs.gnu.org>; Sat, 29 Jun 2024 17:26:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1719707145; x=1720311945; darn=debbugs.gnu.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=Nk0c1efJ8RNUzWTZ59owQlo85k7sIpAbAw6WynxIYHE=; b=VadXe2navgYLqDy+SF/NoWn7J3/ab12eI3t72ydJhcdP1+dX1iXzr96dIHD2cofh9R tjJb2wW2Jso13FULstcJgvKmXKYpVu6bObyUXZaRoaWVPN8QUl+3y1gqupEvuo/iWGFe u/F8Vt5WYn34M9SIZyNF+w8Esn56myHZanqRwlnO1XnnNs61BYEVWkpVub28OI6N5r3y Mxtud7wAaBYyPcpaVHPbwVB7ZJrC5wenHbF5nXwVoowhVBqZ70u+FYPJcN/WXN52EVXS gWD50YLclmuMyAVSWTHPDiAMh8B4vUVEsNjT2O89BGo4pRRoFGgoMtF5L6Jc4ZvZCHUd 6D9A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719707145; x=1720311945; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=Nk0c1efJ8RNUzWTZ59owQlo85k7sIpAbAw6WynxIYHE=; b=wPdUCvh3LSsiUy5s+FBm8G1ul0EnhEB+K48IGzKH+Cm6p/riNg7NVLvDmoBEQSTU+U akSRdEAdF+LEZc2mpEyCbsx6akRg4sLthVV7IzyY7mOMcnNnVj/ZarIAj31r/LGBcdst 0jClcJzQD9maGpnbehDL/QM5HCAbwIUfw5L+gmiWloXroqG/ttgfcnWK5tsubWz9TMUD kLri4koYeiTWygtwhDDqszA1QIkILNQXS1BTe+pOAcf92pNn2tc8TmK+elmYRbi5adM6 kMVqD4nSKI1KEAtUUXlvM49b1O3YVuXl0SIfen/CLxMoKewE1cLd1A5kRombQ0msZcLa CyKA== X-Forwarded-Encrypted: i=1; AJvYcCWZeJXaZN41ix0iYirolhxwzDrFuQFO616quFXkXvtJeU1nEn8ReIRoCzL0hjADyYQkpyx71ozalaf2jICWLOQL2FgHzp0= X-Gm-Message-State: AOJu0Yxv/dC6epCmdEETjFEVSOjjogbYzjib07YgQQ2pBhEEZ9s3W0cX WueQghOWgLqlQoClwYgaaiBiFp/Bho88rmS19HooqTBcBex2OpBT9+HJkwMl61AsLI7pLDoiev3 RZr6OU3tZ8RBxE9i6/1RS2cJ+POA= X-Google-Smtp-Source: AGHT+IFdJYmwXYBbvxQ9eBxg77p+DmpxPUMsuTXr+lTPGjYfuDWKhxpQykopw0PVcAXs3wOtZxrXeFpfDhG8GtUi89k= X-Received: by 2002:a05:6512:61b:b0:52c:ea28:8442 with SMTP id 2adb3069b0e04-52e82666472mr1218509e87.20.1719707144530; Sat, 29 Jun 2024 17:25:44 -0700 (PDT) MIME-Version: 1.0 References: <86wmm9jfk7.fsf@gnu.org> <86o77kjk87.fsf@gnu.org> <17183c60-1733-4938-9a85-f3351c87bcb9@gutov.dev> In-Reply-To: From: =?UTF-8?B?Sm/Do28gVMOhdm9yYQ==?= Date: Sun, 30 Jun 2024 01:25:32 +0100 Message-ID: Subject: Re: bug#71823: 31.0.50; project-mode-line and eglot duplicate project-name in mode-line To: Spencer Baugh Content-Type: multipart/alternative; boundary="00000000000077b1a6061c1085d0" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 71823 Cc: Dmitry Gutov , Eli Zaretskii , 71823@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --00000000000077b1a6061c1085d0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Sat, Jun 29, 2024, 15:24 Spencer Baugh wrote: > Or, here's an alternative idea, more aggressive: > > What if Eglot just sets project-mode-line=3Dt in eglot-managed buffers, a= nd > removes the project-name from the Eglot entry entirely? > > Then the language identifier would be the major mode, the project > identifier would be project-mode-line, and the eglot status indicator wou= ld > just be for the status of the server. > Works for me, it's in line with Eglot's policy of setting other modes when managing buffers. Show a patch. But also, my idea of eglot-mode-line-format should be alsoh considered. AFAICT there no big technical hurdle, it's just relatively boring work and some naming decisions to make. And as I mentioned, it would fix more issues than just the one at hand. Jo=C3=A3o > --00000000000077b1a6061c1085d0 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable



=
Or, here&#= 39;s an alternative idea, more aggressive:

What if Eglot just sets project-mode-lin= e=3Dt in eglot-managed buffers, and removes the project-name from the Eglot= entry entirely?

Then th= e language identifier would be the major mode, the project identifier would= be project-mode-line, and the eglot status indicator would just be for the= status of the server.

Works for me, it's in line with Eglot'= ;s policy of setting other modes when managing buffers. Show a patch.=C2=A0=

But also, my idea of eg= lot-mode-line-format should be alsoh considered. AFAICT there no big techni= cal hurdle, it's just relatively boring work and some naming decisions = to make. And as I mentioned, it would fix more issues than just the one at = hand.

Jo=C3=A3o
--00000000000077b1a6061c1085d0-- From debbugs-submit-bounces@debbugs.gnu.org Sun Jun 30 02:55:55 2024 Received: (at 71823) by debbugs.gnu.org; 30 Jun 2024 06:55:55 +0000 Received: from localhost ([127.0.0.1]:54752 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sNoTa-0006iD-Sb for submit@debbugs.gnu.org; Sun, 30 Jun 2024 02:55:55 -0400 Received: from relay5-d.mail.gandi.net ([217.70.183.197]:41605) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sNoTZ-0006hz-Pa for 71823@debbugs.gnu.org; Sun, 30 Jun 2024 02:55:54 -0400 Received: by mail.gandi.net (Postfix) with ESMTPSA id 859C01C0003; Sun, 30 Jun 2024 06:55:25 +0000 (UTC) From: Juri Linkov To: Dmitry Gutov Subject: Re: bug#71823: 31.0.50; project-mode-line and eglot duplicate project-name in mode-line In-Reply-To: <5782856d-9c8f-4903-9d42-143a015fee14@gutov.dev> (Dmitry Gutov's message of "Sat, 29 Jun 2024 14:59:10 +0300") Organization: LINKOV.NET References: <86wmm9jfk7.fsf@gnu.org> <86o77kjk87.fsf@gnu.org> <5782856d-9c8f-4903-9d42-143a015fee14@gutov.dev> Date: Sun, 30 Jun 2024 09:50:36 +0300 Message-ID: <86jzi7q71j.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/31.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-GND-Sasl: juri@linkov.net X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 71823 Cc: Spencer Baugh , Eli Zaretskii , joaotavora@gmail.com, 71823@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) >> After all, the project-mode-line >> option belongs to project.el, so the fact that it adds the project >> name to the mode line too indiscriminately can legitimately be >> considered to be a problem with that option. Right? > > It's "discriminate" and off by default. > >> On top of that, >> project-mode-line is new in Emacs 30, whereas Eglot has been showing >> the project in its mode line before that. So once again, IMO the onus >> is on project.el to fix this somehow. For example, by not adding this >> to the mode line in Eglot-controlled buffers. > > Hard-coding an "unless Eglot" condition seems like a bad idea in terms of > abstraction and general code logic. I completely agree. When a user explicitly expressed the wish to display the project name in the middle of the mode line by customizing project-mode-line to t, this means there is no need to duplicate it at the end of the mode line with Eglot information. This will make the mode line shorter. Ideally, everything should be customizable by two new Eglot options: eglot-mode-line-format and eglot-mode-line-position (e.g. middle/end). From debbugs-submit-bounces@debbugs.gnu.org Sun Jun 30 06:26:32 2024 Received: (at 71823) by debbugs.gnu.org; 30 Jun 2024 10:26:32 +0000 Received: from localhost ([127.0.0.1]:55171 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sNrlP-0001CV-Rf for submit@debbugs.gnu.org; Sun, 30 Jun 2024 06:26:32 -0400 Received: from mail-lf1-f48.google.com ([209.85.167.48]:49259) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sNrlO-0001CM-34 for 71823@debbugs.gnu.org; Sun, 30 Jun 2024 06:26:30 -0400 Received: by mail-lf1-f48.google.com with SMTP id 2adb3069b0e04-52cdf4bc083so2870593e87.2 for <71823@debbugs.gnu.org>; Sun, 30 Jun 2024 03:26:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1719743129; x=1720347929; darn=debbugs.gnu.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=xcv7JGix6cP5L/4PrQHH4M2Ej04tyHiiT927M7eIazk=; b=motx8BKY4rbY76QPdaulmYVT+WpJz7mh6SYn0P0J1ywufsKchD0v23iHnvQ8vMJ5WT dIOQQr8q/6zH+7Is66r1X4CYq5cKXNHFn/MGIo+sDc3qbTqR4D9XCfXjAzxVYFAd0O36 tssYkEVH2mHHas6sT9vEN8YgVUUHuZWEqnT2yX8CQB39MizUENvXrUiudCjB7uopqr0k pXFzfpt1/1IBhbDDleP/DtY6hd0j5CeCSkt9QPmuIOlGp+Kv7BBZEW1MIU2nLbfC+aru HPmVoe7c74nlxtdNUN4tjo9jg6KKOy9Am437wgo6/pUvk1ubMBMDXUOyWVj3rdKiEIaD epTA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719743129; x=1720347929; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=xcv7JGix6cP5L/4PrQHH4M2Ej04tyHiiT927M7eIazk=; b=S4WqCdg9LcVdRXBvazb5xubrmWeGtyInAd3dAQ1oUNgnNJPby8Br5JzautMEN3LeDP aGjnm7vFpiCYsY1+qNlcNf9XfuJlY5jbbytSea60fdHxEWJDexJ1Q1FnJa7k3UgMKaEd jgKXWcqtL5e34goZ4geKB0VP8wa+mq3IuxGjb1uR7PkEDg+pgu7vFymgKaJ9trpyffZH V7+KXZv2vq02oA+r74vq74fRxf5tGwY0LX9Mb4kknio9KKls5XiTw1qMedSsepZ55Hpp YPotGLxkIgOzmGCzRmD8P8f+fGGH5KJ2MC6rFRSKTwX8/psutE60UlB+KPrkFCYVFCcZ biPw== X-Forwarded-Encrypted: i=1; AJvYcCUFoawZnBx5k6LYlmrekgfmyfzhNdH6ExJMR+1HlqHC72QFWHVE9G++8a6LnEoq0NUmIXSeTdClVBvzwsVe0mgf2SFwxS4= X-Gm-Message-State: AOJu0YwuCeC9Qj0ZlunA8r/RO1WeCG3reSWvHPzngUf1PGl13QgdcfZh WeXTC0d1xal9rDKEFjrsLOhhmM37/Fmlf4lJS9i75ndsnVTQ9hIYBYfRZz0JVrVjjs2E/h29Gvj FdUedsjal3sac408Bgf7GCxc7LUU= X-Google-Smtp-Source: AGHT+IFEiwZKJU2ufSp7af94z8DwpONHJhln0YlSLvGyaBfptpNmfTVuudMQxJNsKGB5X4keMPVTPKBMVOaG7mh5bkg= X-Received: by 2002:a05:6512:3b24:b0:52c:c9bb:2ba4 with SMTP id 2adb3069b0e04-52e826f1526mr2101318e87.46.1719743128758; Sun, 30 Jun 2024 03:25:28 -0700 (PDT) MIME-Version: 1.0 References: <86wmm9jfk7.fsf@gnu.org> <86o77kjk87.fsf@gnu.org> <5782856d-9c8f-4903-9d42-143a015fee14@gutov.dev> <86jzi7q71j.fsf@mail.linkov.net> In-Reply-To: <86jzi7q71j.fsf@mail.linkov.net> From: =?UTF-8?B?Sm/Do28gVMOhdm9yYQ==?= Date: Sun, 30 Jun 2024 11:25:16 +0100 Message-ID: Subject: Re: bug#71823: 31.0.50; project-mode-line and eglot duplicate project-name in mode-line To: Juri Linkov Content-Type: multipart/alternative; boundary="0000000000004b751d061c18e6be" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 71823 Cc: Dmitry Gutov , Eli Zaretskii , 71823@debbugs.gnu.org, Spencer Baugh X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --0000000000004b751d061c18e6be Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Sun, Jun 30, 2024, 07:55 Juri Linkov wrote: > shorter. > > Ideally, everything should be customizable by two new Eglot options: > eglot-mode-line-format and eglot-mode-line-position (e.g. middle/end). > The second one is redundant. There is already ample machinery to juggle elements around in relation to other elements. But the first one is absolutely what's needed, and fixes other issues, so anyone should feel free to start working on it, the default value of course producing exactly what is seen now, perhaps with the "defer to protect" semantics. Jo=C3=A3o > --0000000000004b751d061c18e6be Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

On Sun, Jun 30, 2024, 07:55 Juri Linkov <juri@linkov.net> wrote:
shorter.

Ideally, everything should be customizable by two new Eglot options:
eglot-mode-line-format and eglot-mode-line-position (e.g. middle/end).
<= /blockquote>

The s= econd one is redundant. There is already ample machinery to juggle elements= around in relation to other elements. But the first one is absolutely what= 's needed, and fixes other issues, so anyone should feel free to start = working on it, the default value of course producing exactly what is seen n= ow, perhaps with the "defer to protect" semantics.

Jo=C3=A3o
--0000000000004b751d061c18e6be-- From debbugs-submit-bounces@debbugs.gnu.org Sun Jun 30 08:51:34 2024 Received: (at 71823) by debbugs.gnu.org; 30 Jun 2024 12:51:34 +0000 Received: from localhost ([127.0.0.1]:55865 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sNu1l-0002Jv-OO for submit@debbugs.gnu.org; Sun, 30 Jun 2024 08:51:34 -0400 Received: from s.wrqvtzvf.outbound-mail.sendgrid.net ([149.72.126.143]:57566) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sNu1j-0002Jg-FG for 71823@debbugs.gnu.org; Sun, 30 Jun 2024 08:51:32 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=catern.com; h=from:subject:in-reply-to:references:mime-version:to:cc:content-type: cc:content-type:from:subject:to; s=s1; bh=VGx8NawPRCJepuLxL7n+AcmDO1f1/jRNJ3VaijX4tVs=; b=JG17Z+nmvFPX8VEDSH/rOxAnBtoLCpm1z8YtY3jkMc6lorc5HxuoMQjtS4YlOrEzmWL0 fk2t7+nlGAaIauQUjlmuex/dZ3Ik8LH/0KPZi4H1HvaWDLj4LRWVrSUmRb3R2EyWLw5MF+ RkOdxRJUAfGLPsVcCW3LTsWLLeyAUYvOSiydc2y5bsNDFeDnaICEaz2VDtPBxfHO+OiSgl TQkWlyrmidqGErW3ksDNFac+qNnaqFzF8gbBMnroZq6pOqtHznPW8+P+IwYxrqBO5KaXYw l3IussQIz6h8ZAW34JBj3NfDUw/fOPyjVgalWkWUU+s9gfGRlDUOAwFvauTgLydQ== Received: by recvd-65946f9675-tqqhf with SMTP id recvd-65946f9675-tqqhf-1-668154CD-8 2024-06-30 12:51:25.756906222 +0000 UTC m=+243851.569972294 Received: from earth.catern.com (unknown) by geopod-ismtpd-18 (SG) with ESMTP id e9RDq-tbRp-oBdWLro9dBA Sun, 30 Jun 2024 12:51:25.652 +0000 (UTC) X-Comment: SPF check N/A for local connections - client-ip=127.0.0.1; helo=localhost; envelope-from=sbaugh@catern.com; receiver=gmail.com Received: from localhost (localhost [127.0.0.1]) by earth.catern.com (Postfix) with ESMTPSA id 2050162505; Sun, 30 Jun 2024 08:51:25 -0400 (EDT) From: sbaugh@catern.com Subject: Re: bug#71823: 31.0.50; project-mode-line and eglot duplicate project-name in mode-line In-Reply-To: (=?utf-8?Q?=22Jo=C3=A3o_T=C3=A1vora=22's?= message of "Sun, 30 Jun 2024 01:25:32 +0100") References: <86wmm9jfk7.fsf@gnu.org> <86o77kjk87.fsf@gnu.org> <17183c60-1733-4938-9a85-f3351c87bcb9@gutov.dev> Date: Sun, 30 Jun 2024 12:51:25 +0000 (UTC) Message-ID: <87jzi6fvar.fsf@catern.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 X-SG-EID: =?us-ascii?Q?u001=2Ev6RTqHFpv1T6krEot6UFAVAJmQ+4h1t8=2FTfqqE2B07PW6Nx04XuXMBWO3?= =?us-ascii?Q?BsENpYtxy+vwKol+P1x86hHTzt7kESju5apyxR6?= =?us-ascii?Q?klwmovNP0Zh1tS6XYT00LREuywHha2zhm51UPsi?= =?us-ascii?Q?e8RiVEcaVdezNRIeh+bCDAgYNaP7RQztOW=2FGVSB?= =?us-ascii?Q?p0VZXazjugZ4rRWWXfbFxSEnavyUrcnGbCAITNh?= =?us-ascii?Q?g=3D=3D?= To: =?iso-8859-1?b?Sm/jbyBU4XZvcmE=?= X-Entity-ID: u001.oW4JupFKOzCccZAQN2OOFQ== Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 71823 Cc: Spencer Baugh , Eli Zaretskii , Juri Linkov , 71823@debbugs.gnu.org, Dmitry Gutov X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --=-=-= Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Jo=E3o T=E1vora writes: > On Sat, Jun 29, 2024, 15:24 Spencer Baugh wrote: > > Or, here's an alternative idea, more aggressive: > > What if Eglot just sets project-mode-line=3Dt in eglot-managed buffers, = and removes the project-name from the Eglot entry > entirely? > > Then the language identifier would be the major mode, the project identi= fier would be project-mode-line, and the eglot status > indicator would just be for the status of the server. > > Works for me, it's in line with Eglot's policy of setting other modes whe= n managing buffers. Show a patch.=20 Attached. I do think this is a great way to resolve this - now that project-mode-line exists, using it deletes one small bit of eglot-specific functionality, which is in line with the Eglot design philosophy. The only issue is that this was only added to mode-line-format in Emacs 30, so we can only use it in Emacs 30 or later. The attached patch detects that with: + (when (member '(project-mode-line project-mode-line-format) mode-line-= format) but I'm also totally fine with: + (when (version<=3D "30" emacs-version) Or I guess we could sidestep the issue if project.el itself ensured, when loaded, that mode-line-format contains project-mode-line. eglot itself does this with eglot--mode-line-format, running the following at load time: (add-to-list 'mode-line-misc-info `(eglot--managed-mode (" [" eglot--mode-line-format "] "))) Juri, any opinion? > But also, my idea of eglot-mode-line-format should be alsoh considered. A= FAICT there no big technical hurdle, it's just relatively > boring work and some naming decisions to make. And as I mentioned, it wou= ld fix more issues than just the one at hand. Yes, I think that would also be useful as a separate patch. --=-=-= Content-Type: text/x-diff; charset=utf-8 Content-Disposition: inline; filename=0001-Use-project-mode-line-for-the-project-nick-in-Eglot.patch Content-Transfer-Encoding: quoted-printable >From 5b53ecc3db2356bcab3fd8b9d8583de6a6adcef2 Mon Sep 17 00:00:00 2001 From: Spencer Baugh Date: Sun, 30 Jun 2024 08:27:43 -0400 Subject: [PATCH] Use project-mode-line for the project nick in Eglot The existence of project-mode-line now means that eglot can have an indicator for the current project of the current buffer, without using the eglot mode-line entry to do it. This commit teaches eglot to (when possible) set project-mode-line true in eglot-managed buffers and remove project-name from the eglot mode line entry. * lisp/progmodes/eglot.el (eglot--managed-mode): Set project-mode-line if the project-mode-line entry is in mode-line-format. (eglot-menu): Always include eglot-server-menu as a submenu. (eglot--mode-line-format): Don't include project-name when project-mode-line is set. (bug#71823) --- lisp/progmodes/eglot.el | 74 ++++++++++++++++++++++------------------- 1 file changed, 39 insertions(+), 35 deletions(-) diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el index bb6b0281d9f..249dda7f3d8 100644 --- a/lisp/progmodes/eglot.el +++ b/lisp/progmodes/eglot.el @@ -7,7 +7,7 @@ ;; Maintainer: Jo=C3=A3o T=C3=A1vora ;; URL: https://github.com/joaotavora/eglot ;; Keywords: convenience, languages -;; Package-Requires: ((emacs "26.3") (compat "27.1") (eldoc "1.14.0") (ext= ernal-completion "0.1") (flymake "1.2.1") (jsonrpc "1.0.24") (project "0.9.= 8") (seq "2.23") (track-changes "1.2") (xref "1.6.2")) +;; Package-Requires: ((emacs "26.3") (compat "27.1") (eldoc "1.14.0") (ext= ernal-completion "0.1") (flymake "1.2.1") (jsonrpc "1.0.24") (project "0.11= .0") (seq "2.23") (track-changes "1.2") (xref "1.6.2")) =20 ;; This is a GNU ELPA :core package. Avoid adding functionality ;; that is not available in the version of Emacs recorded above or any @@ -2026,6 +2026,8 @@ eglot--managed-mode (eglot--setq-saving company-tooltip-align-annotations t) (eglot--setq-saving eldoc-documentation-strategy #'eldoc-documentation-compose) + (when (member '(project-mode-line project-mode-line-format) mode-line-= format) + (setq-local project-mode-line t)) (unless (eglot--stay-out-of-p 'imenu) (add-function :before-until (local 'imenu-create-index-function) #'eglot-imenu)) @@ -2161,10 +2163,24 @@ eglot-upgrade-eglot (package-delete existing t)) (package-install (cadr (assoc 'eglot package-archive-contents))))) =20 +(easy-menu-define eglot-server-menu nil "Monitor server communication" + '("Debugging the server communication" + ["Reconnect to server" eglot-reconnect] + ["Quit server" eglot-shutdown] + "--" + ["LSP events buffer" eglot-events-buffer] + ["Server stderr buffer" eglot-stderr-buffer] + ["Customize event buffer size" + (lambda () + (interactive) + (customize-variable 'eglot-events-buffer-size))])) + (easy-menu-define eglot-menu nil "Eglot" `("Eglot" ;; Commands for getting information and customization. ["Customize Eglot" (lambda () (interactive) (customize-group "eglot"))] + ["Server" eglot-server-menu + :active (eglot-current-server)] "--" ;; xref like commands. ["Find definitions" xref-find-definitions @@ -2211,18 +2227,6 @@ eglot-menu ["Quickfix" eglot-code-action-quickfix :visible (eglot-server-capable :codeActionProvider)])) =20 -(easy-menu-define eglot-server-menu nil "Monitor server communication" - '("Debugging the server communication" - ["Reconnect to server" eglot-reconnect] - ["Quit server" eglot-shutdown] - "--" - ["LSP events buffer" eglot-events-buffer] - ["Server stderr buffer" eglot-stderr-buffer] - ["Customize event buffer size" - (lambda () - (interactive) - (customize-variable 'eglot-events-buffer-size))])) - (defun eglot--mode-line-props (thing face defs &optional prepend) "Helper for function `eglot--mode-line-format'. Uses THING, FACE, DEFS and PREPEND." @@ -2252,7 +2256,7 @@ eglot--mode-line-format 'keymap (let ((map (make-sparse-keymap))) (define-key map [mode-line down-mouse-1] eglot-menu) map))) - (when nick + (when (and nick (not project-mode-line)) `(":" ,(propertize nick @@ -2261,28 +2265,28 @@ eglot--mode-line-format 'help-echo (format "Project '%s'\nmouse-1: LSP server control m= enu" nick) 'keymap (let ((map (make-sparse-keymap))) (define-key map [mode-line down-mouse-1] eglot-server= -menu) - map)) - ,@(when last-error - `("/" ,(eglot--mode-line-props - "error" 'compilation-mode-line-fail - '((mouse-3 eglot-clear-status "Clear this status")) - (format "An error occurred: %s\n" (plist-get last-err= or - :message= ))))) - ,@(when (cl-plusp pending) - `("/" ,(eglot--mode-line-props - (format "%d" pending) 'warning - '((mouse-3 eglot-forget-pending-continuations - "Forget pending continuations")) - "Number of outgoing, \ + map)))) + (when last-error + `("/" ,(eglot--mode-line-props + "error" 'compilation-mode-line-fail + '((mouse-3 eglot-clear-status "Clear this status")) + (format "An error occurred: %s\n" (plist-get last-error + :message))))) + (when (cl-plusp pending) + `("/" ,(eglot--mode-line-props + (format "%d" pending) 'warning + '((mouse-3 eglot-forget-pending-continuations + "Forget pending continuations")) + "Number of outgoing, \ still unanswered LSP requests to the server\n"))) - ,@(cl-loop for pr hash-values of (eglot--progress-reporters serve= r) - when (eq (car pr) 'eglot--mode-line-reporter) - append `("/" ,(eglot--mode-line-props - (format "%s%%%%" (or (nth 4 pr) "?")) - 'eglot-mode-line - nil - (format "(%s) %s %s" (nth 1 pr) - (nth 2 pr) (nth 3 pr)))))))))) + (cl-loop for pr hash-values of (eglot--progress-reporters server) + when (eq (car pr) 'eglot--mode-line-reporter) + append `("/" ,(eglot--mode-line-props + (format "%s%%%%" (or (nth 4 pr) "?")) + 'eglot-mode-line + nil + (format "(%s) %s %s" (nth 1 pr) + (nth 2 pr) (nth 3 pr)))))))) =20 (add-to-list 'mode-line-misc-info `(eglot--managed-mode (" [" eglot--mode-line-format "] "))) --=20 2.44.0 --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Sun Jun 30 10:54:55 2024 Received: (at 71823) by debbugs.gnu.org; 30 Jun 2024 14:54:55 +0000 Received: from localhost ([127.0.0.1]:58687 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sNvx8-0006XM-IJ for submit@debbugs.gnu.org; Sun, 30 Jun 2024 10:54:55 -0400 Received: from mail-lj1-f178.google.com ([209.85.208.178]:42251) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sNvx6-0006XC-9k for 71823@debbugs.gnu.org; Sun, 30 Jun 2024 10:54:53 -0400 Received: by mail-lj1-f178.google.com with SMTP id 38308e7fff4ca-2ec59193468so17583251fa.1 for <71823@debbugs.gnu.org>; Sun, 30 Jun 2024 07:54:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1719759231; x=1720364031; darn=debbugs.gnu.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=0K/gv80PfWc+pF4vcaSzy/jeAiwtJaehM63iSXuHnBQ=; b=R/MhwSp1D1e5QpuRgD4YV67cMjf9Znd/v0+XcULzL8CEJ7YzV28bMOQ+RUcmnjqzQc lyGRmUymWVX7jh+iRN1xDAMLeNG3kaQUTaIrgqQDq8RGLWvGhA0FF546FJRaJSDvz1zT k0RKFZAAW0iZBx55v2DFUB5pY2clmFTd7adLxAy1AsjitefCh0IEWAdJ2widU74gkt2/ AlWdBdfAKd3608fqOW5Aa0iT9E8yahkG8m6elKsxaDnfJUPYYK3uB0lBKvQPfaRKugyq JEyZiyvP84kgiYNgiR7OFbdaZTuMZJvoto1SEQNALU7JnQfs296wPtR8U7EMLH443lO8 5gIw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719759231; x=1720364031; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=0K/gv80PfWc+pF4vcaSzy/jeAiwtJaehM63iSXuHnBQ=; b=EE4u+R3azNDNnYJ1cgcBaCplNVFsmu1Tz4sziNOCJY/f0g5KEYIVTmQaqmCqgcr5oa tnaZFxn1e71tGJrm6rEy9yfD/zwXZmBG1eZSTbkZ5EIBmixXk3a5NURr4tTykjydssyQ CmKWsVa/7xdzsNEaqSY+7jQ85aGh0Xsl3R2qZmIPyPZ4MVGePeUCR8KsdBcKbz5e5tX/ cILxIJcrdPTotqo8WsZxowXcFxOd41huWeKiS8XgYlkyPAD2aTj6GC20sqGWSdXYLuz7 dN4LhStsCb95sw6jP/uavYZOxGgvdG1uN/MSBDaN6lpyM+cTly9B+FQi6O9LxSSiWAoa VbcQ== X-Forwarded-Encrypted: i=1; AJvYcCXorez3w3H1wFnc+gkVc1KhWql5dEfdV7zWiOTDXUb/niTwuFLvu9NOovIKDHAmgCx7tqjtSy/th7sjPtyZbh1XzLrG/Y0= X-Gm-Message-State: AOJu0Yzo8ia4L9P9dzH5MeNcRxGifgsMDuycqlHSA/bo3i3EDpfnCrHE /xgemHm0t3owgOvPcsAmP7jYEAis7hcb8mYpS+wUGhXA4scD50J0e2fwUwaotQMBsxCP2e6mYMD FB842AlENziplBvpm9ClZmd47QFg= X-Google-Smtp-Source: AGHT+IHSp7bsOp7TvsBlRGm0savk4VhtD5sXzntsmVbvtoMMQpXDXeqY+78u11H9zoA8qXmo+/W6A/rhjq655yPA3E0= X-Received: by 2002:a2e:9c50:0:b0:2ec:35a3:20bd with SMTP id 38308e7fff4ca-2ee53c89a66mr20570871fa.22.1719759231036; Sun, 30 Jun 2024 07:53:51 -0700 (PDT) MIME-Version: 1.0 References: <86wmm9jfk7.fsf@gnu.org> <86o77kjk87.fsf@gnu.org> <17183c60-1733-4938-9a85-f3351c87bcb9@gutov.dev> <87jzi6fvar.fsf@catern.com> In-Reply-To: <87jzi6fvar.fsf@catern.com> From: =?UTF-8?B?Sm/Do28gVMOhdm9yYQ==?= Date: Sun, 30 Jun 2024 15:53:39 +0100 Message-ID: Subject: Re: bug#71823: 31.0.50; project-mode-line and eglot duplicate project-name in mode-line To: Spencer Baugh Content-Type: multipart/alternative; boundary="00000000000010b3b6061c1ca611" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 71823 Cc: Spencer Baugh , Eli Zaretskii , Juri Linkov , 71823@debbugs.gnu.org, Dmitry Gutov X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --00000000000010b3b6061c1ca611 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Sun, Jun 30, 2024, 13:51 wrote: > Jo=C3=A3o T=C3=A1vora writes: > > On Sat, Jun 29, 2024, 15:24 Spencer Baugh wrote= : > > > > Or, here's an alternative idea, more aggressive: > > > > What if Eglot just sets project-mode-line=3Dt in eglot-managed buffers= , > and removes the project-name from the Eglot entry > > entirely? > > > > Then the language identifier would be the major mode, the project > identifier would be project-mode-line, and the eglot status > > indicator would just be for the status of the server. > > > > Works for me, it's in line with Eglot's policy of setting other modes > when managing buffers. Show a patch. > > Attached. > > I do think this is a great way to resolve this - now that > project-mode-line exists, using it deletes one small bit of > eglot-specific functionality, which is in line with the Eglot design > philosophy. > Yes. The only issue is that this was only added to mode-line-format in Emacs > 30, so we can only use it in Emacs 30 or later. > No, that's not an issue, or rather your solution isn't the way to solve it. In trunk Eglot use everything that is in trunk Emacs. In released Eglot versions name sure you depend on capable versions of core GNU Elpa packages, a set which already includes project.el. So basically version bumps solves it. So please show an updated patch, and don't forget the etc/EGLOT-NEWS entry. > But also, my idea of eglot-mode-line-format should be alsoh considered. > AFAICT there no big technical hurdle, it's just relatively > > boring work and some naming decisions to make. And as I mentioned, it > would fix more issues than just the one at hand. > > Yes, I think that would also be useful as a separate patch. > Looking forward to it. Jo=C3=A3o > --00000000000010b3b6061c1ca611 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


On Sun, Jun 30, 2024, 13:51 <sbaugh@catern.com> wrote:
Jo=C3=A3o T=C3=A1vora <joaotavora@gma= il.com> writes:
> On Sat, Jun 29, 2024, 15:24 Spencer Baugh <sbaugh@janestreet.com= > wrote:
>
>=C2=A0 Or, here's an alternative idea, more aggressive:
>
>=C2=A0 What if Eglot just sets project-mode-line=3Dt in eglot-managed b= uffers, and removes the project-name from the Eglot entry
>=C2=A0 entirely?
>
>=C2=A0 Then the language identifier would be the major mode, the projec= t identifier would be project-mode-line, and the eglot status
>=C2=A0 indicator would just be for the status of the server.
>
> Works for me, it's in line with Eglot's policy of setting othe= r modes when managing buffers. Show a patch.

Attached.

I do think this is a great way to resolve this - now that
project-mode-line exists, using it deletes one small bit of
eglot-specific functionality, which is in line with the Eglot design
philosophy.

Yes.

The only issue is that this was only added to mode-line-format in Emacs
30, so we can only use it in Emacs 30 or later.

No, that's not an issue,= or rather your solution isn't the way to solve it. In trunk Eglot use = everything that is in trunk Emacs. In released Eglot versions name sure you= depend on capable versions of core GNU Elpa packages, a set which already = includes project.el. So basically version bumps solves it.

So please show an updated patch, and don= 't forget the etc/EGLOT-NEWS entry.


> But also, my idea of eglot-mode-line-format should be alsoh considered= . AFAICT there no big technical hurdle, it's just relatively
> boring work and some naming decisions to make. And as I mentioned, it = would fix more issues than just the one at hand.

Yes, I think that would also be useful as a separate patch.

Looking forward = to it.=C2=A0

Jo=C3=A3o
--00000000000010b3b6061c1ca611-- From debbugs-submit-bounces@debbugs.gnu.org Sun Jun 30 11:06:46 2024 Received: (at 71823) by debbugs.gnu.org; 30 Jun 2024 15:06:46 +0000 Received: from localhost ([127.0.0.1]:58700 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sNw8c-0006qM-1c for submit@debbugs.gnu.org; Sun, 30 Jun 2024 11:06:46 -0400 Received: from mail-lj1-f177.google.com ([209.85.208.177]:43055) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sNw8Z-0006q9-OO for 71823@debbugs.gnu.org; Sun, 30 Jun 2024 11:06:44 -0400 Received: by mail-lj1-f177.google.com with SMTP id 38308e7fff4ca-2ee4ab4076bso27936861fa.0 for <71823@debbugs.gnu.org>; Sun, 30 Jun 2024 08:06:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1719759938; x=1720364738; darn=debbugs.gnu.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=qxt1GosvMiyU5EZb3Tq3TboGdTyWqx/J/GfVc2zAE4Q=; b=UTKd1jdtFe7EckTSzkboz6zq/5FGa+I1HsiJesR2qpRSsyswD+Nwl/lEWvx96z27om nZPlBguFnWT6t65LEgkLoFDjyco0nmfdUWrcb9C3SAH7SYCbyBbSv/V3UIpsbwygOAJI 7EAgBDLCf6w2CSXJdKVVCTbL/X5rgfWpjA2+kUjazXfKhCoVxMgdXz2sJbBjD9HYiH8S SIfetVRLxw3PEfSqt/Swp2wlW6FRr5aeE8xiG9MlVEz2ox19g10QIAwYPqoO/FXaHMAD tDFQilFMHfjsfouSzFynUzur49XfUKaLi4QtVq6YzVHIbq9pseYne1wHWazZfT8qMVHv VbRg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719759938; x=1720364738; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=qxt1GosvMiyU5EZb3Tq3TboGdTyWqx/J/GfVc2zAE4Q=; b=vTdiRLHSMPsmXvAR/tBn3oO13x5TTTGB6+viXpZ9hmBgmk3dlvC37bdNqCSHnIwHZ6 rUJqRj3Gfxi8ij3SP3CIeGlnfY60UZZqtLKC+FhL+K8hclMbh4I08IhXvKgEShW9hJmK myJVyHGgGKq+DfUFqvW1eSIYLnByaViPYYZqIm9QTtzVKJq4U6D+7DtVlhb7hGCNdg+d Q48Fok4PvuHC+WwYTVN6z3AmYcacZ9OGr2i/tfeANeXNXYZJauSX7O7Uzrn2/BvgiuIt GRPycF7OMhXFna78DRYGCv1rhkGnzr3d8a1xMRbmXbwRXvkjM8cQ8zcor7x7pj3ZNQnT BNjA== X-Forwarded-Encrypted: i=1; AJvYcCVyd27+PZ9J+JefNHfscD63zsnsKl/41BUm/IeTfG46PPSWc7TV18d3+mmutja2+TqDv/o19XtMkhzrDV6PsWS95FaF8DA= X-Gm-Message-State: AOJu0Yypdzbx9cqEnX5/a/WPV2H6i4QKUSQYCZ3PhU+rys06EM//OnjW Z/P987M2DBatGg3kmKBay6wNrkYsYiP8XfwrYQpuTmpSmVfQUvmfxTqa+cDKijP4gRSPV7MLmTh 75kUAt3nYJMfyypUKy2VI5S1u6O4= X-Google-Smtp-Source: AGHT+IGahieVkAqAzFhYtMEJQ0qBA8LnbMqmJwOfvL4LWcHqlfQsQ4yX9HswAheTf63iFkSsCUrL3ixOvwpUYCKYN08= X-Received: by 2002:a05:6512:4026:b0:52c:caf3:98ed with SMTP id 2adb3069b0e04-52e825cb5acmr1245531e87.24.1719759937571; Sun, 30 Jun 2024 08:05:37 -0700 (PDT) MIME-Version: 1.0 References: <86wmm9jfk7.fsf@gnu.org> <86o77kjk87.fsf@gnu.org> <17183c60-1733-4938-9a85-f3351c87bcb9@gutov.dev> <87jzi6fvar.fsf@catern.com> In-Reply-To: From: =?UTF-8?B?Sm/Do28gVMOhdm9yYQ==?= Date: Sun, 30 Jun 2024 16:05:25 +0100 Message-ID: Subject: Re: bug#71823: 31.0.50; project-mode-line and eglot duplicate project-name in mode-line To: Spencer Baugh Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 71823 Cc: Spencer Baugh , Eli Zaretskii , Juri Linkov , 71823@debbugs.gnu.org, Dmitry Gutov X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) On Sun, Jun 30, 2024 at 3:53=E2=80=AFPM Jo=C3=A3o T=C3=A1vora wrote: >> The only issue is that this was only added to mode-line-format in Emacs >> 30, so we can only use it in Emacs 30 or later. > > > In released Eglot versions name sure you depend on capable versions ^^^^ I meant "make sure", obviously. Sorry about that. From debbugs-submit-bounces@debbugs.gnu.org Sun Jun 30 12:40:23 2024 Received: (at 71823) by debbugs.gnu.org; 30 Jun 2024 16:40:23 +0000 Received: from localhost ([127.0.0.1]:58847 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sNxbD-0003t8-Ej for submit@debbugs.gnu.org; Sun, 30 Jun 2024 12:40:23 -0400 Received: from relay9-d.mail.gandi.net ([217.70.183.199]:32811) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sNxbB-0003su-De for 71823@debbugs.gnu.org; Sun, 30 Jun 2024 12:40:21 -0400 Received: by mail.gandi.net (Postfix) with ESMTPSA id E98A0FF802; Sun, 30 Jun 2024 16:39:52 +0000 (UTC) From: Juri Linkov To: sbaugh@catern.com Subject: Re: bug#71823: 31.0.50; project-mode-line and eglot duplicate project-name in mode-line In-Reply-To: <87jzi6fvar.fsf@catern.com> (sbaugh@catern.com's message of "Sun, 30 Jun 2024 12:51:25 +0000 (UTC)") Organization: LINKOV.NET References: <86wmm9jfk7.fsf@gnu.org> <86o77kjk87.fsf@gnu.org> <17183c60-1733-4938-9a85-f3351c87bcb9@gutov.dev> <87jzi6fvar.fsf@catern.com> Date: Sun, 30 Jun 2024 19:38:59 +0300 Message-ID: <86plryo064.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/31.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-GND-Sasl: juri@linkov.net X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 71823 Cc: Spencer Baugh , Eli Zaretskii , =?iso-8859-1?Q?Jo=E3o_T=E1vora?= , 71823@debbugs.gnu.org, Dmitry Gutov X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) > I do think this is a great way to resolve this - now that > project-mode-line exists, using it deletes one small bit of > eglot-specific functionality, which is in line with the Eglot design > philosophy. > > The only issue is that this was only added to mode-line-format in Emacs > 30, so we can only use it in Emacs 30 or later. > > The attached patch detects that with: > > + (when (member '(project-mode-line project-mode-line-format) mode-line-format) > > but I'm also totally fine with: > > + (when (version<= "30" emacs-version) > > Or I guess we could sidestep the issue if project.el itself ensured, > when loaded, that mode-line-format contains project-mode-line. eglot > itself does this with eglot--mode-line-format, running the following at > load time: > > (add-to-list 'mode-line-misc-info > `(eglot--managed-mode (" [" eglot--mode-line-format "] "))) > > Juri, any opinion? bindings.el already contains '(project-mode-line project-mode-line-format), so checking this with (member '(project-mode-line project-mode-line-format) mode-line-format) looks fine. OTOH, I'm not sure if using (setq-local project-mode-line t) would be appreciated by users. I think your initial patch was more correct with (bound-and-true-p project-mode-line). From debbugs-submit-bounces@debbugs.gnu.org Wed Jul 03 09:00:53 2024 Received: (at 71823) by debbugs.gnu.org; 3 Jul 2024 13:00:53 +0000 Received: from localhost ([127.0.0.1]:39145 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sOzbR-0008TO-9i for submit@debbugs.gnu.org; Wed, 03 Jul 2024 09:00:53 -0400 Received: from mxout6.mail.janestreet.com ([64.215.233.21]:34127) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sOzbP-0008TA-Fp for 71823@debbugs.gnu.org; Wed, 03 Jul 2024 09:00:52 -0400 From: Spencer Baugh To: Juri Linkov Subject: Re: bug#71823: 31.0.50; project-mode-line and eglot duplicate project-name in mode-line In-Reply-To: <86plryo064.fsf@mail.linkov.net> (Juri Linkov's message of "Sun, 30 Jun 2024 19:38:59 +0300") References: <86wmm9jfk7.fsf@gnu.org> <86o77kjk87.fsf@gnu.org> <17183c60-1733-4938-9a85-f3351c87bcb9@gutov.dev> <87jzi6fvar.fsf@catern.com> <86plryo064.fsf@mail.linkov.net> Date: Wed, 03 Jul 2024 09:00:43 -0400 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=janestreet.com; s=waixah; t=1720011643; bh=N3a9IWa6Qe5kg96iszghyNrIh06sIDNhaC0EIGIcUf4=; h=From:To:Cc:Subject:In-Reply-To:References:Date; b=GI7YzGZvJpfHDwhuWd6wvBjC4W6Qdc3fnfO0pXGRRbqZBWIC2t4TysWNEtFN8vm/v jOre8M1xHm05+YQ6o5qoJ8i+eDZvRuLgjyXIU1XW+1g3SJ2i5c9lQouSVx3fb009xo ngNvWQvc1dJuNmLNX2Ls1ITZ0d6dzYGa2iEXXMH6OfHfFhn/jrOOkOX0Yqr/BN41su qu4otTAPj4FTjbKRQV8yidKqR7N0QPFVTN6ErhcgBcsUivirDZ8RERCu8YGe3KhRmF A3rM3ExJZLgy6wgWzzIw6AqEZlZb815SEvRhZH5pFYOt/txjnw+5h1DWpmA999sPJU kF60f6K5G/Ffg== X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 71823 Cc: sbaugh@catern.com, Eli Zaretskii , =?utf-8?B?Sm/Do28g?= =?utf-8?B?VMOhdm9yYQ==?= , 71823@debbugs.gnu.org, Dmitry Gutov X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Juri Linkov writes: >> I do think this is a great way to resolve this - now that >> project-mode-line exists, using it deletes one small bit of >> eglot-specific functionality, which is in line with the Eglot design >> philosophy. >> >> The only issue is that this was only added to mode-line-format in Emacs >> 30, so we can only use it in Emacs 30 or later. >> >> The attached patch detects that with: >> >> + (when (member '(project-mode-line project-mode-line-format) mode-line-format) >> >> but I'm also totally fine with: >> >> + (when (version<= "30" emacs-version) >> >> Or I guess we could sidestep the issue if project.el itself ensured, >> when loaded, that mode-line-format contains project-mode-line. eglot >> itself does this with eglot--mode-line-format, running the following at >> load time: >> >> (add-to-list 'mode-line-misc-info >> `(eglot--managed-mode (" [" eglot--mode-line-format "] "))) >> >> Juri, any opinion? > > bindings.el already contains '(project-mode-line project-mode-line-format), > so checking this with (member '(project-mode-line project-mode-line-format) > mode-line-format) looks fine. Will do that in the next version of the patch. > OTOH, I'm not sure if using (setq-local project-mode-line t) > would be appreciated by users. I think your initial patch > was more correct with (bound-and-true-p project-mode-line). I was also unsure, but after thinking about it, I think it's actually quite reasonable, for this reason: anyone enabling eglot already had project-name in their modeline. This patch just moves the project-name from the [eglot] element to a separate mode-line element. So this doesn't actually change the contents of an eglot user's mode-line, just the order of the elements. Plus the separate element has the mouse-1 project menu, which is a nice addition. From debbugs-submit-bounces@debbugs.gnu.org Wed Jul 03 09:18:00 2024 Received: (at 71823) by debbugs.gnu.org; 3 Jul 2024 13:18:00 +0000 Received: from localhost ([127.0.0.1]:39163 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sOzrz-0000SM-P0 for submit@debbugs.gnu.org; Wed, 03 Jul 2024 09:18:00 -0400 Received: from mxout6.mail.janestreet.com ([64.215.233.21]:40655) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sOzrx-0000S8-9I for 71823@debbugs.gnu.org; Wed, 03 Jul 2024 09:17:58 -0400 From: Spencer Baugh To: =?utf-8?B?Sm/Do28gVMOhdm9yYQ==?= Subject: Re: bug#71823: 31.0.50; project-mode-line and eglot duplicate project-name in mode-line In-Reply-To: (=?utf-8?Q?=22Jo=C3=A3o_T=C3=A1vora=22's?= message of "Sun, 30 Jun 2024 15:53:39 +0100") References: <86wmm9jfk7.fsf@gnu.org> <86o77kjk87.fsf@gnu.org> <17183c60-1733-4938-9a85-f3351c87bcb9@gutov.dev> <87jzi6fvar.fsf@catern.com> Date: Wed, 03 Jul 2024 09:17:49 -0400 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=janestreet.com; s=waixah; t=1720012669; bh=rZNl7BWj+2bjzMXETw/FdFkfHF4MTjBRGUrvG+QzczE=; h=From:To:Cc:Subject:In-Reply-To:References:Date; b=ZrLKnKjcp0uiD6hisL5jp0WxJRcTbyiqG3i0YES9LENnP1qLv6qYbAXu5NrDugH2P xK4pxtqQZDXzyMJA9iLsQnMgoR6aC4zjGTw5F8Kpn4ix1eqra31TxRvgfrbTpfzRcz ROU+Mko0/JoLGisth2T4tp8LdIaOVDfuJhTTnwYm2gcRmXaOdIzrgcRHy50CHcwsnp /4EWPfk0R5ey2SXVPEVZfscisEq8sNGKE9/hq0IKHv+T0jYfgLF7QXvKHNhjvqS3lx ocZSYxBH1jXTn/zt9Atx5E7l5NVGFgqkZiXLM1Ct+U9l4fGmS/6ebpqpjocKOGqS52 TTq7gNUuyBVpg== X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 71823 Cc: Dmitry Gutov , Spencer Baugh , Eli Zaretskii , 71823@debbugs.gnu.org, Juri Linkov X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Jo=C3=A3o T=C3=A1vora writes: > On Sun, Jun 30, 2024, 13:51 wrote: > > Jo=C3=A3o T=C3=A1vora writes: > > On Sat, Jun 29, 2024, 15:24 Spencer Baugh wrot= e: > > > > Or, here's an alternative idea, more aggressive: > > > > What if Eglot just sets project-mode-line=3Dt in eglot-managed buffer= s, and removes the project-name from the Eglot entry > > entirely? > > > > Then the language identifier would be the major mode, the project ide= ntifier would be project-mode-line, and the eglot > status > > indicator would just be for the status of the server. > > > > Works for me, it's in line with Eglot's policy of setting other modes = when managing buffers. Show a patch.=20 > > Attached. > > I do think this is a great way to resolve this - now that > project-mode-line exists, using it deletes one small bit of > eglot-specific functionality, which is in line with the Eglot design > philosophy. > > Yes. > > The only issue is that this was only added to mode-line-format in Emacs > 30, so we can only use it in Emacs 30 or later. > > No, that's not an issue, or rather your solution isn't the way to solve i= t. In trunk Eglot use everything that is in trunk Emacs. In > released Eglot versions name sure you depend on capable versions of core = GNU Elpa packages, a set which already includes > project.el. So basically version bumps solves it. Yes, certainly. That's why I bumped the required version of project.el in the Package-Requires. But, loading a newer version of project.el doesn't add the project-mode-line entry to mode-line-format. That's done in bindings.el, and can't be updated. So we still need to do something else to accomodate an Emacs 29 user with an updated eglot.el and project.el. Juri says "(member '(project-mode-line project-mode-line-format) mode-line-format)" check is good, though, so I think we can just do that. > So please show an updated patch, and don't forget the etc/EGLOT-NEWS entr= y. Ok, here's a new version of the patch with an etc/EGLOT-NEWS entry. --=-=-= Content-Type: text/x-patch; charset=utf-8 Content-Disposition: inline; filename=0001-Use-project-mode-line-for-the-project-nick-in-Eglot.patch Content-Transfer-Encoding: quoted-printable >From c7ab7a1f7b74effeca4cebbc5adb602bc8a57c87 Mon Sep 17 00:00:00 2001 From: Spencer Baugh Date: Wed, 3 Jul 2024 09:11:51 -0400 Subject: [PATCH] Use project-mode-line for the project nick in Eglot The existence of project-mode-line now means that eglot can have an indicator for the current project of the current buffer, without using the eglot mode-line entry to do it. This commit teaches eglot to (when possible) set project-mode-line true in eglot-managed buffers and remove project-name from the eglot mode line entry. * etc/EGLOT-NEWS: Announce usage of project-mode-line. * lisp/progmodes/eglot.el (eglot--managed-mode): Set project-mode-line if the project-mode-line entry is in mode-line-format. (eglot-menu): Always include eglot-server-menu as a submenu. (eglot--mode-line-format): Don't include project-name when project-mode-line is set. (bug#71823) --- etc/EGLOT-NEWS | 8 +++++ lisp/progmodes/eglot.el | 72 ++++++++++++++++++++++------------------- 2 files changed, 46 insertions(+), 34 deletions(-) diff --git a/etc/EGLOT-NEWS b/etc/EGLOT-NEWS index 0e3e4b7aff8..7462edd1cf0 100644 --- a/etc/EGLOT-NEWS +++ b/etc/EGLOT-NEWS @@ -26,6 +26,14 @@ Eglot will now try to not register $/progress messages f= rom the server when the defcustom is set to nil. This requires a restart of the server for the change to take effect. =20 +** Mode line entry now uses project-mode-line for project name + +In buffers managed by Eglot, the mode line has always contained the +project-name of that buffer's project (usually the basename of the VCS +root directory). Previously project-name was part of Eglot's mode line +entry; now project-name is in a separate entry provided by +project-mode-line. + * Changes in Eglot 1.17 (25/1/2024) =20 diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el index bb6b0281d9f..fa09fb5ea51 100644 --- a/lisp/progmodes/eglot.el +++ b/lisp/progmodes/eglot.el @@ -7,7 +7,7 @@ ;; Maintainer: Jo=C3=A3o T=C3=A1vora ;; URL: https://github.com/joaotavora/eglot ;; Keywords: convenience, languages -;; Package-Requires: ((emacs "26.3") (compat "27.1") (eldoc "1.14.0") (ext= ernal-completion "0.1") (flymake "1.2.1") (jsonrpc "1.0.24") (project "0.9.= 8") (seq "2.23") (track-changes "1.2") (xref "1.6.2")) +;; Package-Requires: ((emacs "26.3") (compat "27.1") (eldoc "1.14.0") (ext= ernal-completion "0.1") (flymake "1.2.1") (jsonrpc "1.0.24") (project "0.11= .0") (seq "2.23") (track-changes "1.2") (xref "1.6.2")) =20 ;; This is a GNU ELPA :core package. Avoid adding functionality ;; that is not available in the version of Emacs recorded above or any @@ -2026,6 +2026,8 @@ eglot--managed-mode (eglot--setq-saving company-tooltip-align-annotations t) (eglot--setq-saving eldoc-documentation-strategy #'eldoc-documentation-compose) + (when (member '(project-mode-line project-mode-line-format) mode-line-= format) + (setq-local project-mode-line t)) (unless (eglot--stay-out-of-p 'imenu) (add-function :before-until (local 'imenu-create-index-function) #'eglot-imenu)) @@ -2161,10 +2163,24 @@ eglot-upgrade-eglot (package-delete existing t)) (package-install (cadr (assoc 'eglot package-archive-contents))))) =20 +(easy-menu-define eglot-server-menu nil "Monitor server communication" + '("Debugging the server communication" + ["Reconnect to server" eglot-reconnect] + ["Quit server" eglot-shutdown] + "--" + ["LSP events buffer" eglot-events-buffer] + ["Server stderr buffer" eglot-stderr-buffer] + ["Customize event buffer size" + (lambda () + (interactive) + (customize-variable 'eglot-events-buffer-size))])) + (easy-menu-define eglot-menu nil "Eglot" `("Eglot" ;; Commands for getting information and customization. ["Customize Eglot" (lambda () (interactive) (customize-group "eglot"))] + ["Server" eglot-server-menu + :active (eglot-current-server)] "--" ;; xref like commands. ["Find definitions" xref-find-definitions @@ -2211,18 +2227,6 @@ eglot-menu ["Quickfix" eglot-code-action-quickfix :visible (eglot-server-capable :codeActionProvider)])) =20 -(easy-menu-define eglot-server-menu nil "Monitor server communication" - '("Debugging the server communication" - ["Reconnect to server" eglot-reconnect] - ["Quit server" eglot-shutdown] - "--" - ["LSP events buffer" eglot-events-buffer] - ["Server stderr buffer" eglot-stderr-buffer] - ["Customize event buffer size" - (lambda () - (interactive) - (customize-variable 'eglot-events-buffer-size))])) - (defun eglot--mode-line-props (thing face defs &optional prepend) "Helper for function `eglot--mode-line-format'. Uses THING, FACE, DEFS and PREPEND." @@ -2261,28 +2265,28 @@ eglot--mode-line-format 'help-echo (format "Project '%s'\nmouse-1: LSP server control m= enu" nick) 'keymap (let ((map (make-sparse-keymap))) (define-key map [mode-line down-mouse-1] eglot-server= -menu) - map)) - ,@(when last-error - `("/" ,(eglot--mode-line-props - "error" 'compilation-mode-line-fail - '((mouse-3 eglot-clear-status "Clear this status")) - (format "An error occurred: %s\n" (plist-get last-err= or - :message= ))))) - ,@(when (cl-plusp pending) - `("/" ,(eglot--mode-line-props - (format "%d" pending) 'warning - '((mouse-3 eglot-forget-pending-continuations - "Forget pending continuations")) - "Number of outgoing, \ + map)))) + (when last-error + `("/" ,(eglot--mode-line-props + "error" 'compilation-mode-line-fail + '((mouse-3 eglot-clear-status "Clear this status")) + (format "An error occurred: %s\n" (plist-get last-error + :message))))) + (when (cl-plusp pending) + `("/" ,(eglot--mode-line-props + (format "%d" pending) 'warning + '((mouse-3 eglot-forget-pending-continuations + "Forget pending continuations")) + "Number of outgoing, \ still unanswered LSP requests to the server\n"))) - ,@(cl-loop for pr hash-values of (eglot--progress-reporters serve= r) - when (eq (car pr) 'eglot--mode-line-reporter) - append `("/" ,(eglot--mode-line-props - (format "%s%%%%" (or (nth 4 pr) "?")) - 'eglot-mode-line - nil - (format "(%s) %s %s" (nth 1 pr) - (nth 2 pr) (nth 3 pr)))))))))) + (cl-loop for pr hash-values of (eglot--progress-reporters server) + when (eq (car pr) 'eglot--mode-line-reporter) + append `("/" ,(eglot--mode-line-props + (format "%s%%%%" (or (nth 4 pr) "?")) + 'eglot-mode-line + nil + (format "(%s) %s %s" (nth 1 pr) + (nth 2 pr) (nth 3 pr)))))))) =20 (add-to-list 'mode-line-misc-info `(eglot--managed-mode (" [" eglot--mode-line-format "] "))) --=20 2.39.3 --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Wed Jul 03 10:00:39 2024 Received: (at 71823) by debbugs.gnu.org; 3 Jul 2024 14:00:39 +0000 Received: from localhost ([127.0.0.1]:39962 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sP0XH-000233-B1 for submit@debbugs.gnu.org; Wed, 03 Jul 2024 10:00:39 -0400 Received: from mail-oa1-f41.google.com ([209.85.160.41]:61478) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sP0XF-00022r-ML for 71823@debbugs.gnu.org; Wed, 03 Jul 2024 10:00:38 -0400 Received: by mail-oa1-f41.google.com with SMTP id 586e51a60fabf-25d634c5907so3386626fac.2 for <71823@debbugs.gnu.org>; Wed, 03 Jul 2024 07:00:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1720015170; x=1720619970; darn=debbugs.gnu.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=A6+it7dv9y1/ceUCsb88D4kv9oD4VZe/iwOQzKSkNJc=; b=Dd6bUvpwN/ZUbbymoaBP8oECAv25+BzxvJeChEUWMMTXBIDtuVpH+p7ALph0vrCB96 Vb/0sgGyu+lLEVD6Kx019SJZ6/bLu+ne4oUvkHxkK/yXIU2o1WpJD5ANoJRtq2wY5vuQ ISjBDgPlRuAqz/V2z7ZwM9YznsU0qHJToSt94Patw7pqrEVINZ6W7NM8OdDmxLFvSDoz 7Zo7AsQRHPVdMMqbC7u48T4otBNYHBRBXakLDAaVb72lnMAhSdAEfKbDfCz0pae47JqV v+s17BommFWobrLfFAntBvsH4t4IwEEOLVqKJuCFgk01urZG/4ovg1dJJ3euvoHmM0bF rVxA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1720015170; x=1720619970; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=A6+it7dv9y1/ceUCsb88D4kv9oD4VZe/iwOQzKSkNJc=; b=gFW7wnxPjXYZ2r7+zac4iSGE41l9lou7EZgzRWU977ueHD6V3PKmRYWN5b2pOLpA9A 8qtCJSfRIp4zzhLvstaSJT/D9s2vThGOvgNdzwiAcUd+CpeLO5dHzpX34Usg3SQghCMX yWVFOrtPibQPbHgxmaX4p8zjQZJ3t7XVdMcT136Pivh+atI5LBXZ/vDiAqajLT4IGvuR KaDcU/1a7Wzh1EjYoTpD1ebY+RZbvaeha5PyTtRy2oQt3txA6GMa7JHQjux/BvPg2uqP jwfkjsRzdXxBoP/UrcKhhNDYpSdDe1sPiR5eaiu6IautuoiXtMZkRV62pYu9YmEVv5Wf 8yuA== X-Forwarded-Encrypted: i=1; AJvYcCVAlwzKjOl9l5SiB0hs7is7SsjNO4orQk0eI0YVe1sse1a0qXK45XJJoRUCSPc+ZHLTdHpspuhyhbMXedf7hcqNydVxVtA= X-Gm-Message-State: AOJu0YzHX9Gh2Ft2FB9G4bjjhHzrX/XJ+eQ0iBnlmgXijoOAjEviRfPS vQkSbLLU4/JQc0jSQKld/28M0JrXICuwyMWUahc+gh2hCYThrL/wyrksIxWj1vvGkXKQXHCaUQu C2ZXF2vr3F8D73WmnUCiEqdTpx44= X-Google-Smtp-Source: AGHT+IG5NrFHUClhGhvtW9j63Xcu+6zAgKc+eKshcPXEmz8oGrEtFojsOgkdn6e6swWuS0nSSTaPJRu84uaYsSOuid0= X-Received: by 2002:a05:6870:b155:b0:25c:c35f:e259 with SMTP id 586e51a60fabf-25db3442fa9mr11497098fac.34.1720015170030; Wed, 03 Jul 2024 06:59:30 -0700 (PDT) MIME-Version: 1.0 References: <86wmm9jfk7.fsf@gnu.org> <86o77kjk87.fsf@gnu.org> <17183c60-1733-4938-9a85-f3351c87bcb9@gutov.dev> <87jzi6fvar.fsf@catern.com> In-Reply-To: From: =?UTF-8?B?Sm/Do28gVMOhdm9yYQ==?= Date: Wed, 3 Jul 2024 14:59:18 +0100 Message-ID: Subject: Re: bug#71823: 31.0.50; project-mode-line and eglot duplicate project-name in mode-line To: Spencer Baugh Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 71823 Cc: Dmitry Gutov , Spencer Baugh , Eli Zaretskii , 71823@debbugs.gnu.org, Juri Linkov X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) On Wed, Jul 3, 2024 at 2:17=E2=80=AFPM Spencer Baugh wrote: > > Jo=C3=A3o T=C3=A1vora writes: > > > On Sun, Jun 30, 2024, 13:51 wrote: > > > > Jo=C3=A3o T=C3=A1vora writes: > > > On Sat, Jun 29, 2024, 15:24 Spencer Baugh wr= ote: > > > > > > Or, here's an alternative idea, more aggressive: > > > > > > What if Eglot just sets project-mode-line=3Dt in eglot-managed buff= ers, and removes the project-name from the Eglot entry > > > entirely? > > > > > > Then the language identifier would be the major mode, the project i= dentifier would be project-mode-line, and the eglot > > status > > > indicator would just be for the status of the server. > > > > > > Works for me, it's in line with Eglot's policy of setting other mode= s when managing buffers. Show a patch. > > > > Attached. > > > > I do think this is a great way to resolve this - now that > > project-mode-line exists, using it deletes one small bit of > > eglot-specific functionality, which is in line with the Eglot design > > philosophy. > > > > Yes. > > > > The only issue is that this was only added to mode-line-format in Emac= s > > 30, so we can only use it in Emacs 30 or later. > > > > No, that's not an issue, or rather your solution isn't the way to solve= it. In trunk Eglot use everything that is in trunk Emacs. In > > released Eglot versions name sure you depend on capable versions of cor= e GNU Elpa packages, a set which already includes > > project.el. So basically version bumps solves it. > > Yes, certainly. That's why I bumped the required version of project.el > in the Package-Requires. > > But, loading a newer version of project.el doesn't add the > project-mode-line entry to mode-line-format. That's done in > bindings.el, and can't be updated. So we still need to do something > else to accomodate an Emacs 29 user with an updated eglot.el and > project.el. Hmm, I don't like it I must say. I thought there would be some kind of project-mode-line-mode to call that would do what it has to do to put the project in the mode-line. Like this it feels too hacky and intrusive into project.el's and binding.el's implementation. I also don't understand the other changes (i.e. to the menu) but that's OK. I'm going back to my previous recommendation of redesigning Eglot's eglot--mode-line-format into eglot-mode-line-format in the likenes= s of other packages (Flymake for example). If I'm going to carefully review and test changes to Eglot's mode-line machinery like the ones you are presenting here, it might as well be the most useful changes possible. That change should fix this and other problems. Until then, I don't think this is an extremely serious problem. Jo=C3=A3o From debbugs-submit-bounces@debbugs.gnu.org Wed Jul 03 10:47:53 2024 Received: (at 71823) by debbugs.gnu.org; 3 Jul 2024 14:47:53 +0000 Received: from localhost ([127.0.0.1]:40028 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sP1Gz-0003Ms-89 for submit@debbugs.gnu.org; Wed, 03 Jul 2024 10:47:53 -0400 Received: from mxout5.mail.janestreet.com ([64.215.233.18]:38009) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sP1Gx-0003Mb-Eb for 71823@debbugs.gnu.org; Wed, 03 Jul 2024 10:47:52 -0400 From: Spencer Baugh To: =?utf-8?B?Sm/Do28gVMOhdm9yYQ==?= Subject: Re: bug#71823: 31.0.50; project-mode-line and eglot duplicate project-name in mode-line In-Reply-To: (=?utf-8?Q?=22Jo=C3=A3o_T=C3=A1vora=22's?= message of "Wed, 3 Jul 2024 14:59:18 +0100") References: <86wmm9jfk7.fsf@gnu.org> <86o77kjk87.fsf@gnu.org> <17183c60-1733-4938-9a85-f3351c87bcb9@gutov.dev> <87jzi6fvar.fsf@catern.com> Date: Wed, 03 Jul 2024 10:47:43 -0400 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=janestreet.com; s=waixah; t=1720018063; bh=PpR1SYR2HuRCucd4sS+YcpdqLucchz0s4SxJFc/7o3g=; h=From:To:Cc:Subject:In-Reply-To:References:Date; b=B8qopNqbK9PALozVb57tX3z6mthhCyZQ9ww8MTGwcGZBrTfFpyFqLrJxdMaRbUypJ 4dTh97v2Jk572LmR3lLbQcNbOKo8aP8dAM+gKrurLNHN3xulMaguvj2WfHyVftQfUH OKuXYoG6+noBRgeHPskvnUp8MYSLJZey8b4txGAOm/IIr6jIFwzvos1uTiF92XCtzy bT8RlSs0q5w4ofK0mHqRw1DmbslyEs8+VpLgemZZVga9aTAMqxCGHyPa3RfUwxrOL8 1PGP8xaHULa25d7U+0u/xUGaFXnURg6yf69D58vqdL9HJ4LXUJZzcsxJzn/opIpW2A c3oa+Fvp7UhIg== X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 71823 Cc: Dmitry Gutov , Eli Zaretskii , Juri Linkov , 71823@debbugs.gnu.org, Spencer Baugh X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Jo=C3=A3o T=C3=A1vora writes: > On Wed, Jul 3, 2024 at 2:17=E2=80=AFPM Spencer Baugh wrote: >> >> Jo=C3=A3o T=C3=A1vora writes: >> >> > On Sun, Jun 30, 2024, 13:51 wrote: >> > >> > Jo=C3=A3o T=C3=A1vora writes: >> > > On Sat, Jun 29, 2024, 15:24 Spencer Baugh w= rote: >> > > >> > > Or, here's an alternative idea, more aggressive: >> > > >> > > What if Eglot just sets project-mode-line=3Dt in eglot-managed buf= fers, and removes the project-name from the Eglot entry >> > > entirely? >> > > >> > > Then the language identifier would be the major mode, the project = identifier would be project-mode-line, and the eglot >> > status >> > > indicator would just be for the status of the server. >> > > >> > > Works for me, it's in line with Eglot's policy of setting other mod= es when managing buffers. Show a patch. >> > >> > Attached. >> > >> > I do think this is a great way to resolve this - now that >> > project-mode-line exists, using it deletes one small bit of >> > eglot-specific functionality, which is in line with the Eglot design >> > philosophy. >> > >> > Yes. >> > >> > The only issue is that this was only added to mode-line-format in Ema= cs >> > 30, so we can only use it in Emacs 30 or later. >> > >> > No, that's not an issue, or rather your solution isn't the way to solv= e it. In trunk Eglot use everything that is in trunk Emacs. In >> > released Eglot versions name sure you depend on capable versions of co= re GNU Elpa packages, a set which already includes >> > project.el. So basically version bumps solves it. >> >> Yes, certainly. That's why I bumped the required version of project.el >> in the Package-Requires. >> >> But, loading a newer version of project.el doesn't add the >> project-mode-line entry to mode-line-format. That's done in >> bindings.el, and can't be updated. So we still need to do something >> else to accomodate an Emacs 29 user with an updated eglot.el and >> project.el. > > Hmm, I don't like it I must say. I thought there would be some kind > of project-mode-line-mode to call that would do what it has to do > to put the project in the mode-line. Like this it feels too hacky > and intrusive into project.el's and binding.el's implementation. Sure, so here are some possible solutions: A. Check (member '(project-mode-line project-mode-line-format) mode-line-fo= rmat) B. Check (version<=3D "30" emacs-version) C. project.el itself could ensure, when loaded, that mode-line-format contains project-mode-line. eglot itself does this with eglot--mode-line-format, running the following at load time: =20=20=20 (add-to-list 'mode-line-misc-info `(eglot--managed-mode (" [" eglot--mode-line-format "] "))) D. Add a project-minor-mode like you suggest which puts the project in the mode-line. Do any of these seem acceptable? I personally prefer C. > I also don't understand the other changes (i.e. to the menu) but > that's OK. The project-name in the eglot mode line entry had the server menu attached to it. Since the project-name is no longer present, the server menu isn't accessible. To make the server menu accessible again, it's added to the main eglot menu. > I'm going back to my previous recommendation of redesigning Eglot's > eglot--mode-line-format into eglot-mode-line-format in the likeness of > other packages (Flymake for example). If I'm going to carefully > review and test changes to Eglot's mode-line machinery like the ones > you are presenting here, it might as well be the most useful changes > possible. > > That change should fix this and other problems. Until then, I don't think > this is an extremely serious problem. Making eglot-mode-line-format customizable is an orthogonal change, which gives different benefits. To be clear, the problem I want to fix is "there's two mode-line entries (project-mode-line-format, eglot--mode-line-format) which include project-name, so project-name shows up twice". Yes, making those entries customizable allows the user to solve the problem by customizing the entries. But I don't want to delegate the responsibility of solving this problem to the user, I want the problem to just be gone: the entries should just not duplicate project-name. From debbugs-submit-bounces@debbugs.gnu.org Wed Jul 03 10:59:13 2024 Received: (at 71823) by debbugs.gnu.org; 3 Jul 2024 14:59:14 +0000 Received: from localhost ([127.0.0.1]:40054 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sP1Rx-0003iL-EF for submit@debbugs.gnu.org; Wed, 03 Jul 2024 10:59:13 -0400 Received: from mail-oa1-f52.google.com ([209.85.160.52]:55655) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sP1Rn-0003hW-Ep for 71823@debbugs.gnu.org; Wed, 03 Jul 2024 10:59:12 -0400 Received: by mail-oa1-f52.google.com with SMTP id 586e51a60fabf-25cc6962c24so2659887fac.3 for <71823@debbugs.gnu.org>; Wed, 03 Jul 2024 07:59:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1720018676; x=1720623476; darn=debbugs.gnu.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=v+3jIY6ZPQJYCftzYhnwyu30izdzKahcXZ5YTlaoJ3M=; b=mWNARTzUMpHjRi3vEOg5kcqqas6550c71ufBu5QV2HHIz9HH6n/FeZ9nRuHpvMEJPP Z+6cdDFQoqPunNKqdYM+Ozyflo+aDJ29AJ59bM5EU1+zFE1swofBgY1sTEhf5/bv6s3z twAkJU3URldDQupeTk9kaG2gdjtelEr0u6dLXYapJHxme9ZMyWSX+jIDXJIkQg8xMcgz JN7Ube9E9JAU+kKZmSjN8R6oO2EUETmirmQE8NDQRvmFXc5uwDO1cUNCRHVsgI3jbzZP XLoFCJ36fa3CuVD0tW2zvHuHL9HIrQJTU4ibesoPCUhE5HPY0jHbZPgX9ZrOzjkefxRX tx6Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1720018676; x=1720623476; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=v+3jIY6ZPQJYCftzYhnwyu30izdzKahcXZ5YTlaoJ3M=; b=d8S1ypZ2qYl6iC/xCSwuMtt8NxOKsRVcEWwIa6xznwyI6CrctRt8skcngSRXZ+r/yp yNyvDhfwocK0wjts3uq5qlNyKcENqcK3Q2mgUkWfiq9aDtLAEFJrw1jNiPEmpWGAmncr aoiWpNsGz5dZt0a+28iyBLMbX1Lx+8WAFB99Oi4XP+bRCZ/E3iC/sJuGPhFYbXIdXGuM Ge4e3+h1hE4+emIzVJBejZwVgL2zKuAVuxeembzNJ6XHnH9ymKJS7wWU84qlNBsj9y+d xf61ZzGoFl//tSu50eNJCMdWln043kJbpjq6qVvVaaq7JE0+mkPAqrr4Wd2mLW8jWTTM A5KA== X-Forwarded-Encrypted: i=1; AJvYcCWbJ2m2/yZNCkI6a/wzwB7r9VhCtz63oW21Np/DHCnCudePfNwt3T9Y2oWtTjJGSHcJ5/Bo/VVtM1BW+mzmDgPbcNg5GLg= X-Gm-Message-State: AOJu0Ywy0C1xB5VQto5V6tFBLA9KPPZOUEzUwRAWxICg0v0Eas5kU0sv WoFBlgp0kqxSD0TwPYEcIOyHIugMpL1pFmBprB8/d3aNEQZMyNNH1KEChckDHTWFh9HuO6a01zs OL4jrVp3+3mfttpgKYeIdhpZ8GPY= X-Google-Smtp-Source: AGHT+IE22pjFHEutZIvih0AaFVAYj9K3IpQ2pnJnt6qaqyZavuZplxyIXgi4IEtwL596Lv81KbgFQxFWOMqAwAn+1N0= X-Received: by 2002:a05:6870:4152:b0:25e:ebb:b4f4 with SMTP id 586e51a60fabf-25e0ebbddedmr1448806fac.2.1720018675869; Wed, 03 Jul 2024 07:57:55 -0700 (PDT) MIME-Version: 1.0 References: <86wmm9jfk7.fsf@gnu.org> <86o77kjk87.fsf@gnu.org> <17183c60-1733-4938-9a85-f3351c87bcb9@gutov.dev> <87jzi6fvar.fsf@catern.com> In-Reply-To: From: =?UTF-8?B?Sm/Do28gVMOhdm9yYQ==?= Date: Wed, 3 Jul 2024 15:57:43 +0100 Message-ID: Subject: Re: bug#71823: 31.0.50; project-mode-line and eglot duplicate project-name in mode-line To: Spencer Baugh Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 71823 Cc: Dmitry Gutov , Eli Zaretskii , Juri Linkov , 71823@debbugs.gnu.org, Spencer Baugh X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) On Wed, Jul 3, 2024 at 3:47=E2=80=AFPM Spencer Baugh wrote: > Do any of these seem acceptable? No, sorry. > > > I also don't understand the other changes (i.e. to the menu) but > > that's OK. > > The project-name in the eglot mode line entry had the server menu > attached to it. Since the project-name is no longer present, the server > menu isn't accessible. To make the server menu accessible again, it's > added to the main eglot menu. Ah right. Well that unexpected side effect alone makes this approach unacceptable. It seemed like a quick out, but it really isn't. We have to go to the other approach > But I don't want to delegate the responsibility of solving this problem > to the user, I want the problem to just be gone: the entries should just > not duplicate project-name. This problem wasn't introduced by Eglot. In fact I don't know if this is even a problem. Users must know if they want to keep the Eglot mode line info working like it always did or if they want to tweak it to save space because of a new mode-line tenant that has since appeared in the very latest Emacs (a tenant which isn't even on by default). The problem in Eglot to me is that there isn't the possibility to do the latter thing, and _that's_ what I think should be addressed. Jo=C3=A3o From debbugs-submit-bounces@debbugs.gnu.org Wed Jul 03 11:12:19 2024 Received: (at 71823) by debbugs.gnu.org; 3 Jul 2024 15:12:19 +0000 Received: from localhost ([127.0.0.1]:40136 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sP1ed-0004Gw-2e for submit@debbugs.gnu.org; Wed, 03 Jul 2024 11:12:19 -0400 Received: from mxout6.mail.janestreet.com ([64.215.233.21]:35699) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sP1eb-0004Gi-6S for 71823@debbugs.gnu.org; Wed, 03 Jul 2024 11:12:17 -0400 From: Spencer Baugh To: =?utf-8?B?Sm/Do28gVMOhdm9yYQ==?= Subject: Re: bug#71823: 31.0.50; project-mode-line and eglot duplicate project-name in mode-line In-Reply-To: (=?utf-8?Q?=22Jo=C3=A3o_T=C3=A1vora=22's?= message of "Wed, 3 Jul 2024 15:57:43 +0100") References: <86wmm9jfk7.fsf@gnu.org> <86o77kjk87.fsf@gnu.org> <17183c60-1733-4938-9a85-f3351c87bcb9@gutov.dev> <87jzi6fvar.fsf@catern.com> Date: Wed, 03 Jul 2024 11:12:09 -0400 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=janestreet.com; s=waixah; t=1720019529; bh=YiBHSLdQGY03UUJULb/vAK7rROynmLBA4ED7i5DS79k=; h=From:To:Cc:Subject:In-Reply-To:References:Date; b=DxDQf664y2CyoPL2XJwNrDZyFsCg3aRVqLA3ljIW4gkF7AgmQ7BMUHA1ZfujgFmU/ VTskTIwd06nw6iTkbPUxaWdlYg65t60B4NnwsXTf+92ipYeq9ygkds1cA7DlWBzGg+ 3+e0f3TrhuRGy9xXwrjTmpVBHdFqZyVqVHabLKp/Uh6F1ax3CimIEA4GaDQQcMYMQA 5KKqjMidY15mZIHkD8T0dAVm2PGEOXojdrvzHlz10Gl3w6br1nnKLDPfYijrsKuK2L jPwsGhylko0ukZfjt1mLFsMA73II0FnXO317QsSk4TFQky71qH6B18YgTo5aWvjd5J 6rEJkXlbTlbVg== X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 71823 Cc: Dmitry Gutov , Eli Zaretskii , Spencer Baugh , 71823@debbugs.gnu.org, Juri Linkov X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Jo=C3=A3o T=C3=A1vora writes: > On Wed, Jul 3, 2024 at 3:47=E2=80=AFPM Spencer Baugh wrote: > >> Do any of these seem acceptable? > > No, sorry. When you originally said the patch was OK, how did you think the project-mode-line worked? Whatever way that is, I can just make project-mode-line work that way. >> > I also don't understand the other changes (i.e. to the menu) but >> > that's OK. >> >> The project-name in the eglot mode line entry had the server menu >> attached to it. Since the project-name is no longer present, the server >> menu isn't accessible. To make the server menu accessible again, it's >> added to the main eglot menu. > > Ah right. Well that unexpected side effect alone makes this > approach unacceptable. Why is that? What's the problem with moving the server menu to the main menu? >> But I don't want to delegate the responsibility of solving this problem >> to the user, I want the problem to just be gone: the entries should just >> not duplicate project-name. > > This problem wasn't introduced by Eglot. Definitely, but it seems like it is best to fix it in Eglot. I hope we can find a fix from the problem I want to solve, which is satisfying to you. > In fact I don't know if this is even a problem. Users must know if > they want to keep the Eglot mode line info working like it always did > or if they want to tweak it to save space because of a new mode-line > tenant that has since appeared in the very latest Emacs (a tenant > which isn't even on by default). > > The problem in Eglot to me is that there isn't the possibility to > do the latter thing, and _that's_ what I think should be addressed. Right. But even if we solved that, the problem I want to solve would still exist, and I'd still want to solve it without requiring users to do extra configuration, which is why I say there are separate problems. From debbugs-submit-bounces@debbugs.gnu.org Wed Jul 03 12:04:32 2024 Received: (at 71823) by debbugs.gnu.org; 3 Jul 2024 16:04:32 +0000 Received: from localhost ([127.0.0.1]:40200 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sP2T9-0005dX-Ru for submit@debbugs.gnu.org; Wed, 03 Jul 2024 12:04:32 -0400 Received: from mail-oa1-f44.google.com ([209.85.160.44]:44297) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sP2T8-0005dH-BA for 71823@debbugs.gnu.org; Wed, 03 Jul 2024 12:04:31 -0400 Received: by mail-oa1-f44.google.com with SMTP id 586e51a60fabf-24c9f6338a4so2921426fac.1 for <71823@debbugs.gnu.org>; Wed, 03 Jul 2024 09:04:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1720022603; x=1720627403; darn=debbugs.gnu.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=Gtlg6bfHOddh4FkeX/Djv4YNH90+BnE0pCbBKnnbSAc=; b=OFSFc3q3haSKYEud55tb869t8SzjR8Z/Zt7ofP9hy6qZVBA5sS3GuDM4mkDTkMEzFe kLgevr/W/XDyf5zLq9GSMGaH9pdVanZWbeq6xNf99K/vcucxA0V3O4zIDY7ffBkavumA R+JnaXsHRvF6lNyUBFu/kSu2laGTwfs0dP85MLjwElGuhbhqiHBn6frIqjDKEB0Gdu/7 rAf5YnXkusY1c66tmShCGEeeyi584OcXZ+DAz2s6eLghWCbnyY6Gzm5gt51xGBf5OemD 2qXEVE44ak7Poy76qCcOW6BdKGmUrBCTcdtukv7G37ZNJ5VQIoKRjquScHsCTKNRN0Or FBIg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1720022603; x=1720627403; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Gtlg6bfHOddh4FkeX/Djv4YNH90+BnE0pCbBKnnbSAc=; b=wbBh956krl2sDiNlutr8+5T3DzgLQOepQpRrlnKKFCnxZv2sQjCJWtyjGoq1k8wiH9 1T8eCo5Ifffngmy/Wm+vz5YlOAlII57XyY8Mqn0GPf8cxT5Spe8NbrnRrb9ePXo4brFT P2uPsU1ybjRzNvD4FerFeb33We3pm7HywNSjxh/eVdCCQZnF/jp+7BDkqcRsAqOH33nx 0n96MnBWkOo55irFpsOjzkoNKxFDaL0YtR9PtkvyQwtu+m23rSJhtUEcrj3kZ+tfMigl VbV6pu0ArVleTkG8LEioN0IP59W8dwPRMjRzI8S0TpuyyxIMY9l3xV7uUjgGPm0ylA05 I6MQ== X-Forwarded-Encrypted: i=1; AJvYcCVklApUkQFjguLeE0Nu1i62EO/0jkS82y7WIGDID/mU/eCXObzl/DACrXwk+C8NltVUDNvponlOXZ3zgMdaS6PFO0+5N/k= X-Gm-Message-State: AOJu0Yzy8uUmhFEnenenfnDC5vYYTKXlkG9O7p/xUC6z8sT8pNo+LQtV tDJU4S4L+MUHW6lOZuwvnFpsIDdoKQxYReF5wOPwhdpmKYdYCG0zMtzc5YHGjyNtTzz3gFi5vrY 8BemNR3keTvxP+5aBUZ0nGMYdpjM= X-Google-Smtp-Source: AGHT+IEW+VOSjuwmm24DeyNWRiui93g6BVJKxiAeSz7d7YuuLr6DpSHQgPf4SUjX5nZzxaf+P/2xEudR+g9RTApmnVo= X-Received: by 2002:a05:6870:d24e:b0:25e:129c:2223 with SMTP id 586e51a60fabf-25e129c8c5dmr1478368fac.19.1720022602549; Wed, 03 Jul 2024 09:03:22 -0700 (PDT) MIME-Version: 1.0 References: <86wmm9jfk7.fsf@gnu.org> <86o77kjk87.fsf@gnu.org> <17183c60-1733-4938-9a85-f3351c87bcb9@gutov.dev> <87jzi6fvar.fsf@catern.com> In-Reply-To: From: =?UTF-8?B?Sm/Do28gVMOhdm9yYQ==?= Date: Wed, 3 Jul 2024 17:03:09 +0100 Message-ID: Subject: Re: bug#71823: 31.0.50; project-mode-line and eglot duplicate project-name in mode-line To: Spencer Baugh Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 71823 Cc: Dmitry Gutov , Eli Zaretskii , Spencer Baugh , 71823@debbugs.gnu.org, Juri Linkov X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) On Wed, Jul 3, 2024 at 4:12=E2=80=AFPM Spencer Baugh wrote: > > Jo=C3=A3o T=C3=A1vora writes: > > > On Wed, Jul 3, 2024 at 3:47=E2=80=AFPM Spencer Baugh wrote: > > > >> Do any of these seem acceptable? > > > > No, sorry. > > When you originally said the patch was OK, how did you think the > project-mode-line worked? I said the idea was OK :-) I forgot that Eglot's own display of the project name is not only that. It has more functionality: the project name is only a label. So what I thought would be a mere replacement and is actually not. > >> > I also don't understand the other changes (i.e. to the menu) but > >> > that's OK. > >> > >> The project-name in the eglot mode line entry had the server menu > >> attached to it. Since the project-name is no longer present, the serv= er > >> menu isn't accessible. To make the server menu accessible again, it's > >> added to the main eglot menu. > > > > Ah right. Well that unexpected side effect alone makes this > > approach unacceptable. > > Why is that? What's the problem with moving the server menu to the main > menu? Nothing in particular, but if we're going to do that, we might as well do the other thing, which I still think is cleaner. > >> But I don't want to delegate the responsibility of solving this proble= m > >> to the user, I want the problem to just be gone: the entries should ju= st > >> not duplicate project-name. > > > > This problem wasn't introduced by Eglot. > > Definitely, but it seems like it is best to fix it in Eglot. It's best to allow the user to choose, and Eglot doesn't have a way to let the user choose (while project has). So let's give them one in Eglot. Jo=C3=A3o From debbugs-submit-bounces@debbugs.gnu.org Wed Jul 03 13:10:18 2024 Received: (at 71823) by debbugs.gnu.org; 3 Jul 2024 17:10:18 +0000 Received: from localhost ([127.0.0.1]:40319 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sP3Uo-0007Up-1N for submit@debbugs.gnu.org; Wed, 03 Jul 2024 13:10:18 -0400 Received: from s.wfbtzhsw.outbound-mail.sendgrid.net ([159.183.224.105]:27220) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sP3Ul-0007Ua-Nb for 71823@debbugs.gnu.org; Wed, 03 Jul 2024 13:10:16 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=catern.com; h=from:subject:in-reply-to:references:mime-version:to:cc:content-type: content-transfer-encoding:cc:content-type:from:subject:to; s=s1; bh=Tetz0QtBVVjt72tqgudRvXlTtUURU194pqxm4ZfFml8=; b=Skh8b2saOWXLm5X3JFSCypnwrYQcI+itop8+k0t7E+KplnX1uuMqGMudbgtd5sdZqLIZ 82Mr0SMNZvMOGoFVriauqYyUvfcdBcVXOGuvNe8tUKFYE97X4hb9lYRT4LxGwtQNvx+OTa xF4BA/gigjJEOY7q53w0qEBJjs9TcSd5y/OTbbNjtMlH5tq1gQrm+GK+onPkzal+DAuWR8 DRcr4cY0brSReL075JakB2O7In2xJc9BwMCzq88JBNEJsay3ZSeKji5/gjGYQYNA7t5kIC gXAlNH75bgZFIVAJutJ5gVLEMaljlqR5X+ERtD8FiP8U0n3HObzE6u3Jxn9KSQpQ== Received: by filterdrecv-7b48875b86-t7jpc with SMTP id filterdrecv-7b48875b86-t7jpc-1-668585EE-9 2024-07-03 17:10:06.740641442 +0000 UTC m=+5596171.131730789 Received: from earth.catern.com (unknown) by geopod-ismtpd-24 (SG) with ESMTP id _y6jP341QXaGsTScQk3BlA Wed, 03 Jul 2024 17:10:06.635 +0000 (UTC) X-Comment: SPF check N/A for local connections - client-ip=127.0.0.1; helo=localhost; envelope-from=sbaugh@catern.com; receiver=gmail.com Received: from localhost (localhost [127.0.0.1]) by earth.catern.com (Postfix) with ESMTPSA id 23F436014C; Wed, 3 Jul 2024 13:10:06 -0400 (EDT) From: sbaugh@catern.com Subject: Re: bug#71823: 31.0.50; project-mode-line and eglot duplicate project-name in mode-line In-Reply-To: (=?utf-8?Q?=22Jo=C3=A3o_T=C3=A1vora=22's?= message of "Wed, 3 Jul 2024 17:03:09 +0100") References: <86wmm9jfk7.fsf@gnu.org> <86o77kjk87.fsf@gnu.org> <17183c60-1733-4938-9a85-f3351c87bcb9@gutov.dev> <87jzi6fvar.fsf@catern.com> Date: Wed, 03 Jul 2024 17:10:06 +0000 (UTC) Message-ID: <87h6d6flld.fsf@catern.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 X-SG-EID: =?us-ascii?Q?u001=2Ev6RTqHFpv1T6krEot6UFAVAJmQ+4h1t8=2FTfqqE2B07MBsoKbzINi7KIWv?= =?us-ascii?Q?1MbjluQ1m0wYWQr3vrdrHbyb88Ty52TuFsKDoZp?= =?us-ascii?Q?=2FKLSf36d4b3zNp3ZpS9xO3epbwD4jpe+QHLJwEU?= =?us-ascii?Q?hvMQRVqeRtjUrLtJrz2MOTdpsvc5uSnli1JCAPS?= =?us-ascii?Q?RPm4F69PQRnzCqGjCTbQrUapNYusGT+JPwtmDto?= =?us-ascii?Q?w=3D=3D?= To: =?iso-8859-1?b?Sm/jbyBU4XZvcmE=?= X-Entity-ID: u001.oW4JupFKOzCccZAQN2OOFQ== Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 71823 Cc: Spencer Baugh , Eli Zaretskii , Juri Linkov , 71823@debbugs.gnu.org, Dmitry Gutov X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Jo=C3=A3o T=C3=A1vora writes: > On Wed, Jul 3, 2024 at 4:12=E2=80=AFPM Spencer Baugh wrote: >> >> Jo=C3=A3o T=C3=A1vora writes: >> >> > On Wed, Jul 3, 2024 at 3:47=E2=80=AFPM Spencer Baugh wrote: >> > >> >> Do any of these seem acceptable? >> > >> > No, sorry. >> >> When you originally said the patch was OK, how did you think the >> project-mode-line worked? > > I said the idea was OK :-) I forgot that Eglot's own display of > the project name is not only that. It has more functionality: > the project name is only a label. So what I thought would be a mere > replacement and is actually not. To be clear, I want a configuration which will have project-name from project-mode-line and no project-name in the eglot mode-line entry. So that functionality will need to be moved anyway, no matter how we solve this problem. Are you fine with including the server menu in the main menu? This is something we'd want in both the "make it work by default" or "make it customizable" solutions. >> >> But I don't want to delegate the responsibility of solving this probl= em >> >> to the user, I want the problem to just be gone: the entries should j= ust >> >> not duplicate project-name. >> > >> > This problem wasn't introduced by Eglot. >> >> Definitely, but it seems like it is best to fix it in Eglot. > > It's best to allow the user to choose, and Eglot doesn't have a way > to let the user choose (while project has). So let's give them one > in Eglot. It's better still to both allow the user to choose and *also* have a default which works right out of the box. Those are two separate things which we can do separately. But allowing the user to choose adds a bunch of new customization points that need to be maintained. I don't understand why we would add these new customization points when we already are low on maintainer time for Eglot. I anticipate adding these custosmization points would have lots of small bugs. I'm all for doing it eventually, but making things work by default also solves my problem, without adding new maintenance burden. From debbugs-submit-bounces@debbugs.gnu.org Fri Jul 05 08:04:15 2024 Received: (at 71823) by debbugs.gnu.org; 5 Jul 2024 12:04:15 +0000 Received: from localhost ([127.0.0.1]:43697 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sPhfj-0004r6-0y for submit@debbugs.gnu.org; Fri, 05 Jul 2024 08:04:15 -0400 Received: from mail-lj1-f174.google.com ([209.85.208.174]:56784) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sPhfg-0004qn-TH for 71823@debbugs.gnu.org; Fri, 05 Jul 2024 08:04:13 -0400 Received: by mail-lj1-f174.google.com with SMTP id 38308e7fff4ca-2ee910d6aaeso15541891fa.1 for <71823@debbugs.gnu.org>; Fri, 05 Jul 2024 05:04:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1720180984; x=1720785784; darn=debbugs.gnu.org; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Krqd8IP4++us7gxgO1fvHUzr00iasESDbH34Mz1LQs0=; b=QJ9ldJ+NVGnu24xrhO1BZUxrF5/joWA7tkw/7tLWuW7SvQWLm4YazK5N6mR4710aUk gkl8w8Kqnxy90sWa1ZxPyuk5XbI2FAIeQ+D93J5wSmxoBIJlNt7+F0N9hYCEh7ZHCCkb ZNgNtBQpDHj2m+iEU9HeGFuCyZGgHtCyW61JEcr4YylpfvKXUubIwuszuXB+s9WlJA/w q+YGgmRWz0pdSCclRmfYciR3rBQEvvNcJ3IV+7K6Ph/cvaUX3x4jejE36fzNRxkCUmPk WAHRnMuQ74aQo959pl/D+IPd/CD7rsVjvxVMk9QRIIPsN3CgkFH93rN63599k69vGqgX 1xDQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1720180984; x=1720785784; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=Krqd8IP4++us7gxgO1fvHUzr00iasESDbH34Mz1LQs0=; b=qLfm51WVchdpbf2h4xQoJ6Azr+decXBrSNc9+DFFV4SJUQa84g55k9rt73hPFeBX6X 58BmxA66c3j8q/X9VbjgLRLTeDXO0LmoFnkcHNcsiggE6eXLh58xY6q7Ob60zPXC6K4W unLfeI4KxSHfL2B2zElBc2ZR6OkV5HT3EKLtflFKA+9+HQ0f7/rs2tkzi5pnF2N79UyX F0FiHkY2hKQhB932pjPs2D/ySYau02n8Kv/fe8mPVROk/7B+31zhyOz/OmXQX9duxHF/ 4/0Iz0Q9d53tJCwN+7OXnUJ6Ar/wdX8ljm4uqE/rWWf9CurPqEgjFZrOzd6hz9qgu8LG pinQ== X-Forwarded-Encrypted: i=1; AJvYcCVNbYX6sO7tH/aaeF14ALv9PHHUZCIrQl+WB/oywC4KiQO69jORJuZyLqsPeUxwSnKNJc+HMnhJml2tgnq7MGSpNe3GF+M= X-Gm-Message-State: AOJu0YwbI0RJNo7JB23SH+g8UBVcjIhnYICh1amX+H+OfqLIAuUDKp0U XRio42KCf9C1cFSasROYiU9nyCC43WJLQK7hnmLX7Zs+eqV/oWgO X-Google-Smtp-Source: AGHT+IGnxD2PpIdw9U9R4uiYbvffG6m/Qqq8qITDW6CSk/CkMx1pZqnS4+KwR9w57AjVGGFQe3rDHg== X-Received: by 2002:a05:651c:2226:b0:2ec:5061:d7d2 with SMTP id 38308e7fff4ca-2ee8ed5ee10mr37928611fa.18.1720180983363; Fri, 05 Jul 2024 05:03:03 -0700 (PDT) Received: from krug (87-196-76-11.net.novis.pt. [87.196.76.11]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3679c12440asm4103529f8f.73.2024.07.05.05.03.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Jul 2024 05:03:02 -0700 (PDT) From: =?utf-8?B?Sm/Do28gVMOhdm9yYQ==?= To: sbaugh@catern.com Subject: Re: bug#71823: 31.0.50; project-mode-line and eglot duplicate project-name in mode-line In-Reply-To: <87h6d6flld.fsf@catern.com> (sbaugh@catern.com's message of "Wed, 03 Jul 2024 17:10:06 +0000 (UTC)") References: <86wmm9jfk7.fsf@gnu.org> <86o77kjk87.fsf@gnu.org> <17183c60-1733-4938-9a85-f3351c87bcb9@gutov.dev> <87jzi6fvar.fsf@catern.com> <87h6d6flld.fsf@catern.com> Date: Fri, 05 Jul 2024 13:04:15 +0100 Message-ID: <874j94gi4g.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 71823 Cc: Spencer Baugh , Eli Zaretskii , Juri Linkov , 71823@debbugs.gnu.org, Dmitry Gutov X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) sbaugh@catern.com writes: > To be clear, I want a configuration which will have project-name from > project-mode-line and no project-name in the eglot mode-line entry. I understand. > So that functionality will need to be moved anyway, no matter how we > solve this problem. As I see it (now, not 2 weeks ago) only if the user wants the same as you. The reason I changed my mind is that I hadn't realized that section was being used for the server-specific menu. > Are you fine with including the server menu in the main menu? This is > something we'd want in both the "make it work by default" or "make it > customizable" solutions. No, I'm not sure of that. One of the reasons is that Eglot currently supports only one server, but there are many requests for it to support more than one in the future. So I'm not sure that's such a good move, whereas if the user decides they don't need the server menu, that's a different story. > It's better still to both allow the user to choose and *also* have a > default which works right out of the box. Those are two separate things > which we can do separately. AFAIK the current default is fine. Nothing is broken. > But allowing the user to choose adds a bunch of new customization points > that need to be maintained. Not a bunch of customization points. Only one, a very idiomatic one: eglot-mode-line-format. > I don't understand why we would add these new customization points > when we already are low on maintainer time for Eglot. I anticipate > adding these custosmization points would have lots of small bugs. I'm > all for doing it eventually, but making things work by default also > solves my problem, without adding new maintenance burden. I find this very contradictory, but that's just my opinion. It's precisely because we're low on maintainer capacity for Eglot that I don't want rash changes. No offense to your idea -- it seemed good and I approved and encouraged it, but in light of this new info, I've changed my mind. Also, Eglot enabling things outside its domain when managing buffers is indeed a design principle, but it usually applies to things that are _essential_ to helping Eglot do its job corectly (Flymake, ElDoc, even certain Company configurations). Now, I'm not sure showing the user the current project in the mode-line and giving them access to all those (undoutably useful) options is one of those "essential things", whereas telling the user that there is currently at least one live server is. Furthermore , not everyone likes this idea, as you may expect. Anyway, if you want a quick hack for your predicament, I think you can put this in your .emacs: (add-hook 'eglot-managed-mode-hook (lambda () (setf (eglot--project-nickname (eglot-current-server)) ""))) untested... Jo=C3=A3o From debbugs-submit-bounces@debbugs.gnu.org Mon Jul 15 09:30:32 2024 Received: (at 71823) by debbugs.gnu.org; 15 Jul 2024 13:30:32 +0000 Received: from localhost ([127.0.0.1]:59230 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sTLmh-0006z4-Kn for submit@debbugs.gnu.org; Mon, 15 Jul 2024 09:30:31 -0400 Received: from mxout5.mail.janestreet.com ([64.215.233.18]:51935) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sTLmf-0006yq-JP for 71823@debbugs.gnu.org; Mon, 15 Jul 2024 09:30:30 -0400 From: Spencer Baugh To: =?utf-8?B?Sm/Do28gVMOhdm9yYQ==?= Subject: Re: bug#71823: 31.0.50; project-mode-line and eglot duplicate project-name in mode-line In-Reply-To: <874j94gi4g.fsf@gmail.com> (=?utf-8?Q?=22Jo=C3=A3o_T=C3=A1vor?= =?utf-8?Q?a=22's?= message of "Fri, 05 Jul 2024 13:04:15 +0100") References: <86wmm9jfk7.fsf@gnu.org> <86o77kjk87.fsf@gnu.org> <17183c60-1733-4938-9a85-f3351c87bcb9@gutov.dev> <87jzi6fvar.fsf@catern.com> <87h6d6flld.fsf@catern.com> <874j94gi4g.fsf@gmail.com> Date: Mon, 15 Jul 2024 09:30:21 -0400 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=janestreet.com; s=waixah; t=1721050221; bh=SJ6Rc10Wxdxkdkm6cT530M+ifUHoakQuxGQ5sPeh/Pk=; h=From:To:Cc:Subject:In-Reply-To:References:Date; b=Xt65PnY70hxL7nyk3w5b9NhuXEwh2E6xYkZ23eOCNTxCqMbJ+HiK3NYRELdhi0ZqR JVdlg0Vw48woM9nmeMLj4boyNGxDcCB2V66N/JqdFmZI7eYjF+GRLk8nQAvWDr9LC1 ckz6sopwFwPiaAXMw8qyqQJGWxRMTaHiSFo8j9OEN8z8Z7NP5q2NQQJPLMPhamD44T hXzwbdeN5g0HjdNE2JFoRMPGm+waFQ9lOKCeOjSf/3+zdJRolDpu48cKDOhSdGmGAK +F2zeMYN31fmUoHmYCLr0kPSE2JPdbdPFnmbSnmk4XA/353f49NG72ND2bzIMxB0pX RU1MRUodANcnA== X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 71823 Cc: Dmitry Gutov , sbaugh@catern.com, Eli Zaretskii , 71823@debbugs.gnu.org, Juri Linkov X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Jo=C3=A3o T=C3=A1vora writes: > sbaugh@catern.com writes: > >> To be clear, I want a configuration which will have project-name from >> project-mode-line and no project-name in the eglot mode-line entry. > > I understand. > >> So that functionality will need to be moved anyway, no matter how we >> solve this problem. > > As I see it (now, not 2 weeks ago) only if the user wants the same as > you. The reason I changed my mind is that I hadn't realized that section > was being used for the server-specific menu. > >> Are you fine with including the server menu in the main menu? This is >> something we'd want in both the "make it work by default" or "make it >> customizable" solutions. > > No, I'm not sure of that. One of the reasons is that Eglot currently > supports only one server, but there are many requests for it to support > more than one in the future. So I'm not sure that's such a good move, > whereas if the user decides they don't need the server menu, that's a > different story. I see. What about putting an abbreviated server name in the eglot modeline, replacing the current project-name? That would fit better with supporting multiple servers anyway: there would be multiple entries for multiple servers. I'm not sure what a good source for an abbreviated server name would be... perhaps we could query something from the LSP server, or put it in eglot-server-programs? From debbugs-submit-bounces@debbugs.gnu.org Tue Jan 28 06:13:45 2025 Received: (at 71823-done) by debbugs.gnu.org; 28 Jan 2025 11:13:45 +0000 Received: from localhost ([127.0.0.1]:35712 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tcjXN-00023L-52 for submit@debbugs.gnu.org; Tue, 28 Jan 2025 06:13:45 -0500 Received: from mail-oa1-x2c.google.com ([2001:4860:4864:20::2c]:60430) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1tcjXK-000233-Bj for 71823-done@debbugs.gnu.org; Tue, 28 Jan 2025 06:13:42 -0500 Received: by mail-oa1-x2c.google.com with SMTP id 586e51a60fabf-2a3a40c69e3so3001272fac.0 for <71823-done@debbugs.gnu.org>; Tue, 28 Jan 2025 03:13:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1738062816; x=1738667616; darn=debbugs.gnu.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=r0nbSA0FlmDZVJ6JdEftjnW3o5zWeQ0/18RpTJhdtNw=; b=eunkDgqkOuVYEzRV2N/FgYPaocas0a27eTcl9MY5ikrvdo5Q0gH3dnS0zGrVATCw68 UnqBG8NYGkj+mBV5CXxRj4TGc3ymDZVcyyfVlw2QTDX9fYcYHvQmrud70sRA94G/rYUJ v6LBHv82bJNY4Hq+H4JrwYTjUkw6Kw1GVOHcQWGOvYGCBpa+wEpXkD9qcfE8l2ZdqEol wsQ7h5KHwrDIuk54pEqXwDbWhF5FKjdK2tkPNZ4M7smdQDpaCGs5Z+hJQY/oQZW+LqCf 7180uZuK+nH8yT+ZeQsJk7e3awGhj3loMwP5HVgBntad1Lnl74xFRrh9DlpVFXUXXU5C uy3Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1738062816; x=1738667616; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=r0nbSA0FlmDZVJ6JdEftjnW3o5zWeQ0/18RpTJhdtNw=; b=qOqxOPUf+BHqgvwc4VjImUiFCQetSIe9tCry23OOw9A1P9iMFMhBOcMAv9ef4cB71M OuuL/aq0fyM74iLi17/oz9GbOI/OpaIsr4OuPIPfMY7jSTLIA6h/WtHlmcvQ6/EcPhLM iFNgaP+P5O23xIam49grNt/C5nvTUUW1DSLB3toMzVB53jn8rE+bieC+lqwfYXkikfdT 2GCyiMN5SncNPCfU2KoeidTkSyYDnOH61EjsdOQXc2K7L0vjudBw0ivzhSqm/+IZAmqd 2zOP7F7HqNCeF00NqzHr/1IaOa+UOy+oTm+mkDfkYB+qXkEtR8wmUX+04MjZrj/4PWbI meXw== X-Forwarded-Encrypted: i=1; AJvYcCWXVigWCRLGYK9Ufrcnn2xM3bYk5z7rt8+LA//kNmULBhmAEJQukk34TU35eh/BCDsvr3up8xmb4LRt@debbugs.gnu.org X-Gm-Message-State: AOJu0YxuOT8uzLRZrk8RlyfFtZpbPV7OvgpLziiyUizqnfRCuSNQl296 Ch6exG37xDhMew4WPSB2tWypcshVUtlnhL12v2NCmZk6sFKR8AR12c57Myw13L1mqEDrt6gBCcj h2j8P55qa9Zi5oXUbjPHPY65kBNA= X-Gm-Gg: ASbGnctgTgQCzIUTARcXCL4whYdPwrGsO1zaZ9ic/L0Y6pAxw4fn0S3vI98oqlktVBs vUi1EKN9zugrQ5VbptUqThC6Sfc05kEg7xpqfVwvmOdvIlpeI+JnU2ZqbrWhnJN0P5GHYe3+d X-Google-Smtp-Source: AGHT+IHn58ITbwHHGL3H/Ln8z4fJBIWt51TvE4Kg+/YAg4JWXLS/Cimdix9k2xMqQp28PNO7kFjbcDTdCli82bMW8aU= X-Received: by 2002:a05:6871:2010:b0:29e:460d:f74d with SMTP id 586e51a60fabf-2b1c048c301mr22816416fac.0.1738062816250; Tue, 28 Jan 2025 03:13:36 -0800 (PST) MIME-Version: 1.0 References: <86wmm9jfk7.fsf@gnu.org> <86o77kjk87.fsf@gnu.org> <17183c60-1733-4938-9a85-f3351c87bcb9@gutov.dev> <87jzi6fvar.fsf@catern.com> <87h6d6flld.fsf@catern.com> <874j94gi4g.fsf@gmail.com> In-Reply-To: <874j94gi4g.fsf@gmail.com> From: =?UTF-8?B?Sm/Do28gVMOhdm9yYQ==?= Date: Tue, 28 Jan 2025 11:13:36 +0000 X-Gm-Features: AWEUYZkUWUCreJCuuhWnKwhJhM24JIE9zy5qitAS74YM4UrWt_RFmWvNyS8LrA0 Message-ID: Subject: Re: bug#71823: 31.0.50; project-mode-line and eglot duplicate project-name in mode-line To: sbaugh@catern.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 71823-done Cc: Spencer Baugh , Eli Zaretskii , Juri Linkov , 71823-done@debbugs.gnu.org, Dmitry Gutov X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) On Fri, Jul 5, 2024 at 1:03=E2=80=AFPM Jo=C3=A3o T=C3=A1vora wrote: > > But allowing the user to choose adds a bunch of new customization point= s > > that need to be maintained. > > Not a bunch of customization points. Only one, a very idiomatic one: > eglot-mode-line-format. I've now implemented this in eglot.el and pushed to master. Just remove eglot-mode-line-session for eglot-mode-line-format and Eglot's mode line will no longer display the project name in a conflicting way. This enhancement will be in the upcoming Eglot 1.19 version. Jo=C3=A3o From unknown Sun Jun 22 17:12:46 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Tue, 25 Feb 2025 12:24:08 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator