]> code.delx.au - gnu-emacs/blobdiff - lisp/foldout.el
*** empty log message ***
[gnu-emacs] / lisp / foldout.el
index ad9bfe2c2ecfec633ac4b14369ef8492e6dc4d07..10f3cecd3ee8da65d5f92fc9d207f840d109fa6d 100644 (file)
@@ -1,11 +1,11 @@
-;;; foldout.el --- Folding extensions for outline-mode and outline-minor-mode.
+;;; foldout.el --- folding extensions for outline-mode and outline-minor-mode
 
 ;; Copyright (C) 1994 Free Software Foundation, Inc.
 
 ;; Author: Kevin Broadey <KevinB@bartley.demon.co.uk>
 ;; Created: 27 Jan 1994
 ;; Version: foldout.el 1.10 dated 94/05/19 at 17:09:12
-;; Keywords: folding, outline
+;; Keywords: folding, outlines
 
 ;; This file is part of GNU Emacs.
 
 (if (not (boundp 'outline-minor-mode))
     (error "Can't find outline-minor-mode"))
 
-(defconst foldout-fold-list nil
+(defvar foldout-fold-list nil
   "List of start and end markers for the folds currently entered.
-An end marker of NIL means the fold ends after (point-max).")
+An end marker of nil means the fold ends after (point-max).")
 (make-variable-buffer-local 'foldout-fold-list)
 
-(defconst foldout-modeline-string nil
+(defvar foldout-modeline-string nil
   "Modeline string announcing that we are in an outline fold.")
 (make-variable-buffer-local 'foldout-modeline-string)
 
@@ -269,7 +269,7 @@ optional arg EXPOSURE \(interactively with prefix arg\) changes this:-
           ;; I need a marker that will follow the end of the region even when
           ;; text is inserted right at the end.  Text gets inserted *after*
           ;; markers, so I need it at end+1.  Unfortunately I can't set a
-          ;; marker at (point-max)+1, so I use NIL to mean the region ends at
+          ;; marker at (point-max)+1, so I use nil to mean the region ends at
           ;; (point-max).
           (end-marker (if (eobp) nil (set-marker (make-marker) (1+ end))))
           )
@@ -318,7 +318,7 @@ exited and text is left visible."
      ;; catch a request to leave all folds
      ((zerop num-folds)
       (setq num-folds (length foldout-fold-list)))
+
      ;; have we been told not to hide the fold?
      ((< num-folds 0)
       (setq hide-fold nil
@@ -517,7 +517,7 @@ if the event didn't occur on a heading."
 ;;; Keymaps:
 
 (defvar foldout-inhibit-key-bindings nil
-  "Set non-NIL before loading foldout to inhibit key bindings.")
+  "Set non-nil before loading foldout to inhibit key bindings.")
 
 (defvar foldout-mouse-modifiers '(meta control)
   "List of modifier keys to apply to foldout's mouse events.
@@ -531,11 +531,12 @@ Valid modifiers are shift, control, meta, alt, hyper and super.")
     ()
   (define-key outline-mode-map "\C-c\C-z" 'foldout-zoom-subtree)
   (define-key outline-mode-map "\C-c\C-x" 'foldout-exit-fold)
-  (define-key outline-minor-mode-map
-    (concat outline-minor-mode-prefix "\C-z") 'foldout-zoom-subtree)
-  (define-key outline-minor-mode-map
-    (concat outline-minor-mode-prefix "\C-x") 'foldout-exit-fold)
-
+  (let ((map (lookup-key outline-minor-mode-map outline-minor-mode-prefix)))
+    (unless map
+      (setq map (make-sparse-keymap))
+      (define-key outline-minor-mode-map outline-minor-mode-prefix map))
+    (define-key map "\C-z" 'foldout-zoom-subtree)
+    (define-key map "\C-x" 'foldout-exit-fold))
   (let* ((modifiers (apply 'concat
                           (mapcar (function
                                    (lambda (modifier)
@@ -566,5 +567,5 @@ Valid modifiers are shift, control, meta, alt, hyper and super.")
 
 (provide 'foldout)
 
+;;; arch-tag: 19d095a2-1f09-42a7-a5ac-e2a3078cfe95
 ;;; foldout.el ends here
-