emacs-diffs
[Top][All Lists]
Advanced

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

master 7b409df: Remove :copy from define-keymap


From: Lars Ingebrigtsen
Subject: master 7b409df: Remove :copy from define-keymap
Date: Mon, 4 Oct 2021 10:37:39 -0400 (EDT)

branch: master
commit 7b409dfe9671ec12377d1bd3c02e5306badd22b5
Author: Lars Ingebrigtsen <larsi@gnus.org>
Commit: Lars Ingebrigtsen <larsi@gnus.org>

    Remove :copy from define-keymap
    
    * doc/lispref/keymaps.texi (Changing Key Bindings): Update
    documentation.
    
    * lisp/subr.el (define-keymap):
    (define-keymap--define): Remove :copy from the signature.
    
    * lisp/net/eww.el (eww-link-keymap): Use :parent.
---
 doc/lispref/keymaps.texi |  4 ----
 lisp/net/eww.el          |  4 ++--
 lisp/subr.el             | 16 ++++------------
 3 files changed, 6 insertions(+), 18 deletions(-)

diff --git a/doc/lispref/keymaps.texi b/doc/lispref/keymaps.texi
index 1ca4857..adee7ce 100644
--- a/doc/lispref/keymaps.texi
+++ b/doc/lispref/keymaps.texi
@@ -1442,10 +1442,6 @@ If non-@code{nil}, the keymap will be suppressed with
 @code{suppress-keymap} (@pxref{Changing Key Bindings}).  If
 @code{nodigits}, treat digits like other chars.
 
-@item :copy
-If non-@code{nil}, copy this keymap and use it as the basis
-(@pxref{Creating Keymaps}).
-
 @item :name
 If non-@code{nil}, this should be a string to use as the menu for the
 keymap if you use it as a menu with @code{x-popup-menu} (@pxref{Pop-Up
diff --git a/lisp/net/eww.el b/lisp/net/eww.el
index e5716d3..afcf2ce 100644
--- a/lisp/net/eww.el
+++ b/lisp/net/eww.el
@@ -271,10 +271,10 @@ See also `eww-form-checkbox-selected-symbol'."
   "text/html, text/plain, text/sgml, text/css, application/xhtml+xml, 
*/*;q=0.01"
   "Value used for the HTTP 'Accept' header.")
 
-(defvar-keymap eww-link-keymap (:copy shr-map)
+(defvar-keymap eww-link-keymap (:parent shr-map)
   "\r" #'eww-follow-link)
 
-(defvar-keymap eww-image-link-keymap (:copy shr-map)
+(defvar-keymap eww-image-link-keymap (:parent shr-map)
   "\r" #'eww-follow-link)
 
 (defun eww-suggested-uris nil
diff --git a/lisp/subr.el b/lisp/subr.el
index 18b0851..6473c5a 100644
--- a/lisp/subr.el
+++ b/lisp/subr.el
@@ -6478,9 +6478,6 @@ pairs.  Available keywords are:
 :keymap    If non-nil, instead of creating a new keymap, the given keymap
              will be destructively modified instead.
 
-:copy      If non-nil, copy this keymap and use it as the basis
-             (see `copy-keymap').
-
 :name      If non-nil, this should be a string to use as the menu for
              the keymap in case you use it as a menu with `x-popup-menu'.
 
@@ -6492,7 +6489,7 @@ KEY/DEFINITION pairs are as KEY and DEF in `define-key'.  
KEY can
 also be the special symbol `:menu', in which case DEFINITION
 should be a MENU form as accepted by `easy-menu-define'.
 
-\n(fn [&key FULL PARENT SUPPRESS NAME PREFIX KEYMAP COPY] [KEY DEFINITION] 
...)"
+\n(fn [&key FULL PARENT SUPPRESS NAME PREFIX KEYMAP] [KEY DEFINITION] ...)"
   ;; Handle keywords.
   (let ((options nil))
     (while (and definitions
@@ -6505,7 +6502,7 @@ should be a MENU form as accepted by `easy-menu-define'.
     (define-keymap--define (nreverse options) definitions)))
 
 (defun define-keymap--define (options definitions)
-  (let (full suppress parent name prefix copy keymap)
+  (let (full suppress parent name prefix keymap)
     (while options
       (let ((keyword (pop options))
             (value (pop options)))
@@ -6513,7 +6510,6 @@ should be a MENU form as accepted by `easy-menu-define'.
           (:full (setq full value))
           (:keymap (setq keymap value))
           (:parent (setq parent value))
-          (:copy (setq copy value))
           (:suppress (setq suppress value))
           (:name (setq name value))
           (:prefix (setq prefix value)))))
@@ -6522,16 +6518,12 @@ should be a MENU form as accepted by `easy-menu-define'.
                (or full parent suppress keymap))
       (error "A prefix keymap can't be defined with 
:full/:parent/:suppress/:keymap keywords"))
 
-    (when (and full copy)
-      (error "Invalid combination: :full/:copy"))
-
-    (when (and keymap (or full copy))
-      (error "Invalid combination: :keymap with :full/:copy"))
+    (when (and keymap full)
+      (error "Invalid combination: :keymap with :full"))
 
     (let ((keymap (cond
                    (keymap keymap)
                    (prefix (define-prefix-command prefix nil name))
-                   (copy (copy-keymap copy))
                    (full (make-keymap name))
                    (t (make-sparse-keymap name)))))
       (when suppress



reply via email to

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