From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Ivan Kanis Newsgroups: gmane.emacs.devel Subject: Re: emacs-lisp-mode and find-tag Date: Fri, 20 Jun 2014 20:53:28 +0200 Message-ID: <87lhsrtntj.fsf@kanis.fr> References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1403290445 23261 80.91.229.3 (20 Jun 2014 18:54:05 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 20 Jun 2014 18:54:05 +0000 (UTC) Cc: Josh , ams@gnu.org, emacs-devel To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Jun 20 20:53:56 2014 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Wy3wg-0006bX-Sx for ged-emacs-devel@m.gmane.org; Fri, 20 Jun 2014 20:53:55 +0200 Original-Received: from localhost ([::1]:42459 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wy3wg-00033f-Gx for ged-emacs-devel@m.gmane.org; Fri, 20 Jun 2014 14:53:54 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:54801) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wy3wX-00033J-VU for emacs-devel@gnu.org; Fri, 20 Jun 2014 14:53:51 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Wy3wQ-00044m-58 for emacs-devel@gnu.org; Fri, 20 Jun 2014 14:53:44 -0400 Original-Received: from kanis.fr ([46.19.35.252]:39456 helo=srv2.kanis.fr) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wy3wP-00040A-SE; Fri, 20 Jun 2014 14:53:38 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=kanis.fr; s=alpha; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date:References:Subject:Cc:To:From; bh=GZjYQrlWopI0O+dFTnS3aIvyfE2Gd7yNFIcu/6s5nfU=; b=Zjr8JjBwq+OyFjtLZXkCNzDTqhLAcPY4evw8V5p4mFYBsCgLTpVmsOipFtmxNHq73EE+WVLj2ovZ/sR8WHmuI5HEpdIPrALTeCuHca607kOUf+vl2vEzu8lBakBudr04; Original-Received: from smtp.comencini.fr ([164.138.25.8]) by smtp.comencini.fr with esmtpsa (TLS1.1:DHE_RSA_AES_128_CBC_SHA1:128) (Exim 4.80.1) (envelope-from ) id 1Wy3wI-0004HQ-07; Fri, 20 Jun 2014 20:53:30 +0200 Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAAXNSR0IArs4c6QAAAB5QTFRF IBkXUxMTOCwoTC4qcUY8iFxQmmper31txpaJ/v/8aKZ1oAAAAcVJREFUOMt100tu2zAQAFDCXnUZ oAcIqG68LZULVLQBbwuSiffm6AIRRyeotAySJoVu2+FPpJWWC3/4NKOZocSW/yxWfnJ2+Bdwzhj7 8gleWVy7DXC2rkMNr2V/zRbghXIwthf3VbIA9Ffc71vZCSFyCEsBggtNS8ludwvfmhYA0Vn9o4DP zMWxR7+cPWzAYFzwM0ModtdmcDbDS6i/hT7L+RZof5yCXGrYe5jn2YO6BYMjgY+51tCIAqHgBLwR pwLnGuRjAKyBJkuN4yd4U92uCY1vUr2D/c5b8DuxyQwfOHUeaLqDJhnkkuGXbB56h2C1IVBdgncc bBi6feroa9B6jUDojnQPQKupbyXyeeCE1oT7Oqrt+SnfY3mkiyGA/3AmD3H5g32CcBx6hY8pRkwJ 9PpcjRGobUfprFnhAa1vepwcgMOhwG+pdSgKHFU9HAvoAH6XUl7lDUCCq5Qb6GMbVm3Aj++qDYCt wdBc/YHgOFCmS3mjDMRcSE2qY4E3Q3PVIQRQmeodNH4QEbRUFZzW+VotzwX4yTcRTySOML1qjcE5 hTirVqDHkMAP0PjAywp3d18JZtqzvr9zDYD+GaSKtE6Zlr/DLPNFmOcvBAAAAABJRU5ErkJggg== X-Hashcash: 1:20:140620:emacs-devel@gnu.org::nm/o830JOvJeU6+y:0000000000000000000000000000000000000000002GxE X-Hashcash: 1:20:140620:monnier@iro.umontreal.ca::JBPMVoL2FHlFUpvN:00000000000000000000000000000000000004czm X-Hashcash: 1:20:140620:josh@foxtail.org::3O/H+vy9jwmF8Kc5:07Bn1 X-Hashcash: 1:20:140620:ams@gnu.org::ydXvxo3SpVe5Czeb:000000Bl1I In-Reply-To: (Stefan Monnier's message of "Fri, 20 Jun 2014 13:35:07 -0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.91 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] X-Received-From: 46.19.35.252 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 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.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:172586 Archived-At: June, 20 at 13:35 Stefan wrote: > I'm more interested in introducing generic code, which relies on > a `find-tag-function` hook to do the work of finding the definition. I have used the following two functions for a while now. The second I have bound to M-, to pop back like in slime. (The default M-* is awkward IMO). I bind the functions in the elisp-mode, help-mode and the debugger-mode. They are not generic though... (defun ivan-elisp-find-object () "Jump to definition of function or variable near point." (interactive) (let ((object (intern (current-word))) (insert (lambda() (ring-insert ivan-elisp-mark-ring (point-marker))))) (cond ((functionp object) (funcall insert) (find-function object)) ((boundp object) (funcall insert) (find-variable object)) (t (message "symbol %s not found" (current-word)))))) (defun ivan-elisp-pop-mark () "Pop to the previous location before jumping to a definition." (interactive) (if (ring-empty-p ivan-elisp-mark-ring) (message "No previous locations") (let ((marker (ring-remove ivan-elisp-mark-ring 0))) (switch-to-buffer (or (marker-buffer marker) (message "The marked buffer has been deleted"))) (goto-char (marker-position marker)) (set-marker marker nil nil)))) -- I have been at my book, and am now past the craggy paths of study, and come to the flowery plains of honour and reputation. -- Ben Jonson