From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: =?UTF-8?B?Sm/Do28gVMOhdm9yYQ==?= Newsgroups: gmane.emacs.devel Subject: Use elisp--xref-backend in *Apropos* and *Help* (Was Re: [ELPA] New package: transient) Date: Sat, 2 May 2020 12:09:36 +0100 Message-ID: References: <87368npxw4.fsf@bernoul.li> <87v9ljo5d0.fsf@bernoul.li> <87ftcnxu5m.fsf@bernoul.li> <83y2qezlpd.fsf@gnu.org> <83tv12zjx1.fsf@gnu.org> <20200429101755.GF24737@tuxteam.de> <838sicw4do.fsf@gnu.org> <83zhaqu89z.fsf@gnu.org> <83sggiu2p9.fsf@gnu.org> <83r1w2u20y.fsf@gnu.org> <83lfmatym6.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="120575"; mail-complaints-to="usenet@ciao.gmane.io" To: Dmitry Gutov , emacs-devel Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat May 02 13:10:42 2020 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 1jUq2c-000VIC-30 for ged-emacs-devel@m.gmane-mx.org; Sat, 02 May 2020 13:10:42 +0200 Original-Received: from localhost ([::1]:54506 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jUq2b-0008Nm-4m for ged-emacs-devel@m.gmane-mx.org; Sat, 02 May 2020 07:10:41 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:38130) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jUq1p-0007tU-Jk for emacs-devel@gnu.org; Sat, 02 May 2020 07:09:54 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.90_1) (envelope-from ) id 1jUq1l-0000hW-79 for emacs-devel@gnu.org; Sat, 02 May 2020 07:09:53 -0400 Original-Received: from mail-io1-xd29.google.com ([2607:f8b0:4864:20::d29]:41072) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jUq1k-0000hN-Oc for emacs-devel@gnu.org; Sat, 02 May 2020 07:09:48 -0400 Original-Received: by mail-io1-xd29.google.com with SMTP id b12so7301296ion.8 for ; Sat, 02 May 2020 04:09:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :content-transfer-encoding; bh=XnV+QyVjPhqfURm/SIUzYlFgt0OD6kq1rkwc7IZOdhM=; b=OcSq6xYZ/FEbcbjnWOIVDqxPGFlrQ7j0qIrNsqhK5j4/rYNL9OVPx9ZgviTp6s67wI L1M0QYlcVVZzRQK5bDmCEuuZr32X1IIFTGymFX5zvRcxSzGVgUhwFYCg2DhMuwI2TIE/ 4/I3X0hQH7DrGf753lA6ouR5CrgMgQBFmBXeLsKigjazWPPkNgVL9pmgqVwaS5QQtX0q H83+cQbegRQCcrDH9JCDWab0VXnaFHXtQLB7cK2615JeSh2aj5QHe+o2JTuTnQ2vwozv 2fS3a9CL2HYyimSqBA1p3GRbj63v9Ju4dKOkyZJC7IJetIKrXPEeHD+bZc+FTKK1zXFQ qAjQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:content-transfer-encoding; bh=XnV+QyVjPhqfURm/SIUzYlFgt0OD6kq1rkwc7IZOdhM=; b=JKiIzbXp2DUsQWHhX+c/TnEBoKH7DIQayIDQK7oRIMDmyhY3A48bUbGItTLltji3oo LtZxXDr7kBbHxD37gT5uz6eMH/jNICqa7YmoxeZ9jSX6MLyKhJXrLOujcdzoPR0sqcC3 x1SJUFQ96UA1NQvUz7rBJdl8tBjW/PEr4z+HqRkbj+VGMwl51nf/Gg5+MkRS2O09xGPB 3ZkB/QhhgdBdrsHUlZQfRl2gW2m3Jcq9klolJ3HqfCcahrs3Jd/flpO3fHmSmi2NIwPH DyzxevH796nDfk+0jLUHRUQi5JIr6qXpXVTiX4VS31nNUKmEZaW0UCM+tN/Uwf/qboaj qeEA== X-Gm-Message-State: AGi0Pub7jlCF5hUmBtXCtG0HnBzTuzPbdz5QxL3bhoJnFJO2LZ6JCxyz wpGy0Yxcf972qb4nnjwmXj5vT2gRPK++r+1lkyQ= X-Google-Smtp-Source: APiQypLP6MKGzjLy/7Wql4sA7RLPEZYIkn87BRKAgmADexaV0lXt964/irAORS1d8qGkVNxtrPWXPrOBI/z6JLCFU7U= X-Received: by 2002:a02:5bc9:: with SMTP id g192mr7122983jab.136.1588417787440; Sat, 02 May 2020 04:09:47 -0700 (PDT) In-Reply-To: Received-SPF: pass client-ip=2607:f8b0:4864:20::d29; envelope-from=joaotavora@gmail.com; helo=mail-io1-xd29.google.com X-detected-operating-system: by eggs.gnu.org: Error: [-] PROGRAM ABORT : Malformed IPv6 address (bad octet value). Location : parse_addr6(), p0f-client.c:67 X-Received-From: 2607:f8b0:4864:20::d29 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 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:248401 Archived-At: Since we're on the subject of Elisp development help, can we restart the discussion on how to get the `elisp--xref-backend` activated in *Apropos* and help? The default `etags--xref-backend` isn't very useful there. Plus= , when one is used to M-. and M-, it's a little strange to have to switch to = C-h o to follow the very commonly occurring references to symbols. I recall correctly, we had already settles that it's a decently good idea, but we ran into some loading precedence problem and the effort stalled. Is that the right recollection? It doesn't seem to make a lot of sense, since all we apparently need is `add-hook`. Anyway, it can be argued that `elisp--xref-backend` isn't the _best_ choice for those buffers, and that we should be taking the user to say, the manual when searching from those places. Or maybe, the `elisp--xref-backend` coul= d also collect matches from the manual, why not? Thanks, Jo=C3=A3o On Sat, May 2, 2020 at 11:57 AM Philippe Vaucher wrote: >> >> > My original use case is: I want to copy an association list, I know th= e function will probably have "copy" in its >> > name and "alist", let's C-h f for "alist TAB" and fail because no resu= lts. Start again with "copy TAB" and filter >> > the lots of "copy-*" function until I find copy-alist. >> >> "C-u C-h a copy alist RET" finds that function as the single hit. As >> does "C-u C-h a alist copy RET". > > > Right, that works well. Thanks. It's not the most obvious keybinding but = "C-h d copy alist" also works. > > >> >> > Now imagine if this particual function was named "asscpy" >> > instead how frustrated I'd be :-) >> >> You will be frustrated because you use the wrong command. "C-h f" is >> not your friend unless you have a very good idea of the function's >> name. That's why "apropos" family of commands were invented: to help >> you find something you don't know by name. There's a best tool for >> each job, and "C-h f" is not a good tool for this job. >> >> But I already said that, several times. And since you still disagree, >> then I must insist that my response to Richard was spot-on: he asked >> why doesn't "C-h d" do the job, and my response was, in a nutshell, >> that what "C-h d" does is not relevant for you and other users who >> think and are accustomed to work like you do. You disagreed with my >> conclusion, but we now made one more full circle, and established that >> my conclusion was correct after all. > > > I think we are mixing two concepts here. To search for a single function,= where you already know the keywords, yes "C-h d" works. To get a curated l= ist of the API of a topic, not so much. Because my examples mix both findin= g a specific function and getting the curated list, I guess we were each ta= lking about the specific function example and I want talking about the cura= ted list. > > I still think "C-h d alist", because it does not give me assq and assoc i= s not doing a good job. > > Because alist is controversial let's take "C-h d regexp match": it does n= ot give me string-match nor match-string. If I search for "regex match" the= n I find match-string. > > But overall I understand your point better now, you are not supposed to u= se "C-h d" to get a curated list of the api of a topic, it's just to find a= single function. For that I agree it's a good tool. > > >> >> > Also imagine how self-documenting and self-discoverable Emacs Lisp wou= ld >> > be if things where properly namespaced, like we ask for all packages t= o be on MELPA/ELPA and friends. >> >> I'm not objected to have aliases that would make it easier to find out >> the function's name using simple completion, but I think you greatly >> overestimate the usefulness of that in many practical situations. >> Meanwhile there are existing features designed specifically for these >> use cases, which do their job much more efficiently _today_, and you >> choose to disregard them or treat them as second-class citizens. I >> think it's a mistake, but I can only make suggestions and point out >> that those features do exist. > > > I'm still not very satisfied about the tools you showed for listing an ov= erview of the API to manipulate regexp, or files, or processes (etc). What = you are basically saying is that wanting to have this overview is overrated= , but for me it helps me understand the landscape of how the API works and = is designed. What functions would be available should I need them in the fu= ture, what parts is missing, etc. > > For now the only tool I have is the manual page with "M-x keep-lines -- f= unction". > > >> >> > As said earlier, probably that my way of thinking is not common around= here, but I'd not be surprised if it was >> > common for many developpers, maybe outside Emacs Lisp. >> >> My earnest advice for those developers is to try the features I >> mentioned, they might find them useful in situations similar to the >> one you described, and they might then decide to use them more than >> what they do today. > > > I'll certainly start to use it more. > > Thanks, > Philippe --=20 Jo=C3=A3o T=C3=A1vora