Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
emacs
emacs
Commits
265a9e55
Commit
265a9e55
authored
Jan 13, 1992
by
Jim Blandy
Browse files
*** empty log message ***
parent
d427b66a
Changes
36
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
670 additions
and
615 deletions
+670
-615
src/alloc.c
src/alloc.c
+5
-5
src/buffer.c
src/buffer.c
+54
-57
src/buffer.h
src/buffer.h
+1
-2
src/bytecode.c
src/bytecode.c
+13
-13
src/callint.c
src/callint.c
+11
-11
src/cmds.c
src/cmds.c
+15
-15
src/commands.h
src/commands.h
+1
-1
src/dired.c
src/dired.c
+8
-10
src/dispextern.h
src/dispextern.h
+14
-9
src/doc.c
src/doc.c
+5
-6
src/eval.c
src/eval.c
+52
-52
src/fileio.c
src/fileio.c
+40
-43
src/filelock.c
src/filelock.c
+6
-7
src/floatfns.c
src/floatfns.c
+31
-10
src/fns.c
src/fns.c
+43
-46
src/frame.c
src/frame.c
+17
-17
src/frame.h
src/frame.h
+29
-8
src/hftctl.c
src/hftctl.c
+220
-200
src/keymap.c
src/keymap.c
+77
-75
src/lread.c
src/lread.c
+28
-28
No files found.
src/alloc.c
View file @
265a9e55
...
@@ -329,7 +329,7 @@ Any number of arguments, even zero arguments, are allowed.")
...
@@ -329,7 +329,7 @@ Any number of arguments, even zero arguments, are allowed.")
XFASTINT
(
len
)
=
nargs
;
XFASTINT
(
len
)
=
nargs
;
val
=
Fmake_list
(
len
,
Qnil
);
val
=
Fmake_list
(
len
,
Qnil
);
val_tail
=
val
;
val_tail
=
val
;
while
(
!
N
ULL
(
val_tail
))
while
(
!
N
ILP
(
val_tail
))
{
{
XCONS
(
val_tail
)
->
car
=
*
args
++
;
XCONS
(
val_tail
)
->
car
=
*
args
++
;
val_tail
=
XCONS
(
val_tail
)
->
cdr
;
val_tail
=
XCONS
(
val_tail
)
->
cdr
;
...
@@ -425,14 +425,14 @@ significance.")
...
@@ -425,14 +425,14 @@ significance.")
register
struct
Lisp_Vector
*
p
;
register
struct
Lisp_Vector
*
p
;
XFASTINT
(
len
)
=
nargs
;
XFASTINT
(
len
)
=
nargs
;
if
(
!
N
ULL
(
Vpurify_flag
))
if
(
!
N
ILP
(
Vpurify_flag
))
val
=
make_pure_vector
(
len
);
val
=
make_pure_vector
(
len
);
else
else
val
=
Fmake_vector
(
len
,
Qnil
);
val
=
Fmake_vector
(
len
,
Qnil
);
p
=
XVECTOR
(
val
);
p
=
XVECTOR
(
val
);
for
(
index
=
0
;
index
<
nargs
;
index
++
)
for
(
index
=
0
;
index
<
nargs
;
index
++
)
{
{
if
(
!
N
ULL
(
Vpurify_flag
))
if
(
!
N
ILP
(
Vpurify_flag
))
args
[
index
]
=
Fpurecopy
(
args
[
index
]);
args
[
index
]
=
Fpurecopy
(
args
[
index
]);
p
->
contents
[
index
]
=
args
[
index
];
p
->
contents
[
index
]
=
args
[
index
];
}
}
...
@@ -905,7 +905,7 @@ Does not copy symbols.")
...
@@ -905,7 +905,7 @@ Does not copy symbols.")
register
Lisp_Object
new
,
tem
;
register
Lisp_Object
new
,
tem
;
register
int
i
;
register
int
i
;
if
(
N
ULL
(
Vpurify_flag
))
if
(
N
ILP
(
Vpurify_flag
))
return
obj
;
return
obj
;
if
((
PNTR_COMPARISON_TYPE
)
XPNTR
(
obj
)
<
(
PNTR_COMPARISON_TYPE
)
((
char
*
)
pure
+
PURESIZE
)
if
((
PNTR_COMPARISON_TYPE
)
XPNTR
(
obj
)
<
(
PNTR_COMPARISON_TYPE
)
((
char
*
)
pure
+
PURESIZE
)
...
@@ -1041,7 +1041,7 @@ Garbage collection happens automatically if you cons more than\n\
...
@@ -1041,7 +1041,7 @@ Garbage collection happens automatically if you cons more than\n\
/* Save a copy of the contents of the stack, for debugging. */
/* Save a copy of the contents of the stack, for debugging. */
#if MAX_SAVE_STACK > 0
#if MAX_SAVE_STACK > 0
if
(
N
ULL
(
Vpurify_flag
))
if
(
N
ILP
(
Vpurify_flag
))
{
{
i
=
&
stack_top_variable
-
stack_bottom
;
i
=
&
stack_top_variable
-
stack_bottom
;
if
(
i
<
0
)
i
=
-
i
;
if
(
i
<
0
)
i
=
-
i
;
...
...
src/buffer.c
View file @
265a9e55
...
@@ -25,9 +25,6 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
...
@@ -25,9 +25,6 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
#define MAXPATHLEN 1024
#define MAXPATHLEN 1024
#endif
/* not MAXPATHLEN */
#endif
/* not MAXPATHLEN */
#ifdef NULL
#undef NULL
#endif
#include "config.h"
#include "config.h"
#include "lisp.h"
#include "lisp.h"
#include "window.h"
#include "window.h"
...
@@ -163,7 +160,7 @@ If there is no such live buffer, return nil.")
...
@@ -163,7 +160,7 @@ If there is no such live buffer, return nil.")
if
(
XTYPE
(
buf
)
!=
Lisp_Buffer
)
continue
;
if
(
XTYPE
(
buf
)
!=
Lisp_Buffer
)
continue
;
if
(
XTYPE
(
XBUFFER
(
buf
)
->
filename
)
!=
Lisp_String
)
continue
;
if
(
XTYPE
(
XBUFFER
(
buf
)
->
filename
)
!=
Lisp_String
)
continue
;
tem
=
Fstring_equal
(
XBUFFER
(
buf
)
->
filename
,
filename
);
tem
=
Fstring_equal
(
XBUFFER
(
buf
)
->
filename
,
filename
);
if
(
!
N
ULL
(
tem
))
if
(
!
N
ILP
(
tem
))
return
buf
;
return
buf
;
}
}
return
Qnil
;
return
Qnil
;
...
@@ -185,7 +182,7 @@ The value is never nil.")
...
@@ -185,7 +182,7 @@ The value is never nil.")
register
struct
buffer
*
b
;
register
struct
buffer
*
b
;
buf
=
Fget_buffer
(
name
);
buf
=
Fget_buffer
(
name
);
if
(
!
N
ULL
(
buf
))
if
(
!
N
ILP
(
buf
))
return
buf
;
return
buf
;
b
=
(
struct
buffer
*
)
malloc
(
sizeof
(
struct
buffer
));
b
=
(
struct
buffer
*
)
malloc
(
sizeof
(
struct
buffer
));
...
@@ -227,14 +224,14 @@ The value is never nil.")
...
@@ -227,14 +224,14 @@ The value is never nil.")
b
->
name
=
name
;
b
->
name
=
name
;
function
=
buffer_defaults
.
major_mode
;
function
=
buffer_defaults
.
major_mode
;
if
(
N
ULL
(
function
))
if
(
N
ILP
(
function
))
{
{
tem
=
Fget
(
current_buffer
->
major_mode
,
Qmode_class
);
tem
=
Fget
(
current_buffer
->
major_mode
,
Qmode_class
);
if
(
EQ
(
tem
,
Qnil
))
if
(
EQ
(
tem
,
Qnil
))
function
=
current_buffer
->
major_mode
;
function
=
current_buffer
->
major_mode
;
}
}
if
(
N
ULL
(
function
)
||
EQ
(
function
,
Qfundamental_mode
))
if
(
N
ILP
(
function
)
||
EQ
(
function
,
Qfundamental_mode
))
return
buf
;
return
buf
;
/* To select a nonfundamental mode,
/* To select a nonfundamental mode,
...
@@ -327,7 +324,7 @@ until an unused name is found, and then return that name.")
...
@@ -327,7 +324,7 @@ until an unused name is found, and then return that name.")
CHECK_STRING
(
name
,
0
);
CHECK_STRING
(
name
,
0
);
tem
=
Fget_buffer
(
name
);
tem
=
Fget_buffer
(
name
);
if
(
N
ULL
(
tem
))
if
(
N
ILP
(
tem
))
return
name
;
return
name
;
count
=
1
;
count
=
1
;
...
@@ -336,7 +333,7 @@ until an unused name is found, and then return that name.")
...
@@ -336,7 +333,7 @@ until an unused name is found, and then return that name.")
sprintf
(
number
,
"<%d>"
,
++
count
);
sprintf
(
number
,
"<%d>"
,
++
count
);
gentemp
=
concat2
(
name
,
build_string
(
number
));
gentemp
=
concat2
(
name
,
build_string
(
number
));
tem
=
Fget_buffer
(
gentemp
);
tem
=
Fget_buffer
(
gentemp
);
if
(
N
ULL
(
tem
))
if
(
N
ILP
(
tem
))
return
gentemp
;
return
gentemp
;
}
}
}
}
...
@@ -348,7 +345,7 @@ With no argument or nil as argument, return the name of the current buffer.")
...
@@ -348,7 +345,7 @@ With no argument or nil as argument, return the name of the current buffer.")
(
buffer
)
(
buffer
)
register
Lisp_Object
buffer
;
register
Lisp_Object
buffer
;
{
{
if
(
N
ULL
(
buffer
))
if
(
N
ILP
(
buffer
))
return
current_buffer
->
name
;
return
current_buffer
->
name
;
CHECK_BUFFER
(
buffer
,
0
);
CHECK_BUFFER
(
buffer
,
0
);
return
XBUFFER
(
buffer
)
->
name
;
return
XBUFFER
(
buffer
)
->
name
;
...
@@ -360,7 +357,7 @@ No argument or nil as argument means use the current buffer.")
...
@@ -360,7 +357,7 @@ No argument or nil as argument means use the current buffer.")
(
buffer
)
(
buffer
)
register
Lisp_Object
buffer
;
register
Lisp_Object
buffer
;
{
{
if
(
N
ULL
(
buffer
))
if
(
N
ILP
(
buffer
))
return
current_buffer
->
filename
;
return
current_buffer
->
filename
;
CHECK_BUFFER
(
buffer
,
0
);
CHECK_BUFFER
(
buffer
,
0
);
return
XBUFFER
(
buffer
)
->
filename
;
return
XBUFFER
(
buffer
)
->
filename
;
...
@@ -378,7 +375,7 @@ No argument or nil as argument means use current buffer as BUFFER.")
...
@@ -378,7 +375,7 @@ No argument or nil as argument means use current buffer as BUFFER.")
register
struct
buffer
*
buf
;
register
struct
buffer
*
buf
;
register
Lisp_Object
val
;
register
Lisp_Object
val
;
if
(
N
ULL
(
buffer
))
if
(
N
ILP
(
buffer
))
buf
=
current_buffer
;
buf
=
current_buffer
;
else
else
{
{
...
@@ -433,7 +430,7 @@ No argument or nil as argument means use current buffer as BUFFER.")
...
@@ -433,7 +430,7 @@ No argument or nil as argument means use current buffer as BUFFER.")
register
Lisp_Object
buffer
;
register
Lisp_Object
buffer
;
{
{
register
struct
buffer
*
buf
;
register
struct
buffer
*
buf
;
if
(
N
ULL
(
buffer
))
if
(
N
ILP
(
buffer
))
buf
=
current_buffer
;
buf
=
current_buffer
;
else
else
{
{
...
@@ -459,17 +456,17 @@ A non-nil FLAG means mark the buffer modified.")
...
@@ -459,17 +456,17 @@ A non-nil FLAG means mark the buffer modified.")
If buffer becoming unmodified, unlock the file. */
If buffer becoming unmodified, unlock the file. */
fn
=
current_buffer
->
filename
;
fn
=
current_buffer
->
filename
;
if
(
!
N
ULL
(
fn
))
if
(
!
N
ILP
(
fn
))
{
{
already
=
current_buffer
->
save_modified
<
MODIFF
;
already
=
current_buffer
->
save_modified
<
MODIFF
;
if
(
!
already
&&
!
N
ULL
(
flag
))
if
(
!
already
&&
!
N
ILP
(
flag
))
lock_file
(
fn
);
lock_file
(
fn
);
else
if
(
already
&&
N
ULL
(
flag
))
else
if
(
already
&&
N
ILP
(
flag
))
unlock_file
(
fn
);
unlock_file
(
fn
);
}
}
#endif
/* CLASH_DETECTION */
#endif
/* CLASH_DETECTION */
current_buffer
->
save_modified
=
N
ULL
(
flag
)
?
MODIFF
:
0
;
current_buffer
->
save_modified
=
N
ILP
(
flag
)
?
MODIFF
:
0
;
update_mode_lines
++
;
update_mode_lines
++
;
return
flag
;
return
flag
;
}
}
...
@@ -484,7 +481,7 @@ No argument or nil as argument means use current buffer as BUFFER.")
...
@@ -484,7 +481,7 @@ No argument or nil as argument means use current buffer as BUFFER.")
register
Lisp_Object
buffer
;
register
Lisp_Object
buffer
;
{
{
register
struct
buffer
*
buf
;
register
struct
buffer
*
buf
;
if
(
N
ULL
(
buffer
))
if
(
N
ILP
(
buffer
))
buf
=
current_buffer
;
buf
=
current_buffer
;
else
else
{
{
...
@@ -513,9 +510,9 @@ This does not change the name of the visited file (if any).")
...
@@ -513,9 +510,9 @@ This does not change the name of the visited file (if any).")
tem
=
Fget_buffer
(
name
);
tem
=
Fget_buffer
(
name
);
if
(
XBUFFER
(
tem
)
==
current_buffer
)
if
(
XBUFFER
(
tem
)
==
current_buffer
)
return
current_buffer
->
name
;
return
current_buffer
->
name
;
if
(
!
N
ULL
(
tem
))
if
(
!
N
ILP
(
tem
))
{
{
if
(
!
N
ULL
(
distinguish
))
if
(
!
N
ILP
(
distinguish
))
name
=
Fgenerate_new_buffer_name
(
name
);
name
=
Fgenerate_new_buffer_name
(
name
);
else
else
error
(
"Buffer name
\"
%s
\"
is in use"
,
XSTRING
(
name
)
->
data
);
error
(
"Buffer name
\"
%s
\"
is in use"
,
XSTRING
(
name
)
->
data
);
...
@@ -524,7 +521,7 @@ This does not change the name of the visited file (if any).")
...
@@ -524,7 +521,7 @@ This does not change the name of the visited file (if any).")
current_buffer
->
name
=
name
;
current_buffer
->
name
=
name
;
XSET
(
buf
,
Lisp_Buffer
,
current_buffer
);
XSET
(
buf
,
Lisp_Buffer
,
current_buffer
);
Fsetcar
(
Frassq
(
buf
,
Vbuffer_alist
),
name
);
Fsetcar
(
Frassq
(
buf
,
Vbuffer_alist
),
name
);
if
(
N
ULL
(
current_buffer
->
filename
)
&&
!
N
ULL
(
current_buffer
->
auto_save_file_name
))
if
(
N
ILP
(
current_buffer
->
filename
)
&&
!
N
ILP
(
current_buffer
->
auto_save_file_name
))
call0
(
intern
(
"rename-auto-save-file"
));
call0
(
intern
(
"rename-auto-save-file"
));
return
name
;
return
name
;
}
}
...
@@ -540,7 +537,7 @@ If BUFFER is omitted or nil, some interesting buffer is returned.")
...
@@ -540,7 +537,7 @@ If BUFFER is omitted or nil, some interesting buffer is returned.")
register
Lisp_Object
tail
,
buf
,
notsogood
,
tem
;
register
Lisp_Object
tail
,
buf
,
notsogood
,
tem
;
notsogood
=
Qnil
;
notsogood
=
Qnil
;
for
(
tail
=
Vbuffer_alist
;
!
N
ULL
(
tail
);
tail
=
Fcdr
(
tail
))
for
(
tail
=
Vbuffer_alist
;
!
N
ILP
(
tail
);
tail
=
Fcdr
(
tail
))
{
{
buf
=
Fcdr
(
Fcar
(
tail
));
buf
=
Fcdr
(
Fcar
(
tail
));
if
(
EQ
(
buf
,
buffer
))
if
(
EQ
(
buf
,
buffer
))
...
@@ -548,12 +545,12 @@ If BUFFER is omitted or nil, some interesting buffer is returned.")
...
@@ -548,12 +545,12 @@ If BUFFER is omitted or nil, some interesting buffer is returned.")
if
(
XSTRING
(
XBUFFER
(
buf
)
->
name
)
->
data
[
0
]
==
' '
)
if
(
XSTRING
(
XBUFFER
(
buf
)
->
name
)
->
data
[
0
]
==
' '
)
continue
;
continue
;
tem
=
Fget_buffer_window
(
buf
,
Qnil
);
tem
=
Fget_buffer_window
(
buf
,
Qnil
);
if
(
N
ULL
(
tem
))
if
(
N
ILP
(
tem
))
return
buf
;
return
buf
;
if
(
N
ULL
(
notsogood
))
if
(
N
ILP
(
notsogood
))
notsogood
=
buf
;
notsogood
=
buf
;
}
}
if
(
!
N
ULL
(
notsogood
))
if
(
!
N
ILP
(
notsogood
))
return
notsogood
;
return
notsogood
;
return
Fget_buffer_create
(
build_string
(
"*scratch*"
));
return
Fget_buffer_create
(
build_string
(
"*scratch*"
));
}
}
...
@@ -579,12 +576,12 @@ No argument or nil as argument means do this for the current buffer.")
...
@@ -579,12 +576,12 @@ No argument or nil as argument means do this for the current buffer.")
register
struct
buffer
*
b
;
register
struct
buffer
*
b
;
register
Lisp_Object
buf1
;
register
Lisp_Object
buf1
;
if
(
N
ULL
(
buf
))
if
(
N
ILP
(
buf
))
b
=
current_buffer
;
b
=
current_buffer
;
else
else
{
{
buf1
=
Fget_buffer
(
buf
);
buf1
=
Fget_buffer
(
buf
);
if
(
N
ULL
(
buf1
))
nsberror
(
buf
);
if
(
N
ILP
(
buf1
))
nsberror
(
buf
);
b
=
XBUFFER
(
buf1
);
b
=
XBUFFER
(
buf1
);
}
}
...
@@ -620,24 +617,24 @@ with `delete-process'.")
...
@@ -620,24 +617,24 @@ with `delete-process'.")
register
struct
Lisp_Marker
*
m
;
register
struct
Lisp_Marker
*
m
;
struct
gcpro
gcpro1
,
gcpro2
;
struct
gcpro
gcpro1
,
gcpro2
;
if
(
N
ULL
(
bufname
))
if
(
N
ILP
(
bufname
))
buf
=
Fcurrent_buffer
();
buf
=
Fcurrent_buffer
();
else
else
buf
=
Fget_buffer
(
bufname
);
buf
=
Fget_buffer
(
bufname
);
if
(
N
ULL
(
buf
))
if
(
N
ILP
(
buf
))
nsberror
(
bufname
);
nsberror
(
bufname
);
b
=
XBUFFER
(
buf
);
b
=
XBUFFER
(
buf
);
/* Query if the buffer is still modified. */
/* Query if the buffer is still modified. */
if
(
INTERACTIVE
&&
!
N
ULL
(
b
->
filename
)
if
(
INTERACTIVE
&&
!
N
ILP
(
b
->
filename
)
&&
BUF_MODIFF
(
b
)
>
b
->
save_modified
)
&&
BUF_MODIFF
(
b
)
>
b
->
save_modified
)
{
{
GCPRO2
(
buf
,
bufname
);
GCPRO2
(
buf
,
bufname
);
tem
=
do_yes_or_no_p
(
format1
(
"Buffer %s modified; kill anyway? "
,
tem
=
do_yes_or_no_p
(
format1
(
"Buffer %s modified; kill anyway? "
,
XSTRING
(
b
->
name
)
->
data
));
XSTRING
(
b
->
name
)
->
data
));
UNGCPRO
;
UNGCPRO
;
if
(
N
ULL
(
tem
))
if
(
N
ILP
(
tem
))
return
Qnil
;
return
Qnil
;
}
}
...
@@ -660,7 +657,7 @@ with `delete-process'.")
...
@@ -660,7 +657,7 @@ with `delete-process'.")
if
(
EQ
(
buf
,
XWINDOW
(
minibuf_window
)
->
buffer
))
if
(
EQ
(
buf
,
XWINDOW
(
minibuf_window
)
->
buffer
))
return
Qnil
;
return
Qnil
;
if
(
N
ULL
(
b
->
name
))
if
(
N
ILP
(
b
->
name
))
return
Qnil
;
return
Qnil
;
/* Make this buffer not be current.
/* Make this buffer not be current.
...
@@ -696,7 +693,7 @@ with `delete-process'.")
...
@@ -696,7 +693,7 @@ with `delete-process'.")
{
{
Lisp_Object
tem
;
Lisp_Object
tem
;
tem
=
Fsymbol_value
(
intern
(
"delete-auto-save-files"
));
tem
=
Fsymbol_value
(
intern
(
"delete-auto-save-files"
));
if
(
!
N
ULL
(
tem
))
if
(
!
N
ILP
(
tem
))
unlink
(
XSTRING
(
b
->
auto_save_file_name
)
->
data
);
unlink
(
XSTRING
(
b
->
auto_save_file_name
)
->
data
);
}
}
...
@@ -739,7 +736,7 @@ record_buffer (buf)
...
@@ -739,7 +736,7 @@ record_buffer (buf)
/* Effectively do Vbuffer_alist = Fdelq (link, Vbuffer_alist)
/* Effectively do Vbuffer_alist = Fdelq (link, Vbuffer_alist)
but cannot use Fdelq here it that allows quitting. */
but cannot use Fdelq here it that allows quitting. */
if
(
N
ULL
(
prev
))
if
(
N
ILP
(
prev
))
Vbuffer_alist
=
XCONS
(
Vbuffer_alist
)
->
cdr
;
Vbuffer_alist
=
XCONS
(
Vbuffer_alist
)
->
cdr
;
else
else
XCONS
(
prev
)
->
cdr
=
XCONS
(
XCONS
(
prev
)
->
cdr
)
->
cdr
;
XCONS
(
prev
)
->
cdr
=
XCONS
(
XCONS
(
prev
)
->
cdr
)
->
cdr
;
...
@@ -766,15 +763,15 @@ the window-buffer correspondences.")
...
@@ -766,15 +763,15 @@ the window-buffer correspondences.")
if
(
EQ
(
minibuf_window
,
selected_window
))
if
(
EQ
(
minibuf_window
,
selected_window
))
error
(
"Cannot switch buffers in minibuffer window"
);
error
(
"Cannot switch buffers in minibuffer window"
);
tem
=
Fwindow_dedicated_p
(
selected_window
);
tem
=
Fwindow_dedicated_p
(
selected_window
);
if
(
!
N
ULL
(
tem
))
if
(
!
N
ILP
(
tem
))
error
(
"Cannot switch buffers in a dedicated window"
);
error
(
"Cannot switch buffers in a dedicated window"
);
if
(
N
ULL
(
bufname
))
if
(
N
ILP
(
bufname
))
buf
=
Fother_buffer
(
Fcurrent_buffer
());
buf
=
Fother_buffer
(
Fcurrent_buffer
());
else
else
buf
=
Fget_buffer_create
(
bufname
);
buf
=
Fget_buffer_create
(
bufname
);
Fset_buffer
(
buf
);
Fset_buffer
(
buf
);
if
(
N
ULL
(
norecord
))
if
(
N
ILP
(
norecord
))
record_buffer
(
buf
);
record_buffer
(
buf
);
Fset_window_buffer
(
EQ
(
selected_window
,
minibuf_window
)
Fset_window_buffer
(
EQ
(
selected_window
,
minibuf_window
)
...
@@ -794,7 +791,7 @@ window even if BUFFER is already visible in the selected window.")
...
@@ -794,7 +791,7 @@ window even if BUFFER is already visible in the selected window.")
Lisp_Object
bufname
,
other
;
Lisp_Object
bufname
,
other
;
{
{
register
Lisp_Object
buf
;
register
Lisp_Object
buf
;
if
(
N
ULL
(
bufname
))
if
(
N
ILP
(
bufname
))
buf
=
Fother_buffer
(
Fcurrent_buffer
());
buf
=
Fother_buffer
(
Fcurrent_buffer
());
else
else
buf
=
Fget_buffer_create
(
bufname
);
buf
=
Fget_buffer_create
(
bufname
);
...
@@ -834,7 +831,7 @@ set_buffer_internal (b)
...
@@ -834,7 +831,7 @@ set_buffer_internal (b)
/* Look down buffer's list of local Lisp variables
/* Look down buffer's list of local Lisp variables
to find and update any that forward into C variables. */
to find and update any that forward into C variables. */
for
(
tail
=
b
->
local_var_alist
;
!
N
ULL
(
tail
);
tail
=
XCONS
(
tail
)
->
cdr
)
for
(
tail
=
b
->
local_var_alist
;
!
N
ILP
(
tail
);
tail
=
XCONS
(
tail
)
->
cdr
)
{
{
valcontents
=
XSYMBOL
(
XCONS
(
XCONS
(
tail
)
->
car
)
->
car
)
->
value
;
valcontents
=
XSYMBOL
(
XCONS
(
XCONS
(
tail
)
->
car
)
->
car
)
->
value
;
if
((
XTYPE
(
valcontents
)
==
Lisp_Buffer_Local_Value
if
((
XTYPE
(
valcontents
)
==
Lisp_Buffer_Local_Value
...
@@ -850,7 +847,7 @@ set_buffer_internal (b)
...
@@ -850,7 +847,7 @@ set_buffer_internal (b)
/* Do the same with any others that were local to the previous buffer */
/* Do the same with any others that were local to the previous buffer */
if
(
old_buf
)
if
(
old_buf
)
for
(
tail
=
old_buf
->
local_var_alist
;
!
N
ULL
(
tail
);
tail
=
XCONS
(
tail
)
->
cdr
)
for
(
tail
=
old_buf
->
local_var_alist
;
!
N
ILP
(
tail
);
tail
=
XCONS
(
tail
)
->
cdr
)
{
{
valcontents
=
XSYMBOL
(
XCONS
(
XCONS
(
tail
)
->
car
)
->
car
)
->
value
;
valcontents
=
XSYMBOL
(
XCONS
(
XCONS
(
tail
)
->
car
)
->
car
)
->
value
;
if
((
XTYPE
(
valcontents
)
==
Lisp_Buffer_Local_Value
if
((
XTYPE
(
valcontents
)
==
Lisp_Buffer_Local_Value
...
@@ -876,9 +873,9 @@ Use `switch-to-buffer' or `pop-to-buffer' to switch buffers permanently.")
...
@@ -876,9 +873,9 @@ Use `switch-to-buffer' or `pop-to-buffer' to switch buffers permanently.")
{
{
register
Lisp_Object
buffer
;
register
Lisp_Object
buffer
;
buffer
=
Fget_buffer
(
bufname
);
buffer
=
Fget_buffer
(
bufname
);
if
(
N
ULL
(
buffer
))
if
(
N
ILP
(
buffer
))
nsberror
(
bufname
);
nsberror
(
bufname
);
if
(
N
ULL
(
XBUFFER
(
buffer
)
->
name
))
if
(
N
ILP
(
XBUFFER
(
buffer
)
->
name
))
error
(
"Selecting deleted buffer"
);
error
(
"Selecting deleted buffer"
);
set_buffer_internal
(
XBUFFER
(
buffer
));
set_buffer_internal
(
XBUFFER
(
buffer
));
return
buffer
;
return
buffer
;
...
@@ -889,7 +886,7 @@ DEFUN ("barf-if-buffer-read-only", Fbarf_if_buffer_read_only,
...
@@ -889,7 +886,7 @@ DEFUN ("barf-if-buffer-read-only", Fbarf_if_buffer_read_only,
"Signal a `buffer-read-only' error if the current buffer is read-only."
)
"Signal a `buffer-read-only' error if the current buffer is read-only."
)
()
()
{
{
while
(
!
N
ULL
(
current_buffer
->
read_only
))
while
(
!
N
ILP
(
current_buffer
->
read_only
))
Fsignal
(
Qbuffer_read_only
,
(
Fcons
(
Fcurrent_buffer
(),
Qnil
)));
Fsignal
(
Qbuffer_read_only
,
(
Fcons
(
Fcurrent_buffer
(),
Qnil
)));
return
Qnil
;
return
Qnil
;
}
}
...
@@ -903,7 +900,7 @@ thus, the least likely buffer for \\[switch-to-buffer] to select by default.")
...
@@ -903,7 +900,7 @@ thus, the least likely buffer for \\[switch-to-buffer] to select by default.")
{
{
register
Lisp_Object
aelt
,
link
;
register
Lisp_Object
aelt
,
link
;
if
(
N
ULL
(
buf
))
if
(
N
ILP
(
buf
))
{
{
XSET
(
buf
,
Lisp_Buffer
,
current_buffer
);
XSET
(
buf
,
Lisp_Buffer
,
current_buffer
);
Fswitch_to_buffer
(
Fother_buffer
(
buf
),
Qnil
);
Fswitch_to_buffer
(
Fother_buffer
(
buf
),
Qnil
);
...
@@ -913,7 +910,7 @@ thus, the least likely buffer for \\[switch-to-buffer] to select by default.")
...
@@ -913,7 +910,7 @@ thus, the least likely buffer for \\[switch-to-buffer] to select by default.")
Lisp_Object
buf1
;
Lisp_Object
buf1
;
buf1
=
Fget_buffer
(
buf
);
buf1
=
Fget_buffer
(
buf
);
if
(
N
ULL
(
buf1
))
if
(
N
ILP
(
buf1
))
nsberror
(
buf
);
nsberror
(
buf
);
buf
=
buf1
;
buf
=
buf1
;
}
}
...
@@ -983,7 +980,7 @@ list_buffers_1 (files)
...
@@ -983,7 +980,7 @@ list_buffers_1 (files)
tail
=
intern
(
"Buffer-menu-mode"
);
tail
=
intern
(
"Buffer-menu-mode"
);
if
(
!
EQ
(
tail
,
current_buffer
->
major_mode
)
if
(
!
EQ
(
tail
,
current_buffer
->
major_mode
)
&&
(
tem
=
Ffboundp
(
tail
),
!
N
ULL
(
tem
)))
&&
(
tem
=
Ffboundp
(
tail
),
!
N
ILP
(
tem
)))
call0
(
tail
);
call0
(
tail
);
Fbuffer_disable_undo
(
Vstandard_output
);
Fbuffer_disable_undo
(
Vstandard_output
);
current_buffer
->
read_only
=
Qnil
;
current_buffer
->
read_only
=
Qnil
;
...
@@ -992,7 +989,7 @@ list_buffers_1 (files)
...
@@ -992,7 +989,7 @@ list_buffers_1 (files)
MR Buffer Size Mode File
\n
\
MR Buffer Size Mode File
\n
\
-- ------ ---- ---- ----
\n
"
,
-
1
);
-- ------ ---- ---- ----
\n
"
,
-
1
);
for
(
tail
=
Vbuffer_alist
;
!
N
ULL
(
tail
);
tail
=
Fcdr
(
tail
))
for
(
tail
=
Vbuffer_alist
;
!
N
ILP
(
tail
);
tail
=
Fcdr
(
tail
))
{
{
buf
=
Fcdr
(
Fcar
(
tail
));
buf
=
Fcdr
(
Fcar
(
tail
));
b
=
XBUFFER
(
buf
);
b
=
XBUFFER
(
buf
);
...
@@ -1000,7 +997,7 @@ list_buffers_1 (files)
...
@@ -1000,7 +997,7 @@ list_buffers_1 (files)
if
(
XSTRING
(
b
->
name
)
->
data
[
0
]
==
' '
)
if
(
XSTRING
(
b
->
name
)
->
data
[
0
]
==
' '
)
continue
;
continue
;
/* Optionally don't mention buffers that lack files. */
/* Optionally don't mention buffers that lack files. */
if
(
!
N
ULL
(
files
)
&&
N
ULL
(
b
->
filename
))
if
(
!
N
ILP
(
files
)
&&
N
ILP
(
b
->
filename
))
continue
;
continue
;
/* Identify the current buffer. */
/* Identify the current buffer. */
if
(
b
==
old
)
if
(
b
==
old
)
...
@@ -1008,7 +1005,7 @@ list_buffers_1 (files)
...
@@ -1008,7 +1005,7 @@ list_buffers_1 (files)
write_string
(
b
==
old
?
"."
:
" "
,
-
1
);
write_string
(
b
==
old
?
"."
:
" "
,
-
1
);
/* Identify modified buffers */
/* Identify modified buffers */
write_string
(
BUF_MODIFF
(
b
)
>
b
->
save_modified
?
"*"
:
" "
,
-
1
);
write_string
(
BUF_MODIFF
(
b
)
>
b
->
save_modified
?
"*"
:
" "
,
-
1
);
write_string
(
N
ULL
(
b
->
read_only
)
?
" "
:
"% "
,
-
1
);
write_string
(
N
ILP
(
b
->
read_only
)
?
" "
:
"% "
,
-
1
);
Fprinc
(
b
->
name
,
Qnil
);
Fprinc
(
b
->
name
,
Qnil
);
Findent_to
(
col1
,
make_number
(
2
));
Findent_to
(
col1
,
make_number
(
2
));
XFASTINT
(
tem
)
=
BUF_Z
(
b
)
-
BUF_BEG
(
b
);
XFASTINT
(
tem
)
=
BUF_Z
(
b
)
-
BUF_BEG
(
b
);
...
@@ -1017,7 +1014,7 @@ list_buffers_1 (files)
...
@@ -1017,7 +1014,7 @@ list_buffers_1 (files)
Fprinc
(
b
->
mode_name
,
Qnil
);
Fprinc
(
b
->
mode_name
,
Qnil
);
Findent_to
(
col3
,
minspace
);
Findent_to
(
col3
,
minspace
);
if
(
!
N
ULL
(
b
->
filename
))
if
(
!
N
ILP
(
b
->
filename
))
Fprinc
(
b
->
filename
,
Qnil
);
Fprinc
(
b
->
filename
,
Qnil
);
else
else
{
{
...
@@ -1025,7 +1022,7 @@ list_buffers_1 (files)
...
@@ -1025,7 +1022,7 @@ list_buffers_1 (files)
Lisp_Object
tem
;
Lisp_Object
tem
;
set_buffer_internal
(
b
);
set_buffer_internal
(
b
);
tem
=
Fboundp
(
other_file_symbol
);