diff options
Diffstat (limited to 'common.el')
-rw-r--r-- | common.el | 12 |
1 files changed, 12 insertions, 0 deletions
@@ -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. |