]> code.delx.au - gnu-emacs/blobdiff - lisp/progmodes/sh-script.el
from trunk
[gnu-emacs] / lisp / progmodes / sh-script.el
index 1adea78c2f56f0cbfff88e0b0a9d3d0d40213cbb..ca0971bf675f753c29a700be19056314f0d9112d 100644 (file)
@@ -1,7 +1,7 @@
 ;;; sh-script.el --- shell-script editing commands for Emacs
 
 ;; Copyright (C) 1993, 1994, 1995, 1996, 1997, 1999, 2001, 2002, 2003,
-;;  2004, 2005, 2006, 2007, 2008, 2009  Free Software Foundation, Inc.
+;;  2004, 2005, 2006, 2007, 2008, 2009, 2010  Free Software Foundation, Inc.
 
 ;; Author: Daniel Pfeiffer <occitan@esperanto.org>
 ;; Version: 2.0f
@@ -1109,6 +1109,9 @@ subshells can nest."
                  (when (memq (char-before) '(?\" ?\'))
                    (condition-case nil (progn (backward-sexp 1) t)
                      (error nil)))))
+         ;; Patterns can be preceded by an open-paren (Bug#1320).
+         (if (eq (char-before (point)) ?\()
+             (backward-char 1))
           (while (progn
                    (forward-comment (- (point-max)))
                    ;; Maybe we've bumped into an escaped newline.
@@ -2975,8 +2978,7 @@ so that `occur-next' and `occur-prev' will work."
 ;;
 ;; (defun what-i-learned (list)
 ;;   (let ((p list))
-;;     (save-excursion
-;;       (set-buffer "*scratch*")
+;;     (with-current-buffer "*scratch*"
 ;;       (goto-char (point-max))
 ;;       (insert "(setq\n")
 ;;       (while p
@@ -3210,7 +3212,7 @@ This command can often take a long time to run."
           )))
       ;; Are abnormal hooks considered bad form?
       (run-hook-with-args 'sh-learned-buffer-hook learned-var-list)
-      (and (called-interactively-p)
+      (and (called-interactively-p 'any)
           (or sh-popup-occur-buffer (> num-diffs 0))
           (pop-to-buffer out-buffer)))))