emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] master 4a7e74f: Un-obsolete 'string-to-unibyte'


From: Eli Zaretskii
Subject: [Emacs-diffs] master 4a7e74f: Un-obsolete 'string-to-unibyte'
Date: Sat, 2 Jun 2018 06:05:17 -0400 (EDT)

branch: master
commit 4a7e74fea687011ee81dcbb02294bccd99b3a05f
Author: Eli Zaretskii <address@hidden>
Commit: Eli Zaretskii <address@hidden>

    Un-obsolete 'string-to-unibyte'
    
    * lisp/subr.el (string-to-unibyte): No longer obsolete.  See the
    emacs-devel discussion around this message:
    http://lists.gnu.org/archive/html/emacs-devel/2018-05/msg00656.html.
    
    * etc/NEWS: Announce the change.
---
 etc/NEWS     | 7 +++++++
 lisp/subr.el | 7 ++++++-
 2 files changed, 13 insertions(+), 1 deletion(-)

diff --git a/etc/NEWS b/etc/NEWS
index bd25f43..1b32498 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -670,6 +670,13 @@ loading messages if requested, and protects against 
recursive loads.
 The history of variable names read by 'read-variable' is recorded in
 the new variable 'custom-variable-history'.
 
+---
+** The function 'string-to-unibyte' is no longer declared obsolete.
+We have found that there are legitimate use cases for this function,
+where there's no better alternative.  We believe that the incorrect
+uses of this function all but disappeared by now, so we are
+un-obsoleting it.
+
 
 * Changes in Emacs 27.1 on Non-Free Operating Systems
 
diff --git a/lisp/subr.el b/lisp/subr.el
index 35e220a..914112c 100644
--- a/lisp/subr.el
+++ b/lisp/subr.el
@@ -1438,8 +1438,13 @@ be a list of the form returned by `event-start' and 
`event-end'."
                "27.1")
 (make-obsolete 'invocation-name "use the variable of the same name." "27.1")
 
+;; We used to declare string-to-unibyte obsolete, but it is a valid
+;; way of getting a unibyte string that can be indexed by bytes, when
+;; the original string has raw bytes in their internal multibyte
+;; representation.  This can be useful when one needs to examine
+;; individual bytes at known offsets from the string beginning.
+;; (make-obsolete 'string-to-unibyte   "use `encode-coding-string'." "26.1")
 ;; bug#23850
-(make-obsolete 'string-to-unibyte   "use `encode-coding-string'." "26.1")
 (make-obsolete 'string-as-unibyte   "use `encode-coding-string'." "26.1")
 (make-obsolete 'string-make-unibyte   "use `encode-coding-string'." "26.1")
 (make-obsolete 'string-to-multibyte "use `decode-coding-string'." "26.1")



reply via email to

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