;;; @ C primitives emulation.
;;;
-;; (require FEATURE &optional FILENAME NOERROR)
-;; Emacs 20.4 and later takes optional 3rd arg NOERROR.
+;; Emacs 20.3 and earlier: (require FEATURE &optional FILENAME)
+;; Emacs 20.4 and later: (require FEATURE &optional FILENAME NOERROR)
(static-condition-case nil
;; compile-time check.
(progn
one of the properties on the list."
(setplist 'plist-get-internal-symbol plist)
(get 'plist-get-internal-symbol prop))
+ ;; for `load-history'.
(setq current-load-list (cons 'plist-get current-load-list))
(put 'plist-get 'defun-maybe t))))
(setplist 'plist-put-internal-symbol plist)
(put 'plist-put-internal-symbol prop val)
(symbol-plist 'plist-put-internal-symbol))
+ ;; for `load-history'.
(setq current-load-list (cons 'plist-put current-load-list))
(put 'plist-put 'defun-maybe t))))
On other systems, this variable is normally always nil.")
;; Emacs 20.1/XEmacs 20.3(?) and later: (save-current-buffer &rest BODY)
+;;
;; v20 defines `save-current-buffer' as a C primitive (in src/editfns.c)
;; and introduces a new bytecode Bsave_current_buffer(_1), replacing an
;; obsolete bytecode Bread_char. To make things worse, Emacs 20.1 and
;; 20.2 have a bug that it will restore the current buffer without
;; confirming that it is alive.
+;;
;; This is a source of incompatibility of .elc between v18/v19 and v20.
;; (XEmacs compiler takes care of it if compatibility mode is enabled.)
(defmacro-maybe save-current-buffer (&rest body)
((memq system-type '(windows-nt ms-dos))
;; should we do (require 'filename) at load-time ?
;; (require 'filename)
- ;; filename.el requires many modules, so we do not want to load at
- ;; compile-time. instead, suppress warnings by this.
+ ;; filename.el requires many modules, so we do not want to load it
+ ;; at compile-time. Instead, suppress warnings by these autoloads.
(eval-when-compile
(autoload 'filename-maybe-truncate-by-size "filename")
(autoload 'filename-special-filter "filename"))
nil is returned. Otherwise the associated face object is returned."
(car (memq face-or-name (face-list))))
-;; Emacs 20.5 defines this as an alias for `line-beginning-position'.
+;; Emacs 21.1 defines this as an alias for `line-beginning-position'.
;; Therefore, optional 2nd arg BUFFER is not portable.
(defun-maybe point-at-bol (&optional n buffer)
"Return the character position of the first character on the current line.
(forward-line (1- (or n 1)))
(point)))
-;; Emacs 20.5 defines this as an alias for `line-end-position'.
+;; Emacs 21.1 defines this as an alias for `line-end-position'.
;; Therefore, optional 2nd arg BUFFER is not portable.
(defun-maybe point-at-eol (&optional n buffer)
"Return the character position of the last character on the current line.
;;; Code:
+;; for `load-history'.
(or (boundp 'current-load-list) (setq current-load-list nil))
(require 'static)
(` (or (fboundp (quote (, name)))
(prog1
(defun (, name) (,@ everything-else))
- ;; This `defun' will be compiled to `fset', which does
- ;; not update `load-history'.
+ ;; This `defun' will be compiled to `fset',
+ ;; which does not update `load-history'.
;; We must update `current-load-list' explicitly.
(setq current-load-list
(cons (quote (, name)) current-load-list))
(` (or (fboundp (quote (, name)))
(prog1
(defmacro (, name) (,@ everything-else))
+ ;; This `defmacro' will be compiled to `fset',
+ ;; which does not update `load-history'.
+ ;; We must update `current-load-list' explicitly.
(setq current-load-list
(cons (quote (, name)) current-load-list))
(put (quote (, name)) 'defmacro-maybe t))))))
(` (or (fboundp (quote (, name)))
(prog1
(defsubst (, name) (,@ everything-else))
+ ;; This `defsubst' will be compiled to `fset',
+ ;; which does not update `load-history'.
+ ;; We must update `current-load-list' explicitly.
(setq current-load-list
(cons (quote (, name)) current-load-list))
(put (quote (, name)) 'defsubst-maybe t))))))
(` (or (fboundp (quote (, symbol)))
(prog1
(defalias (quote (, symbol)) (, definition))
- (setq current-load-list
- (cons (quote (, symbol)) current-load-list))
+ ;; `defalias' updates `load-history' internally.
(put (quote (, symbol)) 'defalias-maybe t))))))
(defmacro defvar-maybe (name &rest everything-else)
(` (or (boundp (quote (, name)))
(prog1
(defconst (, name) (,@ everything-else))
+ ;; byte-compiler will generate code to update
+ ;; `load-history'.
(put (quote (, name)) 'defconst-maybe t))))))
(defmacro defun-maybe-cond (name args &optional doc &rest clauses)
(` (defun (, name) (, args)
(,@ (cdr case))))))))
clauses)))
+ ;; This `defun' will be compiled to `fset',
+ ;; which does not update `load-history'.
+ ;; We must update `current-load-list' explicitly.
(setq current-load-list
(cons (quote (, name)) current-load-list))
(put (quote (, name)) 'defun-maybe t))))))
(` (defmacro (, name) (, args)
(,@ (cdr case))))))))
clauses)))
+ ;; This `defmacro' will be compiled to `fset',
+ ;; which does not update `load-history'.
+ ;; We must update `current-load-list' explicitly.
(setq current-load-list
(cons (quote (, name)) current-load-list))
(put (quote (, name)) 'defmacro-maybe t))))))
(` (defsubst (, name) (, args)
(,@ (cdr case))))))))
clauses)))
+ ;; This `defsubst' will be compiled to `fset',
+ ;; which does not update `load-history'.
+ ;; We must update `current-load-list' explicitly.
(setq current-load-list
(cons (quote (, name)) current-load-list))
(put (quote (, name)) 'defsubst-maybe t))))))