[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#10463: 24.0.92; c-literal-limits out of range
From: |
Alan Mackenzie |
Subject: |
bug#10463: 24.0.92; c-literal-limits out of range |
Date: |
Mon, 9 Jan 2012 21:17:21 +0000 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
On Mon, Jan 09, 2012 at 07:19:25PM +0100, martin rudalics wrote a bug
report:
Hi, Martin.
Please apply this patch, use C Mode for an infinite amount of time, then
report back and tell me the bug has disappeared.
Thanks!
*** orig/cc-engine.el 2012-01-09 20:27:51.000000000 +0000
--- cc-engine.el 2012-01-09 20:53:42.000000000 +0000
***************
*** 4225,4236 ****
Note that this function might do hidden buffer changes. See the
comment at the start of cc-engine.el for more info."
! (let* ((safe-place (c-state-safe-place (point)))
! (lit (c-state-pp-to-literal safe-place (point))))
! (or (cadr lit)
! (and detect-cpp
! (save-excursion (c-beginning-of-macro))
! 'pound))))
(defun c-literal-limits (&optional lim near not-in-delimiter)
"Return a cons of the beginning and end positions of the comment or
--- 4225,4238 ----
Note that this function might do hidden buffer changes. See the
comment at the start of cc-engine.el for more info."
! (save-restriction
! (widen
! (let* ((safe-place (c-state-safe-place (point)))
! (lit (c-state-pp-to-literal safe-place (point))))
! (or (cadr lit)
! (and detect-cpp
! (save-excursion (c-beginning-of-macro))
! 'pound))))))
(defun c-literal-limits (&optional lim near not-in-delimiter)
"Return a cons of the beginning and end positions of the comment or
***************
*** 4250,4258 ****
(save-excursion
(let* ((pos (point))
(lim (or lim (c-state-safe-place pos)))
! (pp-to-lit (c-state-pp-to-literal lim pos))
(state (car pp-to-lit))
- (lit-type (cadr pp-to-lit))
(lit-limits (car (cddr pp-to-lit))))
(cond
--- 4252,4261 ----
(save-excursion
(let* ((pos (point))
(lim (or lim (c-state-safe-place pos)))
! (pp-to-lit (save-restriction
! (widen)
! (c-state-pp-to-literal lim pos)))
(state (car pp-to-lit))
(lit-limits (car (cddr pp-to-lit))))
(cond
> martin
--
Alan Mackenzie (Nuremberg, Germany).
bug#10463: Bug #10463 fixed, Alan Mackenzie, 2012/01/11