From 6eb668e0f6a28efda160f768f9230bf5da8e5702 Mon Sep 17 00:00:00 2001 From: jao Date: Sat, 4 Dec 2021 01:44:59 +0000 Subject: randomsig nit --- lib/net/randomsig.el | 28 ++++++++-------------------- 1 file changed, 8 insertions(+), 20 deletions(-) (limited to 'lib/net') diff --git a/lib/net/randomsig.el b/lib/net/randomsig.el index d07e676..71f31e1 100644 --- a/lib/net/randomsig.el +++ b/lib/net/randomsig.el @@ -1,6 +1,6 @@ ;;; randomsig.el --- insert a randomly selected signature -;; Copyright (C) 2001, 2002, 2013, 2020 Hans-Jürgen Ficker +;; Copyright (C) 2001, 2002, 2013, 2020, 2021 Hans-Jürgen Ficker ;; Emacs Lisp Archive Entry ;; Author: Hans-Juergen Ficker @@ -254,19 +254,11 @@ You probably want to have a newline at the end of it." (unless (fboundp 'line-end-position) (defalias 'line-end-position 'point-at-eol)) -(defun randomsig-mark-active-p () - mark-active) ;; jao: region-active-p is defined in GNU Emacs 23 with - ;; a different meaning -;;; (if (boundp 'region-active-p) - -;;; (region-active-p) ; XEmacs - -;;; mark-active)) ; Gnu Emacs - +(defun randomsig-mark-active-p () mark-active) (require 'cl-lib) -(random t) ; Initialize random seed +(random t) ; Initialize random seed ;;; Helper Functions @@ -274,23 +266,19 @@ You probably want to have a newline at the end of it." ;; return a list of strings (cond ((listp files) files) ((and (symbolp files) - (fboundp files)) (randomsig-files-to-list (funcall files))) + (fboundp files)) + (randomsig-files-to-list (funcall files))) ((and (symbolp files) - (boundp files)) (randomsig-files-to-list (symbol-value files))) + (boundp files)) + (randomsig-files-to-list (symbol-value files))) ((stringp files) (list files)) (t nil))) - (defun randomsig-prompt (&optional prompt) ;; Prompt for a signature file. (let ((files (randomsig-files-to-list randomsig-files))) (completing-read (if prompt prompt "signature: ") - (mapcar 'list files) - nil - nil - (unless (cdr files) (car files)) - randomsig-history))) - + (mapcar 'list files) nil t nil randomsig-history (car files)))) (defun randomsig-read-signatures-to-buffer (buffer-name &optional files) ;; read the signatures into the signature buffer -- cgit v1.2.3