aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Kangas2024-11-13 23:26:41 +0100
committerStefan Kangas2024-11-13 23:29:57 +0100
commit96656c77e282939a84b19a9ccbbea5fbea948e33 (patch)
tree9a86719537e6b8d3e34dea150a22848e304865c3
parent8e27f5bc5276287038dcdbaa8d09bc42f61d1073 (diff)
downloademacs-96656c77e282939a84b19a9ccbbea5fbea948e33.tar.gz
emacs-96656c77e282939a84b19a9ccbbea5fbea948e33.zip
Delete commented out help--describe-vector implementation
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.
-rw-r--r--lisp/help.el73
1 files changed, 0 insertions, 73 deletions
diff --git a/lisp/help.el b/lisp/help.el
index 1617afdcd6e..ef0b7ffc01d 100644
--- a/lisp/help.el
+++ b/lisp/help.el
@@ -1884,79 +1884,6 @@ in `help--describe-map-tree'."
1884 (- width (car elem)) 1884 (- width (car elem))
1885 (mod width tab-width)))))) 1885 (mod width tab-width))))))
1886 1886
1887;;;; This Lisp version is 100 times slower than its C equivalent:
1888;;
1889;; (defun help--describe-vector
1890;; (vector prefix transl partial shadow entire-map mention-shadow)
1891;; "Insert in the current buffer a description of the contents of VECTOR.
1892;;
1893;; PREFIX a prefix key which leads to the keymap that this vector is
1894;; in.
1895;;
1896;; If PARTIAL, it means do not mention suppressed commands
1897;; (that assumes the vector is in a keymap).
1898;;
1899;; SHADOW is a list of keymaps that shadow this map. If it is
1900;; non-nil, look up the key in those maps and don't mention it if it
1901;; is defined by any of them.
1902;;
1903;; ENTIRE-MAP is the vector in which this vector appears.
1904;; If the definition in effect in the whole map does not match
1905;; the one in this vector, we ignore this one."
1906;; ;; Converted from describe_vector in keymap.c.
1907;; (let* ((first t)
1908;; (idx 0))
1909;; (while (< idx (length vector))
1910;; (let* ((val (aref vector idx))
1911;; (definition (keymap--get-keyelt val nil))
1912;; (start-idx idx)
1913;; this-shadowed
1914;; found-range)
1915;; (when (and definition
1916;; ;; Don't mention suppressed commands.
1917;; (not (and partial
1918;; (symbolp definition)
1919;; (get definition 'suppress-keymap)))
1920;; ;; If this binding is shadowed by some other map,
1921;; ;; ignore it.
1922;; (not (and shadow
1923;; (help--shadow-lookup shadow (vector start-idx) t nil)
1924;; (if mention-shadow
1925;; (prog1 nil (setq this-shadowed t))
1926;; t)))
1927;; ;; Ignore this definition if it is shadowed by an earlier
1928;; ;; one in the same keymap.
1929;; (not (and entire-map
1930;; (not (eq (lookup-key entire-map (vector start-idx) t)
1931;; definition)))))
1932;; (when first
1933;; (insert "\n")
1934;; (setq first nil))
1935;; (when (and prefix (> (length prefix) 0))
1936;; (insert (format "%s" prefix)))
1937;; (insert (help--key-description-fontified (vector start-idx) prefix))
1938;; ;; Find all consecutive characters or rows that have the
1939;; ;; same definition.
1940;; (while (equal (keymap--get-keyelt (aref vector (1+ idx)) nil)
1941;; definition)
1942;; (setq found-range t)
1943;; (setq idx (1+ idx)))
1944;; ;; If we have a range of more than one character,
1945;; ;; print where the range reaches to.
1946;; (when found-range
1947;; (insert " .. ")
1948;; (when (and prefix (> (length prefix) 0))
1949;; (insert (format "%s" prefix)))
1950;; (insert (help--key-description-fontified (vector idx) prefix)))
1951;; (if transl
1952;; (help--describe-translation definition)
1953;; (help--describe-command definition))
1954;; (when this-shadowed
1955;; (goto-char (1- (point)))
1956;; (insert " (binding currently shadowed)")
1957;; (goto-char (1+ (point))))))
1958;; (setq idx (1+ idx)))))
1959
1960 1887
1961(declare-function x-display-pixel-height "xfns.c" (&optional terminal)) 1888(declare-function x-display-pixel-height "xfns.c" (&optional terminal))
1962(declare-function x-display-pixel-width "xfns.c" (&optional terminal)) 1889(declare-function x-display-pixel-width "xfns.c" (&optional terminal))