unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Dirk Farin <d.s.farin@tue.nl>
Subject: emacs hangs in c++ font-lock-mode
Date: Thu, 14 Apr 2005 12:24:51 +0200	[thread overview]
Message-ID: <425E44F3.30108@tue.nl> (raw)

[-- Attachment #1: Type: text/plain, Size: 324 bytes --]


Hi,

I have got a C++ source file that causes "GNU Emacs 21.4.1"
(current Debian testing) to hang with 100% cpu. To reproduce
the bug, load the attached source file and turn font-lock-mode
on in C++ mode. If you move the cursor down, at some position,
emacs will hang and accept no more keyboard inputs.

Regards,
   Dirk


[-- Attachment #2: main.cc --]
[-- Type: text/x-c++src, Size: 2829 bytes --]


#include <gtkmm.h>
#include <libgnomeuimm.h>
#include <libgnomemm.h>
#include <libglademm.h>
#include <iostream>
#include <libvideogfx.hh>

using namespace videogfx;
//using namespace std;

Glib::RefPtr<Gnome::Glade::Xml> refXml;
Gnome::UI::App* pApp = 0;  // main window


struct SourceImage
{
  std::string name;
  Image<Pixel>  img;
};

DynArray<SourceImage> g_images;


void on_menu_item_activated()
{
  std::cout << "add\n";
}


void AddImageToList()
{
  Gtk::FileChooserDialog dialog("Please choose an image", Gtk::FILE_CHOOSER_ACTION_OPEN);
  dialog.set_transient_for(*pApp);

  //Add response buttons the the dialog:
  dialog.add_button(Gtk::Stock::CANCEL, Gtk::RESPONSE_CANCEL);
  dialog.add_button(Gtk::Stock::OPEN, Gtk::RESPONSE_OK);

  //Add filters, so that only certain file types can be selected:

#if 0
  Gtk::FileFilter filter_text;
  filter_text.set_name("Text files");
  filter_text.add_mime_type("text/plain");
  dialog.add_filter(filter_text);

  Gtk::FileFilter filter_cpp;
  filter_cpp.set_name("C/C++ files");
  filter_cpp.add_mime_type("text/x-c");
  filter_cpp.add_mime_type("text/x-c++");
  filter_cpp.add_mime_type("text/x-c-header");
  dialog.add_filter(filter_cpp);
#endif

#if 0
  Gtk::FileFilter filter_any;
  filter_any.set_name("Any files");
  filter_any.add_pattern("*");
  dialog.add_filter(filter_any);
#endif

  //Show the dialog and wait for a user response:
  int result = dialog.run();

  //Handle the response:
  switch(result)
    {
    case(Gtk::RESPONSE_OK):
      {
	std::cout << "Open clicked." << std::endl;

	std::string filename = dialog.get_filename(); //Notice that it is a std::string, not a Glib::ustring.
	std::cout << "File selected: " <<  filename << std::endl;

	int last = filename.find_last_of('/');

	SourceImage newimage;
	newimage.name = filename.substr(

	//std::cout << last << endl;

#if 0
struct SourceImage
{
  Glib::ustring name;
  Image<Pixel>  img;
};

DynArray<SourceImage> g_images;
#endif

	break;
      }
    case(Gtk::RESPONSE_CANCEL):
      {
	std::cout << "Cancel clicked." << std::endl;
	break;
      }
    default:
      {
	std::cout << "Unexpected button clicked." << std::endl;
	break;
      }
    }
}


void ConnectMenuCallbacks()
{
  Gtk::MenuItem* pMenuItem = 0;
  refXml->get_widget("add_image1", pMenuItem);
  if(pMenuItem)
    pMenuItem->signal_activate().connect( sigc::ptr_fun(&AddImageToList) );

  refXml->get_widget("quit1", pMenuItem);
  if(pMenuItem)
    pMenuItem->signal_activate().connect( sigc::mem_fun(*pApp,&Gnome::UI::App::hide) );
}


int main(int argc, char *argv[])
{
  Gnome::Main kit("spherepano","0.1",
		  Gnome::UI::module_info_get(),
		  argc,argv);

  refXml = Gnome::Glade::Xml::create("gui.glade");

  refXml->get_widget("mainwindow", pApp);

  ConnectMenuCallbacks();

  Gtk::Main::run(*pApp);
    
  return 0;
}

[-- Attachment #3: Type: text/plain, Size: 149 bytes --]

_______________________________________________
Bug-gnu-emacs mailing list
Bug-gnu-emacs@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-gnu-emacs

             reply	other threads:[~2005-04-14 10:24 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-04-14 10:24 Dirk Farin [this message]
  -- strict thread matches above, loose matches on Subject: below --
2005-04-16 16:50 emacs hangs in c++ font-lock-modeo Alan Mackenzie
2005-04-16 17:34 ` emacs hangs in c++ font-lock-mode Dirk Farin

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=425E44F3.30108@tue.nl \
    --to=d.s.farin@tue.nl \
    /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 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).