From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Noah Slater" Newsgroups: gmane.emacs.help Subject: Re: Code completion Date: Fri, 23 Jun 2006 21:34:01 +0100 Message-ID: <9ea1c1180606231334x3ee7214dr9b6f9aad1da84e23@mail.gmail.com> References: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1151094877 25634 80.91.229.2 (23 Jun 2006 20:34:37 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 23 Jun 2006 20:34:37 +0000 (UTC) Cc: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Jun 23 22:34:36 2006 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1FtsM7-0006uc-Sj for geh-help-gnu-emacs@m.gmane.org; Fri, 23 Jun 2006 22:34:20 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FtsM7-0000iI-DK for geh-help-gnu-emacs@m.gmane.org; Fri, 23 Jun 2006 16:34:19 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1FtsLt-0000i0-2U for help-gnu-emacs@gnu.org; Fri, 23 Jun 2006 16:34:05 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1FtsLr-0000hf-0z for help-gnu-emacs@gnu.org; Fri, 23 Jun 2006 16:34:04 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FtsLq-0000hc-QE for help-gnu-emacs@gnu.org; Fri, 23 Jun 2006 16:34:02 -0400 Original-Received: from [64.233.162.192] (helo=nz-out-0102.google.com) by monty-python.gnu.org with esmtp (Exim 4.52) id 1FtsX7-0000lA-MV for help-gnu-emacs@gnu.org; Fri, 23 Jun 2006 16:45:41 -0400 Original-Received: by nz-out-0102.google.com with SMTP id i1so1180732nzh for ; Fri, 23 Jun 2006 13:34:01 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=t6OU5SCMNhWAnJBPq0jkOabnbJTW9F6uVHm50P29cw7b/pBkYgfiRSvs2D6xg6rqQRlnTNFz1VmpqzzEOKNM8kyHkNyrzqzKBojVuZy85VMH5wwzQ+ilxCH3I1OZcJ3uc+B7zwRLq7sr5m1geoS/2x86fdmEiln9f5E3DmIz9E8= Original-Received: by 10.64.179.19 with SMTP id b19mr4504721qbf; Fri, 23 Jun 2006 13:34:01 -0700 (PDT) Original-Received: by 10.65.20.14 with HTTP; Fri, 23 Jun 2006 13:34:01 -0700 (PDT) Original-To: "Jorge Peixoto de Morais Neto" In-Reply-To: Content-Disposition: inline X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:35622 Archived-At: Try putting the following in your ~/.emacs file (customise project specific details): ;;; Tags ;; When revisiting the tag file, do not prompt to reload. (setq tags-revert-without-query t) (defun rebuild-tags (project-name directory-name tags-file) "Rebuild tags-file for directory-name." (eshell-command (format "find %s -type f -name '*.py' | etags -o %s -" directory-name tags-file)) (message "Rebuilt %s tags file." project-name)) (defun remember-find-tag (tagname) "Call `find-tag' and remember `last-tag'." (interactive (if (bound-and-true-p last-tag) (list nil) (list (find-tag-tag "Find tag: ")))) (find-tag tagname t)) (defun indent-or-complete () "Complete if point is at the end of a word, otherwise indent line." (interactive) (if (looking-at "\\>") (dabbrev-expand nil) (indent-for-tab-command))) ;; Key more commonly bound to `indent-for-tab-command' command. (global-set-key (kbd "TAB") 'indent-or-complete) ;; Key more commonly bound to `forward-char' command. (global-set-key (kbd "C-f") 'remember-find-tag) ;; Key more commonly bound to `backward-char' command. (global-set-key (kbd "C-b") 'pop-tag-mark) ; ;; Key more commonly bound to `next-line' command. (global-set-key (kbd "C-n") 'find-tag-other-window) ;; Key more commonly bound to `previous-line' command. (global-set-key (kbd "C-p") 'tags-apropos) (defvar my-project-tags-file "/path/to/my/project/etags_file" "My project tags file.") (defun my-project-build-tags () "Build my project tags file." (interactive) (rebuild-tags "My Project" "/path/to/my/project" hyperbind-tags-file)) ;; Visit tags table and rebuild after every save. (visit-tags-table my-project-tags-file) (add-hook 'after-save-hook 'my-project-build-tags) -- "Creativity can be a social contribution, but only in so far as society is free to use the results." - R. Stallman