diff options
| author | Andrea Corallo | 2020-07-15 23:13:59 +0200 |
|---|---|---|
| committer | Andrea Corallo | 2020-07-15 23:13:59 +0200 |
| commit | 907618b3b51a653d111d7f5764da586fcee6da5e (patch) | |
| tree | ddde8eb9f40da415fc7699d16948eb9638804588 | |
| parent | 2c2cc21f1be721e5ba30fa22aedeb5c254791193 (diff) | |
| parent | 85eaa8373bb0a91013af503d333670788ec5a956 (diff) | |
| download | emacs-907618b3b51a653d111d7f5764da586fcee6da5e.tar.gz emacs-907618b3b51a653d111d7f5764da586fcee6da5e.zip | |
Merge remote-tracking branch 'savahnna/master' into HEAD
| -rw-r--r-- | doc/emacs/mule.texi | 2 | ||||
| -rw-r--r-- | doc/lispref/modes.texi | 2 | ||||
| -rw-r--r-- | etc/NEWS | 2 | ||||
| -rw-r--r-- | lisp/descr-text.el | 19 | ||||
| -rw-r--r-- | lisp/emacs-lisp/eldoc.el | 17 | ||||
| -rw-r--r-- | lisp/epa-dired.el | 44 | ||||
| -rw-r--r-- | lisp/epa-file.el | 30 | ||||
| -rw-r--r-- | lisp/epa-hook.el | 11 | ||||
| -rw-r--r-- | lisp/epa.el | 39 | ||||
| -rw-r--r-- | lisp/epg-config.el | 14 |
10 files changed, 89 insertions, 91 deletions
diff --git a/doc/emacs/mule.texi b/doc/emacs/mule.texi index 0f07d286cda..6eff0ca0d22 100644 --- a/doc/emacs/mule.texi +++ b/doc/emacs/mule.texi | |||
| @@ -202,7 +202,7 @@ terminal, the code(s) sent to the terminal. | |||
| 202 | @item | 202 | @item |
| 203 | If the character was composed on display with any following characters | 203 | If the character was composed on display with any following characters |
| 204 | to form one or more grapheme clusters, the composition information: | 204 | to form one or more grapheme clusters, the composition information: |
| 205 | the font glyphs if the frame is on a graphical display, else the | 205 | the font glyphs if the frame is on a graphical display, and the |
| 206 | characters that were composed. | 206 | characters that were composed. |
| 207 | 207 | ||
| 208 | @item | 208 | @item |
diff --git a/doc/lispref/modes.texi b/doc/lispref/modes.texi index 17e96079ab9..33a07c9fb4d 100644 --- a/doc/lispref/modes.texi +++ b/doc/lispref/modes.texi | |||
| @@ -469,7 +469,7 @@ variable @code{imenu-generic-expression}, for the two variables | |||
| 469 | @code{imenu-create-index-function} (@pxref{Imenu}). | 469 | @code{imenu-create-index-function} (@pxref{Imenu}). |
| 470 | 470 | ||
| 471 | @item | 471 | @item |
| 472 | The mode can tell Eldoc mode how to retrieve different types of | 472 | The mode can tell ElDoc mode how to retrieve different types of |
| 473 | documentation for whatever is at point, by adding one or more | 473 | documentation for whatever is at point, by adding one or more |
| 474 | buffer-local entries to the special hook | 474 | buffer-local entries to the special hook |
| 475 | @code{eldoc-documentation-functions}. | 475 | @code{eldoc-documentation-functions}. |
| @@ -263,7 +263,7 @@ obsolete. | |||
| 263 | 263 | ||
| 264 | *** 'eldoc-echo-area-use-multiline-p' is now handled by ElDoc. | 264 | *** 'eldoc-echo-area-use-multiline-p' is now handled by ElDoc. |
| 265 | The user option 'eldoc-echo-area-use-multiline-p' is now handled | 265 | The user option 'eldoc-echo-area-use-multiline-p' is now handled |
| 266 | by the Eldoc library itself. Functions in | 266 | by the ElDoc library itself. Functions in |
| 267 | 'eldoc-documentation-functions' don't need to worry about consulting | 267 | 'eldoc-documentation-functions' don't need to worry about consulting |
| 268 | it when producing a doc string. | 268 | it when producing a doc string. |
| 269 | 269 | ||
diff --git a/lisp/descr-text.el b/lisp/descr-text.el index 4de1a7b7005..be5e01435a7 100644 --- a/lisp/descr-text.el +++ b/lisp/descr-text.el | |||
| @@ -775,13 +775,16 @@ The character information includes: | |||
| 775 | (setq glyph (lgstring-glyph gstring from))) | 775 | (setq glyph (lgstring-glyph gstring from))) |
| 776 | (insert (format " %S\n" glyph)) | 776 | (insert (format " %S\n" glyph)) |
| 777 | (setq from (1+ from))) | 777 | (setq from (1+ from))) |
| 778 | (insert "from these character(s):\n") | 778 | (when (and (stringp (car composition)) |
| 779 | (dotimes (i (lgstring-char-len gstring)) | 779 | (string-match "\"\\([^\"]+\\)\"" (car composition))) |
| 780 | (let ((char (lgstring-char gstring i))) | 780 | (insert "with these character(s):\n") |
| 781 | (insert (format " %c (#x%x) %s\n" | 781 | (let ((chars (match-string 1 (car composition)))) |
| 782 | char char | 782 | (dotimes (i (length chars)) |
| 783 | (get-char-code-property | 783 | (let ((char (aref chars i))) |
| 784 | char 'name)))))) | 784 | (insert (format " %c (#x%x) %s\n" |
| 785 | char char | ||
| 786 | (get-char-code-property | ||
| 787 | char 'name)))))))) | ||
| 785 | ;; TTY frame: show composition in terms of characters. | 788 | ;; TTY frame: show composition in terms of characters. |
| 786 | (insert " by these characters:\n") | 789 | (insert " by these characters:\n") |
| 787 | (while (and (<= from to) | 790 | (while (and (<= from to) |
| @@ -950,7 +953,7 @@ This function can be used as a value of | |||
| 950 | ;; instead of returning a string tailored here for the echo area | 953 | ;; instead of returning a string tailored here for the echo area |
| 951 | ;; exclusively, we could call the (now unused) argument | 954 | ;; exclusively, we could call the (now unused) argument |
| 952 | ;; _CALLBACK with hints on how to shorten the string if needed, | 955 | ;; _CALLBACK with hints on how to shorten the string if needed, |
| 953 | ;; or with multiple usable strings which Eldoc picks according | 956 | ;; or with multiple usable strings which ElDoc picks according |
| 954 | ;; to its space contraints. | 957 | ;; to its space contraints. |
| 955 | (describe-char-eldoc--format | 958 | (describe-char-eldoc--format |
| 956 | ch | 959 | ch |
diff --git a/lisp/emacs-lisp/eldoc.el b/lisp/emacs-lisp/eldoc.el index 1dd0ea2942d..510dff9ed0b 100644 --- a/lisp/emacs-lisp/eldoc.el +++ b/lisp/emacs-lisp/eldoc.el | |||
| @@ -92,7 +92,7 @@ echo area must be resized to fit. | |||
| 92 | 92 | ||
| 93 | If value is a number (integer or floating point), it has the | 93 | If value is a number (integer or floating point), it has the |
| 94 | semantics of `max-mini-window-height', constraining the resizing | 94 | semantics of `max-mini-window-height', constraining the resizing |
| 95 | for Eldoc purposes only. | 95 | for ElDoc purposes only. |
| 96 | 96 | ||
| 97 | Any resizing respects `max-mini-window-height'. | 97 | Any resizing respects `max-mini-window-height'. |
| 98 | 98 | ||
| @@ -112,9 +112,9 @@ single line of display in the echo area." | |||
| 112 | line" truncate-sym-name-if-fit))) | 112 | line" truncate-sym-name-if-fit))) |
| 113 | 113 | ||
| 114 | (defcustom eldoc-prefer-doc-buffer nil | 114 | (defcustom eldoc-prefer-doc-buffer nil |
| 115 | "Prefer Eldoc's documentation buffer if it is showing in some frame. | 115 | "Prefer ElDoc's documentation buffer if it is showing in some frame. |
| 116 | If this variable's value is t and a piece of documentation needs | 116 | If this variable's value is t and a piece of documentation needs |
| 117 | to be truncated to fit in the echo area, do so if Eldoc's | 117 | to be truncated to fit in the echo area, do so if ElDoc's |
| 118 | documentation buffer is not already showing, since the buffer | 118 | documentation buffer is not already showing, since the buffer |
| 119 | always holds the full documentation." | 119 | always holds the full documentation." |
| 120 | :type 'boolean) | 120 | :type 'boolean) |
| @@ -495,8 +495,9 @@ Honor most of `eldoc-echo-area-use-multiline-p'." | |||
| 495 | (substitute-command-keys "\\[eldoc-doc-buffer]"))))))))) | 495 | (substitute-command-keys "\\[eldoc-doc-buffer]"))))))))) |
| 496 | ((= available 1) | 496 | ((= available 1) |
| 497 | ;; Truncate "brutally." ; FIXME: use `eldoc-prefer-doc-buffer' too? | 497 | ;; Truncate "brutally." ; FIXME: use `eldoc-prefer-doc-buffer' too? |
| 498 | (truncate-string-to-width | 498 | (with-current-buffer (eldoc-doc-buffer) |
| 499 | (buffer-substring (point-min) (line-end-position 1)) width))))) | 499 | (truncate-string-to-width |
| 500 | (buffer-substring (point-min) (line-end-position 1)) width)))))) | ||
| 500 | (when echo-area-message | 501 | (when echo-area-message |
| 501 | (eldoc--message echo-area-message)))))) | 502 | (eldoc--message echo-area-message)))))) |
| 502 | 503 | ||
| @@ -539,11 +540,11 @@ Meant as a value for `eldoc-documentation-strategy'." | |||
| 539 | (if (stringp str) (funcall callback str)) | 540 | (if (stringp str) (funcall callback str)) |
| 540 | nil)))) | 541 | nil)))) |
| 541 | 542 | ||
| 542 | ;; JT@2020-07-10: Eldoc is pre-loaded, so in in Emacs < 28 we can't | 543 | ;; JT@2020-07-10: ElDoc is pre-loaded, so in Emacs < 28 we can't |
| 543 | ;; make the "old" `eldoc-documentation-function' point to the new | 544 | ;; make the "old" `eldoc-documentation-function' point to the new |
| 544 | ;; `eldoc-documentation-strategy', so we do the reverse. This allows | 545 | ;; `eldoc-documentation-strategy', so we do the reverse. This allows |
| 545 | ;; for Eldoc to be loaded in those older Emacs versions and work with | 546 | ;; for ElDoc to be loaded in those older Emacs versions and work with |
| 546 | ;; whomever (major-modes, extensions, ueser) sets one of the other | 547 | ;; whomever (major-modes, extensions, user) sets one or the other |
| 547 | ;; variable. | 548 | ;; variable. |
| 548 | (defmacro eldoc--documentation-strategy-defcustom | 549 | (defmacro eldoc--documentation-strategy-defcustom |
| 549 | (main secondary value docstring &rest more) | 550 | (main secondary value docstring &rest more) |
diff --git a/lisp/epa-dired.el b/lisp/epa-dired.el index f601d426566..9269ea97070 100644 --- a/lisp/epa-dired.el +++ b/lisp/epa-dired.el | |||
| @@ -29,48 +29,40 @@ | |||
| 29 | (defun epa-dired-do-decrypt () | 29 | (defun epa-dired-do-decrypt () |
| 30 | "Decrypt marked files." | 30 | "Decrypt marked files." |
| 31 | (interactive) | 31 | (interactive) |
| 32 | (let ((file-list (dired-get-marked-files))) | 32 | (dolist (file (dired-get-marked-files)) |
| 33 | (while file-list | 33 | (epa-decrypt-file (expand-file-name file))) |
| 34 | (epa-decrypt-file (expand-file-name (car file-list))) | 34 | (revert-buffer)) |
| 35 | (setq file-list (cdr file-list))) | ||
| 36 | (revert-buffer))) | ||
| 37 | 35 | ||
| 38 | ;;;###autoload | 36 | ;;;###autoload |
| 39 | (defun epa-dired-do-verify () | 37 | (defun epa-dired-do-verify () |
| 40 | "Verify marked files." | 38 | "Verify marked files." |
| 41 | (interactive) | 39 | (interactive) |
| 42 | (let ((file-list (dired-get-marked-files))) | 40 | (dolist (file (dired-get-marked-files)) |
| 43 | (while file-list | 41 | (epa-verify-file (expand-file-name file)))) |
| 44 | (epa-verify-file (expand-file-name (car file-list))) | ||
| 45 | (setq file-list (cdr file-list))))) | ||
| 46 | 42 | ||
| 47 | ;;;###autoload | 43 | ;;;###autoload |
| 48 | (defun epa-dired-do-sign () | 44 | (defun epa-dired-do-sign () |
| 49 | "Sign marked files." | 45 | "Sign marked files." |
| 50 | (interactive) | 46 | (interactive) |
| 51 | (let ((file-list (dired-get-marked-files))) | 47 | (dolist (file (dired-get-marked-files)) |
| 52 | (while file-list | 48 | (epa-sign-file |
| 53 | (epa-sign-file | 49 | (expand-file-name file) |
| 54 | (expand-file-name (car file-list)) | 50 | (epa-select-keys (epg-make-context) "Select keys for signing. |
| 55 | (epa-select-keys (epg-make-context) "Select keys for signing. | ||
| 56 | If no one is selected, default secret key is used. " | 51 | If no one is selected, default secret key is used. " |
| 57 | nil t) | 52 | nil t) |
| 58 | (y-or-n-p "Make a detached signature? ")) | 53 | (y-or-n-p "Make a detached signature? "))) |
| 59 | (setq file-list (cdr file-list))) | 54 | (revert-buffer)) |
| 60 | (revert-buffer))) | ||
| 61 | 55 | ||
| 62 | ;;;###autoload | 56 | ;;;###autoload |
| 63 | (defun epa-dired-do-encrypt () | 57 | (defun epa-dired-do-encrypt () |
| 64 | "Encrypt marked files." | 58 | "Encrypt marked files." |
| 65 | (interactive) | 59 | (interactive) |
| 66 | (let ((file-list (dired-get-marked-files))) | 60 | (dolist (file (dired-get-marked-files)) |
| 67 | (while file-list | 61 | (epa-encrypt-file |
| 68 | (epa-encrypt-file | 62 | (expand-file-name file) |
| 69 | (expand-file-name (car file-list)) | 63 | (epa-select-keys (epg-make-context) "Select recipients for encryption. |
| 70 | (epa-select-keys (epg-make-context) "Select recipients for encryption. | 64 | If no one is selected, symmetric encryption will be performed. "))) |
| 71 | If no one is selected, symmetric encryption will be performed. ")) | 65 | (revert-buffer)) |
| 72 | (setq file-list (cdr file-list))) | ||
| 73 | (revert-buffer))) | ||
| 74 | 66 | ||
| 75 | (provide 'epa-dired) | 67 | (provide 'epa-dired) |
| 76 | 68 | ||
diff --git a/lisp/epa-file.el b/lisp/epa-file.el index dedf20b0d77..20043a9eae4 100644 --- a/lisp/epa-file.el +++ b/lisp/epa-file.el | |||
| @@ -40,9 +40,9 @@ Note that this option has no effect if you use GnuPG 2.0." | |||
| 40 | (defcustom epa-file-select-keys nil | 40 | (defcustom epa-file-select-keys nil |
| 41 | "Control whether or not to pop up the key selection dialog. | 41 | "Control whether or not to pop up the key selection dialog. |
| 42 | 42 | ||
| 43 | If t, always asks user to select recipients. | 43 | If t, always ask user to select recipients. |
| 44 | If nil, query user only when `epa-file-encrypt-to' is not set. | 44 | If nil, query user only when `epa-file-encrypt-to' is not set. |
| 45 | If neither t nor nil, doesn't ask user. In this case, symmetric | 45 | If neither t nor nil, don't ask user. In this case, symmetric |
| 46 | encryption is used." | 46 | encryption is used." |
| 47 | :type '(choice (const :tag "Ask always" t) | 47 | :type '(choice (const :tag "Ask always" t) |
| 48 | (const :tag "Ask when recipients are not set" nil) | 48 | (const :tag "Ask when recipients are not set" nil) |
| @@ -51,16 +51,6 @@ encryption is used." | |||
| 51 | 51 | ||
| 52 | (defvar epa-file-passphrase-alist nil) | 52 | (defvar epa-file-passphrase-alist nil) |
| 53 | 53 | ||
| 54 | (eval-and-compile | ||
| 55 | (if (fboundp 'encode-coding-string) | ||
| 56 | (defalias 'epa-file--encode-coding-string 'encode-coding-string) | ||
| 57 | (defalias 'epa-file--encode-coding-string 'identity))) | ||
| 58 | |||
| 59 | (eval-and-compile | ||
| 60 | (if (fboundp 'decode-coding-string) | ||
| 61 | (defalias 'epa-file--decode-coding-string 'decode-coding-string) | ||
| 62 | (defalias 'epa-file--decode-coding-string 'identity))) | ||
| 63 | |||
| 64 | (defun epa-file-passphrase-callback-function (context key-id file) | 54 | (defun epa-file-passphrase-callback-function (context key-id file) |
| 65 | (if (and epa-file-cache-passphrase-for-symmetric-encryption | 55 | (if (and epa-file-cache-passphrase-for-symmetric-encryption |
| 66 | (eq key-id 'SYM)) | 56 | (eq key-id 'SYM)) |
| @@ -71,8 +61,8 @@ encryption is used." | |||
| 71 | (or (copy-sequence (cdr entry)) | 61 | (or (copy-sequence (cdr entry)) |
| 72 | (progn | 62 | (progn |
| 73 | (unless entry | 63 | (unless entry |
| 74 | (setq entry (list file) | 64 | (setq entry (list file)) |
| 75 | epa-file-passphrase-alist | 65 | (setq epa-file-passphrase-alist |
| 76 | (cons entry | 66 | (cons entry |
| 77 | epa-file-passphrase-alist))) | 67 | epa-file-passphrase-alist))) |
| 78 | (setq passphrase (epa-passphrase-callback-function context | 68 | (setq passphrase (epa-passphrase-callback-function context |
| @@ -236,11 +226,7 @@ encryption is used." | |||
| 236 | (setq file (expand-file-name file)) | 226 | (setq file (expand-file-name file)) |
| 237 | (let* ((coding-system (or coding-system-for-write | 227 | (let* ((coding-system (or coding-system-for-write |
| 238 | (if (fboundp 'select-safe-coding-system) | 228 | (if (fboundp 'select-safe-coding-system) |
| 239 | ;; This is needed since Emacs 22 has | 229 | (let ((buffer-file-name file)) |
| 240 | ;; no-conversion setting for *.gpg in | ||
| 241 | ;; `auto-coding-alist'. | ||
| 242 | (let ((buffer-file-name | ||
| 243 | (file-name-sans-extension file))) | ||
| 244 | (select-safe-coding-system | 230 | (select-safe-coding-system |
| 245 | (point-min) (point-max))) | 231 | (point-min) (point-max))) |
| 246 | buffer-file-coding-system))) | 232 | buffer-file-coding-system))) |
| @@ -266,7 +252,7 @@ encryption is used." | |||
| 266 | (epg-encrypt-string | 252 | (epg-encrypt-string |
| 267 | context | 253 | context |
| 268 | (if (stringp start) | 254 | (if (stringp start) |
| 269 | (epa-file--encode-coding-string start coding-system) | 255 | (encode-coding-string start coding-system) |
| 270 | (unless start | 256 | (unless start |
| 271 | (setq start (point-min) | 257 | (setq start (point-min) |
| 272 | end (point-max))) | 258 | end (point-max))) |
| @@ -280,8 +266,8 @@ encryption is used." | |||
| 280 | ;; decrypted contents. | 266 | ;; decrypted contents. |
| 281 | (format-encode-buffer (with-current-buffer buffer | 267 | (format-encode-buffer (with-current-buffer buffer |
| 282 | buffer-file-format)) | 268 | buffer-file-format)) |
| 283 | (epa-file--encode-coding-string (buffer-string) | 269 | (encode-coding-string (buffer-string) |
| 284 | coding-system))) | 270 | coding-system))) |
| 285 | (if (or (eq epa-file-select-keys t) | 271 | (if (or (eq epa-file-select-keys t) |
| 286 | (and (null epa-file-select-keys) | 272 | (and (null epa-file-select-keys) |
| 287 | (not (local-variable-p 'epa-file-encrypt-to | 273 | (not (local-variable-p 'epa-file-encrypt-to |
diff --git a/lisp/epa-hook.el b/lisp/epa-hook.el index d424e7a9faf..a86f23eb688 100644 --- a/lisp/epa-hook.el +++ b/lisp/epa-hook.el | |||
| @@ -35,10 +35,10 @@ | |||
| 35 | (defcustom epa-file-name-regexp (purecopy "\\.gpg\\(~\\|\\.~[0-9]+~\\)?\\'") | 35 | (defcustom epa-file-name-regexp (purecopy "\\.gpg\\(~\\|\\.~[0-9]+~\\)?\\'") |
| 36 | "Regexp which matches filenames to be encrypted with GnuPG. | 36 | "Regexp which matches filenames to be encrypted with GnuPG. |
| 37 | 37 | ||
| 38 | If you set this outside Custom while epa-file is already enabled, you | 38 | If you set this outside Custom while epa-file is already enabled, |
| 39 | have to call `epa-file-name-regexp-update' after setting it to | 39 | you have to call `epa-file-name-regexp-update' after setting it |
| 40 | properly update file-name-handler-alist. Setting this through Custom | 40 | to properly update `file-name-handler-alist'. Setting this |
| 41 | does that automatically." | 41 | through Custom does that automatically." |
| 42 | :type 'regexp | 42 | :type 'regexp |
| 43 | :group 'epa-file | 43 | :group 'epa-file |
| 44 | :set 'epa-file--file-name-regexp-set) | 44 | :set 'epa-file--file-name-regexp-set) |
| @@ -72,6 +72,9 @@ May either be a string or a list of strings.") | |||
| 72 | (list epa-file-name-regexp nil 'epa-file)) | 72 | (list epa-file-name-regexp nil 'epa-file)) |
| 73 | 73 | ||
| 74 | (defun epa-file-name-regexp-update () | 74 | (defun epa-file-name-regexp-update () |
| 75 | "Update `file-name-handler-alist' after configuring outside Custom. | ||
| 76 | After setting `epa-file-name-regexp-update' outside the Custom | ||
| 77 | interface, update `file-name-handler-alist'." | ||
| 75 | (interactive) | 78 | (interactive) |
| 76 | (unless (equal (car epa-file-handler) epa-file-name-regexp) | 79 | (unless (equal (car epa-file-handler) epa-file-name-regexp) |
| 77 | (setcar epa-file-handler epa-file-name-regexp))) | 80 | (setcar epa-file-handler epa-file-name-regexp))) |
diff --git a/lisp/epa.el b/lisp/epa.el index 8ec42187358..3c7dd8309a8 100644 --- a/lisp/epa.el +++ b/lisp/epa.el | |||
| @@ -25,7 +25,9 @@ | |||
| 25 | (require 'epg) | 25 | (require 'epg) |
| 26 | (require 'font-lock) | 26 | (require 'font-lock) |
| 27 | (require 'widget) | 27 | (require 'widget) |
| 28 | (eval-when-compile (require 'wid-edit)) | 28 | (eval-when-compile |
| 29 | (require 'subr-x) | ||
| 30 | (require 'wid-edit)) | ||
| 29 | (require 'derived) | 31 | (require 'derived) |
| 30 | 32 | ||
| 31 | (defgroup epa nil | 33 | (defgroup epa nil |
| @@ -56,11 +58,6 @@ If neither t nor nil, ask user for confirmation." | |||
| 56 | :type 'integer | 58 | :type 'integer |
| 57 | :group 'epa) | 59 | :group 'epa) |
| 58 | 60 | ||
| 59 | (defgroup epa-faces nil | ||
| 60 | "Faces for epa-mode." | ||
| 61 | :version "23.1" | ||
| 62 | :group 'epa) | ||
| 63 | |||
| 64 | (defcustom epa-mail-aliases nil | 61 | (defcustom epa-mail-aliases nil |
| 65 | "Alist of aliases of email addresses that stand for encryption keys. | 62 | "Alist of aliases of email addresses that stand for encryption keys. |
| 66 | Each element is a list of email addresses (ALIAS EXPANSIONS...). | 63 | Each element is a list of email addresses (ALIAS EXPANSIONS...). |
| @@ -76,6 +73,11 @@ The command `epa-mail-encrypt' uses this." | |||
| 76 | :group 'epa | 73 | :group 'epa |
| 77 | :version "24.4") | 74 | :version "24.4") |
| 78 | 75 | ||
| 76 | (defgroup epa-faces nil | ||
| 77 | "Faces for epa-mode." | ||
| 78 | :version "23.1" | ||
| 79 | :group 'epa) | ||
| 80 | |||
| 79 | (defface epa-validity-high | 81 | (defface epa-validity-high |
| 80 | '((default :weight bold) | 82 | '((default :weight bold) |
| 81 | (((class color) (background dark)) :foreground "PaleTurquoise")) | 83 | (((class color) (background dark)) :foreground "PaleTurquoise")) |
| @@ -117,13 +119,15 @@ The command `epa-mail-encrypt' uses this." | |||
| 117 | '((default :weight bold) | 119 | '((default :weight bold) |
| 118 | (((class color) (background dark)) :foreground "PaleTurquoise")) | 120 | (((class color) (background dark)) :foreground "PaleTurquoise")) |
| 119 | "Face for the name of the attribute field." | 121 | "Face for the name of the attribute field." |
| 120 | :group 'epa) | 122 | :version "28.1" |
| 123 | :group 'epa-faces) | ||
| 121 | 124 | ||
| 122 | (defface epa-field-body | 125 | (defface epa-field-body |
| 123 | '((default :slant italic) | 126 | '((default :slant italic) |
| 124 | (((class color) (background dark)) :foreground "turquoise")) | 127 | (((class color) (background dark)) :foreground "turquoise")) |
| 125 | "Face for the body of the attribute field." | 128 | "Face for the body of the attribute field." |
| 126 | :group 'epa) | 129 | :version "28.1" |
| 130 | :group 'epa-faces) | ||
| 127 | 131 | ||
| 128 | (defcustom epa-validity-face-alist | 132 | (defcustom epa-validity-face-alist |
| 129 | '((unknown . epa-validity-disabled) | 133 | '((unknown . epa-validity-disabled) |
| @@ -138,8 +142,9 @@ The command `epa-mail-encrypt' uses this." | |||
| 138 | (full . epa-validity-high) | 142 | (full . epa-validity-high) |
| 139 | (ultimate . epa-validity-high)) | 143 | (ultimate . epa-validity-high)) |
| 140 | "An alist mapping validity values to faces." | 144 | "An alist mapping validity values to faces." |
| 145 | :version "28.1" | ||
| 141 | :type '(repeat (cons symbol face)) | 146 | :type '(repeat (cons symbol face)) |
| 142 | :group 'epa) | 147 | :group 'epa-faces) |
| 143 | 148 | ||
| 144 | (defvar epa-font-lock-keywords | 149 | (defvar epa-font-lock-keywords |
| 145 | '(("^\\*" | 150 | '(("^\\*" |
| @@ -185,6 +190,8 @@ You should bind this variable with `let', but do not set it globally.") | |||
| 185 | (defvar epa-key-list-mode-map | 190 | (defvar epa-key-list-mode-map |
| 186 | (let ((keymap (make-sparse-keymap)) | 191 | (let ((keymap (make-sparse-keymap)) |
| 187 | (menu-map (make-sparse-keymap))) | 192 | (menu-map (make-sparse-keymap))) |
| 193 | (set-keymap-parent keymap widget-keymap) | ||
| 194 | (define-key keymap "\C-m" 'epa-show-key) | ||
| 188 | (define-key keymap "m" 'epa-mark-key) | 195 | (define-key keymap "m" 'epa-mark-key) |
| 189 | (define-key keymap "u" 'epa-unmark-key) | 196 | (define-key keymap "u" 'epa-unmark-key) |
| 190 | (define-key keymap "d" 'epa-decrypt-file) | 197 | (define-key keymap "d" 'epa-decrypt-file) |
| @@ -332,8 +339,7 @@ If ARG is non-nil, mark the key." | |||
| 332 | (epa-mark-key (not arg))) | 339 | (epa-mark-key (not arg))) |
| 333 | 340 | ||
| 334 | (defun epa-exit-buffer () | 341 | (defun epa-exit-buffer () |
| 335 | "Exit the current buffer. | 342 | "Exit the current buffer using `epa-exit-buffer-function'." |
| 336 | `epa-exit-buffer-function' is called if it is set." | ||
| 337 | (interactive) | 343 | (interactive) |
| 338 | (funcall epa-exit-buffer-function)) | 344 | (funcall epa-exit-buffer-function)) |
| 339 | 345 | ||
| @@ -397,8 +403,7 @@ DOC is documentation text to insert at the start." | |||
| 397 | (goto-char point)) | 403 | (goto-char point)) |
| 398 | 404 | ||
| 399 | (epa--insert-keys (epg-list-keys context name secret)) | 405 | (epa--insert-keys (epg-list-keys context name secret)) |
| 400 | (widget-setup) | 406 | (widget-setup)) |
| 401 | (set-keymap-parent (current-local-map) widget-keymap)) | ||
| 402 | (make-local-variable 'epa-list-keys-arguments) | 407 | (make-local-variable 'epa-list-keys-arguments) |
| 403 | (setq epa-list-keys-arguments (list name secret)) | 408 | (setq epa-list-keys-arguments (list name secret)) |
| 404 | (goto-char (point-min)) | 409 | (goto-char (point-min)) |
| @@ -500,6 +505,14 @@ If SECRET is non-nil, list secret keys instead of public keys." | |||
| 500 | (let ((keys (epg-list-keys context names secret))) | 505 | (let ((keys (epg-list-keys context names secret))) |
| 501 | (epa--select-keys prompt keys))) | 506 | (epa--select-keys prompt keys))) |
| 502 | 507 | ||
| 508 | (defun epa-show-key () | ||
| 509 | "Show a key on the current line." | ||
| 510 | (interactive) | ||
| 511 | (if-let ((key (get-text-property (point) 'epa-key))) | ||
| 512 | (save-selected-window | ||
| 513 | (epa--show-key key)) | ||
| 514 | (error "No key on this line"))) | ||
| 515 | |||
| 503 | (defun epa--show-key (key) | 516 | (defun epa--show-key (key) |
| 504 | (let* ((primary-sub-key (car (epg-key-sub-key-list key))) | 517 | (let* ((primary-sub-key (car (epg-key-sub-key-list key))) |
| 505 | (entry (assoc (epg-sub-key-id primary-sub-key) | 518 | (entry (assoc (epg-sub-key-id primary-sub-key) |
diff --git a/lisp/epg-config.el b/lisp/epg-config.el index daa9a5abd17..1c429246529 100644 --- a/lisp/epg-config.el +++ b/lisp/epg-config.el | |||
| @@ -202,13 +202,13 @@ version requirement is met." | |||
| 202 | (cond | 202 | (cond |
| 203 | ((eq type 'group) | 203 | ((eq type 'group) |
| 204 | (if (string-match "\\`\\([^:]+\\):" args) | 204 | (if (string-match "\\`\\([^:]+\\):" args) |
| 205 | (setq groups | 205 | (setq groups |
| 206 | (cons (cons (downcase (match-string 1 args)) | 206 | (cons (cons (downcase (match-string 1 args)) |
| 207 | (delete "" (split-string | 207 | (delete "" (split-string |
| 208 | (substring args | 208 | (substring args |
| 209 | (match-end 0)) | 209 | (match-end 0)) |
| 210 | ";"))) | 210 | ";"))) |
| 211 | groups)) | 211 | groups)) |
| 212 | (if epg-debug | 212 | (if epg-debug |
| 213 | (message "Invalid group configuration: %S" args)))) | 213 | (message "Invalid group configuration: %S" args)))) |
| 214 | ((memq type '(pubkey cipher digest compress)) | 214 | ((memq type '(pubkey cipher digest compress)) |