[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] Changes to emacs/lisp/progmodes/hideif.el
From: |
Miles Bader |
Subject: |
[Emacs-diffs] Changes to emacs/lisp/progmodes/hideif.el |
Date: |
Fri, 04 Apr 2003 01:22:52 -0500 |
Index: emacs/lisp/progmodes/hideif.el
diff -c emacs/lisp/progmodes/hideif.el:1.46 emacs/lisp/progmodes/hideif.el:1.47
*** emacs/lisp/progmodes/hideif.el:1.46 Wed Mar 6 10:11:20 2002
--- emacs/lisp/progmodes/hideif.el Tue Feb 4 08:24:34 2003
***************
*** 36,42 ****
;; M-x hide-ifdefs or C-c @ h
;;
;; Hide-ifdef suppresses the display of code that the preprocessor wouldn't
! ;; pass through. The support of constant expressions in #if lines is
;; limited to identifiers, parens, and the operators: &&, ||, !, and
;; "defined". Please extend this.
;;
--- 36,42 ----
;; M-x hide-ifdefs or C-c @ h
;;
;; Hide-ifdef suppresses the display of code that the preprocessor wouldn't
! ;; pass through. The support of constant expressions in #if lines is
;; limited to identifiers, parens, and the operators: &&, ||, !, and
;; "defined". Please extend this.
;;
***************
*** 45,51 ****
;; still in the buffer, and you can move the point into it and modify
;; text unawares.
;; You can make your buffer read-only while hide-ifdef-hiding by setting
! ;; hide-ifdef-read-only to a non-nil value. You can toggle this
;; variable with hide-ifdef-toggle-read-only (C-c @ C-q).
;;
;; You can undo the effect of hide-ifdefs by typing
--- 45,51 ----
;; still in the buffer, and you can move the point into it and modify
;; text unawares.
;; You can make your buffer read-only while hide-ifdef-hiding by setting
! ;; hide-ifdef-read-only to a non-nil value. You can toggle this
;; variable with hide-ifdef-toggle-read-only (C-c @ C-q).
;;
;; You can undo the effect of hide-ifdefs by typing
***************
*** 58,64 ****
;; If you define or undefine a symbol while hide-ifdef-mode is in effect,
;; the display will be updated. Only the define list for the current
;; buffer will be affected. You can save changes to the local define
! ;; list with hide-ifdef-set-define-alist. This adds entries
;; to hide-ifdef-define-alist.
;;
;; If you have defined a hide-ifdef-mode-hook, you can set
--- 58,64 ----
;; If you define or undefine a symbol while hide-ifdef-mode is in effect,
;; the display will be updated. Only the define list for the current
;; buffer will be affected. You can save changes to the local define
! ;; list with hide-ifdef-set-define-alist. This adds entries
;; to hide-ifdef-define-alist.
;;
;; If you have defined a hide-ifdef-mode-hook, you can set
***************
*** 179,185 ****
is used.
`hide-ifdef-define-alist'
! An association list of defined symbol lists.
Use `hide-ifdef-set-define-alist' to save the current `hide-ifdef-env'
and `hide-ifdef-use-define-alist' to set the current `hide-ifdef-env'
from one of the lists in `hide-ifdef-define-alist'.
--- 179,185 ----
is used.
`hide-ifdef-define-alist'
! An association list of defined symbol lists.
Use `hide-ifdef-set-define-alist' to save the current `hide-ifdef-env'
and `hide-ifdef-use-define-alist' to set the current `hide-ifdef-env'
from one of the lists in `hide-ifdef-define-alist'.
***************
*** 220,226 ****
(remove-from-invisibility-spec '(hide-ifdef . t))
(if hide-ifdef-hiding
(show-ifdefs))))
!
(defun hif-show-all ()
"Show all of the text in the current buffer."
--- 220,226 ----
(remove-from-invisibility-spec '(hide-ifdef . t))
(if hide-ifdef-hiding
(show-ifdefs))))
!
(defun hif-show-all ()
"Show all of the text in the current buffer."
***************
*** 420,426 ****
(hif-nexttoken)
(setq result (list math-op result (hif-factor))))
result))
!
(defun hif-factor ()
"Parse a factor: '!' factor | '(' expr ')' | 'defined(' id ')' | id."
(cond
--- 420,426 ----
(hif-nexttoken)
(setq result (list math-op result (hif-factor))))
result))
!
(defun hif-factor ()
"Parse a factor: '!' factor | '(' expr ')' | 'defined(' id ')' | id."
(cond
***************
*** 720,726 ****
(setq end (point))) ; (save-excursion (end-of-line) (point))
(hif-make-range start end else))))
!
;;; A bit slimy.
(defun hif-hide-line (point)
--- 720,726 ----
(setq end (point))) ; (save-excursion (end-of-line) (point))
(hif-make-range start end else))))
!
;;; A bit slimy.
(defun hif-hide-line (point)
***************
*** 730,742 ****
(goto-char point)
(hide-ifdef-region-internal (line-beginning-position)
(progn (hif-end-of-line) (point))))))
!
;;; Hif-Possibly-Hide
;;; There are four cases. The #ifX expression is "taken" if it
;;; the hide-ifdef-evaluator returns T. Presumably, this means the code
;;; inside the #ifdef would be included when the program was
! ;;; compiled.
;;;
;;; Case 1: #ifX taken, and there's an #else.
;;; The #else part must be hidden. The #if (then) part must be
--- 730,742 ----
(goto-char point)
(hide-ifdef-region-internal (line-beginning-position)
(progn (hif-end-of-line) (point))))))
!
;;; Hif-Possibly-Hide
;;; There are four cases. The #ifX expression is "taken" if it
;;; the hide-ifdef-evaluator returns T. Presumably, this means the code
;;; inside the #ifdef would be included when the program was
! ;;; compiled.
;;;
;;; Case 1: #ifX taken, and there's an #else.
;;; The #else part must be hidden. The #if (then) part must be
***************
*** 771,777 ****
(let ((test (hif-canonicalize))
(range (hif-find-range)))
;; (message "test = %s" test) (sit-for 1)
!
(hif-hide-line (hif-range-end range))
(if (not (hif-not (funcall hide-ifdef-evaluator test)))
(cond ((hif-range-else range) ; case 1
--- 771,777 ----
(let ((test (hif-canonicalize))
(range (hif-find-range)))
;; (message "test = %s" test) (sit-for 1)
!
(hif-hide-line (hif-range-end range))
(if (not (hif-not (funcall hide-ifdef-evaluator test)))
(cond ((hif-range-else range) ; case 1
***************
*** 851,857 ****
hif-outside-read-only))
(force-mode-line-update))
!
(defun hide-ifdef-define (var)
"Define a VAR so that #ifdef VAR would be included."
(interactive "SDefine what? ")
--- 851,857 ----
hif-outside-read-only))
(force-mode-line-update))
!
(defun hide-ifdef-define (var)
"Define a VAR so that #ifdef VAR would be included."
(interactive "SDefine what? ")
***************
*** 866,873 ****
(defun hide-ifdefs (&optional nomsg)
! "Hide the contents of some #ifdefs.
! Assume that defined symbols have been added to `hide-ifdef-env'.
The text hidden is the text that would not be included by the C
preprocessor if it were given the file with those symbols defined.
--- 866,873 ----
(defun hide-ifdefs (&optional nomsg)
! "Hide the contents of some #ifdefs.
! Assume that defined symbols have been added to `hide-ifdef-env'.
The text hidden is the text that would not be included by the C
preprocessor if it were given the file with those symbols defined.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] Changes to emacs/lisp/progmodes/hideif.el,
Miles Bader <=