* WL-MK: Byte-optimize the function `char-after' for old Emacsen.
[elisp/wanderlust.git] / WL-MK
diff --git a/WL-MK b/WL-MK
index 86117f2..fb20044 100644 (file)
--- a/WL-MK
+++ b/WL-MK
@@ -60,6 +60,7 @@
       (` (defvar (, symbol) (, value) (, doc))))))
 
 (load "bytecomp" nil t)
+
 (unless (fboundp 'byte-compile-file-form-custom-declare-variable)
   ;; Bind defcustom'ed variables.
   (put 'custom-declare-variable 'byte-hunk-handler
              (cons (nth 1 (nth 1 form)) byte-compile-bound-variables)))
     form))
 
+(condition-case nil
+    (char-after)
+  (wrong-number-of-arguments
+   ;; Optimize byte code for `char-after'.
+   (put 'char-after 'byte-optimizer 'byte-optimize-char-after)
+   (defun byte-optimize-char-after (form)
+     (if (null (cdr form))
+        '(char-after (point))
+       form))))
+
 (setq byte-compile-warnings '(free-vars unresolved callargs redefine))
 
 ;; v18, v19