1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-15 10:30:25 -08:00

Some more flatten-tree aliases

* lisp/allout.el (allout-flatten):
* lisp/progmodes/hideif.el (hif-flatten):
Now an obsolete alias for flatten-tree.  All callers changed.
* lisp/org/org-protocol.el (org-protocol-flatten):
Make it an alias for flatten-tree if available.
* lisp/progmodes/js.el (js--flatten-list):
Remove alias.  We shouldn’t need obsolete function aliases for
private functions.
This commit is contained in:
Paul Eggert 2018-12-17 10:19:23 -08:00
parent a5995a326d
commit ef144113f3
4 changed files with 14 additions and 25 deletions

View file

@ -4351,7 +4351,7 @@ subtopics into siblings of the item."
(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)
@ -6547,14 +6547,7 @@ If BEG is bigger than END we return 0."
(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)

View file

@ -349,17 +349,20 @@ returned list."
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.

View file

@ -672,12 +672,7 @@ that form should be displayed.")
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.
@ -748,7 +743,7 @@ detecting self-reference."
expanded))
(hif-flatten (nreverse expanded)))))
(flatten-tree (nreverse expanded)))))
(defun hif-parse-exp (token-list &optional macroname)
"Parse the TOKEN-LIST.
@ -1166,7 +1161,7 @@ preprocessing token"
(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)))))

View file

@ -623,8 +623,6 @@ then the \".\"s will be lined up:
"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