]> git.eshelyaron.com Git - emacs.git/commitdiff
Delete commented out help--describe-vector implementation
authorStefan Kangas <stefankangas@gmail.com>
Wed, 13 Nov 2024 22:26:41 +0000 (23:26 +0100)
committerEshel Yaron <me@eshelyaron.com>
Wed, 20 Nov 2024 12:32:41 +0000 (13:32 +0100)
This was an attempt at lifting 'help--describe-vector' to Lisp that
turned out to be prohibitively slow.  It is still there in the Git log
if we need to refer back to it.  Currently, it is just dead weight, so
delete it.

* lisp/help.el: Delete commented out code.

(cherry picked from commit 96656c77e282939a84b19a9ccbbea5fbea948e33)

lisp/help.el

index 03c2f5000459733a16cd9dbe17c48a3cf2528f47..ef4262e45f66af33cee1a4c7a2de23b9542d8ca8 100644 (file)
@@ -2032,79 +2032,6 @@ in `help--describe-map-tree'."
                            (- width (car elem))
                          (mod width tab-width))))))
 
-;;;; This Lisp version is 100 times slower than its C equivalent:
-;;
-;; (defun help--describe-vector
-;;     (vector prefix transl partial shadow entire-map mention-shadow)
-;;   "Insert in the current buffer a description of the contents of VECTOR.
-;;
-;; PREFIX a prefix key which leads to the keymap that this vector is
-;; in.
-;;
-;; If PARTIAL, it means do not mention suppressed commands
-;; (that assumes the vector is in a keymap).
-;;
-;; SHADOW is a list of keymaps that shadow this map.  If it is
-;; non-nil, look up the key in those maps and don't mention it if it
-;; is defined by any of them.
-;;
-;; ENTIRE-MAP is the vector in which this vector appears.
-;; If the definition in effect in the whole map does not match
-;; the one in this vector, we ignore this one."
-;;   ;; Converted from describe_vector in keymap.c.
-;;   (let* ((first t)
-;;          (idx 0))
-;;     (while (< idx (length vector))
-;;       (let* ((val (aref vector idx))
-;;              (definition (keymap--get-keyelt val nil))
-;;              (start-idx idx)
-;;              this-shadowed
-;;              found-range)
-;;         (when (and definition
-;;                    ;; Don't mention suppressed commands.
-;;                    (not (and partial
-;;                              (symbolp definition)
-;;                              (get definition 'suppress-keymap)))
-;;                    ;; If this binding is shadowed by some other map,
-;;                    ;; ignore it.
-;;                    (not (and shadow
-;;                              (help--shadow-lookup shadow (vector start-idx) t nil)
-;;                              (if mention-shadow
-;;                                  (prog1 nil (setq this-shadowed t))
-;;                                t)))
-;;                    ;; Ignore this definition if it is shadowed by an earlier
-;;                    ;; one in the same keymap.
-;;                    (not (and entire-map
-;;                              (not (eq (lookup-key entire-map (vector start-idx) t)
-;;                                       definition)))))
-;;           (when first
-;;             (insert "\n")
-;;             (setq first nil))
-;;           (when (and prefix (> (length prefix) 0))
-;;             (insert (format "%s" prefix)))
-;;           (insert (help--key-description-fontified (vector start-idx) prefix))
-;;           ;; Find all consecutive characters or rows that have the
-;;           ;; same definition.
-;;           (while (equal (keymap--get-keyelt (aref vector (1+ idx)) nil)
-;;                         definition)
-;;             (setq found-range t)
-;;             (setq idx (1+ idx)))
-;;           ;; If we have a range of more than one character,
-;;           ;; print where the range reaches to.
-;;           (when found-range
-;;             (insert " .. ")
-;;             (when (and prefix (> (length prefix) 0))
-;;               (insert (format "%s" prefix)))
-;;             (insert (help--key-description-fontified (vector idx) prefix)))
-;;           (if transl
-;;               (help--describe-translation definition)
-;;             (help--describe-command definition))
-;;           (when this-shadowed
-;;             (goto-char (1- (point)))
-;;             (insert "  (binding currently shadowed)")
-;;             (goto-char (1+ (point))))))
-;;       (setq idx (1+ idx)))))
-
 \f
 (declare-function x-display-pixel-height "xfns.c" (&optional terminal))
 (declare-function x-display-pixel-width "xfns.c" (&optional terminal))