[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/autocrypt 709dc5b3bf 70/94: Add default return value fo
From: |
ELPA Syncer |
Subject: |
[elpa] externals/autocrypt 709dc5b3bf 70/94: Add default return value for autocrypt-make-function |
Date: |
Sun, 26 Mar 2023 07:58:01 -0400 (EDT) |
branch: externals/autocrypt
commit 709dc5b3bf5963f527006cbd504e7d6d558562db
Author: Philip Kaludercic <philipk@posteo.net>
Commit: Philip Kaludercic <philipk@posteo.net>
Add default return value for autocrypt-make-function
---
autocrypt.el | 20 +++++++++++---------
1 file changed, 11 insertions(+), 9 deletions(-)
diff --git a/autocrypt.el b/autocrypt.el
index 466162276b..0fe2ba0e40 100644
--- a/autocrypt.el
+++ b/autocrypt.el
@@ -146,15 +146,17 @@ found."
(unless silent
(error "Missing %S implementation for %S" command backend))))))
-(defun autocrypt-make-function (command signature &optional silent)
+(defun autocrypt-make-function (command signature &optional default)
"Return a function to handle COMMAND.
-The advertised calling convention is set to SIGNATURE. If SILENT
-is non-nil, return nil when no implementation could be found."
- (let ((f (lambda (&rest args)
- (let ((fn (autocrypt-find-function command silent)))
- (and fn (apply fn args))))))
- (set-advertised-calling-convention f signature nil)
- f))
+The advertised calling convention is set to SIGNATURE. If
+DEFAULT is non-nil, return DEFAULT when no implementation could
+be found."
+ (let ((fn (lambda (&rest args)
+ (let* ((silent (not (null default)))
+ (fn (autocrypt-find-function command silent)))
+ (if fn (apply fn args) default)))))
+ (set-advertised-calling-convention fn signature nil)
+ fn))
(defalias 'autocrypt-install (autocrypt-make-function 'install '())
"Install necessary autocrypt functions into the MUA.")
@@ -180,7 +182,7 @@ is non-nil, return nil when no implementation could be
found."
(defalias 'autocrypt-encrypted-p (autocrypt-make-function 'encrypted-p '())
"Check the the current message is encrypted.")
-(defalias 'autocrypt-get-part (autocrypt-make-function 'get-part '(index) t)
+(defalias 'autocrypt-get-part (autocrypt-make-function 'get-part '(index) 'n/a)
"Return the INDEX'th part of the current message.")
- [elpa] externals/autocrypt 3ad5baba83 90/94: Add auto-generated package.el files to .gitignore, (continued)
- [elpa] externals/autocrypt 3ad5baba83 90/94: Add auto-generated package.el files to .gitignore, ELPA Syncer, 2023/03/26
- [elpa] externals/autocrypt 82ceacb63c 13/94: fixed package-lint issues, ELPA Syncer, 2023/03/26
- [elpa] externals/autocrypt 354b339cfe 16/94: fixed or removed (require 'autocrypt) statements, ELPA Syncer, 2023/03/26
- [elpa] externals/autocrypt 2f94c4398f 22/94: encrypt message before composing if possible, ELPA Syncer, 2023/03/26
- [elpa] externals/autocrypt 13f31c7e45 45/94: Fix autocrypt-rmail, ELPA Syncer, 2023/03/26
- [elpa] externals/autocrypt 8bdddf38ff 48/94: Save autocrypt data when modified, ELPA Syncer, 2023/03/26
- [elpa] externals/autocrypt 173d7616a8 49/94: Don't save value of autocrypt-saved-version, ELPA Syncer, 2023/03/26
- [elpa] externals/autocrypt 72c903656e 50/94: Attempt to only save autocrypt file if necessary, ELPA Syncer, 2023/03/26
- [elpa] externals/autocrypt 40b7576aad 54/94: Print the autocrypt version into the autocrypt file, ELPA Syncer, 2023/03/26
- [elpa] externals/autocrypt cd290fc1cb 65/94: Modify the local hook values in autocrypt-mu4e--uninstall, ELPA Syncer, 2023/03/26
- [elpa] externals/autocrypt 709dc5b3bf 70/94: Add default return value for autocrypt-make-function,
ELPA Syncer <=
- [elpa] externals/autocrypt 25513ed635 71/94: Simplify autocrypt-find-function symbol searching, ELPA Syncer, 2023/03/26
- [elpa] externals/autocrypt 81c88ab90e 86/94: Remove setup example from the README, ELPA Syncer, 2023/03/26
- [elpa] externals/autocrypt 957232314a 87/94: Avoid usage of 'defsubst' where unnecessary, ELPA Syncer, 2023/03/26
- [elpa] externals/autocrypt ebfe1129f6 91/94: Recommend GNU ELPA as installation archive, ELPA Syncer, 2023/03/26