From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Aaron Maxwell Newsgroups: gmane.emacs.help Subject: Anything like this exist already? (buffer name intelligence) Date: Fri, 11 Jan 2008 10:59:08 -0800 Message-ID: <200801111059.08794.amax@redsymbol.net> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1200077976 21469 80.91.229.12 (11 Jan 2008 18:59:36 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 11 Jan 2008 18:59:36 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Jan 11 19:59:56 2008 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1JDP6h-0003Yu-16 for geh-help-gnu-emacs@m.gmane.org; Fri, 11 Jan 2008 19:59:55 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JDP6J-00038q-FG for geh-help-gnu-emacs@m.gmane.org; Fri, 11 Jan 2008 13:59:31 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JDP60-00036X-Iu for help-gnu-emacs@gnu.org; Fri, 11 Jan 2008 13:59:12 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JDP5z-00033g-3g for help-gnu-emacs@gnu.org; Fri, 11 Jan 2008 13:59:12 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JDP5y-00033Y-RB for help-gnu-emacs@gnu.org; Fri, 11 Jan 2008 13:59:10 -0500 Original-Received: from smtp-gw30.mailanyone.net ([208.70.128.56]) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1JDP5y-0006nM-MX for help-gnu-emacs@gnu.org; Fri, 11 Jan 2008 13:59:10 -0500 Original-Received: from mailanyone.net by smtp-gw30.mailanyone.net with esmtpsa (TLSv1:AES256-SHA:256) (MailAnyone extSMTP redsymbol) id 1JDP5x-0007RG-EZ for help-gnu-emacs@gnu.org; Fri, 11 Jan 2008 12:59:09 -0600 User-Agent: KMail/1.9.6 (enterprise 0.20070907.709405) Content-Disposition: inline X-detected-kernel: by monty-python.gnu.org: Genre and OS details not recognized. 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:50661 Archived-At: Hi all, I find that much of the work I do now involves similarly named files, so that the default buffer naming algorithm is less than ideal. For example, I write Python code in the Django framework a lot, which at any given moment I'll have a number of files like this open at once: pkg1/__init__.py pgk1/models.py pkg1/views.py pkg2/__init__.py pkg1/views.py some_unrelated_library/__init__.py Etc. So it's hard to know what the buffer named "__init__.py<3>" corresponds to just from memory, etc. I've taken to renaming such buffers with a prefix in their file path, just enough to make them unique: i.e., for "/home/amax/src/snazzylib/__init__.py", I might rename its buffer from "__init__.py" to "snazzylib/__init__.py". And I wrote a utility to automate this, which I've pasted below. I bind it to C-c e, and thus can quickly give a new buffer a clueful name without interrupting myself to think about it. Am I reinventing the wheel here? I can't imagine being the first to be annoyed by this, so there's a good chance this problem has already been solved. If someone knows of an existing solution, can you point me to it? If so, I may use that rather than putting more work into this (I have further features in mind). Otherwise I'll add to it and package it up nice and pretty so others can use it. Thanks. -- Aaron Maxwell http://redsymbol.net Business Owners and Self-Employed: You're NOT Alone! The Business Butler - http://businessbutler.us