From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Michael Albinus Newsgroups: gmane.emacs.devel Subject: Re: Yet another global/gtags package into elpa.. Date: Tue, 29 Mar 2022 10:21:07 +0200 Message-ID: <87sfr1dv9o.fsf@gmx.de> References: <20220328232754.feeavepjtqauvnv5.ref@Ergus> <20220328232754.feeavepjtqauvnv5@Ergus> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="10652"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) Cc: emacs-devel@gnu.org To: Ergus Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Mar 29 10:24:30 2022 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nZ79R-0002UR-HZ for ged-emacs-devel@m.gmane-mx.org; Tue, 29 Mar 2022 10:24:29 +0200 Original-Received: from localhost ([::1]:39962 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nZ79Q-0006BP-4q for ged-emacs-devel@m.gmane-mx.org; Tue, 29 Mar 2022 04:24:28 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:42758) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nZ76K-0004kf-QQ for emacs-devel@gnu.org; Tue, 29 Mar 2022 04:21:22 -0400 Original-Received: from mout.gmx.net ([212.227.15.18]:52983) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nZ76F-0004OK-Vo for emacs-devel@gnu.org; Tue, 29 Mar 2022 04:21:16 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1648542068; bh=9OghfPXzOFxfzffJwsukgAe48GojnRtAiDyNcjnekDk=; h=X-UI-Sender-Class:From:To:Cc:Subject:References:Date:In-Reply-To; b=AqYQjbUyg1lLpQWKIaZDUeYHXnD6qN5fL61oybfn/3JPC2Nly8yH+CfessFJDKTLG ohOzR9qyN/Xyk72X0fbu8NFTrqYg60RFdm+b0HGPRn9P3Nj2GvdQAB2F0/7mnhfnWq kR/C9d8GJowNHnyiSDAbbFEzuI0PaMep39oAnWFc= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Original-Received: from gandalf.gmx.de ([213.220.156.255]) by mail.gmx.net (mrgmx005 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MeCpR-1o90Lb0LTj-00bOAI; Tue, 29 Mar 2022 10:21:08 +0200 In-Reply-To: <20220328232754.feeavepjtqauvnv5@Ergus> (Ergus's message of "Tue, 29 Mar 2022 01:27:54 +0200") X-Provags-ID: V03:K1:4t1hM8yip3qBFynYUzfUtWdDJ8pQMbMfn3+lkfxYLY5gtJRKgwS 13LXRK59iRTTcRBvm6f7aLde7hzFSWr7RO7hKygvLYdijpfsNbYf7zIYjUUO/Pco7lvlRPT mWDQACQZlfdsDBxqgY9Y5DiIy0wb04KCQeXQqWStIFgJ4QotNYAmeYeLd6QHfZbH6lP9JhG 6B2dTNg0qOVfMjsBDkzpg== X-UI-Out-Filterresults: notjunk:1;V03:K0:1/aboaLkXYI=:VmIYCnm2Mqm4r84H7WPu/E fEMLzJvsQaxMnKaYCOdh22ivJ3+KoncTdSWXmM/ehvXoJTS0o6CQ+UAbihkg8g8wa9fBXAXHZ 7JFi+1Bt0/+QuZpxA2W2zZRCEpTxzrsiHJZS9l16dm99l+dF27RXgS9TdVskKndJP/zFs+uAe We+NJfQgZBLqLrucDffmK8ix6uF4bA85myppzpqwxTrVVIfGDEME5Rdi+Yb3xSkePWuNtUh7+ 95GPPTz+psORol5roktG7iQt/cF+bXFwMmoEwerxW85DFGCScDOf81tuA/SEqGzgnxWNKESK9 30qFvwZGYWyhJ4LBxhWFp+shUow5BYmYK22NNazJIOJy3H2Fyo/52sGRYtXLck2epC0HxxLKS 7+bMORCzA5dVJIIialmyj1AjY9LCdOxBNdjXoRhC8hK4MX/EXUR9FjCfN9mBlA3ewpUBLMYL2 z1tv540hXgqSTal3ax0306O0hG7cvMX3UwA0QE3OeJuCkBfVUgaGj62nCcZAP9MH5dp04owxS ex3nfib17TT6p+0t/Tm6pjZyvBHO1mc59/zhfx6zkU9EpplE9rNJVM2OYDbMuIlkA5Kq9MMHR o80Xh3i41BM43svzyYSC6MZc++ppwO9K2wWYCVhVWGRX2Ro3pix3kNmOsId7F5UlCPc2Gan40 aTkzbEgNFlD1BhdlFqsYZAoeUISA9Us9OP1ZqSqX4pZrATvR3rZDZgebU2Ny/P3DbDKhp26MP Gwa8YJrY0l9TvrvzfIaH7rnWhsxxMMomnst7LGyKdIy1Rwu+ZA2DR2/6RW+LZwNT5YsNXX8X Received-SPF: pass client-ip=212.227.15.18; envelope-from=michael.albinus@gmx.de; helo=mout.gmx.net X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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" Xref: news.gmane.io gmane.emacs.devel:287549 Archived-At: Ergus writes: > Hi: Hi, > If you consider that it is fine to add it; please just give me the > steps. > > https://github.com/Ergus/global-xref I gave it a cursory reading, some comments (all of them are rather minor). The Readme.md speaks about global-tags-mode, I guess you mean global-xref-mode. --8<---------------cut here---------------start------------->8--- ;; Copyright (C) 2022 Jimmy Aguilar Mena ;; Copyright (C) 2022 Jimmy Aguilar Mena --8<---------------cut here---------------end--------------->8--- This line is doubled, one is sufficient. But if the package is added to GNU ELPA it will be replaced anyway I guess. --8<---------------cut here---------------start------------->8--- (defvar global-xref--roots-list nil "Full list of project Global root. The address is absolute on remote hsts.") --8<---------------cut here---------------end--------------->8--- ^^^^ Typo --8<---------------cut here---------------start------------->8--- (defconst global-xref--output-format-regex "^\\([^ \t]+\\)[ \t]+\\([0-9]+\\)[ \t]+\\([^ \t\]+\\)[ \t]+\\(.*\\)" --8<---------------cut here---------------end--------------->8--- ^ Typo No backslash in front of ]. Instead of " \t" I would prefer "[:blank:]" for better readability, but this is personal style. Same for "0-9" vs [:digit:]". --8<---------------cut here---------------start------------->8--- (let ((criteria `(:machine ,host)) --8<---------------cut here---------------end--------------->8--- Why only the host? The user name could also be relevant. I wouldn't think too much about, and use just (connection-local-criteria-for-default-directory). In Emacs 29, you could even use an own :application symbol in order to distinguish from global Tramp settings. --8<---------------cut here---------------start------------->8--- (hack-connection-local-variables-apply (connection-local-criteria-for-default-directory)))) --8<---------------cut here---------------end--------------->8--- Here you use it already. --8<---------------cut here---------------start------------->8--- (defun global-xref--exec-async (command args &optional sentinel) "Run COMMAND with ARGS asynchronously and set SENTINEL to process. Starts an asynchronous process and sets `global-xref--exec-async-sentinel' as the process sentinel if SENTINEL is 'nil' or not specified. Returns the process handler." --8<---------------cut here---------------end--------------->8--- We don't quote nil in docstrings. And the function returns the "process object". --8<---------------cut here---------------start------------->8--- (defun global-xref--exec-sync (command args &optional sentinel) "Run COMMAND with ARGS synchronously, on success call SENTINEL. Starts a sync process; on success call SENTINEL or `global-xref--sync-sentinel' if SENTINEL is not specified or 'nil'. Returns the output of SENTINEL or nil if any error occurred." --8<---------------cut here---------------end--------------->8--- The same, we don't quote nil in docstrings. --8<---------------cut here---------------start------------->8--- (defun global-xref--filter-find-symbol (args symbol creator) "Run `global-xref--exec-sync' with ARGS on SYMBOL and filter output with CREATOR. Returns the results as a list of CREATORS outputs similar to `mapcar'. Creator should be a function with 4 input arguments: name, code, file, line." --8<---------------cut here---------------end--------------->8--- Creator shall be CREATOR. > Best, > Ergus Best regards, Michael.