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/sh-script.el


From: Stefan Monnier
Subject: [Emacs-diffs] Changes to emacs/lisp/progmodes/sh-script.el
Date: Sun, 01 Jun 2003 13:36:41 -0400

Index: emacs/lisp/progmodes/sh-script.el
diff -c emacs/lisp/progmodes/sh-script.el:1.121 
emacs/lisp/progmodes/sh-script.el:1.122
*** emacs/lisp/progmodes/sh-script.el:1.121     Tue May 27 14:40:31 2003
--- emacs/lisp/progmodes/sh-script.el   Sun Jun  1 13:36:41 2003
***************
*** 890,895 ****
--- 890,899 ----
    ;; This looks silly, but it's because `sh-here-doc-re' keeps changing.
    (re-search-forward sh-here-doc-re limit t))
  
+ (defun sh-is-quoted-p (pos)
+   (and (eq (char-before pos) ?\\)
+        (not (sh-is-quoted-p (1- pos)))))
+ 
  (defun sh-font-lock-paren (start)
    (save-excursion
      (goto-char start)
***************
*** 900,906 ****
          ;; Skip through one pattern
          (while
              (or (/= 0 (skip-syntax-backward "w_"))
!                 (/= 0 (skip-chars-backward "?*/"))
                  (when (memq (char-before) '(?\" ?\'))
                    (condition-case nil (progn (backward-sexp 1) t)
                      (error nil)))))
--- 904,912 ----
          ;; Skip through one pattern
          (while
              (or (/= 0 (skip-syntax-backward "w_"))
!                 (/= 0 (skip-chars-backward "?*/\\"))
!                 (and (sh-is-quoted-p (1- (point)))
!                      (goto-char (- (point) 2)))
                  (when (memq (char-before) '(?\" ?\'))
                    (condition-case nil (progn (backward-sexp 1) t)
                      (error nil)))))
***************
*** 1536,1543 ****
            (setcdr elt
                    (setq val
                          (eval (if (consp (setq val (cdr val)))
!                                   (let ((sh-shell (car (cdr val)))
!                                         function)
                                      (if (assq sh-shell list)
                                          (setcar (cdr val)
                                                  (list 'quote
--- 1542,1548 ----
            (setcdr elt
                    (setq val
                          (eval (if (consp (setq val (cdr val)))
!                                   (let ((sh-shell (car (cdr val))))
                                      (if (assq sh-shell list)
                                          (setcar (cdr val)
                                                  (list 'quote
***************
*** 1947,1974 ****
             what the indentation is based on."
    ;; See comments before `sh-kw'.
    (save-excursion
!     (let ((prev-kw nil)
!         (prev-stmt nil)
!         (have-result nil)
!         depth-bol depth-eol
          this-kw
-         (state nil)
-         state-bol
-         (depth-prev-bol nil)
          start
!         func val
          (result nil)
-         prev-lines-indent
-         (prev-list nil)
-         (this-list nil)
          (align-point nil)
          prev-line-end x)
        (beginning-of-line)
        ;; Note: setting result to t means we are done and will return nil.
        ;;(This function never returns just t.)
        (cond
!        ((or (and (boundp 'font-lock-string-face)
!                (eq (get-text-property (point) 'face) font-lock-string-face))
            (eq (get-text-property (point) 'face) sh-heredoc-face))
        (setq result t)
        (setq have-result t))
--- 1952,1971 ----
             what the indentation is based on."
    ;; See comments before `sh-kw'.
    (save-excursion
!     (let ((have-result nil)
          this-kw
          start
!         val
          (result nil)
          (align-point nil)
          prev-line-end x)
        (beginning-of-line)
        ;; Note: setting result to t means we are done and will return nil.
        ;;(This function never returns just t.)
        (cond
!        ((or (and (boundp 'font-lock-string-face) (not (bobp))
!                (eq (get-text-property (1- (point)) 'face)
!                    font-lock-string-face))
            (eq (get-text-property (point) 'face) sh-heredoc-face))
        (setq result t)
        (setq have-result t))
***************
*** 2265,2275 ****
    ;;
    (if (bolp)
        nil
!     (let ((going t)
!         c n
!         min-point
!         (start (point))
!         (found nil))
        (save-restriction
        (narrow-to-region
        (if (sh-this-is-a-continuation)
--- 2262,2269 ----
    ;;
    (if (bolp)
        nil
!     (let (c min-point
!         (start (point)))
        (save-restriction
        (narrow-to-region
        (if (sh-this-is-a-continuation)
***************
*** 2558,2564 ****
    (sh-must-support-indent)
    (let* ((info (sh-get-indent-info))
         (var (sh-get-indent-var-for-line info))
!        val val0 new-val old-val indent-val)
      (if (stringp var)
        (message (format "Cannot set indent - %s" var))
        (setq old-val (symbol-value var))
--- 2552,2558 ----
    (sh-must-support-indent)
    (let* ((info (sh-get-indent-info))
         (var (sh-get-indent-var-for-line info))
!        val old-val indent-val)
      (if (stringp var)
        (message (format "Cannot set indent - %s" var))
        (setq old-val (symbol-value var))
***************
*** 2753,2759 ****
      (let ((learned-var-list nil)
          (out-buffer "*indent*")
          (num-diffs 0)
-         last-pos
          previous-set-info
          (max 17)
          vec
--- 2747,2752 ----
***************
*** 2914,2927 ****
            (append (list (list 'sh-indent-comment comment-col (point-max)))
                    learned-var-list))
        (setq sh-indent-comment comment-col)
!       (let ((name (buffer-name))
!           (lines (if (and (eq (point-min) 1)
!                           (eq (point-max) (1+ (buffer-size))))
!                      ""
!                    (format "lines %d to %d of "
!                            (1+ (count-lines 1 (point-min)))
!                            (1+ (count-lines 1 (point-max))))))
!           )
        (sh-mark-line  "\nLearned variable settings:" nil out-buffer)
        (if arg
            ;; Set learned variables to symbolic rather than numeric
--- 2907,2913 ----
            (append (list (list 'sh-indent-comment comment-col (point-max)))
                    learned-var-list))
        (setq sh-indent-comment comment-col)
!       (let ((name (buffer-name)))
        (sh-mark-line  "\nLearned variable settings:" nil out-buffer)
        (if arg
            ;; Set learned variables to symbolic rather than numeric
***************
*** 2966,2977 ****
    nil           - we couldn't find a reasonable one."
    (let* ((max (1- (length vec)))
         (i 1)
!        (totals (make-vector max 0))
!        (return nil)
!        j)
      (while (< i max)
        (aset totals i (+ (aref totals i) (* 4 (aref vec i))))
-       (setq j (/ i 2))
        (if (zerop (% i 2))
          (aset totals i (+ (aref totals i) (aref vec (/ i 2)))))
        (if (< (* i 2) max)
--- 2952,2960 ----
    nil           - we couldn't find a reasonable one."
    (let* ((max (1- (length vec)))
         (i 1)
!        (totals (make-vector max 0)))
      (while (< i max)
        (aset totals i (+ (aref totals i) (* 4 (aref vec i))))
        (if (zerop (% i 2))
          (aset totals i (+ (aref totals i) (aref vec (/ i 2)))))
        (if (< (* i 2) max)




reply via email to

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