[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] Changes to emacs/lisp/progmodes/asm-mode.el
From: |
Stefan Monnier |
Subject: |
[Emacs-diffs] Changes to emacs/lisp/progmodes/asm-mode.el |
Date: |
Tue, 01 Apr 2003 18:09:14 -0500 |
Index: emacs/lisp/progmodes/asm-mode.el
diff -c emacs/lisp/progmodes/asm-mode.el:1.24
emacs/lisp/progmodes/asm-mode.el:1.25
*** emacs/lisp/progmodes/asm-mode.el:1.24 Mon Mar 31 15:16:01 2003
--- emacs/lisp/progmodes/asm-mode.el Tue Apr 1 18:09:13 2003
***************
*** 58,84 ****
:type 'character
:group 'asm)
! (defvar asm-mode-syntax-table nil
"Syntax table used while in Asm mode.")
(defvar asm-mode-abbrev-table nil
"Abbrev table used while in Asm mode.")
(define-abbrev-table 'asm-mode-abbrev-table ())
! (defvar asm-mode-map nil
"Keymap for Asm mode.")
- (if asm-mode-map
- nil
- (setq asm-mode-map (make-sparse-keymap))
- ;; Note that the comment character isn't set up until asm-mode is called.
- (define-key asm-mode-map ":" 'asm-colon)
- (define-key asm-mode-map "\C-c;" 'comment-region)
- (define-key asm-mode-map "\C-i" 'tab-to-tab-stop)
- (define-key asm-mode-map "\C-j" 'asm-newline)
- (define-key asm-mode-map "\C-m" 'asm-newline)
- )
-
(defconst asm-font-lock-keywords
'(("^\\(\\(\\sw\\|\\s_\\)+\\)\\>:?[ \t]*\\(\\sw+\\(\\.\\sw+\\)*\\)?"
(1 font-lock-function-name-face) (3 font-lock-keyword-face nil t))
--- 58,86 ----
:type 'character
:group 'asm)
! (defvar asm-mode-syntax-table
! (let ((st (make-syntax-table)))
! (modify-syntax-entry ?\n ">" st)
! (modify-syntax-entry ?/ ". 14b" st)
! (modify-syntax-entry ?* ". 23b" st)
! st)
"Syntax table used while in Asm mode.")
(defvar asm-mode-abbrev-table nil
"Abbrev table used while in Asm mode.")
(define-abbrev-table 'asm-mode-abbrev-table ())
! (defvar asm-mode-map
! (let ((map (make-sparse-keymap)))
! ;; Note that the comment character isn't set up until asm-mode is called.
! (define-key map ":" 'asm-colon)
! (define-key map "\C-c;" 'comment-region)
! (define-key map "\C-i" 'tab-to-tab-stop)
! (define-key map "\C-j" 'asm-newline)
! (define-key map "\C-m" 'asm-newline)
! map)
"Keymap for Asm mode.")
(defconst asm-font-lock-keywords
'(("^\\(\\(\\sw\\|\\s_\\)+\\)\\>:?[ \t]*\\(\\sw+\\(\\.\\sw+\\)*\\)?"
(1 font-lock-function-name-face) (3 font-lock-keyword-face nil t))
***************
*** 86,94 ****
2 font-lock-keyword-face))
"Additional expressions to highlight in Assembler mode.")
! (defvar asm-code-level-empty-comment-pattern nil)
! (defvar asm-flush-left-empty-comment-pattern nil)
! (defvar asm-inline-empty-comment-pattern nil)
;;;###autoload
(defun asm-mode ()
--- 88,96 ----
2 font-lock-keyword-face))
"Additional expressions to highlight in Assembler mode.")
! (defconst asm-code-level-empty-comment-pattern "^[\t ]+\\s<\\s< *$")
! (defconst asm-flush-left-empty-comment-pattern "^\\s<\\s<\\s< *$")
! (defconst asm-inline-empty-comment-pattern "^.+\\s<+ *$")
;;;###autoload
(defun asm-mode ()
***************
*** 109,116 ****
Turning on Asm mode runs the hook `asm-mode-hook' at the end of
initialization.
Special commands:
! \\{asm-mode-map}
! "
(interactive)
(kill-all-local-variables)
(setq mode-name "Assembler")
--- 111,117 ----
Turning on Asm mode runs the hook `asm-mode-hook' at the end of
initialization.
Special commands:
! \\{asm-mode-map}"
(interactive)
(kill-all-local-variables)
(setq mode-name "Assembler")
***************
*** 118,152 ****
(setq local-abbrev-table asm-mode-abbrev-table)
(make-local-variable 'font-lock-defaults)
(setq font-lock-defaults '(asm-font-lock-keywords))
- (make-local-variable 'asm-mode-syntax-table)
- (setq asm-mode-syntax-table (make-syntax-table))
- (set-syntax-table asm-mode-syntax-table)
(run-hooks 'asm-mode-set-comment-hook)
;; Make our own local child of asm-mode-map
;; so we can define our own comment character.
(use-local-map (nconc (make-sparse-keymap) asm-mode-map))
(local-set-key (vector asm-comment-char) 'asm-comment)
! (modify-syntax-entry asm-comment-char
! "< b" asm-mode-syntax-table)
! (modify-syntax-entry ?\n
! "> b" asm-mode-syntax-table)
!
! (modify-syntax-entry ?/ ". 14" asm-mode-syntax-table)
! (modify-syntax-entry ?* ". 23" asm-mode-syntax-table)
!
! (let ((cs (regexp-quote (char-to-string asm-comment-char))))
! (make-local-variable 'comment-start)
! (setq comment-start (concat (char-to-string asm-comment-char) " "))
! (make-local-variable 'comment-start-skip)
! (setq comment-start-skip (concat cs "+[ \t]*" "\\|" "/\\*+ *"))
! (make-local-variable 'comment-end-skip)
! (setq comment-end-skip "[ \t]*\\(\\s>\\|\\*+/\\)")
! (setq asm-inline-empty-comment-pattern (concat "^.+" cs "+ *$"))
! (setq asm-code-level-empty-comment-pattern (concat "^[\t ]+" cs cs " *$"))
! (setq asm-flush-left-empty-comment-pattern (concat "^" cs cs cs " *$"))
! )
(make-local-variable 'comment-end)
(setq comment-end "")
(setq fill-prefix "\t")
--- 119,139 ----
(setq local-abbrev-table asm-mode-abbrev-table)
(make-local-variable 'font-lock-defaults)
(setq font-lock-defaults '(asm-font-lock-keywords))
(run-hooks 'asm-mode-set-comment-hook)
;; Make our own local child of asm-mode-map
;; so we can define our own comment character.
(use-local-map (nconc (make-sparse-keymap) asm-mode-map))
(local-set-key (vector asm-comment-char) 'asm-comment)
+ (set-syntax-table (make-syntax-table asm-mode-syntax-table))
+ (modify-syntax-entry asm-comment-char "<")
! (make-local-variable 'comment-start)
! (setq comment-start (string asm-comment-char ?\ ))
! (make-local-variable 'comment-start-skip)
! (setq comment-start-skip "\\(?:\\s<+\\|/\\*+\\)[ \t]*")
! (make-local-variable 'comment-end-skip)
! (setq comment-end-skip "[ \t]*\\(\\s>\\|\\*+/\\)")
(make-local-variable 'comment-end)
(setq comment-end "")
(setq fill-prefix "\t")
***************
*** 171,177 ****
(tab-to-tab-stop)
)
! (defun asm-line-matches (pattern &optional withcomment)
(save-excursion
(beginning-of-line)
(looking-at pattern)))
--- 158,164 ----
(tab-to-tab-stop)
)
! (defun asm-line-matches (pattern)
(save-excursion
(beginning-of-line)
(looking-at pattern)))
***************
*** 187,194 ****
(if (bolp)
nil
(beginning-of-line)
! (open-line 1))
! )
(defun asm-comment ()
--- 174,180 ----
(if (bolp)
nil
(beginning-of-line)
! (open-line 1)))
(defun asm-comment ()
***************
*** 234,242 ****
;; If all else fails, insert character
(t
! (insert asm-comment-char))
!
! )
(end-of-line))
(provide 'asm-mode)
--- 220,226 ----
;; If all else fails, insert character
(t
! (insert asm-comment-char)))
(end-of-line))
(provide 'asm-mode)
- [Emacs-diffs] Changes to emacs/lisp/progmodes/asm-mode.el,
Stefan Monnier <=