all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#13713: 24.3.50; C indent produces error when narrowing is active
@ 2013-02-14  8:57 Dima Kogan
  2013-02-17  8:06 ` bug#13713: Root cause Dima Kogan
  2017-12-01 10:04 ` bug#13713: 24.3.50; C indent produces error when narrowing is active Noam Postavsky
  0 siblings, 2 replies; 3+ messages in thread
From: Dima Kogan @ 2013-02-14  8:57 UTC (permalink / raw)
  To: 13713

Hi.

I'm observing an issue with emacs indentation in C mode when narrowing
is enabled. To reproduce, create a tst.c buffer with the following 3
lines:

// 123
// 456
// 789

I select the last 2 lines (456, 789), and narrow-to-region. Then I place
the point at the start of the 789 line, and press 'tab'. I get this:

Debugger entered--Lisp error: (args-out-of-range 1 8)
  parse-partial-sexp(1 8)
  c-determine-limit-get-base(15 1000)
  (let* ((start (or start (point))) (try-size (or try-size (* 2 how-far-back))) (base (c-determine-limit-get-base start try-size)) (pos base) (s (parse-partial-sexp pos pos)) stack elt size (count 0)) (while (< pos start) (setq s (parse-partial-sexp pos start nil nil s (quote syntax-table))) (setq size (- (if (or (nth 4 s) (nth 3 s)) (nth 8 s) (point)) pos)) (if (> size 0) (setq stack (cons (cons pos size) stack))) (if (or (nth 4 s) (nth 3 s)) (setq s (parse-partial-sexp (point) start nil nil s (quote syntax-table)))) (setq pos (point))) (while (and (< count how-far-back) stack) (setq elt (car stack) stack (cdr stack)) (setq count (+ count (cdr elt)))) (cond ((>= count how-far-back) (+ (car elt) (- count how-far-back))) ((eq base (point-min)) (point-min)) (t (c-determine-limit (- how-far-b
 ack count) base try-size))))
  (save-excursion (let* ((start (or start (point))) (try-size (or try-size (* 2 how-far-back))) (base (c-determine-limit-get-base start try-size)) (pos base) (s (parse-partial-sexp pos pos)) stack elt size (count 0)) (while (< pos start) (setq s (parse-partial-sexp pos start nil nil s (quote syntax-table))) (setq size (- (if (or (nth 4 s) (nth 3 s)) (nth 8 s) (point)) pos)) (if (> size 0) (setq stack (cons (cons pos size) stack))) (if (or (nth 4 s) (nth 3 s)) (setq s (parse-partial-sexp (point) start nil nil s (quote syntax-table)))) (setq pos (point))) (while (and (< count how-far-back) stack) (setq elt (car stack) stack (cdr stack)) (setq count (+ count (cdr elt)))) (cond ((>= count how-far-back) (+ (car elt) (- count how-far-back))) ((eq base (point-min)) (point-min)) (t (c-determine-li
 mit (- how-far-back count) base try-size)))))
  c-determine-limit(500)
  c-guess-basic-syntax()
  c-indent-line()
  c-indent-command(nil)
  c-indent-line-or-region(nil nil)
  call-interactively(c-indent-line-or-region nil nil)


As shown above, the failure is in (parse-partial-sexp 1 8). Evaluating
this same for succeeds if the buffer is re-widened.

Thanks





^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-12-01 10:04 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-02-14  8:57 bug#13713: 24.3.50; C indent produces error when narrowing is active Dima Kogan
2013-02-17  8:06 ` bug#13713: Root cause Dima Kogan
2017-12-01 10:04 ` bug#13713: 24.3.50; C indent produces error when narrowing is active Noam Postavsky

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.