Andreas Roehler | 1 Jan 2010 12:43
Picon

Re: cc-mode help - how to support literal strings in C# syntax?

ok, had to change beg-end.el still a little bit, as beg- and end-string are equal here

Here its use in thingatpt-utils-base.el

;; Doublequoted

(put 'doublequoted 'beginning-op-at
     (lambda ()
         (beginning-of-form-base "\"" "\"" nil 1)))

(put 'doublequoted 'end-op-at
     (lambda ()
       (when (looking-at "\"")
           (end-of-form-base "\"" "\"" nil 1))))

It now returns things between regardless escapes. Not uploaded yet.

Still some minor issues, checks to do. I'll send a message, if its ready.

hopefully, happy new year

Andreas

dino chiesa wrote:
> Andreas, thanks for the reply. 
> The mode is available at: 
> http://www.emacswiki.org/emacs/csharp-mode.el
>  
>  
> And here is a source code module that exhibits the problem:
(Continue reading)

yupeng | 1 Jan 2010 10:00
Picon

awk file report error after I save it

From: yupeng <yupeng <at> yupeng-laptop>
To: bug-cc-mode <at> gnu.org
Subject: CC Mode 5.31.7 (AWK/l); awk file report error after I save it
X-Reporter-Void-Vars-Found: auto-fill-mode 
--text follows this line--

If I set require-final-newline as "t" in my .emacs:
(setq require-final-newline t)
every time I save my awk file, emacs will report "Args out of range" in
minibuffer, and I can not save
the file successfully.

The below is an example.
I run emacs by "emacs -q &", and set require-final-newline as "t"
manually in *scratch* buffer,
then I write a very simple awk file, named "1.awk":
------------------------------------------------------
#! /usr/bin/awk -f

BEGIN { print "Hello" }
--------------------------------------------------------
When I save it, "Args out of range" will be shown in minibuffer, and I
can't save it successfully.
I check the *Messages* buffer, and find the below message:
c-awk-set-syntax-table-properties: Args out of range: 21, 46.

If I don't set require-final-newline as t, everything will be fine.

And I check the "c-awk-set-syntax-table-properties" function, 
add the below sentence before "(c-clear-char-properties (point) lim
(Continue reading)

Andreas Roehler | 1 Jan 2010 17:04
Picon

Re: cc-mode help - how to support literal strings in C# syntax?

Hi again,

with little experimental form below
` <at> -prefixed-csharp-string' is detected.  See screenshot
attached.

It's core is built upon thingatpt-utils-base.el from
https://code.launchpad.net/s-x-emacs-werkstatt/

Reporting borders and all kind of at-point-functions
will be available likewise - it's just to put new form
` <at> -Prefixed-csharp-string' into a template.

If that kind of functions being useful, needed
functions from thingatpt-utils-base.el might be
extracted into a standalone app.

Andreas

;;;;;;;;

(require 'thingatpt-utils-base)

;;  <at> -Prefixed-csharp-string

(put ' <at> -prefixed-csharp-string 'beginning-op-at
     (lambda ()
         (beginning-of-form-base " <at> \"" "[^ <at> ]\"" nil 1)))

(put ' <at> -prefixed-csharp-string 'end-op-at
(Continue reading)

Alan Mackenzie | 5 Jan 2010 23:14
Picon
Favicon

Re: awk file report error after I save it

Hi, Yupeng,

On Fri, Jan 01, 2010 at 05:00:22PM +0800, yupeng wrote:
> From: yupeng <yupeng <at> yupeng-laptop>
> To: bug-cc-mode <at> gnu.org
> Subject: CC Mode 5.31.7 (AWK/l); awk file report error after I save it
> X-Reporter-Void-Vars-Found: auto-fill-mode 
> --text follows this line--

> If I set require-final-newline as "t" in my .emacs:
> (setq require-final-newline t)
> every time I save my awk file, emacs will report "Args out of range" in
> minibuffer, and I can not save
> the file successfully.

> The below is an example.
> I run emacs by "emacs -q &", and set require-final-newline as "t"
> manually in *scratch* buffer,
> then I write a very simple awk file, named "1.awk":
> ------------------------------------------------------
> #! /usr/bin/awk -f

> BEGIN { print "Hello" }
> --------------------------------------------------------
> When I save it, "Args out of range" will be shown in minibuffer, and I
> can't save it successfully.
> I check the *Messages* buffer, and find the below message:
> c-awk-set-syntax-table-properties: Args out of range: 21, 46.

> If I don't set require-final-newline as t, everything will be fine.
(Continue reading)

Jose A. Ortega | 10 Jan 2010 15:43
Picon
Gravatar

error in c-mode highlighting/indentation (emacs 23.91.1)

Hi, this is a bug somewhere in c-mode syntactic analyser (or so it
seems). It happens to me in several circumstances; below i describe a
simple instance for a C++ file (i've seen it happening also in pure C
files).

1) Start emacs with -nw and -Q
2) Create a new C++ file, say test.cpp
3) Insert the following text:

/* Copyright (C) 2009, 2100 Foo Industries */
#include <libPlasma/c++/Pool.h>
4) When pressing the closing '>' an error occurs with the following backtrace:

Debugger entered--Lisp error: (args-out-of-range 79 80)
  remove-text-properties(79 80 (category nil))
  c-parse-state()
  c-syntactic-skip-backward("^<;}" nil t)
  c-electric-lt-gt(nil)
  call-interactively(c-electric-lt-gt nil nil)

My emacs setup:

In GNU Emacs 23.1.91.1 (i486-pc-linux-gnu, GTK+ Version 2.18.5)
 of 2010-01-06 on elegiac, modified by Debian
 (emacs-snapshot package, version 1:20100106-1)
configured using `configure  '--build' 'i486-linux-gnu' '--host'
 'i486-linux-gnu' '--prefix=/usr' '--sharedstatedir=/var/lib'
 '--libexecdir=/usr/lib' '--localstatedir=/var'
 '--infodir=/usr/share/info' '--mandir=/usr/share/man' '--with-pop\
=yes'
(Continue reading)

Thomas Caswell | 13 Jan 2010 19:13
Favicon

CC Mode 5.31.8 (C++/lah); error on hilighting standard includes


When typeing the stardard #include an error is generated.

test case:
1 open new file in c++-mode
2 type #include <string>
3 generates errors and does not highlight text and cursor does not jump
back to the end.  generates the following errors:

 c-neutralize-syntax-in-and-mark-CPP: Args out of range: 2, 3Error during redisplay:
(args-out-of-range 10 11)
 Error during redisplay: (args-out-of-range 11 12)
 byte-code: Args out of range: 18, 19
 Error during redisplay: (args-out-of-range 18 19)

4 if the file is reloaded with C-x C-v the highlighting works, but
adding a second include also generates the
 byte-code: Args out of range: 18, 19
error and does not jump back to the end
5 indenting does not work properly, but if the file is reloaded then it
works again

Emacs  : GNU Emacs 23.1.90.2 (x86_64-unknown-linux-gnu, GTK+ Version 2.12.12)
 of 2010-01-12 on innoue
Package: CC Mode 5.31.8 (C++/lah)
Buffer Style: gnu
c-emacs-features: (pps-extended-state col-0-paren posix-char-classes gen-string-delim
gen-comment-delim syntax-properties 1-bit)

current state:
(Continue reading)

Odekirk, Shawn | 15 Jan 2010 15:43
Favicon

23.1; syntactic analysis incorrect

I first sent this to the bug-gnu-emacs mailing list, but I think this list might be more appropriate.
 
From:  <shawn.odekirk <at> fkilogistex.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 23.1; syntactic analysis incorrect
--text follows this line--
A switch statement with two case labels, at least one of which is a character constant, causes the syntactic analysis of the first statement in the case block to be evaluated as statement-cont instead of statement-case-intro.
I believe the line 'x = 1;' should be evaluated as statement-case-into, but it is being evaluated as statement-cont.
 
switch (x)
  {
  case 'a':
  case 'b':
    x = 1;
  y = 2;
  break;
  }
 
 
 
In GNU Emacs 23.1.1 (x86_64-unknown-linux-gnu, GTK+ Version 2.16.5)
 of 2009-07-31 on bitzer.hoetzel.info
Windowing system distributor `The X.Org Foundation', version 11.0.10703901
configured using `configure  '--prefix=/usr' '--sysconfdir=/etc' '--libexecdir=/usr/lib' '--localstatedir=/var' '--mandir=/usr/share/man' '--without-sound' '-with-x-toolkit=gtk' 'CFLAGS=-march=x86-64 -mtune=generic -O2 -pipe''
 
Important settings:
  value of $LC_ALL: nil
  value of $LC_COLLATE: C
  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: en_US.UTF-8
  value of $XMODIFIERS: nil
  locale-coding-system: utf-8-unix
  default-enable-multibyte-characters: t
 
Major mode: C/l
 
Minor modes in effect:
  tooltip-mode: t
  tool-bar-mode: t
  mouse-wheel-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  global-auto-composition-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  transient-mark-mode: t
  abbrev-mode: t
 
Recent input:
C-x k <return> <up> <up> <up> <up> <down> <down> <down>
<down> <down> <down> <down> s w i t c h SPC ( x ) <escape>
x c - m o d e <return> <down> <down> <down> <return>
{ <return> } <end> <up> <return> c a s e SPC ' a '
: <return> c a s e SPC ' b ' : <return> x SPC = SPC
1 ; <return> y SPC = SPC 3 <backspace> 2 ; <return>
b r e a k ; <down> <tab> <up> <tab> <escape> x s e
t - v a r <tab> <return> c - e <tab> c <tab> <return>
y <backspace> t <return> <tab> <up> <tab> <up> <tab>
<up> <tab> <down> <tab> <down> <tab> <up> <tab> <up>
<tab> <up> <up> <up> <up> <C-home> C-k C-k C-k C-k
C-k C-k C-k <tab> <down> <tab> <down> <tab> <down>
<tab> <down> <tab> <down> <tab> <down> <tab> <down>
<tab> <down> <down> <down> <return> <escape> x r e
p o r <tab> <return>
 
Recent messages:
syntax: ((statement-cont 221)), indent: 4
syntax: ((case-label 205)), indent: 2
Mark set
syntax: ((topmost-intro 1)), indent: 0
syntax: ((substatement-open 1)), indent: 2
syntax: ((case-label 14)), indent: 2 [2 times]
syntax: ((statement-cont 30)), indent: 4
syntax: ((statement 30)), indent: 2
syntax: ((statement 53)), indent: 2
syntax: ((block-close 14)), indent: 2
 

 

 

Shawn Odekirk
Senior Software Engineer

Intelligrated
4612 Navistar Drive
Frederick, MD21703

Email: shawn.odekirk <at> intelligrated.com
Web:
www.intelligrated.com

Phone: 240.629.1540
Cell: 240.647.8457
Fax: 240.629.1460

 

CONFIDENTIALITY NOTICE

This e-mail transmission, and any documents, files, or previous e-mail messages attached to it, may contain confidential information, trade secret information, or information that is legally privileged. If you are not the intended recipient, or a person responsible for delivering it to the intended recipient, you are hereby notified that any disclosure, copying, distribution, or use of any of the information contained in or attached to this message is strictly prohibited. If you have received this transmission in error, please immediately notify the sender by reply e-mail, and destroy the original transmission and its' attachments.

This E-mail is the property of Intelligrated.

 

 
------------------------------------------------------------------------------
Throughout its 18-year history, RSA Conference consistently attracts the
world's best and brightest in the field, creating opportunities for Conference
attendees to learn about information security's most important issues through
interactions with peers, luminaries and emerging and established companies.
http://p.sf.net/sfu/rsaconf-dev2dev
Alan Mackenzie | 20 Jan 2010 14:09
Picon
Favicon

Re: CC Mode 5.31.8 (C++/lah); error on hilighting standard includes

Hi, Thomas,

On Wed, Jan 13, 2010 at 12:13:09PM -0600, Thomas Caswell wrote:

> When typeing the stardard #include an error is generated.

> test case:
> 1 open new file in c++-mode
> 2 type #include <string>
> 3 generates errors and does not highlight text and cursor does not jump
> back to the end.  generates the following errors:

>  c-neutralize-syntax-in-and-mark-CPP: Args out of range: 2, 3Error during redisplay:
(args-out-of-range 10 11)
>  Error during redisplay: (args-out-of-range 11 12)
>  byte-code: Args out of range: 18, 19
>  Error during redisplay: (args-out-of-range 18 19)

> 4 if the file is reloaded with C-x C-v the highlighting works, but
> adding a second include also generates the
>  byte-code: Args out of range: 18, 19
> error and does not jump back to the end
> 5 indenting does not work properly, but if the file is reloaded then it
> works again

OK, firstly, thanks for such a clear and explicit bug report.

I've committed a patch to savannah which should fix this.  Please either
update your bzr version of Emacs, or apply the following patch.
Afterwards, make sure you byte-compile cc-langs.el, cc-engine.el and
cc-mode.el.

Here's the patch:

*** cc-defs.el~	2010-01-19 13:24:48.000000000 +0000
--- cc-defs.el	2010-01-19 17:23:44.000000000 +0000
***************
*** 1217,1228 ****
    ;; This macro does a hidden buffer change.
    `(progn
       (c-put-char-property ,beg 'category 'c-cpp-delimiter)
!      (c-put-char-property ,end 'category 'c-cpp-delimiter)))
  (defmacro c-clear-cpp-delimiters (beg end)
    ;; This macro does a hidden buffer change.
    `(progn
       (c-clear-char-property ,beg 'category)
!      (c-clear-char-property ,end 'category)))

  (defsubst c-comment-out-cpps ()
    ;; Render all preprocessor constructs syntactically commented out.
--- 1217,1230 ----
    ;; This macro does a hidden buffer change.
    `(progn
       (c-put-char-property ,beg 'category 'c-cpp-delimiter)
!      (if (< ,end (point-max))
! 	 (c-put-char-property ,end 'category 'c-cpp-delimiter))))
  (defmacro c-clear-cpp-delimiters (beg end)
    ;; This macro does a hidden buffer change.
    `(progn
       (c-clear-char-property ,beg 'category)
!      (if (< ,end (point-max))
! 	 (c-clear-char-property ,end 'category))))

  (defsubst c-comment-out-cpps ()
    ;; Render all preprocessor constructs syntactically commented out.

[ CC Mode state dump cut, but appreciated. ]

--

-- 
Alan Mackenzie (Nuremberg, Germany).

------------------------------------------------------------------------------
Throughout its 18-year history, RSA Conference consistently attracts the
world's best and brightest in the field, creating opportunities for Conference
attendees to learn about information security's most important issues through
interactions with peers, luminaries and emerging and established companies.
http://p.sf.net/sfu/rsaconf-dev2dev

Tom Browder | 31 Jan 2010 23:57
Picon

Need Help with Filling Doxygen-style Comments

In cc-mode filling paragraphs works great on '//' style comments, but
the styles for filling doxygen comments like '//!' I can't make work.
The '///' style work fine, though.

I have tried setting the adaptive filling variables like this:

(setq allow-fill-mode t)
(defvar adaptive-fill-first-line-regexp
  '("[[:space:]]*\\([#;>*]+ +\|/// +\|//! +\\)?"))
(defvar adaptive-fill-regexp
  '("[[:space:]]*\\([#;>*]+ +\|/// +\|//! +\\)?"))

but it doesn't affect '//!' comments.  And if I remove those lines
above, '///' still fills fine.

Any ideas?

Thanks.

-Tom

Thomas M. Browder, Jr.
Niceville, Florida
USA

------------------------------------------------------------------------------
The Planet: dedicated and managed hosting, cloud storage, colocation
Stay online with enterprise data centers and the best network in the business
Choose flexible plans and management services without long-term contracts
Personal 24x7 support from experience hosting pros just a phone call away.
http://p.sf.net/sfu/theplanet-com


Gmane