From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: David Kastrup Newsgroups: gmane.emacs.devel Subject: Re: file-name-shadow-mode Date: Mon, 21 Mar 2005 16:14:57 +0100 Message-ID: References: <200503180435.j2I4Z2R18621@raven.dms.auburn.edu> <87is3p5zp2.fsf-monnier+emacs@gnu.org> <200503191521.j2JFL8901509@raven.dms.auburn.edu> <87r7ibziw6.fsf-monnier+emacs@gnu.org> <200503200230.j2K2UvS03067@raven.dms.auburn.edu> <87is3lw2yk.fsf-monnier+emacs@gnu.org> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1111418700 6290 80.91.229.2 (21 Mar 2005 15:25:00 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 21 Mar 2005 15:25:00 +0000 (UTC) Cc: emacs-devel@gnu.org, teirllm@dms.auburn.edu, Stefan Monnier , rms@gnu.org, miles@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Mar 21 16:24:59 2005 Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1DDOe0-000668-0n for ged-emacs-devel@m.gmane.org; Mon, 21 Mar 2005 16:16:41 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DDOuV-0004Nt-Bw for ged-emacs-devel@m.gmane.org; Mon, 21 Mar 2005 10:33:43 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1DDOtP-0004HG-Cs for emacs-devel@gnu.org; Mon, 21 Mar 2005 10:32:35 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1DDOtN-0004EN-0y for emacs-devel@gnu.org; Mon, 21 Mar 2005 10:32:33 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DDOtM-0004CM-Jl for emacs-devel@gnu.org; Mon, 21 Mar 2005 10:32:32 -0500 Original-Received: from [199.232.76.164] (helo=fencepost.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.34) id 1DDOcd-00029A-Jj for emacs-devel@gnu.org; Mon, 21 Mar 2005 10:15:15 -0500 Original-Received: from localhost ([127.0.0.1] helo=lola.goethe.zz) by fencepost.gnu.org with esmtp (Exim 4.34) id 1DDOcW-0006qg-OS; Mon, 21 Mar 2005 10:15:09 -0500 Original-To: snogglethorpe@gmail.com In-Reply-To: (Miles Bader's message of "Mon, 21 Mar 2005 23:26:20 +0900") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org X-MailScanner-To: ged-emacs-devel@m.gmane.org Xref: news.gmane.org gmane.emacs.devel:34893 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:34893 Miles Bader writes: > On Mon, 21 Mar 2005 08:24:38 -0500, Stefan Monnier > wrote: >> How 'bout the patch below which makes no assumption (that I know of) about >> substitute-in-file-name, and will thus correctly even with weird >> magic file name handlers. > > Um, I should note that the original code was designed to be fast and > not cons unnecessarily, because it runs on every keystroke -- that's > the reason it uses just a regexp match and a move-overlay. Your > suggested replacement looks ... less careful. substitute-in-file-name is a built-in function in `C source code'. (substitute-in-file-name FILENAME &optional PARSEINFO) Substitute environment variables referred to in FILENAME. `$FOO' where FOO is an environment variable name means to substitute the value of that variable. The variable name should be terminated with a character not a letter, digit or underscore; otherwise, enclose the entire variable name in braces. If `/~' appears, all of FILENAME through that `/' is discarded. On VMS, `$' substitution is not done; this function does little and only duplicates what `expand-file-name' does. If PARSEINFO is not NIL, it is a list used or reused for storing parsing information (it is extended as necessary). Elements 2N point to positions in the original string, Elements 2N+1 to corresponding positions in the substituted string. [...] Something like that. And then one looks for the last [x,0] pair in the list, and x is the position from which to shadow. No consing done except when the syntax changes on entry. -- David Kastrup, Kriemhildstr. 15, 44793 Bochum