Commit d0ccc4dd authored by David Byers's avatar David Byers
Browse files

Gnu Emacs MULE-related patches

parent 631ea110
1999-11-20 David Byers <davby@ida.liu.se>
* compatibility.el (lyskom-string-width): New function. Gnu Emacs
MULE lossage workaround.
(string-make-unibyte): New compatibility function.
(string-make-multibyte): New compatibility function.
(multibyte-string-p): New compatibility function.
* lyskom-rest.el (lyskom-format-aux-help): Use
lyskom-string-width, not string-width.
* mime.el (lyskom-mime-string-charset): Use the server default
coding system if no charsets were found (non-MULE Emacs.)
* lyskom-rest.el (lyskom-prot-a-format-aux-item): Aux item data is
a raw string.
* parse.el (lyskom-parse-aux-item): Aux item data is a raw string.
1999-11-19 Joel Rosdahl <joel@lysator.liu.se>
* README.debian: New build instructions.
......
......@@ -120,11 +120,12 @@ of the lyskom-provide-* functions instead."
;;; lyskom-xemacs-or-gnu
;;;
(defmacro lyskom-xemacs-or-gnu (xemacs-form gnu-form)
"Eval XEMACS-FORM in XEmacs and GNU-FORM in Gnu Emacs."
(if (string-match "XEmacs" (emacs-version))
xemacs-form
gnu-form))
(eval-and-compile
(defmacro lyskom-xemacs-or-gnu (xemacs-form gnu-form)
"Eval XEMACS-FORM in XEmacs and GNU-FORM in Gnu Emacs."
(if (string-match "XEmacs" (emacs-version))
xemacs-form
gnu-form)))
(put 'lyskom-xemacs-or-gnu 'edebug-form-spec '(form form))
......@@ -290,6 +291,22 @@ string to search in."
(lyskom-provide-function char-width (c) 1)
(lyskom-provide-function find-charset-string (str) '(ascii))
(lyskom-provide-function string-as-unibyte (str) str)
(lyskom-provide-function string-make-unibyte (str) str)
(lyskom-provide-function string-make-multibyte (str) str)
(lyskom-provide-function multibyte-string-p (str) nil)
(eval-and-compile
(lyskom-xemacs-or-gnu
(fset 'lyskom-string-width (symbol-function 'string-width))
(defun lyskom-string-width (str)
(cond ((and (multibyte-string-p str)
(null enable-multibyte-characters))
(string-width (string-make-unibyte str)))
((and (null (multibyte-string-p str))
enable-multibyte-characters)
(string-width (string-make-multibyte str)))
(t (string-width str))))))
(lyskom-provide-function last (x &optional n)
"Returns the last link in the list LIST.
......
......@@ -1495,19 +1495,19 @@ Note that it is not allowed to use deferred insertions in the text."
(cond ((or (null pad-length)
(null result)) nil)
((> abs-length (string-width result))
(let ((padstring (make-string (- abs-length (string-width result))
((> abs-length (lyskom-string-width result))
(let ((padstring (make-string (- abs-length (lyskom-string-width result))
pad-letter)))
(if (< pad-length 0) ; LEFT justify
(progn
(setq prop-adjust-end (- (- abs-length (string-width
(setq prop-adjust-end (- (- abs-length (lyskom-string-width
result))))
(setq result (concat result padstring)))
(progn
(setq prop-adjust-start (- abs-length (string-width result)))
(setq prop-adjust-start (- abs-length (lyskom-string-width result)))
(setq result (concat padstring result))))))
((and equals-flag
(< abs-length (string-width result)))
(< abs-length (lyskom-string-width result)))
(setq result (lyskom-truncate-string-to-width result abs-length))))
(if result
......@@ -3215,7 +3215,7 @@ Other objects are converted correctly."
(int-to-string (aux-item->tag item)) " "
(lyskom-prot-a-format-aux-item-flags (aux-item->flags item)) " "
(int-to-string (aux-item->inherit-limit item)) " "
(lyskom-prot-a-format-string (aux-item->data item))))
(lyskom-prot-a-format-raw-string (cons 'STRING (aux-item->data item)))))
(defun lyskom-prot-a-format-aux-item-flags (flags)
"Format AUX-ITEM-FLAGS for output to the server."
......
......@@ -67,8 +67,8 @@
(defun lyskom-mime-string-charset (data)
(let ((cs (find-charset-string data))
(tmp lyskom-charset-alist)
(system 'us-ascii))
(while tmp
(system lyskom-server-coding-system))
(while (and tmp cs)
(if (lyskom-subset-p cs (car (car tmp)))
(setq system (cdr (car tmp)) tmp nil)
(setq tmp (cdr tmp))))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment