summaryrefslogtreecommitdiffstats
path: root/emacs.d/nxhtml/util/appmenu-fold.el
blob: 938ab92493f0d6bdbe1ad713b42622d8700fda99 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
;;; appmenu-fold.el --- Support form fold-dwim in AppMenu
;;
;; Author: Lennart Borgman (lennart O borgman A gmail O com)
;; Created: Wed Jan 11 21:48:02 2006
(defconst appmenu-fold:version "0.51") ;; Version:
;; Last-Updated: Mon Jan 15 03:10:59 2007 (3600 +0100)
;; Keywords:
;; Compatibility:
;;
;; Features that might be required by this library:
;;
;;   None
;;

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;;; Commentary:
;;
;;
;;

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;;; Change log:
;;
;;

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;; This program 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)
;; any later version.
;;
;; This program is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
;; GNU General Public License for more details.
;;
;; You should have received a copy of the GNU General Public License
;; along with this program; see the file COPYING.  If not, write to the
;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
;; Boston, MA 02111-1307, USA.

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;;; Code:

(require 'fold-dwim nil t)
(eval-when-compile (require 'appmenu))

(when (featurep 'fold-dwim)

  (defun appmenu-fold-no-hs-minor-mode ()
    t)
  (defun appmenu-fold-no-outline-minor-mode ()
    t)
  (defun appmenu-fold-setup ()
    "Adds some tweaks for using fold-dwim in AppMenu."
    (let ((fd-map (make-sparse-keymap)))
      (define-key fd-map [fold-dwim-toggle]
        (list 'menu-item "Fold Dwin Toggle" 'fold-dwim-toggle))
      (define-key fd-map [fold-dwim-hide-all]
        (list 'menu-item "Fold Dwin Hide All" 'fold-dwim-hide-all))
      (define-key fd-map [fold-dwim-show-all]
        (list 'menu-item "Fold Dwin Show All" 'fold-dwim-show-all))
      ;;(add-to-list 'appmenu-alist (cons t (cons "Folding" fd-map)))
      (appmenu-add 'appmenu-fold nil t "Folding" fd-map)
      )
;;;     (add-to-list 'appmenu-minor-modes-exclude
;;;                  '(hs-minor-mode appmenu-fold-no-hs-minor-mode))
;;;     (add-to-list 'appmenu-minor-modes-exclude
;;;                  '(outline-minor-mode appmenu-fold-no-outline-minor-mode)))
    )
  )

(provide 'appmenu-fold)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; appmenu-fold.el ends here