{"action":"created","issue":{"url":"https://api.github.com/repos/xwl/electric-spacing/issues/13","labels_url":"https://api.github.com/repos/xwl/electric-spacing/issues/13/labels{/name}","comments_url":"https://api.github.com/repos/xwl/electric-spacing/issues/13/comments","events_url":"https://api.github.com/repos/xwl/electric-spacing/issues/13/events","html_url":"https://github.com/xwl/electric-spacing/issues/13","id":128556211,"number":13,"title":"Include electric-spacing for R coding style","user":{"login":"walmes","id":1236798,"avatar_url":"https://avatars.githubusercontent.com/u/1236798?v=3","gravatar_id":"","url":"https://api.github.com/users/walmes","html_url":"https://github.com/walmes","followers_url":"https://api.github.com/users/walmes/followers","following_url":"https://api.github.com/users/walmes/following{/other_user}","gists_url":"https://api.github.com/users/walmes/gists{/gist_id}","starred_url":"https://api.github.com/users/walmes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/walmes/subscriptions","organizations_url":"https://api.github.com/users/walmes/orgs","repos_url":"https://api.github.com/users/walmes/repos","events_url":"https://api.github.com/users/walmes/events{/privacy}","received_events_url":"https://api.github.com/users/walmes/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2016-01-25T15:05:20Z","updated_at":"2016-01-27T14:01:22Z","closed_at":null,"body":"Hi William,\r\n\r\nAs I told you, I was working to extend electric-spacing for the R coding style based on what you did for C++. I did this in a new file, [ess-electric-spacings](https://github.com/walmes/electric-spacing/blob/ess/ess-electric-spacing.el). I did some testing, it seems to be working well. Now I can submit a pull request but I was thinking if is better to put `electric-spacing-*` characters definitions in separated files, one for each mode/language, and keep generic functions (those in the top of file) in the `electric-spacing.el`. This way, `electric-spacings-c++.el` and `electric-spacings-r.el` would be created now. The main file would call one of the other files based on the current major mode. Moreover, in the future someone can easily add more extensions, like python and shell.\r\n\r\nBests."},"comment":{"url":"https://api.github.com/repos/xwl/electric-spacing/issues/comments/175642154","html_url":"https://github.com/xwl/electric-spacing/issues/13#issuecomment-175642154","issue_url":"https://api.github.com/repos/xwl/electric-spacing/issues/13","id":175642154,"user":{"login":"xwl","id":173505,"avatar_url":"https://avatars.githubusercontent.com/u/173505?v=3","gravatar_id":"","url":"https://api.github.com/users/xwl","html_url":"https://github.com/xwl","followers_url":"https://api.github.com/users/xwl/followers","following_url":"https://api.github.com/users/xwl/following{/other_user}","gists_url":"https://api.github.com/users/xwl/gists{/gist_id}","starred_url":"https://api.github.com/users/xwl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xwl/subscriptions","organizations_url":"https://api.github.com/users/xwl/orgs","repos_url":"https://api.github.com/users/xwl/repos","events_url":"https://api.github.com/users/xwl/events{/privacy}","received_events_url":"https://api.github.com/users/xwl/received_events","type":"User","site_admin":false},"created_at":"2016-01-27T14:01:22Z","updated_at":"2016-01-27T14:01:22Z","body":"i have something like this in mind:\r\n\r\n1. electric-spacing.el defines: (defvar electric-spacing-customized-modes '(c++-mode r-mode))\r\n2. Then, e.g., when inserting %, \r\n * check if current mode is in electric-spacing-customized-modes, \r\n * if yes, load the file (require 'electric-spacing-c++);\r\n     * check if mode has defined its own version of % (using boundp);\r\n         * if yes, call it\r\n\r\n * else call default implementation.\r\n   \r\nSo the user only needs to know and use electric-spacing.el.\r\n"}}