]> code.delx.au - gnu-emacs/commitdiff
(Man-softhyphen-to-minus): Revert previous change. Avoid unibyte to
authorDave Love <fx@gnu.org>
Sat, 7 Aug 1999 11:45:06 +0000 (11:45 +0000)
committerDave Love <fx@gnu.org>
Sat, 7 Aug 1999 11:45:06 +0000 (11:45 +0000)
multibyte conversion of search-forward (from Handa), but avoid the
replacement if the language is Latin-N.

lisp/man.el

index 27860b5c0a2b368dfdea4133d442afa6c57f9615..4befb4161491ce98de453c998ddda3618bd191e3 100644 (file)
@@ -660,13 +660,15 @@ See the variable `Man-notify-method' for the different notification behaviors."
      )))
 
 (defun Man-softhyphen-to-minus ()
-  ;; \255 is some kind of dash in Latin-1.
-  (goto-char (point-min))
-  (if enable-multibyte-characters
-      (while (search-forward "\255" nil t)
-       (if (= (preceding-char) ?\255)
-           (replace-match "-")))
-    (while (search-forward "\255" nil t) (replace-match "-"))))
+  ;; \255 is some kind of dash in Latin-N.  Versions of Debian man, at
+  ;; least, emit it even when not in a Latin-N locale.
+  (unless (eq t (compare-strings "latin-" 0 nil
+                                current-language-environment 0 6 t))
+    (goto-char (point-min))
+    (let ((str "\255"))
+      (if enable-multibyte-characters
+         (setq str (string-as-multibyte str)))
+      (while (search-forward str nil t) (replace-match "-")))))
 
 (defun Man-fontify-manpage ()
   "Convert overstriking and underlining to the correct fonts.