all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Alan Mackenzie <acm@muc.de>
To: martin rudalics <rudalics@gmx.at>
Cc: 10463@debbugs.gnu.org
Subject: bug#10463: 24.0.92; c-literal-limits out of range
Date: Mon, 9 Jan 2012 21:17:21 +0000	[thread overview]
Message-ID: <20120109211721.GA4913@acm.acm> (raw)
In-Reply-To: <4F0B2FAD.8030400@gmx.at>

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).





  reply	other threads:[~2012-01-09 21:17 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-09 10:13 bug#10463: 24.0.92; c-literal-limits out of range martin rudalics
2012-01-09 14:02 ` Stefan Monnier
2012-01-09 18:19   ` martin rudalics
2012-01-09 21:17     ` Alan Mackenzie [this message]
2012-01-10 10:19       ` martin rudalics
2012-01-10 20:04         ` Stefan Monnier
2012-01-10 20:29           ` Juanma Barranquero
2012-01-10 21:21           ` martin rudalics
2012-01-11 22:38 ` bug#10463: Bug #10463 fixed Alan Mackenzie

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20120109211721.GA4913@acm.acm \
    --to=acm@muc.de \
    --cc=10463@debbugs.gnu.org \
    --cc=rudalics@gmx.at \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.