Commit 6bdd9204 authored by Stefan Monnier's avatar Stefan Monnier
Browse files

* lisp/abbrev.el (define-abbrev): Beware new meaning of fboundp.

* lisp/emacs-lisp/elint.el (elint-find-builtins):
* lisp/emacs-lisp/eldoc.el (eldoc-symbol-function):
* lisp/emacs-lisp/bytecomp.el (byte-compile-callargs-warn)
(byte-compile-file-form-defmumble, byte-compile, byte-compile-form):
* lisp/emacs-lisp/byte-opt.el (byte-compile-inline-expand):
* lisp/apropos.el (apropos-safe-documentation):
* lisp/subr.el (symbol-file): Remove redundant fboundp.
* lisp/progmodes/idlw-shell.el (idlwave-shell-comint-filter): Use defalias.
parent daccca97
2014-01-06 Stefan Monnier <monnier@iro.umontreal.ca>
* abbrev.el (define-abbrev): Beware new meaning of fboundp.
* emacs-lisp/elint.el (elint-find-builtins):
* emacs-lisp/eldoc.el (eldoc-symbol-function):
* emacs-lisp/bytecomp.el (byte-compile-callargs-warn)
(byte-compile-file-form-defmumble, byte-compile, byte-compile-form):
* emacs-lisp/byte-opt.el (byte-compile-inline-expand):
* apropos.el (apropos-safe-documentation):
* subr.el (symbol-file): Remove redundant fboundp.
* progmodes/idlw-shell.el (idlwave-shell-comint-filter): Use defalias.
2014-01-06 Bastien Guerry <bzg@gnu.org> 2014-01-06 Bastien Guerry <bzg@gnu.org>
* hl-line.el (global-hl-line-overlay): Make a local variable. * hl-line.el (global-hl-line-overlay): Make a local variable.
......
...@@ -588,7 +588,7 @@ An obsolete but still supported calling form is: ...@@ -588,7 +588,7 @@ An obsolete but still supported calling form is:
(boundp sym) (symbol-value sym) (boundp sym) (symbol-value sym)
(not (abbrev-get sym :system))) (not (abbrev-get sym :system)))
(unless (or system-flag (unless (or system-flag
(and (boundp sym) (fboundp sym) (and (boundp sym)
;; load-file-name ;; load-file-name
(equal (symbol-value sym) expansion) (equal (symbol-value sym) expansion)
(equal (symbol-function sym) hook))) (equal (symbol-function sym) hook)))
......
...@@ -1006,8 +1006,7 @@ Returns list of symbols and documentation found." ...@@ -1006,8 +1006,7 @@ Returns list of symbols and documentation found."
"Like `documentation', except it avoids calling `get_doc_string'. "Like `documentation', except it avoids calling `get_doc_string'.
Will return nil instead." Will return nil instead."
(while (and function (symbolp function)) (while (and function (symbolp function))
(setq function (if (fboundp function) (setq function (symbol-function function)))
(symbol-function function))))
(if (eq (car-safe function) 'macro) (if (eq (car-safe function) 'macro)
(setq function (cdr function))) (setq function (cdr function)))
(setq function (if (byte-code-function-p function) (setq function (if (byte-code-function-p function)
......
...@@ -248,10 +248,10 @@ ...@@ -248,10 +248,10 @@
(defun byte-compile-inline-expand (form) (defun byte-compile-inline-expand (form)
(let* ((name (car form)) (let* ((name (car form))
(localfn (cdr (assq name byte-compile-function-environment))) (localfn (cdr (assq name byte-compile-function-environment)))
(fn (or localfn (and (fboundp name) (symbol-function name))))) (fn (or localfn (symbol-function name))))
(when (autoloadp fn) (when (autoloadp fn)
(autoload-do-load fn) (autoload-do-load fn)
(setq fn (or (and (fboundp name) (symbol-function name)) (setq fn (or (symbol-function name)
(cdr (assq name byte-compile-function-environment))))) (cdr (assq name byte-compile-function-environment)))))
(pcase fn (pcase fn
(`nil (`nil
......
...@@ -1265,8 +1265,7 @@ Each function's symbol gets added to `byte-compile-noruntime-functions'." ...@@ -1265,8 +1265,7 @@ Each function's symbol gets added to `byte-compile-noruntime-functions'."
(if (byte-code-function-p def) (if (byte-code-function-p def)
(aref def 0) (aref def 0)
'(&rest def))))) '(&rest def)))))
(if (and (fboundp (car form)) (if (subrp (symbol-function (car form)))
(subrp (symbol-function (car form))))
(subr-arity (symbol-function (car form)))))) (subr-arity (symbol-function (car form))))))
(ncall (length (cdr form)))) (ncall (length (cdr form))))
;; Check many or unevalled from subr-arity. ;; Check many or unevalled from subr-arity.
...@@ -2396,9 +2395,8 @@ not to take responsibility for the actual compilation of the code." ...@@ -2396,9 +2395,8 @@ not to take responsibility for the actual compilation of the code."
(byte-compile-warn "%s `%s' defined multiple times in this file" (byte-compile-warn "%s `%s' defined multiple times in this file"
(if macro "macro" "function") (if macro "macro" "function")
name))) name)))
((and (fboundp name) ((eq (car-safe (symbol-function name))
(eq (car-safe (symbol-function name)) (if macro 'lambda 'macro))
(if macro 'lambda 'macro)))
(when (byte-compile-warning-enabled-p 'redefine) (when (byte-compile-warning-enabled-p 'redefine)
(byte-compile-warn "%s `%s' being redefined as a %s" (byte-compile-warn "%s `%s' being redefined as a %s"
(if macro "function" "macro") (if macro "function" "macro")
...@@ -2532,7 +2530,7 @@ If FORM is a lambda or a macro, byte-compile it as a function." ...@@ -2532,7 +2530,7 @@ If FORM is a lambda or a macro, byte-compile it as a function."
(byte-compile-close-variables (byte-compile-close-variables
(let* ((lexical-binding lexical-binding) (let* ((lexical-binding lexical-binding)
(fun (if (symbolp form) (fun (if (symbolp form)
(and (fboundp form) (symbol-function form)) (symbol-function form)
form)) form))
(macro (eq (car-safe fun) 'macro))) (macro (eq (car-safe fun) 'macro)))
(if macro (if macro
...@@ -2946,8 +2944,7 @@ for symbols generated by the byte compiler itself." ...@@ -2946,8 +2944,7 @@ for symbols generated by the byte compiler itself."
(format "; use `%s' instead." (format "; use `%s' instead."
interactive-only)) interactive-only))
(t ".")))) (t "."))))
(if (and (fboundp (car form)) (if (eq (car-safe (symbol-function (car form))) 'macro)
(eq (car-safe (symbol-function (car form))) 'macro))
(byte-compile-log-warning (byte-compile-log-warning
(format "Forgot to expand macro %s" (car form)) nil :error)) (format "Forgot to expand macro %s" (car form)) nil :error))
(if (and handler (if (and handler
......
...@@ -512,8 +512,7 @@ In the absence of INDEX, just call `eldoc-docstring-format-sym-doc'." ...@@ -512,8 +512,7 @@ In the absence of INDEX, just call `eldoc-docstring-format-sym-doc'."
;; Do indirect function resolution if possible. ;; Do indirect function resolution if possible.
(defun eldoc-symbol-function (fsym) (defun eldoc-symbol-function (fsym)
(let ((defn (and (fboundp fsym) (let ((defn (symbol-function fsym)))
(symbol-function fsym))))
(and (symbolp defn) (and (symbolp defn)
(condition-case _ (condition-case _
(setq defn (indirect-function fsym)) (setq defn (indirect-function fsym))
......
...@@ -1145,8 +1145,8 @@ Marks the function with their arguments, and returns a list of variables." ...@@ -1145,8 +1145,8 @@ Marks the function with their arguments, and returns a list of variables."
(defun elint-find-builtins () (defun elint-find-builtins ()
"Return a list of all built-in functions." "Return a list of all built-in functions."
(let (subrs) (let (subrs)
(mapatoms (lambda (s) (and (fboundp s) (subrp (symbol-function s)) (mapatoms (lambda (s) (and (subrp (symbol-function s))
(setq subrs (cons s subrs))))) (push s subrs))))
subrs)) subrs))
(defun elint-find-builtin-args (&optional list) (defun elint-find-builtin-args (&optional list)
......
...@@ -1446,10 +1446,10 @@ Otherwise just move the line. Move down unless UP is non-nil." ...@@ -1446,10 +1446,10 @@ Otherwise just move the line. Move down unless UP is non-nil."
;; Newer versions of comint.el changed the name of comint-filter to ;; Newer versions of comint.el changed the name of comint-filter to
;; comint-output-filter. ;; comint-output-filter.
(defun idlwave-shell-comint-filter (process string) nil) (defalias 'idlwave-shell-comint-filter
(if (fboundp 'comint-output-filter) (if (fboundp 'comint-output-filter)
(fset 'idlwave-shell-comint-filter (symbol-function 'comint-output-filter)) #'comint-output-filter
(fset 'idlwave-shell-comint-filter (symbol-function 'comint-filter))) #'comint-filter))
(defun idlwave-shell-is-running () (defun idlwave-shell-is-running ()
"Return t if the shell process is running." "Return t if the shell process is running."
......
...@@ -1810,7 +1810,7 @@ If TYPE is nil, then any kind of definition is acceptable. If ...@@ -1810,7 +1810,7 @@ If TYPE is nil, then any kind of definition is acceptable. If
TYPE is `defun', `defvar', or `defface', that specifies function TYPE is `defun', `defvar', or `defface', that specifies function
definition, variable definition, or face definition only." definition, variable definition, or face definition only."
(if (and (or (null type) (eq type 'defun)) (if (and (or (null type) (eq type 'defun))
(symbolp symbol) (fboundp symbol) (symbolp symbol)
(autoloadp (symbol-function symbol))) (autoloadp (symbol-function symbol)))
(nth 1 (symbol-function symbol)) (nth 1 (symbol-function symbol))
(let ((files load-history) (let ((files load-history)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment