[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] emacs etc/NEWS lisp/ChangeLog lisp/subr.el lisp...
From: |
Stefan Monnier |
Subject: |
[Emacs-diffs] emacs etc/NEWS lisp/ChangeLog lisp/subr.el lisp... |
Date: |
Thu, 01 Oct 2009 17:47:45 +0000 |
CVSROOT: /sources/emacs
Module name: emacs
Changes by: Stefan Monnier <monnier> 09/10/01 17:47:44
Modified files:
etc : NEWS
lisp : ChangeLog subr.el
lisp/emacs-lisp: bytecomp.el
src : ChangeLog eval.c
Log message:
* eval.c (Fcalled_interactively_p): Add `kind' argument.
* subr.el (interactive-p): Mark obsolete.
(called-interactively-p): Make the optional-ness of `kind' obsolete.
* emacs-lisp/bytecomp.el (byte-compile-fdefinition): Make it obey
advertised-signature-table for subroutines as well.
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/emacs/etc/NEWS?cvsroot=emacs&r1=1.2096&r2=1.2097
http://cvs.savannah.gnu.org/viewcvs/emacs/lisp/ChangeLog?cvsroot=emacs&r1=1.16316&r2=1.16317
http://cvs.savannah.gnu.org/viewcvs/emacs/lisp/subr.el?cvsroot=emacs&r1=1.657&r2=1.658
http://cvs.savannah.gnu.org/viewcvs/emacs/lisp/emacs-lisp/bytecomp.el?cvsroot=emacs&r1=2.265&r2=2.266
http://cvs.savannah.gnu.org/viewcvs/emacs/src/ChangeLog?cvsroot=emacs&r1=1.7776&r2=1.7777
http://cvs.savannah.gnu.org/viewcvs/emacs/src/eval.c?cvsroot=emacs&r1=1.314&r2=1.315
Patches:
Index: etc/NEWS
===================================================================
RCS file: /sources/emacs/emacs/etc/NEWS,v
retrieving revision 1.2096
retrieving revision 1.2097
diff -u -b -r1.2096 -r1.2097
--- etc/NEWS 1 Oct 2009 16:54:21 -0000 1.2096
+++ etc/NEWS 1 Oct 2009 17:47:38 -0000 1.2097
@@ -246,6 +246,8 @@
* Lisp changes in Emacs 23.2
+** called-interactively-p now takes one argument and replaces interactive-p
+which is now marked obsolete.
** New function set-advertised-calling-convention makes it possible
to obsolete arguments as well as make some arguments mandatory.
** eval-next-after-load is obsolete.
Index: lisp/ChangeLog
===================================================================
RCS file: /sources/emacs/emacs/lisp/ChangeLog,v
retrieving revision 1.16316
retrieving revision 1.16317
diff -u -b -r1.16316 -r1.16317
--- lisp/ChangeLog 1 Oct 2009 16:54:22 -0000 1.16316
+++ lisp/ChangeLog 1 Oct 2009 17:47:39 -0000 1.16317
@@ -1,5 +1,10 @@
2009-10-01 Stefan Monnier <address@hidden>
+ * subr.el (interactive-p): Mark obsolete.
+ (called-interactively-p): Make the optional-ness of `kind' obsolete.
+ * emacs-lisp/bytecomp.el (byte-compile-fdefinition): Make it obey
+ advertised-signature-table for subroutines as well.
+
* emacs-lisp/byte-run.el (advertised-signature-table): New var.
(set-advertised-calling-convention): New function.
(make-obsolete, define-obsolete-function-alias)
Index: lisp/subr.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/subr.el,v
retrieving revision 1.657
retrieving revision 1.658
diff -u -b -r1.657 -r1.658
--- lisp/subr.el 1 Oct 2009 02:03:41 -0000 1.657
+++ lisp/subr.el 1 Oct 2009 17:47:42 -0000 1.658
@@ -1008,6 +1008,39 @@
;;;; Obsolescent names for functions.
+(define-obsolete-function-alias 'window-dot 'window-point "22.1")
+(define-obsolete-function-alias 'set-window-dot 'set-window-point "22.1")
+(define-obsolete-function-alias 'read-input 'read-string "22.1")
+(define-obsolete-function-alias 'show-buffer 'set-window-buffer "22.1")
+(define-obsolete-function-alias 'eval-current-buffer 'eval-buffer "22.1")
+(define-obsolete-function-alias 'string-to-int 'string-to-number "22.1")
+
+(make-obsolete 'char-bytes "now always returns 1." "20.4")
+(make-obsolete 'forward-point "use (+ (point) N) instead." "23.1")
+
+(defun insert-string (&rest args)
+ "Mocklisp-compatibility insert function.
+Like the function `insert' except that any argument that is a number
+is converted into a string by expressing it in decimal."
+ (dolist (el args)
+ (insert (if (integerp el) (number-to-string el) el))))
+(make-obsolete 'insert-string 'insert "22.1")
+
+(defun makehash (&optional test) (make-hash-table :test (or test 'eql)))
+(make-obsolete 'makehash 'make-hash-table "22.1")
+
+;; These are used by VM and some old programs
+(defalias 'focus-frame 'ignore "")
+(make-obsolete 'focus-frame "it does nothing." "22.1")
+(defalias 'unfocus-frame 'ignore "")
+(make-obsolete 'unfocus-frame "it does nothing." "22.1")
+(make-obsolete 'make-variable-frame-local
+ "explicitly check for a frame-parameter instead." "22.2")
+(make-obsolete 'interactive-p 'called-interactively-p "23.2")
+(set-advertised-calling-convention 'called-interactively-p '(kind))
+
+;;;; Obsolescence declarations for variables, and aliases.
+
;; Special "default-FOO" variables which contain the default value of
;; the "FOO" variable are nasty. Their implementation is brittle, and
;; slows down several unrelated variable operations; furthermore, they
@@ -1047,37 +1080,6 @@
(make-obsolete-variable 'default-enable-multibyte-characters
"use enable-multibyte-characters or set-buffer-multibyte instead" "23.2")
-(define-obsolete-function-alias 'window-dot 'window-point "22.1")
-(define-obsolete-function-alias 'set-window-dot 'set-window-point "22.1")
-(define-obsolete-function-alias 'read-input 'read-string "22.1")
-(define-obsolete-function-alias 'show-buffer 'set-window-buffer "22.1")
-(define-obsolete-function-alias 'eval-current-buffer 'eval-buffer "22.1")
-(define-obsolete-function-alias 'string-to-int 'string-to-number "22.1")
-
-(make-obsolete 'char-bytes "now always returns 1." "20.4")
-(make-obsolete 'forward-point "use (+ (point) N) instead." "23.1")
-
-(defun insert-string (&rest args)
- "Mocklisp-compatibility insert function.
-Like the function `insert' except that any argument that is a number
-is converted into a string by expressing it in decimal."
- (dolist (el args)
- (insert (if (integerp el) (number-to-string el) el))))
-(make-obsolete 'insert-string 'insert "22.1")
-
-(defun makehash (&optional test) (make-hash-table :test (or test 'eql)))
-(make-obsolete 'makehash 'make-hash-table "22.1")
-
-;; These are used by VM and some old programs
-(defalias 'focus-frame 'ignore "")
-(make-obsolete 'focus-frame "it does nothing." "22.1")
-(defalias 'unfocus-frame 'ignore "")
-(make-obsolete 'unfocus-frame "it does nothing." "22.1")
-(make-obsolete 'make-variable-frame-local
- "explicitly check for a frame-parameter instead." "22.2")
-
-;;;; Obsolescence declarations for variables, and aliases.
-
(make-obsolete-variable 'define-key-rebound-commands nil "23.2")
(make-obsolete-variable 'redisplay-end-trigger-functions 'jit-lock-register
"23.1")
(make-obsolete 'window-redisplay-end-trigger nil "23.1")
Index: lisp/emacs-lisp/bytecomp.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/emacs-lisp/bytecomp.el,v
retrieving revision 2.265
retrieving revision 2.266
diff -u -b -r2.265 -r2.266
--- lisp/emacs-lisp/bytecomp.el 1 Oct 2009 16:54:25 -0000 2.265
+++ lisp/emacs-lisp/bytecomp.el 1 Oct 2009 17:47:43 -0000 2.266
@@ -1248,7 +1248,11 @@
(and (not macro-p)
(byte-code-function-p (symbol-function fn)))))
(setq fn (symbol-function fn)))
- (let ((advertised (gethash fn advertised-signature-table t)))
+ (let ((advertised (gethash (if (and (symbolp fn) (fboundp fn))
+ ;; Could be a subr.
+ (symbol-function fn)
+ fn)
+ advertised-signature-table t)))
(cond
((listp advertised)
(if macro-p
@@ -3104,14 +3108,14 @@
;; which have special byte codes just for speed.
(defmacro byte-defop-compiler (function &optional compile-handler)
- ;; add a compiler-form for FUNCTION.
- ;; If function is a symbol, then the variable "byte-SYMBOL" must name
- ;; the opcode to be used. If function is a list, the first element
- ;; is the function and the second element is the bytecode-symbol.
- ;; The second element may be nil, meaning there is no opcode.
- ;; COMPILE-HANDLER is the function to use to compile this byte-op, or
- ;; may be the abbreviations 0, 1, 2, 3, 0-1, or 1-2.
- ;; If it is nil, then the handler is "byte-compile-SYMBOL."
+ "Add a compiler-form for FUNCTION.
+If function is a symbol, then the variable \"byte-SYMBOL\" must name
+the opcode to be used. If function is a list, the first element
+is the function and the second element is the bytecode-symbol.
+The second element may be nil, meaning there is no opcode.
+COMPILE-HANDLER is the function to use to compile this byte-op, or
+may be the abbreviations 0, 1, 2, 3, 0-1, or 1-2.
+If it is nil, then the handler is \"byte-compile-SYMBOL.\""
(let (opcode)
(if (symbolp function)
(setq opcode (intern (concat "byte-" (symbol-name function))))
Index: src/ChangeLog
===================================================================
RCS file: /sources/emacs/emacs/src/ChangeLog,v
retrieving revision 1.7776
retrieving revision 1.7777
diff -u -b -r1.7776 -r1.7777
--- src/ChangeLog 1 Oct 2009 15:08:13 -0000 1.7776
+++ src/ChangeLog 1 Oct 2009 17:47:43 -0000 1.7777
@@ -1,6 +1,10 @@
+2009-10-01 Stefan Monnier <address@hidden>
+
+ * eval.c (Fcalled_interactively_p): Add `kind' argument.
+
2009-10-01 Michael Albinus <address@hidden>
- * fileio.c (Fdelete_directory_internal): Renamed from
+ * fileio.c (Fdelete_directory_internal): Rename from
Fdelete_directory. It is not a command anymore. It has no file
name handler.
Index: src/eval.c
===================================================================
RCS file: /sources/emacs/emacs/src/eval.c,v
retrieving revision 1.314
retrieving revision 1.315
diff -u -b -r1.314 -r1.315
--- src/eval.c 20 Sep 2009 17:05:02 -0000 1.314
+++ src/eval.c 1 Oct 2009 17:47:44 -0000 1.315
@@ -608,19 +608,31 @@
}
-DEFUN ("called-interactively-p", Fcalled_interactively_p,
Scalled_interactively_p, 0, 0, 0,
+DEFUN ("called-interactively-p", Fcalled_interactively_p,
Scalled_interactively_p, 0, 1, 0,
doc: /* Return t if the containing function was called by
`call-interactively'.
-This includes being called as the binding of a key, or called from a
-keyboard macro (unlike `interactive-p').
+If KIND is `interactive', then only return t if the call was made
+interactively by the user, i.e. not in `noninteractive' mode nor
+when `executing-kbd-macro'.
+If KIND is `any', on the other hand, it will return t for any kind of
+interactive call, including being called as the binding of a key, or
+from a keyboard macro, or in `noninteractive' mode.
+
+The only known proper use of `interactive' for KIND is in deciding
+whether to display a helpful message, or how to display it. If you're
+thinking of using it for any other purpose, it is quite likely that
+you're making a mistake. Think: what do you want to do when the
+command is called from a keyboard macro?
This function is meant for implementing advice and other
function-modifying features. Instead of using this, it is sometimes
cleaner to give your function an extra optional argument whose
`interactive' spec specifies non-nil unconditionally (\"p\" is a good
-way to do this). */)
- ()
+way to do this), or via (not (or executing-kbd-macro noninteractive)). */)
+ (kind)
+ Lisp_Object kind;
{
- return interactive_p (1) ? Qt : Qnil;
+ return ((INTERACTIVE || !EQ (kind, intern ("interactive")))
+ && interactive_p (1)) ? Qt : Qnil;
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] emacs etc/NEWS lisp/ChangeLog lisp/subr.el lisp...,
Stefan Monnier <=