Function: toolbarx-separate-options
toolbarx-separate-options is a byte-compiled function defined in
toolbar-x.el.
Signature
(toolbarx-separate-options GROUP-LIST VALID-OPTIONS &optional CHECK)
Documentation
Return a cons cell with non-options and options of GROUP-LIST.
The options-part is the largest tail of the list GROUP-LIST that
has an element of VALID-OPTIONS (the comparation is made with
memq.) The non-options-part is the beginning of GROUP-LIST
less its tail. Return a cons cell which car is the
non-options-part and the cdr is the options-part.
If CHECK is non-nil, the tail is the largest that yield non-nil
when applied to toolbarx-good-option-list-p.
Source Code
;; Defined in ~/.emacs.d/elpa/auctex-14.1.2/toolbar-x.el
(defun toolbarx-separate-options (group-list valid-options &optional check)
"Return a cons cell with non-options and options of GROUP-LIST.
The options-part is the largest tail of the list GROUP-LIST that
has an element of VALID-OPTIONS (the comparation is made with
`memq'.) The non-options-part is the beginning of GROUP-LIST
less its tail. Return a cons cell which `car' is the
non-options-part and the `cdr' is the options-part.
If CHECK is non-nil, the tail is the largest that yield non-nil
when applied to `toolbarx-good-option-list-p'."
(let ((maximal)
(temp))
(dolist (i valid-options)
(setq temp (memq i group-list))
(when (and (> (length temp) (length maximal))
(if check
(toolbarx-good-option-list-p temp valid-options)
t))
(setq maximal (memq i group-list))))
(cons (butlast group-list (length maximal)) maximal)))