Welcome to awesome bug tracking system.

FS#395 - Inline functions considered bad

Attached to Project: awesome
Opened by Damjan (gdamjan) - Sunday, 30 November 2008, 03:55 GMT
Last edited by Uli Schlachter (psychon) - Thursday, 24 May 2012, 09:05 GMT
Task Type Feature Request
Category Core
Status Closed
Assigned To No-one
Operating System All
Severity Very Low
Priority Low
Reported Version git/master
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 2
Private No


Awesome in the default config file uses an inline function for a lot of keybindings etc.

This is suboptimal since for ex. I'd like to add "mod4 + R" as an alternative to "mod4 + F1". To do this I need to copy the function for "mod4 + F1". Even worse, when awesome improves the default function, I'd need to notice it and copy/paste it again.

What would be much better is if there was a single function, named awesome_shell_prompt or smth, that I could call from different places.

There are some other similar places, where a slight reorganizing would help make the default config file more reusable.
This task depends upon

Closed by  Uli Schlachter (psychon)
Thursday, 24 May 2012, 09:05 GMT
Reason for closing:  Won't implement
Additional comments about closing:  Sorry, but nope.

However, it should be possible to write a function which "calls" into another keybinding. This would need access to the result from awful.key() and thus wouldn't be easily integratable with updates to the config either. Hm...
Comment by Uli Schlachter (psychon) - Sunday, 14 March 2010, 14:20 GMT
The inline functions in the current default config aren't really that long and giving each of them a name would make the config a lot longer and I think it would also be more complicated since you'd have to jump around to see what the function actually does.

Would you still want this or can this bug be closed?
Comment by Arvydas Sidorenko (Asido) - Thursday, 24 May 2012, 15:05 GMT
I saw a paper once with tons of Lua benchmarks and inlining showed quite a big performance drop.