;;; hideif.el --- hides selected code within ifdef
-;; Copyright (C) 1988, 1994, 2001, 2002, 2005 Free Software Foundation, Inc.
+;; Copyright (C) 1988, 1994, 2001, 2002, 2003, 2004, 2005, 2006, 2007
+;; Free Software Foundation, Inc.
;; Author: Daniel LaLiberte <liberte@holonexus.org>
;; Maintainer: FSF
;; GNU Emacs is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation; either version 2, or (at your option)
+;; the Free Software Foundation; either version 3, or (at your option)
;; any later version.
;; GNU Emacs is distributed in the hope that it will be useful,
;; You should have received a copy of the GNU General Public License
;; along with GNU Emacs; see the file COPYING. If not, write to the
-;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-;; Boston, MA 02111-1307, USA.
+;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+;; Boston, MA 02110-1301, USA.
;;; Commentary:
(setq hide-ifdef-hiding t))
(setq buffer-read-only (or hide-ifdef-read-only hif-outside-read-only)))
-
(defun show-ifdef-block ()
"Show the ifdef block (true or false part) enclosing or before the cursor."
(interactive)
- (if hide-ifdef-lines
- (save-excursion
- (beginning-of-line)
- (hif-show-ifdef-region (1- (point)) (progn (end-of-line) (point))))
- (let ((top-bottom (hif-find-ifdef-block)))
+ (let ((top-bottom (hif-find-ifdef-block)))
+ (if hide-ifdef-lines
+ (hif-show-ifdef-region
+ (save-excursion
+ (goto-char (car top-bottom)) (line-beginning-position))
+ (save-excursion
+ (goto-char (1+ (cdr top-bottom)))
+ (hif-end-of-line) (point)))
(hif-show-ifdef-region (1- (car top-bottom)) (cdr top-bottom)))))
"Set `hide-ifdef-env' to the define list specified by NAME."
(interactive
(list (completing-read "Use define list: "
- hide-ifdef-define-alist nil t)))
+ (mapcar (lambda (x) (symbol-name (car x)))
+ hide-ifdef-define-alist)
+ nil t)))
(if (stringp name) (setq name (intern name)))
(let ((define-list (assoc name hide-ifdef-define-alist)))
(if define-list
(provide 'hideif)
-;;; arch-tag: c6381d17-a59a-483a-b945-658f22277981
+;; arch-tag: c6381d17-a59a-483a-b945-658f22277981
;;; hideif.el ends here