comparison lisp/progmodes/cpp.el @ 8736:fe48762e68de

*** empty log message ***
author Richard M. Stallman <rms@gnu.org>
date Wed, 14 Sep 1994 09:05:48 +0000
parents d1f0811de024
children 714588372e06
comparison
equal deleted inserted replaced
8735:d1f0811de024 8736:fe48762e68de
1 ;;; cpp.el --- Highlight or hide text according to cpp conditionals. 1 ;;; cpp.el --- Highlight or hide text according to cpp conditionals.
2 2
3 ;; Copyright (C) 1994 Free Software Foundation 3 ;; Copyright (C) 1994 Free Software Foundation
4 4
5 ;; Author: Per Abrahamsen <abraham@iesd.auc.dk> 5 ;; Author: Per Abrahamsen <abraham@iesd.auc.dk>
6 ;; Version: $Id: 0.2 ALPHA RELEASE WITH BUGS $
7 ;; Keywords: c, faces, tools 6 ;; Keywords: c, faces, tools
8 7
9 ;; LCD Archive Entry: 8 ;; This file is part of GNU Emacs.
10 ;; cpp|Per Abrahamsen|abraham@iesd.auc.dk| 9
11 ;; Highlight or hide text according to cpp conditionals| 10 ;; GNU Emacs is free software; you can redistribute it and/or modify
12 ;; $Date: 1994-07-20 $|$Revision: 0.2 $|~/misc/cpp.Z|
13
14 ;; This program is free software; you can redistribute it and/or modify
15 ;; it under the terms of the GNU General Public License as published by 11 ;; it under the terms of the GNU General Public License as published by
16 ;; the Free Software Foundation; either version 2, or (at your option) 12 ;; the Free Software Foundation; either version 2, or (at your option)
17 ;; any later version. 13 ;; any later version.
18 ;; 14
19 ;; This program is distributed in the hope that it will be useful, 15 ;; GNU Emacs is distributed in the hope that it will be useful,
20 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of 16 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
21 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 ;; GNU General Public License for more details. 18 ;; GNU General Public License for more details.
23 ;; 19
24 ;; You should have received a copy of the GNU General Public License 20 ;; You should have received a copy of the GNU General Public License
25 ;; along with this program; if not, write to the Free Software 21 ;; along with GNU Emacs; see the file COPYING. If not, write to
26 ;; Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 22 ;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
27 23
28 ;;; Comments: 24 ;;; Commentary:
29 25
30 ;; Parse a text for C preprocessor conditionals, and highlight or hide 26 ;; Parse a text for C preprocessor conditionals, and highlight or hide
31 ;; the text inside the conditionals as you wish. 27 ;; the text inside the conditionals as you wish.
32 28
33 ;; Insert the following in your `emacs' to activate it. This assumes 29 ;; You might want to bind keys as follows.
34 ;; you use BAW's superior cc-mode instead of Boring Old C-Mode. 30 ;;
35
36 ;; (autoload 'cpp-parse-buffer "cpp" "Parse and display cpp conditionals." t)
37
38 ;; (eval-after-load "cc-mode"
39 ;; '(progn 31 ;; '(progn
40 ;; (define-key c-mode-map "\C-c\C-x" 'cpp-parse-buffer) 32 ;; (define-key c-mode-map "\C-c\C-x" 'cpp-parse-buffer)
41 ;; (define-key-after (bar (lookup-key c-mode-map [ menu-bar c ])) 33 ;; (define-key-after (bar (lookup-key c-mode-map [ menu-bar c ]))
42 ;; [ cpp-parse ] '("Parse Conditionals" . cpp-parse-buffer) 'up)))) 34 ;; [ cpp-parse ] '("Parse Conditionals" . cpp-parse-buffer) 'up)))
43
44 ;; Requires GNU Emacs 19.
45 35
46 ;;; Todo: 36 ;;; Todo:
47 37
48 ;; Should parse "#if" and "#elif" expressions and merge the faces 38 ;; Should parse "#if" and "#elif" expressions and merge the faces
49 ;; somehow. 39 ;; somehow.
768 (apply 'message args)))) 758 (apply 'message args))))
769 759
770 (provide 'cpp) 760 (provide 'cpp)
771 761
772 ;;; cpp.el ends here 762 ;;; cpp.el ends here
773