aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--etc/ChangeLog5
-rw-r--r--etc/NEWS5
-rw-r--r--etc/charsets/GB180302.map33
-rw-r--r--etc/charsets/GB180304.map10
-rw-r--r--lisp/ChangeLog16
-rw-r--r--lisp/progmodes/cc-engine.el8
-rw-r--r--lisp/progmodes/cc-fonts.el47
-rw-r--r--lisp/progmodes/cc-langs.el2
-rw-r--r--lisp/xwidget.el6
-rw-r--r--src/ChangeLog22
-rw-r--r--src/alloc.c10
-rw-r--r--src/fileio.c35
-rw-r--r--src/gnutls.c12
-rw-r--r--src/process.h2
-rw-r--r--src/xdisp.c4
15 files changed, 174 insertions, 43 deletions
diff --git a/etc/ChangeLog b/etc/ChangeLog
index d56523167d9..dfe4630e5bb 100644
--- a/etc/ChangeLog
+++ b/etc/ChangeLog
@@ -1,3 +1,8 @@
12011-07-18 Andreas Schwab <schwab@linux-m68k.org>
2
3 * charsets/GB180302.map: Update to 2005 edition.
4 * charsets/GB180304.map: Likewise.
5
12011-07-17 Bill Wohler <wohler@newt.com> 62011-07-17 Bill Wohler <wohler@newt.com>
2 7
3 Release MH-E version 8.2.93. 8 Release MH-E version 8.2.93.
diff --git a/etc/NEWS b/etc/NEWS
index 278fbea81c1..ffce9da51e4 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -1077,6 +1077,11 @@ syntactic rules.
1077** Syntax tables support a new "comment style c" additionally to style b. 1077** Syntax tables support a new "comment style c" additionally to style b.
1078** frame-local variables cannot be let-bound any more. 1078** frame-local variables cannot be let-bound any more.
1079** prog-mode is a new major-mode meant to be the parent of programming mode. 1079** prog-mode is a new major-mode meant to be the parent of programming mode.
1080The prog-mode-hook it defines can be used to enable features for
1081programming modes. For example:
1082(add-hook 'prog-mode-hook 'flyspell-prog-mode)
1083enables on the fly spell checking for comments and strings for
1084programming modes.
1080** define-minor-mode accepts a new keyword :variable. 1085** define-minor-mode accepts a new keyword :variable.
1081 1086
1082** `delete-file' and `delete-directory' now accept optional arg TRASH. 1087** `delete-file' and `delete-directory' now accept optional arg TRASH.
diff --git a/etc/charsets/GB180302.map b/etc/charsets/GB180302.map
index a001f22153f..ee7e0ecd42e 100644
--- a/etc/charsets/GB180302.map
+++ b/etc/charsets/GB180302.map
@@ -2048,17 +2048,20 @@
20480xA6B9-0xA6C0 0xE785 20480xA6B9-0xA6C0 0xE785
20490xA6C1-0xA6D1 0x03B1 20490xA6C1-0xA6D1 0x03B1
20500xA6D2-0xA6D8 0x03C3 20500xA6D2-0xA6D8 0x03C3
20510xA6D9-0xA6DF 0xE78D 20510xA6D9 0xFE10
20520xA6DA 0xFE12
20530xA6DB 0xFE11
20540xA6DC-0xA6DF 0xFE13
20520xA6E0-0xA6E1 0xFE35 20550xA6E0-0xA6E1 0xFE35
20530xA6E2-0xA6E3 0xFE39 20560xA6E2-0xA6E3 0xFE39
20540xA6E4-0xA6E5 0xFE3F 20570xA6E4-0xA6E5 0xFE3F
20550xA6E6-0xA6E7 0xFE3D 20580xA6E6-0xA6E7 0xFE3D
20560xA6E8-0xA6EB 0xFE41 20590xA6E8-0xA6EB 0xFE41
20570xA6EC-0xA6ED 0xE794 20600xA6EC-0xA6ED 0xFE17
20580xA6EE-0xA6EF 0xFE3B 20610xA6EE-0xA6EF 0xFE3B
20590xA6F0-0xA6F1 0xFE37 20620xA6F0-0xA6F1 0xFE37
20600xA6F2 0xFE31 20630xA6F2 0xFE31
20610xA6F3 0xE796 20640xA6F3 0xFE19
20620xA6F4-0xA6F5 0xFE33 20650xA6F4-0xA6F5 0xFE33
20630xA6F6-0xA6FE 0xE797 20660xA6F6-0xA6FE 0xE797
20640xA740-0xA77E 0xE706 20670xA740-0xA77E 0xE706
@@ -2124,7 +2127,7 @@
21240xA8B9 0x00FC 21270xA8B9 0x00FC
21250xA8BA 0x00EA 21280xA8BA 0x00EA
21260xA8BB 0x0251 21290xA8BB 0x0251
21270xA8BC 0xE7C7 21300xA8BC 0x1E3F
21280xA8BD 0x0144 21310xA8BD 0x0144
21290xA8BE 0x0148 21320xA8BE 0x0148
21300xA8BF 0x01F9 21330xA8BF 0x01F9
@@ -10385,13 +10388,15 @@
103850xFE4B-0xFE4C 0xFA23 103880xFE4B-0xFE4C 0xFA23
103860xFE4D-0xFE4F 0xFA27 103890xFE4D-0xFE4F 0xFA27
103870xFE50 0x2E81 103900xFE50 0x2E81
103880xFE51-0xFE53 0xE816 103910xFE51 0x00020087
103920xFE52 0x00020089
103930xFE53 0x000200CC
103890xFE54 0x2E84 103940xFE54 0x2E84
103900xFE55 0x3473 103950xFE55 0x3473
103910xFE56 0x3447 103960xFE56 0x3447
103920xFE57 0x2E88 103970xFE57 0x2E88
103930xFE58 0x2E8B 103980xFE58 0x2E8B
103940xFE59 0xE81E 103990xFE59 0x9FB4
103950xFE5A 0x359E 104000xFE5A 0x359E
103960xFE5B 0x361A 104010xFE5B 0x361A
103970xFE5C 0x360E 104020xFE5C 0x360E
@@ -10399,17 +10404,18 @@
103990xFE5E 0x2E97 104040xFE5E 0x2E97
104000xFE5F 0x396E 104050xFE5F 0x396E
104010xFE60 0x3918 104060xFE60 0x3918
104020xFE61 0xE826 104070xFE61 0x9FB5
104030xFE62 0x39CF 104080xFE62 0x39CF
104040xFE63 0x39DF 104090xFE63 0x39DF
104050xFE64 0x3A73 104100xFE64 0x3A73
104060xFE65 0x39D0 104110xFE65 0x39D0
104070xFE66-0xFE67 0xE82B 104120xFE66-0xFE67 0x9FB6
104080xFE68 0x3B4E 104130xFE68 0x3B4E
104090xFE69 0x3C6E 104140xFE69 0x3C6E
104100xFE6A 0x3CE0 104150xFE6A 0x3CE0
104110xFE6B 0x2EA7 104160xFE6B 0x2EA7
104120xFE6C-0xFE6D 0xE831 104170xFE6C 0x000215D7
104180xFE6D 0x9FB8
104130xFE6E 0x2EAA 104190xFE6E 0x2EAA
104140xFE6F 0x4056 104200xFE6F 0x4056
104150xFE70 0x415F 104210xFE70 0x415F
@@ -10417,7 +10423,7 @@
104170xFE72 0x4337 104230xFE72 0x4337
104180xFE73 0x2EB3 104240xFE73 0x2EB3
104190xFE74-0xFE75 0x2EB6 104250xFE74-0xFE75 0x2EB6
104200xFE76 0xE83B 104260xFE76 0x0002298F
104210xFE77 0x43B1 104270xFE77 0x43B1
104220xFE78 0x43AC 104280xFE78 0x43AC
104230xFE79 0x2EBB 104290xFE79 0x2EBB
@@ -10425,7 +10431,7 @@
104250xFE7B 0x44D6 104310xFE7B 0x44D6
104260xFE7C 0x4661 104320xFE7C 0x4661
104270xFE7D 0x464C 104330xFE7D 0x464C
104280xFE7E 0xE843 104340xFE7E 0x9FB9
104290xFE80 0x4723 104350xFE80 0x4723
104300xFE81 0x4729 104360xFE81 0x4729
104310xFE82 0x477C 104370xFE82 0x477C
@@ -10440,12 +10446,13 @@
104400xFE8D 0x499B 104460xFE8D 0x499B
104410xFE8E 0x49B7 104470xFE8E 0x49B7
104420xFE8F 0x49B6 104480xFE8F 0x49B6
104430xFE90-0xFE91 0xE854 104490xFE90 0x9FBA
104500xFE91 0x000241FE
104440xFE92 0x4CA3 104510xFE92 0x4CA3
104450xFE93-0xFE95 0x4C9F 104520xFE93-0xFE95 0x4C9F
104460xFE96 0x4C77 104530xFE96 0x4C77
104470xFE97 0x4CA2 104540xFE97 0x4CA2
104480xFE98-0xFE9E 0x4D13 104550xFE98-0xFE9E 0x4D13
104490xFE9F 0x4DAE 104560xFE9F 0x4DAE
104500xFEA0 0xE864 104570xFEA0 0x9FBB
104510xFEA1-0xFEFE 0xE468 104580xFEA1-0xFEFE 0xE468
diff --git a/etc/charsets/GB180304.map b/etc/charsets/GB180304.map
index e81eacff601..31352e266c8 100644
--- a/etc/charsets/GB180304.map
+++ b/etc/charsets/GB180304.map
@@ -40,7 +40,8 @@
400x8130CC30-0x8130D134 0x03CA 400x8130CC30-0x8130D134 0x03CA
410x8130D135-0x8130D238 0x0402 410x8130D135-0x8130D238 0x0402
420x8130D239 0x0450 420x8130D239 0x0450
430x8130D330-0x8136A531 0x0452 430x8130D330-0x8135F436 0x0452
440x8135F438-0x8136A531 0x1E40
440x8136A532-0x8136A533 0x2011 450x8136A532-0x8136A533 0x2011
450x8136A534 0x2017 460x8136A534 0x2017
460x8136A535-0x8136A536 0x201A 470x8136A535-0x8136A536 0x201A
@@ -171,8 +172,10 @@
1710x8234EB33-0x8234F633 0x4CA4 1720x8234EB33-0x8234F633 0x4CA4
1720x8234F634-0x82358731 0x4D1A 1730x8234F634-0x82358731 0x4D1A
1730x82358732-0x82358F32 0x4DAF 1740x82358732-0x82358F32 0x4DAF
1740x82358F33-0x8336C738 0x9FA6 1750x82358F33-0x82359036 0x9FA6
1760x82359135-0x8336C738 0x9FBC
1750x8336C739 0xE76C 1770x8336C739 0xE76C
1780x8135F437 0xE7C7
1760x8336C830 0xE7C8 1790x8336C830 0xE7C8
1770x8336C831-0x8336C933 0xE7E7 1800x8336C831-0x8336C933 0xE7E7
1780x8336C934 0xE815 1810x8336C934 0xE815
@@ -196,7 +199,8 @@
1960x84309B39-0x84309C34 0xFA19 1990x84309B39-0x84309C34 0xFA19
1970x84309C35 0xFA22 2000x84309C35 0xFA22
1980x84309C36-0x84309C37 0xFA25 2010x84309C36-0x84309C37 0xFA25
1990x84309C38-0x84318537 0xFA2A 2020x84309C38-0x84318235 0xFA2A
2030x84318336-0x84318537 0xFE1A
2000x84318538 0xFE32 2040x84318538 0xFE32
2010x84318539-0x84318632 0xFE45 2050x84318539-0x84318632 0xFE45
2020x84318633 0xFE53 2060x84318633 0xFE53
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index f320398975c..0ea3d94a01f 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,19 @@
12011-07-18 Alan Mackenzie <acm@muc.de>
2
3 Fontify declarators properly when, e.g., a jit-lock chunk begins
4 inside a declaration.
5
6 * progmodes/cc-langs.el (c-symbol-chars): Correct a typo.
7
8 * progmodes/cc-fonts.el (c-font-lock-enclosing-decls): New
9 function.
10 (c-complex-decl-matchers): Insert reference to
11 c-font-lock-enclosing-decls.
12
13 * progmodes/cc-engine.el (c-backward-single-comment):
14 (c-backward-comments): Bind open-paren-in-column-0-is-defun-start
15 to nil around calls to (forward-comment -1).
16
12011-07-17 Lars Magne Ingebrigtsen <larsi@gnus.org> 172011-07-17 Lars Magne Ingebrigtsen <larsi@gnus.org>
2 18
3 * image.el (put-image): Doc typo fix. 19 * image.el (put-image): Doc typo fix.
diff --git a/lisp/progmodes/cc-engine.el b/lisp/progmodes/cc-engine.el
index 38f66b4504e..a6fd28be21d 100644
--- a/lisp/progmodes/cc-engine.el
+++ b/lisp/progmodes/cc-engine.el
@@ -1301,12 +1301,13 @@ This function does not do any hidden buffer changes."
1301 ;; same line. 1301 ;; same line.
1302 (re-search-forward "\\=\\s *[\n\r]" start t) 1302 (re-search-forward "\\=\\s *[\n\r]" start t)
1303 1303
1304 (if (if (forward-comment -1) 1304 (if (if (let (open-paren-in-column-0-is-defun-start) (forward-comment -1))
1305 (if (eolp) 1305 (if (eolp)
1306 ;; If forward-comment above succeeded and we're at eol 1306 ;; If forward-comment above succeeded and we're at eol
1307 ;; then the newline we moved over above didn't end a 1307 ;; then the newline we moved over above didn't end a
1308 ;; line comment, so we give it another go. 1308 ;; line comment, so we give it another go.
1309 (forward-comment -1) 1309 (let (open-paren-in-column-0-is-defun-start)
1310 (forward-comment -1))
1310 t)) 1311 t))
1311 1312
1312 ;; Emacs <= 20 and XEmacs move back over the closer of a 1313 ;; Emacs <= 20 and XEmacs move back over the closer of a
@@ -1333,7 +1334,8 @@ comment at the start of cc-engine.el for more info."
1333 ;; return t when moving backwards at bob. 1334 ;; return t when moving backwards at bob.
1334 (not (bobp)) 1335 (not (bobp))
1335 1336
1336 (if (forward-comment -1) 1337 (if (let (open-paren-in-column-0-is-defun-start)
1338 (forward-comment -1))
1337 (if (looking-at "\\*/") 1339 (if (looking-at "\\*/")
1338 ;; Emacs <= 20 and XEmacs move back over the 1340 ;; Emacs <= 20 and XEmacs move back over the
1339 ;; closer of a block comment that lacks an opener. 1341 ;; closer of a block comment that lacks an opener.
diff --git a/lisp/progmodes/cc-fonts.el b/lisp/progmodes/cc-fonts.el
index 600bbc76e9a..0500d48ddbc 100644
--- a/lisp/progmodes/cc-fonts.el
+++ b/lisp/progmodes/cc-fonts.el
@@ -1346,6 +1346,50 @@ casts and declarations are fontified. Used on level 2 and higher."
1346 (c-font-lock-declarators limit t nil))) 1346 (c-font-lock-declarators limit t nil)))
1347 nil) 1347 nil)
1348 1348
1349(defun c-font-lock-enclosing-decls (limit)
1350 ;; Fontify the declarators of (nested) declarations we're in the middle of.
1351 ;; This is mainly for when a jit-lock etc. chunk starts inside the brace
1352 ;; block of a struct/union/class, etc.
1353 ;;
1354 ;; This function will be called from font-lock for a region bounded by POINT
1355 ;; and LIMIT, as though it were to identify a keyword for
1356 ;; font-lock-keyword-face. It always returns NIL to inhibit this and
1357 ;; prevent a repeat invocation. See elisp/lispref page "Search-based
1358 ;; Fontification".
1359 (let* ((paren-state (c-parse-state))
1360 (start (point))
1361 decl-context bo-decl in-typedef type-type ps-elt)
1362
1363 ;; First, are we actually in a "local" declaration?
1364 (setq decl-context (c-beginning-of-decl-1)
1365 bo-decl (point)
1366 in-typedef (looking-at c-typedef-key))
1367 (if in-typedef (c-forward-token-2))
1368 (when (and (eq (car decl-context) 'same)
1369 (< bo-decl start))
1370 ;; Are we genuinely at a type?
1371 (setq type-type (c-forward-type t))
1372 (if (and type-type
1373 (or (not (eq type-type 'maybe))
1374 (looking-at c-symbol-key)))
1375 (c-font-lock-declarators limit t in-typedef)))
1376
1377 ;; Secondly, are we in any nested struct/union/class/etc. braces?
1378 (while paren-state
1379 (setq ps-elt (car paren-state)
1380 paren-state (cdr paren-state))
1381 (when (and (atom ps-elt)
1382 (eq (char-after ps-elt) ?\{))
1383 (goto-char ps-elt)
1384 (setq decl-context (c-beginning-of-decl-1)
1385 in-typedef (looking-at c-typedef-key))
1386 (if in-typedef (c-forward-token-2))
1387 (when (looking-at c-opt-block-decls-with-vars-key)
1388 (goto-char ps-elt)
1389 (when (c-safe (c-forward-sexp))
1390 (c-forward-syntactic-ws)
1391 (c-font-lock-declarators limit t in-typedef)))))))
1392
1349(c-lang-defconst c-simple-decl-matchers 1393(c-lang-defconst c-simple-decl-matchers
1350 "Simple font lock matchers for types and declarations. These are used 1394 "Simple font lock matchers for types and declarations. These are used
1351on level 2 only and so aren't combined with `c-complex-decl-matchers'." 1395on level 2 only and so aren't combined with `c-complex-decl-matchers'."
@@ -1452,6 +1496,9 @@ on level 2 only and so aren't combined with `c-complex-decl-matchers'."
1452 ;; Fontify all declarations, casts and normal labels. 1496 ;; Fontify all declarations, casts and normal labels.
1453 c-font-lock-declarations 1497 c-font-lock-declarations
1454 1498
1499 ;; Fontify declarators when POINT is within their declaration.
1500 c-font-lock-enclosing-decls
1501
1455 ;; Fontify angle bracket arglists like templates in C++. 1502 ;; Fontify angle bracket arglists like templates in C++.
1456 ,@(when (c-lang-const c-recognize-<>-arglists) 1503 ,@(when (c-lang-const c-recognize-<>-arglists)
1457 `(c-font-lock-<>-arglists)) 1504 `(c-font-lock-<>-arglists))
diff --git a/lisp/progmodes/cc-langs.el b/lisp/progmodes/cc-langs.el
index a6459e1724f..9ce23a080d6 100644
--- a/lisp/progmodes/cc-langs.el
+++ b/lisp/progmodes/cc-langs.el
@@ -523,7 +523,7 @@ operator at the top level."
523 523
524(c-lang-defconst c-symbol-chars 524(c-lang-defconst c-symbol-chars
525 "Set of characters that can be part of a symbol. 525 "Set of characters that can be part of a symbol.
526This is on the form that fits inside [ ] in a regexp." 526This is of the form that fits inside [ ] in a regexp."
527 ;; Pike note: With the backquote identifiers this would include most 527 ;; Pike note: With the backquote identifiers this would include most
528 ;; operator chars too, but they are handled with other means instead. 528 ;; operator chars too, but they are handled with other means instead.
529 t (concat c-alnum "_$") 529 t (concat c-alnum "_$")
diff --git a/lisp/xwidget.el b/lisp/xwidget.el
index 93dafea7df9..c4482311543 100644
--- a/lisp/xwidget.el
+++ b/lisp/xwidget.el
@@ -72,6 +72,7 @@ defaults to the string looking like a url around the cursor position."
72 (let ((map (make-sparse-keymap))) 72 (let ((map (make-sparse-keymap)))
73 (define-key map "g" 'xwidget-webkit-browse-url) 73 (define-key map "g" 'xwidget-webkit-browse-url)
74 (define-key map "a" 'xwidget-webkit-adjust-size-to-content) 74 (define-key map "a" 'xwidget-webkit-adjust-size-to-content)
75 (define-key map "b" 'xwidget-webkit-back )
75 (define-key map "\C-m" 'xwidget-webkit-insert-string) 76 (define-key map "\C-m" 'xwidget-webkit-insert-string)
76 map) 77 map)
77 78
@@ -126,6 +127,11 @@ defaults to the string looking like a url around the cursor position."
126 (xwidget-webkit-goto-uri ( xwidget-webkit-last-session) url) 127 (xwidget-webkit-goto-uri ( xwidget-webkit-last-session) url)
127 ( xwidget-webkit-new-session url))) 128 ( xwidget-webkit-new-session url)))
128 129
130(defun xwidget-webkit-back ()
131 (interactive)
132 (xwidget-webkit-execute-script ( xwidget-webkit-last-session) "history.go(-1);")
133 )
134
129 135
130;; use declare here? 136;; use declare here?
131;; (declare-function xwidget-resize-internal "xwidget.c" ) 137;; (declare-function xwidget-resize-internal "xwidget.c" )
diff --git a/src/ChangeLog b/src/ChangeLog
index c06c98c5418..484a4420363 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,25 @@
12011-07-18 Paul Eggert <eggert@cs.ucla.edu>
2
3 * fileio.c (Fcopy_file) [!MSDOS]: Tighten created file's mask.
4 This fixes some race conditions on the permissions of any newly
5 created file.
6
7 * alloc.c (valid_pointer_p): Use pipe, not open.
8 This fixes some permissions issues when debugging.
9
10 * fileio.c (Fcopy_file): Adjust mode if fchown fails. (Bug#9002)
11 If fchown fails to set both uid and gid, try to set just gid,
12 as that is sometimes allowed. Adjust the file's mode to eliminate
13 setuid or setgid bits that are inappropriate if fchown fails.
14
152011-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
16
17 * xdisp.c (next_element_from_string, next_element_from_buffer): Use EQ
18 to compare Lisp_Objects.
19 * gnutls.c (syms_of_gnutls): Rename Vgnutls_log_level to
20 global_gnutls_log_level, don't mistake it for a Lisp_Object.
21 (init_gnutls_functions, emacs_gnutls_handle_error): Fix up uses.
22
12011-07-17 Andreas Schwab <schwab@linux-m68k.org> 232011-07-17 Andreas Schwab <schwab@linux-m68k.org>
2 24
3 * lread.c (read_integer): Unread even EOF character. 25 * lread.c (read_integer): Unread even EOF character.
diff --git a/src/alloc.c b/src/alloc.c
index 44f935c243d..d48d1f34dbd 100644
--- a/src/alloc.c
+++ b/src/alloc.c
@@ -4415,18 +4415,18 @@ valid_pointer_p (void *p)
4415#ifdef WINDOWSNT 4415#ifdef WINDOWSNT
4416 return w32_valid_pointer_p (p, 16); 4416 return w32_valid_pointer_p (p, 16);
4417#else 4417#else
4418 int fd; 4418 int fd[2];
4419 4419
4420 /* Obviously, we cannot just access it (we would SEGV trying), so we 4420 /* Obviously, we cannot just access it (we would SEGV trying), so we
4421 trick the o/s to tell us whether p is a valid pointer. 4421 trick the o/s to tell us whether p is a valid pointer.
4422 Unfortunately, we cannot use NULL_DEVICE here, as emacs_write may 4422 Unfortunately, we cannot use NULL_DEVICE here, as emacs_write may
4423 not validate p in that case. */ 4423 not validate p in that case. */
4424 4424
4425 if ((fd = emacs_open ("__Valid__Lisp__Object__", O_CREAT | O_WRONLY | O_TRUNC, 0666)) >= 0) 4425 if (pipe (fd) == 0)
4426 { 4426 {
4427 int valid = (emacs_write (fd, (char *)p, 16) == 16); 4427 int valid = (emacs_write (fd[1], (char *) p, 16) == 16);
4428 emacs_close (fd); 4428 emacs_close (fd[1]);
4429 unlink ("__Valid__Lisp__Object__"); 4429 emacs_close (fd[0]);
4430 return valid; 4430 return valid;
4431 } 4431 }
4432 4432
diff --git a/src/fileio.c b/src/fileio.c
index a52e834c2b2..3e1aa54462f 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -38,8 +38,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
38#include <selinux/context.h> 38#include <selinux/context.h>
39#endif 39#endif
40 40
41#include <ignore-value.h>
42
43#include "lisp.h" 41#include "lisp.h"
44#include "intervals.h" 42#include "intervals.h"
45#include "buffer.h" 43#include "buffer.h"
@@ -1939,10 +1937,19 @@ on the system, we copy the SELinux context of FILE to NEWNAME. */)
1939 | (NILP (ok_if_already_exists) ? O_EXCL : 0), 1937 | (NILP (ok_if_already_exists) ? O_EXCL : 0),
1940 S_IREAD | S_IWRITE); 1938 S_IREAD | S_IWRITE);
1941#else /* not MSDOS */ 1939#else /* not MSDOS */
1942 ofd = emacs_open (SSDATA (encoded_newname), 1940 {
1943 O_WRONLY | O_TRUNC | O_CREAT 1941 int new_mask = 0666;
1944 | (NILP (ok_if_already_exists) ? O_EXCL : 0), 1942 if (input_file_statable_p)
1945 0666); 1943 {
1944 if (!NILP (preserve_uid_gid))
1945 new_mask = 0600;
1946 new_mask &= st.st_mode;
1947 }
1948 ofd = emacs_open (SSDATA (encoded_newname),
1949 (O_WRONLY | O_TRUNC | O_CREAT
1950 | (NILP (ok_if_already_exists) ? O_EXCL : 0)),
1951 new_mask);
1952 }
1946#endif /* not MSDOS */ 1953#endif /* not MSDOS */
1947 if (ofd < 0) 1954 if (ofd < 0)
1948 report_file_error ("Opening output file", Fcons (newname, Qnil)); 1955 report_file_error ("Opening output file", Fcons (newname, Qnil));
@@ -1961,9 +1968,21 @@ on the system, we copy the SELinux context of FILE to NEWNAME. */)
1961 owner and group. */ 1968 owner and group. */
1962 if (input_file_statable_p) 1969 if (input_file_statable_p)
1963 { 1970 {
1971 int mode_mask = 07777;
1964 if (!NILP (preserve_uid_gid)) 1972 if (!NILP (preserve_uid_gid))
1965 ignore_value (fchown (ofd, st.st_uid, st.st_gid)); 1973 {
1966 if (fchmod (ofd, st.st_mode & 07777) != 0) 1974 /* Attempt to change owner and group. If that doesn't work
1975 attempt to change just the group, as that is sometimes allowed.
1976 Adjust the mode mask to eliminate setuid or setgid bits
1977 that are inappropriate if the owner and group are wrong. */
1978 if (fchown (ofd, st.st_uid, st.st_gid) != 0)
1979 {
1980 mode_mask &= ~06000;
1981 if (fchown (ofd, -1, st.st_gid) == 0)
1982 mode_mask |= 02000;
1983 }
1984 }
1985 if (fchmod (ofd, st.st_mode & mode_mask) != 0)
1967 report_file_error ("Doing chmod", Fcons (newname, Qnil)); 1986 report_file_error ("Doing chmod", Fcons (newname, Qnil));
1968 } 1987 }
1969#endif /* not MSDOS */ 1988#endif /* not MSDOS */
diff --git a/src/gnutls.c b/src/gnutls.c
index 52e80a69ae5..3175f55041d 100644
--- a/src/gnutls.c
+++ b/src/gnutls.c
@@ -193,8 +193,7 @@ init_gnutls_functions (Lisp_Object libraries)
193 LOAD_GNUTLS_FN (library, gnutls_x509_crt_import); 193 LOAD_GNUTLS_FN (library, gnutls_x509_crt_import);
194 LOAD_GNUTLS_FN (library, gnutls_x509_crt_init); 194 LOAD_GNUTLS_FN (library, gnutls_x509_crt_init);
195 195
196 if (NUMBERP (Vgnutls_log_level)) 196 max_log_level = global_gnutls_log_level;
197 max_log_level = XINT (Vgnutls_log_level);
198 197
199 GNUTLS_LOG2 (1, max_log_level, "GnuTLS library loaded:", 198 GNUTLS_LOG2 (1, max_log_level, "GnuTLS library loaded:",
200 SDATA (Fget (Qgnutls_dll, QCloaded_from))); 199 SDATA (Fget (Qgnutls_dll, QCloaded_from)));
@@ -406,8 +405,7 @@ emacs_gnutls_handle_error (gnutls_session_t session, int err)
406 if (err >= 0) 405 if (err >= 0)
407 return 0; 406 return 0;
408 407
409 if (NUMBERP (Vgnutls_log_level)) 408 max_log_level = global_gnutls_log_level;
410 max_log_level = XINT (Vgnutls_log_level);
411 409
412 /* TODO: use gnutls-error-fatalp and gnutls-error-string. */ 410 /* TODO: use gnutls-error-fatalp and gnutls-error-string. */
413 411
@@ -1155,9 +1153,9 @@ syms_of_gnutls (void)
1155 defsubr (&Sgnutls_bye); 1153 defsubr (&Sgnutls_bye);
1156 defsubr (&Sgnutls_available_p); 1154 defsubr (&Sgnutls_available_p);
1157 1155
1158 DEFVAR_INT ("gnutls-log-level", Vgnutls_log_level, 1156 DEFVAR_INT ("gnutls-log-level", global_gnutls_log_level,
1159 doc: /* Logging level used by the GnuTLS functions. */); 1157 doc: /* Logging level used by the GnuTLS functions. */);
1160 Vgnutls_log_level = make_number (0); 1158 global_gnutls_log_level = 0;
1161} 1159}
1162 1160
1163#endif /* HAVE_GNUTLS */ 1161#endif /* HAVE_GNUTLS */
diff --git a/src/process.h b/src/process.h
index 4866a8c1022..aff9e970f63 100644
--- a/src/process.h
+++ b/src/process.h
@@ -141,7 +141,7 @@ struct Lisp_Process
141/* Every field in the preceding structure except for the first two 141/* Every field in the preceding structure except for the first two
142 must be a Lisp_Object, for GC's sake. */ 142 must be a Lisp_Object, for GC's sake. */
143 143
144#define ChannelMask(n) (1<<(n)) 144#define ChannelMask(n) (1 << (n))
145 145
146/* True if we are about to fork off a synchronous process or if we 146/* True if we are about to fork off a synchronous process or if we
147 are waiting for it. */ 147 are waiting for it. */
diff --git a/src/xdisp.c b/src/xdisp.c
index cd87d00d8d0..816c7d36ce3 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -6968,7 +6968,7 @@ next_element_from_string (struct it *it)
6968 struct text_pos position; 6968 struct text_pos position;
6969 6969
6970 xassert (STRINGP (it->string)); 6970 xassert (STRINGP (it->string));
6971 xassert (!it->bidi_p || it->string == it->bidi_it.string.lstring); 6971 xassert (!it->bidi_p || EQ (it->string, it->bidi_it.string.lstring));
6972 xassert (IT_STRING_CHARPOS (*it) >= 0); 6972 xassert (IT_STRING_CHARPOS (*it) >= 0);
6973 position = it->current.string_pos; 6973 position = it->current.string_pos;
6974 6974
@@ -7294,7 +7294,7 @@ next_element_from_buffer (struct it *it)
7294 xassert (IT_CHARPOS (*it) >= BEGV); 7294 xassert (IT_CHARPOS (*it) >= BEGV);
7295 xassert (NILP (it->string) && !it->s); 7295 xassert (NILP (it->string) && !it->s);
7296 xassert (!it->bidi_p 7296 xassert (!it->bidi_p
7297 || (it->bidi_it.string.lstring == Qnil 7297 || (EQ (it->bidi_it.string.lstring, Qnil)
7298 && it->bidi_it.string.s == NULL)); 7298 && it->bidi_it.string.s == NULL));
7299 7299
7300 /* With bidi reordering, the character to display might not be the 7300 /* With bidi reordering, the character to display might not be the