all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Peter Tury <tury.peter@gmail.com>
To: help-gnu-emacs@gnu.org
Subject: Re: avoid interpretation of \n, \t, ... in string
Date: Wed, 28 Jan 2009 04:24:22 -0800 (PST)	[thread overview]
Message-ID: <986c2f5b-67bb-4059-a4b3-f1748dc45e50@z27g2000prd.googlegroups.com> (raw)
In-Reply-To: 7c7i4fkayi.fsf@pbourguignon.anevia.com

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


  reply	other threads:[~2009-01-28 12:24 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-27 17:13 avoid interpretation of \n, \t, ... in string Peter Tury
2009-01-27 18:26 ` Peter Dyballa
     [not found] ` <mailman.5991.1233080786.26697.help-gnu-emacs@gnu.org>
2009-01-27 18:38   ` Peter Tury
2009-01-28  7:52 ` Kevin Rodgers
2009-01-28  9:59 ` Pascal J. Bourguignon
2009-01-28 12:24   ` Peter Tury [this message]
2009-01-28 14:02     ` Pascal J. Bourguignon
     [not found] ` <mailman.6050.1233129149.26697.help-gnu-emacs@gnu.org>
2009-01-28 10:16   ` Peter Tury

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=986c2f5b-67bb-4059-a4b3-f1748dc45e50@z27g2000prd.googlegroups.com \
    --to=tury.peter@gmail.com \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.