[sawfish] Minor fix. `this-command' is set to nil when command execution is over.
- From: Christopher Bratusek <chrisb src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [sawfish] Minor fix. `this-command' is set to nil when command execution is over.
- Date: Tue, 3 Nov 2009 16:22:34 +0000 (UTC)
commit b5a029ffa1887c896b9a38ad545043560b6e3d77
Author: Teika kazura <teika lavabit com>
Date: Tue Nov 3 16:54:23 2009 +0900
Minor fix. `this-command' is set to nil when command execution is over.
Related doc improvement is done, too.
lisp/sawfish/wm/commands.jl | 1 +
man/news.texi | 1 +
man/sawfish.texi | 10 +++++++---
3 files changed, 9 insertions(+), 3 deletions(-)
---
diff --git a/lisp/sawfish/wm/commands.jl b/lisp/sawfish/wm/commands.jl
index 4b450e1..812e9ad 100644
--- a/lisp/sawfish/wm/commands.jl
+++ b/lisp/sawfish/wm/commands.jl
@@ -184,6 +184,7 @@ command called NAME (optionally whose arguments have custom-type TYPE)."
;; postfix
(call-hook 'post-command-hook (list name))
(setq last-command this-command)
+ (setq this-command nil)
(setq current-prefix-arg nil)))
(define-command 'call-command call-command
diff --git a/man/news.texi b/man/news.texi
index 8bb631d..c51065e 100644
--- a/man/news.texi
+++ b/man/news.texi
@@ -99,6 +99,7 @@ Position parameters can be negative [Christopher Bratusek, Teika Kazura]
@item Commands @code{maximize-window-fullscreen} and @code{maximize-window-fullxinerame} work. [Teika kazura]
+ item Variable @code{this-command} is @code{nil} outside of command call.
@end itemize
@item New features:
@itemize @minus
diff --git a/man/sawfish.texi b/man/sawfish.texi
index 9f1873c..5fffe0e 100644
--- a/man/sawfish.texi
+++ b/man/sawfish.texi
@@ -5446,8 +5446,8 @@ prefix argument.
@end defvar
@defvar this-command
-The command currently being called, or @samp{nil} if no command is
-being called.
+The command currently being called. The value is only set during
+command call, and @code{nil} anytime else.
@end defvar
@defvar last-command
@@ -6186,8 +6186,12 @@ The available hooks are listed below.
@cindex Command Hooks
@cindex Hooks, Command
+The hook functions are passed one argument which is the command name.
+
@defvr {Hook} pre-command-hook
-Called before each command is evaluated.
+Called before each command is evaluated. If you set the value
+ code{this-command} to @code{nil} in this hook, then the command
+won't be executed.
@end defvr
@defvr {Hook} post-command-hook
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]