summaryrefslogtreecommitdiff
path: root/lisp/international/mule-util.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/international/mule-util.el')
-rw-r--r--lisp/international/mule-util.el26
1 files changed, 13 insertions, 13 deletions
diff --git a/lisp/international/mule-util.el b/lisp/international/mule-util.el
index 2526f1ee324..8ad212796a5 100644
--- a/lisp/international/mule-util.el
+++ b/lisp/international/mule-util.el
@@ -342,7 +342,7 @@ per-character basis, this may not be accurate."
(let ((eol-offset 0)
;; Make sure we terminate, even if BYTE falls right in the middle
;; of a CRLF or some other weird corner case.
- (omin 0) (omax most-positive-fixnum)
+ (omin 0) omax
pos lines)
(while
(progn
@@ -355,9 +355,9 @@ per-character basis, this may not be accurate."
(setq pos (point-max))))
;; Adjust POS for DOS EOL format.
(setq lines (1- (line-number-at-pos pos)))
- (and (not (= lines eol-offset)) (> omax omin)))
+ (and (not (= lines eol-offset)) (or (not omax) (> omax omin))))
(if (> lines eol-offset)
- (setq omax (min (1- omax) lines)
+ (setq omax (if omax (min (1- omax) lines) lines)
eol-offset omax)
(setq omin (max (1+ omin) lines)
eol-offset omin)))
@@ -393,17 +393,17 @@ QUALITY can be:
japanese-cp932 korean-cp949)))
(setq type 'single-byte))
(pcase type
- (`utf-8
+ ('utf-8
(when (coding-system-get coding-system :bom)
(setq byte (max 0 (- byte 3))))
(if (= eol 1)
(filepos-to-bufferpos--dos (+ pm byte) #'byte-to-position)
(byte-to-position (+ pm byte))))
- (`single-byte
+ ('single-byte
(if (= eol 1)
(filepos-to-bufferpos--dos (+ pm byte) #'identity)
(+ pm byte)))
- ((and `utf-16
+ ((and 'utf-16
;; FIXME: For utf-16, we could use the same approach as used for
;; dos EOLs (counting the number of non-BMP chars instead of the
;; number of lines).
@@ -419,8 +419,8 @@ QUALITY can be:
(+ pm byte)))
(_
(pcase quality
- (`approximate (byte-to-position (+ pm byte)))
- (`exact
+ ('approximate (byte-to-position (+ pm byte)))
+ ('exact
;; Rather than assume that the file exists and still holds the right
;; data, we reconstruct it based on the buffer's content.
(let ((buf (current-buffer)))
@@ -470,7 +470,7 @@ QUALITY can be:
japanese-cp932 korean-cp949)))
(setq type 'single-byte))
(pcase type
- (`utf-8
+ ('utf-8
(setq byte (position-bytes position))
(when (null byte)
(if (<= position 0)
@@ -482,9 +482,9 @@ QUALITY can be:
(if (coding-system-get coding-system :bom) 3 0)
;; Account for CR in CRLF pairs.
lineno))
- (`single-byte
+ ('single-byte
(+ position -1 lineno))
- ((and `utf-16
+ ((and 'utf-16
;; FIXME: For utf-16, we could use the same approach as used for
;; dos EOLs (counting the number of non-BMP chars instead of the
;; number of lines).
@@ -498,8 +498,8 @@ QUALITY can be:
lineno))
(_
(pcase quality
- (`approximate (+ (position-bytes position) -1 lineno))
- (`exact
+ ('approximate (+ (position-bytes position) -1 lineno))
+ ('exact
;; Rather than assume that the file exists and still holds the right
;; data, we reconstruct its relevant portion.
(let ((buf (current-buffer)))