"Move point to the filter group whose name is NAME."
(interactive
(list (ibuffer-read-filter-group-name "Jump to filter group: ")))
- (ibuffer-aif (assoc name (ibuffer-current-filter-groups-with-position))
+ (if-let ((it (assoc name (ibuffer-current-filter-groups-with-position))))
(goto-char (cdr it))
(error "No filter group with name %s" name)))
(interactive (list (ibuffer-read-filter-group-name "Kill filter group: " t)))
(when (equal name "Default")
(error "Can't kill default filter group"))
- (ibuffer-aif (assoc name ibuffer-filter-groups)
+ (if-let ((it (assoc name ibuffer-filter-groups)))
(progn
(push (copy-tree it) ibuffer-filter-group-kill-ring)
(setq ibuffer-filter-groups (ibuffer-remove-alist
"Kill the filter group at point.
See also `ibuffer-kill-filter-group'."
(interactive "P\np")
- (ibuffer-aif (save-excursion
- (ibuffer-forward-line 0)
- (get-text-property (point) 'ibuffer-filter-group-name))
- (progn
- (ibuffer-kill-filter-group it))
- (funcall (if interactive-p #'call-interactively #'funcall)
- #'kill-line arg)))
+ (if-let ((it (save-excursion
+ (ibuffer-forward-line 0)
+ (get-text-property (point) 'ibuffer-filter-group-name))))
+ (ibuffer-kill-filter-group it)
+ (funcall (if interactive-p #'call-interactively #'funcall)
+ #'kill-line arg)))
(defun ibuffer-insert-filter-group-before (newgroup group)
(let* ((found nil)
(list
(read-from-minibuffer "Save current filter groups as: ")
ibuffer-filter-groups)))
- (ibuffer-aif (assoc name ibuffer-saved-filter-groups)
+ (if-let ((it (assoc name ibuffer-saved-filter-groups)))
(setcdr it groups)
(push (cons name groups) ibuffer-saved-filter-groups))
(ibuffer-maybe-save-stuff))
(list
(read-from-minibuffer "Save current filters as: ")
ibuffer-filtering-qualifiers)))
- (ibuffer-aif (assoc name ibuffer-saved-filters)
+ (if-let ((it (assoc name ibuffer-saved-filters)))
(setcdr it filters)
(push (cons name filters) ibuffer-saved-filters))
(ibuffer-maybe-save-stuff))
For a buffer associated with file '/a/b/c.d', this matches
against '/a/b'. For a buffer not associated with a file, this
matches against the value of `default-directory' in that buffer."
- (:description "directory name"
- :reader (read-from-minibuffer "Filter by directory name (regex): "))
- (ibuffer-aif (with-current-buffer buf (ibuffer-buffer-file-name))
- (let ((dirname (file-name-directory it)))
- (when dirname (string-match qualifier dirname)))
+ ( :description "directory name"
+ :reader (read-from-minibuffer "Filter by directory name (regex): "))
+ (if-let ((it (with-current-buffer buf (ibuffer-buffer-file-name))))
+ (when-let ((dirname (file-name-directory it)))
+ (string-match qualifier dirname))
(when default-directory (string-match qualifier default-directory))))
;;;###autoload (autoload 'ibuffer-filter-by-size-gt "ibuf-ext")
(let ((pt (save-excursion
(mouse-set-point event)
(point))))
- (ibuffer-aif (get-text-property (point) 'ibuffer-filter-group-name)
+ (if-let ((it (get-text-property (point) 'ibuffer-filter-group-name)))
(ibuffer-toggle-marks it)
(goto-char pt)
(let ((mark (ibuffer-current-mark)))
If point is on a group name, then this function operates on that
group."
(interactive)
- (ibuffer-aif (get-text-property (point) 'ibuffer-filter-group-name)
- (setq group it))
+ (when-let ((it (get-text-property (point) 'ibuffer-filter-group-name)))
+ (setq group it))
(let ((count
(ibuffer-map-lines
(lambda (_buf mark)
(when (and movement (< movement 0))
(setq arg (- arg)))
(ibuffer-forward-line 0)
- (ibuffer-aif (get-text-property (point) 'ibuffer-filter-group-name)
+ (if-let ((it (get-text-property (point) 'ibuffer-filter-group-name)))
(progn
(require 'ibuf-ext)
(ibuffer-mark-on-buffer #'identity mark it))
;; `ibuffer-inline-columns' alist and insert it
;; into our generated code. Otherwise, we just
;; generate a call to the column function.
- (ibuffer-aif (assq sym ibuffer-inline-columns)
+ (if-let ((it (assq sym ibuffer-inline-columns)))
(nth 1 it)
`(or (,sym buffer mark) "")))
;; You're not expected to understand this. Hell, I
(cond ((zerop total) "No processes")
((= 1 total) "1 process")
(t (format "%d processes" total))))))
- (ibuffer-aif (get-buffer-process buffer)
+ (if-let ((it (get-buffer-process buffer)))
(format "(%s %s)" it (process-status it))
""))
(let ((result
(if (buffer-live-p (ibuffer-current-buffer))
(when (or (null group)
- (ibuffer-aif (get-text-property (point) 'ibuffer-filter-group)
- (equal group it)))
+ (when-let ((it (get-text-property (point) 'ibuffer-filter-group)))
+ (equal group it)))
(save-excursion
(funcall function
(ibuffer-current-buffer)