emacs24

Getting gdb to work with emacs 24

白昼怎懂夜的黑 提交于 2019-12-19 08:55:13
问题 Realised after much head-scratching in relation to this question that gdb seems to be broken in emacs 24 So I have switched to gud-gdb But I now notice that the very handy red dots on break points don't seem to work in gud-gdb Does anyone have a definitive answer on how to be able to sensibly debug C code using emacs 24 ? I never had any problems in emacs 23 but 24 has caused me all sorts of bother.. Maybe I should switch back to emacs 23 but this seems a little regressive? Is the new method

emacs lexical scoping and quoted variable name

末鹿安然 提交于 2019-12-13 01:05:35
问题 I was experimenting with interplay between Emacs lexical scoping (new feature of Emacs 24) and add-to-list and found the interplay confusing and I don't know how to make sense of it. Here is a minimal example, except I use set instead of add-to-list . ( set is similar to add-to-list in that it usually takes a quoted variable name) (eval '(progn (setq a "global") (let ((a "apple")) (defun my-print-a () (print a) (set 'a "by set") (print a)) (setq a "mature apple")) (let ((a "banana")) (my

Interactive Spell Checking Programs Available for emacs

南楼画角 提交于 2019-12-12 11:50:44
问题 I recently switched to emacs24 and upgraded to Ubuntu 12.04. I can't seem to get hunspell working correctly again. I find hunspell to be better than aspell generally. Hunspell only wants to use the Australian dictionary and not English US dictionary or freezes up my system. With aspell I have no problem switching dictionaries or running flyspell mode. My question is how do people have setup interactive spelling in emacs24?? Still using ispell and flyspell or any other setups preferred. Are

Emacs CEDET Semantic tag folding

為{幸葍}努か 提交于 2019-12-12 11:33:26
问题 I would like that every time I open a .cpp file, semantic tag-folding would become activated. I am using the latest version of cedet (loading cedet-devel-load.el). I have (semantic-mode 1) (require 'semantic/ia) (require 'semantic/bovine/gcc) (load-file "path/to/semantic/tag/folding/semantic-tag-folding.el") (require 'semantic-tag-folding) I added a hook (add-hook 'c-mode-common-hook 'setupcpp) and in 'setupcpp I simply have (defun setupcpp () (interactive) (semantic-tag-folding-mode t))

Emacs: apply minor mode for all major modes [duplicate]

拟墨画扇 提交于 2019-12-11 20:22:01
问题 This question already has an answer here : How to enable a non-global minor mode by default, on emacs startup? (1 answer) Closed 5 years ago . I use the minor mode writeroom which I have set to be global, but this setting only makes the mode global for all text-modes. I can specify more modes in the settings. But is there something I can write to enable this minor mode for all major modes? 回答1: Add a hook to find-file : (add-hook 'find-file-hook #'writeroom-mode) Substitute #'writeroom-mode

Emacs Lisp nested function - void-variable error

社会主义新天地 提交于 2019-12-11 12:49:06
问题 I want to make a timer, like this one: (defun dumb (y) (defun P () (print y)) (run-with-timer 0 5 'P)) (dumb 5) Then Emacs gives me this error: Error running timer `P': (void-variable y) I guess the problem is that in the (defun P () (print y)) line, the variable y is not evaluated, so when I run (dumb 5) , the function P tries to print y , which is undefined, instead of a literal 5 . But I don't know how to solve it. Any idea? 回答1: First, defun is for defining functions in the global scope.

Per newsgroup timezone in Date: header

若如初见. 提交于 2019-12-11 12:06:22
问题 How to configure emacs/gnus to use per newsgroup time zone in posted messages? I would like to use CET time zone in pl.* newsgroups and UCT in general newsgroups. 回答1: I would use message-header-setup-hook or message-send-hook with this function: (defvar date-rewrite-rules '(("pl" . return-time-string-in-CET) ("." . return-time-string-in-UTC))) (defun rewrite-date-based-on-newsgroup () (save-excursion (save-restriction (widen) (goto-char 0) (narrow-to-region 0 (search-forward mail-header

Using python2.7 with Emacs 24.3 and python-mode.el

半腔热情 提交于 2019-12-11 03:20:41
问题 I'm new to Emacs and I'm trying to set up my python environment. So far I've learned that using "python-mode.el" in a python buffer C-c C-c loads the contents of the current buffer into an interactive python shell, apparently using what which python yields. In my case that is python 3.3.3. But since I need to get a python 2.7 shell, I'm trying to get Emacs to spawn such a shell on C-c C-c . Unfortunatly I can't figure out, how to do this. Setting py-shell-name to what which python2.7 yields

Strange characters in ansi-term in emacs

风流意气都作罢 提交于 2019-12-11 02:39:32
问题 I wrote a c++ program and when I compiled it using g++ in ansi-term, I got some strange characters displayed: If required, the error was that i hadn't declared the variable n. How can I correct this? 回答1: Ah! Tested this... (setq locale-coding-system 'utf-8) (set-terminal-coding-system 'utf-8-unix) (set-keyboard-coding-system 'utf-8) (set-selection-coding-system 'utf-8) (prefer-coding-system 'utf-8) and problem solved!!! 回答2: Looks like the gcc output contains UTF-8 "smart quotes" and your

Modify verilog mode indentation

浪子不回头ぞ 提交于 2019-12-10 12:54:14
问题 I am trying to have verilog mode indent everything using 2 spaces except decls and always. This is what I added to my .emacs: ;; `define are not indented (setq verilog-indent-level-directive 0) ;; always, initial etc not indented (setq verilog-indent-level-module 0) ;; logic declarations are not indented (setq verilog-indent-level-declaration 0) ;;2 space indent (setq verilog-indent-level 2) ;; no indent on list and no indent when on multiple lines (setq verilog-indent-lists nil) (setq