unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* [kbrint@hamachi.rufus.net: cperl-mode problem under emacs 22.1]
@ 2007-08-08  4:54 Richard Stallman
  2007-08-09 23:57 ` Bob Rogers
  0 siblings, 1 reply; 4+ messages in thread
From: Richard Stallman @ 2007-08-08  4:54 UTC (permalink / raw)
  To: emacs-devel

Would someone please try to DTRT, then ack?  Sometimes these problems
are impossible to fix, or impossible without creating worse problems.
But it would be good to try it and see, before giving up.

------- Start of forwarded message -------
X-Spam-Status: No, score=0.0 required=5.0 tests=UNPARSEABLE_RELAY 
	autolearn=failed version=3.1.0
From: kevin brintnall <kbrint@hamachi.rufus.net>
To: bug-gnu-emacs@gnu.org
Date: Tue,  7 Aug 2007 10:13:55 -0500 (CDT)
Subject: cperl-mode problem under emacs 22.1

emacs -q
C-x C-f file.pl
M-x cperl-mode

Type into buffer:

$k =~ s{a}{b};
          ^ the second open brace will fail to insert, generating message:
	  Args out of range: 14, 15

This is with the built-in cperl-mode 5.22 in Emacs 22.1.

This does not happen with emacs 21.x or 20.x.

###################################

With cperl-mode 5.23 form ilya, I can type the {}'s, but the following
error is generated instead:

End of `s{ ... }{ ... }' string/RE not found: (scan-error Unbalanced parentheses 11 13)

This causes fontification to fail.


In GNU Emacs 22.1.1 (i386-pc-freebsd)
 of 2007-07-22 on hamachi.rufus.net
configured using `configure  '--with-x=no' '--infodir=${prefix}/info' '--mandir=${prefix}/man' '--prefix=/usr/local' 'i386-freebsd' 'build_alias=i386-freebsd' 'host_alias=i386-freebsd' 'target_alias=i386-freebsd' 'CC=cc' 'CFLAGS=-O2 -fno-strict-aliasing -pipe ''

Important settings:
  value of $LC_ALL: nil
  value of $LC_COLLATE: nil
  value of $LC_CTYPE: nil
  value of $LC_MESSAGES: nil
  value of $LC_MONETARY: nil
  value of $LC_NUMERIC: nil
  value of $LC_TIME: nil
  value of $LANG: nil
  locale-coding-system: nil
  default-enable-multibyte-characters: t

Major mode: CPerl

Minor modes in effect:
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  unify-8859-on-encoding-mode: t
  utf-translate-cjk-mode: t
  auto-compression-mode: t
  line-number-mode: t

Recent input:
C-x C-f f i l e . p l RET ESC x c p e r l - m o d e 
RET $ k SPC = ~ SPC m { a } { b } DEL DEL DEL ; RET 
$ k SPC = ~ SPC m { DEL DEL s } DEL [ DEL { a } { } 
b DEL DEL { { { { C-o C-o C-o C-a C-e DEL DEL DEL DEL 
s { a } { ESC x e m a c s - b u g RET C-a r e p o r 
e t - ESC DEL r e p o r t - RET

Recent messages:
Error during redisplay: (wrong-type-argument number-or-marker-p nil)
End of `s{ ... }' string/RE not found: (scan-error Unbalanced parentheses 20 25)
Error during redisplay: (wrong-type-argument number-or-marker-p nil)
End of `s{ ... }

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

* [kbrint@hamachi.rufus.net: cperl-mode problem under emacs 22.1]
  2007-08-08  4:54 [kbrint@hamachi.rufus.net: cperl-mode problem under emacs 22.1] Richard Stallman
@ 2007-08-09 23:57 ` Bob Rogers
  2007-08-11  5:04   ` Richard Stallman
  0 siblings, 1 reply; 4+ messages in thread
From: Bob Rogers @ 2007-08-09 23:57 UTC (permalink / raw)
  To: rms, emacs-devel

   From: Richard Stallman <rms@gnu.org>
   Date: Wed, 08 Aug 2007 00:54:51 -0400

   Would someone please try to DTRT, then ack?  Sometimes these problems
   are impossible to fix, or impossible without creating worse problems.
   But it would be good to try it and see, before giving up.

   ------- Start of forwarded message -------
   X-Spam-Status: No, score=0.0 required=5.0 tests=UNPARSEABLE_RELAY 
	   autolearn=failed version=3.1.0
   From: kevin brintnall <kbrint@hamachi.rufus.net>
   To: bug-gnu-emacs@gnu.org
   Date: Tue,  7 Aug 2007 10:13:55 -0500 (CDT)
   Subject: cperl-mode problem under emacs 22.1

   emacs -q
   C-x C-f file.pl
   M-x cperl-mode

   Type into buffer:

   $k =~ s{a}{b};
	     ^ the second open brace will fail to insert, generating message:
	     Args out of range: 14, 15

   This is with the built-in cperl-mode 5.22 in Emacs 22.1.

   This does not happen with emacs 21.x or 20.x.

The second hunk of the following patch seems to fix (or at least paper
over) this problem.  While testing, I found a similar problem:  If you
put

	{
	}

into an empty cperl-mode buffer and then try to change it to

	{
	  $k =~ s{a}{b};
	}

cperl-find-pods-heres dies in a *different* place when you type the
*first* "{".  This is addressed by the first hunk.

   Needless to say, I do not have a whole lot of confidence in these
band-aids; cperl-find-pods-heres is 1122 lines long, and I do not even
begin to understand it.  Take it FWIW.

   ###################################

   With cperl-mode 5.23 form ilya, I can type the {}'s, but the following
   error is generated instead:

   End of `s{ ... }{ ... }' string/RE not found: (scan-error Unbalanced parentheses 11 13)

   This causes fontification to fail.

I can confirm this, but have no further insights.

					-- Bob Rogers
					   http://rgrjr.dyndns.org/

------------------------------------------------------------------------
Index: lisp/progmodes/cperl-mode.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/progmodes/cperl-mode.el,v
retrieving revision 1.89
diff -c -r1.89 cperl-mode.el
*** lisp/progmodes/cperl-mode.el	16 Apr 2007 07:05:28 -0000	1.89
--- lisp/progmodes/cperl-mode.el	9 Aug 2007 23:46:22 -0000
***************
*** 3729,3736 ****
  	(set-syntax-table reset-st))))
  
  (defsubst cperl-look-at-leading-count (is-x-REx e)
!   (if (re-search-forward (concat "\\=" (if is-x-REx "[ \t\n]*" "") "[{?+*]")
! 			 (1- e) t)	; return nil on failure, no moving
        (if (eq ?\{ (preceding-char)) nil
  	(cperl-postpone-fontification
  	 (1- (point)) (point)
--- 3729,3739 ----
  	(set-syntax-table reset-st))))
  
  (defsubst cperl-look-at-leading-count (is-x-REx e)
!   (if (and (> (point) e)
! 	   ;; return nil on failure, no moving
! 	   (re-search-forward (concat "\\="
! 				      (if is-x-REx "[ \t\n]*" "") "[{?+*]")
! 			      (1- e) t))
        (if (eq ?\{ (preceding-char)) nil
  	(cperl-postpone-fontification
  	 (1- (point)) (point)
***************
*** 4778,4784 ****
  		      (progn
  			(cperl-postpone-fontification
  			 (1- e1) e1 'face my-cperl-delimiters-face)
! 			(if (assoc (char-after b) cperl-starters)
  			    (progn
  			      (cperl-postpone-fontification
  			       b1 (1+ b1) 'face my-cperl-delimiters-face)
--- 4781,4788 ----
  		      (progn
  			(cperl-postpone-fontification
  			 (1- e1) e1 'face my-cperl-delimiters-face)
! 			(if (and (not (eobp))
! 				 (assoc (char-after b) cperl-starters))
  			    (progn
  			      (cperl-postpone-fontification
  			       b1 (1+ b1) 'face my-cperl-delimiters-face)

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

* Re: [kbrint@hamachi.rufus.net: cperl-mode problem under emacs 22.1]
  2007-08-09 23:57 ` Bob Rogers
@ 2007-08-11  5:04   ` Richard Stallman
  2007-08-17 19:04     ` Vinicius Jose Latorre
  0 siblings, 1 reply; 4+ messages in thread
From: Richard Stallman @ 2007-08-11  5:04 UTC (permalink / raw)
  To: emacs-devel; +Cc: Bob Rogers

Does anyone see any problem with Bob's patch?


Date: Thu, 9 Aug 2007 19:57:02 -0400
From: Bob Rogers <rogers-emacs@rgrjr.dyndns.org>
To: rms@gnu.org, emacs-devel@gnu.org
Subject: [kbrint@hamachi.rufus.net: cperl-mode problem under emacs 22.1]
In-Reply-To: <E1IIdZL-00040W-U4@fencepost.gnu.org>

   From: Richard Stallman <rms@gnu.org>
   Date: Wed, 08 Aug 2007 00:54:51 -0400

   Would someone please try to DTRT, then ack?  Sometimes these problems
   are impossible to fix, or impossible without creating worse problems.
   But it would be good to try it and see, before giving up.

   ------- Start of forwarded message -------
   X-Spam-Status: No, score=0.0 required=5.0 tests=UNPARSEABLE_RELAY 
	   autolearn=failed version=3.1.0
   From: kevin brintnall <kbrint@hamachi.rufus.net>
   To: bug-gnu-emacs@gnu.org
   Date: Tue,  7 Aug 2007 10:13:55 -0500 (CDT)
   Subject: cperl-mode problem under emacs 22.1

   emacs -q
   C-x C-f file.pl
   M-x cperl-mode

   Type into buffer:

   $k =~ s{a}{b};
	     ^ the second open brace will fail to insert, generating message:
	     Args out of range: 14, 15

   This is with the built-in cperl-mode 5.22 in Emacs 22.1.

   This does not happen with emacs 21.x or 20.x.

The second hunk of the following patch seems to fix (or at least paper
over) this problem.  While testing, I found a similar problem:  If you
put

	{
	}

into an empty cperl-mode buffer and then try to change it to

	{
	  $k =~ s{a}{b};
	}

cperl-find-pods-heres dies in a *different* place when you type the
*first* "{".  This is addressed by the first hunk.

   Needless to say, I do not have a whole lot of confidence in these
band-aids; cperl-find-pods-heres is 1122 lines long, and I do not even
begin to understand it.  Take it FWIW.

   ###################################

   With cperl-mode 5.23 form ilya, I can type the {}'s, but the following
   error is generated instead:

   End of `s{ ... }{ ... }' string/RE not found: (scan-error Unbalanced parentheses 11 13)

   This causes fontification to fail.

I can confirm this, but have no further insights.

					-- Bob Rogers
					   http://rgrjr.dyndns.org/

------------------------------------------------------------------------
Index: lisp/progmodes/cperl-mode.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/progmodes/cperl-mode.el,v
retrieving revision 1.89
diff -c -r1.89 cperl-mode.el
*** lisp/progmodes/cperl-mode.el	16 Apr 2007 07:05:28 -0000	1.89
--- lisp/progmodes/cperl-mode.el	9 Aug 2007 23:46:22 -0000
***************
*** 3729,3736 ****
  	(set-syntax-table reset-st))))
  
  (defsubst cperl-look-at-leading-count (is-x-REx e)
!   (if (re-search-forward (concat "\\=" (if is-x-REx "[ \t\n]*" "") "[{?+*]")
! 			 (1- e) t)	; return nil on failure, no moving
        (if (eq ?\{ (preceding-char)) nil
  	(cperl-postpone-fontification
  	 (1- (point)) (point)
--- 3729,3739 ----
  	(set-syntax-table reset-st))))
  
  (defsubst cperl-look-at-leading-count (is-x-REx e)
!   (if (and (> (point) e)
! 	   ;; return nil on failure, no moving
! 	   (re-search-forward (concat "\\="
! 				      (if is-x-REx "[ \t\n]*" "") "[{?+*]")
! 			      (1- e) t))
        (if (eq ?\{ (preceding-char)) nil
  	(cperl-postpone-fontification
  	 (1- (point)) (point)
***************
*** 4778,4784 ****
  		      (progn
  			(cperl-postpone-fontification
  			 (1- e1) e1 'face my-cperl-delimiters-face)
! 			(if (assoc (char-after b) cperl-starters)
  			    (progn
  			      (cperl-postpone-fontification
  			       b1 (1+ b1) 'face my-cperl-delimiters-face)
--- 4781,4788 ----
  		      (progn
  			(cperl-postpone-fontification
  			 (1- e1) e1 'face my-cperl-delimiters-face)
! 			(if (and (not (eobp))
! 				 (assoc (char-after b) cperl-starters))
  			    (progn
  			      (cperl-postpone-fontification
  			       b1 (1+ b1) 'face my-cperl-delimiters-face)

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

* Re: [kbrint@hamachi.rufus.net: cperl-mode problem under emacs 22.1]
  2007-08-11  5:04   ` Richard Stallman
@ 2007-08-17 19:04     ` Vinicius Jose Latorre
  0 siblings, 0 replies; 4+ messages in thread
From: Vinicius Jose Latorre @ 2007-08-17 19:04 UTC (permalink / raw)
  To: rms; +Cc: Bob Rogers, emacs-devel

Richard Stallman wrote:
> Does anyone see any problem with Bob's patch?
>   


The patch fix an error when typing an expression like s{a}{b} at end of 
buffer.

I've just installed the patch in trunk and Emacs 22 branch.


> Date: Thu, 9 Aug 2007 19:57:02 -0400
> From: Bob Rogers <rogers-emacs@rgrjr.dyndns.org>
> To: rms@gnu.org, emacs-devel@gnu.org
> Subject: [kbrint@hamachi.rufus.net: cperl-mode problem under emacs 22.1]
> In-Reply-To: <E1IIdZL-00040W-U4@fencepost.gnu.org>
>
>    From: Richard Stallman <rms@gnu.org>
>    Date: Wed, 08 Aug 2007 00:54:51 -0400
>
>    Would someone please try to DTRT, then ack?  Sometimes these problems
>    are impossible to fix, or impossible without creating worse problems.
>    But it would be good to try it and see, before giving up.
>
>    ------- Start of forwarded message -------
>    X-Spam-Status: No, score=0.0 required=5.0 tests=UNPARSEABLE_RELAY 
> 	   autolearn=failed version=3.1.0
>    From: kevin brintnall <kbrint@hamachi.rufus.net>
>    To: bug-gnu-emacs@gnu.org
>    Date: Tue,  7 Aug 2007 10:13:55 -0500 (CDT)
>    Subject: cperl-mode problem under emacs 22.1
>
>    emacs -q
>    C-x C-f file.pl
>    M-x cperl-mode
>
>    Type into buffer:
>
>    $k =~ s{a}{b};
> 	     ^ the second open brace will fail to insert, generating message:
> 	     Args out of range: 14, 15
>
>    This is with the built-in cperl-mode 5.22 in Emacs 22.1.
>
>    This does not happen with emacs 21.x or 20.x.
>
> The second hunk of the following patch seems to fix (or at least paper
> over) this problem.  While testing, I found a similar problem:  If you
> put
>
> 	{
> 	}
>
> into an empty cperl-mode buffer and then try to change it to
>
> 	{
> 	  $k =~ s{a}{b};
> 	}
>
> cperl-find-pods-heres dies in a *different* place when you type the
> *first* "{".  This is addressed by the first hunk.
>
>    Needless to say, I do not have a whole lot of confidence in these
> band-aids; cperl-find-pods-heres is 1122 lines long, and I do not even
> begin to understand it.  Take it FWIW.
>
>    ###################################
>
>    With cperl-mode 5.23 form ilya, I can type the {}'s, but the following
>    error is generated instead:
>
>    End of `s{ ... }{ ... }' string/RE not found: (scan-error Unbalanced parentheses 11 13)
>
>    This causes fontification to fail.
>
> I can confirm this, but have no further insights.
>
> 					-- Bob Rogers
> 					   http://rgrjr.dyndns.org/
>
> ------------------------------------------------------------------------
> Index: lisp/progmodes/cperl-mode.el
> ===================================================================
> RCS file: /sources/emacs/emacs/lisp/progmodes/cperl-mode.el,v
> retrieving revision 1.89
> diff -c -r1.89 cperl-mode.el
> *** lisp/progmodes/cperl-mode.el	16 Apr 2007 07:05:28 -0000	1.89
> --- lisp/progmodes/cperl-mode.el	9 Aug 2007 23:46:22 -0000
> ***************
> *** 3729,3736 ****
>   	(set-syntax-table reset-st))))
>   
>   (defsubst cperl-look-at-leading-count (is-x-REx e)
> !   (if (re-search-forward (concat "\\=" (if is-x-REx "[ \t\n]*" "") "[{?+*]")
> ! 			 (1- e) t)	; return nil on failure, no moving
>         (if (eq ?\{ (preceding-char)) nil
>   	(cperl-postpone-fontification
>   	 (1- (point)) (point)
> --- 3729,3739 ----
>   	(set-syntax-table reset-st))))
>   
>   (defsubst cperl-look-at-leading-count (is-x-REx e)
> !   (if (and (> (point) e)
> ! 	   ;; return nil on failure, no moving
> ! 	   (re-search-forward (concat "\\="
> ! 				      (if is-x-REx "[ \t\n]*" "") "[{?+*]")
> ! 			      (1- e) t))
>         (if (eq ?\{ (preceding-char)) nil
>   	(cperl-postpone-fontification
>   	 (1- (point)) (point)
> ***************
> *** 4778,4784 ****
>   		      (progn
>   			(cperl-postpone-fontification
>   			 (1- e1) e1 'face my-cperl-delimiters-face)
> ! 			(if (assoc (char-after b) cperl-starters)
>   			    (progn
>   			      (cperl-postpone-fontification
>   			       b1 (1+ b1) 'face my-cperl-delimiters-face)
> --- 4781,4788 ----
>   		      (progn
>   			(cperl-postpone-fontification
>   			 (1- e1) e1 'face my-cperl-delimiters-face)
> ! 			(if (and (not (eobp))
> ! 				 (assoc (char-after b) cperl-starters))
>   			    (progn
>   			      (cperl-postpone-fontification
>   			       b1 (1+ b1) 'face my-cperl-delimiters-face)
>   

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

end of thread, other threads:[~2007-08-17 19:04 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-08-08  4:54 [kbrint@hamachi.rufus.net: cperl-mode problem under emacs 22.1] Richard Stallman
2007-08-09 23:57 ` Bob Rogers
2007-08-11  5:04   ` Richard Stallman
2007-08-17 19:04     ` Vinicius Jose Latorre

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