help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Keywords as function arguments for control flow


From: Jean Louis
Subject: Re: Keywords as function arguments for control flow
Date: Sat, 30 Nov 2024 17:37:29 +0300
User-agent: K-9 Mail for Android

(defun cuprat (args)
  (let ((seqr (plist-get args :seqr)))
    (cond
     ((eq seqr 'global) (global-whitespace-mode 1))  ;; if seqr is 'global
     (t (whitespace-mode 1)))))                      ;; default case for other 
values

(cuprat '(:seqr global))  ;; Pass the :seqr keyword as part of the plist
(cuprat '(:seqr other))   ;; Pass the :seqr keyword with a different value

Jean



reply via email to

[Prev in Thread] Current Thread [Next in Thread]