LWN.net Logo

Emacs 24.1 released

Emacs 24.1 released

Posted Jun 13, 2012 16:06 UTC (Wed) by nix (subscriber, #2304)
In reply to: Emacs 24.1 released by theophrastus
Parent article: Emacs 24.1 released

gawdbless Stallman
It's Stefan Monnier, Eli Zaretskii, Chong Yidong (and others: Glenn Morris, Paul Eggert, Juri Linkov, Martin Rudalics...) you should be thanking most for this release: RMS has not been deeply involved in Emacs maintenance for some time, though he is definitely still a user so contributes fixes now and then. The lexical scoping and bidi text changes in particular were enormous and involved, and making them work with their current level of reliability and backward-compatibility was very impressive. This is first-class software engineering by any standard.

(On the git front, if you haven't tried magit, do. It's superb. I also note that this is the first version of Emacs where CEDET's semantic autocompletion has worked fast enough to be useful -- I use it in conjunction with auto-complete.el, and for languages the Semantic Bovinator understands it is nigh flawless and much less terrifying to set up than is rumoured.)

dissociated-press said:

it's clean, reliable, easy to use, symmetrical, and low on text editing
Change the last word. Emacs: It's clean, reliable, easy to use, symmetrical, and low on fat!


(Log in to post comments)

Emacs 24.1 released

Posted Jun 15, 2012 4:19 UTC (Fri) by daglwn (subscriber, #65432) [Link]

> much less terrifying to set up than is rumoured.

Please, do tell! I tried CEDET a few releases ago and gave up because I couldn't get autocomplete/SB to work properly. Is there a guide somewhere?

Emacs 24.1 released

Posted Jun 15, 2012 12:42 UTC (Fri) by nix (subscriber, #2304) [Link]

Yes, here.

My entire autocompletion configuration (using auto-complete.el to provide completion with intellisense-style pull-down menus that vanish at convenient times: tweaked locally, may be full of horrible typos):

(require 'cedet)
(require 'semantic)
(require 'srecode)
(require 'auto-complete-config)

;; Turn on project management.

(setq ede-locate-setup-options '(ede-locate-global ede-locate-locate ede-locate-base))
(global-ede-mode 1)
(global-srecode-minor-mode 1)

;; Kick off the semantic bovinator, function menu, C-warning mode, and flashing
;; brackets.

(setq semantic-default-submodes (append semantic-default-submodes
                                        '(global-semantic-idle-local-symbol-highlight-mode
                                          global-semantic-idle-summary-mode
                                          global-semantic-decoration-mode
                                          global-semantic-highlight-func-mode
                                          global-semantic-stickyfunc-mode
                                          global-semantic-show-unmatched-syntax-mode
                                          global-semantic-mru-bookmark-mode)))

(setq semantic-decoration-styles '(("semantic-decoration-on-includes" . t)
                                   ("semantic-decoration-on-protected-members")
                                   ("semantic-decoration-on-private-members")))

(semantic-mode 1)
(semanticdb-enable-gnu-global-databases 'c-mode)
(semanticdb-enable-gnu-global-databases 'c++-mode)

;; auto-complete should use Semantic.

(ac-config-default)
(ac-set-trigger-key "TAB")

(defun nix-setup-auto-complete-semantic ()
  "Arrange to do semantic autocompletion."
  (add-to-list 'ac-sources 'ac-source-semantic))

(add-hook 'c-mode-common-hook 'nix-setup-auto-complete-semantic t)

;; Some key bindings

(define-key semantic-mode-map (kbd "C-c , .") 'semantic-ia-fast-jump)
(define-key semantic-mode-map (kbd "C-c , P") 'semantic-analyze-proto-impl-toggle)
(define-key semantic-mode-map (kbd "C-c , h") 'semantic-decoration-include-visit)
(I use GNU GLOBAL as a better tagging system and to help CEDET identify headers and associated things in projects rapidly: if I haven't run gtags, it'll use the locate database instead, and if even that isn't enough it'll fall back to find(1). There are other possibilities too.)

That's enough global setup for C and C++ code to work, and almost all of it is unnecessary -- the system will sort of work with nothing but (semantic-mode 1). But you want some local per-project setup too, so it knows where your headers are and what #defines to apply when parsing them and stuff like that. Projects using Autoconf and Automake, and a few major projects such as the Linux kernel, are automatically detected, but for others you might need something like this for each project:

(ede-cpp-root-project "Blah Project" :file "/home/nix/src/blah/Makerules"
    :include-path '("/include" "/local/include")
    :system-include-path '("/home/nix/src/otherproject/include" "/usr/include")
    :spp-table '(("_GNU_SOURCE" . "") ("_FILE_OFFSET_BITS" . "64") ("WOMBLE" . "foo")))
Here, the :file is the name of some file whose presence indicates that this project exists, :include-path is the include path for project-local headers to search for (initial / indicates "relative to project root directory"), :system-include-path is the include path for stuff coming from other projects and systemwide (often just "/usr/include"), and :spp-table is a bunch of #defines you want set. (There are lots of other ways of adding projects, and defining your own is not very hard: see /usr/share/emacs/*/lisp/cedet/ede/proj-*.el.gz.)

Copyright © 2013, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds