From a7b281294c390c555c373315ddabc3389e78f7e2 Mon Sep 17 00:00:00 2001 From: Daniel Hahler Date: Sat, 11 Jul 2015 22:50:11 +0200 Subject: [PATCH 1/5] Makefile: add "tags" to .PHONY targets It could depend on $(shell git ls-files), but it's not worth the overhead to get this list then always. --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 16327a47..6cfeaa67 100644 --- a/Makefile +++ b/Makefile @@ -44,4 +44,4 @@ distclean: $(MAKE) -C ${builddir} $@ $(and $(filter clean,$@),$(RM) $(BUILDLN) $(TARGETS)) -.PHONY: cmake-build cmake install distclean $(BUILDLN) +.PHONY: cmake-build cmake install distclean $(BUILDLN) tags From 5c3734e583bfb71854dec97408a4c5aa282715a5 Mon Sep 17 00:00:00 2001 From: Daniel Hahler Date: Sat, 11 Jul 2015 22:51:51 +0200 Subject: [PATCH 2/5] luaA_xrdb_get_value: add resource name/class to warning --- xrdb.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/xrdb.c b/xrdb.c index f32693c7..a349b450 100644 --- a/xrdb.c +++ b/xrdb.c @@ -67,7 +67,10 @@ int luaA_xrdb_get_value(lua_State *L) { lua_pushstring(L, (char *)resource_value.addr); return 1; } else { - luaA_warn(L, "Failed to get xrdb value"); + if (strlen(resource_class)) + luaA_warn(L, "Failed to get xrdb value '%s' (class '%s').", resource_name, resource_class); + else + luaA_warn(L, "Failed to get xrdb value '%s'.", resource_name); return 0; } } From 1050237d04d5daab53a6bb7089f00fff60aac359 Mon Sep 17 00:00:00 2001 From: Daniel Hahler Date: Sat, 11 Jul 2015 22:53:57 +0200 Subject: [PATCH 3/5] minor: fix/improve doc comments --- awesomerc.lua | 4 ++-- common/lualib.h | 2 +- keygrabber.c | 2 +- lib/awful/keygrabber.lua | 6 +++--- lib/awful/rules.lua | 3 +-- xrdb.c | 2 +- 6 files changed, 9 insertions(+), 10 deletions(-) diff --git a/awesomerc.lua b/awesomerc.lua index 9b8ee01c..e1f1831d 100755 --- a/awesomerc.lua +++ b/awesomerc.lua @@ -395,13 +395,13 @@ client.connect_signal("manage", function (c) -- i.e. put it at the end of others instead of setting it master. -- awful.client.setslave(c) - -- Put windows in a smart way, only if they does not set an initial position. + -- Put windows in a smart way, only if they do not set an initial position. if not c.size_hints.user_position and not c.size_hints.program_position then awful.placement.no_overlap(c) awful.placement.no_offscreen(c) end elseif not c.size_hints.user_position and not c.size_hints.program_position then - -- Prevent clients from being unreachable after screen count change + -- Prevent clients from being unreachable after screen count changes. awful.placement.no_offscreen(c) end diff --git a/common/lualib.h b/common/lualib.h index af439601..513eef88 100644 --- a/common/lualib.h +++ b/common/lualib.h @@ -26,7 +26,7 @@ #include "common/util.h" -/** Lua function to call on dofuction() error */ +/** Lua function to call on dofunction() error */ lua_CFunction lualib_dofunction_on_error; void luaA_checkfunction(lua_State *, int); diff --git a/keygrabber.c b/keygrabber.c index 3cb361d1..b57972ba 100644 --- a/keygrabber.c +++ b/keygrabber.c @@ -75,7 +75,7 @@ is_control(char *buf) /** Handle keypress event. * \param L Lua stack to push the key pressed. * \param e Received XKeyEvent. - * \return True if a key was successfully get, false otherwise. + * \return True if a key was successfully retrieved, false otherwise. */ bool keygrabber_handlekpress(lua_State *L, xcb_key_press_event_t *e) diff --git a/lib/awful/keygrabber.lua b/lib/awful/keygrabber.lua index aac8ab1e..02b63d5b 100644 --- a/lib/awful/keygrabber.lua +++ b/lib/awful/keygrabber.lua @@ -80,11 +80,11 @@ end -- end) -- end function keygrabber.run(g) - -- Remove the grabber if its in stack + -- Remove the grabber if it is in the stack. keygrabber.stop(g) - -- Record the grabber has latest added + -- Record the grabber that has been added most recently. table.insert(grabbers, 1, g) - -- start the keygrabber if its not running already + -- Start the keygrabber if it is not running already. if not keygrabbing then keygrabbing = true capi.keygrabber.run(grabber) diff --git a/lib/awful/rules.lua b/lib/awful/rules.lua index 6e57d793..7a1eb11f 100644 --- a/lib/awful/rules.lua +++ b/lib/awful/rules.lua @@ -214,8 +214,7 @@ function rules.execute(c, props, callbacks) end end - -- Do this at last so we do not erase things done by the focus - -- signal. + -- Do this at last so we do not erase things done by the focus signal. if props.focus and (type(props.focus) ~= "function" or props.focus(c)) then c:emit_signal('request::activate', "rules", {raise=true}) end diff --git a/xrdb.c b/xrdb.c index a349b450..974dee75 100644 --- a/xrdb.c +++ b/xrdb.c @@ -39,7 +39,7 @@ static void xrdb_init(void) { /**/ if (!(globalconf.xrmdb = XrmGetDatabase(globalconf.display))) - warn("Can't open xrdb\n"); + warn("Cannot open xrdb."); } } From 917965483de7a9bcd236b2aa957dbd3cf1010e54 Mon Sep 17 00:00:00 2001 From: Daniel Hahler Date: Sun, 12 Jul 2015 17:32:35 +0200 Subject: [PATCH 4/5] doc: improve docs/02-contributing.md --- docs/02-contributing.md | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/docs/02-contributing.md b/docs/02-contributing.md index 4043faa6..e0add404 100644 --- a/docs/02-contributing.md +++ b/docs/02-contributing.md @@ -14,26 +14,31 @@ Imitate the existing code style. For concrete rules: - Use 4 spaces indentation, do not use tabulator characters; - Place braces alone on new lines, and do not place braces for single - line statement where it is not needed, i.e. no: + line statement where it is not needed, i.e.: - if(bla) { + if(foo) x = 1; + + if(foo) + { + x = 1; + bar(); } - Do not put a space after if, for, while or function call statements; - - The preferred line length is 80 characters; + - The preferred maximum line length is 80 characters; - Use `/* */` for comments; - - Use the API: there's a list of `a_*()` functions you should use instead + - Use the API: there is a list of `a_*()` functions you should use instead of the standard libc ones. There is also a common API for linked lists, tabulars, etc.; - Be *clear* in what you do; - - Prefix your function name with the module they are enhancing, - i.e. if you add a function to manipulate a tag prefix it with `tag_`; + - Prefix your function names with the module they are enhancing, + i.e. if you add a function to manipulate a tag, prefix it with `tag_`; - Write documentation for any new functions, options, whatever. From 94814c7512b2d5d1e6aaab4decc4881c49230b12 Mon Sep 17 00:00:00 2001 From: Daniel Hahler Date: Fri, 20 Mar 2015 16:58:33 +0100 Subject: [PATCH 5/5] screen_client_moveto: add comment/whitespace for 'emit signal' --- objects/screen.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/objects/screen.c b/objects/screen.c index 1865e274..5f3af354 100644 --- a/objects/screen.c +++ b/objects/screen.c @@ -445,6 +445,8 @@ screen_client_moveto(client_t *c, screen_t *new_screen, bool doresize) /* move / resize the client */ client_resize(c, new_geometry, false); + + /* emit signal */ luaA_object_push(L, c); if(old_screen_idx != 0) lua_pushinteger(L, old_screen_idx); @@ -452,6 +454,7 @@ screen_client_moveto(client_t *c, screen_t *new_screen, bool doresize) lua_pushnil(L); luaA_object_emit_signal(L, -2, "property::screen", 1); lua_pop(L, 1); + if(had_focus) client_focus(c); }