summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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 @@
/* Simple built-in editing commands.
- Copyright (C) 1985 Free Software Foundation, Inc.
+ Copyright (C) 1985, 1992 Free Software Foundation, Inc.
This file is part of GNU Emacs.
GNU Emacs is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 1, or (at your option)
+the Free Software Foundation; either version 2, or (at your option)
any later version.
GNU 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\
pos = scan_buffer ('\n', pos2, count - negp, &shortage);
if (shortage > 0
&& (negp
- || (ZV >= BEGV
+ || (ZV > BEGV
+ && pos != pos2
&& FETCH_CHAR (pos - 1) != '\n')))
shortage--;
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,
"Return the documentation string of FUNCTION.\n\
Unless a non-nil second argument is given, the\n\
string is passed through `substitute-command-keys'.")
- (fun1, raw)
- Lisp_Object fun1, raw;
+ (function, raw)
+ Lisp_Object function, raw;
{
Lisp_Object fun;
Lisp_Object funcar;
Lisp_Object tem, doc;
- fun = fun1;
- while (XTYPE (fun) == Lisp_Symbol)
- {
- QUIT;
- fun = Fsymbol_function (fun);
- }
+ fun = Findirect_function (function);
switch (XTYPE (fun))
{
@@ -149,11 +144,11 @@ string is passed through `substitute-command-keys'.")
funcar = Fcar (fun);
if (XTYPE (funcar) != Lisp_Symbol)
return Fsignal (Qinvalid_function, Fcons (fun, Qnil));
- if (XSYMBOL (funcar) == XSYMBOL (Qkeymap))
+ else if (EQ (funcar, Qkeymap))
return build_string ("Prefix command (definition is a keymap associating keystrokes with\n\
subcommands.)");
- if (XSYMBOL (funcar) == XSYMBOL (Qlambda)
- || XSYMBOL (funcar) == XSYMBOL (Qautoload))
+ else if (EQ (funcar, Qlambda)
+ || EQ (funcar, Qautoload))
{
tem = Fcar (Fcdr (Fcdr (fun)));
if (XTYPE (tem) == Lisp_String)
@@ -162,10 +157,12 @@ subcommands.)");
doc = get_doc_string (XFASTINT (tem));
else
return Qnil;
+
+ break;
}
- if (XSYMBOL (funcar) == XSYMBOL (Qmocklisp))
+ else if (EQ (funcar, Qmocklisp))
return Qnil;
- if (XSYMBOL (funcar) == XSYMBOL (Qmacro))
+ else if (EQ (funcar, Qmacro))
return Fdocumentation (Fcdr (fun), raw);
/* 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 @@
/* Manipulation of keymaps
- Copyright (C) 1985, 1986, 1987, 1988 Free Software Foundation, Inc.
+ Copyright (C) 1985, 1986, 1987, 1988, 1992 Free Software Foundation, Inc.
This file is part of GNU Emacs.
GNU Emacs is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 1, or (at your option)
+the Free Software Foundation; either version 2, or (at your option)
any later version.
GNU Emacs is distributed in the hope that it will be useful,
@@ -174,12 +174,7 @@ get_keymap_1 (object, error)
{
register Lisp_Object tem;
- tem = object;
- while (XTYPE (tem) == Lisp_Symbol && !EQ (tem, Qunbound))
- {
- tem = XSYMBOL (tem)->function;
- QUIT;
- }
+ tem = indirect_function (object);
if (CONSP (tem) && EQ (XCONS (tem)->car, Qkeymap))
return tem;
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 @@
/* Keyboard macros.
- Copyright (C) 1985, 1986 Free Software Foundation, Inc.
+ Copyright (C) 1985, 1986, 1992 Free Software Foundation, Inc.
This file is part of GNU Emacs.
GNU Emacs is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 1, or (at your option)
+the Free Software Foundation; either version 2, or (at your option)
any later version.
GNU 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.")
prefixarg = Fprefix_numeric_value (prefixarg),
repeat = XINT (prefixarg);
- final = macro;
- while (XTYPE (final) == Lisp_Symbol && !EQ (final, Qunbound))
- final = XSYMBOL (final)->function;
+ final = indirect_function (macro);
if (XTYPE (final) != Lisp_String
&& XTYPE (final) != Lisp_Vector)
error ("Keyboard macros must be strings or vectors.");