[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] master 4fda400 5/5: Merge from emacs-24
From: |
Stefan Monnier |
Subject: |
[Emacs-diffs] master 4fda400 5/5: Merge from emacs-24 |
Date: |
Fri, 05 Dec 2014 20:30:24 +0000 |
branch: master
commit 4fda400e58339cdf962b5679bf05ebe62c6189c5
Merge: 0d7b2c9 c1c2cee
Author: Stefan Monnier <address@hidden>
Commit: Stefan Monnier <address@hidden>
Merge from emacs-24
---
.gitignore | 12 +++++++-----
ChangeLog | 6 ++++++
lisp/ChangeLog | 10 ++++++++++
lisp/progmodes/sh-script.el | 4 ++--
lisp/simple.el | 4 ++--
src/ChangeLog | 18 ++++++++++++++++++
src/eval.c | 6 ++----
src/nsfns.m | 9 +--------
src/nsterm.h | 6 +++++-
src/nsterm.m | 27 +++++++++++++++++++++++++++
test/indent/shell.sh | 11 +++++++++++
11 files changed, 91 insertions(+), 22 deletions(-)
diff --git a/.gitignore b/.gitignore
index ff0e5ed..228deaa 100644
--- a/.gitignore
+++ b/.gitignore
@@ -18,6 +18,11 @@
# along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
+# 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 56e7520..166e0e9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2014-12-05 Paul Eggert <address@hidden>
+
+ * .gitignore: Remove redundant pattern (subsumed by _*).
+ Avoid "**", as it requires Git 1.8.2 or later.
+
+2014-12-05 Paul Eggert <address@hidden>
2014-12-05 Eli Zaretskii <address@hidden>
* .gitignore: Ignore test/biditest.txt.
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index b4e51a6..79ee9d7 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,5 +1,15 @@
2014-12-05 Stefan Monnier <address@hidden>
+ * 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 <address@hidden>
+2014-12-05 Stefan Monnier <address@hidden>
+
+ * 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 5631358..524749d 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 900828a..9f44798 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 82aabb3..27202f1 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,21 @@
+2014-12-05 Lee Duhem <address@hidden> (tiny change)
+
+ * eval.c (Fsignal): Remove duplicate test.
+ (Fautoload_do_load): Fix up docstring.
+
+2014-12-05 Jan Djärv <address@hidden>
+
+ * 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 <address@hidden>
2014-12-05 Eli Zaretskii <address@hidden>
* dispextern.h (enum bidi_dir_t): Force NEUTRAL_DIR to be zero.
diff --git a/src/eval.c b/src/eval.c
index 8a83fdb..8194468 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 4f158f4..a5ff634 100644
--- a/src/nsfns.m
+++ b/src/nsfns.m
@@ -619,18 +619,11 @@ ns_set_name_as_filename (struct frame *f)
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 b33e6b2..c3841a4 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 8729fa5..f012528 100644
--- a/src/nsterm.m
+++ b/src/nsterm.m
@@ -293,6 +293,9 @@ static struct {
NULL, 0, 0
};
+static NSString *represented_filename = nil;
+static struct frame *represented_frame = 0;
+
#ifdef NS_IMPL_COCOA
/*
* State for pending menu activation:
@@ -400,6 +403,13 @@ void x_set_frame_alpha (struct frame *f);
==========================================================================
*/
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)
{
EVENT_INIT (*ev);
@@ -4600,6 +4610,23 @@ ns_term_shutdown (int sig)
}
#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 e361905..14f6774 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