/[emacs]/emacs/lisp/emacs-lisp/lisp-mode.el
ViewVC logotype

Diff of /emacs/lisp/emacs-lisp/lisp-mode.el

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.129 by rms, Sun Nov 25 19:32:53 2001 UTC revision 1.130 by monnier, Sun Nov 25 21:47:40 2001 UTC
# Line 195  Line 195 
195    (setq imenu-generic-expression lisp-imenu-generic-expression)    (setq imenu-generic-expression lisp-imenu-generic-expression)
196    (make-local-variable 'multibyte-syntax-as-symbol)    (make-local-variable 'multibyte-syntax-as-symbol)
197    (setq multibyte-syntax-as-symbol t)    (setq multibyte-syntax-as-symbol t)
198      (set (make-local-variable 'syntax-begin-function) 'beginning-of-defun)
199    (setq font-lock-defaults    (setq font-lock-defaults
200          '((lisp-font-lock-keywords          '((lisp-font-lock-keywords
201             lisp-font-lock-keywords-1 lisp-font-lock-keywords-2)             lisp-font-lock-keywords-1 lisp-font-lock-keywords-2)
# Line 366  if that value is non-nil." Line 367  if that value is non-nil."
367    "Keymap for Lisp Interaction mode.    "Keymap for Lisp Interaction mode.
368  All commands in `lisp-mode-shared-map' are inherited by this map.")  All commands in `lisp-mode-shared-map' are inherited by this map.")
369    
370    (defvar lisp-interaction-mode-abbrev-table lisp-mode-abbrev-table)
371  (define-derived-mode lisp-interaction-mode emacs-lisp-mode "Lisp Interaction"  (define-derived-mode lisp-interaction-mode emacs-lisp-mode "Lisp Interaction"
372    "Major mode for typing and evaluating Lisp forms.    "Major mode for typing and evaluating Lisp forms.
373  Like Lisp mode except that \\[eval-print-last-sexp] evals the Lisp expression  Like Lisp mode except that \\[eval-print-last-sexp] evals the Lisp expression
# Line 379  Paragraphs are separated only by blank l Line 381  Paragraphs are separated only by blank l
381  Semicolons start comments.  Semicolons start comments.
382  \\{lisp-interaction-mode-map}  \\{lisp-interaction-mode-map}
383  Entry to this mode calls the value of `lisp-interaction-mode-hook'  Entry to this mode calls the value of `lisp-interaction-mode-hook'
384  if that value is non-nil."  if that value is non-nil.")
   (setq local-abbrev-table lisp-mode-abbrev-table))  
385    
386  (defun eval-print-last-sexp ()  (defun eval-print-last-sexp ()
387    "Evaluate sexp before point; print value into current buffer.    "Evaluate sexp before point; print value into current buffer.
# Line 638  which see." Line 639  which see."
639  (defun lisp-mode-auto-fill ()  (defun lisp-mode-auto-fill ()
640    (if (> (current-column) (current-fill-column))    (if (> (current-column) (current-fill-column))
641        (if (save-excursion        (if (save-excursion
642              (nth 4 (parse-partial-sexp (save-excursion              (nth 4 (syntax-ppss (point))))
                                          (beginning-of-defun)  
                                          (point))  
                                        (point))))  
643            (do-auto-fill)            (do-auto-fill)
644          (let ((comment-start nil) (comment-start-skip nil))          (unless (and (boundp 'comment-auto-fill-only-comments)
645            (do-auto-fill)))))                       comment-auto-fill-only-comments)
646              (let ((comment-start nil) (comment-start-skip nil))
647                (do-auto-fill))))))
648    
649  (defvar lisp-indent-offset nil  (defvar lisp-indent-offset nil
650    "If non-nil, indent second line of expressions that many more columns.")    "If non-nil, indent second line of expressions that many more columns.")
# Line 1079  and initial semicolons." Line 1079  and initial semicolons."
1079         ;; A line with some code, followed by a comment?  Remember that the         ;; A line with some code, followed by a comment?  Remember that the
1080         ;; semi which starts the comment shouldn't be part of a string or         ;; semi which starts the comment shouldn't be part of a string or
1081         ;; character.         ;; character.
1082         ((condition-case nil         ((let ((state (syntax-ppss (line-end-position))))
1083              (save-restriction            (when (nth 4 state)
1084                (narrow-to-region (point-min)              (goto-char (nth 8 state))
1085                                  (save-excursion (end-of-line) (point)))              (looking-at ";+[\t ]*")))
               (while (not (looking-at ";\\|$"))  
                 (skip-chars-forward "^;\n\"\\\\?")  
                 (cond  
                  ((eq (char-after (point)) ?\\) (forward-char 2))  
                  ((memq (char-after (point)) '(?\" ??)) (forward-sexp 1))))  
               (looking-at ";+[\t ]*"))  
           (error nil))  
1086          (setq has-comment t has-code-and-comment t)          (setq has-comment t has-code-and-comment t)
1087          (setq comment-fill-prefix          (setq comment-fill-prefix
1088                (concat (make-string (/ (current-column) tab-width) ?\t)                (concat (make-string (/ (current-column) tab-width) ?\t)

Legend:
Removed from v.1.129  
changed lines
  Added in v.1.130

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26