From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: drkm Newsgroups: gmane.emacs.help Subject: Re: Need help writing file-visiting macro Date: Mon, 25 Jul 2005 19:44:36 +0200 Organization: None Message-ID: References: <7e7jfegat6.fsf@ada2.unipv.it> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1122313706 13478 80.91.229.2 (25 Jul 2005 17:48:26 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 25 Jul 2005 17:48:26 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Jul 25 19:48:25 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1Dx73k-0006TB-Tx for geh-help-gnu-emacs@m.gmane.org; Mon, 25 Jul 2005 19:48:13 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Dx763-0006KD-Os for geh-help-gnu-emacs@m.gmane.org; Mon, 25 Jul 2005 13:50:35 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!news.tele.dk!news.tele.dk!small.news.tele.dk!newsfeed.multikabel.nl!skynet.be!skynet.be!newspost001!tjb!not-for-mail Original-Newsgroups: comp.emacs,gnu.emacs.help User-Agent: Gnus/5.110003 (No Gnus v0.3) Emacs/22.0.50 (windows-nt) Cancel-Lock: sha1:9XQowr4iJTjZAJcKXkVK+eFBx/4= Original-Lines: 25 Original-NNTP-Posting-Host: 8293f5a3.news.skynet.be Original-X-Trace: 1122313484 news.skynet.be 8368 81.247.184.219:1407 Original-X-Complaints-To: usenet-abuse@skynet.be Original-Xref: shelby.stanford.edu comp.emacs:89755 gnu.emacs.help:132643 Original-To: help-gnu-emacs@gnu.org 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:28164 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:28164 Roy Smith writes: > In article <7e7jfegat6.fsf@ada2.unipv.it>, > Thien-Thi Nguyen wrote: >>roy@panix.com (Roy Smith) writes: >>> I want it to construct the corresponding _Impl.c filename and >>> visit that file. Is that possible? >>it is possible if the correspondance is at least heuristical. > I'm not sure what you mean by "heuristical", but it certainly is > deterministic. For a given file name X.mdl, the corresponding > implementation file will be X_Impl.c. So you just want the correspondance between the file *name*? Ok: (defun rs:get-impl-filename (mdl-name) (unless (string-match "^\\(.+\\)\\.mdl$" mdl-name) (error "Not a MDL file name" mdl-name)) (concat (match-string 1 mdl-name) "_Impl.c")) --drkm