Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
emacs
emacs
Commits
dcdffbf6
Commit
dcdffbf6
authored
Feb 24, 1994
by
Richard M. Stallman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(Fkill_buffer): Call the Vkill_buffer_query_functions.
(syms_of_buffer): Make Lisp var for kill-buffer-query-functions.
parent
88902b35
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
1 deletion
+21
-1
src/buffer.c
src/buffer.c
+21
-1
No files found.
src/buffer.c
View file @
dcdffbf6
...
...
@@ -117,6 +117,10 @@ Lisp_Object Vtransient_mark_mode;
Any non-nil value means ignore buffer-read-only. */
Lisp_Object
Vinhibit_read_only
;
/* List of functions to call that can query about killing a buffer.
If any of these functions returns nil, we don't kill it. */
Lisp_Object
Vkill_buffer_query_functions
;
/* List of functions to call before changing an unmodified buffer. */
Lisp_Object
Vfirst_change_hook
;
Lisp_Object
Qfirst_change_hook
;
...
...
@@ -729,13 +733,25 @@ with `delete-process'.")
return
Qnil
;
}
/* Run
kill-buffer
hook with the buffer to be killed the current buffer. */
/* Run hook
s
with the buffer to be killed the current buffer. */
{
register
Lisp_Object
val
;
int
count
=
specpdl_ptr
-
specpdl
;
Lisp_Object
list
;
record_unwind_protect
(
save_excursion_restore
,
save_excursion_save
());
set_buffer_internal
(
b
);
/* First run the query functions; if any query is answered no,
don't kill the buffer. */
for
(
list
=
Vkill_buffer_query_functions
;
!
NILP
(
list
);
list
=
Fcdr
(
list
))
{
tem
=
call0
(
Fcar
(
list
));
if
(
NILP
(
tem
))
return
unbind_to
(
count
,
Qnil
);
}
/* Then run the hooks. */
call1
(
Vrun_hooks
,
Qkill_buffer_hook
);
unbind_to
(
count
,
Qnil
);
}
...
...
@@ -2615,6 +2631,10 @@ and disregard a `read-only' text property if the property value\n\
is a member of the list."
);
Vinhibit_read_only
=
Qnil
;
DEFVAR_LISP
(
"kill-buffer-query-functions"
,
&
Vkill_buffer_query_functions
,
"List of functions called with no args to query before killing a buffer."
);
Vkill_buffer_query_functions
=
Qnil
;
defsubr
(
&
Sbuffer_list
);
defsubr
(
&
Sget_buffer
);
defsubr
(
&
Sget_file_buffer
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment