diff --git a/.gitignore b/.gitignore
index ff0e5ed0101..228deaaf8e5 100644
--- a/.gitignore
+++ b/.gitignore
@@ -18,6 +18,11 @@
# along with GNU Emacs. If not, see .
+# Currently we assume only Git 1.7.1 (April 2010) or later, so this
+# file does not rely on "**" in patterns. The "**" feature was added
+# in Git 1.8.2 (March 2013).
+
+
# Built by 'autogen.sh'.
/aclocal.m4
/configure
@@ -72,13 +77,10 @@ src/buildobj.h
src/globals.h
# Lisp-level sources built by 'make'.
+*cus-load.el
+*loaddefs.el
leim/changed.misc
leim/changed.tit
-lisp/**/*cus-load.el
-lisp/cus-load.el
-lisp/**/*loaddefs.el
-lisp/**/**/*loaddefs.el
-lisp/*loaddefs.el
lisp/cedet/semantic/bovine/c-by.el
lisp/cedet/semantic/bovine/make-by.el
lisp/cedet/semantic/bovine/scm-by.el
diff --git a/ChangeLog b/ChangeLog
index 56e7520d421..166e0e96110 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2014-12-05 Paul Eggert
+
+ * .gitignore: Remove redundant pattern (subsumed by _*).
+ Avoid "**", as it requires Git 1.8.2 or later.
+
+2014-12-05 Paul Eggert
2014-12-05 Eli Zaretskii
* .gitignore: Ignore test/biditest.txt.
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index b4e51a6eebb..79ee9d75906 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,5 +1,15 @@
2014-12-05 Stefan Monnier
+ * progmodes/sh-script.el (sh-smie-sh-rules): Go back to the beginning
+ of the whole pipe when indenting an opening keyword after a |.
+ Generalize this treatment to opening keywords like "while" (bug#18031).
+
+2014-12-05 Stefan Monnier
+2014-12-05 Stefan Monnier
+
+ * simple.el (newline): Place the hook buffer-locally,
+ to make sure it's first.
+
* progmodes/prog-mode.el (prettify-symbols--compose-symbol):
Fix handling of symbols with different syntax at beginning/end or with
symbol rather than word syntax.
diff --git a/lisp/progmodes/sh-script.el b/lisp/progmodes/sh-script.el
index 5631358b472..524749d6266 100644
--- a/lisp/progmodes/sh-script.el
+++ b/lisp/progmodes/sh-script.el
@@ -2014,12 +2014,12 @@ May return nil if the line should not be treated as continued."
(and (numberp indent) (numberp initial)
(<= indent initial)))))
`(column . ,(+ initial sh-indentation)))
- (`(:before . ,(or `"(" `"{" `"["))
+ (`(:before . ,(or `"(" `"{" `"[" "while" "if" "for" "case"))
(if (not (smie-rule-prev-p "&&" "||" "|"))
(when (smie-rule-hanging-p)
(smie-rule-parent))
(unless (smie-rule-bolp)
- (smie-backward-sexp 'halfexp)
+ (while (equal "|" (nth 2 (smie-backward-sexp 'halfexp))))
`(column . ,(smie-indent-virtual)))))
;; FIXME: Maybe this handling of ;; should be made into
;; a smie-rule-terminator function that takes the substitute ";" as arg.
diff --git a/lisp/simple.el b/lisp/simple.el
index 900828aad1c..9f447988a2f 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -440,12 +440,12 @@ A non-nil INTERACTIVE argument means to run the `post-self-insert-hook'."
(self-insert-command (prefix-numeric-value arg)))
(unwind-protect
(progn
- (add-hook 'post-self-insert-hook postproc)
+ (add-hook 'post-self-insert-hook postproc nil t)
(self-insert-command (prefix-numeric-value arg)))
;; We first used let-binding to protect the hook, but that was naive
;; since add-hook affects the symbol-default value of the variable,
;; whereas the let-binding might only protect the buffer-local value.
- (remove-hook 'post-self-insert-hook postproc)))
+ (remove-hook 'post-self-insert-hook postproc t)))
(cl-assert (not (member postproc post-self-insert-hook)))
(cl-assert (not (member postproc (default-value 'post-self-insert-hook))))))
nil)
diff --git a/src/ChangeLog b/src/ChangeLog
index 82aabb389a3..27202f10bf5 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,21 @@
+2014-12-05 Lee Duhem (tiny change)
+
+ * eval.c (Fsignal): Remove duplicate test.
+ (Fautoload_do_load): Fix up docstring.
+
+2014-12-05 Jan Djärv
+
+ * nsterm.m (represented_filename, represented_frame): New variables.
+ (ns_set_represented_filename): New function.
+ (sendEvent:): Set represented filename here to avoid flicker,
+ related to Bug#18757.
+
+ * nsterm.h: Declare ns_set_represented_filename.
+
+ * nsfns.m (ns_set_name_as_filename): Don't set represented filename
+ at once, call ns_set_represented_filename instead.
+
+2014-12-05 Eli Zaretskii
2014-12-05 Eli Zaretskii
* dispextern.h (enum bidi_dir_t): Force NEUTRAL_DIR to be zero.
diff --git a/src/eval.c b/src/eval.c
index 8a83fdb7880..8194468a650 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -1533,8 +1533,7 @@ See also the function `condition-case'. */)
|| NILP (clause)
/* A `debug' symbol in the handler list disables the normal
suppression of the debugger. */
- || (CONSP (clause) && CONSP (clause)
- && !NILP (Fmemq (Qdebug, clause)))
+ || (CONSP (clause) && !NILP (Fmemq (Qdebug, clause)))
/* Special handler that means "print a message and run debugger
if requested". */
|| EQ (h->tag_or_ch, Qerror)))
@@ -1918,7 +1917,7 @@ DEFUN ("autoload-do-load", Fautoload_do_load, Sautoload_do_load, 1, 3, 0,
If non-nil, FUNNAME should be the symbol whose function value is FUNDEF,
in which case the function returns the new autoloaded function value.
If equal to `macro', MACRO-ONLY specifies that FUNDEF should only be loaded if
-it is defines a macro. */)
+it defines a macro. */)
(Lisp_Object fundef, Lisp_Object funname, Lisp_Object macro_only)
{
ptrdiff_t count = SPECPDL_INDEX ();
@@ -3405,7 +3404,6 @@ backtrace_eval_unrewind (int distance)
for (; distance > 0; distance--)
{
tmp += step;
- /* */
switch (tmp->kind)
{
/* FIXME: Ideally we'd like to "temporarily unwind" (some of) those
diff --git a/src/nsfns.m b/src/nsfns.m
index 4f158f4c51e..a5ff6346d74 100644
--- a/src/nsfns.m
+++ b/src/nsfns.m
@@ -619,18 +619,11 @@ Turn the input menu (an NSMenu) into a lisp list for tracking on lisp side
fstr = [NSString stringWithUTF8String: SSDATA (encoded_filename)];
if (fstr == nil) fstr = @"";
-#ifdef NS_IMPL_COCOA
- /* work around a bug observed on 10.3 and later where
- setTitleWithRepresentedFilename does not clear out previous state
- if given filename does not exist */
- if (! [[NSFileManager defaultManager] fileExistsAtPath: fstr])
- [[view window] setRepresentedFilename: @""];
-#endif
}
else
fstr = @"";
- [[view window] setRepresentedFilename: fstr];
+ ns_set_represented_filename (fstr, f);
[[view window] setTitle: str];
fset_name (f, name);
}
diff --git a/src/nsterm.h b/src/nsterm.h
index b33e6b2ee08..c3841a40f59 100644
--- a/src/nsterm.h
+++ b/src/nsterm.h
@@ -890,11 +890,15 @@ extern unsigned long ns_get_rgb_color (struct frame *f,
extern void ns_init_events ();
extern void ns_finish_events ();
-/* From nsterm.m, needed in nsfont.m. */
#ifdef __OBJC__
+/* From nsterm.m, needed in nsfont.m. */
extern void
ns_draw_text_decoration (struct glyph_string *s, struct face *face,
NSColor *defaultCol, CGFloat width, CGFloat x);
+/* Needed in nsfns.m. */
+extern void
+ns_set_represented_filename (NSString* fstr, struct frame *f);
+
#endif
#ifdef NS_IMPL_GNUSTEP
diff --git a/src/nsterm.m b/src/nsterm.m
index 8729fa55a92..f012528b40d 100644
--- a/src/nsterm.m
+++ b/src/nsterm.m
@@ -293,6 +293,9 @@ - (NSColor *)colorUsingDefaultColorSpace
NULL, 0, 0
};
+static NSString *represented_filename = nil;
+static struct frame *represented_frame = 0;
+
#ifdef NS_IMPL_COCOA
/*
* State for pending menu activation:
@@ -399,6 +402,13 @@ - (NSColor *)colorUsingDefaultColorSpace
========================================================================== */
+void
+ns_set_represented_filename (NSString* fstr, struct frame *f)
+{
+ represented_filename = [fstr retain];
+ represented_frame = f;
+}
+
void
ns_init_events (struct input_event* ev)
{
@@ -4600,6 +4610,23 @@ - (void)sendEvent: (NSEvent *)theEvent
}
#endif
+ if (represented_filename != nil && represented_frame)
+ {
+ NSString *fstr = represented_filename;
+ NSView *view = FRAME_NS_VIEW (represented_frame);
+#ifdef NS_IMPL_COCOA
+ /* work around a bug observed on 10.3 and later where
+ setTitleWithRepresentedFilename does not clear out previous state
+ if given filename does not exist */
+ if (! [[NSFileManager defaultManager] fileExistsAtPath: fstr])
+ [[view window] setRepresentedFilename: @""];
+#endif
+ [[view window] setRepresentedFilename: fstr];
+ [represented_filename release];
+ represented_filename = nil;
+ represented_frame = NULL;
+ }
+
if (type == NSApplicationDefined)
{
switch ([theEvent data2])
diff --git a/test/indent/shell.sh b/test/indent/shell.sh
index e3619057d6e..14f67744ff2 100755
--- a/test/indent/shell.sh
+++ b/test/indent/shell.sh
@@ -54,6 +54,17 @@ filter_3 () # bug#17842
grep -v "^," | sort -t, -k2,2
}
+foo | bar | {
+ toto
+}
+
+grep -e "^$userregexp:" /etc/passwd | cut -d : -f 1 | while read user ; do
+ print -u2 "user=$user" # bug#18031
+ sudo -U $user -ll | while read line ; do
+ :
+ done
+done
+
echo -n $(( 5 << 2 ))
# This should not be treated as a heredoc (bug#12770).
2