Importing pgnus-0.13
[elisp/gnus.git-] / lisp / gnus-util.el
index 069e6a6..6624762 100644 (file)
@@ -75,9 +75,6 @@
         (set symbol nil))
      symbol))
 
-(defun gnus-truncate-string (str width)
-  (substring str 0 width))
-
 ;; Added by Geoffrey T. Dairiki <dairiki@u.washington.edu>.  A safe way
 ;; to limit the length of a string.  This function is necessary since
 ;; `(substr "abc" 0 30)' pukes with "Args out of range".
      (when (gnus-buffer-exists-p buf)
        (kill-buffer buf))))
 
-(cond
- ((fboundp 'point-at-bol)
-  (fset 'gnus-point-at-bol 'point-at-bol))
- ((fboundp 'line-beginning-position)
-  (fset 'gnus-point-at-bol 'line-beginning-position))
- (t
-  (defun gnus-point-at-bol ()
-    "Return point at the beginning of the line."
-    (let ((p (point)))
-      (beginning-of-line)
-      (prog1
-         (point)
-       (goto-char p))))))
-
-(cond
- ((fboundp 'point-at-eol)
-  (fset 'gnus-point-at-eol 'point-at-eol))
- ((fboundp 'line-end-position)
-  (fset 'gnus-point-at-eol 'line-end-position))
- (t
-  (defun gnus-point-at-eol ()
-    "Return point at the end of the line."
-    (let ((p (point)))
-      (end-of-line)
-      (prog1
-         (point)
-       (goto-char p))))))
+(fset 'gnus-point-at-bol
+      (if (fboundp 'point-at-bol)
+         'point-at-bol
+       'line-beginning-position))
+
+(fset 'gnus-point-at-eol
+      (if (fboundp 'point-at-eol)
+         'point-at-eol
+       'line-end-position))
 
 (defun gnus-delete-first (elt list)
   "Delete by side effect the first occurrence of ELT as a member of LIST."
@@ -550,7 +529,7 @@ Timezone package is used."
        (erase-buffer))
     (set-buffer (gnus-get-buffer-create gnus-work-buffer))
     (kill-all-local-variables)
-    (buffer-disable-undo (current-buffer))))
+    (mm-enable-multibyte)))
 
 (defmacro gnus-group-real-name (group)
   "Find the real name of a foreign newsgroup."