(let ((children-chart (allout-chart-subtree 1)))
(if (listp (car children-chart))
;; whoops:
- (setq children-chart (allout-flatten children-chart)))
+ (setq children-chart (flatten-tree children-chart)))
(save-excursion
(dolist (child-point children-chart)
(goto-char child-point)
(apply 'concat
(mapcar (lambda (char) (if (= char ?%) "%%" (char-to-string char)))
string)))
-;;;_ : lists
-;;;_ > allout-flatten (list)
-(defun allout-flatten (list)
- "Return a list of all atoms in list."
- ;; classic.
- (cond ((null list) nil)
- ((atom (car list)) (cons (car list) (allout-flatten (cdr list))))
- (t (append (allout-flatten (car list)) (allout-flatten (cdr list))))))
+(define-obsolete-function-alias 'allout-flatten #'flatten-tree "27.1")
;;;_ : Compatibility:
;;;_ : xemacs undo-in-progress provision:
(unless (boundp 'undo-in-progress)
ret)
l)))
-(defun org-protocol-flatten (list)
- "Transform LIST into a flat list.
+(if (fboundp 'flatten-tree)
+ (defalias 'org-protocol-flatten 'flatten-tree)
+ (defun org-protocol-flatten (list)
+ "Transform LIST into a flat list.
Greedy handlers might receive a list like this from emacsclient:
\((\"/dir/org-protocol:/greedy:/~/path1\" (23 . 12)) (\"/dir/param\"))
where \"/dir/\" is the absolute path to emacsclients working directory.
This function transforms it into a flat list."
- (if (null list) ()
- (if (listp list)
- (append (org-protocol-flatten (car list)) (org-protocol-flatten (cdr list)))
- (list list))))
+ (if (null list) ()
+ (if (listp list)
+ (append (org-protocol-flatten (car list))
+ (org-protocol-flatten (cdr list)))
+ (list list)))))
(defun org-protocol-parse-parameters (info &optional new-style default-order)
"Return a property list of parameters from INFO.
result))
(nreverse result)))
-(defun hif-flatten (l)
- "Flatten a tree."
- (apply #'nconc
- (mapcar (lambda (x) (if (listp x)
- (hif-flatten x)
- (list x))) l)))
+(define-obsolete-function-alias 'hif-flatten #'flatten-tree "27.1")
(defun hif-expand-token-list (tokens &optional macroname expand_list)
"Perform expansion on TOKENS till everything expanded.
expanded))
- (hif-flatten (nreverse expanded)))))
+ (flatten-tree (nreverse expanded)))))
(defun hif-parse-exp (token-list &optional macroname)
"Parse the TOKEN-LIST.
(setq actual-parms (cdr actual-parms)))
;; Replacement completed, flatten the whole token list
- (setq macro-body (hif-flatten macro-body))
+ (setq macro-body (flatten-tree macro-body))
;; Stringification and token concatenation happens here
(hif-token-concatenation (hif-token-stringification macro-body)))))
"Parse state at `js--last-parse-pos'.")
(make-variable-buffer-local 'js--state-at-last-parse-pos)
-(define-obsolete-function-alias 'js--flatten-list #'flatten-tree "27.1")
-
(defun js--maybe-join (prefix separator suffix &rest list)
"Helper function for `js--update-quick-match-re'.
If LIST contains any element that is not nil, return its non-nil