Now on revision 109189. ------------------------------------------------------------ revno: 109189 committer: Vincent Belaïche branch nick: trunk timestamp: Sun 2012-07-22 23:14:12 +0200 message: * ses.el (ses-cell-formula-aset): New macro. (ses-cell-references-aset): New macro. (ses-cell-p): New function. (ses-rename-cell): Do no longer rely on complex operations like ses-cell-set-formula or ses-set-cell to change the cell and handle the undo at the same time, but rather use lower level new macros `ses-cell-formula-aset' and `ses-cell-references-aset' and handle the undo directly. Refresh the mode line. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-07-21 06:13:23 +0000 +++ lisp/ChangeLog 2012-07-22 21:14:12 +0000 @@ -1,3 +1,14 @@ +2012-07-22 Vincent Belaïche + + * ses.el (ses-cell-formula-aset): New macro. + (ses-cell-references-aset): New macro. + (ses-cell-p): New function. + (ses-rename-cell): Do no longer rely on complex operations like + ses-cell-set-formula or ses-set-cell to change the cell and handle + the undo at the same time, but rather use lower level new macros + `ses-cell-formula-aset' and `ses-cell-references-aset' and handle + the undo directly. Refresh the mode line. + 2012-07-21 Leo Liu * progmodes/cc-cmds.el (c-defun-name): Use === modified file 'lisp/ses.el' --- lisp/ses.el 2012-07-22 04:11:49 +0000 +++ lisp/ses.el 2012-07-22 21:14:12 +0000 @@ -362,6 +362,10 @@ "From a CELL or a pair (ROW,COL), get the function that computes its value." `(aref ,(if col `(ses-get-cell ,row ,col) row) 1)) +(defmacro ses-cell-formula-aset (cell formula) + "From a CELL set the function that computes its value." + `(aset ,cell 1 ,formula)) + (defmacro ses-cell-printer (row &optional col) "From a CELL or a pair (ROW,COL), get the function that prints its value." `(aref ,(if col `(ses-get-cell ,row ,col) row) 2)) @@ -371,6 +375,19 @@ functions refer to its value." `(aref ,(if col `(ses-get-cell ,row ,col) row) 3)) +(defmacro ses-cell-references-aset (cell references) + "From a CELL set the list REFERENCES of symbols for cells the +function of which refer to its value." + `(aset ,cell 3 ,references)) + +(defun ses-cell-p (cell) + "Return non `nil' is CELL is a cell of current buffer." + (and (vectorp cell) + (= (length cell) 5) + (eq cell (let ((rowcol (ses-sym-rowcol (ses-cell-symbol cell)))) + (and (consp rowcol) + (ses-get-cell (car rowcol) (cdr rowcol))))))) + (defun ses-cell-property-get-fun (property-name cell) ;; To speed up property fetching, each time a property is found it is placed ;; in the first position. This way, after the first get, the full property @@ -3193,50 +3210,52 @@ (setq formula (cdr formula)))) new-formula)) -(defun ses-rename-cell (new-name) +(defun ses-rename-cell (new-name &optional cell) "Rename current cell." (interactive "*SEnter new name: ") - (ses-check-curcell) - (or - (and (local-variable-p new-name) - (ses-sym-rowcol new-name) - ;; this test is needed because ses-cell property of deleted cells - ;; is not deleted in case of subsequent undo - (memq new-name ses--renamed-cell-symb-list) - (error "Already a cell name")) - (and (boundp new-name) - (null (yes-or-no-p (format "`%S' is already bound outside this buffer, continue? " - new-name))) - (error "Already a bound cell name"))) - (let* ((rowcol (ses-sym-rowcol ses--curcell)) + (and (local-variable-p new-name) + (ses-sym-rowcol new-name) + ;; this test is needed because ses-cell property of deleted cells + ;; is not deleted in case of subsequent undo + (memq new-name ses--renamed-cell-symb-list) + (error "Already a cell name")) + (and (boundp new-name) + (null (yes-or-no-p (format "`%S' is already bound outside this buffer, continue? " + new-name))) + (error "Already a bound cell name")) + (let* ((sym (if (ses-cell-p cell) + (ses-cell-symbol cell) + (setq cell nil) + (ses-check-curcell) + ses--curcell)) + (rowcol (ses-sym-rowcol sym)) (row (car rowcol)) - (col (cdr rowcol)) - (cell (ses-get-cell row col))) + (col (cdr rowcol))) + (setq cell (or cell (ses-get-cell row col))) + (push `(ses-rename-cell ,(ses-cell-symbol cell) ,cell) buffer-undo-list) (put new-name 'ses-cell rowcol) - ;; Replace name by new name in formula of cells referring to renamed cell. + ;; replace name by new name in formula of cells refering to renamed cell (dolist (ref (ses-cell-references cell)) (let* ((x (ses-sym-rowcol ref)) (xcell (ses-get-cell (car x) (cdr x)))) - (ses-cell-set-formula (car rowcol) - (cdr rowcol) - (ses-replace-name-in-formula - (ses-cell-formula xcell) - ses--curcell - new-name)))) + (ses-cell-formula-aset xcell + (ses-replace-name-in-formula + (ses-cell-formula xcell) + sym + new-name)))) ;; replace name by new name in reference list of cells to which renamed cell refers to (dolist (ref (ses-formula-references (ses-cell-formula cell))) (let* ((x (ses-sym-rowcol ref)) - (xrow (car x)) - (xcol (cdr x))) - (ses-set-cell xrow xcol 'references - (cons new-name (delq ses--curcell - (ses-cell-references xrow xcol)))))) + (xcell (ses-get-cell (car x) (cdr x)))) + (ses-cell-references-aset xcell + (cons new-name (delq sym + (ses-cell-references xcell)))))) (push new-name ses--renamed-cell-symb-list) - (set new-name (symbol-value ses--curcell)) + (set new-name (symbol-value sym)) (aset cell 0 new-name) - (put ses--curcell 'ses-cell nil) - (makunbound ses--curcell) - (setq ses--curcell new-name) + (put sym 'ses-cell nil) + (makunbound sym) + (setq sym new-name) (let* ((pos (point)) (inhibit-read-only t) (col (current-column)) @@ -3245,7 +3264,11 @@ (if (eolp) (+ pos (ses-col-width col) 1) (point))))) - (put-text-property pos end 'intangible new-name))) ) + (put-text-property pos end 'intangible new-name)) + ;; update mode line + (setq mode-line-process (list " cell " + (symbol-name sym))) + (force-mode-line-update))) ;;---------------------------------------------------------------------------- ;; Checking formulas for safety ------------------------------------------------------------ revno: 109188 fixes bug(s): http://debbugs.gnu.org/12005 committer: Jan D. branch nick: trunk timestamp: Sun 2012-07-22 18:35:15 +0200 message: * nsmenu.m (Popdown_data): New struct. (pop_down_menu): p->pointer is Popdown_data. Release the pool and free Popdown_data. (ns_popup_dialog): Use NSAutoreleasePool and pass it to pop_down_menu. (initWithContentRect): Make imgView and contentView non-static and autorelease them. Also autorelease img and matrix. (dealloc): Remove (Bug#12005). diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2012-07-22 15:13:50 +0000 +++ src/ChangeLog 2012-07-22 16:35:15 +0000 @@ -1,3 +1,13 @@ +2012-07-22 Jan Djärv + + * nsmenu.m (Popdown_data): New struct. + (pop_down_menu): p->pointer is Popdown_data. Release the pool and + free Popdown_data. + (ns_popup_dialog): Use NSAutoreleasePool and pass it to pop_down_menu. + (initWithContentRect): Make imgView and contentView non-static + and autorelease them. Also autorelease img and matrix (Bug#12005). + (dealloc): Remove (Bug#12005). + 2012-07-22 Dmitry Antipov Adjust consing_since_gc when objects are explicitly freed. === modified file 'src/nsmenu.m' --- src/nsmenu.m 2012-07-13 18:03:10 +0000 +++ src/nsmenu.m 2012-07-22 16:35:15 +0000 @@ -1349,20 +1349,33 @@ ========================================================================== */ +struct Popdown_data +{ + NSAutoreleasePool *pool; + EmacsDialogPanel *dialog; +}; static Lisp_Object pop_down_menu (Lisp_Object arg) { struct Lisp_Save_Value *p = XSAVE_VALUE (arg); + struct Popdown_data *unwind_data = (struct Popdown_data *) p->pointer; + + BLOCK_INPUT; if (popup_activated_flag) { + EmacsDialogPanel *panel = unwind_data->dialog; popup_activated_flag = 0; - BLOCK_INPUT; [NSApp endModalSession: popupSession]; - [((EmacsDialogPanel *) (p->pointer)) close]; + + [panel close]; + [unwind_data->pool release]; [[FRAME_NS_VIEW (SELECTED_FRAME ()) window] makeKeyWindow]; - UNBLOCK_INPUT; } + + xfree (unwind_data); + UNBLOCK_INPUT; + return Qnil; } @@ -1375,6 +1388,7 @@ struct frame *f; NSPoint p; BOOL isQ; + NSAutoreleasePool *pool; NSTRACE (x-popup-dialog); @@ -1429,15 +1443,23 @@ contents = Fcons (title, Fcons (Fcons (build_string ("Ok"), Qt), Qnil)); BLOCK_INPUT; + pool = [[NSAutoreleasePool alloc] init]; dialog = [[EmacsDialogPanel alloc] initFromContents: contents isQuestion: isQ]; + { ptrdiff_t specpdl_count = SPECPDL_INDEX (); - record_unwind_protect (pop_down_menu, make_save_value (dialog, 0)); + struct Popdown_data *unwind_data = xmalloc (sizeof (*unwind_data)); + + unwind_data->pool = pool; + unwind_data->dialog = dialog; + + record_unwind_protect (pop_down_menu, make_save_value (unwind_data, 0)); popup_activated_flag = 1; tem = [dialog runDialogAt: p]; unbind_to (specpdl_count, Qnil); /* calls pop_down_menu */ } + UNBLOCK_INPUT; return tem; @@ -1475,24 +1497,22 @@ NSSize spacing = {SPACER, SPACER}; NSRect area; id cell; - static NSImageView *imgView; - static FlippedView *contentView; + NSImageView *imgView; + FlippedView *contentView; + NSImage *img; - if (imgView == nil) - { - NSImage *img; - area.origin.x = 3*SPACER; - area.origin.y = 2*SPACER; - area.size.width = ICONSIZE; - area.size.height= ICONSIZE; - img = [[NSImage imageNamed: @"NSApplicationIcon"] copy]; - [img setScalesWhenResized: YES]; - [img setSize: NSMakeSize (ICONSIZE, ICONSIZE)]; - imgView = [[NSImageView alloc] initWithFrame: area]; - [imgView setImage: img]; - [imgView setEditable: NO]; - [img release]; - } + area.origin.x = 3*SPACER; + area.origin.y = 2*SPACER; + area.size.width = ICONSIZE; + area.size.height= ICONSIZE; + img = [[NSImage imageNamed: @"NSApplicationIcon"] copy]; + [img setScalesWhenResized: YES]; + [img setSize: NSMakeSize (ICONSIZE, ICONSIZE)]; + imgView = [[NSImageView alloc] initWithFrame: area]; + [imgView setImage: img]; + [imgView setEditable: NO]; + [img autorelease]; + [imgView autorelease]; aStyle = NSTitledWindowMask; flag = YES; @@ -1501,6 +1521,8 @@ [super initWithContentRect: contentRect styleMask: aStyle backing: backingType defer: flag]; contentView = [[FlippedView alloc] initWithFrame: [[self contentView] frame]]; + [contentView autorelease]; + [self setContentView: contentView]; [[self contentView] setAutoresizesSubviews: YES]; @@ -1551,12 +1573,12 @@ prototype: cell numberOfRows: 0 numberOfColumns: 1]; - [[self contentView] addSubview: matrix]; - [matrix release]; [matrix setFrameOrigin: NSMakePoint (area.origin.x, area.origin.y + (TEXTHEIGHT+3*SPACER))]; [matrix setIntercellSpacing: spacing]; + [matrix autorelease]; + [[self contentView] addSubview: matrix]; [self setOneShot: YES]; [self setReleasedWhenClosed: YES]; [self setHidesOnDeactivate: YES]; @@ -1735,12 +1757,6 @@ } -- (void)dealloc -{ - { [super dealloc]; return; }; -} - - - (Lisp_Object)runDialogAt: (NSPoint)p { NSInteger ret; ------------------------------------------------------------ revno: 109187 committer: Dmitry Antipov branch nick: trunk timestamp: Sun 2012-07-22 19:13:50 +0400 message: Adjust consing_since_gc when objects are explicitly freed. * alloc.c (GC_DEFAULT_THRESHOLD): New macro. (Fgarbage_collect): Use it. Change minimum to 1/10 of default. (free_cons, free_misc): Subtract object size from consing_since_gc. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2012-07-22 05:37:24 +0000 +++ src/ChangeLog 2012-07-22 15:13:50 +0000 @@ -1,5 +1,12 @@ 2012-07-22 Dmitry Antipov + Adjust consing_since_gc when objects are explicitly freed. + * alloc.c (GC_DEFAULT_THRESHOLD): New macro. + (Fgarbage_collect): Use it. Change minimum to 1/10 of default. + (free_cons, free_misc): Subtract object size from consing_since_gc. + +2012-07-22 Dmitry Antipov + Simplify and cleanup markers positioning code. * marker.c (attach_marker): More useful eassert. (live_buffer, set_marker_internal): New function. === modified file 'src/alloc.c' --- src/alloc.c 2012-07-20 14:07:28 +0000 +++ src/alloc.c 2012-07-22 15:13:50 +0000 @@ -161,6 +161,10 @@ #define GC_STRING_BYTES(S) (STRING_BYTES (S)) +/* Default value of gc_cons_threshold (see below). */ + +#define GC_DEFAULT_THRESHOLD (100000 * sizeof (Lisp_Object)) + /* Global variables. */ struct emacs_globals globals; @@ -2711,6 +2715,7 @@ ptr->car = Vdead; #endif cons_free_list = ptr; + consing_since_gc -= sizeof *ptr; total_free_conses++; } @@ -3606,7 +3611,7 @@ XMISCTYPE (misc) = Lisp_Misc_Free; XMISC (misc)->u_free.chain = marker_free_list; marker_free_list = XMISC (misc); - + consing_since_gc -= sizeof (union Lisp_Misc); total_free_markers++; } @@ -5581,8 +5586,8 @@ gc_in_progress = 0; consing_since_gc = 0; - if (gc_cons_threshold < 10000) - gc_cons_threshold = 10000; + if (gc_cons_threshold < GC_DEFAULT_THRESHOLD / 10) + gc_cons_threshold = GC_DEFAULT_THRESHOLD / 10; gc_relative_threshold = 0; if (FLOATP (Vgc_cons_percentage)) @@ -6731,7 +6736,7 @@ #endif refill_memory_reserve (); - gc_cons_threshold = 100000 * sizeof (Lisp_Object); + gc_cons_threshold = GC_DEFAULT_THRESHOLD; } void ------------------------------------------------------------ revno: 109186 committer: Dmitry Antipov branch nick: trunk timestamp: Sun 2012-07-22 09:37:24 +0400 message: Simplify and cleanup markers positioning code. * marker.c (attach_marker): More useful eassert. (live_buffer, set_marker_internal): New function. (Fset_marker, set_marker_restricted): Use set_marker_internal. (set_marker_both, set_marker_restricted_both): Use live_buffer. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2012-07-22 03:44:35 +0000 +++ src/ChangeLog 2012-07-22 05:37:24 +0000 @@ -1,3 +1,11 @@ +2012-07-22 Dmitry Antipov + + Simplify and cleanup markers positioning code. + * marker.c (attach_marker): More useful eassert. + (live_buffer, set_marker_internal): New function. + (Fset_marker, set_marker_restricted): Use set_marker_internal. + (set_marker_both, set_marker_restricted_both): Use live_buffer. + 2012-07-22 Paul Eggert * buffer.h (struct buffer.indirections): Now ptrdiff_t, not int, === modified file 'src/marker.c' --- src/marker.c 2012-07-09 03:15:10 +0000 +++ src/marker.c 2012-07-22 05:37:24 +0000 @@ -431,8 +431,12 @@ attach_marker (struct Lisp_Marker *m, struct buffer *b, ptrdiff_t charpos, ptrdiff_t bytepos) { - /* Every character is at least one byte. */ - eassert (charpos <= bytepos); + /* In a single-byte buffer, two positions must be equal. + Otherwise, every character is at least one byte. */ + if (BUF_Z (b) == BUF_Z_BYTE (b)) + eassert (charpos == bytepos); + else + eassert (charpos <= bytepos); m->charpos = charpos; m->bytepos = bytepos; @@ -446,191 +450,136 @@ } } -DEFUN ("set-marker", Fset_marker, Sset_marker, 2, 3, 0, - doc: /* Position MARKER before character number POSITION in BUFFER. -BUFFER defaults to the current buffer. -If POSITION is nil, makes marker point nowhere. -Then it no longer slows down editing in any buffer. -Returns MARKER. */) - (Lisp_Object marker, Lisp_Object position, Lisp_Object buffer) -{ - register ptrdiff_t charpos; - register ptrdiff_t bytepos; - register struct buffer *b; +/* If BUFFER is nil, return current buffer pointer. Next, check + whether BUFFER is a buffer object and return buffer pointer + corresponding to BUFFER if BUFFER is live, or NULL otherwise. */ + +static inline struct buffer * +live_buffer (Lisp_Object buffer) +{ + struct buffer *b; + + if (NILP (buffer)) + { + b = current_buffer; + eassert (!NILP (BVAR (b, name))); + } + else + { + CHECK_BUFFER (buffer); + b = XBUFFER (buffer); + if (NILP (BVAR (b, name))) + b = NULL; + } + return b; +} + +/* Internal function to set MARKER in BUFFER at POSITION. Non-zero + RESTRICTED means limit the POSITION by the visible part of BUFFER. */ + +static inline Lisp_Object +set_marker_internal (Lisp_Object marker, Lisp_Object position, + Lisp_Object buffer, int restricted) +{ register struct Lisp_Marker *m; + register struct buffer *b = live_buffer (buffer); CHECK_MARKER (marker); m = XMARKER (marker); - /* If position is nil or a marker that points nowhere, - make this marker point nowhere. */ + /* Set MARKER to point nowhere if BUFFER is dead, or + POSITION is nil or a marker points to nowhere. */ if (NILP (position) - || (MARKERP (position) && !XMARKER (position)->buffer)) - { - unchain_marker (m); - return marker; - } - - if (NILP (buffer)) - b = current_buffer; - else - { - CHECK_BUFFER (buffer); - b = XBUFFER (buffer); - /* If buffer is dead, set marker to point nowhere. */ - if (EQ (BVAR (b, name), Qnil)) - { - unchain_marker (m); - return marker; - } - } - - /* Optimize the special case where we are copying the position - of an existing marker, and MARKER is already in the same buffer. */ - if (MARKERP (position) && b == XMARKER (position)->buffer - && b == m->buffer) + || (MARKERP (position) && !XMARKER (position)->buffer) + || !b) + unchain_marker (m); + + /* Optimize the special case where we are copying the position of + an existing marker, and MARKER is already in the same buffer. */ + else if (MARKERP (position) && b == XMARKER (position)->buffer + && b == m->buffer) { m->bytepos = XMARKER (position)->bytepos; m->charpos = XMARKER (position)->charpos; - return marker; - } - - CHECK_NUMBER_COERCE_MARKER (position); - charpos = clip_to_bounds (BUF_BEG (b), XINT (position), BUF_Z (b)); - bytepos = buf_charpos_to_bytepos (b, charpos); - - attach_marker (m, b, charpos, bytepos); + } + + else + { + register ptrdiff_t charpos, bytepos; + + CHECK_NUMBER_COERCE_MARKER (position); + charpos = clip_to_bounds (restricted ? BUF_BEGV (b) : BUF_BEG (b), + XINT (position), + restricted ? BUF_ZV (b) : BUF_Z (b)); + bytepos = buf_charpos_to_bytepos (b, charpos); + attach_marker (m, b, charpos, bytepos); + } return marker; } -/* This version of Fset_marker won't let the position - be outside the visible part. */ +DEFUN ("set-marker", Fset_marker, Sset_marker, 2, 3, 0, + doc: /* Position MARKER before character number POSITION in BUFFER, +which defaults to the current buffer. If POSITION is nil, +makes marker point nowhere so it no longer slows down +editing in any buffer. Returns MARKER. */) + (Lisp_Object marker, Lisp_Object position, Lisp_Object buffer) +{ + return set_marker_internal (marker, position, buffer, 0); +} + +/* Like the above, but won't let the position be outside the visible part. */ Lisp_Object -set_marker_restricted (Lisp_Object marker, Lisp_Object pos, Lisp_Object buffer) +set_marker_restricted (Lisp_Object marker, Lisp_Object position, + Lisp_Object buffer) { - register ptrdiff_t charpos; - register ptrdiff_t bytepos; - register struct buffer *b; - register struct Lisp_Marker *m; - - CHECK_MARKER (marker); - m = XMARKER (marker); - - /* If position is nil or a marker that points nowhere, - make this marker point nowhere. */ - if (NILP (pos) - || (MARKERP (pos) && !XMARKER (pos)->buffer)) - { - unchain_marker (m); - return marker; - } - - if (NILP (buffer)) - b = current_buffer; - else - { - CHECK_BUFFER (buffer); - b = XBUFFER (buffer); - /* If buffer is dead, set marker to point nowhere. */ - if (EQ (BVAR (b, name), Qnil)) - { - unchain_marker (m); - return marker; - } - } - - /* Optimize the special case where we are copying the position - of an existing marker, and MARKER is already in the same buffer. */ - if (MARKERP (pos) && b == XMARKER (pos)->buffer - && b == m->buffer) - { - m->bytepos = XMARKER (pos)->bytepos; - m->charpos = XMARKER (pos)->charpos; - return marker; - } - - CHECK_NUMBER_COERCE_MARKER (pos); - charpos = clip_to_bounds (BUF_BEGV (b), XINT (pos), BUF_ZV (b)); - bytepos = buf_charpos_to_bytepos (b, charpos); - - attach_marker (m, b, charpos, bytepos); - return marker; + return set_marker_internal (marker, position, buffer, 1); } - + /* Set the position of MARKER, specifying both the character position and the corresponding byte position. */ Lisp_Object -set_marker_both (Lisp_Object marker, Lisp_Object buffer, ptrdiff_t charpos, ptrdiff_t bytepos) +set_marker_both (Lisp_Object marker, Lisp_Object buffer, + ptrdiff_t charpos, ptrdiff_t bytepos) { - register struct buffer *b; register struct Lisp_Marker *m; + register struct buffer *b = live_buffer (buffer); CHECK_MARKER (marker); m = XMARKER (marker); - if (NILP (buffer)) - b = current_buffer; + if (b) + attach_marker (m, b, charpos, bytepos); else - { - CHECK_BUFFER (buffer); - b = XBUFFER (buffer); - /* If buffer is dead, set marker to point nowhere. */ - if (EQ (BVAR (b, name), Qnil)) - { - unchain_marker (m); - return marker; - } - } - - /* In a single-byte buffer, the two positions must be equal. */ - if (BUF_Z (b) == BUF_Z_BYTE (b) - && charpos != bytepos) - abort (); - - attach_marker (m, b, charpos, bytepos); + unchain_marker (m); return marker; } -/* This version of set_marker_both won't let the position - be outside the visible part. */ +/* Like the above, but won't let the position be outside the visible part. */ Lisp_Object -set_marker_restricted_both (Lisp_Object marker, Lisp_Object buffer, ptrdiff_t charpos, ptrdiff_t bytepos) +set_marker_restricted_both (Lisp_Object marker, Lisp_Object buffer, + ptrdiff_t charpos, ptrdiff_t bytepos) { - register struct buffer *b; register struct Lisp_Marker *m; + register struct buffer *b = live_buffer (buffer); CHECK_MARKER (marker); m = XMARKER (marker); - if (NILP (buffer)) - b = current_buffer; - else + if (b) { - CHECK_BUFFER (buffer); - b = XBUFFER (buffer); - /* If buffer is dead, set marker to point nowhere. */ - if (EQ (BVAR (b, name), Qnil)) - { - unchain_marker (m); - return marker; - } + attach_marker + (m, b, + clip_to_bounds (BUF_BEGV (b), charpos, BUF_ZV (b)), + clip_to_bounds (BUF_BEGV_BYTE (b), bytepos, BUF_ZV_BYTE (b))); } - - charpos = clip_to_bounds (BUF_BEGV (b), charpos, BUF_ZV (b)); - bytepos = clip_to_bounds (BUF_BEGV_BYTE (b), bytepos, BUF_ZV_BYTE (b)); - - /* In a single-byte buffer, the two positions must be equal. */ - if (BUF_Z (b) == BUF_Z_BYTE (b) - && charpos != bytepos) - abort (); - - attach_marker (m, b, charpos, bytepos); + else + unchain_marker (m); return marker; } - + /* Remove MARKER from the chain of whatever buffer it is in, leaving it points to nowhere. This is called during garbage collection, so we must be careful to ignore and preserve