;;; 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
(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.
"Variables controlling indentation in shell scripts.
Note: customizing these variables will not affect existing buffers if
-`sh-make-vars-local' is no-nil. See the documentation for
+`sh-make-vars-local' is non-nil. See the documentation for
variable `sh-make-vars-local', command `sh-make-vars-local'
and command `sh-reset-indent-vars-to-global-values'."
:group 'sh-script)
;;
;; (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
Output in buffer \"*indent*\" shows any lines which have conflicting
values of a variable, and the final value of all variables learned.
-This buffer is popped to automatically if there are any discrepancies.
+When called interactively, pop to this buffer automatically if
+there are any discrepancies.
If no prefix ARG is given, then variables are set to numbers.
If a prefix arg is given, then variables are set to symbols when
)))
;; Are abnormal hooks considered bad form?
(run-hook-with-args 'sh-learned-buffer-hook learned-var-list)
- (if (or sh-popup-occur-buffer (> num-diffs 0))
- (pop-to-buffer out-buffer))
- )))
+ (and (called-interactively-p 'any)
+ (or sh-popup-occur-buffer (> num-diffs 0))
+ (pop-to-buffer out-buffer)))))
(defun sh-guess-basic-offset (vec)
"See if we can determine a reasonable value for `sh-basic-offset'.