Skip to content

Commit e7a589c

Browse files
committed
internal
1 parent 367fe90 commit e7a589c

File tree

1 file changed

+4
-39
lines changed

1 file changed

+4
-39
lines changed

jcs-template.el

Lines changed: 4 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -65,46 +65,11 @@
6565
:group 'jcs-template)
6666

6767
;;
68-
;; (@* "Util" )
68+
;; (@* "Externals" )
6969
;;
7070

71-
;;;###autoload
72-
(defun jcs-current-file-empty-p (&optional fn)
73-
"Check if the FN an empty file."
74-
(if fn (with-current-buffer fn (and (bobp) (eobp)))
75-
(and (bobp) (eobp))))
76-
77-
;;;###autoload
78-
(defun jcs-string-compare-p (regexp str type &optional ignore-case)
79-
"Compare STR with REGEXP by TYPE.
80-
81-
Argument TYPE can be on of the following symbol.
82-
83-
* regex - uses function `string-match-p'. (default)
84-
* strict - uses function `string='.
85-
* prefix - uses function `string-prefix-p'.
86-
* suffix - uses function `string-suffix-p'.
87-
88-
Optional argument IGNORE-CASE is only uses when TYPE is either symbol `prefix'
89-
or `suffix'."
90-
(cl-case type
91-
(`strict (string= regexp str))
92-
(`prefix (string-prefix-p regexp str ignore-case))
93-
(`suffix (string-suffix-p regexp str ignore-case))
94-
(t (ignore-errors (string-match-p regexp str)))))
95-
96-
;;;###autoload
97-
(defun jcs-contain-list-type-str (elt list type &optional reverse)
98-
"Return non-nil if ELT is listed in LIST.
99-
100-
Argument TYPE see function `jcs-string-compare-p' for more information.
101-
102-
If optional argument REVERSE is non-nil, LIST item and ELT argument."
103-
(cl-some
104-
(lambda (elm)
105-
(if reverse (jcs-string-compare-p elt elm type)
106-
(jcs-string-compare-p elm elt type)))
107-
list))
71+
(declare-function jcs-current-file-empty-p "ext:jcs-util.el")
72+
(declare-function jcs-member "ext:jcs-util.el")
10873

10974
;;
11075
;; (@* "Insertion" )
@@ -130,7 +95,7 @@ FAILED is callback if does NOT successfully inserted header content."
13095
(let (result)
13196
(when (and buffer-file-name
13297
(not (file-exists-p buffer-file-name))
133-
(jcs-contain-list-type-str (f-filename buffer-file-name) reg-lst 'regex))
98+
(jcs-member (f-filename buffer-file-name) reg-lst 'regex))
13499
(setq result (jcs-insert-header-if-empty insert-func interactive)))
135100
(if result
136101
(when (functionp success) (funcall success))

0 commit comments

Comments
 (0)