branch: elpa/helm
commit eb93e39a35243981fc7dfc4c46fa2037bf1eb6f0
Author: Thierry Volpiatto <thie...@posteo.net>
Commit: Thierry Volpiatto <thie...@posteo.net>

    Some other trivial replace of cl-defun
---
 helm-core.el   | 19 ++++++++++---------
 helm-elisp.el  |  6 +++---
 helm-eshell.el |  3 ++-
 helm-grep.el   |  5 +++--
 helm-info.el   |  3 ++-
 helm-mode.el   |  9 +++++----
 helm-net.el    |  2 +-
 helm-occur.el  |  4 ++--
 helm-utils.el  |  3 ++-
 9 files changed, 30 insertions(+), 24 deletions(-)

diff --git a/helm-core.el b/helm-core.el
index 1071ecd3df..2ce80b2c15 100644
--- a/helm-core.el
+++ b/helm-core.el
@@ -2246,9 +2246,7 @@ ATTRIBUTE-NAME."
 (defalias 'helm-attr 'helm-get-attr)
 (make-obsolete 'helm-attr 'helm-get-attr "3.7.0")
 
-(cl-defun helm-set-attr (attribute-name value
-                                       &optional
-                                       (src (helm-get-current-source)))
+(defun helm-set-attr (attribute-name value &optional src)
   "Set the value of ATTRIBUTE-NAME of source SRC to VALUE.
 
 If ATTRIBUTE-NAME doesn't exists in source it is created with
@@ -2256,6 +2254,7 @@ value VALUE.  If SRC is omitted, use current source.  If 
operation
 succeed, return value, otherwise nil.
 
 Using this function is same as using `setf' on `helm-get-attr'."
+  (unless src (setq src (helm-get-current-source)))
   (setf (helm-get-attr attribute-name src) value))
 
 (defalias 'helm-attrset 'helm-set-attr)
@@ -2290,8 +2289,7 @@ function associated to name."
                        (assoc action-or-name actions))))
     (helm-set-attr 'action (delete del-action actions) source)))
 
-(cl-defun helm-add-action-to-source-if (name fn source predicate
-                                             &optional (index 4) test-only)
+(defun helm-add-action-to-source-if (name fn source predicate &optional index 
test-only)
   "Add new action NAME linked to function FN to SOURCE.
 Action NAME will be available when the current candidate matches
 PREDICATE.
@@ -2316,6 +2314,7 @@ when predicate helm-ff-candidates-lisp-p returns non-nil:
                               \\='async-byte-compile-file
                               helm-source-find-files
                               \\='helm-ff-candidates-lisp-p)."
+  (unless index (setq index 4))
   (let* ((actions     (helm-get-attr 'action source 'ignorefn))
          (action-transformers (helm-get-attr 'action-transformer source))
          (new-action  (list (cons name fn)))
@@ -2679,9 +2678,10 @@ IOW Don't use VALUE of previous VAR to set the VALUE of 
next VAR.
 
 
 ;; API helper
-(cl-defun helm-empty-buffer-p (&optional (buffer helm-buffer))
+(defun helm-empty-buffer-p (&optional buffer)
   "Check if BUFFER have candidates.
 Default value for BUFFER is `helm-buffer'."
+  (unless buffer (setq buffer helm-buffer))
   (zerop (buffer-size (and buffer (get-buffer buffer)))))
 
 (defun helm-empty-source-p ()
@@ -4836,12 +4836,12 @@ useful when the order of the candidates is meaningful, 
e.g. with
         (setq display (if mp (concat beg-str (buffer-string) end-str) 
(buffer-string))))
       (if real (cons display real) display))))
 
-(cl-defun helm-fuzzy-default-highlight-match (candidate
-                                              &optional (pattern helm-pattern) 
diacritics file-comp)
+(defun helm-fuzzy-default-highlight-match (candidate &optional pattern 
diacritics file-comp)
   "The default function to highlight matches in fuzzy matching.
 Highlight elements in CANDIDATE matching PATTERN according
 to the matching method in use.  When DIACRITICS is specified, ignore
 diacritics, see `char-fold-to-regexp' for more infos."
+  (unless pattern (setq pattern helm-pattern))
   (if (string= pattern "")
       ;; Empty pattern, do nothing.  This is needed when this function
       ;; is used outside of helm-fuzzy-highlight-matches like in *buffers-list.
@@ -5107,10 +5107,11 @@ candidates in display."
 ;;; Case fold search
 ;;
 ;;
-(cl-defun helm-set-case-fold-search (&optional (pattern helm-pattern))
+(defun helm-set-case-fold-search (&optional pattern)
   "Used to set the value of `case-fold-search' in Helm.
 Return t or nil depending on the value of `helm-case-fold-search'
 and `helm-pattern'."
+  (unless pattern (setq pattern helm-pattern))
   (if helm-alive-p
       (let ((helm-case-fold-search
              (helm-aif (assq 'case-fold-search (helm-get-current-source))
diff --git a/helm-elisp.el b/helm-elisp.el
index 3ad1ea369c..a21dea6b3c 100644
--- a/helm-elisp.el
+++ b/helm-elisp.el
@@ -439,13 +439,13 @@ the same time to variable and a function."
            finally return (sort lst #'helm-generic-sort-fn)))
 
 ;;;###autoload
-(cl-defun helm-get-first-line-documentation (sym &optional
-                                                   (name "describe-function")
-                                                   (end-column 72))
+(defun helm-get-first-line-documentation (sym &optional name end-column)
   "Return first line documentation of symbol SYM truncated at END-COLUMN.
 If SYM is not documented, return \"Not documented\".
 Argument NAME allows specifiying what function to use to display
 documentation when SYM name is the same for function and variable."
+  (unless name (setq name "describe-function"))
+  (unless end-column (setq end-column 72))
   (let ((doc (condition-case _err
                  (helm-acase sym
                    ((guard* (stringp it))
diff --git a/helm-eshell.el b/helm-eshell.el
index 332c745f90..8916cadf0e 100644
--- a/helm-eshell.el
+++ b/helm-eshell.el
@@ -437,8 +437,9 @@ See `helm-eshell-prompts-list'."
 (defun helm-eshell-prompts-all-transformer (candidates)
   (helm-eshell-prompts-transformer candidates t))
 
-(cl-defun helm-eshell-prompts-goto (candidate &optional (action 
'switch-to-buffer))
+(defun helm-eshell-prompts-goto (candidate &optional action)
   ;; Candidate format: ("ls" 162 "*eshell*" 3)
+  (unless action (setq action #'switch-to-buffer))
   (let ((buf (nth 2 candidate)))
     (unless (and (string= (buffer-name) buf)
                  (eq action 'switch-to-buffer))
diff --git a/helm-grep.el b/helm-grep.el
index 3f52705c97..c0f0ab58f9 100644
--- a/helm-grep.el
+++ b/helm-grep.el
@@ -1227,8 +1227,8 @@ of grep."
       (setf (slot-value source 'follow)
             (assoc-default 'follow it))))
 
-(cl-defun helm-do-grep-1 (targets &optional recurse backend exts
-                                  default-input input (source 
'helm-source-grep))
+(defun helm-do-grep-1 (targets &optional recurse backend exts
+                                  default-input input source)
   "Launch helm using backend BACKEND on a list of TARGETS files.
 
 When RECURSE is given and BACKEND is \\='grep' use -r option of
@@ -1252,6 +1252,7 @@ It is used currently to specify \\='zgrep' or \\='git'.
 When BACKEND \\='zgrep' is used don't prompt for a choice in
 recurse, and ignore EXTS, search being made recursively on files
 matching `helm-zgrep-file-extension-regexp' only."
+  (unless source (setq source 'helm-source-grep))
   (let* (non-essential
          (ack-rec-p (helm-grep-use-ack-p :where 'recursive))
          (exts (and recurse
diff --git a/helm-info.el b/helm-info.el
index df0fd7b38a..b6575fcbd5 100644
--- a/helm-info.el
+++ b/helm-info.el
@@ -59,10 +59,11 @@ files with `helm-info-at-point'."
 
 ;;; Build info-index sources with `helm-info-source' class.
 
-(cl-defun helm-info-init (&optional (file (helm-get-attr 'info-file)))
+(defun helm-info-init (&optional file)
   "Initialize candidates for info FILE.
 If FILE have nodes, loop through all nodes and accumulate candidates
 found in each node, otherwise scan only the current info buffer."
+  (unless file (setq file (helm-get-attr 'info-file)))
   ;; Allow reinit candidate buffer when using edebug.
   (helm-aif (and debug-on-error
                  (helm-candidate-buffer))
diff --git a/helm-mode.el b/helm-mode.el
index 5b2cce3bd3..970bb98682 100644
--- a/helm-mode.el
+++ b/helm-mode.el
@@ -468,9 +468,8 @@ to use a list as return value when `helm-mode' is enabled, 
e.g.
   (let ((debug-on-quit nil))
     (signal 'quit nil)))
 
-(cl-defun helm-comp-read-get-candidates (collection &optional
-                                                    test sort-fn alistp
-                                                    (input helm-pattern))
+(defun helm-comp-read-get-candidates (collection
+                                      &optional test sort-fn alistp input)
   "Convert COLLECTION to list removing elements that don't match TEST.
 See `helm-comp-read' about supported COLLECTION arguments.
 
@@ -510,6 +509,7 @@ with an empty string as value for `helm-pattern' because
 data would not be fully collected at init time.
 
 If COLLECTION is an `obarray', a TEST should be needed. See `obarray'."
+  (unless input (setq input helm-pattern))
   ;; Ensure COLLECTION is computed from `helm-current-buffer'
   ;; because some functions used as COLLECTION work
   ;; only in the context of current-buffer (Bug#1030) .
@@ -572,7 +572,8 @@ If COLLECTION is an `obarray', a TEST should be needed. See 
`obarray'."
                  (t (all-completions input collection test)))))
       (if sort-fn (sort cands sort-fn) cands))))
 
-(cl-defun helm-cr--pattern-in-candidates-p (candidates &optional (pattern 
helm-pattern))
+(defun helm-cr--pattern-in-candidates-p (candidates &optional pattern)
+  (unless pattern (setq pattern helm-pattern))
   (or (assoc pattern candidates)
       (assoc (concat " " pattern) candidates)
       (assq (intern pattern) candidates)
diff --git a/helm-net.el b/helm-net.el
index 98baa66755..d206bc3e3f 100644
--- a/helm-net.el
+++ b/helm-net.el
@@ -283,7 +283,7 @@ Can be \"--new-tab\" (default), \"--new-window\" or 
\"--private-window\"."
     ("emacs" . eww-browse-url))
   "Alist of (browse_url_variable . function) to try to find a suitable url 
browser.")
 
-(cl-defun helm-generic-browser (url cmd-name &rest args)
+(defun helm-generic-browser (url cmd-name &rest args)
   "Browse URL with NAME browser."
   (let ((proc (concat cmd-name " " url)))
     (message "Starting %s..." cmd-name)
diff --git a/helm-occur.el b/helm-occur.el
index fc1486a3e7..912e238aa4 100644
--- a/helm-occur.el
+++ b/helm-occur.el
@@ -458,11 +458,11 @@ without having to delete its contents before."
 
 ;;; Actions
 ;;
-(cl-defun helm-occur-action (lineno
-                                  &optional (method (quote buffer)))
+(defun helm-occur-action (lineno &optional method)
   "Jump to line number LINENO with METHOD.
 METHOD can be one of buffer, buffer-other-window, buffer-other-frame."
   (require 'helm-grep)
+  (unless method (setq method 'buffer))
   (let ((buf (if (eq major-mode 'helm-occur-mode)
                  (get-text-property (point) 'buffer-name)
                (helm-get-attr 'buffer-name)))
diff --git a/helm-utils.el b/helm-utils.el
index f6496fbff5..29d6ec8200 100644
--- a/helm-utils.el
+++ b/helm-utils.el
@@ -700,11 +700,12 @@ that is sorting is done against real value of candidate."
            (< (length str1) (length str2)))
           (t (> sc3 sc4)))))
 
-(cl-defun helm-file-human-size (size &optional (kbsize helm-default-kbsize))
+(defun helm-file-human-size (size &optional kbsize)
   "Return a string showing SIZE of a file in human readable form.
 SIZE can be an integer or a float depending on it's value.
 `file-attributes' will take care of that to avoid overflow error.
 KBSIZE is a floating point number, defaulting to `helm-default-kbsize'."
+  (unless kbsize (setq kbsize helm-default-kbsize))
   (cl-loop with result = (cons "B" size)
            for i in '("k" "M" "G" "T" "P" "E" "Z" "Y")
            while (>= (cdr result) kbsize)

Reply via email to