From: David Kastrup <dak@gnu.org>
Cc: Richard Stallman <rms@gnu.org>, emacs-devel <emacs-devel@gnu.org>
Subject: Re: Unmentioned "stringify" aspect in docu buffer-substring-no-properties
Date: Thu, 22 Jun 2006 22:28:14 +0200 [thread overview]
Message-ID: <85ejxhkk9t.fsf@lola.goethe.zz> (raw)
In-Reply-To: <449AFC62.8030404@online.de> (Andreas Roehler's message of "Thu, 22 Jun 2006 22:24:02 +0200")
Andreas Roehler <andreas.roehler@online.de> writes:
> Richard Stallman schrieb:
>> Would people please check those files for accuracy one more time?
>> They are the files listed in FOR-RELEASE with just one name.
>
>> text.texi
> IMO:
> Unmentioned "stringify" aspect in
> `buffer-substring-no-properties'; also concerns
> `buffer-substring'
>
> AFAIU there are two different meanings of string, which
> are mixed up in naming and function of
>
> `buffer-substring-no-properties':
>
> 1) it takes a portion of the buffer, but not necessary
> of a type `string', so `substring' might mislead
> here (nonetheless, would not ask for changing this
> name for compatiblity reasons)
Uh what? Of course the type is `string'.
> 2) it stringifies these portion, changes the type of it
It does nothing of the sort.
> ;;; check the following examples in a buffer starting
> with it, in order to have the Start-End-Entries
> set as given
>
> (defun foo ()
> " "
> (interactive "*")
> )
>
> (buffer-substring-no-properties 34 37)"e \""
There is no "stringification" done by buffer-substring-no-properties.
The Lisp reader prints the result of the evaluation in string syntax,
that is all.
> It happened to be a discussion in de.comp.editoren,
> concerning a stringify function
>
> The (still disputed) result exploits just the
> mentioned quality.
It doesn't.
> (defun region2string (start end)
> "Make a string from the chars of a region.
> Doublequotes inside will be quoted therefor.
>
> baz --> \"baz\"
>
> baz \"bar\" --> \"baz \\\"bar\\\"\""
> (interactive "r*")
> (goto-char end)
> (prin1 (buffer-substring-no-properties start end) (current-buffer))
> (delete-region start end))
The string quotes get added by prin1, not by
buffer-substring-no-properties. You should really try reading up some
basics in the Emacs Lisp tutorial.
--
David Kastrup, Kriemhildstr. 15, 44793 Bochum
next prev parent reply other threads:[~2006-06-22 20:28 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-06-22 20:24 Unmentioned "stringify" aspect in docu buffer-substring-no-properties Andreas Roehler
2006-06-22 20:28 ` David Kastrup [this message]
2006-06-23 6:38 ` Andreas Roehler
2006-06-23 7:26 ` David Kastrup
2006-06-23 7:31 ` Miles Bader
2006-06-23 6:00 ` Andreas Roehler
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=85ejxhkk9t.fsf@lola.goethe.zz \
--to=dak@gnu.org \
--cc=emacs-devel@gnu.org \
--cc=rms@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.