unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Piotr Sipika <piotr.sipika@gmail.com>
To: Alan Mackenzie <acm@muc.de>
Cc: 18970@debbugs.gnu.org
Subject: bug#18970: 24.3; indent region fails in C++ mode after adding a #include
Date: Thu, 06 Nov 2014 08:53:41 -0500	[thread overview]
Message-ID: <545B7D65.8080505@gmail.com> (raw)
In-Reply-To: <20141106115429.80515.qmail@mail.muc.de>

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


Hi Alan,

On 11/06/2014 06:54 AM, Alan Mackenzie wrote:
> This bug will be dependent on the exact contents of the file, or at least
> the first few hundred or thousand bytes in it.  Is there any chance you
> could post the file as it was just before you edited it in step 1., and
> say exactly what keys you used for 1. - 4.?
Certainly.

The steps were:
1. Edited a C++ header file in a buffer.
The file is attached (resource.h)

2. Switched to another buffer.
C-x b [ENTER]
(possibly edited the other buffer, but don't recall the exact keys...)

3. Went back to buffer in #1, above.
C-x b [ENTER]

4. Added a #include to the top of the buffer.
Went to line 9, moved the two #include's there down using [ENTER] (twice).
Added: #include <pthread.h> [ENTER]
Saved buffer: C-x C-s

5. Indentation for all code blocks following the include, when using
TAB, resets to line 0.
Went down to the declaration of findLocation() and hit [TAB]; the
function ended up being moved to line 0.

> Thanks!
Hope this helps...

Cheers,
Piotr


[-- Attachment #2: resource.h --]
[-- Type: text/plain, Size: 1339 bytes --]


#ifndef LXWEATHER_RESOURCE_H_
#define LXWEATHER_RESOURCE_H_

#include "exception.h"
#include "location.h"
#include "transport.h"

#include <string>
#include <vector>

namespace LXWeather
{
  typedef enum
    {
      RESOURCE_UNKNOWN,
      RESOURCE_YAHOO,
      RESOURCE_MAX
    } ResourceType;

  class ResourceException : public Exception
  {
  public:
    ResourceException(const std::string &msg) : Exception(msg) {};
  };

  class Resource
  {
  public:
    Resource(const ResourceType type, Transport &transport) : 
      type_(type), 
      location_(NULL),
      transport_(transport) {};

    virtual ~Resource() 
    {
      if (location_)
        {
          delete location_;
        }
    };

    ResourceType type() { return type_; };

    Location *location() const { return location_; };

    void location(Location *location) 
    { 
      if (location_)
        {
          delete location_;
        }
      
      location_ = location; 
    };

    Transport &transport() const { return transport_; };

    virtual std::vector<Location *> findLocation(const std::string &name) = 0;

    /*    virtual std::string forecast(const std::string &URI) = 0;*/

  protected:
    ResourceType type_;

    Location *location_;

    Transport &transport_;
  };

} /* end namespace LXWeather */

#endif /* LXWEATHER_RESOURCE_H_ */

  reply	other threads:[~2014-11-06 13:53 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-06  3:44 bug#18970: 24.3; indent region fails in C++ mode after adding a #include Piotr Sipika
     [not found] ` <mailman.12996.1415245577.1147.bug-gnu-emacs@gnu.org>
2014-11-06 11:54   ` Alan Mackenzie
2014-11-06 13:53     ` Piotr Sipika [this message]
2014-11-07 16:14       ` Piotr Sipika
     [not found]     ` <545D3F5E.8030801@gmail.com>
2014-11-07 23:24       ` Alan Mackenzie
2014-11-08  2:27         ` Piotr Sipika
2014-11-08  3:08         ` Piotr Sipika
2014-11-08  8:29           ` Alan Mackenzie

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=545B7D65.8080505@gmail.com \
    --to=piotr.sipika@gmail.com \
    --cc=18970@debbugs.gnu.org \
    --cc=acm@muc.de \
    /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).