Skip to content

Commit

Permalink
Reindent all files again.
Browse files Browse the repository at this point in the history
* helm-elisp-package.el: Use with instead of let.
  • Loading branch information
thierryvolpiatto committed Apr 25, 2014
1 parent 7e621fb commit e6c3ff1
Show file tree
Hide file tree
Showing 39 changed files with 2,004 additions and 2,004 deletions.
16 changes: 8 additions & 8 deletions helm-adaptative.el
Expand Up @@ -53,7 +53,7 @@ Format: ((SOURCE-NAME (SELECTED-CANDIDATE (PATTERN . NUMBER-OF-USE) ...) ...) ..
(setq helm-adaptive-done nil))

(define-minor-mode helm-adaptative-mode
"Toggle adaptative sorting in all sources."
"Toggle adaptative sorting in all sources."
:group 'helm-adapt
:require 'helm-adaptative
:global t
Expand Down Expand Up @@ -201,13 +201,13 @@ This is a filtered candidate transformer you can use with the

;; put those candidates first which have the highest usage count
(cl-loop for (info . _freq) in usage
for member = (cl-member info candidates
:test 'helm-adaptive-compare)
when member collect (car member) into sorted
and do
(setq candidates (cl-remove info candidates
:test 'helm-adaptive-compare))
finally return (append sorted candidates)))
for member = (cl-member info candidates
:test 'helm-adaptive-compare)
when member collect (car member) into sorted
and do
(setq candidates (cl-remove info candidates
:test 'helm-adaptive-compare))
finally return (append sorted candidates)))
(message "Your `%s' is maybe corrupted or too old, \
you should reinitialize it with `helm-reset-adaptative-history'"
helm-adaptive-history-file)
Expand Down
28 changes: 14 additions & 14 deletions helm-aliases.el
Expand Up @@ -32,32 +32,32 @@

(defun helm-check-conflicting-prefixes ()
(cl-loop for s in (all-completions "helm-c-" obarray)
for rep = (replace-regexp-in-string "helm-c-" "helm-" s)
when (or (and (not (helm-alias-p (intern s))) (fboundp (intern rep)))
(and (not (helm-alias-p (intern s))) (boundp (intern rep))))
collect rep))
for rep = (replace-regexp-in-string "helm-c-" "helm-" s)
when (or (and (not (helm-alias-p (intern s))) (fboundp (intern rep)))
(and (not (helm-alias-p (intern s))) (boundp (intern rep))))
collect rep))

(defun helm-collect-functions-with-bad-prefix ()
(cl-loop for s in (all-completions "helm-c-" obarray)
for sym = (intern s)
when (and (not (helm-alias-p sym)) (fboundp sym))
collect s))
for sym = (intern s)
when (and (not (helm-alias-p sym)) (fboundp sym))
collect s))

(defun helm-collect-vars-with-bad-prefix ()
(cl-loop for s in (all-completions "helm-c-" obarray)
for sym = (intern s)
when (and (not (helm-alias-p sym)) (boundp sym))
collect s))
for sym = (intern s)
when (and (not (helm-alias-p sym)) (boundp sym))
collect s))

(defun helm-insert-fn-aliases ()
(cl-loop for s in (helm-collect-functions-with-bad-prefix)
for rep = (replace-regexp-in-string "helm-c-" "helm-" s)
do (insert (format "(defalias '%s '%s)\n(make-obsolete '%s '%s \"1.5.1\")\n" s rep s rep))))
for rep = (replace-regexp-in-string "helm-c-" "helm-" s)
do (insert (format "(defalias '%s '%s)\n(make-obsolete '%s '%s \"1.5.1\")\n" s rep s rep))))

(defun helm-insert-var-aliases ()
(cl-loop for s in (helm-collect-vars-with-bad-prefix)
for rep = (replace-regexp-in-string "helm-c-" "helm-" s)
do (insert (format "(defvaralias '%s '%s)\n(make-obsolete-variable '%s '%s \"1.5.1\")\n" s rep s rep))))
for rep = (replace-regexp-in-string "helm-c-" "helm-" s)
do (insert (format "(defvaralias '%s '%s)\n(make-obsolete-variable '%s '%s \"1.5.1\")\n" s rep s rep))))


;;; Alias old functions prefixed with "helm-c-"
Expand Down
46 changes: 23 additions & 23 deletions helm-apt.el
Expand Up @@ -41,12 +41,12 @@ If nil default `helm-apt-cache-show-1' will be used."
:group 'helm-apt)

(defface helm-apt-installed
'((t (:foreground "green")))
'((t (:foreground "green")))
"Face used for apt installed candidates."
:group 'helm-apt)

(defface helm-apt-deinstalled
'((t (:foreground "DimGray")))
'((t (:foreground "DimGray")))
"Face used for apt deinstalled candidates."
:group 'helm-apt)

Expand Down Expand Up @@ -100,23 +100,23 @@ If nil default `helm-apt-cache-show-1' will be used."
(defun helm-apt-candidate-transformer (candidates)
"Show installed CANDIDATES and the ones to deinstall in a different color."
(cl-loop for cand in candidates
for name = (helm-apt-display-to-real cand)
for deinstall = (string=
(assoc-default name helm-apt-installed-packages)
"deinstall")
for install = (string=
(assoc-default name helm-apt-installed-packages)
"install")
for show = (cond ((and deinstall
(memq helm-apt-show-only '(all deinstalled)))
(propertize cand 'face 'helm-apt-deinstalled))
((and install
(memq helm-apt-show-only '(all installed)))
(propertize cand 'face 'helm-apt-installed))
((and (eq helm-apt-show-only 'noinstalled)
(not install)) cand)
((eq helm-apt-show-only 'all) cand))
when show collect show))
for name = (helm-apt-display-to-real cand)
for deinstall = (string=
(assoc-default name helm-apt-installed-packages)
"deinstall")
for install = (string=
(assoc-default name helm-apt-installed-packages)
"install")
for show = (cond ((and deinstall
(memq helm-apt-show-only '(all deinstalled)))
(propertize cand 'face 'helm-apt-deinstalled))
((and install
(memq helm-apt-show-only '(all installed)))
(propertize cand 'face 'helm-apt-installed))
((and (eq helm-apt-show-only 'noinstalled)
(not install)) cand)
((eq helm-apt-show-only 'all) cand))
when show collect show))

(defun helm-apt-show-only-installed ()
(interactive)
Expand Down Expand Up @@ -154,8 +154,8 @@ If nil default `helm-apt-cache-show-1' will be used."
(call-process-shell-command "dpkg --get-selections"
nil (current-buffer))
(cl-loop for i in (split-string (buffer-string) "\n" t)
for p = (split-string i)
collect (cons (car p) (cadr p)))))
for p = (split-string i)
collect (cons (car p) (cadr p)))))
(helm-init-candidates-in-buffer
'global
(setq helm-apt-all-packages
Expand All @@ -175,8 +175,8 @@ package name - description."

(defvar helm-apt-show-current-package nil)
(define-derived-mode helm-apt-show-mode
special-mode "helm-apt-show"
"Mode to display infos on apt packages.")
special-mode "helm-apt-show"
"Mode to display infos on apt packages.")

(defun helm-apt-cache-show (package)
"Show information on apt package PACKAGE."
Expand Down
74 changes: 37 additions & 37 deletions helm-bbdb.el
Expand Up @@ -52,53 +52,53 @@ The format is \"Firstname Lastname\"."
See docstring of `bbdb-create-internal' for more info on address entries."
(cl-loop with loc-list = (cons "[Exit when no more]"
(bbdb-label-completion-list "phones"))
with loc ; Defer count
do (setq loc (helm-comp-read (format "Phone location[%s]: " count)
loc-list
:must-match 'confirm
:default ""))
while (not (string= loc "[Exit when no more]"))
for count from 1
for phone-number = (read-string (format "Phone number (%s): " loc))
collect (vector loc phone-number) into phone-list
do (setq loc-list (remove loc loc-list))
finally return phone-list))
with loc ; Defer count
do (setq loc (helm-comp-read (format "Phone location[%s]: " count)
loc-list
:must-match 'confirm
:default ""))
while (not (string= loc "[Exit when no more]"))
for count from 1
for phone-number = (read-string (format "Phone number (%s): " loc))
collect (vector loc phone-number) into phone-list
do (setq loc-list (remove loc loc-list))
finally return phone-list))

;; TODO move this to helm-utils when finish
(defun helm-read-repeat-string (bbdb--prompt &optional count)
"Prompt as many time PROMPT is not empty.
If COUNT is non--nil add a number after each prompt."
(cl-loop with elm
while (not (string= elm ""))
for n from 1
do (when count
(setq bbdb--prompt (concat bbdb--prompt (int-to-string n) ": ")))
collect (setq elm (read-string bbdb--prompt)) into lis
finally return (remove "" lis)))
while (not (string= elm ""))
for n from 1
do (when count
(setq bbdb--prompt (concat bbdb--prompt (int-to-string n) ": ")))
collect (setq elm (read-string bbdb--prompt)) into lis
finally return (remove "" lis)))

(defun helm-bbdb-read-address ()
"Return a list of vector address objects.
See docstring of `bbdb-create-internal' for more info on address entries."
(cl-loop with loc-list = (cons "[Exit when no more]"
(bbdb-label-completion-list "addresses"))
with loc ; Defer count
do (setq loc (helm-comp-read
(format "Address description[%s]: "
(int-to-string count))
loc-list
:must-match 'confirm
:default ""))
while (not (string= loc "[Exit when no more]"))
for count from 1
;; Create vector
for lines = (helm-read-repeat-string "Line" t)
for city = (read-string "City: ")
for state = (read-string "State: ")
for zip = (read-string "ZipCode: ")
for country = (read-string "Country: ")
collect (vector loc lines city state zip country) into address-list
do (setq loc-list (remove loc loc-list))
finally return address-list))
with loc ; Defer count
do (setq loc (helm-comp-read
(format "Address description[%s]: "
(int-to-string count))
loc-list
:must-match 'confirm
:default ""))
while (not (string= loc "[Exit when no more]"))
for count from 1
;; Create vector
for lines = (helm-read-repeat-string "Line" t)
for city = (read-string "City: ")
for state = (read-string "State: ")
for zip = (read-string "ZipCode: ")
for country = (read-string "Country: ")
collect (vector loc lines city state zip country) into address-list
do (setq loc-list (remove loc loc-list))
finally return address-list))

(defun helm-bbdb-create-contact (actions candidate)
"Action transformer for `helm-source-bbdb'.
Expand Down Expand Up @@ -154,8 +154,8 @@ http://bbdb.sourceforge.net/")
"Return a list of all mail addresses of records in bbdb buffer."
(with-current-buffer bbdb-buffer-name
(cl-loop for i in bbdb-records
if (bbdb-record-net (car i))
collect (bbdb-dwim-net-address (car i)))))
if (bbdb-record-net (car i))
collect (bbdb-dwim-net-address (car i)))))

(defun helm-bbdb-compose-mail (candidate)
"Compose a mail with all records of bbdb buffer."
Expand Down

0 comments on commit e6c3ff1

Please sign in to comment.