“current buffer has no process“ 问题解决

前些日子在Emacs中使用gdb调试程序,发现一设断点就提示 "current buffer has no process",很是郁闷。后来偶然发现原因:Emacs中已经集成了gdb,所以不需要再load-library multi-gud.el和multi-gdb-ui.el了。增加了gdb的快捷键设置,现在的.emacs文件内容如下:

 

(setq initial-frame-alist '((top . 0) (left . 0) (width . 1024) (height . 768)))
(column-number-mode t)
(transient-mark-mode t)
(setq line-number-mode t)
;;(setq default-tab-width 8)
(setq default-tab-width 4)
(customize-set-variable 'scroll-bar-mode' right)
(setq default-directory "/home/zhouyi198631/Study")
(setq inhibit-startup-message t)
(setq global-font-lock-mode t)
(setq make-backup-files nil)
(setq auto-save-mode nil)
(setq x-select-enable-clipboard t)
(setq mouse-yank-at-point t)
;;(define-key global-map [home] 'beginning-of-buffer)
;;(define-key global-map [end] 'end-of-buffer)
(define-key global-map [f3] 'display-line-number-mode-on)
(define-key global-map [C-f4] 'other-window)
(define-key global-map [f5] 'compile)
(setq-default compile-command "make")
;;(define-key global-map [f7] 'du-onekey-compile)
(define-key global-map [f6] 'gdb)
(define-key global-map [C-f7] 'previous-error)
(define-key global-map [f7] 'next-error)
;;(set-default-font "9x15")
;;(set-default-font "-adobe-courier-medium-r-normal--14-100-100-100-m-90-iso10646-1")
(set-default-font "10x20")
;;(set-default-font "-outline-ÐÂËÎÌå-normal-r-normal-normal-14-*-96-96-c-*-gb2312")

;; Load CEDET
(load-file "~/.emacs.d/cedet-1.0pre6/common/cedet.el")
;; Enabling various SEMANTIC minor modes.  See semantic/INSTALL for more ideas.
;; Select one of the following:
;; * This enables the database and idle reparse engines
;;(semantic-load-enable-minimum-features)
;; * This enables some tools useful for coding, such as summary mode
;;   imenu support, and the semantic navigator
;;(semantic-load-enable-code-helpers)
;; * This enables even more coding tools such as the nascent intellisense mode
;;   decoration mode, and stickyfunc mode (plus regular code helpers)
;;(semantic-load-enable-guady-code-helpers)
;; * This turns on which-func support (Plus all other code helpers)
(semantic-load-enable-excessive-code-helpers)
;; This turns on modes that aid in grammar writing and semantic tool
;; development.  It does not enable any other features such as code
;; helpers above.
(semantic-load-enable-semantic-debugging-helpers)

;; 配置 Semantic
(setq semanticdb-project-roots (list (expand-file-name "/")))
(defun my-indent-or-complete ()
    (interactive)
    (if (looking-at "//>") (hippie-expand nil) (indent-for-tab-command))
)
(define-key global-map [(control tab)] 'my-indent-or-complete)
(autoload 'senator-try-expand-semantic "senator")
(setq hippie-expand-try-functions-list '(
    senator-try-expand-semantic
    try-expand-dabbrev
    try-expand-dabbrev-visible
    try-expand-dabbrev-all-buffers
    try-expand-dabbrev-from-kill
    try-expand-list
    try-expand-list-all-buffers
    try-expand-line
    try-expand-line-all-buffers
    try-complete-file-name-partially
    try-complete-file-name
    try-expand-whole-kill
))

(define-key global-map [(f4)] 'speedbar-get-focus)
(require 'cc-mode)
(c-set-offset 'inline-open 0)
;;(c-set-offset 'friend '-)
(c-set-offset 'substatement-open 0)
(defun my-c-mode-common-hook()
  (setq tab-width 8 indent-tabs-mode nil)
  (c-set-style "k&r")
  ;;; hungry-delete and auto-newline
  (c-toggle-auto-hungry-state 1) 
  (define-key c-mode-base-map [(control /')] 'hs-toggle-hiding)
;;  (define-key c-mode-base-map [(return)] 'newline-and-indent)
;;  (define-key c-mode-base-map [(f6)] 'compile)
  (define-key c-mode-base-map [(meta /')] 'c-indent-command)
;;  (define-key c-mode-base-map [(tab)] 'hippie-expand)
  (define-key c-mode-base-map [(tab)] 'my-indent-or-complete)
  (define-key c-mode-base-map [(meta /)] 'semantic-ia-complete-symbol-menu)
 
  (setq c-macro-shrink-window-flag t)
  (setq c-macro-preprocessor "cpp")
  (setq c-macro-cppflags " ")
  (setq c-macro-prompt-flag t)
  (setq hs-minor-mode t)
  (setq abbrev-mode t)
)
(add-hook 'c-mode-common-hook 'my-c-mode-common-hook)
(defun my-c++-mode-hook()
  (setq tab-width 8 indent-tabs-mode nil)
;;  (c-set-style "stroustrup")
  (c-set-style "k&r")
;;  (define-key c++-mode-map [f3] 'replace-regexp)
)

(add-to-list 'load-path "~/.emacs.d")

(require 'display-line-number)
;;(load-library "linum.el")
(global-display-line-number-mode 1)
;;(setq display-line-number-mode-on t)
(add-hook 'c-mode-hook 'display-line-number-mode)
(add-hook 'cc-mode-hook 'display-line-number-mode)

(add-to-list 'load-path "~/.emacs.d/ecb-2.40")
;;(require 'ecb)
(require 'ecb-autoloads)

;;for gdb-many-window mode
(require 'gud)
(setq gdb-many-windows t)
;;(setq gud-tooltip-mode t)
;;(load-library "multi-gud.el")
;;(load-library "multi-gdb-ui.el")
(add-hook 'gdb-mode-hook '(lambda ()
  (gud-tooltip-mode 1)
  (define-key c-mode-base-map [f5] 'gud-go)
  (define-key c-mode-base-map [C-f5] 'gud-run)
  (define-key c-mode-base-map [S-f5] 'gud-cont)
  (define-key c-mode-base-map [f7] 'compile)
  (define-key c-mode-base-map [f8] 'gud-print)
  (define-key c-mode-base-map [C-f8] 'gud-pstar)
  (define-key c-mode-base-map [f9] 'gud-break)
  (define-key c-mode-base-map [C-f9] 'gud-remove)
  (define-key c-mode-base-map [f10] 'gud-next)
  (define-key c-mode-base-map [C-f10] 'gud-until)
  (define-key c-mode-base-map [S-f10] 'gud-jump)
  (define-key c-mode-base-map [f11] 'gud-step)
  (define-key c-mode-base-map [S-f11] 'gud-finish)))

;; 窗体切换
(require 'wcy-swbuff)
;; then you can use <C-tab> and <C-S-kp-tab> to switch buffer.
(define-key global-map (kbd "<C-tab>") 'wcy-switch-buffer-forward)
(define-key global-map (kbd "<C-S-kp-tab>") 'wcy-switch-buffer-backward)
(setq wcy-switch-buffer-active-buffer-face  'highlight)
(setq wcy-switch-buffer-inactive-buffer-face  'secondary-selection )

;; cscope in emacs
(add-to-list 'load-path "~/.emacs.d/cscope-15.7a/contrib/xcscope")
(require 'xcscope)

;; hotkey for cscope
(define-key global-map [(control f3)]  'cscope-set-initial-directory)
(define-key global-map [(control f4)]  'cscope-unset-initial-directory)
(define-key global-map [(control f5)]  'cscope-find-this-symbol)
(define-key global-map [(control f6)]  'cscope-find-global-definition)
(define-key global-map [(control f7)]
'cscope-find-global-definition-no-prompting)
(define-key global-map [(control f8)]  'cscope-pop-mark)
(define-key global-map [(control f9)]  'cscope-next-symbol)
(define-key global-map [(control f10)] 'cscope-next-file)
(define-key global-map [(control f11)] 'cscope-prev-symbol)
(define-key global-map [(control f12)] 'cscope-prev-file)
(define-key global-map [(meta f9)]  'cscope-display-buffer)
(define-key global-map [(meta f10)] 'cscope-display-buffer-toggle)
(set-face-background 'default "#334455")
(set-face-foreground 'default "wheat")
(set-cursor-color "white")
;;(add-to-list 'load-path "~/.emacs.d/color-theme-6.6.0")
;;(require 'color-theme)
;;(color-theme-dark-blue)

(custom-set-variables
  ;; custom-set-variables was added by Custom.
  ;; If you edit it by hand, you could mess it up, so be careful.
  ;; Your init file should contain only one such instance.
  ;; If there is more than one, they won't work right.
 '(ecb-source-path (quote ("/home/zhouyi198631/linux"))))
(custom-set-faces
  ;; custom-set-faces was added by Custom.
  ;; If you edit it by hand, you could mess it up, so be careful.
  ;; Your init file should contain only one such instance.
  ;; If there is more than one, they won't work right.
 )

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值