From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eduardo Ochs Newsgroups: gmane.emacs.help Subject: Is there a `find-function-noselect' that does not resolve aliases? Date: Tue, 18 Jan 2022 02:08:00 -0300 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="31115"; mail-complaints-to="usenet@ciao.gmane.io" To: help-gnu-emacs Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Tue Jan 18 06:11:45 2022 Return-path: Envelope-to: geh-help-gnu-emacs@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 1n9gmX-0007wv-FD for geh-help-gnu-emacs@m.gmane-mx.org; Tue, 18 Jan 2022 06:11:45 +0100 Original-Received: from localhost ([::1]:44874 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n9gmW-0006WB-AL for geh-help-gnu-emacs@m.gmane-mx.org; Tue, 18 Jan 2022 00:11:44 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:50472) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n9gjC-0006Vz-Js for help-gnu-emacs@gnu.org; Tue, 18 Jan 2022 00:08:18 -0500 Original-Received: from [2607:f8b0:4864:20::1029] (port=55942 helo=mail-pj1-x1029.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1n9gj8-0001Pt-9N for help-gnu-emacs@gnu.org; Tue, 18 Jan 2022 00:08:18 -0500 Original-Received: by mail-pj1-x1029.google.com with SMTP id hv15so22255182pjb.5 for ; Mon, 17 Jan 2022 21:08:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:from:date:message-id:subject:to; bh=qf4jHle4Wm7OfOIyOjUrBBsrD+XZ/QCS/D+N2moMqcs=; b=npn34G1ZiFwE0H7xBdrGwuSuF45wje5kDYTJj0HiklkR6FTnUHwPS0yDx2i3lB3ipn p2O0RAZG9xQXKX/Twhh8CrAG+nGkSrFshwuELTlORxWJ2bWZl9hxkpkR4OIMiCN9iK97 yx+uyeQKH3HKvMQVUKvF8W3CdhHnhKFRNhcsbWr98rBA/7dRWk1e+wI7dg4PRVOsMLVZ ur/0VdJ7L0T4Zfmla57uCjqqIJM+BWVnT08AC4FDPUNoA9lMUjf3ofLwtm//60PDNMwP mq7sW6jjqaGZJGaMSlddpIylUqDmfLGsDrXvVNPF3n7mYFDXL23MTkpHT8yQ6ow1duca owpg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=qf4jHle4Wm7OfOIyOjUrBBsrD+XZ/QCS/D+N2moMqcs=; b=I6RgozbzPIBWWnzqIhX5XGZwzJnKImkyrHeC23Vv2VbBGbYRABxavw8yhHoVjqLtWn h/fMwbIfZTmwDabkndD6ffiJLHuugU+8ApjUf+G9xUyZDeCubKkKxZxkVMTkLVgN43VY iv76QksseKkK+n0KP6bwoDJjXh/DC/4KJ/QCJv7+NoIBInq9Fyil8LFIHlHIBgdYU1+Q 0dy4LRlRYw5KAvIte2Vcio3gWANh4qr/wmFc58gju3FOwIoZ2WNccBCQ/5MYgJc9h5T0 esww7ZsHFB93DY/UwP3iPLV6TQVilgjm2egMp3pMqOZaDbo9ezoj3O4Pl36U9RsC0fm0 sPyA== X-Gm-Message-State: AOAM531JYaMOsF03pzTBPaZPq1AboC1dKN/mq3DheEA2gtPaNY5jX8U/ U7wADzxTxHxocgPirvsfEF88dZnsyj/vGUkOTKY8K6BIor5ytg== X-Google-Smtp-Source: ABdhPJworLEMlZhllAvJSntQMYfEhu4QiL82kqFz1xjAZziDL8Se5ggmskow1z+w52eafpBkZNQk1o2uBfUx1BFnZs0= X-Received: by 2002:a17:903:187:b0:14a:6ee7:682c with SMTP id z7-20020a170903018700b0014a6ee7682cmr25780824plg.105.1642482492157; Mon, 17 Jan 2022 21:08:12 -0800 (PST) X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::1029 (failed) Received-SPF: pass client-ip=2607:f8b0:4864:20::1029; envelope-from=eduardoochs@gmail.com; helo=mail-pj1-x1029.google.com X-Spam_score_int: -12 X-Spam_score: -1.3 X-Spam_bar: - X-Spam_report: (-1.3 / 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, HTML_MESSAGE=0.001, PDS_HP_HELO_NORDNS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.io gmane.emacs.help:135415 Archived-At: Hi list, what is the recommended low-level way to jump to the definition of an alias? Let me explain my question with a concrete example... if we run this on a shell, cat > /tmp/my.el <<'--snip--snip--' (defalias 'myalias1 'myalias2) (defalias 'myalias2 'myalias3) (defalias 'myalias3 'myfunction) (defun myfunction () 42) '( (load (buffer-file-name)) ;; This jumps to the definition of `myfunction': (find-function-noselect 'myalias2) ;; The sexp below generates a "*Help*" buffer in which the ;; first line has a button whose text is "/tmp/my.el". ;; Its action is to jump to the definition of `myalias2'. (describe-function 'myalias2) ) --snip--snip-- it will create a file /tmp/my.el that defines three aliases and a function, and then it has a quoted list that is treated as a comment. That quoted list contains three sexps that are to be run by hand with `C-e C-x C-e' or your favorite variation of that. If we run those three sexps then the first one will load that file. The second one, (find-function-noselect 'myalias2) will (sort of) jump to the definition of the function `myfunction', instead of to the definition of the alias `myalias2' - so it "resolves the alias" somehow... but if we run the third sexp, that is (describe-function 'myalias2) and we click on its button "/tmp/my.el" then this will jump to the definition of the alias `myalias2'... so somewhere in the code associated to that button there's a low-level way of jumping to the definition of an alias "WITHOUT resolving the alias". The problem is that the code of that button is too intrincate for me. I've tried `M-x describe-button', I've tried to inspect its text properties, I found that on that button the key RET is bound to `push-button', and I've tried to understand the code of `push-button' and `help-function-def--button-function', but I'm stuck. Or rather: my brain is too tiny, and I'm tired. Help, please! =( Cheers, Eduardo Ochs http://angg.twu.net/ P.S.: here's a bit more of context. If we run one of these sexps in eev - they're equivalent - (find-efunction-links 'myalias2) (eek "M-h M-f myalias2") we get a temporary buffer with lots of sexps "about myalias2". One of these sexps is: (find-efunction 'myalias2) that interprets the result of (find-function-noselect 'myalias2) in the right way, and jumps to the definition of the function that `myalias2' point to. I am trying to write a variant of `find-efunction', called `find-ealias', that will behave like this: a sexp like (find-ealias 'myalias2) will jump to the definition of the alias `myalias2' "WITHOUT resolving the alias to a function"... P.P.S.: sorry for the length - I was trying to avoid getting answers like "use M-x describe-function" or "look at find-func.el"...