comparison src/keymap.c @ 13245:2e0c4159e94b

(describe_map_tree): New arg always_title. Callers changed.
author Richard M. Stallman <rms@gnu.org>
date Thu, 19 Oct 1995 00:17:11 +0000
parents e9007fec678e
children cc0f24bdfab1
comparison
equal deleted inserted replaced
13244:23281af757c9 13245:2e0c4159e94b
1872 insert ("\n", 1); 1872 insert ("\n", 1);
1873 } 1873 }
1874 1874
1875 if (!NILP (Vkey_translation_map)) 1875 if (!NILP (Vkey_translation_map))
1876 describe_map_tree (Vkey_translation_map, 0, Qnil, prefix, 1876 describe_map_tree (Vkey_translation_map, 0, Qnil, prefix,
1877 "Key translations", 0, 1); 1877 "Key translations", 0, 1, 0);
1878 1878
1879 { 1879 {
1880 int i, nmaps; 1880 int i, nmaps;
1881 Lisp_Object *modes, *maps; 1881 Lisp_Object *modes, *maps;
1882 1882
1911 *p++ = '\''; 1911 *p++ = '\'';
1912 bcopy (" Minor Mode Bindings", p, sizeof (" Minor Mode Bindings") - 1); 1912 bcopy (" Minor Mode Bindings", p, sizeof (" Minor Mode Bindings") - 1);
1913 p += sizeof (" Minor Mode Bindings") - 1; 1913 p += sizeof (" Minor Mode Bindings") - 1;
1914 *p = 0; 1914 *p = 0;
1915 1915
1916 describe_map_tree (maps[i], 0, shadow, prefix, title, 0, 0); 1916 describe_map_tree (maps[i], 0, shadow, prefix, title, 0, 0, 0);
1917 shadow = Fcons (maps[i], shadow); 1917 shadow = Fcons (maps[i], shadow);
1918 } 1918 }
1919 } 1919 }
1920 1920
1921 /* Print the (major mode) local map. */ 1921 /* Print the (major mode) local map. */
1927 start1 = XBUFFER (descbuf)->keymap; 1927 start1 = XBUFFER (descbuf)->keymap;
1928 1928
1929 if (!NILP (start1)) 1929 if (!NILP (start1))
1930 { 1930 {
1931 describe_map_tree (start1, 0, shadow, prefix, 1931 describe_map_tree (start1, 0, shadow, prefix,
1932 "Major Mode Bindings", 0, 0); 1932 "Major Mode Bindings", 0, 0, 0);
1933 shadow = Fcons (start1, shadow); 1933 shadow = Fcons (start1, shadow);
1934 } 1934 }
1935 1935
1936 describe_map_tree (current_global_map, 0, shadow, prefix, 1936 describe_map_tree (current_global_map, 0, shadow, prefix,
1937 "Global Bindings", 0, 0); 1937 "Global Bindings", 0, 0, 1);
1938 1938
1939 /* Print the function-key-map translations under this prefix. */ 1939 /* Print the function-key-map translations under this prefix. */
1940 if (!NILP (Vfunction_key_map)) 1940 if (!NILP (Vfunction_key_map))
1941 describe_map_tree (Vfunction_key_map, 0, Qnil, prefix, 1941 describe_map_tree (Vfunction_key_map, 0, Qnil, prefix,
1942 "Function key map translations", 0, 1); 1942 "Function key map translations", 0, 1, 0);
1943 1943
1944 call0 (intern ("help-mode")); 1944 call0 (intern ("help-mode"));
1945 Fset_buffer (descbuf); 1945 Fset_buffer (descbuf);
1946 UNGCPRO; 1946 UNGCPRO;
1947 return Qnil; 1947 return Qnil;
1957 TITLE, if not 0, is a string to insert at the beginning. 1957 TITLE, if not 0, is a string to insert at the beginning.
1958 TITLE should not end with a colon or a newline; we supply that. 1958 TITLE should not end with a colon or a newline; we supply that.
1959 If NOMENU is not 0, then omit menu-bar commands. 1959 If NOMENU is not 0, then omit menu-bar commands.
1960 1960
1961 If TRANSL is nonzero, the definitions are actually key translations 1961 If TRANSL is nonzero, the definitions are actually key translations
1962 so print strings and vectors differently. */ 1962 so print strings and vectors differently.
1963
1964 If ALWAYS_TITLE is nonzero, print the title even if there are no maps
1965 to look through. */
1963 1966
1964 void 1967 void
1965 describe_map_tree (startmap, partial, shadow, prefix, title, nomenu, transl) 1968 describe_map_tree (startmap, partial, shadow, prefix, title, nomenu, transl,
1969 always_title)
1966 Lisp_Object startmap, shadow, prefix; 1970 Lisp_Object startmap, shadow, prefix;
1967 int partial; 1971 int partial;
1968 char *title; 1972 char *title;
1969 int nomenu; 1973 int nomenu;
1970 int transl; 1974 int transl;
1975 int always_title;
1971 { 1976 {
1972 Lisp_Object maps, seen, sub_shadows; 1977 Lisp_Object maps, seen, sub_shadows;
1973 struct gcpro gcpro1, gcpro2, gcpro3; 1978 struct gcpro gcpro1, gcpro2, gcpro3;
1974 int something = 0; 1979 int something = 0;
1975 char *key_heading 1980 char *key_heading
2000 maps = Fdelq (elt, maps); 2005 maps = Fdelq (elt, maps);
2001 } 2006 }
2002 } 2007 }
2003 } 2008 }
2004 2009
2005 if (!NILP (maps)) 2010 if (!NILP (maps) || always_title)
2006 { 2011 {
2007 if (title) 2012 if (title)
2008 { 2013 {
2009 insert_string (title); 2014 insert_string (title);
2010 if (!NILP (prefix)) 2015 if (!NILP (prefix))