kiwanami / emacs-calfw

A calendar framework for Emacs
1.17k stars 100 forks source link

Please use standard symbol prefixes #62

Closed rnkn closed 8 years ago

rnkn commented 9 years ago

Wonderful package that could be made even more wonderful with standard symbol prefixes.

From Emacs Lisp Coding Conventions:

You should choose a short word to distinguish your program from other Lisp programs. The names of all global symbols in your program, that is the names of variables, constants, and functions, should begin with that chosen prefix. Separate the prefix from the rest of the name with a hyphen, ‘-’. This practice helps avoid name conflicts, since all global variables in Emacs Lisp share the same name space, and all functions share another name space. Use two hyphens to separate prefix and name if the symbol is not meant to be used by other packages.

e.g. cfw:open-calendar-buffer to cfw-open-calendar-buffer :)

kiwanami commented 9 years ago

Hi @rnkn Yes! I know this document. I had to write code in this style. It is easy to rewrite the code, but, when should I do that?

This is my excuse for naming convention: Unfortunately I had studied emacs lisp before this document. https://github.com/emacs-mirror/emacs/commit/4f1e25e2c999be13ae6c111443085c799eb825fd And I noticed the package naming convention 3 years ago...

rnkn commented 9 years ago

My thinking would be the easiest thing to do is first defalias interactive functions with the calfw- prefix (or cfw-) to make it more obvious for newcomers. Then defalias all symbols after. I could submit a pull request or requests doing this grunt work if you'd like?

If you decide to rewrite the code with the prefix, the defalias functions can then easily be changed to define-obsolete-variable-alias and define-obsolete-function-alias. This way it should all go smoothly and retain backwards compatibility, so you would not need to wait until a 2.0 release to make the switch (if you wanted to keep with semantic versioning).

kiwanami commented 9 years ago

I'm sorry for my late response. defalias is good idea! Would you make the PR?

rnkn commented 8 years ago

Sorry I forgot about this. I don't use Org Mode anymore so it's unlikely I'll focus on this. Feel free to close.

kiwanami commented 8 years ago

Ok. I close this issue. Maybe calfw should fix the package prefix in future...