nndoc.el (nndoc-dissect-mime-parts-sub): Fix last change
[gnus] / lisp / gnus-compat.el
index 2b25e45..80e3113 100644 (file)
@@ -1,6 +1,6 @@
 ;;; gnus-compat.el --- Compatability functions for Gnus
 
-;; Copyright (C) 2012 Free Software Foundation, Inc.
+;; Copyright (C) 2012-2013g Free Software Foundation, Inc.
 
 ;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
 ;; Keywords: compat
@@ -104,6 +104,31 @@ TRASH is ignored."
     (and (boundp var)
         (symbol-value var))))
 
+
+;; Emacs less than 24.3
+(unless (fboundp 'add-face)
+  (defun add-face (beg end face)
+    "Combine FACE BEG and END."
+    (let ((b beg))
+      (while (< b end)
+       (let ((oldval (get-text-property b 'face)))
+         (put-text-property
+          b (setq b (next-single-property-change b 'face nil end))
+          'face (cond ((null oldval)
+                       face)
+                      ((and (consp oldval)
+                            (not (keywordp (car oldval))))
+                       (cons face oldval))
+                      (t
+                       (list face oldval)))))))))
+
+(unless (fboundp 'move-beginning-of-line)
+  (defun move-beginning-of-line (arg)
+    (interactive "p")
+    (unless (= arg 1)
+      (forward-line arg))
+    (beginning-of-line)))
+
 (provide 'gnus-compat)
 
 ;; gnus-compat.el ends here