Open write mode for flock(fh, LOCK_EX) for portability

We should open file with write intent for using flock(fh, LOCK_EX) for portability. Because flock(fh, LOCK_EX) is failed without write intent on some platforms(such as Solaris) and platforms which does not provide flock. (In this case Perl emulates flock with other API).

On Linux or some BSD(include MacOSX), flock(fh, LOCK_EX) successes without write intent. However if you want to work your module on many platforms, you should open with write intent.

perldoc -f flock says

Note that the fcntl(2) emulation of flock(3) requires that FILEHANDLE be open with read intent to use LOCK_SH and requires that it be open with write intent to use LOCK_EX.

See also

auto-complete source for Emoji

I uploaded ac-emoji to github. This package provides auto-complete source of Emoji.

Image

ac-emoji

Repository

https://github.com/syohex/emacs-ac-emoji

I test only MacOSX.

Sample configuration

I think this package is useful for writing Markdown or git commit message.

(add-hook 'markdown-mode-hook 'ac-emoji-setup)
(add-hook 'git-commit-mode-hook 'ac-emoji-setup)

MacOSX Users

Please add emoji font configuration to your init.el. This configuration is not necessary if you use emacs with no window mode(-nw).

(set-fontset-font
 t 'symbol
 (font-spec :family "Apple Color Emoji") nil 'prepend)

Summary

I released ac-emoji which is auto-complete source of emoji. I plan to request this package to MELPA. If you have any suggestions or problems, please report me via github issue.