diff options
| author | Richard M. Stallman | 1993-06-28 19:20:28 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1993-06-28 19:20:28 +0000 |
| commit | 99a225a911da3249b4aa15e8c94ed41bf4719258 (patch) | |
| tree | 9014d5fca70519d5baed945613f1685664092549 /src | |
| parent | 1bd4e7608f017775061564eec8158ac21f6c3fdf (diff) | |
| download | emacs-99a225a911da3249b4aa15e8c94ed41bf4719258.tar.gz emacs-99a225a911da3249b4aa15e8c94ed41bf4719258.zip | |
(describe_map_2): Cleanups.
Check there's no previous definition in same keymap.
Diffstat (limited to 'src')
| -rw-r--r-- | src/keymap.c | 33 |
1 files changed, 17 insertions, 16 deletions
diff --git a/src/keymap.c b/src/keymap.c index e08a285ae6c..9cef916565b 100644 --- a/src/keymap.c +++ b/src/keymap.c | |||
| @@ -1841,8 +1841,8 @@ describe_map_2 (keymap, elt_prefix, elt_describer, partial, shadow) | |||
| 1841 | int partial; | 1841 | int partial; |
| 1842 | Lisp_Object shadow; | 1842 | Lisp_Object shadow; |
| 1843 | { | 1843 | { |
| 1844 | Lisp_Object this; | 1844 | Lisp_Object definition, event; |
| 1845 | Lisp_Object tem1, tem2 = Qnil; | 1845 | Lisp_Object tem; |
| 1846 | Lisp_Object suppress; | 1846 | Lisp_Object suppress; |
| 1847 | Lisp_Object kludge; | 1847 | Lisp_Object kludge; |
| 1848 | int first = 1; | 1848 | int first = 1; |
| @@ -1855,8 +1855,9 @@ describe_map_2 (keymap, elt_prefix, elt_describer, partial, shadow) | |||
| 1855 | that is done once per keymap element, we don't want to cons up a | 1855 | that is done once per keymap element, we don't want to cons up a |
| 1856 | fresh vector every time. */ | 1856 | fresh vector every time. */ |
| 1857 | kludge = Fmake_vector (make_number (1), Qnil); | 1857 | kludge = Fmake_vector (make_number (1), Qnil); |
| 1858 | definition = Qnil; | ||
| 1858 | 1859 | ||
| 1859 | GCPRO3 (elt_prefix, tem2, kludge); | 1860 | GCPRO3 (elt_prefix, definition, kludge); |
| 1860 | 1861 | ||
| 1861 | for (; CONSP (keymap); keymap = Fcdr (keymap)) | 1862 | for (; CONSP (keymap); keymap = Fcdr (keymap)) |
| 1862 | { | 1863 | { |
| @@ -1867,30 +1868,31 @@ describe_map_2 (keymap, elt_prefix, elt_describer, partial, shadow) | |||
| 1867 | elt_prefix, elt_describer, partial, shadow); | 1868 | elt_prefix, elt_describer, partial, shadow); |
| 1868 | else | 1869 | else |
| 1869 | { | 1870 | { |
| 1870 | tem1 = Fcar_safe (Fcar (keymap)); | 1871 | event = Fcar_safe (Fcar (keymap)); |
| 1871 | tem2 = get_keyelt (Fcdr_safe (Fcar (keymap))); | 1872 | definition = get_keyelt (Fcdr_safe (Fcar (keymap))); |
| 1872 | 1873 | ||
| 1873 | /* Don't show undefined commands or suppressed commands. */ | 1874 | /* Don't show undefined commands or suppressed commands. */ |
| 1874 | if (NILP (tem2)) continue; | 1875 | if (NILP (definition)) continue; |
| 1875 | if (XTYPE (tem2) == Lisp_Symbol && partial) | 1876 | if (XTYPE (definition) == Lisp_Symbol && partial) |
| 1876 | { | 1877 | { |
| 1877 | this = Fget (tem2, suppress); | 1878 | tem = Fget (definition, suppress); |
| 1878 | if (!NILP (this)) | 1879 | if (!NILP (tem)) |
| 1879 | continue; | 1880 | continue; |
| 1880 | } | 1881 | } |
| 1881 | 1882 | ||
| 1882 | /* Don't show a command that isn't really visible | 1883 | /* Don't show a command that isn't really visible |
| 1883 | because a local definition of the same key shadows it. */ | 1884 | because a local definition of the same key shadows it. */ |
| 1884 | 1885 | ||
| 1886 | XVECTOR (kludge)->contents[0] = event; | ||
| 1885 | if (!NILP (shadow)) | 1887 | if (!NILP (shadow)) |
| 1886 | { | 1888 | { |
| 1887 | Lisp_Object tem; | ||
| 1888 | |||
| 1889 | XVECTOR (kludge)->contents[0] = tem1; | ||
| 1890 | tem = Flookup_key (shadow, kludge, Qt); | 1889 | tem = Flookup_key (shadow, kludge, Qt); |
| 1891 | if (!NILP (tem)) continue; | 1890 | if (!NILP (tem)) continue; |
| 1892 | } | 1891 | } |
| 1893 | 1892 | ||
| 1893 | tem = Flookup_key (map, kludge, Qt); | ||
| 1894 | if (! EQ (tem, definition)) continue; | ||
| 1895 | |||
| 1894 | if (first) | 1896 | if (first) |
| 1895 | { | 1897 | { |
| 1896 | insert ("\n", 1); | 1898 | insert ("\n", 1); |
| @@ -1900,14 +1902,13 @@ describe_map_2 (keymap, elt_prefix, elt_describer, partial, shadow) | |||
| 1900 | if (!NILP (elt_prefix)) | 1902 | if (!NILP (elt_prefix)) |
| 1901 | insert1 (elt_prefix); | 1903 | insert1 (elt_prefix); |
| 1902 | 1904 | ||
| 1903 | /* THIS gets the string to describe the character TEM1. */ | 1905 | /* THIS gets the string to describe the character EVENT. */ |
| 1904 | this = Fsingle_key_description (tem1); | 1906 | insert1 (Fsingle_key_description (event)); |
| 1905 | insert1 (this); | ||
| 1906 | 1907 | ||
| 1907 | /* Print a description of the definition of this character. | 1908 | /* Print a description of the definition of this character. |
| 1908 | elt_describer will take care of spacing out far enough | 1909 | elt_describer will take care of spacing out far enough |
| 1909 | for alignment purposes. */ | 1910 | for alignment purposes. */ |
| 1910 | (*elt_describer) (tem2); | 1911 | (*elt_describer) (definition); |
| 1911 | } | 1912 | } |
| 1912 | } | 1913 | } |
| 1913 | 1914 | ||