From 946c009b511d6b459abafb8d2201bb7f526933be Mon Sep 17 00:00:00 2001 From: Chong Yidong Date: Sat, 19 Sep 2009 19:35:15 +0000 Subject: [PATCH] * progmodes/sh-script.el (sh-learn-buffer-indent): Pop to the indent buffer only if called interactively (Bug#4452). --- lisp/ChangeLog | 5 +++++ lisp/progmodes/sh-script.el | 9 +++++---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 8b15bd07573..0d3f8d686dd 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2009-09-19 Chong Yidong + + * progmodes/sh-script.el (sh-learn-buffer-indent): Pop to the + indent buffer only if called interactively (Bug#4452). + 2009-09-19 Juanma Barranquero Eli Zaretskii diff --git a/lisp/progmodes/sh-script.el b/lisp/progmodes/sh-script.el index 70b96ba807d..1adea78c2f5 100644 --- a/lisp/progmodes/sh-script.el +++ b/lisp/progmodes/sh-script.el @@ -2997,7 +2997,8 @@ so that `occur-next' and `occur-prev' will work." 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 @@ -3209,9 +3210,9 @@ 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) - (if (or sh-popup-occur-buffer (> num-diffs 0)) - (pop-to-buffer out-buffer)) - ))) + (and (called-interactively-p) + (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'. -- 2.39.5