Function: ibuffer-update-saved-filters-format

ibuffer-update-saved-filters-format is a byte-compiled function defined in ibuf-ext.el.gz.

Signature

(ibuffer-update-saved-filters-format FILTERS)

Documentation

Transform alist from old to new ibuffer-saved-filters format.

Specifically, converts old-format alist with values of the form (STRING (FILTER-SPECS...)) to alist with values of the form (STRING FILTER-SPECS...), where each filter spec should be a cons cell with a symbol in the car. Any elements in the latter form are kept as is.

Returns (OLD-FORMAT-DETECTED . UPDATED-SAVED-FILTERS-LIST).

Source Code

;; Defined in /usr/src/emacs/lisp/ibuf-ext.el.gz
(defun ibuffer-update-saved-filters-format (filters)
  "Transform alist from old to new `ibuffer-saved-filters' format.

Specifically, converts old-format alist with values of the
form (STRING (FILTER-SPECS...)) to alist with values of the
form (STRING FILTER-SPECS...), where each filter spec should be a
cons cell with a symbol in the car.  Any elements in the latter
form are kept as is.

Returns (OLD-FORMAT-DETECTED . UPDATED-SAVED-FILTERS-LIST)."
  (when filters
    (let* ((old-format-detected nil)
           (fix-filter (lambda (filter-spec)
                         (if (symbolp (car (cadr filter-spec)))
                             filter-spec
                           (setq old-format-detected t) ; side-effect
                           (cons (car filter-spec) (cadr filter-spec)))))
           (fixed (mapcar fix-filter filters)))
      (cons old-format-detected fixed))))