From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Peter Tury Newsgroups: gmane.emacs.help Subject: Re: avoid interpretation of \n, \t, ... in string Date: Wed, 28 Jan 2009 04:24:22 -0800 (PST) Organization: http://groups.google.com Message-ID: <986c2f5b-67bb-4059-a4b3-f1748dc45e50@z27g2000prd.googlegroups.com> References: <665cbb9b-8140-489e-a4d8-a15acce224be@r37g2000prr.googlegroups.com> <7c7i4fkayi.fsf@pbourguignon.anevia.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1233146455 17874 80.91.229.12 (28 Jan 2009 12:40:55 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 28 Jan 2009 12:40:55 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Jan 28 13:42:08 2009 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 1LS9k0-00056V-5F for geh-help-gnu-emacs@m.gmane.org; Wed, 28 Jan 2009 13:42:00 +0100 Original-Received: from localhost ([127.0.0.1]:53621 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LS9ih-0002kx-I3 for geh-help-gnu-emacs@m.gmane.org; Wed, 28 Jan 2009 07:40:39 -0500 Original-Path: news.stanford.edu!newsfeed.stanford.edu!postnews.google.com!z27g2000prd.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 46 Original-NNTP-Posting-Host: 194.237.142.6 Original-X-Trace: posting.google.com 1233145462 32308 127.0.0.1 (28 Jan 2009 12:24:22 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Wed, 28 Jan 2009 12:24:22 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: z27g2000prd.googlegroups.com; posting-host=194.237.142.6; posting-account=Xb8sGQoAAABwL3BYvXXbA1TD0PsAYrcM User-Agent: G2/1.0 X-HTTP-UserAgent: Opera/9.61 (Windows NT 6.0; U; en) Presto/2.1.1,gzip(gfe),gzip(gfe) Original-Xref: news.stanford.edu gnu.emacs.help:166408 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:61728 Archived-At: Hi, Pascal J. Bourguignon wrote: > Switch to Common Lisp. There's no reader macro in emacs lisp, so you > cannot do much about it. In Common Lisp, you can trivially implement I think this will be a longer journey sometime in the future. CL is on my "todo" list for some time ;-) > Ok, another way to do it would be to store your paths in a file, and > to read it: > > (defun read-paths (file) > (with-temp-buffer > (insert-file-contents file) > (delete "" (split-string (buffer-substring-no-properties > (point-min) (point-max)) > "[\n\r]+")))) Great, thanks! I've checked it and found that in fact `buffer-substring-no- properties' does the trick here. So my original question can be reformulated now: ---> is there a way to get string (text) representation in a form as `buffer-substring-no-properties' do it, i.e. duplicating single `\'-s automatically (without(!) interpreting "pseudo-escape-sequences" (\n, \t, ...) in the original text)? BTW when we come to external files (e.g. directories.txt) I have to mention that my current workaround is to automate the problematic step outside of Emacs: I have a simple .bat file (what does the vob mounting) and call it from Emacs... > Note that this is a serrious proposition. Myself, I use a [...] > so I can write all my scripts, whatever the language, independently of > any directory location, and thus they can run identically on the Very nice, thanks for the idea! I'll keep this way-of-working in my mind. Thanks, P