   ele.removeAttr(name)
   return $(buddy).attr(name)
 
-
-
-# Get the markdown source code of the current page.
-#   fst: first line number
-#   lst: last line number
-# returns JSON encoded markdown source code
-getOriginalMinuteAsJSON = () ->
+# Get the JSON format of the current page.
+#
+# If the current page is /mintes/1, it will return /minutes/1.json.
+# This function is supposed to be used to get a JSON-style content of
+# currently displayed minute.
+#
+# returns JSON encoded structure.
+#
+getCurrentPageAsJSON = () ->
   res = $.ajax
     url: window.location.pathname + ".json"
     async: false

  json = res.responseJSON
  return json

renderMarkdown = (text, update_element) ->
  $.post '/minutes/preview', {text: text}, (data) ->
    $(update_element).html(data)

# Stub getOriginalMinuteAsJSON for test
getOriginalMinuteAsJSON_Stub = (fst, lst) ->
  return {
    title: "Minute 2015-06-10"
    body: "# Blah\n+ fst: #{fst}\n+ lst: #{lst}\n"
    labels: "bug"
  }

#
# Remove Headings of list item ``+ (A) ``
#
removeHeader = (string) ->
  string.replace(/^ *[*+-] */, '')
#  string.replace(/^ *[*+-]( \(.\))? */, '')

# Return a regexp to match a string in the array STRINGS
# JavaScript verion of Emacs regexp-opt
# https://gist.github.com/kawanet/5540864
#
array_to_regexp = (strings, regexp_option) ->

displayTitle = (title) ->
  $('#title').val(title)

ready = ->
  repos_list = getGithubAllHomeRepositories()
  setupAutoCompleteEmoji('#minute_content')
  setupAutoCompleteTag('#tag-name')
  setupTabCallback()
