X-Git-Url: http://git.chise.org/gitweb/?p=chise%2Fxemacs-chise.git.1;a=blobdiff_plain;f=lisp%2Fbytecomp.el;h=a7bbe8d15254aa5ae650f068ba76bf08988a891a;hp=c1cc824c7d2ed76f6cb71275cdc6531f3386a1cc;hb=eeca41d3213b7a3b7efcf6508693e748c1590748;hpb=de1ec4b272dfa3f9ef2c9ae28a9ba67170d24da5 diff --git a/lisp/bytecomp.el b/lisp/bytecomp.el index c1cc824..a7bbe8d 100644 --- a/lisp/bytecomp.el +++ b/lisp/bytecomp.el @@ -1284,7 +1284,7 @@ otherwise pop it") (setq unreferenced (nreverse unreferenced)) (while unreferenced (byte-compile-warn - (format "variable %s bound but not referenced" (car unreferenced))) + "variable %s bound but not referenced" (car unreferenced)) (setq unreferenced (cdr unreferenced))))) @@ -1773,29 +1773,81 @@ With argument, insert value in current buffer after the form." ;; file if under Mule. If there are any extended characters in the ;; input file, use `escape-quoted' to make sure that both binary and ;; extended characters are output properly and distinguished properly. - ;; Otherwise, use `raw-text' for maximum portability with non-Mule + ;; Otherwise, use `binary' for maximum portability with non-Mule ;; Emacsen. (when (featurep '(or mule file-coding)) (defvar buffer-file-coding-system) - (if (or (featurep '(not mule)) ;; Don't scan buffer if we are not muleized - (save-excursion - (set-buffer byte-compile-inbuffer) + (let (ces) + (if (featurep 'mule) + (save-excursion + (set-buffer byte-compile-inbuffer) + (goto-char (point-min)) + ;; mrb- There must be a better way than skip-chars-forward + (skip-chars-forward (concat (char-to-string 0) "-" + (char-to-string 255))) + (if (eq (point) (point-max)) + (setq ces 'binary) + (goto-char (point-min)) + (while (< (point)(point-max)) + (cond ((and (eq (char-after) ?\;) + (not (eq (char-after (1- (point))) ?\\))) + (delete-region (point)(point-at-eol)) + (if (eq (char-after) ?\n) + (delete-char 1) + (forward-char)) + ) + ((eq (char-after) ?\?) + (forward-char 2) + ) + ((eq (char-after) ?\n) + (forward-char) + ) + ((eq (char-after) ?\") + (forward-char) + (while (and (< (point)(point-max)) + (not (when (eq (char-after) ?\") + (forward-char) + t))) + (if (eq (char-after) ?\\) + (forward-char 2) + (forward-char))) + ) + (t + (forward-char)))) (goto-char (point-min)) - ;; mrb- There must be a better way than skip-chars-forward (skip-chars-forward (concat (char-to-string 0) "-" - (char-to-string 255))) - (eq (point) (point-max)))) - (setq buffer-file-coding-system 'raw-text-unix) - (insert "(require 'mule)\n;;;###coding system: escape-quoted\n") - (setq buffer-file-coding-system 'escape-quoted) - ;; #### Lazy loading not yet implemented for MULE files - ;; mrb - Fix this someday. - (save-excursion - (set-buffer byte-compile-inbuffer) - (setq byte-compile-dynamic nil - byte-compile-dynamic-docstrings nil)) - ;;(external-debugging-output (prin1-to-string (buffer-local-variables)))) - )) + (char-to-string 255)))) + (setq ces + (if (eq (point) (point-max)) + (if (and (featurep 'utf-2000) + (re-search-backward "\\\\u[0-9A-Fa-f]+" nil t)) + 'utf-8-mcs-unix + 'binary) + (when (featurep 'utf-2000) + (goto-char (point-min)) + (if (re-search-forward "\\\\u[0-9A-Fa-f]+" nil t) + 'utf-8-mcs-unix))))) + (setq ces 'binary)) + (if (eq ces 'binary) + (setq buffer-file-coding-system 'binary) + (cond ((eq ces 'utf-8-mcs-unix) + (insert + "(require 'mule)\n;;;###coding system: utf-8-mcs-unix\n") + (setq buffer-file-coding-system 'utf-8-mcs-unix) + ) + (t + (insert "(require 'mule)\n;;;###coding system: escape-quoted\n") + (setq buffer-file-coding-system 'escape-quoted) + )) + ;; #### Lazy loading not yet implemented for MULE files + ;; mrb - Fix this someday. + (save-excursion + (set-buffer byte-compile-inbuffer) + (setq byte-compile-dynamic nil + byte-compile-dynamic-docstrings nil)) + ;; (external-debugging-output + ;; (prin1-to-string (buffer-local-variables))) + ))) ) @@ -2894,7 +2946,7 @@ If FORM is a lambda or a macro, byte-compile it as a function." (byte-defop-compiler char-after 0-1+1) (byte-defop-compiler set-buffer 1) ;;(byte-defop-compiler set-mark 1) ;; obsolete -(byte-defop-compiler forward-word 1+1) +(byte-defop-compiler forward-word 0-1+1) (byte-defop-compiler char-syntax 1+1) (byte-defop-compiler nreverse 1) (byte-defop-compiler car-safe 1) @@ -3869,7 +3921,7 @@ If FORM is a lambda or a macro, byte-compile it as a function." ;; `defconst' sets `var' unconditionally. `(setq ,var ,value) ;; `defvar' sets `var' only when unbound. - `(if (not (boundp ',var)) (setq ,var ,value)))) + `(if (not (default-boundp ',var)) (set-default ',var ,value)))) `',var)))) (defun byte-compile-autoload (form)