emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: using empty_string as the only "" string


From: Juanma Barranquero
Subject: Re: using empty_string as the only "" string
Date: Fri, 8 Jun 2007 17:49:12 +0200

On 6/7/07, Richard Stallman <address@hidden> wrote:

We can scrape by with this new change, but anything more would need
papers.

OK, I can install the change.

It's less than 40 changed lines, across 18 files, and a 20% of those
changes are simply the renaming empty_string => empty_unibyte_string.

Of the rest, most are using empty_unibyte_string instead of
make_string ("", 0) or build_string ("").

BTW, I see no consistency in the way empty_string was used before: at
times empty_string was used, others make_string ("", 0) or
build_string ("") were preferred. That causes this funny equality:

;; without the patch
(eq "" "") => nil
(eq (car (car (cdr (cdr icon-title-format)))) (key-description "")) => t

which I suppose more than offsets my unhappiness for this:

;; with the patch
(eq "" (substring-no-properties "" 0 0)) => t

and the slight incompatibility that

(condition-case err (store-substring "" 0 "a") (error err))
=> (args-out-of-range "" 0)                      ; before the patch
=> (error "Attempt to modify read-only object")  ; after the patch

Warning: the patch changes lisp.h and most src/*.c files do not have a
makefile dependency for it, so I suspect a full recompilation (or a
bootstrap) will be needed after the patch.

            Juanma




reply via email to

[Prev in Thread] Current Thread [Next in Thread]