From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Brendan Miller Newsgroups: gmane.emacs.devel Subject: unifying emacs "go to definition" functionality Date: Tue, 19 Feb 2013 16:28:04 -0800 Message-ID: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 X-Trace: ger.gmane.org 1361320102 7001 80.91.229.3 (20 Feb 2013 00:28:22 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 20 Feb 2013 00:28:22 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Feb 20 01:28:44 2013 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 1U7xY4-0002cH-Ui for ged-emacs-devel@m.gmane.org; Wed, 20 Feb 2013 01:28:37 +0100 Original-Received: from localhost ([::1]:43053 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U7xXk-000564-Lh for ged-emacs-devel@m.gmane.org; Tue, 19 Feb 2013 19:28:16 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:57348) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U7xXg-00054x-Lg for emacs-devel@gnu.org; Tue, 19 Feb 2013 19:28:15 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1U7xXa-0001yC-CJ for emacs-devel@gnu.org; Tue, 19 Feb 2013 19:28:12 -0500 Original-Received: from mail-ob0-f175.google.com ([209.85.214.175]:38770) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U7xXa-0001xr-7X for emacs-devel@gnu.org; Tue, 19 Feb 2013 19:28:06 -0500 Original-Received: by mail-ob0-f175.google.com with SMTP id uz6so7137869obc.6 for ; Tue, 19 Feb 2013 16:28:04 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:x-received:date:message-id:subject:from:to :content-type:x-gm-message-state; bh=mEzaBO8aywVp1HbsWRzLMeqp8J/Kw0xV2Saw3ADgbSc=; b=I0WtcI8r7bCGdtEeNLWilMEQ4N1yLEyLVfDcpb0SnDyTPm4Urlr2jxw9xStKq3Is4S dK/+dBmqD/Q6pRDEUruM7EtCQmPOgbLxTyzn5ugpt/GVsHC6a/8wXccLKBArMwBwDYcF 2p6nQ3zWUD8FRPhZr/SVE9wJItzWAaaG8qOmrdBzQW6jayn8oq7juw2xwMt6zNwBukyx t19BnGcYgiISvced1nW0AEheOs/afqO3cJLDFmwZrDfbthAll0slIiWBZoiVJQq+B0e9 J4kAdPq400VwVl4dCwI/s9weCPHMmgp+zkMDJEJpdc3tVrZNsYc+JMcNfLBRKhb7RxSg ntHQ== X-Received: by 10.182.51.98 with SMTP id j2mr8412025obo.77.1361320084300; Tue, 19 Feb 2013 16:28:04 -0800 (PST) Original-Received: by 10.182.225.105 with HTTP; Tue, 19 Feb 2013 16:28:04 -0800 (PST) X-Gm-Message-State: ALoCoQn5EzdJPpxr/8M3Ea83U9FMjRTZiV7YNbjwj5cB5+brOYVf9meDSl2MlQm9LRzralk4+eeP X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 209.85.214.175 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:157179 Archived-At: Right now emacs has several modules that offer "go to definition" functionality, all of which have different implementations, and different behavior. 1. Etags uses M-. and M-* to push and pop from a pair of tag stacks (find-tag-marker-ring, and tags-location-ring). 2. elisp uses C-h f TAB RETURN to jump to definition. It has no tag stack, so there's no way to jump back. 3. CEDET uses C-c , J to jump to definition. It has no tag stack, though it pushes to the global mark ring. 4. Jedi (jump to definition/autocompletion for python) uses C-. It has no tag stack. 5. SLIME uses etags keybindings, but I don't think it uses etags stack. By far the etags interface (M-. to jump to definition and push the location, M-* to pop back), is the easiest interface to use, though the underlying tagging engine is less precise than the others. My suggestion is that the etags key bindings and tag stack be made generic, and that M-. trigger some kind of callback through a buffer local variable, so that jump to definition can be handled in a mode specific way. Note that in addition to reusing the same keybindings, reusing the same tag stack gives that added benefits that it's possible to navigate through a high level language into a lower level language, and then pop back out with M-*. I have this mocked up (in kind of a hacky way) with elisp and C, where I can jump from elisp into the C definition of a native function, navigate around C with etags or CEDET, and then pop back out back into elisp again. I'd be interested in taking a look at the implementation work behind this in the future, but initially I just wanted to put the idea out there for feedback. Brendan Miller