emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/lisp/progmodes/octave-mod.el [lexbind]


From: Miles Bader
Subject: [Emacs-diffs] Changes to emacs/lisp/progmodes/octave-mod.el [lexbind]
Date: Thu, 20 Nov 2003 19:36:41 -0500

Index: emacs/lisp/progmodes/octave-mod.el
diff -c emacs/lisp/progmodes/octave-mod.el:1.19.4.2 
emacs/lisp/progmodes/octave-mod.el:1.19.4.3
*** emacs/lisp/progmodes/octave-mod.el:1.19.4.2 Tue Oct 14 19:30:18 2003
--- emacs/lisp/progmodes/octave-mod.el  Thu Nov 20 19:35:51 2003
***************
*** 1,6 ****
  ;;; octave-mod.el --- editing Octave source files under Emacs
  
! ;; Copyright (C) 1997 Free Software Foundation, Inc.
  
  ;; Author: Kurt Hornik <address@hidden>
  ;; Author: John Eaton <address@hidden>
--- 1,6 ----
  ;;; octave-mod.el --- editing Octave source files under Emacs
  
! ;; Copyright (C) 1997, 2003 Free Software Foundation, Inc.
  
  ;; Author: Kurt Hornik <address@hidden>
  ;; Author: John Eaton <address@hidden>
***************
*** 94,100 ****
  (defvar octave-comment-char ?#
    "Character to start an Octave comment.")
  (defvar octave-comment-start
!   (concat (make-string 1 octave-comment-char) " ")
    "String to insert to start a new Octave in-line comment.")
  (defvar octave-comment-start-skip "\\s<+\\s-*"
    "Regexp to match the start of an Octave comment up to its body.")
--- 94,100 ----
  (defvar octave-comment-char ?#
    "Character to start an Octave comment.")
  (defvar octave-comment-start
!   (string octave-comment-char ?\ )
    "String to insert to start a new Octave in-line comment.")
  (defvar octave-comment-start-skip "\\s<+\\s-*"
    "Regexp to match the start of an Octave comment up to its body.")
***************
*** 287,296 ****
        ["Lookup Octave Index"          octave-help t])
    "Menu for Octave mode.")
  
! (defvar octave-mode-syntax-table nil
!   "Syntax table in use in octave-mode buffers.")
! (if octave-mode-syntax-table
!     ()
    (let ((table (make-syntax-table)))
      (modify-syntax-entry ?\r " "  table)
      (modify-syntax-entry ?+ "."   table)
--- 287,293 ----
        ["Lookup Octave Index"          octave-help t])
    "Menu for Octave mode.")
  
! (defvar octave-mode-syntax-table
    (let ((table (make-syntax-table)))
      (modify-syntax-entry ?\r " "  table)
      (modify-syntax-entry ?+ "."   table)
***************
*** 309,318 ****
      (modify-syntax-entry ?\" "\"" table)
      (modify-syntax-entry ?. "w"   table)
      (modify-syntax-entry ?_ "w"   table)
!     (modify-syntax-entry ?\% "."  table)
      (modify-syntax-entry ?\# "<"  table)
      (modify-syntax-entry ?\n ">"  table)
!     (setq octave-mode-syntax-table table)))
  
  (defcustom octave-auto-indent nil
    "*Non-nil means indent line after a semicolon or space in Octave mode."
--- 306,316 ----
      (modify-syntax-entry ?\" "\"" table)
      (modify-syntax-entry ?. "w"   table)
      (modify-syntax-entry ?_ "w"   table)
!     (modify-syntax-entry ?\% "<"  table)
      (modify-syntax-entry ?\# "<"  table)
      (modify-syntax-entry ?\n ">"  table)
!     table)
!   "Syntax table in use in `octave-mode' buffers.")
  
  (defcustom octave-auto-indent nil
    "*Non-nil means indent line after a semicolon or space in Octave mode."
***************
*** 565,597 ****
    (interactive)
    (describe-function major-mode))
  
- (defun octave-point (position)
-   "Returns the value of point at certain positions."
-   (save-excursion
-     (cond
-      ((eq position 'bol)  (beginning-of-line))
-      ((eq position 'eol)  (end-of-line))
-      ((eq position 'boi)  (back-to-indentation))
-      ((eq position 'bonl) (forward-line 1))
-      ((eq position 'bopl) (forward-line -1))
-      (t (error "unknown buffer position requested: %s" position)))
-     (point)))
- 
  (defsubst octave-in-comment-p ()
    "Returns t if point is inside an Octave comment, nil otherwise."
    (interactive)
    (save-excursion
!     (nth 4 (parse-partial-sexp (octave-point 'bol) (point)))))
  
  (defsubst octave-in-string-p ()
    "Returns t if point is inside an Octave string, nil otherwise."
    (interactive)
    (save-excursion
!     (nth 3 (parse-partial-sexp (octave-point 'bol) (point)))))
  
  (defsubst octave-not-in-string-or-comment-p ()
    "Returns t iff point is not inside an Octave string or comment."
!   (let ((pps (parse-partial-sexp (octave-point 'bol) (point))))
      (not (or (nth 3 pps) (nth 4 pps)))))
  
  (defun octave-in-block-p ()
--- 563,583 ----
    (interactive)
    (describe-function major-mode))
  
  (defsubst octave-in-comment-p ()
    "Returns t if point is inside an Octave comment, nil otherwise."
    (interactive)
    (save-excursion
!     (nth 4 (parse-partial-sexp (line-beginning-position) (point)))))
  
  (defsubst octave-in-string-p ()
    "Returns t if point is inside an Octave string, nil otherwise."
    (interactive)
    (save-excursion
!     (nth 3 (parse-partial-sexp (line-beginning-position) (point)))))
  
  (defsubst octave-not-in-string-or-comment-p ()
    "Returns t iff point is not inside an Octave string or comment."
!   (let ((pps (parse-partial-sexp (line-beginning-position) (point))))
      (not (or (nth 3 pps) (nth 4 pps)))))
  
  (defun octave-in-block-p ()
***************
*** 682,688 ****
              (back-to-indentation)
              (setq icol (current-column))
              (let ((bot (point))
!                   (eol (octave-point 'eol)))
                (while (< (point) eol)
                  (if (octave-not-in-string-or-comment-p)
                      (cond
--- 668,674 ----
              (back-to-indentation)
              (setq icol (current-column))
              (let ((bot (point))
!                   (eol (line-end-position)))
                (while (< (point) eol)
                  (if (octave-not-in-string-or-comment-p)
                      (cond
***************
*** 1017,1023 ****
                (buffer-substring-no-properties
                 (match-beginning 0) pos)
                pos (+ pos 1)
!               eol (octave-point 'eol)
                bb-arg
                (save-excursion
                  (save-restriction
--- 1003,1009 ----
                (buffer-substring-no-properties
                 (match-beginning 0) pos)
                pos (+ pos 1)
!               eol (line-end-position)
                bb-arg
                (save-excursion
                  (save-restriction
***************
*** 1123,1129 ****
                  (if (save-excursion
                        (skip-syntax-backward " <")
                        (bolp))
!                     (re-search-forward "[ \t]" (octave-point 'eol)
                                         'move))
                  ;; If we're not in a comment line and just ahead the
                  ;; continuation string, don't break here.
--- 1109,1115 ----
                  (if (save-excursion
                        (skip-syntax-backward " <")
                        (bolp))
!                     (re-search-forward "[ \t]" (line-end-position)
                                         'move))
                  ;; If we're not in a comment line and just ahead the
                  ;; continuation string, don't break here.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]