This was the function I had found online somewhere and never had problems in linux but when run on a macbook in emacs 24 I get the error below. Any help would be appreciated.
;; (define-minor-mode sensitive-mode
;; "For sensitive files like password lists.
;; It disables backup creation and auto saving.
;; With no argument, this command toggles the mode.
;; Non-null prefix argument turns on the mode.
;; Null prefix argument turns off the mode."
;; ;; The initial value.
;; -1
;; ;; The indicator for the mode line.
;; " Sensitive"
;; ;; The minor mode bindings.
;; -1
;; (if (symbol-value sensitive-mode)
;; (progn
;; ;; disable backups
;; (set (make-local-variable 'backup-inhibited) 1)
;; ;; disable auto-save
;; (if auto-save-default
;; (auto-save-mode -1)))
;; ;resort to default value of backup-inhibited
;; (kill-local-variable 'backup-inhibited)
;; ;resort to default auto save setting
;; (if auto-save-default
;; (auto-save-mode 1))))
;; (setq auto-mode-alist
;; (append '(("\\.gpg$" . sensitive-mode))
;; auto-mode-alist))
The error is:
Debugger entered--Lisp error: (error "Invalid keymap -1")
2 signal(error ("Invalid keymap -1"))
3 error("Invalid keymap %S" -1)
4 (cond ((keymapp m) m) ((listp m) (easy-mmode-define-keymap m)) (t (error "Invalid keymap %S" m)))
5 (let ((m -1)) (cond ((keymapp m) m) ((listp m) (easy-mmode-define-keymap m)) (t (error "Invalid keymap %S" m))))
6 (defvar sensitive-mode-map (let ((m -1)) (cond ((keymapp m) m) ((listp m) (easy-mmode-define-keymap m)) (t (error "$
7 (progn (progn :autoload-end (defvar sensitive-mode -1 "Non-nil if Sensitive mode is enabled.\nUse the command `sens$
8 eval-buffer(#<buffer *load*-983931> nil "/Users/bigtyme/Dropbox/SyncedPrograms/emacs/initFiles/setup.el" nil t) ;$
9 load-with-code-conversion("/Users/bigtyme/Dropbox/SyncedPrograms/emacs/initFiles/setup.el" "/Users/bigtyme/Dropbox/$
10 load("/Users/bigtyme/Dropbox/SyncedPrograms/emacs/initFiles/setup.el" nil nil t)
11 load-file("~/Dropbox/SyncedPrograms/emacs/initFiles/setup.el")
12 eval-buffer(#<buffer *load*> nil "/Users/bigtyme/.emacs" nil t) ; Reading at buffer position 2000
13 load-with-code-conversion("/Users/bigtyme/.emacs" "/Users/bigtyme/.emacs" t t)
14 load("~/.emacs" t t)
15 #[0 "^H\205\262^@ \306=\203^Q^@\307^H\310Q\202;^@ \311=\204^^^@\307^H\312Q\202;^@\313\307\314\315#\203*^@\316\2$
16 command-line()
17 normal-top-level()
Show the code that defines the minor mode (uncommented). Show any code that binds keys in the minor mode's keymap. The error you show does not relate directly to the code you show.
In particular, show the
defvarthat defines the keymapsensitive-mode-map. It is thatdefvarsexp that seems to be the problem.This is the code used by the
defvar, apparently:And clearly that binding of
mto-1means that the 3rdcondclause is evaluated. This could never have worked on any Emacs platform, IMO --- UNLESS your init file or some other code actually set the value of that keymap prior to thatdefvarbeing evaluated. In that case, thedefvarwould do nothing.