aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/cmds.c7
-rw-r--r--src/doc.c23
-rw-r--r--src/keymap.c11
-rw-r--r--src/macros.c8
4 files changed, 20 insertions, 29 deletions
diff --git a/src/cmds.c b/src/cmds.c
index 2a212ad6223..915c185bafc 100644
--- a/src/cmds.c
+++ b/src/cmds.c
@@ -1,11 +1,11 @@
1/* Simple built-in editing commands. 1/* Simple built-in editing commands.
2 Copyright (C) 1985 Free Software Foundation, Inc. 2 Copyright (C) 1985, 1992 Free Software Foundation, Inc.
3 3
4This file is part of GNU Emacs. 4This file is part of GNU Emacs.
5 5
6GNU Emacs is free software; you can redistribute it and/or modify 6GNU Emacs is free software; you can redistribute it and/or modify
7it under the terms of the GNU General Public License as published by 7it under the terms of the GNU General Public License as published by
8the Free Software Foundation; either version 1, or (at your option) 8the Free Software Foundation; either version 2, or (at your option)
9any later version. 9any later version.
10 10
11GNU Emacs is distributed in the hope that it will be useful, 11GNU Emacs is distributed in the hope that it will be useful,
@@ -94,7 +94,8 @@ With positive ARG, a non-empty line at the end counts as one line\n\
94 pos = scan_buffer ('\n', pos2, count - negp, &shortage); 94 pos = scan_buffer ('\n', pos2, count - negp, &shortage);
95 if (shortage > 0 95 if (shortage > 0
96 && (negp 96 && (negp
97 || (ZV >= BEGV 97 || (ZV > BEGV
98 && pos != pos2
98 && FETCH_CHAR (pos - 1) != '\n'))) 99 && FETCH_CHAR (pos - 1) != '\n')))
99 shortage--; 100 shortage--;
100 SET_PT (pos); 101 SET_PT (pos);
diff --git a/src/doc.c b/src/doc.c
index 48f6c4df685..6dceb587fcb 100644
--- a/src/doc.c
+++ b/src/doc.c
@@ -105,19 +105,14 @@ DEFUN ("documentation", Fdocumentation, Sdocumentation, 1, 2, 0,
105 "Return the documentation string of FUNCTION.\n\ 105 "Return the documentation string of FUNCTION.\n\
106Unless a non-nil second argument is given, the\n\ 106Unless a non-nil second argument is given, the\n\
107string is passed through `substitute-command-keys'.") 107string is passed through `substitute-command-keys'.")
108 (fun1, raw) 108 (function, raw)
109 Lisp_Object fun1, raw; 109 Lisp_Object function, raw;
110{ 110{
111 Lisp_Object fun; 111 Lisp_Object fun;
112 Lisp_Object funcar; 112 Lisp_Object funcar;
113 Lisp_Object tem, doc; 113 Lisp_Object tem, doc;
114 114
115 fun = fun1; 115 fun = Findirect_function (function);
116 while (XTYPE (fun) == Lisp_Symbol)
117 {
118 QUIT;
119 fun = Fsymbol_function (fun);
120 }
121 116
122 switch (XTYPE (fun)) 117 switch (XTYPE (fun))
123 { 118 {
@@ -149,11 +144,11 @@ string is passed through `substitute-command-keys'.")
149 funcar = Fcar (fun); 144 funcar = Fcar (fun);
150 if (XTYPE (funcar) != Lisp_Symbol) 145 if (XTYPE (funcar) != Lisp_Symbol)
151 return Fsignal (Qinvalid_function, Fcons (fun, Qnil)); 146 return Fsignal (Qinvalid_function, Fcons (fun, Qnil));
152 if (XSYMBOL (funcar) == XSYMBOL (Qkeymap)) 147 else if (EQ (funcar, Qkeymap))
153 return build_string ("Prefix command (definition is a keymap associating keystrokes with\n\ 148 return build_string ("Prefix command (definition is a keymap associating keystrokes with\n\
154subcommands.)"); 149subcommands.)");
155 if (XSYMBOL (funcar) == XSYMBOL (Qlambda) 150 else if (EQ (funcar, Qlambda)
156 || XSYMBOL (funcar) == XSYMBOL (Qautoload)) 151 || EQ (funcar, Qautoload))
157 { 152 {
158 tem = Fcar (Fcdr (Fcdr (fun))); 153 tem = Fcar (Fcdr (Fcdr (fun)));
159 if (XTYPE (tem) == Lisp_String) 154 if (XTYPE (tem) == Lisp_String)
@@ -162,10 +157,12 @@ subcommands.)");
162 doc = get_doc_string (XFASTINT (tem)); 157 doc = get_doc_string (XFASTINT (tem));
163 else 158 else
164 return Qnil; 159 return Qnil;
160
161 break;
165 } 162 }
166 if (XSYMBOL (funcar) == XSYMBOL (Qmocklisp)) 163 else if (EQ (funcar, Qmocklisp))
167 return Qnil; 164 return Qnil;
168 if (XSYMBOL (funcar) == XSYMBOL (Qmacro)) 165 else if (EQ (funcar, Qmacro))
169 return Fdocumentation (Fcdr (fun), raw); 166 return Fdocumentation (Fcdr (fun), raw);
170 167
171 /* Fall through to the default to report an error. */ 168 /* Fall through to the default to report an error. */
diff --git a/src/keymap.c b/src/keymap.c
index 5fde6b20a74..89a273db972 100644
--- a/src/keymap.c
+++ b/src/keymap.c
@@ -1,11 +1,11 @@
1/* Manipulation of keymaps 1/* Manipulation of keymaps
2 Copyright (C) 1985, 1986, 1987, 1988 Free Software Foundation, Inc. 2 Copyright (C) 1985, 1986, 1987, 1988, 1992 Free Software Foundation, Inc.
3 3
4This file is part of GNU Emacs. 4This file is part of GNU Emacs.
5 5
6GNU Emacs is free software; you can redistribute it and/or modify 6GNU Emacs is free software; you can redistribute it and/or modify
7it under the terms of the GNU General Public License as published by 7it under the terms of the GNU General Public License as published by
8the Free Software Foundation; either version 1, or (at your option) 8the Free Software Foundation; either version 2, or (at your option)
9any later version. 9any later version.
10 10
11GNU Emacs is distributed in the hope that it will be useful, 11GNU Emacs is distributed in the hope that it will be useful,
@@ -174,12 +174,7 @@ get_keymap_1 (object, error)
174{ 174{
175 register Lisp_Object tem; 175 register Lisp_Object tem;
176 176
177 tem = object; 177 tem = indirect_function (object);
178 while (XTYPE (tem) == Lisp_Symbol && !EQ (tem, Qunbound))
179 {
180 tem = XSYMBOL (tem)->function;
181 QUIT;
182 }
183 if (CONSP (tem) && EQ (XCONS (tem)->car, Qkeymap)) 178 if (CONSP (tem) && EQ (XCONS (tem)->car, Qkeymap))
184 return tem; 179 return tem;
185 if (error) 180 if (error)
diff --git a/src/macros.c b/src/macros.c
index f9c158c89eb..64e91776f67 100644
--- a/src/macros.c
+++ b/src/macros.c
@@ -1,11 +1,11 @@
1/* Keyboard macros. 1/* Keyboard macros.
2 Copyright (C) 1985, 1986 Free Software Foundation, Inc. 2 Copyright (C) 1985, 1986, 1992 Free Software Foundation, Inc.
3 3
4This file is part of GNU Emacs. 4This file is part of GNU Emacs.
5 5
6GNU Emacs is free software; you can redistribute it and/or modify 6GNU Emacs is free software; you can redistribute it and/or modify
7it under the terms of the GNU General Public License as published by 7it under the terms of the GNU General Public License as published by
8the Free Software Foundation; either version 1, or (at your option) 8the Free Software Foundation; either version 2, or (at your option)
9any later version. 9any later version.
10 10
11GNU Emacs is distributed in the hope that it will be useful, 11GNU Emacs is distributed in the hope that it will be useful,
@@ -201,9 +201,7 @@ COUNT is a repeat count, or nil for once, or 0 for infinite loop.")
201 prefixarg = Fprefix_numeric_value (prefixarg), 201 prefixarg = Fprefix_numeric_value (prefixarg),
202 repeat = XINT (prefixarg); 202 repeat = XINT (prefixarg);
203 203
204 final = macro; 204 final = indirect_function (macro);
205 while (XTYPE (final) == Lisp_Symbol && !EQ (final, Qunbound))
206 final = XSYMBOL (final)->function;
207 if (XTYPE (final) != Lisp_String 205 if (XTYPE (final) != Lisp_String
208 && XTYPE (final) != Lisp_Vector) 206 && XTYPE (final) != Lisp_Vector)
209 error ("Keyboard macros must be strings or vectors."); 207 error ("Keyboard macros must be strings or vectors.");