[Top][All Lists]

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

Re: Noob dumb question (extending emacs)

From: Jean Louis
Subject: Re: Noob dumb question (extending emacs)
Date: Fri, 5 Nov 2021 22:03:11 +0300
User-agent: Mutt/2.0.7+183 (3d24855) (2021-05-28)

* Emanuel Berg via Users list for the GNU Emacs text editor 
<> [2021-11-01 05:11]:
> (defun urandom (bits)
>   (interactive "nbits: ")
>   (let*((bytes     (/ bits 8))
>         (bytes-opt (format "--bytes=%s" bytes)) )
>     (with-temp-buffer
>       (set-buffer-multibyte nil)
>       (call-process "head" "/dev/urandom" t nil bytes-opt)
>       (string-to-list
>        (buffer-substring-no-properties (point-min) (point-max)) ))))
> ;; (urandom 100)

I think the above is not portable. And finally, if you use external
program, then you could call `pwgen' directly.


Take action in Free Software Foundation campaigns:

In support of Richard M. Stallman

reply via email to

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