From a681e7f368cfd9294841b11d89bbe624b859272a Mon Sep 17 00:00:00 2001 From: JSDurand Date: Fri, 6 Jan 2023 23:35:46 +0800 Subject: ibuffer: Try to re-invent the wheel of exporting buffers to ibuffer. --- common.el | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'common.el') diff --git a/common.el b/common.el index 94cbe3c..7da6129 100644 --- a/common.el +++ b/common.el @@ -474,6 +474,18 @@ If the length of LS is less than N, then return the whole LS." ((setq i n)))) (reverse result))))) +;;; A helper function to remove the last non-cons-cell `cdr'. + +(defun remove-last-non-nil-cdr (arg) + "Remove the last `cdr' that is not a cons cell." + (let ((temp arg)) + (while (consp temp) + (cond + ((consp (cdr temp))) + ((setcdr temp nil))) + (setq temp (cdr temp)))) + arg) + (provide 'common) ;;; common.el ends here. -- cgit v1.2.3-18-g5258