Andrew Burgess | 5 Jan 2012 13:30
Favicon

[PATCH] c-set-region-active / activate-mark-hook

Hi,

I create a config file ~/tmp/setup.el containing:

(defun cursor-activate-mark ()
   (setq cursor-type 'bar))
(add-hook 'activate-mark-hook 'cursor-activate-mark)

(defun cursor-deactivate-mark ()
   (setq cursor-type 'box))
(add-hook 'deactivate-mark-hook 'cursor-deactivate-mark)

(defun setup-c-mode ()
   (c-toggle-auto-newline 1))
(add-hook 'c-mode-hook 'setup-c-mode)

If I start emacs on a new empty file,

emacs -Q -l ~/tmp/setup.el ~/tmp/newfile.c

First I need to have a mark set, so,

M-x set-mark-command

This should turn the cursor from standard box into a bar form. Now,

M-x keyboard-quit

The cursor should return to box form.

(Continue reading)

Hannu Koivisto | 4 Jan 2012 10:42
Picon
Picon
Favicon

Incorrect C++ indentation in variable definition

Hi,

With CC Mode from CVS as of this writing and arglist-cont-nonempty
set to +, I get the following indentation:

int bar(int a, int b)
{
    return a+b;
}

void foo()
{
    int variable(bar(1,
            2));  // the problem
    int variable2 = bar(1,
        2);       // ok
}

I would expect the line marked with "the problem" to be indented
identically to the line marked with "ok".

--

-- 
Hannu

------------------------------------------------------------------------------
Ridiculously easy VDI. With Citrix VDI-in-a-Box, you don't need a complex
infrastructure or vast IT resources to deliver seamless, secure access to
virtual desktops. With this all-in-one solution, easily deploy virtual 
desktops for less than the cost of PCs and save 60% on VDI infrastructure 
costs. Try it free! http://p.sf.net/sfu/Citrix-VDIinabox
(Continue reading)

martin rudalics | 9 Jan 2012 19:19
Picon
Picon

bug#10463: 24.0.92; c-literal-limits out of range

 > That's presumably because the code uses something like
 > with-silent-modifications.  I.e. it's not a problem (contrary to the
 > `args-out-of-range' error, obviously).

My bad.  I didn't quit the backtrace buffer but tried to fix it manually
and lost my changes :-(

martin

------------------------------------------------------------------------------
Ridiculously easy VDI. With Citrix VDI-in-a-Box, you don't need a complex
infrastructure or vast IT resources to deliver seamless, secure access to
virtual desktops. With this all-in-one solution, easily deploy virtual 
desktops for less than the cost of PCs and save 60% on VDI infrastructure 
costs. Try it free! http://p.sf.net/sfu/Citrix-VDIinabox

Alan Mackenzie | 9 Jan 2012 22:17
Picon
Favicon

bug#10463: 24.0.92; c-literal-limits out of range

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."
(Continue reading)

Kimball Thurston | 9 Jan 2012 18:40
Picon

problem with templates in c++

Hi -

   I've been having a common, but not consistent that I can lock it
down, problem with cc-mode. I've tried checking out the latest head
revision of the source tree, and it still persists. Basically, as I'm
typing, say something like:

namespace Foo
{

template <class T> void doSomething( const std::vector<Bar::X> &v, const T &y )

the template arguments (i.e. Bar::X, or class T) will not recognize
that the template block has closed, and so indent will continue from
there on the next line indented to say, underneath the Bar::X in the
above example. Sometimes if I reload the file once I've finished
typing, it will fix itself, sometimes it's more persistent. In either
case, the incorrect only continues until the next major block (i.e.
{}), so if I manually update the indenting, and get into the main
code, it's usually fine, until the next time I declare a variable with
template arguments.

Can someone give me pointers on where to look, or things to provide to
help debug this? It's fairly annoying.

Additionally, I'd like to make sure that C++11 template notation
functions (template <class std::vector<X>> where there is no space
between the right angle brackets)...

thanks!
(Continue reading)

martin rudalics | 10 Jan 2012 11:19
Picon
Picon

bug#10463: 24.0.92; c-literal-limits out of range

 > Please apply this patch, use C Mode for an infinite amount of time,

Editing with C Mode already takes an infinite amount of time ...

 > then
 > report back and tell me the bug has disappeared.

... so better not hold your breath ;-)

 > !     (widen
 > !      (let* ((safe-place (c-state-safe-place (point)))

My `widen' doesn't like any arguments.

Thanks, martin

------------------------------------------------------------------------------
Write once. Port to many.
Get the SDK and tools to simplify cross-platform app development. Create 
new or port existing apps to sell to consumers worldwide. Explore the 
Intel AppUpSM program developer opportunity. appdeveloper.intel.com/join
http://p.sf.net/sfu/intel-appdev

Alan Mackenzie | 10 Jan 2012 11:45
Picon
Favicon

Re: problem with templates in c++

Hello, Thurston.

On Mon, Jan 09, 2012 at 09:40:07AM -0800, Kimball Thurston wrote:
> Hi -

>    I've been having a common, but not consistent that I can lock it
> down, problem with cc-mode. I've tried checking out the latest head
> revision of the source tree, and it still persists.

How often does it happen?  Nearly every time, or about half the time, or
about 10% of the time or hardly ever?

> Basically, as I'm typing, say something like:

> namespace Foo
> {

> template <class T> void doSomething( const std::vector<Bar::X> &v, const T &y )

> the template arguments (i.e. Bar::X, or class T) will not recognize
> that the template block has closed, and so indent will continue from
> there on the next line indented to say, underneath the Bar::X in the
> above example.

Does this happen in exactly the fragment you've typed above?

> Sometimes if I reload the file once I've finished typing, it will fix
> itself, sometimes it's more persistent. In either case, the incorrect
> only continues until the next major block (i.e.  {}), so if I manually
> update the indenting, and get into the main code, it's usually fine,
(Continue reading)

Stefan Monnier | 10 Jan 2012 21:04
Picon

bug#10463: 24.0.92; c-literal-limits out of range

>> Please apply this patch, use C Mode for an infinite amount of time,
> Editing with C Mode already takes an infinite amount of time ...

But doing it with Emacs makes the time pass infinitely faster.

        Stefan

------------------------------------------------------------------------------
Write once. Port to many.
Get the SDK and tools to simplify cross-platform app development. Create 
new or port existing apps to sell to consumers worldwide. Explore the 
Intel AppUpSM program developer opportunity. appdeveloper.intel.com/join
http://p.sf.net/sfu/intel-appdev

Juanma Barranquero | 10 Jan 2012 21:29
Picon
Gravatar

bug#10463: 24.0.92; c-literal-limits out of range

On Tue, Jan 10, 2012 at 21:04, Stefan Monnier <monnier <at> iro.umontreal.ca> wrote:

>> Editing with C Mode already takes an infinite amount of time ...
>
> But doing it with Emacs makes the time pass infinitely faster.

Yes, but do both infinites have the same cardinality...?

    Juanma

------------------------------------------------------------------------------
Write once. Port to many.
Get the SDK and tools to simplify cross-platform app development. Create 
new or port existing apps to sell to consumers worldwide. Explore the 
Intel AppUpSM program developer opportunity. appdeveloper.intel.com/join
http://p.sf.net/sfu/intel-appdev
martin rudalics | 10 Jan 2012 22:21
Picon
Picon

bug#10463: 24.0.92; c-literal-limits out of range

> But doing it with Emacs makes the time pass infinitely faster.

In particular when it throws you out of its ranges.

martin

------------------------------------------------------------------------------
Write once. Port to many.
Get the SDK and tools to simplify cross-platform app development. Create 
new or port existing apps to sell to consumers worldwide. Explore the 
Intel AppUpSM program developer opportunity. appdeveloper.intel.com/join
http://p.sf.net/sfu/intel-appdev


Gmane