aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorStefan Monnier2019-03-21 23:55:28 -0400
committerStefan Monnier2019-03-21 23:55:28 -0400
commit76fea1eba1332440eab2e3daecce053daccd3782 (patch)
tree944ea8279b8a52cb715fe3493d909bc581776430 /lisp
parent57a60db2b88dfa5dea41a3a05b736cd7cd17a953 (diff)
downloademacs-76fea1eba1332440eab2e3daecce053daccd3782.tar.gz
emacs-76fea1eba1332440eab2e3daecce053daccd3782.zip
Fix misuses of NULL when talking about the NUL character
* lisp/subr.el (inhibit-null-byte-detection): Make it an obsolete alias. * src/coding.c (setup_coding_system): Use new name. (detect_coding): Rename null_byte_found => nul_byte_found. (detect_coding_system): Use new name. Rename null_byte_found => nul_byte_found. (Fdefine_coding_system_internal): Use new name. (syms_of_coding): Rename inhibit-null-byte-detection to inhibit-nul-byte-detection. * src/w16select.c (get_clipboard_data): null_char => nul_char. * src/json.c (check_string_without_embedded_nuls): Rename from check_string_without_embedded_nulls. (Fjson_parse_string): Adjust accordingly. * src/coding.h (enum define_coding_undecided_arg_index) (enum coding_attr_index): ...null_byte... => ...nul_byte.... * lisp/info.el (info-insert-file-contents, Info-insert-dir): * lisp/international/mule.el (define-coding-system): * lisp/vc/vc-git.el (vc-git--call): * doc/lispref/nonascii.texi (Lisp and Coding Systems): Use the new name.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/info.el6
-rw-r--r--lisp/international/mule.el10
-rw-r--r--lisp/subr.el2
-rw-r--r--lisp/vc/vc-git.el4
4 files changed, 12 insertions, 10 deletions
diff --git a/lisp/info.el b/lisp/info.el
index c650d882572..f2a064abb67 100644
--- a/lisp/info.el
+++ b/lisp/info.el
@@ -642,14 +642,14 @@ Do the right thing if the file has been compressed or zipped."
642 (insert-file-contents-literally fullname visit) 642 (insert-file-contents-literally fullname visit)
643 (let ((inhibit-read-only t) 643 (let ((inhibit-read-only t)
644 (coding-system-for-write 'no-conversion) 644 (coding-system-for-write 'no-conversion)
645 (inhibit-null-byte-detection t) ; Index nodes include null bytes 645 (inhibit-nul-byte-detection t) ; Index nodes include null bytes
646 (default-directory (or (file-name-directory fullname) 646 (default-directory (or (file-name-directory fullname)
647 default-directory))) 647 default-directory)))
648 (or (consp decoder) 648 (or (consp decoder)
649 (setq decoder (list decoder))) 649 (setq decoder (list decoder)))
650 (apply #'call-process-region (point-min) (point-max) 650 (apply #'call-process-region (point-min) (point-max)
651 (car decoder) t t nil (cdr decoder)))) 651 (car decoder) t t nil (cdr decoder))))
652 (let ((inhibit-null-byte-detection t)) ; Index nodes include null bytes 652 (let ((inhibit-nul-byte-detection t)) ; Index nodes include null bytes
653 (insert-file-contents fullname visit))) 653 (insert-file-contents fullname visit)))
654 654
655 ;; Clear the caches of modified Info files. 655 ;; Clear the caches of modified Info files.
@@ -1377,7 +1377,7 @@ is non-nil)."
1377 ;; Index nodes include null bytes. DIR 1377 ;; Index nodes include null bytes. DIR
1378 ;; files should not have indices, but who 1378 ;; files should not have indices, but who
1379 ;; knows... 1379 ;; knows...
1380 (let ((inhibit-null-byte-detection t)) 1380 (let ((inhibit-nul-byte-detection t))
1381 (insert-file-contents file) 1381 (insert-file-contents file)
1382 (setq Info-dir-file-name file) 1382 (setq Info-dir-file-name file)
1383 (push (current-buffer) buffers) 1383 (push (current-buffer) buffers)
diff --git a/lisp/international/mule.el b/lisp/international/mule.el
index 281e5297d63..ba30fee4961 100644
--- a/lisp/international/mule.el
+++ b/lisp/international/mule.el
@@ -819,10 +819,10 @@ VALUE is a CCL program name defined by `define-ccl-program'. The
819CCL program reads a character sequence and writes a byte sequence 819CCL program reads a character sequence and writes a byte sequence
820as an encoding result. 820as an encoding result.
821 821
822`:inhibit-null-byte-detection' 822`:inhibit-nul-byte-detection'
823 823
824VALUE non-nil means Emacs ignore null bytes on code detection. 824VALUE non-nil means Emacs ignore null bytes on code detection.
825See the variable `inhibit-null-byte-detection'. This attribute 825See the variable `inhibit-nul-byte-detection'. This attribute
826is meaningful only when `:coding-type' is `undecided'. 826is meaningful only when `:coding-type' is `undecided'.
827 827
828`:inhibit-iso-escape-detection' 828`:inhibit-iso-escape-detection'
@@ -867,7 +867,7 @@ non-ASCII files. This attribute is meaningful only when
867 :ccl-encoder 867 :ccl-encoder
868 :valids)) 868 :valids))
869 ((eq coding-type 'undecided) 869 ((eq coding-type 'undecided)
870 '(:inhibit-null-byte-detection 870 '(:inhibit-nul-byte-detection
871 :inhibit-iso-escape-detection 871 :inhibit-iso-escape-detection
872 :prefer-utf-8)))))) 872 :prefer-utf-8))))))
873 873
@@ -920,8 +920,8 @@ non-ASCII files. This attribute is meaningful only when
920 (cons :name (cons name (cons :docstring (cons (purecopy docstring) 920 (cons :name (cons name (cons :docstring (cons (purecopy docstring)
921 props))))) 921 props)))))
922 (setcdr (assq :plist common-attrs) props) 922 (setcdr (assq :plist common-attrs) props)
923 (apply 'define-coding-system-internal 923 (apply #'define-coding-system-internal
924 name (mapcar 'cdr (append common-attrs spec-attrs))))) 924 name (mapcar #'cdr (append common-attrs spec-attrs)))))
925 925
926(defun coding-system-doc-string (coding-system) 926(defun coding-system-doc-string (coding-system)
927 "Return the documentation string for CODING-SYSTEM." 927 "Return the documentation string for CODING-SYSTEM."
diff --git a/lisp/subr.el b/lisp/subr.el
index 6c0ad00afa5..f48ca545c9d 100644
--- a/lisp/subr.el
+++ b/lisp/subr.el
@@ -1511,6 +1511,8 @@ be a list of the form returned by `event-start' and `event-end'."
1511(make-obsolete-variable 'x-gtk-use-window-move nil "26.1") 1511(make-obsolete-variable 'x-gtk-use-window-move nil "26.1")
1512 1512
1513(defvaralias 'messages-buffer-max-lines 'message-log-max) 1513(defvaralias 'messages-buffer-max-lines 'message-log-max)
1514(define-obsolete-variable-alias 'inhibit-null-byte-detection
1515 'inhibit-nul-byte-detection "27.1")
1514 1516
1515;;;; Alternate names for functions - these are not being phased out. 1517;;;; Alternate names for functions - these are not being phased out.
1516 1518
diff --git a/lisp/vc/vc-git.el b/lisp/vc/vc-git.el
index 6b8ed7e2c12..0f8c9c836ce 100644
--- a/lisp/vc/vc-git.el
+++ b/lisp/vc/vc-git.el
@@ -1629,9 +1629,9 @@ The difference to vc-do-command is that this function always invokes
1629(defun vc-git--call (buffer command &rest args) 1629(defun vc-git--call (buffer command &rest args)
1630 ;; We don't need to care the arguments. If there is a file name, it 1630 ;; We don't need to care the arguments. If there is a file name, it
1631 ;; is always a relative one. This works also for remote 1631 ;; is always a relative one. This works also for remote
1632 ;; directories. We enable `inhibit-null-byte-detection', otherwise 1632 ;; directories. We enable `inhibit-nul-byte-detection', otherwise
1633 ;; Tramp's eol conversion might be confused. 1633 ;; Tramp's eol conversion might be confused.
1634 (let ((inhibit-null-byte-detection t) 1634 (let ((inhibit-nul-byte-detection t)
1635 (coding-system-for-read 1635 (coding-system-for-read
1636 (or coding-system-for-read vc-git-log-output-coding-system)) 1636 (or coding-system-for-read vc-git-log-output-coding-system))
1637 (coding-system-for-write 1637 (coding-system-for-write