emacs-diffs
[Top][All Lists]
Advanced

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

feature/native-comp 907618b 4/4: Merge remote-tracking branch 'savahnna/


From: Andrea Corallo
Subject: feature/native-comp 907618b 4/4: Merge remote-tracking branch 'savahnna/master' into HEAD
Date: Wed, 15 Jul 2020 17:15:22 -0400 (EDT)

branch: feature/native-comp
commit 907618b3b51a653d111d7f5764da586fcee6da5e
Merge: 2c2cc21 85eaa83
Author: Andrea Corallo <akrl@sdf.org>
Commit: Andrea Corallo <akrl@sdf.org>

    Merge remote-tracking branch 'savahnna/master' into HEAD
---
 doc/emacs/mule.texi      |  2 +-
 doc/lispref/modes.texi   |  2 +-
 etc/NEWS                 |  2 +-
 lisp/descr-text.el       | 19 +++++++++++--------
 lisp/emacs-lisp/eldoc.el | 17 +++++++++--------
 lisp/epa-dired.el        | 44 ++++++++++++++++++--------------------------
 lisp/epa-file.el         | 30 ++++++++----------------------
 lisp/epa-hook.el         | 11 +++++++----
 lisp/epa.el              | 39 ++++++++++++++++++++++++++-------------
 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 0f07d28..6eff0ca 100644
--- a/doc/emacs/mule.texi
+++ b/doc/emacs/mule.texi
@@ -202,7 +202,7 @@ terminal, the code(s) sent to the terminal.
 @item
 If the character was composed on display with any following characters
 to form one or more grapheme clusters, the composition information:
-the font glyphs if the frame is on a graphical display, else the
+the font glyphs if the frame is on a graphical display, and the
 characters that were composed.
 
 @item
diff --git a/doc/lispref/modes.texi b/doc/lispref/modes.texi
index 17e9607..33a07c9 100644
--- a/doc/lispref/modes.texi
+++ b/doc/lispref/modes.texi
@@ -469,7 +469,7 @@ variable @code{imenu-generic-expression}, for the two 
variables
 @code{imenu-create-index-function} (@pxref{Imenu}).
 
 @item
-The mode can tell Eldoc mode how to retrieve different types of
+The mode can tell ElDoc mode how to retrieve different types of
 documentation for whatever is at point, by adding one or more
 buffer-local entries to the special hook
 @code{eldoc-documentation-functions}.
diff --git a/etc/NEWS b/etc/NEWS
index e55f57e..2afd4de 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -263,7 +263,7 @@ obsolete.
 
 *** 'eldoc-echo-area-use-multiline-p' is now handled by ElDoc.
 The user option 'eldoc-echo-area-use-multiline-p' is now handled
-by the Eldoc library itself.  Functions in
+by the ElDoc library itself.  Functions in
 'eldoc-documentation-functions' don't need to worry about consulting
 it when producing a doc string.
 
diff --git a/lisp/descr-text.el b/lisp/descr-text.el
index 4de1a7b..be5e014 100644
--- a/lisp/descr-text.el
+++ b/lisp/descr-text.el
@@ -775,13 +775,16 @@ The character information includes:
                                     (setq glyph (lgstring-glyph gstring from)))
                           (insert (format "  %S\n" glyph))
                           (setq from (1+ from)))
-                        (insert "from these character(s):\n")
-                        (dotimes (i (lgstring-char-len gstring))
-                          (let ((char (lgstring-char gstring i)))
-                            (insert (format "  %c (#x%x) %s\n"
-                                            char char
-                                            (get-char-code-property
-                                             char 'name))))))
+                        (when (and (stringp (car composition))
+                                   (string-match "\"\\([^\"]+\\)\"" (car 
composition)))
+                          (insert "with these character(s):\n")
+                          (let ((chars (match-string 1 (car composition))))
+                            (dotimes (i (length chars))
+                              (let ((char (aref chars i)))
+                                (insert (format "  %c (#x%x) %s\n"
+                                                char char
+                                                (get-char-code-property
+                                                 char 'name))))))))
                     ;; TTY frame: show composition in terms of characters.
                     (insert " by these characters:\n")
                     (while (and (<= from to)
@@ -950,7 +953,7 @@ This function can be used as a value of
       ;; instead of returning a string tailored here for the echo area
       ;; exclusively, we could call the (now unused) argument
       ;; _CALLBACK with hints on how to shorten the string if needed,
-      ;; or with multiple usable strings which Eldoc picks according
+      ;; or with multiple usable strings which ElDoc picks according
       ;; to its space contraints.
       (describe-char-eldoc--format
        ch
diff --git a/lisp/emacs-lisp/eldoc.el b/lisp/emacs-lisp/eldoc.el
index 1dd0ea2..510dff9 100644
--- a/lisp/emacs-lisp/eldoc.el
+++ b/lisp/emacs-lisp/eldoc.el
@@ -92,7 +92,7 @@ echo area must be resized to fit.
 
 If value is a number (integer or floating point), it has the
 semantics of `max-mini-window-height', constraining the resizing
-for Eldoc purposes only.
+for ElDoc purposes only.
 
 Any resizing respects `max-mini-window-height'.
 
@@ -112,9 +112,9 @@ single line of display in the echo area."
  line" truncate-sym-name-if-fit)))
 
 (defcustom eldoc-prefer-doc-buffer nil
-  "Prefer Eldoc's documentation buffer if it is showing in some frame.
+  "Prefer ElDoc's documentation buffer if it is showing in some frame.
 If this variable's value is t and a piece of documentation needs
-to be truncated to fit in the echo area, do so if Eldoc's
+to be truncated to fit in the echo area, do so if ElDoc's
 documentation buffer is not already showing, since the buffer
 always holds the full documentation."
   :type 'boolean)
@@ -495,8 +495,9 @@ Honor most of `eldoc-echo-area-use-multiline-p'."
                             (substitute-command-keys 
"\\[eldoc-doc-buffer]")))))))))
               ((= available 1)
                ;; Truncate "brutally." ; FIXME: use `eldoc-prefer-doc-buffer' 
too?
-               (truncate-string-to-width
-                (buffer-substring (point-min) (line-end-position 1)) width)))))
+               (with-current-buffer (eldoc-doc-buffer)
+                 (truncate-string-to-width
+                  (buffer-substring (point-min) (line-end-position 1)) 
width))))))
         (when echo-area-message
           (eldoc--message echo-area-message))))))
 
@@ -539,11 +540,11 @@ Meant as a value for `eldoc-documentation-strategy'."
                         (if (stringp str) (funcall callback str))
                         nil))))
 
-;; JT@2020-07-10: Eldoc is pre-loaded, so in in Emacs < 28 we can't
+;; JT@2020-07-10: ElDoc is pre-loaded, so in Emacs < 28 we can't
 ;; make the "old" `eldoc-documentation-function' point to the new
 ;; `eldoc-documentation-strategy', so we do the reverse.  This allows
-;; for Eldoc to be loaded in those older Emacs versions and work with
-;; whomever (major-modes, extensions, ueser) sets one of the other
+;; for ElDoc to be loaded in those older Emacs versions and work with
+;; whomever (major-modes, extensions, user) sets one or the other
 ;; variable.
 (defmacro eldoc--documentation-strategy-defcustom
     (main secondary value docstring &rest more)
diff --git a/lisp/epa-dired.el b/lisp/epa-dired.el
index f601d42..9269ea9 100644
--- a/lisp/epa-dired.el
+++ b/lisp/epa-dired.el
@@ -29,48 +29,40 @@
 (defun epa-dired-do-decrypt ()
   "Decrypt marked files."
   (interactive)
-  (let ((file-list (dired-get-marked-files)))
-    (while file-list
-      (epa-decrypt-file (expand-file-name (car file-list)))
-      (setq file-list (cdr file-list)))
-    (revert-buffer)))
+  (dolist (file (dired-get-marked-files))
+    (epa-decrypt-file (expand-file-name file)))
+  (revert-buffer))
 
 ;;;###autoload
 (defun epa-dired-do-verify ()
   "Verify marked files."
   (interactive)
-  (let ((file-list (dired-get-marked-files)))
-    (while file-list
-      (epa-verify-file (expand-file-name (car file-list)))
-      (setq file-list (cdr file-list)))))
+  (dolist (file (dired-get-marked-files))
+    (epa-verify-file (expand-file-name file))))
 
 ;;;###autoload
 (defun epa-dired-do-sign ()
   "Sign marked files."
   (interactive)
-  (let ((file-list (dired-get-marked-files)))
-    (while file-list
-      (epa-sign-file
-       (expand-file-name (car file-list))
-       (epa-select-keys (epg-make-context) "Select keys for signing.
+  (dolist (file (dired-get-marked-files))
+    (epa-sign-file
+     (expand-file-name file)
+     (epa-select-keys (epg-make-context) "Select keys for signing.
 If no one is selected, default secret key is used.  "
-                       nil t)
-       (y-or-n-p "Make a detached signature? "))
-      (setq file-list (cdr file-list)))
-    (revert-buffer)))
+                     nil t)
+     (y-or-n-p "Make a detached signature? ")))
+  (revert-buffer))
 
 ;;;###autoload
 (defun epa-dired-do-encrypt ()
   "Encrypt marked files."
   (interactive)
-  (let ((file-list (dired-get-marked-files)))
-    (while file-list
-      (epa-encrypt-file
-       (expand-file-name (car file-list))
-       (epa-select-keys (epg-make-context) "Select recipients for encryption.
-If no one is selected, symmetric encryption will be performed.  "))
-      (setq file-list (cdr file-list)))
-    (revert-buffer)))
+  (dolist (file (dired-get-marked-files))
+    (epa-encrypt-file
+     (expand-file-name file)
+     (epa-select-keys (epg-make-context) "Select recipients for encryption.
+If no one is selected, symmetric encryption will be performed.  ")))
+  (revert-buffer))
 
 (provide 'epa-dired)
 
diff --git a/lisp/epa-file.el b/lisp/epa-file.el
index dedf20b..20043a9 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."
 (defcustom epa-file-select-keys nil
   "Control whether or not to pop up the key selection dialog.
 
-If t, always asks user to select recipients.
+If t, always ask user to select recipients.
 If nil, query user only when `epa-file-encrypt-to' is not set.
-If neither t nor nil, doesn't ask user.  In this case, symmetric
+If neither t nor nil, don't ask user.  In this case, symmetric
 encryption is used."
   :type '(choice (const :tag "Ask always" t)
                 (const :tag "Ask when recipients are not set" nil)
@@ -51,16 +51,6 @@ encryption is used."
 
 (defvar epa-file-passphrase-alist nil)
 
-(eval-and-compile
-  (if (fboundp 'encode-coding-string)
-      (defalias 'epa-file--encode-coding-string 'encode-coding-string)
-    (defalias 'epa-file--encode-coding-string 'identity)))
-
-(eval-and-compile
-  (if (fboundp 'decode-coding-string)
-      (defalias 'epa-file--decode-coding-string 'decode-coding-string)
-    (defalias 'epa-file--decode-coding-string 'identity)))
-
 (defun epa-file-passphrase-callback-function (context key-id file)
   (if (and epa-file-cache-passphrase-for-symmetric-encryption
           (eq key-id 'SYM))
@@ -71,8 +61,8 @@ encryption is used."
          (or (copy-sequence (cdr entry))
              (progn
                (unless entry
-                 (setq entry (list file)
-                       epa-file-passphrase-alist
+                 (setq entry (list file))
+                 (setq epa-file-passphrase-alist
                        (cons entry
                              epa-file-passphrase-alist)))
                (setq passphrase (epa-passphrase-callback-function context
@@ -236,11 +226,7 @@ encryption is used."
   (setq file (expand-file-name file))
   (let* ((coding-system (or coding-system-for-write
                            (if (fboundp 'select-safe-coding-system)
-                               ;; This is needed since Emacs 22 has
-                               ;; no-conversion setting for *.gpg in
-                               ;; `auto-coding-alist'.
-                               (let ((buffer-file-name
-                                      (file-name-sans-extension file)))
+                               (let ((buffer-file-name file))
                                  (select-safe-coding-system
                                   (point-min) (point-max)))
                              buffer-file-coding-system)))
@@ -266,7 +252,7 @@ encryption is used."
              (epg-encrypt-string
               context
               (if (stringp start)
-                  (epa-file--encode-coding-string start coding-system)
+                  (encode-coding-string start coding-system)
                 (unless start
                   (setq start (point-min)
                         end (point-max)))
@@ -280,8 +266,8 @@ encryption is used."
                   ;; decrypted contents.
                   (format-encode-buffer (with-current-buffer buffer
                                           buffer-file-format))
-                  (epa-file--encode-coding-string (buffer-string)
-                                                  coding-system)))
+                  (encode-coding-string (buffer-string)
+                                        coding-system)))
               (if (or (eq epa-file-select-keys t)
                       (and (null epa-file-select-keys)
                            (not (local-variable-p 'epa-file-encrypt-to
diff --git a/lisp/epa-hook.el b/lisp/epa-hook.el
index d424e7a..a86f23e 100644
--- a/lisp/epa-hook.el
+++ b/lisp/epa-hook.el
@@ -35,10 +35,10 @@
 (defcustom epa-file-name-regexp (purecopy "\\.gpg\\(~\\|\\.~[0-9]+~\\)?\\'")
   "Regexp which matches filenames to be encrypted with GnuPG.
 
-If you set this outside Custom while epa-file is already enabled, you
-have to call `epa-file-name-regexp-update' after setting it to
-properly update file-name-handler-alist.  Setting this through Custom
-does that automatically."
+If you set this outside Custom while epa-file is already enabled,
+you have to call `epa-file-name-regexp-update' after setting it
+to properly update `file-name-handler-alist'.  Setting this
+through Custom does that automatically."
   :type 'regexp
   :group 'epa-file
   :set 'epa-file--file-name-regexp-set)
@@ -72,6 +72,9 @@ May either be a string or a list of strings.")
   (list epa-file-name-regexp nil 'epa-file))
 
 (defun epa-file-name-regexp-update ()
+  "Update `file-name-handler-alist' after configuring outside Custom.
+After setting `epa-file-name-regexp-update' outside the Custom
+interface, update `file-name-handler-alist'."
   (interactive)
   (unless (equal (car epa-file-handler) epa-file-name-regexp)
     (setcar epa-file-handler epa-file-name-regexp)))
diff --git a/lisp/epa.el b/lisp/epa.el
index 8ec4218..3c7dd83 100644
--- a/lisp/epa.el
+++ b/lisp/epa.el
@@ -25,7 +25,9 @@
 (require 'epg)
 (require 'font-lock)
 (require 'widget)
-(eval-when-compile (require 'wid-edit))
+(eval-when-compile
+  (require 'subr-x)
+  (require 'wid-edit))
 (require 'derived)
 
 (defgroup epa nil
@@ -56,11 +58,6 @@ If neither t nor nil, ask user for confirmation."
   :type 'integer
   :group 'epa)
 
-(defgroup epa-faces nil
-  "Faces for epa-mode."
-  :version "23.1"
-  :group 'epa)
-
 (defcustom epa-mail-aliases nil
   "Alist of aliases of email addresses that stand for encryption keys.
 Each element is a list of email addresses (ALIAS EXPANSIONS...).
@@ -76,6 +73,11 @@ The command `epa-mail-encrypt' uses this."
   :group 'epa
   :version "24.4")
 
+(defgroup epa-faces nil
+  "Faces for epa-mode."
+  :version "23.1"
+  :group 'epa)
+
 (defface epa-validity-high
   '((default :weight bold)
     (((class color) (background dark)) :foreground "PaleTurquoise"))
@@ -117,13 +119,15 @@ The command `epa-mail-encrypt' uses this."
   '((default :weight bold)
     (((class color) (background dark)) :foreground "PaleTurquoise"))
   "Face for the name of the attribute field."
-  :group 'epa)
+  :version "28.1"
+  :group 'epa-faces)
 
 (defface epa-field-body
   '((default :slant italic)
     (((class color) (background dark)) :foreground "turquoise"))
   "Face for the body of the attribute field."
-  :group 'epa)
+  :version "28.1"
+  :group 'epa-faces)
 
 (defcustom epa-validity-face-alist
   '((unknown . epa-validity-disabled)
@@ -138,8 +142,9 @@ The command `epa-mail-encrypt' uses this."
     (full . epa-validity-high)
     (ultimate . epa-validity-high))
   "An alist mapping validity values to faces."
+  :version "28.1"
   :type '(repeat (cons symbol face))
-  :group 'epa)
+  :group 'epa-faces)
 
 (defvar epa-font-lock-keywords
   '(("^\\*"
@@ -185,6 +190,8 @@ You should bind this variable with `let', but do not set it 
globally.")
 (defvar epa-key-list-mode-map
   (let ((keymap (make-sparse-keymap))
        (menu-map (make-sparse-keymap)))
+    (set-keymap-parent keymap widget-keymap)
+    (define-key keymap "\C-m" 'epa-show-key)
     (define-key keymap "m" 'epa-mark-key)
     (define-key keymap "u" 'epa-unmark-key)
     (define-key keymap "d" 'epa-decrypt-file)
@@ -332,8 +339,7 @@ If ARG is non-nil, mark the key."
   (epa-mark-key (not arg)))
 
 (defun epa-exit-buffer ()
-  "Exit the current buffer.
-`epa-exit-buffer-function' is called if it is set."
+  "Exit the current buffer using `epa-exit-buffer-function'."
   (interactive)
   (funcall epa-exit-buffer-function))
 
@@ -397,8 +403,7 @@ DOC is documentation text to insert at the start."
       (goto-char point))
 
     (epa--insert-keys (epg-list-keys context name secret))
-    (widget-setup)
-    (set-keymap-parent (current-local-map) widget-keymap))
+    (widget-setup))
   (make-local-variable 'epa-list-keys-arguments)
   (setq epa-list-keys-arguments (list name secret))
   (goto-char (point-min))
@@ -500,6 +505,14 @@ If SECRET is non-nil, list secret keys instead of public 
keys."
   (let ((keys (epg-list-keys context names secret)))
     (epa--select-keys prompt keys)))
 
+(defun epa-show-key ()
+  "Show a key on the current line."
+  (interactive)
+  (if-let ((key (get-text-property (point) 'epa-key)))
+      (save-selected-window
+        (epa--show-key key))
+    (error "No key on this line")))
+
 (defun epa--show-key (key)
   (let* ((primary-sub-key (car (epg-key-sub-key-list key)))
         (entry (assoc (epg-sub-key-id primary-sub-key)
diff --git a/lisp/epg-config.el b/lisp/epg-config.el
index daa9a5a..1c42924 100644
--- a/lisp/epg-config.el
+++ b/lisp/epg-config.el
@@ -202,13 +202,13 @@ version requirement is met."
        (cond
         ((eq type 'group)
          (if (string-match "\\`\\([^:]+\\):" args)
-                 (setq groups
-                       (cons (cons (downcase (match-string 1 args))
-                                   (delete "" (split-string
-                                               (substring args
-                                                          (match-end 0))
-                                               ";")))
-                             groups))
+             (setq groups
+                   (cons (cons (downcase (match-string 1 args))
+                               (delete "" (split-string
+                                           (substring args
+                                                      (match-end 0))
+                                           ";")))
+                         groups))
            (if epg-debug
                (message "Invalid group configuration: %S" args))))
         ((memq type '(pubkey cipher digest compress))



reply via email to

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