From 7ab91c5f4532a82db9dbfcfc8a991f3429f43610 Mon Sep 17 00:00:00 2001 From: Juanma Barranquero Date: Thu, 18 Mar 2004 00:20:44 +0000 Subject: (make-obsolete-variable): Fix docstring. --- lisp/emacs-lisp/byte-run.el | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lisp/emacs-lisp/byte-run.el') diff --git a/lisp/emacs-lisp/byte-run.el b/lisp/emacs-lisp/byte-run.el index 15377c033d9..a7385fe5fd0 100644 --- a/lisp/emacs-lisp/byte-run.el +++ b/lisp/emacs-lisp/byte-run.el @@ -91,9 +91,9 @@ was first made obsolete, for example a date or a release number." fn) (defun make-obsolete-variable (var new &optional when) - "Make the byte-compiler warn that VARIABLE is obsolete, -and NEW should be used instead. If NEW is a string, then that is the -`use instead' message. + "Make the byte-compiler warn that VARIABLE is obsolete. +The warning will say that NEW should be used instead. +If NEW is a string, that is the `use instead' message. If provided, WHEN should be a string indicating when the variable was first made obsolete, for example a date or a release number." (interactive -- cgit v1.2.3 From 66599b54fb2fc58b536b8e3a37945762ea52bea2 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Mon, 22 Mar 2004 15:22:34 +0000 Subject: (defsubst): Add edebug spec and use backquote. (dont-compile, eval-when-compile, eval-and-compile): Add edebug spec. --- lisp/emacs-lisp/byte-run.el | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'lisp/emacs-lisp/byte-run.el') diff --git a/lisp/emacs-lisp/byte-run.el b/lisp/emacs-lisp/byte-run.el index a7385fe5fd0..9956d5003cc 100644 --- a/lisp/emacs-lisp/byte-run.el +++ b/lisp/emacs-lisp/byte-run.el @@ -1,6 +1,6 @@ ;;; byte-run.el --- byte-compiler support for inlining -;; Copyright (C) 1992 Free Software Foundation, Inc. +;; Copyright (C) 1992, 2004 Free Software Foundation, Inc. ;; Author: Jamie Zawinski ;; Hallvard Furuseth @@ -67,14 +67,14 @@ ;; This has a special byte-hunk-handler in bytecomp.el. (defmacro defsubst (name arglist &rest body) "Define an inline function. The syntax is just like that of `defun'." + (declare (debug defun)) (or (memq (get name 'byte-optimizer) '(nil byte-compile-inline-expand)) (error "`%s' is a primitive" name)) - (list 'prog1 - (cons 'defun (cons name (cons arglist body))) - (list 'eval-and-compile - (list 'put (list 'quote name) - ''byte-optimizer ''byte-compile-inline-expand)))) + `(prog1 + (defun ,name ,arglist ,@body) + (eval-and-compile + (put ',name 'byte-optimizer 'byte-compile-inline-expand)))) (defun make-obsolete (fn new &optional when) "Make the byte-compiler warn that FUNCTION is obsolete. @@ -109,6 +109,7 @@ was first made obsolete, for example a date or a release number." (defmacro dont-compile (&rest body) "Like `progn', but the body always runs interpreted (not compiled). If you think you need this, you're probably making a mistake somewhere." + (declare (debug t)) (list 'eval (list 'quote (if (cdr body) (cons 'progn body) (car body))))) @@ -121,6 +122,7 @@ If you think you need this, you're probably making a mistake somewhere." (defmacro eval-when-compile (&rest body) "Like `progn', but evaluates the body at compile time. The result of the body appears to the compiler as a quoted constant." + (declare (debug t)) ;; Not necessary because we have it in b-c-initial-macro-environment ;; (list 'quote (eval (cons 'progn body))) (cons 'progn body)) @@ -128,6 +130,7 @@ The result of the body appears to the compiler as a quoted constant." (put 'eval-and-compile 'lisp-indent-hook 0) (defmacro eval-and-compile (&rest body) "Like `progn', but evaluates the body at compile time and at load time." + (declare (debug t)) ;; Remember, it's magic. (cons 'progn body)) -- cgit v1.2.3 From ae122ad2d485518df1708303fa7fe1556315e916 Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Wed, 21 Apr 2004 19:10:29 +0000 Subject: (with-no-warnings): Simplify: take all args as &rest arg. --- lisp/emacs-lisp/byte-run.el | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'lisp/emacs-lisp/byte-run.el') diff --git a/lisp/emacs-lisp/byte-run.el b/lisp/emacs-lisp/byte-run.el index 9956d5003cc..4ed47129fc9 100644 --- a/lisp/emacs-lisp/byte-run.el +++ b/lisp/emacs-lisp/byte-run.el @@ -134,11 +134,10 @@ The result of the body appears to the compiler as a quoted constant." ;; Remember, it's magic. (cons 'progn body)) -(defun with-no-warnings (&optional first &rest body) +(defun with-no-warnings (&rest body) "Like `progn', but prevents compiler warnings in the body." ;; The implementation for the interpreter is basically trivial. - (if body (car (last body)) - first)) + (car (last body))) ;;; I nuked this because it's not a good idea for users to think of using it. -- cgit v1.2.3 From 506b775323a723f91ae87e31580d881af3741d66 Mon Sep 17 00:00:00 2001 From: Juanma Barranquero Date: Fri, 7 May 2004 00:58:54 +0000 Subject: (make-obsolete, make-obsolete-variable): Make argument names match their use in docstring. --- lisp/emacs-lisp/byte-run.el | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'lisp/emacs-lisp/byte-run.el') diff --git a/lisp/emacs-lisp/byte-run.el b/lisp/emacs-lisp/byte-run.el index 4ed47129fc9..2cd0896c835 100644 --- a/lisp/emacs-lisp/byte-run.el +++ b/lisp/emacs-lisp/byte-run.el @@ -76,21 +76,21 @@ (eval-and-compile (put ',name 'byte-optimizer 'byte-compile-inline-expand)))) -(defun make-obsolete (fn new &optional when) +(defun make-obsolete (function new &optional when) "Make the byte-compiler warn that FUNCTION is obsolete. The warning will say that NEW should be used instead. If NEW is a string, that is the `use instead' message. If provided, WHEN should be a string indicating when the function was first made obsolete, for example a date or a release number." (interactive "aMake function obsolete: \nxObsoletion replacement: ") - (let ((handler (get fn 'byte-compile))) + (let ((handler (get function 'byte-compile))) (if (eq 'byte-compile-obsolete handler) - (setq handler (nth 1 (get fn 'byte-obsolete-info))) - (put fn 'byte-compile 'byte-compile-obsolete)) - (put fn 'byte-obsolete-info (list new handler when))) - fn) + (setq handler (nth 1 (get function 'byte-obsolete-info))) + (put function 'byte-compile 'byte-compile-obsolete)) + (put function 'byte-obsolete-info (list new handler when))) + function) -(defun make-obsolete-variable (var new &optional when) +(defun make-obsolete-variable (variable new &optional when) "Make the byte-compiler warn that VARIABLE is obsolete. The warning will say that NEW should be used instead. If NEW is a string, that is the `use instead' message. @@ -102,8 +102,8 @@ was first made obsolete, for example a date or a release number." (if (equal str "") (error "")) (intern str)) (car (read-from-string (read-string "Obsoletion replacement: "))))) - (put var 'byte-obsolete-variable (cons new when)) - var) + (put variable 'byte-obsolete-variable (cons new when)) + variable) (put 'dont-compile 'lisp-indent-hook 0) (defmacro dont-compile (&rest body) -- cgit v1.2.3