* bug#16695: 24.3; comment-dwim (args out of range)
@ 2014-02-08 14:32 eg5cue
2014-02-08 20:09 ` Eli Zaretskii
` (2 more replies)
0 siblings, 3 replies; 7+ messages in thread
From: eg5cue @ 2014-02-08 14:32 UTC (permalink / raw)
To: 16695
this is a longstanding bug since 24.3(i don't tried older versions) till now (the latest git version - github mirror), and is very annoying.
it happens when trying to comment out (a line/multiple lines) except the first line from a C family file that:
it's first line isn't empty or a comment.
isn't modified after it's opened.
comment function: comment-dwim (M-;)
emacs args: emacs -Q
^ permalink raw reply [flat|nested] 7+ messages in thread
* bug#16695: 24.3; comment-dwim (args out of range)
2014-02-08 14:32 bug#16695: 24.3; comment-dwim (args out of range) eg5cue
@ 2014-02-08 20:09 ` Eli Zaretskii
2014-02-08 20:12 ` Glenn Morris
2014-02-09 12:41 ` Alan Mackenzie
2 siblings, 0 replies; 7+ messages in thread
From: Eli Zaretskii @ 2014-02-08 20:09 UTC (permalink / raw)
To: eg5cue; +Cc: 16695
> From: eg5cue@gmail.com
> Date: Sat, 08 Feb 2014 14:32:51 +0000
>
> this is a longstanding bug since 24.3(i don't tried older versions) till now (the latest git version - github mirror), and is very annoying.
> it happens when trying to comment out (a line/multiple lines) except the first line from a C family file that:
>
> it's first line isn't empty or a comment.
> isn't modified after it's opened.
>
> comment function: comment-dwim (M-;)
> emacs args: emacs -Q
I cannot reproduce this. Could you please provide a detailed, key by
key recipe, starting with "emacs -Q", and a sample C file to go with
it?
Thanks.
^ permalink raw reply [flat|nested] 7+ messages in thread
* bug#16695: 24.3; comment-dwim (args out of range)
2014-02-08 14:32 bug#16695: 24.3; comment-dwim (args out of range) eg5cue
2014-02-08 20:09 ` Eli Zaretskii
@ 2014-02-08 20:12 ` Glenn Morris
2014-02-08 22:51 ` Alan Mackenzie
[not found] ` <20140208225107.GB4063@acm.acm>
2014-02-09 12:41 ` Alan Mackenzie
2 siblings, 2 replies; 7+ messages in thread
From: Glenn Morris @ 2014-02-08 20:12 UTC (permalink / raw)
To: eg5cue; +Cc: 16695
eg5cue@gmail.com wrote:
> this is a longstanding bug since 24.3(i don't tried older versions)
> till now (the latest git version - github mirror), and is very
> annoying. it happens when trying to comment out (a line/multiple
> lines) except the first line from a C family file that:
>
> it's first line isn't empty or a comment.
> isn't modified after it's opened.
>
> comment function: comment-dwim (M-;)
> emacs args: emacs -Q
Thanks. For future reference, please do
M-x toggle-debug-on-error
and include the basktrace in the report:
Debugger entered--Lisp error: (args-out-of-range 1 2)
remove-text-properties(#<marker at 1 in foo.c> 2 (category nil))
c-invalidate-state-cache(17)
c-before-change(17 17)
comment-region-internal(17 45 "/* " " */" nil nil nil nil t)
comment-region-default(16 46 nil)
comment-region(16 46 nil)
comment-or-uncomment-region(16 46 nil)
comment-dwim(nil)
call-interactively(comment-dwim nil nil)
command-execute(comment-dwim)
^ permalink raw reply [flat|nested] 7+ messages in thread
* bug#16695: 24.3; comment-dwim (args out of range)
2014-02-08 20:12 ` Glenn Morris
@ 2014-02-08 22:51 ` Alan Mackenzie
[not found] ` <20140208225107.GB4063@acm.acm>
1 sibling, 0 replies; 7+ messages in thread
From: Alan Mackenzie @ 2014-02-08 22:51 UTC (permalink / raw)
To: Glenn Morris; +Cc: 16695, eg5cue
Hi, Glenn.
On Sat, Feb 08, 2014 at 03:12:20PM -0500, Glenn Morris wrote:
> eg5cue@gmail.com wrote:
> > this is a longstanding bug since 24.3(i don't tried older versions)
> > till now (the latest git version - github mirror), and is very
> > annoying. it happens when trying to comment out (a line/multiple
> > lines) except the first line from a C family file that:
> > it's first line isn't empty or a comment.
> > isn't modified after it's opened.
> > comment function: comment-dwim (M-;)
> > emacs args: emacs -Q
> Thanks. For future reference, please do
> M-x toggle-debug-on-error
> and include the basktrace in the report:
> Debugger entered--Lisp error: (args-out-of-range 1 2)
> remove-text-properties(#<marker at 1 in foo.c> 2 (category nil))
> c-invalidate-state-cache(17)
> c-before-change(17 17)
> comment-region-internal(17 45 "/* " " */" nil nil nil nil t)
> comment-region-default(16 46 nil)
> comment-region(16 46 nil)
> comment-or-uncomment-region(16 46 nil)
> comment-dwim(nil)
> call-interactively(comment-dwim nil nil)
> command-execute(comment-dwim)
I think this is the same bug as #16585, which I've just posted a patch
for. Here is the patch again. After applying this patch, recompile
progmodes/cc-defs.el, then recompile progmodes/cc-engine.el.
To the Original Poster: please try this out, and confirm it fixes the
bug. Thanks!
=== modified file 'lisp/progmodes/cc-defs.el'
*** lisp/progmodes/cc-defs.el 2014-02-02 10:25:29 +0000
--- lisp/progmodes/cc-defs.el 2014-02-08 22:21:01 +0000
***************
*** 1293,1302 ****
;; suppressed.
`(unwind-protect
(c-save-buffer-state ()
! (c-clear-cpp-delimiters ,beg ,end)
,`(c-with-cpps-commented-out ,@forms))
(c-save-buffer-state ()
! (c-set-cpp-delimiters ,beg ,end))))
\f
(defsubst c-intersect-lists (list alist)
;; return the element of ALIST that matches the first element found
--- 1293,1306 ----
;; suppressed.
`(unwind-protect
(c-save-buffer-state ()
! (save-restriction
! (widen)
! (c-clear-cpp-delimiters ,beg ,end))
,`(c-with-cpps-commented-out ,@forms))
(c-save-buffer-state ()
! (save-restriction
! (widen)
! (c-set-cpp-delimiters ,beg ,end)))))
\f
(defsubst c-intersect-lists (list alist)
;; return the element of ALIST that matches the first element found
--
Alan Mackenzie (Nuremberg, Germany).
^ permalink raw reply [flat|nested] 7+ messages in thread
* bug#16695: 24.3; comment-dwim (args out of range)
[not found] ` <20140208225107.GB4063@acm.acm>
@ 2014-02-08 23:23 ` Glenn Morris
[not found] ` <CAAFMBVaGpoZrKgPm-tALx47+XNN8W8sezKyEz9EYwAOz-bG+GA@mail.gmail.com>
1 sibling, 0 replies; 7+ messages in thread
From: Glenn Morris @ 2014-02-08 23:23 UTC (permalink / raw)
To: Alan Mackenzie; +Cc: 16695, eg5cue
Alan Mackenzie wrote:
> I think this is the same bug as #16585
I don't about that, but it is certainly the same as #15881.
^ permalink raw reply [flat|nested] 7+ messages in thread
* bug#16695: 24.3; comment-dwim (args out of range)
[not found] ` <CAAFMBVaGpoZrKgPm-tALx47+XNN8W8sezKyEz9EYwAOz-bG+GA@mail.gmail.com>
@ 2014-02-09 10:33 ` Arash Cue
0 siblings, 0 replies; 7+ messages in thread
From: Arash Cue @ 2014-02-09 10:33 UTC (permalink / raw)
To: Alan Mackenzie; +Cc: 16695
[-- Attachment #1: Type: text/plain, Size: 2709 bytes --]
this patch fixed the problem for me. thanks
On Sat, Feb 8, 2014 at 10:51 PM, Alan Mackenzie <acm@muc.de> wrote:
> Hi, Glenn.
>
> On Sat, Feb 08, 2014 at 03:12:20PM -0500, Glenn Morris wrote:
> > eg5cue@gmail.com wrote:
>
> > > this is a longstanding bug since 24.3(i don't tried older versions)
> > > till now (the latest git version - github mirror), and is very
> > > annoying. it happens when trying to comment out (a line/multiple
> > > lines) except the first line from a C family file that:
>
> > > it's first line isn't empty or a comment.
> > > isn't modified after it's opened.
>
> > > comment function: comment-dwim (M-;)
> > > emacs args: emacs -Q
>
> > Thanks. For future reference, please do
>
> > M-x toggle-debug-on-error
>
> > and include the basktrace in the report:
>
> > Debugger entered--Lisp error: (args-out-of-range 1 2)
> > remove-text-properties(#<marker at 1 in foo.c> 2 (category nil))
> > c-invalidate-state-cache(17)
> > c-before-change(17 17)
> > comment-region-internal(17 45 "/* " " */" nil nil nil nil t)
> > comment-region-default(16 46 nil)
> > comment-region(16 46 nil)
> > comment-or-uncomment-region(16 46 nil)
> > comment-dwim(nil)
> > call-interactively(comment-dwim nil nil)
> > command-execute(comment-dwim)
>
> I think this is the same bug as #16585, which I've just posted a patch
> for. Here is the patch again. After applying this patch, recompile
> progmodes/cc-defs.el, then recompile progmodes/cc-engine.el.
>
> To the Original Poster: please try this out, and confirm it fixes the
> bug. Thanks!
>
>
> === modified file 'lisp/progmodes/cc-defs.el'
> *** lisp/progmodes/cc-defs.el 2014-02-02 10:25:29 +0000
> --- lisp/progmodes/cc-defs.el 2014-02-08 22:21:01 +0000
> ***************
> *** 1293,1302 ****
> ;; suppressed.
> `(unwind-protect
> (c-save-buffer-state ()
> ! (c-clear-cpp-delimiters ,beg ,end)
> ,`(c-with-cpps-commented-out ,@forms))
> (c-save-buffer-state ()
> ! (c-set-cpp-delimiters ,beg ,end))))
>
> (defsubst c-intersect-lists (list alist)
> ;; return the element of ALIST that matches the first element found
> --- 1293,1306 ----
> ;; suppressed.
> `(unwind-protect
> (c-save-buffer-state ()
> ! (save-restriction
> ! (widen)
> ! (c-clear-cpp-delimiters ,beg ,end))
> ,`(c-with-cpps-commented-out ,@forms))
> (c-save-buffer-state ()
> ! (save-restriction
> ! (widen)
> ! (c-set-cpp-delimiters ,beg ,end)))))
>
> (defsubst c-intersect-lists (list alist)
> ;; return the element of ALIST that matches the first element found
>
>
> --
> Alan Mackenzie (Nuremberg, Germany).
>
[-- Attachment #2: Type: text/html, Size: 3581 bytes --]
^ permalink raw reply [flat|nested] 7+ messages in thread
* bug#16695: 24.3; comment-dwim (args out of range)
2014-02-08 14:32 bug#16695: 24.3; comment-dwim (args out of range) eg5cue
2014-02-08 20:09 ` Eli Zaretskii
2014-02-08 20:12 ` Glenn Morris
@ 2014-02-09 12:41 ` Alan Mackenzie
2 siblings, 0 replies; 7+ messages in thread
From: Alan Mackenzie @ 2014-02-09 12:41 UTC (permalink / raw)
To: 16695-done
Bug fixed.
--
Alan Mackenzie (Nuremberg, Germany).
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2014-02-09 12:41 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-02-08 14:32 bug#16695: 24.3; comment-dwim (args out of range) eg5cue
2014-02-08 20:09 ` Eli Zaretskii
2014-02-08 20:12 ` Glenn Morris
2014-02-08 22:51 ` Alan Mackenzie
[not found] ` <20140208225107.GB4063@acm.acm>
2014-02-08 23:23 ` Glenn Morris
[not found] ` <CAAFMBVaGpoZrKgPm-tALx47+XNN8W8sezKyEz9EYwAOz-bG+GA@mail.gmail.com>
2014-02-09 10:33 ` Arash Cue
2014-02-09 12:41 ` Alan Mackenzie
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).