auto-complete for Elixir programming

I recommend you to use company-mode for auto completion of Elixir programming.

I created ac-alchemist which is auto-complete source of alchemist. Because alchemist provides only company-mode completion.

alchemist often changes its API frequently. So it may break ac-alchemist. Please report me if ac-alchemist does not work with latest alchemist via github issues.

Repository

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

Image

ac-alchemist

See also

neotree with vc-mode

neotree can work with vc-mode. So it works like Atom.io. However its feature is disabled as default. Please add following configuration to your init.el for enabling it. You also enable vc-mode.

(custom-set-variables
 '(neo-vc-integration '(face)))

Screenshot is here. Modified files are highlighted in magenta.

f:id:syohex:20150805194909p:plain

neotree supports showing vc information by face and char. We can also enable both of them as below.

(custom-set-variables
 '(neo-vc-integration '(face char)))

This version screenshot is here. There are E(means edited) characters at Modified files.

f:id:syohex:20150805195322p:plain

Customize

Face names of neotree vc information are neo-vc-*-face(Ex neo-vc-edited-face). And characters of it is neo-vc-state-char-alist. You can custom as you like. Please read documentation or source code in more detail.

f:id:syohex:20150805200033p:plain

enjoy hacking neotree.

Release Mouse v2.4.4

https://metacpan.org/release/SYOHEX/Mouse-v2.4.4

Mouse with threads did not work on Perl 5.22.0 or higher version. This makes Text::Xslate test failure for a long time. This version fixed the issue and works with threads. Please upgrade for newer perl users.

Example

We expects $foo->syntax is "Kolon" but $foo->syntax is undef with older Mouse on Perl 5.22.0 or higher. This test is passed with Mouse v2.4.4.

#!perl
package Foo;
use Mouse;

has syntax => (
    is      => 'rw',
    isa     => 'Str',
    default => 'Kolon',
);

package main;
use strict;
use warnings;
use threads;

use Test::More;

my $foo = Foo->new;
is $foo->syntax, "Kolon";

threads->create(sub{
    is $foo->syntax, "Kolon";
})->join();

done_testing;

evil-textobj-line

evil-textobj-line is Emacs port of @kana1's vim-textobj-line. evil-text-obj-line provides functions which select portion of current line.

Repository

https://github.com/syohex/evil-textobj-line

Demo a line("val")

a-line selects whole current line

f:id:syohex:20150731140024g:plain

Demo inner line("vil")

inner-line selects current line excepts both leading spaces and trailing spaces.

f:id:syohex:20150731140054g:plain

atomを起動できない問題の workaround

atomを使ってみようと, Ubuntu 15.04に公式 debパッケージを使って, インストールして起動しようとしてみたが以下のエラーが出て起動しない.

line 98:  8076 Aborted                 (core dumped) nohup "$ATOM_PATH" --executed-from="$(pwd)" --pid=$$ "$@" > "$ATOM_HOME/nohup.out" 2>&1
[8076:0727/230141:ERROR:browser_main_loop.cc(170)] Running without the SUID sandbox! See https://code.google.com/p/chromium/wiki/LinuxSUIDSandboxDevelopment for more information on developing with the sandbox on.
ATTENTION: default value of option force_s3tc_enable overridden by environment.
[libprotobuf FATAL ../../third_party/protobuf/src/google/protobuf/stubs/common.cc:61] This program requires version 2.6.0 of the Protocol Buffer runtime library, but the installed version is 2.5.0.  Please update your library.  If you compiled the program yourself, make sure that your headers are from the same version of Protocol Buffers as your link-time library.  (Version verification failed in "gen/proto_out/session/candidates.pb.cc".)
Failed to get crash dump id.
Report Id:

Ubuntu 14.04ではなんともなかったのだが, 起動さえもできなくなってしまった. Protocol Bufferライブラリのバージョンについて怒られているが, インストールしているバージョンは 2.6台でそこに問題はない(はず).

Workaround

環境変数 GTK_IM_MODULE(KDE等の Qt環境では QT_IM_MODULE)と XMODIFIERSを無効にして起動すれば問題ないことがわかった.( 参考). 以下のようなスクリプトを /usr/binより優先される PATHに置き, 実行すればとりあえず起動できることはわかった. インプットメソッドは起動できないので日本語は打てないが, 必要ないのでとりあえずいいでしょう.

#!/bin/sh

set -e

unset GTK_IM_MODULE
unset XMODIFIERS
/usr/bin/atom $@

Implement my own simple helm-find-files

f:id:syohex:20150715144102p:plain

helm-find-files is useful command for opening files in current directory. However I have some complaints for it. - I want to see only files, not directories(., .. etc). - I don't want to open binary files - I use only some actions(open file, open file in other window, insert file)

Here is code. To collect files is following step - Collect all files/directory in current directory by glob('* .*') - filter them by -T file flag - -T file flag returns true if argument is text file.

(defun my/helm-find-files-init ()
  (with-current-buffer (helm-candidate-buffer 'global)
    (unless (zerop (process-file "perl" nil t nil "-wE" "say for grep {-T $_} glob('* .*')"))
      (error "Failed: collect files"))))

(defvar my/helm-source-find-files
  (helm-build-in-buffer-source "Find Files"
    :init 'my/helm-find-files-init
    :action '(("Find File" . find-file)
              ("Find File other window" . find-file-other-window)
              ("Insert File" . insert-file))))

(defun my/helm-find-files ()
  (interactive)
  (helm :sources '(my/helm-source-find-files) :buffer "*Helm Find Files*"))

This is a little slow because Perl is not so fast language :-(

How to disassemble MacOSX binary(O-Mach) on Linux

f:id:syohex:20150713165520p:plain

Download Binutils

Download Binutils

% curl -LO http://ftp.jaist.ac.jp/pub/GNU/binutils/binutils-2.25.tar.bz2

Configuration

Change --prefix as you like.

% tar xf binutils-2.25.tar.bz2
% cd binutils-2.25
% mkdir build
% cd build
% ../configure --prefix=/opt/mac --target=x86_64-apple-darwin --enable-64-bit-bfd --disable-nls

Build and Install

% make
% sudo make install

Set PATH environment variable to the --prefix directory. In this case, export PATH=/opt/mac/bin:$PATH

Disassemble

% x86_64-apple-darwin-objdump -d peco |less