Skip to content

Commit

Permalink
Change first position 🐹
Browse files Browse the repository at this point in the history
  • Loading branch information
FukuyamaShingo authored and FukuyamaShingo committed Nov 11, 2013
1 parent fd31fbc commit e6ced96
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.org
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ Emoji image files are from [[https://github.com/arvida/emoji-cheat-sheet.com][ar
** Usage

M-x emoji-cheat-sheet :tired_face:
And then press `RET' to copy emoji code to clipboard.
Press `RET' on any emoji to copy its code to clipboard.
5 changes: 3 additions & 2 deletions emoji-cheat-sheet.el
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,13 @@
(defun emoji-cheat-sheet-create ()
(let (($files (directory-files emoji-cheat-sheet-dir nil "png$"))
($i 0)
($width (window-width)))
($width (/ (window-width) 4)))
(dolist ($file $files)
(insert-image (create-image (concat emoji-cheat-sheet-dir $file)
'png nil :margin 1 :ascent 'center)
(format ":%s:" (substring $file 0 -4)))
(setq $i (1+ $i))
(if (eq 0 (% $i (/ $width 4)))
(if (eq 0 (% $i $width))
(insert "\n")))))

(defun emoji-cheat-sheet-copy-at-point ()
Expand All @@ -86,6 +86,7 @@
(emoji-cheat-sheet-create)
(local-set-key (kbd "RET") 'emoji-cheat-sheet-copy-at-point)
(goto-char (point-min))
(next-line 3)
(read-only-mode 1)))

(provide 'emoji-cheat-sheet)
Expand Down

0 comments on commit e6ced96

Please sign in to comment.