From: Andrew Pennebaker <andrew.pennebaker@gmail.com>
To: Emacs Help <help-gnu-emacs@gnu.org>
Subject: c++-mode: Invalid function: (setq ad-return-value (ad-Orig-c-parse-state))
Date: Tue, 26 Mar 2013 16:12:00 -0400 [thread overview]
Message-ID: <CAHXt_SX9Y82L9YcOBki--AX0WpXH5GXsfL2xNNajGpDjOi-vbA@mail.gmail.com> (raw)
[-- Attachment #1.1: Type: text/plain, Size: 288 bytes --]
I can't insert important C++ characters into my code (attached). When I
press ; or { Emacs shows an error in the minibuffer:
"Invalid function: (setq ad-return-value (ad-Orig-c-parse-state))"
Major mode is c++-mode.
Using Emacs 24.2.1.
--
Cheers,
Andrew Pennebaker
www.yellosoft.us
[-- Attachment #1.2: Type: text/html, Size: 560 bytes --]
[-- Attachment #2: fizzy.cpp --]
[-- Type: text/x-c++src, Size: 1073 bytes --]
#include <iostream>
#include <string>
#include <sstream>
#include <vector>
#include <numeric>
#ifdef ASYNC
#include <future>
#endif
using namespace std;
string fizzy(int n) {
int a = n % 3, b = n % 5;
if (a == 0 && b == 0) {
return "FizzBuzz";
}
else if (a == 0) {
return "Fizz";
}
else if (b == 0) {
return "Buzz";
}
else {
stringstream out;
out << n;
return out.str();
}
}
void fizzbuzz() {
vector<int> range(100, 0);
#ifdef ASYNC
iota(range.begin(), range.end(), 0);
#endif
vector<string> strings(range.size(), "");
#ifdef ASYNC
vector<future<void>> futures;
#endif
#ifdef AUTO
for (auto i : range) {
#elsif
int i;
for (i = 0; i < range.size(); i++) {
#endif
#ifdef ASYNC
futures.emplace_back(
std::async(
launch::async,
[&]() {
#endif
strings[i] = fizzy(i + 1);
#ifdef ASYNC
}
)
);
#endif
}
for (auto s : strings) {
cout << s << endl;
}
}
int main() { fizzbuzz(); }
next reply other threads:[~2013-03-26 20:12 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-26 20:12 Andrew Pennebaker [this message]
2013-03-26 20:18 ` c++-mode: Invalid function: (setq ad-return-value (ad-Orig-c-parse-state)) Andrew Pennebaker
2013-03-27 6:43 ` Leo Liu
2013-03-27 12:16 ` Andrew Pennebaker
[not found] ` <mailman.22894.1364329129.855.help-gnu-emacs@gnu.org>
2013-03-27 11:07 ` c++-mode: Invalid function: (setq ad-return-value?(ad-Orig-c-parse-state)) Alan Mackenzie
2013-03-27 12:37 ` c++-mode: Invalid function: (setq ad-return-value (ad-Orig-c-parse-state)) Stefan Monnier
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAHXt_SX9Y82L9YcOBki--AX0WpXH5GXsfL2xNNajGpDjOi-vbA@mail.gmail.com \
--to=andrew.pennebaker@gmail.com \
--cc=help-gnu-emacs@gnu.org \
/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 external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.