From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Filippo Argiolas Newsgroups: gmane.emacs.devel Subject: Re: [NonGNU ELPA] new package: eglot-inactive-regions Date: Fri, 06 Dec 2024 12:59:46 +0100 Message-ID: References: <874j3nrri7.fsf@posteo.net> <878qswlfty.fsf@posteo.net> <87ldwvjdzl.fsf@posteo.net> <878qsu3zln.fsf@posteo.net> <87jzcd2nkg.fsf@posteo.net> <87ser111ob.fsf@posteo.net> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="33474"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org, Gerd =?utf-8?Q?M=C3=B6llmann?= , Stefan Kangas , =?utf-8?B?Sm/Do28gVMOhdm9yYQ==?= To: Philip Kaludercic Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Dec 06 13:02:26 2024 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1tJX2Q-0008Wv-6V for ged-emacs-devel@m.gmane-mx.org; Fri, 06 Dec 2024 13:02:26 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tJX0F-00079m-Ds; Fri, 06 Dec 2024 07:00:11 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tJWzy-0006yO-OW for emacs-devel@gnu.org; Fri, 06 Dec 2024 06:59:55 -0500 Original-Received: from mail-wr1-x42b.google.com ([2a00:1450:4864:20::42b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tJWzw-0004RZ-OC for emacs-devel@gnu.org; Fri, 06 Dec 2024 06:59:54 -0500 Original-Received: by mail-wr1-x42b.google.com with SMTP id ffacd0b85a97d-3862ca8e0bbso420920f8f.0 for ; Fri, 06 Dec 2024 03:59:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1733486389; x=1734091189; darn=gnu.org; h=content-transfer-encoding:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from:from:to:cc:subject:date:message-id :reply-to; bh=c+vGAXzIqvjwfwehJm/iGcxHr/Te/TRJxMGL4/uw0ek=; b=g8ZXSIQ/fSyWX80ikyiymg6pYcVba9Rin4t8NgWnT6/pc+T//+FV++JuDRz2fl3CVG OhNSb/ZGbBMmov3z/B7OmY0U8gwlEiOxnHSOFMcAleJFxqxwVBL02b7HEvPwK5VKEJX/ OdZL9Aa12a1dH7ni4eZIOuBDIb1LNKUHFNGLCQ3EGgWkg5WJS8C1FuV+yPm4TvirziP2 la/zfDs8HN59of6n7Z3qCh0RJAXo8YdaGaCinahKBwcvhyoNFqpOO255aR3C29Mk4y2z h7E1IDxKmOR93lJJkfesMxwqwDM00Xkc8ZWi/tbQPmZWIrxl2I29O2L9XVpomRjCnbd4 HQ/A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733486389; x=1734091189; h=content-transfer-encoding:mime-version: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=c+vGAXzIqvjwfwehJm/iGcxHr/Te/TRJxMGL4/uw0ek=; b=I4QpHgIFa4s+//YBS2ghu9p5iG6wXOLYCSx4u2Ik6eDDDldCHSj1aaMtB8u8LNuAv0 vYysAPkez4ptt9Rp9TuXi2QFSvO4I3HW3rrYpEK20Hmd47S0BPItw2JrN2Rqq8BWm2Zp rcHWjJd8mlWROOU5ifNbJ0ioC8T73rJmdZFi/3s54/jjqzSV5jsjMNrlwfBQsmJDRKJG lqqmET2Kofx+g/pkfLaIl13cFxzwCqZHpyzHCFzQd/7YkAklb70Rxvar7AMc8Qptjvzz t7wSWrIV8mfW26PMUmfPKjcOC5EAJccV9o7fD8I+ktn6k2wRqhqTbMEN6ZNzxJ7onWrA OvNA== X-Gm-Message-State: AOJu0YwDsHEJ5K0tFsq4RWbhbH449O0eOtABY6bwOR3Nv7s3c/pvRi89 ofHUAINrp03GHFC754XLAg9vpPvzNXwmvjZv3yE99udWRFO+j8BK X-Gm-Gg: ASbGncuG+/C2ycPWlUi1ZP0PgRynPEbb19F9WZmr+qzumoKx7Bl9b46ufY72MIG0sDV qfDlQrbc3s69hWlAJTy//Y2sRiqfNgULmL5ZhpXBXaUa+k/v5LsPBDnod0ZrUReSpKMG8q/MwdZ 6D+DpyeSNSe6FG52wMWilebfYek94webRlK2BxD0ck0TG/3J2rgxK1NXW/5FSotk1nJlGTXkrbg jj+LjdampeCgU8YiwIUis7Ig3tdQMkBVqk2qXiZPp+BbMpAjELAN0x8CQ== X-Google-Smtp-Source: AGHT+IEalRKo5fSwxvNwj9zIQuc5wYu8e3LcSeO1OVPJvQyKgWVwY5/iDthvXtetbJ7wfwt4Xga+vg== X-Received: by 2002:a05:6000:402b:b0:385:e877:c037 with SMTP id ffacd0b85a97d-3862b3ce0c3mr1644521f8f.42.1733486389040; Fri, 06 Dec 2024 03:59:49 -0800 (PST) Original-Received: from mba ([151.56.36.113]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3861ecf3ee4sm4488293f8f.6.2024.12.06.03.59.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Dec 2024 03:59:48 -0800 (PST) In-Reply-To: <87ser111ob.fsf@posteo.net> Received-SPF: pass client-ip=2a00:1450:4864:20::42b; envelope-from=filippo.argiolas@gmail.com; helo=mail-wr1-x42b.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:326135 Archived-At: Philip Kaludercic writes: > Filippo Argiolas writes: > >> Philip Kaludercic writes: >> >>> Filippo Argiolas writes: >>> >>>> Philip Kaludercic writes: >>>> >>>>> Filippo Argiolas writes: >>>>> >>>>>> Philip Kaludercic writes: >>>>>> >>>>>>> Filippo Argiolas writes: >>>>>>> >>>>>>>> Filippo Argiolas writes: >>>>>>>> >>>>>>>>> Philip Kaludercic writes: >>>>>>>>> >>>>>>>>>> I would try something of the form like >>>>>>>>>> >>>>>>>>>> (if (fboundp 'new-function) >>>>>>>>>> (new-function ...) >>>>>>>>>> (old-function ...)) >>>>>>>>>> >>>>>>>>>> If on the other hand there has already been a new release of Egl= ot with >>>>>>>>>> these commands, then just depend on that version and the issue w= ould >>>>>>>>>> resolve itself. >>>>>>>>>> >>>>>>>>> >>>>>>>>> CC-ing Jo=C3=A3o. >>>>>>>>> >>>>>>>>> I pushed the suggested change but I still get the compile warning= s about >>>>>>>>> deprecated functions. I'd like to keep supporting emacs-29, shoul= d I >>>>>>>>> just disregard the warning? >>>>>>>>> >>>>>>>>> Sorry for the ignorance, how would the dependency on a specific e= glot >>>>>>>>> version work now that it's in core? >>>>>>>>> Does it require the users to have additional repos enabled? >>>>>>>>> >>>>>>>>> Sounds strange to me that we have macros to deprecate functions b= ut no >>>>>>>>> mechanism to automatically switch to the new one if it's just a >>>>>>>>> rename. Am I missing something obvious? >>>>>>>>> >>>>>>>>> Thanks! >>>>>>>>> >>>>>>>>> Filippo >>>>>>>> >>>>>>>> How about something like: >>>>>>>> >>>>>>>> ;; fallback to deprecated eglot functions >>>>>>>> (when (version< emacs-version "30") >>>>>>>> (defalias 'eglot-uri-to-path 'eglot--uri-to-path) >>>>>>>> (defalias 'eglot-range-region 'eglot--range-region)) >>>>>>>> >>>>>>>> or even something similar with a check on eglot version? >>>>>>> >>>>>>> That can be dangerous if other packages do fboundp checks and infer= too >>>>>>> much from that. I would try to see if adding `declare-function's c= ould >>>>>>> help suppress the warnings? >>>>>> >>>>>> Nope, the only solution working so far is to call the deprecated >>>>>> functions with `with-no-warnings'. >>>>>> >>>>>> Guess I'll go with this. I'd be fine with the warnings too if we did= n't >>>>>> have the annoying habit of scaring the end users with them :-) >>>>> >>>>> I don't have your source code available right now, my last suggestion >>>>> would be to use `with-suppressed-warnings' where you can suppress >>>>> specific obsoletion warnings, but that requires Emacs 27.1 or newer. >>>>> >>>> >>>> Thanks this seems to do the trick! >>> >>> OK great, I'll add the package to NonGNU ELPA. Can you just add a >>> .elpaignore file that lists the "screenshot" directory to be excluded >>> from the tarball? >>> >>> PS. Using the command "oxipng -o max -Z" I could compress one of the >>> images by 49%. You might also consider creating a SVG screenshot. >> >> Great, thanks! Added screenshots to ignore, let me know if I also have >> to bump the release number. > > That will be necessary for the change to take effect. Done > >> One of these days I wanted to update screenshots as they look ugly on >> lower res displays, will consider switching to SVG ones. > > In case you or anyone else reading along is not familiar with the > function, you can generate a SVG screenshot by evaluating: > > (write-region (x-export-frames nil 'svg) nil "screenshot.svg") > > Note that this requires Emacs to have been built using Cairo. I admit I didn't know this! I have a pgtk build in my work laptop, will definitely give it a try.