update.
[chise/xemacs-chise.git.1] / lisp / lisp-mode.el
index d0278b1..ac05da6 100644 (file)
 (if (not lisp-mode-syntax-table)
     (progn (setq lisp-mode-syntax-table
                 (copy-syntax-table emacs-lisp-mode-syntax-table))
-          (modify-syntax-entry ?\| "\"   " lisp-mode-syntax-table)
           (modify-syntax-entry ?\[ "_   " lisp-mode-syntax-table)
           ;; XEmacs changes
           (modify-syntax-entry ?\] "_   " lisp-mode-syntax-table)
-           ;;
-           ;; If emacs was compiled with NEW_SYNTAX, then do
-           ;;  CL's #| |# block comments.
-           (if (= 8 (length (parse-partial-sexp (point) (point))))
-               (progn
-                 (modify-syntax-entry ?#  "' 58" lisp-mode-syntax-table)
-                 (modify-syntax-entry ?|  ". 67" lisp-mode-syntax-table))
-            ;; else, old style
-            (modify-syntax-entry ?\| "\"   " lisp-mode-syntax-table))))
+          (modify-syntax-entry ?#  "' 58" lisp-mode-syntax-table)
+          (modify-syntax-entry ?|  "\" 67" lisp-mode-syntax-table)))
 
 (define-abbrev-table 'lisp-mode-abbrev-table ())
 
@@ -268,6 +260,16 @@ All commands in `shared-lisp-mode-map' are inherited by this map.")
   ;; doesn't need them.
 )
 
+;; XEmacs: add docstrings to the hooks
+(defvar emacs-lisp-mode-hook nil
+  "Hook to run when entering emacs-lisp-mode.")
+
+(defvar lisp-mode-hook nil
+  "Hook to run when entering lisp-mode.")
+
+(defvar lisp-interaction-mode-hook nil
+  "Hook to run when entering lisp-interaction-mode.")
+
 (defun emacs-lisp-byte-compile ()
   "Byte compile the file containing the current buffer."
   (interactive)
@@ -545,7 +547,7 @@ rigidly along with this one."
       (if (and (looking-at "\\s<") (not (looking-at "\\s<\\s<")))
          ;; Single-semicolon comment lines should be indented
          ;; as comment lines, not as code.
-         (progn (indent-for-comment) (forward-char -1))
+         (progn (indent-for-comment) (backward-char 1))
        (if (listp indent) (setq indent (car indent)))
        (setq shift-amt (- indent (current-column)))
        (if (zerop shift-amt)
@@ -682,7 +684,7 @@ of the start of the containing expression."
     (parse-partial-sexp (point) calculate-lisp-indent-last-sexp 0 t)
     (if (and (elt state 2)
              (not (looking-at "\\sw\\|\\s_")))
-        ;; car of form doesn't seem to be a a symbol
+        ;; car of form doesn't seem to be a symbol
         (progn
           (if (not (> (save-excursion (forward-line 1) (point))
                       calculate-lisp-indent-last-sexp))
@@ -802,6 +804,8 @@ of the start of the containing expression."
 (put 'if 'lisp-indent-function 2)
 (put 'catch 'lisp-indent-function 1)
 (put 'condition-case 'lisp-indent-function 2)
+(put 'handler-case 'lisp-indent-function 1)
+(put 'handler-bind 'lisp-indent-function 1)
 (put 'call-with-condition-handler 'lisp-indent-function 2)
 (put 'unwind-protect 'lisp-indent-function 1)
 (put 'save-current-buffer 'lisp-indent-function 0)
@@ -811,12 +815,16 @@ of the start of the containing expression."
 (put 'with-temp-buffer 'lisp-indent-function 0)
 (put 'with-output-to-string 'lisp-indent-function 0)
 (put 'with-output-to-temp-buffer 'lisp-indent-function 1)
+(put 'with-slots 'lisp-indent-function 2)
+(put 'with-open-file 'lisp-indent-function 1)
+(put 'with-open-stream 'lisp-indent-function 1)
 (put 'eval-after-load 'lisp-indent-function 1)
 (put 'display-message 'lisp-indent-function 1)
 (put 'display-warning 'lisp-indent-function 1)
 (put 'lmessage 'lisp-indent-function 2)
 (put 'lwarn 'lisp-indent-function 2)
 (put 'global-set-key 'lisp-indent-function 1)
+(put 'print-unreadable-object 'lisp-indent-function 1)
 
 (defun indent-sexp (&optional endpos)
   "Indent each line of the list starting just after point.