Skip to content

Commit

Permalink
Fix comments of code and some typos
Browse files Browse the repository at this point in the history
  • Loading branch information
kadircancetin committed Aug 1, 2020
1 parent 5f0ec7e commit ac48f2e
Showing 1 changed file with 14 additions and 15 deletions.
29 changes: 14 additions & 15 deletions typo-suggest.el
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
;;; typo-suggest.el --- Don't make typo with the help of helm and compny ;; -*- lexical-binding: t -*-
;;; typo-suggest.el --- Don't make typos with the help of helm and company -*- lexical-binding: t -*-

;; Copyright (C) 2020 Kadir Can Çetin

;; Author: Kadir Can Çetin <[email protected]>
;; Keywords: convenience, wp
;; Package-Requires: ((emacs "24.3") (helm "3.0") (company "0.9.10"))
;; URL: https://github.com/kadircancetin/typo-suggest
;; Version: 0.0.2
;; Version: 0.0.3

;; This program is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
Expand All @@ -22,13 +22,13 @@
;; along with this program. If not, see <https://www.gnu.org/licenses/>.

;;; Commentary:

;; Fixing typos with helm or company.
;;
;; This package relies on the third-party Datamuse's /sug API (doc:
;; https://www.datamuse.com/api/). The API is free to use any usage and without API key has a daily
;; 100,000 requests per day limit. You can contact us with any problem with
;; https://github.com/kadircancetin/typo-suggest.

;;; Code:

;; code goes here

(require 'cl-lib)
(require 'json)
(require 'thingatpt)
Expand All @@ -42,12 +42,12 @@
:group 'helm)

(defcustom typo-suggest-suggestion-count 20
"Number of suggestion for 'helm and company completion."
"Number of suggestions for 'helm and company completion."
:type 'integer
:group 'typo-suggest)

(defcustom typo-suggest-timeout 1
"Number of second to try maximum connection server time."
"Number of seconds to try maximum server waiting time."
:type 'integer
:group 'typo-suggest)

Expand All @@ -65,11 +65,11 @@ Argument QUERY is string which will searched."
(re-search-forward "^$")
(delete-region (point)(point-min))(buffer-string)))

(defun typo-suggest--results (fetched_str)
(defun typo-suggest--results (fetched-str)
"Gets json str, return parsed elisp obj.
It returns list of strings suggestion. Argument FETCHED_STR is
It returns list of strings suggestion. Argument FETCHED-STR is
comes from `typo-suggest--fetch-result'."
(mapcar #'cdr (mapcar #'car (json-read-from-string (typo-suggest--fetch-results fetched_str)))))
(mapcar #'cdr (mapcar #'car (json-read-from-string (typo-suggest--fetch-results fetched-str)))))


(defun typo-suggest--helm-replace-word(x)
Expand Down Expand Up @@ -106,11 +106,10 @@ comes from `typo-suggest--fetch-result'."


;;;###autoload
(defun typo-suggest-company (command &optional arg &rest ignored)
(defun typo-suggest-company (command &optional arg &rest _ignored)
"Get word suggestion from datamuse api with company mode.
Argument COMMAND is used for company.
Optional argument ARG Is used from company to send which will search.
Optional argument IGNORED ignored arguments."
Optional argument ARG Is used from company to send which will search."
(interactive (list 'interactive))
(cl-case command
(interactive (company-begin-backend 'typo-suggest-company))
Expand Down

2 comments on commit ac48f2e

@kaz-yos
Copy link

@kaz-yos kaz-yos commented on ac48f2e Aug 6, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"compny" is still in the Github About.

@kadircancetin
Copy link
Owner Author

@kadircancetin kadircancetin commented on ac48f2e Aug 7, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"compny" is still in the Github About.

@kaz-yos , Yes, thank you. Actually it was a kind of a joke but a friend of mine, melpa maintainers (which is why this commit about) and you think it is a typo. So I think that joke is not funny so I will fix it. Thank you for your response.

Please sign in to comment.