(octave-abbrev-table): Move defvar and
initialization into define-abbrev-table. Use :regexp. (octave-mode-syntax-table): Don't set word syntax for `.
This commit is contained in:
parent
5af733c09a
commit
7210c33ff8
2 changed files with 39 additions and 36 deletions
|
|
@ -11,6 +11,10 @@
|
|||
|
||||
2008-05-02 Stefan Monnier <monnier@iro.umontreal.ca>
|
||||
|
||||
* progmodes/octave-mod.el (octave-abbrev-table): Move defvar and
|
||||
initialization into define-abbrev-table. Use :regexp.
|
||||
(octave-mode-syntax-table): Don't set word syntax for `.
|
||||
|
||||
* files.el (minibuffer-with-setup-hook): Allow `fun' expressions rather
|
||||
than only value.
|
||||
|
||||
|
|
|
|||
|
|
@ -55,43 +55,41 @@
|
|||
"Kurt Hornik <Kurt.Hornik@wu-wien.ac.at>, bug-gnu-emacs@gnu.org"
|
||||
"Current maintainer of the Emacs Octave package.")
|
||||
|
||||
(defvar octave-abbrev-table nil
|
||||
(define-abbrev-table 'octave-abbrev-table
|
||||
(mapcar (lambda (e) (append e '(nil 0 t)))
|
||||
'(("`a" "all_va_args")
|
||||
("`b" "break")
|
||||
("`cs" "case")
|
||||
("`ca" "catch")
|
||||
("`c" "continue")
|
||||
("`el" "else")
|
||||
("`eli" "elseif")
|
||||
("`et" "end_try_catch")
|
||||
("`eu" "end_unwind_protect")
|
||||
("`ef" "endfor")
|
||||
("`efu" "endfunction")
|
||||
("`ei" "endif")
|
||||
("`es" "endswitch")
|
||||
("`ew" "endwhile")
|
||||
("`f" "for")
|
||||
("`fu" "function")
|
||||
("`gl" "global")
|
||||
("`gp" "gplot")
|
||||
("`gs" "gsplot")
|
||||
("`if" "if ()")
|
||||
("`o" "otherwise")
|
||||
("`rp" "replot")
|
||||
("`r" "return")
|
||||
("`s" "switch")
|
||||
("`t" "try")
|
||||
("`u" "until ()")
|
||||
("`up" "unwind_protect")
|
||||
("`upc" "unwind_protect_cleanup")
|
||||
("`w" "while ()")))
|
||||
"Abbrev table for Octave's reserved words.
|
||||
Used in `octave-mode' and inferior-octave-mode buffers.
|
||||
All Octave abbrevs start with a grave accent (`).")
|
||||
(unless octave-abbrev-table
|
||||
(define-abbrev-table 'octave-abbrev-table ()))
|
||||
|
||||
(let ((abbrevs-changed abbrevs-changed))
|
||||
(define-abbrev octave-abbrev-table "`a" "all_va_args" nil 0 t)
|
||||
(define-abbrev octave-abbrev-table "`b" "break" nil 0 t)
|
||||
(define-abbrev octave-abbrev-table "`cs" "case" nil 0 t)
|
||||
(define-abbrev octave-abbrev-table "`ca" "catch" nil 0 t)
|
||||
(define-abbrev octave-abbrev-table "`c" "continue" nil 0 t)
|
||||
(define-abbrev octave-abbrev-table "`el" "else" nil 0 t)
|
||||
(define-abbrev octave-abbrev-table "`eli" "elseif" nil 0 t)
|
||||
(define-abbrev octave-abbrev-table "`et" "end_try_catch" nil 0 t)
|
||||
(define-abbrev octave-abbrev-table "`eu" "end_unwind_protect" nil 0 t)
|
||||
(define-abbrev octave-abbrev-table "`ef" "endfor" nil 0 t)
|
||||
(define-abbrev octave-abbrev-table "`efu" "endfunction" nil 0 t)
|
||||
(define-abbrev octave-abbrev-table "`ei" "endif" nil 0 t)
|
||||
(define-abbrev octave-abbrev-table "`es" "endswitch" nil 0 t)
|
||||
(define-abbrev octave-abbrev-table "`ew" "endwhile" nil 0 t)
|
||||
(define-abbrev octave-abbrev-table "`f" "for" nil 0 t)
|
||||
(define-abbrev octave-abbrev-table "`fu" "function" nil 0 t)
|
||||
(define-abbrev octave-abbrev-table "`gl" "global" nil 0 t)
|
||||
(define-abbrev octave-abbrev-table "`gp" "gplot" nil 0 t)
|
||||
(define-abbrev octave-abbrev-table "`gs" "gsplot" nil 0 t)
|
||||
(define-abbrev octave-abbrev-table "`if" "if ()" nil 0 t)
|
||||
(define-abbrev octave-abbrev-table "`o" "otherwise" nil 0 t)
|
||||
(define-abbrev octave-abbrev-table "`rp" "replot" nil 0 t)
|
||||
(define-abbrev octave-abbrev-table "`r" "return" nil 0 t)
|
||||
(define-abbrev octave-abbrev-table "`s" "switch" nil 0 t)
|
||||
(define-abbrev octave-abbrev-table "`t" "try" nil 0 t)
|
||||
(define-abbrev octave-abbrev-table "`u" "until ()" nil 0 t)
|
||||
(define-abbrev octave-abbrev-table "`up" "unwind_protect" nil 0 t)
|
||||
(define-abbrev octave-abbrev-table "`upc" "unwind_protect_cleanup" nil 0 t)
|
||||
(define-abbrev octave-abbrev-table "`w" "while ()" nil 0 t))
|
||||
All Octave abbrevs start with a grave accent (`)."
|
||||
:regexp "\\(?:[^`]\\|^\\)\\(\\(?:\\<\\|`\\)\\w+\\)\\W*")
|
||||
|
||||
(defvar octave-comment-char ?#
|
||||
"Character to start an Octave comment.")
|
||||
|
|
@ -298,7 +296,8 @@ parenthetical grouping.")
|
|||
(modify-syntax-entry ?! "." table)
|
||||
(modify-syntax-entry ?\\ "\\" table)
|
||||
(modify-syntax-entry ?\' "." table)
|
||||
(modify-syntax-entry ?\` "w" table)
|
||||
;; Was "w" for abbrevs, but now that it's not necessary any more,
|
||||
(modify-syntax-entry ?\` "." table)
|
||||
(modify-syntax-entry ?\" "\"" table)
|
||||
(modify-syntax-entry ?. "w" table)
|
||||
(modify-syntax-entry ?_ "w" table)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue