cpp-auto-include
cpp-auto-include copied to clipboard
#include<stack> 这个头文件的处理有一点问题。
It can't be added effectively.
Same issue. I'm also having trouble including <stack>
Add following configuration in your conifguration
(with-eval-after-load 'cpp-auto-include
(add-to-list 'cpp-auto-include--header-regexp (list "stack" t t "\\bstack\\s-*<")))
Or apply following patch.
diff --git a/cpp-auto-include.el b/cpp-auto-include.el
index 7b11c69..d67e5f1 100644
--- a/cpp-auto-include.el
+++ b/cpp-auto-include.el
@@ -126,7 +126,8 @@
(and (or "fixed" "hex")
symbol-end)))))
("string" t t "\\bstring\\b")
- ("utility" t t "\\b\\(?:pair\\s-*<\\|make_pair\\)")))
+ ("utility" t t "\\b\\(?:pair\\s-*<\\|make_pair\\)")
+ ("stack" t t "\\bstack\\s-*<")))
(defun cpp-auto-include--include-line (header)
(save-excursion
BTW this package provides very low level features, I suppose it is better to use more smart packages which support auto including header rather than this package.
Thanks for the workaround, it works for me now.
I suppose it is better to use more smart packages which support auto including header rather than this package.
Oh? Is there anything that you'd recommend at the moment?
Oh? Is there anything that you'd recommend at the moment?
Sorry I don't know and I'm no longer use Emacs. However clangd supports auto include feature so lsp-mode might support it.
@syohex Thanks, I have actually using lsp with clangd. I'll look into it then.
I have excellent news: Turns out that someone loves this so much that he continues to maintain this project privately, and has now grown over 1500+ lines! https://github.com/elbeno/dotemacs/blob/master/.emacs.d/site-lisp/cpp-auto-include.el @syohex If you wish, you can replace this repo's content with his 'fork', provided that you have access to commit and PR. Preferably after giving credits to the fork maintainer Ben. Anyhow, I have mine set up like this now:
(use-package cpp-auto-include ; Copyright (C) 2015 by Syohei Yoshida / Ben Deane
:bind (:map c++-mode-map ("C-c i" . cpp-auto-include/ensure-includes-for-file)))
I have no longer write permission of this repository and I cannot change this repository content.
No problem, I'll open a new issue asking the devs here to consider updating the code.
It would be create if @elbeno could maintain this officially. Interested?