summaryrefslogtreecommitdiffhomepage
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/net/randomsig.el28
1 files changed, 8 insertions, 20 deletions
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 <hj@backmes.de>
@@ -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