aboutsummaryrefslogtreecommitdiffstats
path: root/src/buffer.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/buffer.c')
-rw-r--r--src/buffer.c32
1 files changed, 22 insertions, 10 deletions
diff --git a/src/buffer.c b/src/buffer.c
index 02ca23eb2dd..b177c5eaa7f 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -781,15 +781,22 @@ fetch_buffer_markers (struct buffer *b)
781 781
782 782
783DEFUN ("make-indirect-buffer", Fmake_indirect_buffer, Smake_indirect_buffer, 783DEFUN ("make-indirect-buffer", Fmake_indirect_buffer, Smake_indirect_buffer,
784 2, 3, 784 2, 4,
785 "bMake indirect buffer (to buffer): \nBName of indirect buffer: ", 785 "bMake indirect buffer (to buffer): \nBName of indirect buffer: ",
786 doc: /* Create and return an indirect buffer for buffer BASE-BUFFER, named NAME. 786 doc: /* Create and return an indirect buffer for buffer BASE-BUFFER, named NAME.
787BASE-BUFFER should be a live buffer, or the name of an existing buffer. 787BASE-BUFFER should be a live buffer, or the name of an existing buffer.
788
788NAME should be a string which is not the name of an existing buffer. 789NAME should be a string which is not the name of an existing buffer.
789Optional argument CLONE non-nil means preserve BASE-BUFFER's state, 790Optional argument CLONE non-nil means preserve BASE-BUFFER's state,
790such as major and minor modes, in the indirect buffer. 791such as major and minor modes, in the indirect buffer.
791CLONE nil means the indirect buffer's state is reset to default values. */) 792
792 (Lisp_Object base_buffer, Lisp_Object name, Lisp_Object clone) 793CLONE nil means the indirect buffer's state is reset to default values.
794
795If optional argument INHIBIT-BUFFER-HOOKS is non-nil, the new buffer
796does not run the hooks `kill-buffer-hook',
797`kill-buffer-query-functions', and `buffer-list-update-hook'. */)
798 (Lisp_Object base_buffer, Lisp_Object name, Lisp_Object clone,
799 Lisp_Object inhibit_buffer_hooks)
793{ 800{
794 Lisp_Object buf, tem; 801 Lisp_Object buf, tem;
795 struct buffer *b; 802 struct buffer *b;
@@ -834,6 +841,7 @@ CLONE nil means the indirect buffer's state is reset to default values. */)
834 b->pt_byte = b->base_buffer->pt_byte; 841 b->pt_byte = b->base_buffer->pt_byte;
835 b->begv_byte = b->base_buffer->begv_byte; 842 b->begv_byte = b->base_buffer->begv_byte;
836 b->zv_byte = b->base_buffer->zv_byte; 843 b->zv_byte = b->base_buffer->zv_byte;
844 b->inhibit_buffer_hooks = !NILP (inhibit_buffer_hooks);
837 845
838 b->newline_cache = 0; 846 b->newline_cache = 0;
839 b->width_run_cache = 0; 847 b->width_run_cache = 0;
@@ -1076,12 +1084,12 @@ reset_buffer_local_variables (struct buffer *b, bool permanent_too)
1076 for (newlist = Qnil; CONSP (list); list = XCDR (list)) 1084 for (newlist = Qnil; CONSP (list); list = XCDR (list))
1077 { 1085 {
1078 Lisp_Object elt = XCAR (list); 1086 Lisp_Object elt = XCAR (list);
1079 /* Preserve element ELT if it's t, 1087 /* Preserve element ELT if it's t, or if it is a
1080 if it is a function with a `permanent-local-hook' property, 1088 function with a `permanent-local-hook'
1081 or if it's not a symbol. */ 1089 property. */
1082 if (! SYMBOLP (elt) 1090 if (EQ (elt, Qt)
1083 || EQ (elt, Qt) 1091 || (SYMBOLP (elt)
1084 || !NILP (Fget (elt, Qpermanent_local_hook))) 1092 && !NILP (Fget (elt, Qpermanent_local_hook))))
1085 newlist = Fcons (elt, newlist); 1093 newlist = Fcons (elt, newlist);
1086 } 1094 }
1087 newlist = Fnreverse (newlist); 1095 newlist = Fnreverse (newlist);
@@ -4214,7 +4222,11 @@ OVERLAY. */)
4214 4222
4215DEFUN ("overlays-at", Foverlays_at, Soverlays_at, 1, 2, 0, 4223DEFUN ("overlays-at", Foverlays_at, Soverlays_at, 1, 2, 0,
4216 doc: /* Return a list of the overlays that contain the character at POS. 4224 doc: /* Return a list of the overlays that contain the character at POS.
4217If SORTED is non-nil, then sort them by decreasing priority. */) 4225If SORTED is non-nil, then sort them by decreasing priority.
4226
4227Zero-length overlays that start and stop at POS are not included in
4228the return value. Instead use `overlays-in' if those overlays are of
4229interest. */)
4218 (Lisp_Object pos, Lisp_Object sorted) 4230 (Lisp_Object pos, Lisp_Object sorted)
4219{ 4231{
4220 ptrdiff_t len, noverlays; 4232 ptrdiff_t len, noverlays;