From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Omar Polo Newsgroups: gmane.emacs.help Subject: Re: The convenient method to check/inspect/retrieve the definition/usage of any commands/symbols/operators used in elisp code. Date: Sat, 19 Jun 2021 16:48:15 +0200 Message-ID: <87sg1dgbbk.fsf@omarpolo.com> References: Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="13582"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: mu4e 1.4.15; emacs 28.0.50 Cc: help-gnu-emacs@gnu.org To: Hongyi Zhao Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Sat Jun 19 16:48:52 2021 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 1lucHE-0003Og-1v for geh-help-gnu-emacs@m.gmane-mx.org; Sat, 19 Jun 2021 16:48:52 +0200 Original-Received: from localhost ([::1]:44350 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lucHC-0002aI-FF for geh-help-gnu-emacs@m.gmane-mx.org; Sat, 19 Jun 2021 10:48:50 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:53650) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lucGo-0002a5-0p for help-gnu-emacs@gnu.org; Sat, 19 Jun 2021 10:48:26 -0400 Original-Received: from mail.omarpolo.com ([144.91.116.244]:63202) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lucGl-0001iI-Qi for help-gnu-emacs@gnu.org; Sat, 19 Jun 2021 10:48:25 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=omarpolo.com; s=20200327; t=1624114096; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=IxfGVW0i3w/aMlqZr2PdfCgBIKdMjT2vGbZ7eRKv5pw=; b=2q0G7IgeQEsp8brvzFwNIM3ktDJXREheQYZwkbvMoIiLeFKozxIGq8kSdfpo3HnOa00TPy BflZN7w9/68JJlSA6CXBGjZ77u8BJKG4ZZCTvqdF3mF3Ld/4JOZLEMZpVdh0OYI58O+44I gfEUVKIH9/ESdrmVZgtoue6rJh1O/aE= Original-Received: from localhost (host-79-16-11-173.retail.telecomitalia.it [79.16.11.173]) by mail.omarpolo.com (OpenSMTPD) with ESMTPSA id 5939c1f8 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Sat, 19 Jun 2021 16:48:16 +0200 (CEST) Original-Received: from venera (localhost [127.0.0.1]) by localhost (OpenSMTPD) with ESMTP id 2d169662; Sat, 19 Jun 2021 16:48:15 +0200 (CEST) In-reply-to: Received-SPF: pass client-ip=144.91.116.244; envelope-from=op@omarpolo.com; helo=mail.omarpolo.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, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.23 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:131018 Archived-At: Hongyi Zhao writes: > Dear all, > > Are there any built-in method of Emacs which can let me conveniently > check/inspect/retrieve the definition/usage of any > commands/symbols/operators used in elisp code at-the-point/in-situ? > Say, for the following code snippets: > > ;;; > (defun fk/company-wordfreq-toggle-language (&optional language) > (interactive) > (setq ispell-local-dictionary (or language > (if (string= > ispell-local-dictionary "english") > "turkish" > "english"))) > [...] > `(progn > ,@(mapcar (lambda (p) `(use-package ,p)) > packages))) > > (use-multiple-packages flycheck > dash > ) > > [...] > (mapcar #'straight-use-package '(flycheck lsp-mode dash ...)) > > ;or equivalently > > (defvar my-package-list '(flycheck lsp-mode dash ...)) > (mapcar #'straight-use-package my-package-list) > ;;; > > I want to find some convenient methods built in Emacs itself with an > in-situ manner - by moving the point to the interest position - to > check any commands/symbols/operators used in them. > > Regards there is M-. (xref-find-definitions) that will jump to the definition of the symbol at point (at least in emacs lisp buffers), and M-, (xref-pop-marker-stack) to jump back. Or you can C-h f or C-h v (describe-function/variable) and then M-n (next-history-element) to bring in the symbol at point.