aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEli Zaretskii2010-01-08 15:59:09 -0500
committerEli Zaretskii2010-01-08 15:59:09 -0500
commitf14e303adcecf25fa1f116c4040de08a9ed6231b (patch)
treefb366e58925d597963b4d1a89b6267d2047794f0
parent4dad464f19edf1b77ce23d27baec0e06960a4865 (diff)
parent5075d8535904317a9dff2ff3eebbc7540cc587c0 (diff)
downloademacs-f14e303adcecf25fa1f116c4040de08a9ed6231b.tar.gz
emacs-f14e303adcecf25fa1f116c4040de08a9ed6231b.zip
Merge from mainline.
-rw-r--r--doc/lispref/ChangeLog26
-rw-r--r--doc/lispref/control.texi7
-rw-r--r--doc/lispref/display.texi3
-rw-r--r--doc/lispref/modes.texi4
-rw-r--r--doc/lispref/nonascii.texi54
-rw-r--r--doc/lispref/os.texi2
-rw-r--r--doc/lispref/positions.texi12
-rw-r--r--doc/lispref/text.texi13
-rw-r--r--doc/lispref/variables.texi3
-rw-r--r--doc/misc/ChangeLog12
-rw-r--r--doc/misc/calc.texi2
-rwxr-xr-xdoc/misc/eieio.texi12
-rw-r--r--doc/misc/gnus.texi5
-rw-r--r--lisp/ChangeLog107
-rw-r--r--lisp/bookmark.el190
-rw-r--r--lisp/emacs-lisp/easy-mmode.el8
-rw-r--r--lisp/font-setting.el2
-rw-r--r--lisp/gnus/ChangeLog27
-rw-r--r--lisp/gnus/gnus-art.el9
-rw-r--r--lisp/gnus/gnus-sum.el35
-rw-r--r--lisp/gnus/gnus-util.el23
-rw-r--r--lisp/gnus/message.el6
-rw-r--r--lisp/international/fontset.el6
-rw-r--r--lisp/language/indian.el6
-rw-r--r--lisp/net/browse-url.el12
-rw-r--r--lisp/net/rcirc.el1
-rw-r--r--lisp/progmodes/octave-mod.el28
-rw-r--r--lisp/progmodes/python.el6
-rw-r--r--lisp/vc-bzr.el59
-rw-r--r--lisp/vc-dir.el6
-rw-r--r--src/ChangeLog69
-rw-r--r--src/dbusbind.c23
-rw-r--r--src/dispnew.c5
-rw-r--r--src/font.c37
-rw-r--r--src/font.h8
-rw-r--r--src/fontset.c4
-rw-r--r--src/gtkutil.c75
-rw-r--r--src/keyboard.c8
-rw-r--r--src/nsfns.m50
-rw-r--r--src/xftfont.c143
-rw-r--r--src/xterm.c59
41 files changed, 826 insertions, 341 deletions
diff --git a/doc/lispref/ChangeLog b/doc/lispref/ChangeLog
index 0f4abc7a984..6dfc203f638 100644
--- a/doc/lispref/ChangeLog
+++ b/doc/lispref/ChangeLog
@@ -1,3 +1,27 @@
12010-01-04 Stefan Monnier <monnier@iro.umontreal.ca>
2
3 Avoid dubious uses of save-excursions.
4 * positions.texi (Excursions): Recommend the use of
5 save-current-buffer if applicable.
6 * text.texi (Clickable Text): Fix the example code which used
7 save-excursion in a naive way which sometimes preserves point and
8 sometimes not.
9 * variables.texi (Creating Buffer-Local):
10 * os.texi (Session Management):
11 * display.texi (GIF Images):
12 * control.texi (Cleanups): Use (save|with)-current-buffer.
13
142010-01-02 Eli Zaretskii <eliz@gnu.org>
15
16 * modes.texi (Example Major Modes): Fix indentation. (Bug#5195)
17
182010-01-02 Chong Yidong <cyd@stupidchicken.com>
19
20 * nonascii.texi (Text Representations, Character Codes)
21 (Converting Representations, Explicit Encoding)
22 (Translation of Characters): Use hex notation consistently.
23 (Character Sets): Fix map-charset-chars doc (Bug#5197).
24
12010-01-01 Chong Yidong <cyd@stupidchicken.com> 252010-01-01 Chong Yidong <cyd@stupidchicken.com>
2 26
3 * loading.texi (Where Defined): Make it clearer that these are 27 * loading.texi (Where Defined): Make it clearer that these are
@@ -8364,7 +8388,7 @@
8364;; End: 8388;; End:
8365 8389
8366 Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 8390 Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
8367 2007, 2008, 2009 Free Software Foundation, Inc. 8391 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
8368 8392
8369 This file is part of GNU Emacs. 8393 This file is part of GNU Emacs.
8370 8394
diff --git a/doc/lispref/control.texi b/doc/lispref/control.texi
index 41f844b4e21..6d7c01d354b 100644
--- a/doc/lispref/control.texi
+++ b/doc/lispref/control.texi
@@ -1255,9 +1255,8 @@ make sure to kill it before finishing:
1255 1255
1256@smallexample 1256@smallexample
1257@group 1257@group
1258(save-excursion 1258(let ((buffer (get-buffer-create " *temp*")))
1259 (let ((buffer (get-buffer-create " *temp*"))) 1259 (with-current-buffer buffer
1260 (set-buffer buffer)
1261 (unwind-protect 1260 (unwind-protect
1262 @var{body-form} 1261 @var{body-form}
1263 (kill-buffer buffer)))) 1262 (kill-buffer buffer))))
@@ -1269,7 +1268,7 @@ You might think that we could just as well write @code{(kill-buffer
1269(current-buffer))} and dispense with the variable @code{buffer}. 1268(current-buffer))} and dispense with the variable @code{buffer}.
1270However, the way shown above is safer, if @var{body-form} happens to 1269However, the way shown above is safer, if @var{body-form} happens to
1271get an error after switching to a different buffer! (Alternatively, 1270get an error after switching to a different buffer! (Alternatively,
1272you could write another @code{save-excursion} around @var{body-form}, 1271you could write a @code{save-current-buffer} around @var{body-form},
1273to ensure that the temporary buffer becomes current again in time to 1272to ensure that the temporary buffer becomes current again in time to
1274kill it.) 1273kill it.)
1275 1274
diff --git a/doc/lispref/display.texi b/doc/lispref/display.texi
index 8feb8ea8c81..512d7d53019 100644
--- a/doc/lispref/display.texi
+++ b/doc/lispref/display.texi
@@ -4394,8 +4394,7 @@ every 0.1 seconds.
4394 (when (= idx max) 4394 (when (= idx max)
4395 (setq idx 0)) 4395 (setq idx 0))
4396 (let ((img (create-image file nil :image idx))) 4396 (let ((img (create-image file nil :image idx)))
4397 (save-excursion 4397 (with-current-buffer buffer
4398 (set-buffer buffer)
4399 (goto-char (point-min)) 4398 (goto-char (point-min))
4400 (unless first-time (delete-char 1)) 4399 (unless first-time (delete-char 1))
4401 (insert-image img)) 4400 (insert-image img))
diff --git a/doc/lispref/modes.texi b/doc/lispref/modes.texi
index 1e7ef76ed55..c78ced0d67b 100644
--- a/doc/lispref/modes.texi
+++ b/doc/lispref/modes.texi
@@ -1062,8 +1062,8 @@ correspondingly more complicated. Here are excerpts from
1062 ;; @r{part of symbol names but not words.} 1062 ;; @r{part of symbol names but not words.}
1063 ;; @r{(The digit @samp{0} is @code{48} in the @acronym{ASCII} character set.)} 1063 ;; @r{(The digit @samp{0} is @code{48} in the @acronym{ASCII} character set.)}
1064 (while (< i ?0) 1064 (while (< i ?0)
1065 (modify-syntax-entry i "_ " table) 1065 (modify-syntax-entry i "_ " table)
1066 (setq i (1+ i))) 1066 (setq i (1+ i)))
1067 ;; @r{@dots{} similar code follows for other character ranges.} 1067 ;; @r{@dots{} similar code follows for other character ranges.}
1068@end group 1068@end group
1069@group 1069@group
diff --git a/doc/lispref/nonascii.texi b/doc/lispref/nonascii.texi
index d3bbc2c114f..59f790c90da 100644
--- a/doc/lispref/nonascii.texi
+++ b/doc/lispref/nonascii.texi
@@ -46,12 +46,12 @@ in most any known written language.
46follows the @dfn{Unicode Standard}. The Unicode Standard assigns a 46follows the @dfn{Unicode Standard}. The Unicode Standard assigns a
47unique number, called a @dfn{codepoint}, to each and every character. 47unique number, called a @dfn{codepoint}, to each and every character.
48The range of codepoints defined by Unicode, or the Unicode 48The range of codepoints defined by Unicode, or the Unicode
49@dfn{codespace}, is @code{0..10FFFF} (in hex), inclusive. Emacs 49@dfn{codespace}, is @code{0..#x10FFFF} (in hexadecimal notation),
50extends this range with codepoints in the range @code{110000..3FFFFF}, 50inclusive. Emacs extends this range with codepoints in the range
51which it uses for representing characters that are not unified with 51@code{#x110000..#x3FFFFF}, which it uses for representing characters
52Unicode and raw 8-bit bytes that cannot be interpreted as characters 52that are not unified with Unicode and @dfn{raw 8-bit bytes} that
53(the latter occupy the range @code{3FFF80..3FFFFF}). Thus, a 53cannot be interpreted as characters. Thus, a character codepoint in
54character codepoint in Emacs is a 22-bit integer number. 54Emacs is a 22-bit integer number.
55 55
56@cindex internal representation of characters 56@cindex internal representation of characters
57@cindex characters, representation in buffers and strings 57@cindex characters, representation in buffers and strings
@@ -189,8 +189,8 @@ of characters as @var{string}. If @var{string} is a multibyte string,
189it is returned unchanged. The function assumes that @var{string} 189it is returned unchanged. The function assumes that @var{string}
190includes only @acronym{ASCII} characters and raw 8-bit bytes; the 190includes only @acronym{ASCII} characters and raw 8-bit bytes; the
191latter are converted to their multibyte representation corresponding 191latter are converted to their multibyte representation corresponding
192to the codepoints in the @code{3FFF80..3FFFFF} area (@pxref{Text 192to the codepoints @code{#x3FFF80} through @code{#x3FFFFF}, inclusive
193Representations, codepoints}). 193(@pxref{Text Representations, codepoints}).
194@end defun 194@end defun
195 195
196@defun string-to-unibyte string 196@defun string-to-unibyte string
@@ -271,15 +271,19 @@ contains no text properties.
271 271
272 The unibyte and multibyte text representations use different 272 The unibyte and multibyte text representations use different
273character codes. The valid character codes for unibyte representation 273character codes. The valid character codes for unibyte representation
274range from 0 to 255---the values that can fit in one byte. The valid 274range from 0 to @code{#xFF} (255)---the values that can fit in one
275character codes for multibyte representation range from 0 to 4194303 275byte. The valid character codes for multibyte representation range
276(#x3FFFFF). In this code space, values 0 through 127 are for 276from 0 to @code{#x3FFFFF}. In this code space, values 0 through
277@acronym{ASCII} characters, and values 128 through 4194175 (#x3FFF7F) 277@code{#x7F} (127) are for @acronym{ASCII} characters, and values
278are for non-@acronym{ASCII} characters. Values 0 through 1114111 278@code{#x80} (128) through @code{#x3FFF7F} (4194175) are for
279(#10FFFF) correspond to Unicode characters of the same codepoint; 279non-@acronym{ASCII} characters.
280values 1114112 (#110000) through 4194175 (#x3FFF7F) represent 280
281characters that are not unified with Unicode; and values 4194176 281 Emacs character codes are a superset of the Unicode standard.
282(#x3FFF80) through 4194303 (#x3FFFFF) represent eight-bit raw bytes. 282Values 0 through @code{#x10FFFF} (1114111) correspond to Unicode
283characters of the same codepoint; values @code{#x110000} (1114112)
284through @code{#x3FFF7F} (4194175) represent characters that are not
285unified with Unicode; and values @code{#x3FFF80} (4194176) through
286@code{#x3FFFFF} (4194303) represent eight-bit raw bytes.
283 287
284@defun characterp charcode 288@defun characterp charcode
285This returns @code{t} if @var{charcode} is a valid character, and 289This returns @code{t} if @var{charcode} is a valid character, and
@@ -540,7 +544,7 @@ and strings.
540@cindex @code{eight-bit}, a charset 544@cindex @code{eight-bit}, a charset
541 Emacs defines several special character sets. The character set 545 Emacs defines several special character sets. The character set
542@code{unicode} includes all the characters whose Emacs code points are 546@code{unicode} includes all the characters whose Emacs code points are
543in the range @code{0..10FFFF}. The character set @code{emacs} 547in the range @code{0..#x10FFFF}. The character set @code{emacs}
544includes all @acronym{ASCII} and non-@acronym{ASCII} characters. 548includes all @acronym{ASCII} and non-@acronym{ASCII} characters.
545Finally, the @code{eight-bit} charset includes the 8-bit raw bytes; 549Finally, the @code{eight-bit} charset includes the 8-bit raw bytes;
546Emacs uses it to represent raw bytes encountered in text. 550Emacs uses it to represent raw bytes encountered in text.
@@ -628,12 +632,12 @@ that fits the second argument of @code{decode-char} above. If
628 The following function comes in handy for applying a certain 632 The following function comes in handy for applying a certain
629function to all or part of the characters in a charset: 633function to all or part of the characters in a charset:
630 634
631@defun map-charset-chars function charset &optional arg from to 635@defun map-charset-chars function charset &optional arg from-code to-code
632Call @var{function} for characters in @var{charset}. @var{function} 636Call @var{function} for characters in @var{charset}. @var{function}
633is called with two arguments. The first one is a cons cell 637is called with two arguments. The first one is a cons cell
634@code{(@var{from} . @var{to})}, where @var{from} and @var{to} 638@code{(@var{from} . @var{to})}, where @var{from} and @var{to}
635indicate a range of characters contained in charset. The second 639indicate a range of characters contained in charset. The second
636argument is the optional argument @var{arg}. 640argument passed to @var{function} is @var{arg}.
637 641
638By default, the range of codepoints passed to @var{function} includes 642By default, the range of codepoints passed to @var{function} includes
639all the characters in @var{charset}, but optional arguments 643all the characters in @var{charset}, but optional arguments
@@ -751,7 +755,7 @@ This variable automatically becomes buffer-local when set.
751 755
752@defun make-translation-table-from-vector vec 756@defun make-translation-table-from-vector vec
753This function returns a translation table made from @var{vec} that is 757This function returns a translation table made from @var{vec} that is
754an array of 256 elements to map byte values 0 through 255 to 758an array of 256 elements to map bytes (values 0 through #xFF) to
755characters. Elements may be @code{nil} for untranslated bytes. The 759characters. Elements may be @code{nil} for untranslated bytes. The
756returned table has a translation table for reverse mapping in the 760returned table has a translation table for reverse mapping in the
757first extra slot, and the value @code{1} in the second extra slot. 761first extra slot, and the value @code{1} in the second extra slot.
@@ -1562,10 +1566,10 @@ in this section.
1562text. They logically consist of a series of byte values; that is, a 1566text. They logically consist of a series of byte values; that is, a
1563series of @acronym{ASCII} and eight-bit characters. In unibyte 1567series of @acronym{ASCII} and eight-bit characters. In unibyte
1564buffers and strings, these characters have codes in the range 0 1568buffers and strings, these characters have codes in the range 0
1565through 255. In a multibyte buffer or string, eight-bit characters 1569through #xFF (255). In a multibyte buffer or string, eight-bit
1566have character codes higher than 255 (@pxref{Text Representations}), 1570characters have character codes higher than #xFF (@pxref{Text
1567but Emacs transparently converts them to their single-byte values when 1571Representations}), but Emacs transparently converts them to their
1568you encode or decode such text. 1572single-byte values when you encode or decode such text.
1569 1573
1570 The usual way to read a file into a buffer as a sequence of bytes, so 1574 The usual way to read a file into a buffer as a sequence of bytes, so
1571you can decode the contents explicitly, is with 1575you can decode the contents explicitly, is with
diff --git a/doc/lispref/os.texi b/doc/lispref/os.texi
index ded70f4927b..8d62ab87499 100644
--- a/doc/lispref/os.texi
+++ b/doc/lispref/os.texi
@@ -2182,7 +2182,7 @@ Emacs is restarted by the session manager.
2182 2182
2183@group 2183@group
2184(defun save-yourself-test () 2184(defun save-yourself-test ()
2185 (insert "(save-excursion 2185 (insert "(save-current-buffer
2186 (switch-to-buffer \"*scratch*\") 2186 (switch-to-buffer \"*scratch*\")
2187 (insert \"I am restored\"))") 2187 (insert \"I am restored\"))")
2188 nil) 2188 nil)
diff --git a/doc/lispref/positions.texi b/doc/lispref/positions.texi
index deded596f81..3897efc6f2b 100644
--- a/doc/lispref/positions.texi
+++ b/doc/lispref/positions.texi
@@ -806,7 +806,9 @@ after the completion of the excursion.
806 806
807 The forms for saving and restoring the configuration of windows are 807 The forms for saving and restoring the configuration of windows are
808described elsewhere (see @ref{Window Configurations}, and @pxref{Frame 808described elsewhere (see @ref{Window Configurations}, and @pxref{Frame
809Configurations}). 809Configurations}). When only the identity of the current buffer needs
810to be saved and restored, it is preferable to use
811@code{save-current-buffer} instead.
810 812
811@defspec save-excursion body@dots{} 813@defspec save-excursion body@dots{}
812@cindex mark excursion 814@cindex mark excursion
@@ -817,10 +819,10 @@ buffer and the values of point and the mark in it, evaluates
817point and the mark. All three saved values are restored even in case of 819point and the mark. All three saved values are restored even in case of
818an abnormal exit via @code{throw} or error (@pxref{Nonlocal Exits}). 820an abnormal exit via @code{throw} or error (@pxref{Nonlocal Exits}).
819 821
820The @code{save-excursion} special form is the standard way to switch 822The @code{save-excursion} special form is the standard way to move
821buffers or move point within one part of a program and avoid affecting 823point within one part of a program and avoid affecting the rest of the
822the rest of the program. It is used more than 4000 times in the Lisp 824program. It is used more than 4000 times in the Lisp sources
823sources of Emacs. 825of Emacs.
824 826
825@code{save-excursion} does not save the values of point and the mark for 827@code{save-excursion} does not save the values of point and the mark for
826other buffers, so changes in other buffers remain in effect after 828other buffers, so changes in other buffers remain in effect after
diff --git a/doc/lispref/text.texi b/doc/lispref/text.texi
index 91b65017754..7c3f91c3fa8 100644
--- a/doc/lispref/text.texi
+++ b/doc/lispref/text.texi
@@ -3524,13 +3524,12 @@ following command:
3524(defun dired-mouse-find-file-other-window (event) 3524(defun dired-mouse-find-file-other-window (event)
3525 "In Dired, visit the file or directory name you click on." 3525 "In Dired, visit the file or directory name you click on."
3526 (interactive "e") 3526 (interactive "e")
3527 (let (window pos file) 3527 (let ((window (posn-window (event-end event)))
3528 (save-excursion 3528 (pos (posn-point (event-end event)))
3529 (setq window (posn-window (event-end event)) 3529 file)
3530 pos (posn-point (event-end event))) 3530 (if (not (windowp window))
3531 (if (not (windowp window)) 3531 (error "No file chosen"))
3532 (error "No file chosen")) 3532 (with-current-buffer (window-buffer window)
3533 (set-buffer (window-buffer window))
3534 (goto-char pos) 3533 (goto-char pos)
3535 (setq file (dired-get-file-for-visit))) 3534 (setq file (dired-get-file-for-visit)))
3536 (if (file-directory-p file) 3535 (if (file-directory-p file)
diff --git a/doc/lispref/variables.texi b/doc/lispref/variables.texi
index 4f9f9c17369..d8ab347eebf 100644
--- a/doc/lispref/variables.texi
+++ b/doc/lispref/variables.texi
@@ -1240,8 +1240,7 @@ foo
1240 1240
1241@group 1241@group
1242;; @r{In buffer @samp{b2}, the value hasn't changed.} 1242;; @r{In buffer @samp{b2}, the value hasn't changed.}
1243(save-excursion 1243(with-current-buffer "b2"
1244 (set-buffer "b2")
1245 foo) 1244 foo)
1246 @result{} 5 1245 @result{} 5
1247@end group 1246@end group
diff --git a/doc/misc/ChangeLog b/doc/misc/ChangeLog
index 75561a0ba21..cabec8f7fb1 100644
--- a/doc/misc/ChangeLog
+++ b/doc/misc/ChangeLog
@@ -1,3 +1,13 @@
12010-01-04 Stefan Monnier <monnier@iro.umontreal.ca>
2
3 * gnus.texi (Posting Styles): Use with-current-buffer.
4 * calc.texi (Defining Simple Commands): Prefer save-current-buffer.
5
62010-01-02 Kevin Ryde <user42@zip.com.au>
7
8 * eieio.texi (Naming Conventions): Correction to xref on elisp
9 coding conventions, is "Tips" node not "Standards".
10
12009-12-24 Chong Yidong <cyd@stupidchicken.com> 112009-12-24 Chong Yidong <cyd@stupidchicken.com>
2 12
3 * calc.texi (General Mode Commands): Calc file should be in .emacs.d. 13 * calc.texi (General Mode Commands): Calc file should be in .emacs.d.
@@ -6507,7 +6517,7 @@
6507;; End: 6517;; End:
6508 6518
6509 Copyright (C) 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2001, 2002, 6519 Copyright (C) 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2001, 2002,
6510 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc. 6520 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
6511 6521
6512 This file is part of GNU Emacs. 6522 This file is part of GNU Emacs.
6513 6523
diff --git a/doc/misc/calc.texi b/doc/misc/calc.texi
index c88bb3e9ab8..e7c03197704 100644
--- a/doc/misc/calc.texi
+++ b/doc/misc/calc.texi
@@ -31968,7 +31968,7 @@ the function with code that looks roughly like this:
31968@smallexample 31968@smallexample
31969(let ((calc-command-flags nil)) 31969(let ((calc-command-flags nil))
31970 (unwind-protect 31970 (unwind-protect
31971 (save-excursion 31971 (save-current-buffer
31972 (calc-select-buffer) 31972 (calc-select-buffer)
31973 @emph{body of function} 31973 @emph{body of function}
31974 @emph{renumber stack} 31974 @emph{renumber stack}
diff --git a/doc/misc/eieio.texi b/doc/misc/eieio.texi
index c8a34bbd160..06ff1677f0f 100755
--- a/doc/misc/eieio.texi
+++ b/doc/misc/eieio.texi
@@ -11,7 +11,7 @@
11@copying 11@copying
12This manual documents EIEIO, an object framework for Emacs Lisp. 12This manual documents EIEIO, an object framework for Emacs Lisp.
13 13
14Copyright @copyright{} 2007, 2008, 2009 Free Software Foundation, Inc. 14Copyright @copyright{} 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
15 15
16@quotation 16@quotation
17Permission is granted to copy, distribute and/or modify this document 17Permission is granted to copy, distribute and/or modify this document
@@ -1776,11 +1776,11 @@ This signal is called when an attempt to reference @var{slot} in
1776@comment node-name, next, previous, up 1776@comment node-name, next, previous, up
1777@chapter Naming Conventions 1777@chapter Naming Conventions
1778 1778
1779@pxref{Standards,,,elisp,GNU Emacs Lisp Reference Manual}, for a 1779@xref{Tips,,Tips and Conventions,elisp,GNU Emacs Lisp Reference
1780description of Emacs Lisp programming conventions. These conventions 1780Manual}, for a description of Emacs Lisp programming conventions.
1781help ensure that Emacs packages work nicely one another, so an 1781These conventions help ensure that Emacs packages work nicely one
1782@eieio{}-based program should follow them. Here are some conventions 1782another, so an @eieio{}-based program should follow them. Here are
1783that apply specifically to @eieio{}-based programs: 1783some conventions that apply specifically to @eieio{}-based programs:
1784 1784
1785@itemize 1785@itemize
1786 1786
diff --git a/doc/misc/gnus.texi b/doc/misc/gnus.texi
index e90789d2494..a33a91ba6f1 100644
--- a/doc/misc/gnus.texi
+++ b/doc/misc/gnus.texi
@@ -10,7 +10,7 @@
10 10
11@copying 11@copying
12Copyright @copyright{} 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 12Copyright @copyright{} 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
132003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc. 132003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
14 14
15@quotation 15@quotation
16Permission is granted to copy, distribute and/or modify this document 16Permission is granted to copy, distribute and/or modify this document
@@ -13449,8 +13449,7 @@ So here's a new example:
13449 (body "You are fired.\n\nSincerely, your boss.") 13449 (body "You are fired.\n\nSincerely, your boss.")
13450 (organization "Important Work, Inc")) 13450 (organization "Important Work, Inc"))
13451 ("nnml:.*" 13451 ("nnml:.*"
13452 (From (save-excursion 13452 (From (with-current-buffer gnus-article-buffer
13453 (set-buffer gnus-article-buffer)
13454 (message-fetch-field "to")))) 13453 (message-fetch-field "to"))))
13455 ("^nn.+:" 13454 ("^nn.+:"
13456 (signature-file "~/.mail-signature")))) 13455 (signature-file "~/.mail-signature"))))
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index eb35ed93afc..95410b9393a 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,110 @@
12010-01-08 Kenichi Handa <handa@m17n.org>
2
3 * international/fontset.el (build-default-fontset-data): Exclude
4 characters in scripts kana, hangul, han, or cjk-misc.
5
62010-01-07 Juanma Barranquero <lekktu@gmail.com>
7
8 * vc-dir.el (vc-dir-prepare-status-buffer): Pass a (fake) filename
9 to `create-file-buffer' as it expects, not just a buffer name.
10 (vc-dir-mode): Include the buffer name in `list-buffers-directory',
11 to help uniquify. (Bug#3224)
12
132010-01-06 Jan Djärv <jan.h.d@swipnet.se>
14
15 * font-setting.el (font-setting-change-default-font): Use user-spec
16 instead of name.
17
182010-01-06 Dan Nicolaescu <dann@ics.uci.edu>
19
20 * vc-bzr.el (vc-bzr-after-dir-status): Ignore pending merges.
21
222010-01-05 Tom Tromey <tromey@redhat.com>
23
24 * progmodes/python.el (python-font-lock-keywords): Handle
25 qualified decorators (Bug#881).
26
272010-01-05 Dan Nicolaescu <dann@ics.uci.edu>
28
29 * vc-bzr.el (vc-bzr-working-revision): Fix looking for a revision
30 in a lightweight checkout.
31
322010-01-05 Kenichi Handa <handa@m17n.org>
33
34 * language/indian.el (malayalam-composable-pattern): Fix ZWNJ and
35 ZWJ.
36
372010-01-05 Dan Nicolaescu <dann@ics.uci.edu>
38
39 * vc-bzr.el (vc-bzr-diff): Obey vc-disable-async-diff.
40
412010-01-04 Dan Nicolaescu <dann@ics.uci.edu>
42
43 * vc-bzr.el (vc-bzr-state-heuristic): Make it work for lightweight
44 checkouts. (Bug#618)
45 (vc-bzr-log-view-mode): Also highlight the author.
46 (vc-bzr-shelve-map): Change binding for vc-bzr-shelve-apply-at-point.
47 (vc-bzr-shelve-menu-map):
48 (vc-bzr-dir-extra-headers): Improve menu and tooltip text.
49 (vc-bzr-shelve-apply): Make prompt more explicit.
50
512010-01-02 Chong Yidong <cyd@stupidchicken.com>
52
53 * net/browse-url.el (browse-url-encode-url): Don't escape commas.
54 They are valid characters in URL paths (rfc3986), and at least
55 Firefox does not understand the encoded version (Bug#3166).
56
572010-01-02 Daniel Elliott <danelliottster@gmail.com> (tiny change)
58
59 * progmodes/octave-mod.el (octave-end-keywords)
60 (octave-block-begin-or-end-regexp, octave-block-match-alist): Add
61 "end" keyword (Bug#3061).
62 (octave-end-as-array-index-p): New function.
63 (calculate-octave-indent): Use it.
64
652010-01-02 Karl Fogel <kfogel@red-bean.com>
66
67 * bookmark.el: Consistently put the text property on the bookmark name.
68 (bookmark-bmenu-marks-width): Bump back to 2, to include
69 annotation marks.
70 (bookmark-bmenu-hide-filenames): Adjust for above, and put the text
71 property on the bookmark name, instead of not putting it at all.
72 (bookmark-bmenu-list): Fix where we put the text property.
73
742010-01-02 Karl Fogel <kfogel@red-bean.com>
75
76 * bookmark.el (bookmark-bmenu-save): Just depend on the new logic
77 for showing buffer modified state (as added in the previous change).
78
792010-01-02 Karl Fogel <kfogel@red-bean.com>
80
81 * bookmark.el: Show modified state of bookmark buffer more accurately.
82 (bookmark-bmenu-list): Initialize buffer-modified-p properly.
83 (bookmark-send-edited-annotation): Mark bookmark-alist as modified.
84 (with-buffer-modified-unmodified): New macro.
85 (bookmark-bmenu-show-filenames, bookmark-bmenu-hide-filenames)
86 (bookmark-bmenu-mark, bookmark-bmenu-unmark, bookmark-bmenu-delete):
87 Use new macro to preserve the buffer modified state.
88
892010-01-02 Karl Fogel <kfogel@red-bean.com>
90
91 * bookmark.el (bookmark-bmenu-select, bookmark-bmenu-1-window,
92 (bookmark-bmenu-2-window, bookmark-bmenu-this-window)
93 (bookmark-bmenu-other-window, bookmark-bmenu-switch-other-window)
94 (bookmark-bmenu-show-annotation, bookmark-bmenu-edit-annotation)
95 (bookmark-bmenu-rename, bookmark-bmenu-locate)
96 (bookmark-bmenu-relocate, bookmark-bmenu-goto-bookmark): Remove
97 unnecessary calls to `bookmark-bmenu-ensure-position'.
98
992010-01-02 Eli Zaretskii <eliz@gnu.org>
100
101 * emacs-lisp/easy-mmode.el (define-globalized-minor-mode): Make
102 the lines in the generated doc string shorter. (Bug#4668)
103
1042010-01-02 Ryan Yeske <rcyeske@gmail.com>
105
106 * net/rcirc.el: Add follow-link binding (Bug#4738).
107
12010-01-02 Eli Zaretskii <eliz@gnu.org> 1082010-01-02 Eli Zaretskii <eliz@gnu.org>
2 109
3 * Makefile.in (bzr-update): Renamed from cvs-update. 110 * Makefile.in (bzr-update): Renamed from cvs-update.
diff --git a/lisp/bookmark.el b/lisp/bookmark.el
index e837313df37..38f4478cbb4 100644
--- a/lisp/bookmark.el
+++ b/lisp/bookmark.el
@@ -132,8 +132,9 @@ recently set ones come first, oldest ones come last)."
132(defconst bookmark-bmenu-header-height 2 132(defconst bookmark-bmenu-header-height 2
133 "Number of lines used for the *Bookmark List* header.") 133 "Number of lines used for the *Bookmark List* header.")
134 134
135(defconst bookmark-bmenu-marks-width 1 135(defconst bookmark-bmenu-marks-width 2
136 "Number of columns (chars) used for the *Bookmark List* marks column.") 136 "Number of columns (chars) used for the *Bookmark List* marks column,
137including the annotations column.")
137 138
138(defcustom bookmark-bmenu-file-column 30 139(defcustom bookmark-bmenu-file-column 30
139 "Column at which to display filenames in a buffer listing bookmarks. 140 "Column at which to display filenames in a buffer listing bookmarks.
@@ -289,13 +290,20 @@ This point is in `bookmark-current-buffer'.")
289(defvar bookmark-quit-flag nil 290(defvar bookmark-quit-flag nil
290 "Non nil make `bookmark-bmenu-search' quit immediately.") 291 "Non nil make `bookmark-bmenu-search' quit immediately.")
291 292
292;; Helper functions. 293;; Helper functions and macros.
293 294
294;; Only functions on this page and the next one (file formats) need to 295(defmacro with-buffer-modified-unmodified (&rest body)
295;; know anything about the format of bookmark-alist entries. 296 "Run BODY while preserving the buffer's `buffer-modified-p' state."
297 (let ((was-modified (make-symbol "was-modified")))
298 `(let ((,was-modified (buffer-modified-p)))
299 (unwind-protect
300 (progn ,@body)
301 (set-buffer-modified-p ,was-modified)))))
302
303;; Only functions below, in this page and the next one (file formats),
304;; need to know anything about the format of bookmark-alist entries.
296;; Everyone else should go through them. 305;; Everyone else should go through them.
297 306
298
299(defun bookmark-name-from-full-record (full-record) 307(defun bookmark-name-from-full-record (full-record)
300 "Return name of FULL-RECORD (an alist element instead of a string)." 308 "Return name of FULL-RECORD (an alist element instead of a string)."
301 (car full-record)) 309 (car full-record))
@@ -866,6 +874,8 @@ Lines beginning with `#' are ignored."
866 (let ((annotation (buffer-substring-no-properties (point-min) (point-max))) 874 (let ((annotation (buffer-substring-no-properties (point-min) (point-max)))
867 (bookmark bookmark-annotation-name)) 875 (bookmark bookmark-annotation-name))
868 (bookmark-set-annotation bookmark annotation) 876 (bookmark-set-annotation bookmark annotation)
877 (setq bookmark-alist-modification-count
878 (1+ bookmark-alist-modification-count))
869 (bookmark-bmenu-surreptitiously-rebuild-list)) 879 (bookmark-bmenu-surreptitiously-rebuild-list))
870 (kill-buffer (current-buffer))) 880 (kill-buffer (current-buffer)))
871 881
@@ -1547,16 +1557,16 @@ deletion, or > if it is flagged for displaying."
1547 " *" " ") 1557 " *" " ")
1548 name) 1558 name)
1549 (setq end (point)) 1559 (setq end (point))
1550 (put-text-property start 1560 (put-text-property
1551 (+ bookmark-bmenu-marks-width 1 start) 1561 (+ bookmark-bmenu-marks-width start) end 'bookmark-name-prop name)
1552 'bookmark-name-prop name)
1553 (when (display-mouse-p) 1562 (when (display-mouse-p)
1554 (add-text-properties 1563 (add-text-properties
1555 (+ bookmark-bmenu-marks-width 1 start) end 1564 (+ bookmark-bmenu-marks-width start) end
1556 '(mouse-face highlight 1565 '(mouse-face highlight
1557 follow-link t 1566 follow-link t
1558 help-echo "mouse-2: go to this bookmark in other window"))) 1567 help-echo "mouse-2: go to this bookmark in other window")))
1559 (insert "\n"))) 1568 (insert "\n")))
1569 (set-buffer-modified-p (not (= bookmark-alist-modification-count 0)))
1560 (goto-char (point-min)) 1570 (goto-char (point-min))
1561 (forward-line 2) 1571 (forward-line 2)
1562 (bookmark-bmenu-mode) 1572 (bookmark-bmenu-mode)
@@ -1635,26 +1645,27 @@ Non-nil FORCE forces a redisplay showing the filenames. FORCE is used
1635mainly for debugging, and should not be necessary in normal use." 1645mainly for debugging, and should not be necessary in normal use."
1636 (if (and (not force) bookmark-bmenu-toggle-filenames) 1646 (if (and (not force) bookmark-bmenu-toggle-filenames)
1637 nil ;already shown, so do nothing 1647 nil ;already shown, so do nothing
1638 (save-excursion 1648 (with-buffer-modified-unmodified
1639 (save-window-excursion 1649 (save-excursion
1640 (goto-char (point-min)) 1650 (save-window-excursion
1641 (forward-line 2) 1651 (goto-char (point-min))
1642 (setq bookmark-bmenu-hidden-bookmarks ()) 1652 (forward-line 2)
1643 (let ((inhibit-read-only t)) 1653 (setq bookmark-bmenu-hidden-bookmarks ())
1644 (while (< (point) (point-max)) 1654 (let ((inhibit-read-only t))
1645 (let ((bmrk (bookmark-bmenu-bookmark))) 1655 (while (< (point) (point-max))
1646 (push bmrk bookmark-bmenu-hidden-bookmarks) 1656 (let ((bmrk (bookmark-bmenu-bookmark)))
1647 (let ((start (save-excursion (end-of-line) (point)))) 1657 (push bmrk bookmark-bmenu-hidden-bookmarks)
1648 (move-to-column bookmark-bmenu-file-column t) 1658 (let ((start (save-excursion (end-of-line) (point))))
1649 ;; Strip off `mouse-face' from the white spaces region. 1659 (move-to-column bookmark-bmenu-file-column t)
1650 (if (display-mouse-p) 1660 ;; Strip off `mouse-face' from the white spaces region.
1651 (remove-text-properties start (point) 1661 (if (display-mouse-p)
1652 '(mouse-face nil help-echo nil)))) 1662 (remove-text-properties start (point)
1653 (delete-region (point) (progn (end-of-line) (point))) 1663 '(mouse-face nil help-echo nil))))
1654 (insert " ") 1664 (delete-region (point) (progn (end-of-line) (point)))
1655 ;; Pass the NO-HISTORY arg: 1665 (insert " ")
1656 (bookmark-insert-location bmrk t) 1666 ;; Pass the NO-HISTORY arg:
1657 (forward-line 1)))))))) 1667 (bookmark-insert-location bmrk t)
1668 (forward-line 1)))))))))
1658 1669
1659 1670
1660(defun bookmark-bmenu-hide-filenames (&optional force) 1671(defun bookmark-bmenu-hide-filenames (&optional force)
@@ -1663,31 +1674,27 @@ Non-nil FORCE forces a redisplay showing the filenames. FORCE is used
1663mainly for debugging, and should not be necessary in normal use." 1674mainly for debugging, and should not be necessary in normal use."
1664 (when (and (not force) bookmark-bmenu-toggle-filenames) 1675 (when (and (not force) bookmark-bmenu-toggle-filenames)
1665 ;; nothing to hide if above is nil 1676 ;; nothing to hide if above is nil
1666 (save-excursion 1677 (with-buffer-modified-unmodified
1667 (goto-char (point-min)) 1678 (save-excursion
1668 (forward-line 2) 1679 (goto-char (point-min))
1669 (setq bookmark-bmenu-hidden-bookmarks 1680 (forward-line 2)
1670 (nreverse bookmark-bmenu-hidden-bookmarks)) 1681 (setq bookmark-bmenu-hidden-bookmarks
1671 (let ((inhibit-read-only t) 1682 (nreverse bookmark-bmenu-hidden-bookmarks))
1672 (column (save-excursion 1683 (let ((inhibit-read-only t))
1673 (goto-char (point-min)) 1684 (while bookmark-bmenu-hidden-bookmarks
1674 (search-forward "Bookmark") 1685 (move-to-column bookmark-bmenu-marks-width t)
1675 (backward-word 1) 1686 (bookmark-kill-line)
1676 (current-column)))) 1687 (let ((name (pop bookmark-bmenu-hidden-bookmarks))
1677 (while bookmark-bmenu-hidden-bookmarks 1688 (start (point)))
1678 (move-to-column column t) 1689 (insert name)
1679 (bookmark-kill-line) 1690 (put-text-property start (point) 'bookmark-name-prop name)
1680 (let ((name (pop bookmark-bmenu-hidden-bookmarks)) 1691 (if (display-mouse-p)
1681 (start (point))) 1692 (add-text-properties
1682 (insert name) 1693 start (point)
1683 (if (display-mouse-p) 1694 '(mouse-face
1684 (add-text-properties 1695 highlight follow-link t help-echo
1685 start (point) 1696 "mouse-2: go to this bookmark in other window"))))
1686 '(mouse-face highlight 1697 (forward-line 1)))))))
1687 follow-link t
1688 help-echo
1689 "mouse-2: go to this bookmark in other window"))))
1690 (forward-line 1))))))
1691 1698
1692 1699
1693(defun bookmark-bmenu-ensure-position () 1700(defun bookmark-bmenu-ensure-position ()
@@ -1752,18 +1759,18 @@ if an annotation exists."
1752 (interactive) 1759 (interactive)
1753 (beginning-of-line) 1760 (beginning-of-line)
1754 (bookmark-bmenu-ensure-position) 1761 (bookmark-bmenu-ensure-position)
1755 (let ((inhibit-read-only t)) 1762 (with-buffer-modified-unmodified
1756 (delete-char 1) 1763 (let ((inhibit-read-only t))
1757 (insert ?>) 1764 (delete-char 1)
1758 (forward-line 1) 1765 (insert ?>)
1759 (bookmark-bmenu-ensure-position))) 1766 (forward-line 1)
1767 (bookmark-bmenu-ensure-position))))
1760 1768
1761 1769
1762(defun bookmark-bmenu-select () 1770(defun bookmark-bmenu-select ()
1763 "Select this line's bookmark; also display bookmarks marked with `>'. 1771 "Select this line's bookmark; also display bookmarks marked with `>'.
1764You can mark bookmarks with the \\<bookmark-bmenu-mode-map>\\[bookmark-bmenu-mark] command." 1772You can mark bookmarks with the \\<bookmark-bmenu-mode-map>\\[bookmark-bmenu-mark] command."
1765 (interactive) 1773 (interactive)
1766 (bookmark-bmenu-ensure-position)
1767 (let ((bmrk (bookmark-bmenu-bookmark)) 1774 (let ((bmrk (bookmark-bmenu-bookmark))
1768 (menu (current-buffer)) 1775 (menu (current-buffer))
1769 (others ()) 1776 (others ())
@@ -1811,20 +1818,8 @@ With a prefix arg, prompts for a file to save them in."
1811 (interactive "P") 1818 (interactive "P")
1812 (save-excursion 1819 (save-excursion
1813 (save-window-excursion 1820 (save-window-excursion
1814 (bookmark-save parg))) 1821 (bookmark-save parg)
1815 ;; Show the buffer as unmodified after saving, but only if there are 1822 (set-buffer-modified-p nil))))
1816 ;; no marks: marks are not saved with the bookmarks, therefore from
1817 ;; the user's point of view they are a "modification" in the buffer
1818 ;;
1819 ;; FIXME: Ideally, if the buffer were unmodified when there are no
1820 ;; marks, and then some marks are made and removed without being
1821 ;; executed, then the buffer would be restored to unmodified state.
1822 ;; But that would require bookmark-specific logic to track buffer
1823 ;; modification. It might be worth it, but it's fine not to have it
1824 ;; too -- the worst outcome is that the user might be tempted to
1825 ;; save the bookmark list when it technically doesn't need saving.
1826 (if (not (bookmark-bmenu-any-marks))
1827 (set-buffer-modified-p nil)))
1828 1823
1829 1824
1830(defun bookmark-bmenu-load () 1825(defun bookmark-bmenu-load ()
@@ -1840,7 +1835,6 @@ With a prefix arg, prompts for a file to save them in."
1840(defun bookmark-bmenu-1-window () 1835(defun bookmark-bmenu-1-window ()
1841 "Select this line's bookmark, alone, in full frame." 1836 "Select this line's bookmark, alone, in full frame."
1842 (interactive) 1837 (interactive)
1843 (bookmark-bmenu-ensure-position)
1844 (bookmark-jump (bookmark-bmenu-bookmark)) 1838 (bookmark-jump (bookmark-bmenu-bookmark))
1845 (bury-buffer (other-buffer)) 1839 (bury-buffer (other-buffer))
1846 (delete-other-windows)) 1840 (delete-other-windows))
@@ -1849,7 +1843,6 @@ With a prefix arg, prompts for a file to save them in."
1849(defun bookmark-bmenu-2-window () 1843(defun bookmark-bmenu-2-window ()
1850 "Select this line's bookmark, with previous buffer in second window." 1844 "Select this line's bookmark, with previous buffer in second window."
1851 (interactive) 1845 (interactive)
1852 (bookmark-bmenu-ensure-position)
1853 (let ((bmrk (bookmark-bmenu-bookmark)) 1846 (let ((bmrk (bookmark-bmenu-bookmark))
1854 (menu (current-buffer)) 1847 (menu (current-buffer))
1855 (pop-up-windows t)) 1848 (pop-up-windows t))
@@ -1863,7 +1856,6 @@ With a prefix arg, prompts for a file to save them in."
1863(defun bookmark-bmenu-this-window () 1856(defun bookmark-bmenu-this-window ()
1864 "Select this line's bookmark in this window." 1857 "Select this line's bookmark in this window."
1865 (interactive) 1858 (interactive)
1866 (bookmark-bmenu-ensure-position)
1867 (bookmark-jump (bookmark-bmenu-bookmark))) 1859 (bookmark-jump (bookmark-bmenu-bookmark)))
1868 1860
1869 1861
@@ -1871,7 +1863,6 @@ With a prefix arg, prompts for a file to save them in."
1871 "Select this line's bookmark in other window, leaving bookmark menu visible." 1863 "Select this line's bookmark in other window, leaving bookmark menu visible."
1872 (interactive) 1864 (interactive)
1873 (let ((bookmark (bookmark-bmenu-bookmark))) 1865 (let ((bookmark (bookmark-bmenu-bookmark)))
1874 (bookmark-bmenu-ensure-position)
1875 (let ((bookmark-automatically-show-annotations t)) ;FIXME: needed? 1866 (let ((bookmark-automatically-show-annotations t)) ;FIXME: needed?
1876 (bookmark--jump-via bookmark 'switch-to-buffer-other-window)))) 1867 (bookmark--jump-via bookmark 'switch-to-buffer-other-window))))
1877 1868
@@ -1884,7 +1875,6 @@ The current window remains selected."
1884 (pop-up-windows t) 1875 (pop-up-windows t)
1885 same-window-buffer-names 1876 same-window-buffer-names
1886 same-window-regexps) 1877 same-window-regexps)
1887 (bookmark-bmenu-ensure-position)
1888 (let ((bookmark-automatically-show-annotations t)) ;FIXME: needed? 1878 (let ((bookmark-automatically-show-annotations t)) ;FIXME: needed?
1889 (bookmark--jump-via bookmark 'display-buffer)))) 1879 (bookmark--jump-via bookmark 'display-buffer))))
1890 1880
@@ -1901,7 +1891,6 @@ The current window remains selected."
1901 "Show the annotation for the current bookmark in another window." 1891 "Show the annotation for the current bookmark in another window."
1902 (interactive) 1892 (interactive)
1903 (let ((bookmark (bookmark-bmenu-bookmark))) 1893 (let ((bookmark (bookmark-bmenu-bookmark)))
1904 (bookmark-bmenu-ensure-position)
1905 (bookmark-show-annotation bookmark))) 1894 (bookmark-show-annotation bookmark)))
1906 1895
1907 1896
@@ -1915,7 +1904,6 @@ The current window remains selected."
1915 "Edit the annotation for the current bookmark in another window." 1904 "Edit the annotation for the current bookmark in another window."
1916 (interactive) 1905 (interactive)
1917 (let ((bookmark (bookmark-bmenu-bookmark))) 1906 (let ((bookmark (bookmark-bmenu-bookmark)))
1918 (bookmark-bmenu-ensure-position)
1919 (bookmark-edit-annotation bookmark))) 1907 (bookmark-edit-annotation bookmark)))
1920 1908
1921 1909
@@ -1925,14 +1913,15 @@ Optional BACKUP means move up."
1925 (interactive "P") 1913 (interactive "P")
1926 (beginning-of-line) 1914 (beginning-of-line)
1927 (bookmark-bmenu-ensure-position) 1915 (bookmark-bmenu-ensure-position)
1928 (let ((inhibit-read-only t)) 1916 (with-buffer-modified-unmodified
1929 (delete-char 1) 1917 (let ((inhibit-read-only t))
1930 ;; any flags to reset according to circumstances? How about a 1918 (delete-char 1)
1931 ;; flag indicating whether this bookmark is being visited? 1919 ;; any flags to reset according to circumstances? How about a
1932 ;; well, we don't have this now, so maybe later. 1920 ;; flag indicating whether this bookmark is being visited?
1933 (insert " ")) 1921 ;; well, we don't have this now, so maybe later.
1934 (forward-line (if backup -1 1)) 1922 (insert " "))
1935 (bookmark-bmenu-ensure-position)) 1923 (forward-line (if backup -1 1))
1924 (bookmark-bmenu-ensure-position)))
1936 1925
1937 1926
1938(defun bookmark-bmenu-backup-unmark () 1927(defun bookmark-bmenu-backup-unmark ()
@@ -1951,11 +1940,12 @@ To carry out the deletions that you've marked, use \\<bookmark-bmenu-mode-map>\\
1951 (interactive) 1940 (interactive)
1952 (beginning-of-line) 1941 (beginning-of-line)
1953 (bookmark-bmenu-ensure-position) 1942 (bookmark-bmenu-ensure-position)
1954 (let ((inhibit-read-only t)) 1943 (with-buffer-modified-unmodified
1955 (delete-char 1) 1944 (let ((inhibit-read-only t))
1956 (insert ?D) 1945 (delete-char 1)
1957 (forward-line 1) 1946 (insert ?D)
1958 (bookmark-bmenu-ensure-position))) 1947 (forward-line 1)
1948 (bookmark-bmenu-ensure-position))))
1959 1949
1960 1950
1961(defun bookmark-bmenu-delete-backwards () 1951(defun bookmark-bmenu-delete-backwards ()
@@ -2001,7 +1991,6 @@ To carry out the deletions that you've marked, use \\<bookmark-bmenu-mode-map>\\
2001(defun bookmark-bmenu-rename () 1991(defun bookmark-bmenu-rename ()
2002 "Rename bookmark on current line. Prompts for a new name." 1992 "Rename bookmark on current line. Prompts for a new name."
2003 (interactive) 1993 (interactive)
2004 (bookmark-bmenu-ensure-position)
2005 (let ((bmrk (bookmark-bmenu-bookmark)) 1994 (let ((bmrk (bookmark-bmenu-bookmark))
2006 (thispoint (point))) 1995 (thispoint (point)))
2007 (bookmark-rename bmrk) 1996 (bookmark-rename bmrk)
@@ -2011,15 +2000,13 @@ To carry out the deletions that you've marked, use \\<bookmark-bmenu-mode-map>\\
2011(defun bookmark-bmenu-locate () 2000(defun bookmark-bmenu-locate ()
2012 "Display location of this bookmark. Displays in the minibuffer." 2001 "Display location of this bookmark. Displays in the minibuffer."
2013 (interactive) 2002 (interactive)
2014 (bookmark-bmenu-ensure-position) 2003 (let ((bmrk (bookmark-bmenu-bookmark)))
2015 (let ((bmrk (bookmark-bmenu-bookmark))) 2004 (message "%s" (bookmark-location bmrk))))
2016 (message "%s" (bookmark-location bmrk))))
2017 2005
2018(defun bookmark-bmenu-relocate () 2006(defun bookmark-bmenu-relocate ()
2019 "Change the file path of the bookmark on the current line, 2007 "Change the file path of the bookmark on the current line,
2020 prompting with completion for the new path." 2008 prompting with completion for the new path."
2021 (interactive) 2009 (interactive)
2022 (bookmark-bmenu-ensure-position)
2023 (let ((bmrk (bookmark-bmenu-bookmark)) 2010 (let ((bmrk (bookmark-bmenu-bookmark))
2024 (thispoint (point))) 2011 (thispoint (point)))
2025 (bookmark-relocate bmrk) 2012 (bookmark-relocate bmrk)
@@ -2084,7 +2071,6 @@ To carry out the deletions that you've marked, use \\<bookmark-bmenu-mode-map>\\
2084(defun bookmark-bmenu-goto-bookmark (name) 2071(defun bookmark-bmenu-goto-bookmark (name)
2085 "Move point to bookmark with name NAME." 2072 "Move point to bookmark with name NAME."
2086 (goto-char (point-min)) 2073 (goto-char (point-min))
2087 (bookmark-bmenu-ensure-position)
2088 (while (not (equal name (bookmark-bmenu-bookmark))) 2074 (while (not (equal name (bookmark-bmenu-bookmark)))
2089 (forward-line 1)) 2075 (forward-line 1))
2090 (forward-line 0)) 2076 (forward-line 0))
diff --git a/lisp/emacs-lisp/easy-mmode.el b/lisp/emacs-lisp/easy-mmode.el
index bc97b07ddc3..704f8b15ebf 100644
--- a/lisp/emacs-lisp/easy-mmode.el
+++ b/lisp/emacs-lisp/easy-mmode.el
@@ -326,9 +326,13 @@ call another major mode in their body."
326 (make-variable-buffer-local ',MODE-major-mode) 326 (make-variable-buffer-local ',MODE-major-mode)
327 ;; The actual global minor-mode 327 ;; The actual global minor-mode
328 (define-minor-mode ,global-mode 328 (define-minor-mode ,global-mode
329 ;; Very short lines to avoid too long lines in the generated
330 ;; doc string.
329 ,(format "Toggle %s in every possible buffer. 331 ,(format "Toggle %s in every possible buffer.
330With prefix ARG, turn %s on if and only if ARG is positive. 332With prefix ARG, turn %s on if and only if
331%s is enabled in all buffers where `%s' would do it. 333ARG is positive.
334%s is enabled in all buffers where
335\`%s' would do it.
332See `%s' for more information on %s." 336See `%s' for more information on %s."
333 pretty-name pretty-global-name pretty-name turn-on 337 pretty-name pretty-global-name pretty-name turn-on
334 mode pretty-name) 338 mode pretty-name)
diff --git a/lisp/font-setting.el b/lisp/font-setting.el
index a0446e55e50..23c169f36fe 100644
--- a/lisp/font-setting.el
+++ b/lisp/font-setting.el
@@ -57,7 +57,7 @@ current form for the frame (i.e. hinting or somesuch changed)."
57 (if (display-graphic-p f) 57 (if (display-graphic-p f)
58 (let* ((frame-font 58 (let* ((frame-font
59 (or (font-get (face-attribute 'default :font f 59 (or (font-get (face-attribute 'default :font f
60 'default) :name) 60 'default) :user-spec)
61 (frame-parameter f 'font-parameter))) 61 (frame-parameter f 'font-parameter)))
62 (font-to-set 62 (font-to-set
63 (if set-font new-font 63 (if set-font new-font
diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog
index dcbcb81a371..2e90bf6e824 100644
--- a/lisp/gnus/ChangeLog
+++ b/lisp/gnus/ChangeLog
@@ -1,3 +1,28 @@
12010-01-06 Katsumi Yamaoka <yamaoka@jpl.org>
2
3 * gnus-art.el (gnus-article-describe-bindings): Work for prefix keys.
4
5 * message.el (message-check-news-header-syntax): Protect against a
6 string that `rfc822-addresses' returns when parsing fails.
7
82010-01-06 Katsumi Yamaoka <yamaoka@jpl.org>
9
10 * gnus-util.el (gnus-invisible-p, gnus-next-char-property-change)
11 (gnus-previous-char-property-change): New functions.
12
13 * gnus-sum.el (gnus-forward-line-ignore-invisible): Use them.
14
152010-01-05 Andreas Schwab <schwab@linux-m68k.org>
16
17 * gnus-sum.el (gnus-forward-line-ignore-invisible): New function.
18 (gnus-summary-recenter): Use it instead of forward-line. (Bug#5257)
19
202010-01-02 Chong Yidong <cyd@stupidchicken.com>
21
22 * message.el (message-exchange-point-and-mark): Rework last change to
23 avoid using optional arg of exchange-point-and-mark, for backward
24 compatibility.
25
12010-01-01 Chong Yidong <cyd@stupidchicken.com> 262010-01-01 Chong Yidong <cyd@stupidchicken.com>
2 27
3 * message.el (message-exchange-point-and-mark): Call 28 * message.el (message-exchange-point-and-mark): Call
@@ -13782,7 +13807,7 @@
13782 13807
13783See ChangeLog.2 for earlier changes. 13808See ChangeLog.2 for earlier changes.
13784 13809
13785 Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc. 13810 Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
13786 13811
13787 This file is part of GNU Emacs. 13812 This file is part of GNU Emacs.
13788 13813
diff --git a/lisp/gnus/gnus-art.el b/lisp/gnus/gnus-art.el
index 6bc84e42225..dcb63883997 100644
--- a/lisp/gnus/gnus-art.el
+++ b/lisp/gnus/gnus-art.el
@@ -6477,10 +6477,17 @@ then we display only bindings that start with that prefix."
6477 (let ((keymap (copy-keymap gnus-article-mode-map)) 6477 (let ((keymap (copy-keymap gnus-article-mode-map))
6478 (map (copy-keymap gnus-article-send-map)) 6478 (map (copy-keymap gnus-article-send-map))
6479 (sumkeys (where-is-internal 'gnus-article-read-summary-keys)) 6479 (sumkeys (where-is-internal 'gnus-article-read-summary-keys))
6480 agent draft) 6480 parent agent draft)
6481 (define-key keymap "S" map) 6481 (define-key keymap "S" map)
6482 (define-key map [t] nil) 6482 (define-key map [t] nil)
6483 (with-current-buffer gnus-article-current-summary 6483 (with-current-buffer gnus-article-current-summary
6484 (set-keymap-parent
6485 keymap
6486 (if (setq parent (keymap-parent gnus-article-mode-map))
6487 (prog1
6488 (setq parent (copy-keymap parent))
6489 (set-keymap-parent parent (current-local-map)))
6490 (current-local-map)))
6484 (set-keymap-parent map (key-binding "S")) 6491 (set-keymap-parent map (key-binding "S"))
6485 (let (key def gnus-pick-mode) 6492 (let (key def gnus-pick-mode)
6486 (while sumkeys 6493 (while sumkeys
diff --git a/lisp/gnus/gnus-sum.el b/lisp/gnus/gnus-sum.el
index 658193bd508..86244a9ca8f 100644
--- a/lisp/gnus/gnus-sum.el
+++ b/lisp/gnus/gnus-sum.el
@@ -6727,6 +6727,26 @@ Also do horizontal recentering."
6727 6727
6728(put 'gnus-recenter 'isearch-scroll t) 6728(put 'gnus-recenter 'isearch-scroll t)
6729 6729
6730(defun gnus-forward-line-ignore-invisible (n)
6731 "Move N lines forward (backward if N is negative).
6732Like forward-line, but skip over (and don't count) invisible lines."
6733 (let (done)
6734 (while (and (> n 0) (not done))
6735 ;; If the following character is currently invisible,
6736 ;; skip all characters with that same `invisible' property value.
6737 (while (gnus-invisible-p (point))
6738 (goto-char (gnus-next-char-property-change (point))))
6739 (forward-line 1)
6740 (if (eobp)
6741 (setq done t)
6742 (setq n (1- n))))
6743 (while (and (< n 0) (not done))
6744 (forward-line -1)
6745 (if (bobp) (setq done t)
6746 (setq n (1+ n))
6747 (while (and (not (bobp)) (gnus-invisible-p (1- (point))))
6748 (goto-char (gnus-previous-char-property-change (point))))))))
6749
6730(defun gnus-summary-recenter () 6750(defun gnus-summary-recenter ()
6731 "Center point in the summary window. 6751 "Center point in the summary window.
6732If `gnus-auto-center-summary' is nil, or the article buffer isn't 6752If `gnus-auto-center-summary' is nil, or the article buffer isn't
@@ -6742,16 +6762,19 @@ displayed, no centering will be performed."
6742 gnus-auto-center-summary 6762 gnus-auto-center-summary
6743 (/ (1- (window-height)) 2))))) 6763 (/ (1- (window-height)) 2)))))
6744 (height (1- (window-height))) 6764 (height (1- (window-height)))
6745 (bottom (save-excursion (goto-char (point-max)) 6765 (bottom (save-excursion
6746 (forward-line (- height)) 6766 (goto-char (point-max))
6747 (point))) 6767 (gnus-forward-line-ignore-invisible (- height))
6768 (point)))
6748 (window (get-buffer-window (current-buffer)))) 6769 (window (get-buffer-window (current-buffer))))
6749 (when (get-buffer-window gnus-article-buffer) 6770 (when (get-buffer-window gnus-article-buffer)
6750 ;; Only do recentering when the article buffer is displayed, 6771 ;; Only do recentering when the article buffer is displayed,
6751 ;; Set the window start to either `bottom', which is the biggest 6772 ;; Set the window start to either `bottom', which is the biggest
6752 ;; possible valid number, or the second line from the top, 6773 ;; possible valid number, or the second line from the top,
6753 ;; whichever is the least. 6774 ;; whichever is the least.
6754 (let ((top-pos (save-excursion (forward-line (- top)) (point)))) 6775 (let ((top-pos (save-excursion
6776 (gnus-forward-line-ignore-invisible (- top))
6777 (point))))
6755 (if (> bottom top-pos) 6778 (if (> bottom top-pos)
6756 ;; Keep the second line from the top visible 6779 ;; Keep the second line from the top visible
6757 (set-window-start window top-pos) 6780 (set-window-start window top-pos)
@@ -6760,12 +6783,12 @@ displayed, no centering will be performed."
6760 ;; visible, or revert to using TOP-POS. 6783 ;; visible, or revert to using TOP-POS.
6761 (save-excursion 6784 (save-excursion
6762 (goto-char (point-max)) 6785 (goto-char (point-max))
6763 (forward-line -1) 6786 (gnus-forward-line-ignore-invisible -1)
6764 (let ((last-line-start (point))) 6787 (let ((last-line-start (point)))
6765 (goto-char bottom) 6788 (goto-char bottom)
6766 (set-window-start window (point) t) 6789 (set-window-start window (point) t)
6767 (when (not (pos-visible-in-window-p last-line-start window)) 6790 (when (not (pos-visible-in-window-p last-line-start window))
6768 (forward-line 1) 6791 (gnus-forward-line-ignore-invisible 1)
6769 (set-window-start window (min (point) top-pos) t))))))) 6792 (set-window-start window (min (point) top-pos) t)))))))
6770 ;; Do horizontal recentering while we're at it. 6793 ;; Do horizontal recentering while we're at it.
6771 (when (and (get-buffer-window (current-buffer) t) 6794 (when (and (get-buffer-window (current-buffer) t)
diff --git a/lisp/gnus/gnus-util.el b/lisp/gnus/gnus-util.el
index 28a8c5dbed4..f5679ee850f 100644
--- a/lisp/gnus/gnus-util.el
+++ b/lisp/gnus/gnus-util.el
@@ -969,6 +969,29 @@ If there's no subdirectory, delete DIRECTORY as well."
969 (overlay-get overlay 'face)) 969 (overlay-get overlay 'face))
970 (overlays-at pos))))))) 970 (overlays-at pos)))))))
971 971
972(if (fboundp 'invisible-p)
973 (defalias 'gnus-invisible-p 'invisible-p)
974 ;; for Emacs < 22.2, and XEmacs.
975 (defun gnus-invisible-p (pos)
976 "Return non-nil if the character after POS is currently invisible."
977 (let ((prop (get-char-property pos 'invisible)))
978 (if (eq buffer-invisibility-spec t)
979 prop
980 (or (memq prop buffer-invisibility-spec)
981 (assq prop buffer-invisibility-spec))))))
982
983;; Note: the optional 2nd argument has a different meaning between
984;; Emacs and XEmacs.
985;; (next-char-property-change POSITION &optional LIMIT)
986;; (next-extent-change POS &optional OBJECT)
987(defalias 'gnus-next-char-property-change
988 (if (fboundp 'next-extent-change)
989 'next-extent-change 'next-char-property-change))
990
991(defalias 'gnus-previous-char-property-change
992 (if (fboundp 'previous-extent-change)
993 'previous-extent-change 'previous-char-property-change))
994
972;;; Protected and atomic operations. dmoore@ucsd.edu 21.11.1996 995;;; Protected and atomic operations. dmoore@ucsd.edu 21.11.1996
973;; The primary idea here is to try to protect internal datastructures 996;; The primary idea here is to try to protect internal datastructures
974;; from becoming corrupted when the user hits C-g, or if a hook or 997;; from becoming corrupted when the user hits C-g, or if a hook or
diff --git a/lisp/gnus/message.el b/lisp/gnus/message.el
index 655aa4c3e6b..941fa92b8b3 100644
--- a/lisp/gnus/message.el
+++ b/lisp/gnus/message.el
@@ -5077,7 +5077,8 @@ Otherwise, generate and save a value for `canlock-password' first."
5077 "Denied posting -- the From looks strange: \"%s\"." from) 5077 "Denied posting -- the From looks strange: \"%s\"." from)
5078 nil) 5078 nil)
5079 ((let ((addresses (rfc822-addresses from))) 5079 ((let ((addresses (rfc822-addresses from)))
5080 (while (and addresses 5080 ;; `rfc822-addresses' returns a string if parsing fails.
5081 (while (and (consp addresses)
5081 (not (eq (string-to-char (car addresses)) ?\())) 5082 (not (eq (string-to-char (car addresses)) ?\()))
5082 (setq addresses (cdr addresses))) 5083 (setq addresses (cdr addresses)))
5083 addresses) 5084 addresses)
@@ -7505,7 +7506,8 @@ which specify the range to operate on."
7505 7506
7506(defun message-exchange-point-and-mark () 7507(defun message-exchange-point-and-mark ()
7507 "Exchange point and mark, but don't activate region if it was inactive." 7508 "Exchange point and mark, but don't activate region if it was inactive."
7508 (exchange-point-and-mark transient-mark-mode)) 7509 (goto-char (prog1 (mark t)
7510 (set-marker (mark-marker) (point)))))
7509 7511
7510(defalias 'message-make-overlay 'make-overlay) 7512(defalias 'message-make-overlay 'make-overlay)
7511(defalias 'message-delete-overlay 'delete-overlay) 7513(defalias 'message-delete-overlay 'delete-overlay)
diff --git a/lisp/international/fontset.el b/lisp/international/fontset.el
index 9b4a5d59ed4..1b45512fad6 100644
--- a/lisp/international/fontset.el
+++ b/lisp/international/fontset.el
@@ -361,8 +361,10 @@
361 (let ((from (car range)) (to (cdr range))) 361 (let ((from (car range)) (to (cdr range)))
362 (if (< to #x110000) 362 (if (< to #x110000)
363 (while (<= from to) 363 (while (<= from to)
364 (aset cjk-table from 364 (or (memq (aref char-script-table from)
365 (logior (or (aref cjk-table from) 0) mask)) 365 '(kana hangul han cjk-misc))
366 (aset cjk-table from
367 (logior (or (aref cjk-table from) 0) mask)))
366 (setq from (1+ from)))))) 368 (setq from (1+ from))))))
367 (nth 1 elt) nil (nth 2 elt) (nth 3 elt))) 369 (nth 1 elt) nil (nth 2 elt) (nth 3 elt)))
368 (setq i (1+ i))) 370 (setq i (1+ i)))
diff --git a/lisp/language/indian.el b/lisp/language/indian.el
index 82f24a0272f..b9ea94ab2d1 100644
--- a/lisp/language/indian.el
+++ b/lisp/language/indian.el
@@ -153,8 +153,8 @@ South Indian language Malayalam is supported in this language environment."))
153 ("a" . "\u0903") ; vowel modifier (post) 153 ("a" . "\u0903") ; vowel modifier (post)
154 ("S" . "\u0951") ; stress sign (above) 154 ("S" . "\u0951") ; stress sign (above)
155 ("s" . "\u0952") ; stress sign (below) 155 ("s" . "\u0952") ; stress sign (below)
156 ("J" . "\u200D") ; ZWJ
157 ("N" . "\u200C") ; ZWNJ 156 ("N" . "\u200C") ; ZWNJ
157 ("J" . "\u200D") ; ZWJ
158 ("X" . "[\u0900-\u097F]")))) ; all coverage 158 ("X" . "[\u0900-\u097F]")))) ; all coverage
159 (indian-compose-regexp 159 (indian-compose-regexp
160 (concat 160 (concat
@@ -195,8 +195,8 @@ South Indian language Malayalam is supported in this language environment."))
195 ("b" . "[\u0D62-\u0D63]") ; belowbase matra 195 ("b" . "[\u0D62-\u0D63]") ; belowbase matra
196 ("a" . "[\u0D02-\u0D03]") ; abovebase sign 196 ("a" . "[\u0D02-\u0D03]") ; abovebase sign
197 ("H" . "\u0D4D") ; virama sign 197 ("H" . "\u0D4D") ; virama sign
198 ("N" . "\u200D") ; ZWJ 198 ("N" . "\u200C") ; ZWNJ
199 ("J" . "\u200C") ; ZWNJ 199 ("J" . "\u200D") ; ZWJ
200 ("X" . "[\u0D00-\u0D7F]")))) ; all coverage 200 ("X" . "[\u0D00-\u0D7F]")))) ; all coverage
201 (indian-compose-regexp 201 (indian-compose-regexp
202 (concat 202 (concat
diff --git a/lisp/net/browse-url.el b/lisp/net/browse-url.el
index e52f4cb924a..5619108241c 100644
--- a/lisp/net/browse-url.el
+++ b/lisp/net/browse-url.el
@@ -613,7 +613,7 @@ down (this *won't* always work)."
613 613
614(defun browse-url-url-encode-chars (text chars) 614(defun browse-url-url-encode-chars (text chars)
615 "URL-encode the chars in TEXT that match CHARS. 615 "URL-encode the chars in TEXT that match CHARS.
616CHARS is a regexp-like character alternative (e.g., \"[,)$]\")." 616CHARS is a regexp-like character alternative (e.g., \"[)$]\")."
617 (let ((encoded-text (copy-sequence text)) 617 (let ((encoded-text (copy-sequence text))
618 (s 0)) 618 (s 0))
619 (while (setq s (string-match chars encoded-text s)) 619 (while (setq s (string-match chars encoded-text s))
@@ -626,10 +626,12 @@ CHARS is a regexp-like character alternative (e.g., \"[,)$]\")."
626 626
627(defun browse-url-encode-url (url) 627(defun browse-url-encode-url (url)
628 "Escape annoying characters in URL. 628 "Escape annoying characters in URL.
629The annoying characters are those that can mislead a webbrowser 629The annoying characters are those that can mislead a web browser
630regarding its parameter treatment. For instance, `,' can 630regarding its parameter treatment."
631be misleading because it could be used to separate URLs." 631 ;; FIXME: Is there an actual example of a web browser getting
632 (browse-url-url-encode-chars url "[,)$]")) 632 ;; confused? (This used to encode commas, but at least Firefox
633 ;; handles commas correctly and doesn't accept encoded commas.)
634 (browse-url-url-encode-chars url "[)$]"))
633 635
634;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 636;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
635;; URL input 637;; URL input
diff --git a/lisp/net/rcirc.el b/lisp/net/rcirc.el
index d1f54c9909d..e4aaef94983 100644
--- a/lisp/net/rcirc.el
+++ b/lisp/net/rcirc.el
@@ -836,6 +836,7 @@ If SILENT is non-nil, do not print the message in any irc buffer."
836 836
837(define-key rcirc-browse-url-map (kbd "RET") 'rcirc-browse-url-at-point) 837(define-key rcirc-browse-url-map (kbd "RET") 'rcirc-browse-url-at-point)
838(define-key rcirc-browse-url-map (kbd "<mouse-2>") 'rcirc-browse-url-at-mouse) 838(define-key rcirc-browse-url-map (kbd "<mouse-2>") 'rcirc-browse-url-at-mouse)
839(define-key rcirc-browse-url-map [follow-link] 'mouse-face)
839 840
840(defvar rcirc-short-buffer-name nil 841(defvar rcirc-short-buffer-name nil
841 "Generated abbreviation to use to indicate buffer activity.") 842 "Generated abbreviation to use to indicate buffer activity.")
diff --git a/lisp/progmodes/octave-mod.el b/lisp/progmodes/octave-mod.el
index 7f09d83399b..5c5e9851dcb 100644
--- a/lisp/progmodes/octave-mod.el
+++ b/lisp/progmodes/octave-mod.el
@@ -101,11 +101,9 @@ All Octave abbrevs start with a grave accent (`)."
101 '("do" "for" "function" "if" "switch" "try" "unwind_protect" "while")) 101 '("do" "for" "function" "if" "switch" "try" "unwind_protect" "while"))
102(defvar octave-else-keywords 102(defvar octave-else-keywords
103 '("case" "catch" "else" "elseif" "otherwise" "unwind_protect_cleanup")) 103 '("case" "catch" "else" "elseif" "otherwise" "unwind_protect_cleanup"))
104;; FIXME: only use specific "end" tokens here to avoid confusion when "end"
105;; is used in indexing (the real fix is much more complex).
106(defvar octave-end-keywords 104(defvar octave-end-keywords
107 '("endfor" "endfunction" "endif" "endswitch" "end_try_catch" 105 '("endfor" "endfunction" "endif" "endswitch" "end_try_catch"
108 "end_unwind_protect" "endwhile" "until")) 106 "end_unwind_protect" "endwhile" "until" "end"))
109 107
110(defvar octave-reserved-words 108(defvar octave-reserved-words
111 (append octave-begin-keywords 109 (append octave-begin-keywords
@@ -342,17 +340,15 @@ newline or semicolon after an else or end keyword."
342 (concat octave-block-begin-regexp "\\|" octave-block-end-regexp)) 340 (concat octave-block-begin-regexp "\\|" octave-block-end-regexp))
343(defvar octave-block-else-or-end-regexp 341(defvar octave-block-else-or-end-regexp
344 (concat octave-block-else-regexp "\\|" octave-block-end-regexp)) 342 (concat octave-block-else-regexp "\\|" octave-block-end-regexp))
345;; FIXME: only use specific "end" tokens here to avoid confusion when "end"
346;; is used in indexing (the real fix is much more complex).
347(defvar octave-block-match-alist 343(defvar octave-block-match-alist
348 '(("do" . ("until")) 344 '(("do" . ("until"))
349 ("for" . ("endfor")) 345 ("for" . ("endfor" "end"))
350 ("function" . ("endfunction")) 346 ("function" . ("endfunction"))
351 ("if" . ("else" "elseif" "endif")) 347 ("if" . ("else" "elseif" "endif" "end"))
352 ("switch" . ("case" "otherwise" "endswitch")) 348 ("switch" . ("case" "otherwise" "endswitch" "end"))
353 ("try" . ("catch" "end_try_catch")) 349 ("try" . ("catch" "end_try_catch"))
354 ("unwind_protect" . ("unwind_protect_cleanup" "end_unwind_protect")) 350 ("unwind_protect" . ("unwind_protect_cleanup" "end_unwind_protect"))
355 ("while" . ("endwhile"))) 351 ("while" . ("endwhile" "end")))
356 "Alist with Octave's matching block keywords. 352 "Alist with Octave's matching block keywords.
357Has Octave's begin keywords as keys and a list of the matching else or 353Has Octave's begin keywords as keys and a list of the matching else or
358end keywords as associated values.") 354end keywords as associated values.")
@@ -680,7 +676,10 @@ level."
680 (if (= bot (point)) 676 (if (= bot (point))
681 (setq icol (+ icol octave-block-offset)))) 677 (setq icol (+ icol octave-block-offset))))
682 ((octave-looking-at-kw octave-block-end-regexp) 678 ((octave-looking-at-kw octave-block-end-regexp)
683 (if (not (= bot (point))) 679 (if (and (not (= bot (point)))
680 ;; special case for `end' keyword,
681 ;; applied to all keywords
682 (not (octave-end-as-array-index-p)))
684 (setq icol (- icol 683 (setq icol (- icol
685 (octave-block-end-offset))))))) 684 (octave-block-end-offset)))))))
686 (forward-char))) 685 (forward-char)))
@@ -702,6 +701,15 @@ level."
702 (setq icol (list comment-column icol))))) 701 (setq icol (list comment-column icol)))))
703 icol)) 702 icol))
704 703
704;; FIXME: this should probably also make sure we are actually looking
705;; at the "end" keyword.
706(defun octave-end-as-array-index-p ()
707 (save-excursion
708 (condition-case nil
709 ;; Check if point is between parens
710 (progn (up-list 1) t)
711 (error nil))))
712
705(defun octave-block-end-offset () 713(defun octave-block-end-offset ()
706 (save-excursion 714 (save-excursion
707 (octave-backward-up-block 1) 715 (octave-backward-up-block 1)
diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el
index 104ea26689f..94124ad54f0 100644
--- a/lisp/progmodes/python.el
+++ b/lisp/progmodes/python.el
@@ -1,6 +1,6 @@
1;;; python.el --- silly walks for Python -*- coding: iso-8859-1 -*- 1;;; python.el --- silly walks for Python -*- coding: iso-8859-1 -*-
2 2
3;; Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009 3;; Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
4;; Free Software Foundation, Inc. 4;; Free Software Foundation, Inc.
5 5
6;; Author: Dave Love <fx@gnu.org> 6;; Author: Dave Love <fx@gnu.org>
@@ -112,7 +112,9 @@
112 ;; Top-level assignments are worth highlighting. 112 ;; Top-level assignments are worth highlighting.
113 (,(rx line-start (group (1+ (or word ?_))) (0+ space) "=") 113 (,(rx line-start (group (1+ (or word ?_))) (0+ space) "=")
114 (1 font-lock-variable-name-face)) 114 (1 font-lock-variable-name-face))
115 (,(rx line-start (* (any " \t")) (group "@" (1+ (or word ?_)))) ; decorators 115 ;; Decorators.
116 (,(rx line-start (* (any " \t")) (group "@" (1+ (or word ?_))
117 (0+ "." (1+ (or word ?_)))))
116 (1 font-lock-type-face)) 118 (1 font-lock-type-face))
117 ;; Built-ins. (The next three blocks are from 119 ;; Built-ins. (The next three blocks are from
118 ;; `__builtin__.__dict__.keys()' in Python 2.5.1.) These patterns 120 ;; `__builtin__.__dict__.keys()' in Python 2.5.1.) These patterns
diff --git a/lisp/vc-bzr.el b/lisp/vc-bzr.el
index fff4eca57fa..f140671be12 100644
--- a/lisp/vc-bzr.el
+++ b/lisp/vc-bzr.el
@@ -176,13 +176,13 @@ Invoke the bzr command adding `BZR_PROGRESS_BAR=none' and
176 "\0" 176 "\0"
177 "[^\0]*\0" ;id? 177 "[^\0]*\0" ;id?
178 "\\([^\0]*\\)\0" ;"a/f/d", a=removed? 178 "\\([^\0]*\\)\0" ;"a/f/d", a=removed?
179 "[^\0]*\0" ;sha1 (empty if conflicted)? 179 "\\([^\0]*\\)\0" ;sha1 (empty if conflicted)?
180 "\\([^\0]*\\)\0" ;size? 180 "\\([^\0]*\\)\0" ;size?p
181 "[^\0]*\0" ;"y/n", executable? 181 "[^\0]*\0" ;"y/n", executable?
182 "[^\0]*\0" ;? 182 "[^\0]*\0" ;?
183 "\\([^\0]*\\)\0" ;"a/f/d" a=added? 183 "\\([^\0]*\\)\0" ;"a/f/d" a=added?
184 "\\([^\0]*\\)\0" ;sha1 again? 184 "\\([^\0]*\\)\0" ;sha1 again?
185 "[^\0]*\0" ;size again? 185 "\\([^\0]*\\)\0" ;size again?
186 "[^\0]*\0" ;"y/n", executable again? 186 "[^\0]*\0" ;"y/n", executable again?
187 "[^\0]*\0" ;last revid? 187 "[^\0]*\0" ;last revid?
188 ;; There are more fields when merges are pending. 188 ;; There are more fields when merges are pending.
@@ -194,11 +194,20 @@ Invoke the bzr command adding `BZR_PROGRESS_BAR=none' and
194 ;; conflict markers). 194 ;; conflict markers).
195 (cond 195 (cond
196 ((eq (char-after (match-beginning 1)) ?a) 'removed) 196 ((eq (char-after (match-beginning 1)) ?a) 'removed)
197 ((eq (char-after (match-beginning 3)) ?a) 'added) 197 ((eq (char-after (match-beginning 4)) ?a) 'added)
198 ((and (eq (string-to-number (match-string 2)) 198 ((or (and (eq (string-to-number (match-string 3))
199 (nth 7 (file-attributes file))) 199 (nth 7 (file-attributes file)))
200 (equal (match-string 4) 200 (equal (match-string 5)
201 (vc-bzr-sha1 file))) 201 (vc-bzr-sha1 file)))
202 (and
203 ;; It looks like for lightweight
204 ;; checkouts \2 is empty and we need to
205 ;; look for size in \6.
206 (eq (match-beginning 2) (match-end 2))
207 (eq (string-to-number (match-string 6))
208 (nth 7 (file-attributes file)))
209 (equal (match-string 5)
210 (vc-bzr-sha1 file))))
202 'up-to-date) 211 'up-to-date)
203 (t 'edited)) 212 (t 'edited))
204 'unregistered)))) 213 'unregistered))))
@@ -347,9 +356,19 @@ If any error occurred in running `bzr status', then return nil."
347 (if (file-exists-p location-fname) 356 (if (file-exists-p location-fname)
348 (with-temp-buffer 357 (with-temp-buffer
349 (insert-file-contents location-fname) 358 (insert-file-contents location-fname)
350 (when (re-search-forward "file://\(.+\)" nil t) 359 ;; If the lightweight checkout points to a
351 (setq branch-format-file (match-string 1)) 360 ;; location in the local file system, then we can
352 (file-exists-p branch-format-file))) 361 ;; look there for the version information.
362 (when (re-search-forward "file://\\(.+\\)" nil t)
363 (let ((l-c-parent-dir (match-string 1)))
364 (setq branch-format-file
365 (expand-file-name vc-bzr-admin-branch-format-file
366 l-c-parent-dir))
367 (setq lastrev-file
368 (expand-file-name vc-bzr-admin-lastrev l-c-parent-dir))
369 ;; FIXME: maybe it's overkill to check if both these files exist.
370 (and (file-exists-p branch-format-file)
371 (file-exists-p lastrev-file)))))
353 t))) 372 t)))
354 (with-temp-buffer 373 (with-temp-buffer
355 (insert-file-contents branch-format-file) 374 (insert-file-contents branch-format-file)
@@ -475,7 +494,7 @@ REV non-nil gets an error."
475 (4 'change-log-list nil lax)))) 494 (4 'change-log-list nil lax))))
476 (append `((,log-view-message-re . 'log-view-message-face)) 495 (append `((,log-view-message-re . 'log-view-message-face))
477 ;; log-view-font-lock-keywords 496 ;; log-view-font-lock-keywords
478 '(("^ *committer: \ 497 '(("^ *\\(?:committer\\|author\\): \
479\\([^<(]+?\\)[ ]*[(<]\\([[:alnum:]_.+-]+@[[:alnum:]_.-]+\\)[>)]" 498\\([^<(]+?\\)[ ]*[(<]\\([[:alnum:]_.+-]+@[[:alnum:]_.-]+\\)[>)]"
480 (1 'change-log-name) 499 (1 'change-log-name)
481 (2 'change-log-email)) 500 (2 'change-log-email))
@@ -523,7 +542,8 @@ REV non-nil gets an error."
523(defun vc-bzr-diff (files &optional rev1 rev2 buffer) 542(defun vc-bzr-diff (files &optional rev1 rev2 buffer)
524 "VC bzr backend for diff." 543 "VC bzr backend for diff."
525 ;; `bzr diff' exits with code 1 if diff is non-empty. 544 ;; `bzr diff' exits with code 1 if diff is non-empty.
526 (apply #'vc-bzr-command "diff" (or buffer "*vc-diff*") 'async files 545 (apply #'vc-bzr-command "diff" (or buffer "*vc-diff*")
546 (if vc-disable-async-diff 1 'async) files
527 "--diff-options" (mapconcat 'identity 547 "--diff-options" (mapconcat 'identity
528 (vc-switches 'bzr 'diff) 548 (vc-switches 'bzr 'diff)
529 " ") 549 " ")
@@ -651,7 +671,6 @@ stream. Standard error output is discarded."
651 ;; For conflicts, should we list the .THIS/.BASE/.OTHER? 671 ;; For conflicts, should we list the .THIS/.BASE/.OTHER?
652 ("C " . conflict) 672 ("C " . conflict)
653 ("? " . unregistered) 673 ("? " . unregistered)
654 ("? " . unregistered)
655 ;; No such state, but we need to distinguish this case. 674 ;; No such state, but we need to distinguish this case.
656 ("R " . renamed) 675 ("R " . renamed)
657 ;; For a non existent file FOO, the output is: 676 ;; For a non existent file FOO, the output is:
@@ -663,6 +682,8 @@ stream. Standard error output is discarded."
663 ;; FIXME: maybe this warning can be put in the vc-dir header... 682 ;; FIXME: maybe this warning can be put in the vc-dir header...
664 ("wor" . not-found) 683 ("wor" . not-found)
665 ;; Ignore "P " and "P." for pending patches. 684 ;; Ignore "P " and "P." for pending patches.
685 ("P " . not-found)
686 ("P. " . not-found)
666 )) 687 ))
667 (translated nil) 688 (translated nil)
668 (result nil)) 689 (result nil))
@@ -732,7 +753,7 @@ stream. Standard error output is discarded."
732 (define-key map "\C-k" 'vc-bzr-shelve-delete-at-point) 753 (define-key map "\C-k" 'vc-bzr-shelve-delete-at-point)
733 ;; (define-key map "=" 'vc-bzr-shelve-show-at-point) 754 ;; (define-key map "=" 'vc-bzr-shelve-show-at-point)
734 ;; (define-key map "\C-m" 'vc-bzr-shelve-show-at-point) 755 ;; (define-key map "\C-m" 'vc-bzr-shelve-show-at-point)
735 (define-key map "A" 'vc-bzr-shelve-apply-at-point) 756 (define-key map "P" 'vc-bzr-shelve-apply-at-point)
736 map)) 757 map))
737 758
738(defvar vc-bzr-shelve-menu-map 759(defvar vc-bzr-shelve-menu-map
@@ -740,9 +761,9 @@ stream. Standard error output is discarded."
740 (define-key map [de] 761 (define-key map [de]
741 '(menu-item "Delete shelf" vc-bzr-shelve-delete-at-point 762 '(menu-item "Delete shelf" vc-bzr-shelve-delete-at-point
742 :help "Delete the current shelf")) 763 :help "Delete the current shelf"))
743 (define-key map [ap] 764 (define-key map [po]
744 '(menu-item "Apply shelf" vc-bzr-shelve-apply-at-point 765 '(menu-item "Apply and remove shelf (pop)" vc-bzr-shelve-apply-at-point
745 :help "Apply the current shelf")) 766 :help "Apply the current shelf and remove it"))
746 ;; (define-key map [sh] 767 ;; (define-key map [sh]
747 ;; '(menu-item "Show shelve" vc-bzr-shelve-show-at-point 768 ;; '(menu-item "Show shelve" vc-bzr-shelve-show-at-point
748 ;; :help "Show the contents of the current shelve")) 769 ;; :help "Show the contents of the current shelve"))
@@ -800,7 +821,7 @@ stream. Standard error output is discarded."
800 (propertize x 821 (propertize x
801 'face 'font-lock-variable-name-face 822 'face 'font-lock-variable-name-face
802 'mouse-face 'highlight 823 'mouse-face 'highlight
803 'help-echo "mouse-3: Show shelve menu\nA: Apply shelf\nC-k: Delete shelf" 824 'help-echo "mouse-3: Show shelve menu\nP: Apply and remove shelf (pop)\nC-k: Delete shelf"
804 'keymap vc-bzr-shelve-map)) 825 'keymap vc-bzr-shelve-map))
805 shelve "\n")) 826 shelve "\n"))
806 (concat 827 (concat
@@ -830,8 +851,8 @@ stream. Standard error output is discarded."
830;; (pop-to-buffer (current-buffer))) 851;; (pop-to-buffer (current-buffer)))
831 852
832(defun vc-bzr-shelve-apply (name) 853(defun vc-bzr-shelve-apply (name)
833 "Apply shelve NAME." 854 "Apply shelve NAME and remove it afterwards."
834 (interactive "sApply shelf: ") 855 (interactive "sApply (and remove) shelf: ")
835 (vc-bzr-command "unshelve" "*vc-bzr-shelve*" 0 nil "--apply" name) 856 (vc-bzr-command "unshelve" "*vc-bzr-shelve*" 0 nil "--apply" name)
836 (vc-resynch-buffer (vc-bzr-root default-directory) t t)) 857 (vc-resynch-buffer (vc-bzr-root default-directory) t t))
837 858
diff --git a/lisp/vc-dir.el b/lisp/vc-dir.el
index 61cc8575449..6563ac83550 100644
--- a/lisp/vc-dir.el
+++ b/lisp/vc-dir.el
@@ -101,7 +101,9 @@ See `run-hooks'."
101 (return buffer)))))))) 101 (return buffer))))))))
102 (or buf 102 (or buf
103 ;; Create a new buffer named BNAME. 103 ;; Create a new buffer named BNAME.
104 (with-current-buffer (create-file-buffer bname) 104 ;; We pass a filename to create-file-buffer because it is what
105 ;; the function expects, and also what uniquify needs (if active)
106 (with-current-buffer (create-file-buffer (expand-file-name bname dir))
105 (cd dir) 107 (cd dir)
106 (vc-setup-buffer (current-buffer)) 108 (vc-setup-buffer (current-buffer))
107 ;; Reset the vc-parent-buffer-name so that it does not appear 109 ;; Reset the vc-parent-buffer-name so that it does not appear
@@ -928,7 +930,7 @@ the *vc-dir* buffer.
928 (set (make-local-variable 'vc-ewoc) (ewoc-create #'vc-dir-printer)) 930 (set (make-local-variable 'vc-ewoc) (ewoc-create #'vc-dir-printer))
929 (set (make-local-variable 'revert-buffer-function) 931 (set (make-local-variable 'revert-buffer-function)
930 'vc-dir-revert-buffer-function) 932 'vc-dir-revert-buffer-function)
931 (setq list-buffers-directory default-directory) 933 (setq list-buffers-directory (expand-file-name "*vc-dir*" default-directory))
932 (add-to-list 'vc-dir-buffers (current-buffer)) 934 (add-to-list 'vc-dir-buffers (current-buffer))
933 ;; Make sure that if the directory buffer is killed, the update 935 ;; Make sure that if the directory buffer is killed, the update
934 ;; process running in the background is also killed. 936 ;; process running in the background is also killed.
diff --git a/src/ChangeLog b/src/ChangeLog
index d6e7f2c9791..fd32d739bc0 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,66 @@
12010-01-08 Jan Djärv <jan.h.d@swipnet.se>
2
3 * dispnew.c (change_frame_size_1): newwidth == FRAME_COLS (f) must
4 also be true before we can return early (bug #5339).
5
62010-01-06 David Reitter <david.reitter@gmail.com>
7
8 * nsfns.m (ns_get_screen): Rewrite, returning NULL for non-NS.
9 (Fns_display_usable_bounds): Rewrite, computing bounds properly
10 (Bug#3233).
11
122010-01-06 Jan Djärv <jan.h.d@swipnet.se>
13
14 * font.c (font_open_entity): Enable chache and call cached_font_ok
15 for the driver if defined.
16 (QCuser_spec): New symbol.
17 (font_spec_from_name): Save name as user-spec.
18 (font_load_for_lface): Keep user-spec instead of name.
19 (font_open_by_name): Save name as user-spec.
20 (syms_of_font): Initialize QCuser_spec.
21 (font_clear_prop): Clear name if it exists in font (bug#5157).
22
23 * xftfont.c (xftfont_open): Call xftfont_add_rendering_parameters.
24 (xftfont_add_rendering_parameters, xftfont_cached_font_ok): New.
25 (syms_of_xftfont): Initialize xftfont_driver.cached_font_ok.
26
27 * font.h (struct font_driver): Add cached_font_ok.
28
29 * xterm.c (x_clear_frame): Queue draw for scroll bars.
30
312010-01-05 Jan Djärv <jan.h.d@swipnet.se>
32
33 * xterm.c (x_new_font): Move code for setting rows/cols before
34 resizing ...
35 (x_set_window_size): ... to here. bug #2568.
36
37 * gtkutil.c (xg_clear_under_internal_border): New function.
38 (xg_frame_resized, xg_frame_set_char_size): Call
39 xg_clear_under_internal_border.
40 (xg_update_scrollbar_pos): Clear under old scroll bar position.
412010-01-05 Chong Yidong <cyd@stupidchicken.com>
42
43 * keyboard.c (read_key_sequence): Catch keyboard switch after
44 making a new tty frame (Bug#5095).
45
462010-01-05 Kenichi Handa <handa@m17n.org>
47
48 * fontset.c (fontset_find_font): Fix getting the frame pointer.
49
502010-01-04 Stefan Monnier <monnier@iro.umontreal.ca>
51
52 * dbusbind.c (xd_remove_watch): Avoid trying to convert a void* to
53 Lisp_Object, preferring to convert a lisp_Object to a void* instead.
54 (Fdbus_init_bus): Use XHASH to get a scalar value from a Lisp_Object.
55
562010-01-03 Michael Albinus <michael.albinus@gmx.de>
57
58 * dbusbind.c (xd_add_watch): Improve debug message.
59 (xd_remove_watch): Improve debug message. If DATA is the session
60 bus, unset D-Bus session environment.
61 (Fdbus_init_bus): Pass the bus as argument to
62 dbus_connection_set_watch_functions. (Bug#5283)
63
12010-01-01 Chong Yidong <cyd@stupidchicken.com> 642010-01-01 Chong Yidong <cyd@stupidchicken.com>
2 65
3 * nsterm.m (ns_get_color): Fix buffer overflow (Bug#4763). 66 * nsterm.m (ns_get_color): Fix buffer overflow (Bug#4763).
@@ -144,7 +207,7 @@
1442009-12-15 Michael Albinus <michael.albinus@gmx.de> 2072009-12-15 Michael Albinus <michael.albinus@gmx.de>
145 208
146 * dbusbind.c (xd_retrieve_arg): Reorder declarations in order to 209 * dbusbind.c (xd_retrieve_arg): Reorder declarations in order to
147 avoid compiler warnings. (Bug #5217). 210 avoid compiler warnings. (Bug #5217)
148 211
1492009-12-14 Kenichi Handa <handa@m17n.org> 2122009-12-14 Kenichi Handa <handa@m17n.org>
150 213
@@ -5319,7 +5382,7 @@
5319 (XD_SIGNAL1, XD_SIGNAL2, XD_SIGNAL3): New macros. Throw Qdbus_error. 5382 (XD_SIGNAL1, XD_SIGNAL2, XD_SIGNAL3): New macros. Throw Qdbus_error.
5320 (xd_read_queued_messages): Catch Qdbus_error from the macros. 5383 (xd_read_queued_messages): Catch Qdbus_error from the macros.
5321 (all): Replace xsignal1, xsignal2, xsignal3 by the respective 5384 (all): Replace xsignal1, xsignal2, xsignal3 by the respective
5322 macro. (Bug#1186). 5385 macro. (Bug#1186)
5323 5386
53242008-10-23 Ali Bahrami <ali_gnu@emvision.com> (tiny change) 53872008-10-23 Ali Bahrami <ali_gnu@emvision.com> (tiny change)
5325 5388
@@ -21213,7 +21276,7 @@ See ChangeLog.10 for earlier changes.
21213;; add-log-time-zone-rule: t 21276;; add-log-time-zone-rule: t
21214;; End: 21277;; End:
21215 21278
21216 Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc. 21279 Copyright (C) 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
21217 21280
21218 This file is part of GNU Emacs. 21281 This file is part of GNU Emacs.
21219 21282
diff --git a/src/dbusbind.c b/src/dbusbind.c
index 7c0be49ab77..974a01e8ead 100644
--- a/src/dbusbind.c
+++ b/src/dbusbind.c
@@ -761,14 +761,14 @@ xd_add_watch (watch, data)
761 if (dbus_watch_get_flags (watch) & DBUS_WATCH_READABLE) 761 if (dbus_watch_get_flags (watch) & DBUS_WATCH_READABLE)
762 { 762 {
763#if HAVE_DBUS_WATCH_GET_UNIX_FD 763#if HAVE_DBUS_WATCH_GET_UNIX_FD
764 /* TODO: Reverse these on Win32, which prefers the opposite. */ 764 /* TODO: Reverse these on Win32, which prefers the opposite. */
765 int fd = dbus_watch_get_unix_fd(watch); 765 int fd = dbus_watch_get_unix_fd(watch);
766 if (fd == -1) 766 if (fd == -1)
767 fd = dbus_watch_get_socket(watch); 767 fd = dbus_watch_get_socket(watch);
768#else 768#else
769 int fd = dbus_watch_get_fd(watch); 769 int fd = dbus_watch_get_fd(watch);
770#endif 770#endif
771 XD_DEBUG_MESSAGE ("%d", fd); 771 XD_DEBUG_MESSAGE ("fd %d", fd);
772 772
773 if (fd == -1) 773 if (fd == -1)
774 return FALSE; 774 return FALSE;
@@ -781,7 +781,8 @@ xd_add_watch (watch, data)
781 return TRUE; 781 return TRUE;
782} 782}
783 783
784/* Remove connection file descriptor from input_wait_mask. */ 784/* Remove connection file descriptor from input_wait_mask. DATA is
785 the used bus, either QCdbus_system_bus or QCdbus_session_bus. */
785void 786void
786xd_remove_watch (watch, data) 787xd_remove_watch (watch, data)
787 DBusWatch *watch; 788 DBusWatch *watch;
@@ -791,18 +792,25 @@ xd_remove_watch (watch, data)
791 if (dbus_watch_get_flags (watch) & DBUS_WATCH_READABLE) 792 if (dbus_watch_get_flags (watch) & DBUS_WATCH_READABLE)
792 { 793 {
793#if HAVE_DBUS_WATCH_GET_UNIX_FD 794#if HAVE_DBUS_WATCH_GET_UNIX_FD
794 /* TODO: Reverse these on Win32, which prefers the opposite. */ 795 /* TODO: Reverse these on Win32, which prefers the opposite. */
795 int fd = dbus_watch_get_unix_fd(watch); 796 int fd = dbus_watch_get_unix_fd(watch);
796 if (fd == -1) 797 if (fd == -1)
797 fd = dbus_watch_get_socket(watch); 798 fd = dbus_watch_get_socket(watch);
798#else 799#else
799 int fd = dbus_watch_get_fd(watch); 800 int fd = dbus_watch_get_fd(watch);
800#endif 801#endif
801 XD_DEBUG_MESSAGE ("%d", fd); 802 XD_DEBUG_MESSAGE ("fd %d", fd);
802 803
803 if (fd == -1) 804 if (fd == -1)
804 return; 805 return;
805 806
807 /* Unset session environment. */
808 if ((data != NULL) && (data == (void*) XHASH (QCdbus_session_bus)))
809 {
810 XD_DEBUG_MESSAGE ("unsetenv DBUS_SESSION_BUS_ADDRESS");
811 unsetenv ("DBUS_SESSION_BUS_ADDRESS");
812 }
813
806 /* Remove the file descriptor from input_wait_mask. */ 814 /* Remove the file descriptor from input_wait_mask. */
807 delete_keyboard_wait_descriptor (fd); 815 delete_keyboard_wait_descriptor (fd);
808 } 816 }
@@ -825,11 +833,12 @@ This is an internal function, it shall not be used outside dbus.el. */)
825 /* Open a connection to the bus. */ 833 /* Open a connection to the bus. */
826 connection = xd_initialize (bus); 834 connection = xd_initialize (bus);
827 835
828 /* Add the watch functions. */ 836 /* Add the watch functions. We pass also the bus as data, in order
837 to distinguish between the busses in xd_remove_watch. */
829 if (!dbus_connection_set_watch_functions (connection, 838 if (!dbus_connection_set_watch_functions (connection,
830 xd_add_watch, 839 xd_add_watch,
831 xd_remove_watch, 840 xd_remove_watch,
832 NULL, NULL, NULL)) 841 NULL, (void*) XHASH (bus), NULL))
833 XD_SIGNAL1 (build_string ("Cannot add watch functions")); 842 XD_SIGNAL1 (build_string ("Cannot add watch functions"));
834 843
835 /* Return. */ 844 /* Return. */
diff --git a/src/dispnew.c b/src/dispnew.c
index 94bbab225f9..885d85f9809 100644
--- a/src/dispnew.c
+++ b/src/dispnew.c
@@ -6346,8 +6346,11 @@ change_frame_size_1 (f, newheight, newwidth, pretend, delay, safe)
6346 check_frame_size (f, &newheight, &newwidth); 6346 check_frame_size (f, &newheight, &newwidth);
6347 6347
6348 /* If we're not changing the frame size, quit now. */ 6348 /* If we're not changing the frame size, quit now. */
6349 /* Frame width may be unchanged but the text portion may change, for example,
6350 fullscreen and remove/add scroll bar. */
6349 if (newheight == FRAME_LINES (f) 6351 if (newheight == FRAME_LINES (f)
6350 && new_frame_total_cols == FRAME_TOTAL_COLS (f)) 6352 && newwidth == FRAME_COLS (f) // text portion unchanged
6353 && new_frame_total_cols == FRAME_TOTAL_COLS (f)) // frame width unchanged
6351 return; 6354 return;
6352 6355
6353 BLOCK_INPUT; 6356 BLOCK_INPUT;
diff --git a/src/font.c b/src/font.c
index 3a8f73a6b03..2141fe651c3 100644
--- a/src/font.c
+++ b/src/font.c
@@ -143,6 +143,8 @@ Lisp_Object Qc, Qm, Qp, Qd;
143 characters; used in xfont.c and ftfont.c. */ 143 characters; used in xfont.c and ftfont.c. */
144Lisp_Object Qja, Qko; 144Lisp_Object Qja, Qko;
145 145
146Lisp_Object QCuser_spec;
147
146Lisp_Object Vfont_encoding_alist; 148Lisp_Object Vfont_encoding_alist;
147 149
148/* Alist of font registry symbol and the corresponding charsets 150/* Alist of font registry symbol and the corresponding charsets
@@ -2989,16 +2991,6 @@ font_open_entity (f, entity, pixel_size)
2989 else if (CONSP (Vface_font_rescale_alist)) 2991 else if (CONSP (Vface_font_rescale_alist))
2990 scaled_pixel_size = pixel_size * font_rescale_ratio (entity); 2992 scaled_pixel_size = pixel_size * font_rescale_ratio (entity);
2991 2993
2992#if 0
2993 /* This doesn't work if you have changed hinting or any other parameter.
2994 We need to make a new object in every case to be sure. */
2995 for (objlist = AREF (entity, FONT_OBJLIST_INDEX); CONSP (objlist);
2996 objlist = XCDR (objlist))
2997 if (! NILP (AREF (XCAR (objlist), FONT_TYPE_INDEX))
2998 && XFONT_OBJECT (XCAR (objlist))->pixel_size == pixel_size)
2999 return XCAR (objlist);
3000#endif
3001
3002 val = AREF (entity, FONT_TYPE_INDEX); 2994 val = AREF (entity, FONT_TYPE_INDEX);
3003 for (driver_list = f->font_driver_list; 2995 for (driver_list = f->font_driver_list;
3004 driver_list && ! EQ (driver_list->driver->type, val); 2996 driver_list && ! EQ (driver_list->driver->type, val);
@@ -3006,6 +2998,19 @@ font_open_entity (f, entity, pixel_size)
3006 if (! driver_list) 2998 if (! driver_list)
3007 return Qnil; 2999 return Qnil;
3008 3000
3001 for (objlist = AREF (entity, FONT_OBJLIST_INDEX); CONSP (objlist);
3002 objlist = XCDR (objlist))
3003 {
3004 Lisp_Object fn = XCAR (objlist);
3005 if (! NILP (AREF (fn, FONT_TYPE_INDEX))
3006 && XFONT_OBJECT (fn)->pixel_size == pixel_size)
3007 {
3008 if (driver_list->driver->cached_font_ok == NULL
3009 || driver_list->driver->cached_font_ok (f, fn, entity))
3010 return fn;
3011 }
3012 }
3013
3009 font_object = driver_list->driver->open (f, entity, scaled_pixel_size); 3014 font_object = driver_list->driver->open (f, entity, scaled_pixel_size);
3010 if (!NILP (font_object)) 3015 if (!NILP (font_object))
3011 ASET (font_object, FONT_SIZE_INDEX, make_number (pixel_size)); 3016 ASET (font_object, FONT_SIZE_INDEX, make_number (pixel_size));
@@ -3161,6 +3166,7 @@ font_spec_from_name (font_name)
3161 if (font_parse_name ((char *) SDATA (font_name), spec) == -1) 3166 if (font_parse_name ((char *) SDATA (font_name), spec) == -1)
3162 return Qnil; 3167 return Qnil;
3163 font_put_extra (spec, QCname, font_name); 3168 font_put_extra (spec, QCname, font_name);
3169 font_put_extra (spec, QCuser_spec, font_name);
3164 return spec; 3170 return spec;
3165} 3171}
3166 3172
@@ -3174,14 +3180,13 @@ font_clear_prop (attrs, prop)
3174 3180
3175 if (! FONTP (font)) 3181 if (! FONTP (font))
3176 return; 3182 return;
3177#if 0 3183
3178 if (! NILP (Ffont_get (font, QCname))) 3184 if (! NILP (Ffont_get (font, QCname)))
3179 { 3185 {
3180 font = Fcopy_font_spec (font); 3186 font = Fcopy_font_spec (font);
3181 font_put_extra (font, QCname, Qnil); 3187 font_put_extra (font, QCname, Qnil);
3182 } 3188 }
3183 3189
3184#endif
3185 if (NILP (AREF (font, prop)) 3190 if (NILP (AREF (font, prop))
3186 && prop != FONT_FAMILY_INDEX 3191 && prop != FONT_FAMILY_INDEX
3187 && prop != FONT_FOUNDRY_INDEX 3192 && prop != FONT_FOUNDRY_INDEX
@@ -3539,8 +3544,8 @@ font_load_for_lface (f, attrs, spec)
3539 entity = font_open_for_lface (f, entity, attrs, spec); 3544 entity = font_open_for_lface (f, entity, attrs, spec);
3540 if (!NILP (entity)) 3545 if (!NILP (entity))
3541 { 3546 {
3542 name = Ffont_get (spec, QCname); 3547 name = Ffont_get (spec, QCuser_spec);
3543 if (STRINGP (name)) font_put_extra (entity, QCname, name); 3548 if (STRINGP (name)) font_put_extra (entity, QCuser_spec, name);
3544 } 3549 }
3545 return entity; 3550 return entity;
3546} 3551}
@@ -3614,7 +3619,7 @@ font_open_by_name (f, name)
3614 ret = font_open_by_spec (f, spec); 3619 ret = font_open_by_spec (f, spec);
3615 /* Do not loose name originally put in. */ 3620 /* Do not loose name originally put in. */
3616 if (!NILP (ret)) 3621 if (!NILP (ret))
3617 font_put_extra (ret, QCname, args[1]); 3622 font_put_extra (ret, QCuser_spec, args[1]);
3618 3623
3619 return ret; 3624 return ret;
3620} 3625}
@@ -5269,6 +5274,8 @@ syms_of_font ()
5269 DEFSYM (Qja, "ja"); 5274 DEFSYM (Qja, "ja");
5270 DEFSYM (Qko, "ko"); 5275 DEFSYM (Qko, "ko");
5271 5276
5277 DEFSYM (QCuser_spec, "user-spec");
5278
5272 staticpro (&null_vector); 5279 staticpro (&null_vector);
5273 null_vector = Fmake_vector (make_number (0), Qnil); 5280 null_vector = Fmake_vector (make_number (0), Qnil);
5274 5281
diff --git a/src/font.h b/src/font.h
index 1a09df2558c..798676d546e 100644
--- a/src/font.h
+++ b/src/font.h
@@ -689,6 +689,14 @@ struct font_driver
689 int c, unsigned variations[256])); 689 int c, unsigned variations[256]));
690 690
691 void (*filter_properties) P_ ((Lisp_Object font, Lisp_Object properties)); 691 void (*filter_properties) P_ ((Lisp_Object font, Lisp_Object properties));
692
693 /* Optional.
694
695 Return non-zero if FONT_OBJECT can be used as a (cached) font
696 for ENTITY on frame F. */
697 int (*cached_font_ok) P_ ((struct frame *f,
698 Lisp_Object font_object,
699 Lisp_Object entity));
692}; 700};
693 701
694 702
diff --git a/src/fontset.c b/src/fontset.c
index 30620e511c8..b62c779be70 100644
--- a/src/fontset.c
+++ b/src/fontset.c
@@ -533,8 +533,8 @@ fontset_find_font (fontset, c, face, id, fallback)
533{ 533{
534 Lisp_Object vec, font_group; 534 Lisp_Object vec, font_group;
535 int i, charset_matched = 0, found_index; 535 int i, charset_matched = 0, found_index;
536 FRAME_PTR f = (FRAMEP (FONTSET_FRAME (fontset))) 536 FRAME_PTR f = (FRAMEP (FONTSET_FRAME (fontset))
537 ? XFRAME (selected_frame) : XFRAME (FONTSET_FRAME (fontset)); 537 ? XFRAME (FONTSET_FRAME (fontset)) : XFRAME (selected_frame));
538 Lisp_Object rfont_def; 538 Lisp_Object rfont_def;
539 539
540 font_group = fontset_get_font_group (fontset, fallback ? -1 : c); 540 font_group = fontset_get_font_group (fontset, fallback ? -1 : c);
diff --git a/src/gtkutil.c b/src/gtkutil.c
index cd9c930c7c2..1dab467a0ac 100644
--- a/src/gtkutil.c
+++ b/src/gtkutil.c
@@ -568,6 +568,42 @@ xg_set_geometry (f)
568 f->left_pos, f->top_pos); 568 f->left_pos, f->top_pos);
569} 569}
570 570
571/* Clear under internal border if any. As we use a mix of Gtk+ and X calls
572 and use a GtkFixed widget, this doesn't happen automatically. */
573
574static void
575xg_clear_under_internal_border (f)
576 FRAME_PTR f;
577{
578 if (FRAME_INTERNAL_BORDER_WIDTH (f) > 0)
579 {
580 GtkWidget *wfixed = f->output_data.x->edit_widget;
581 gtk_widget_queue_draw (wfixed);
582 gdk_window_process_all_updates ();
583 x_clear_area (FRAME_X_DISPLAY (f),
584 FRAME_X_WINDOW (f),
585 0, 0,
586 FRAME_PIXEL_WIDTH (f),
587 FRAME_INTERNAL_BORDER_WIDTH (f), 0);
588 x_clear_area (FRAME_X_DISPLAY (f),
589 FRAME_X_WINDOW (f),
590 0, 0,
591 FRAME_INTERNAL_BORDER_WIDTH (f),
592 FRAME_PIXEL_HEIGHT (f), 0);
593 x_clear_area (FRAME_X_DISPLAY (f),
594 FRAME_X_WINDOW (f),
595 0, FRAME_PIXEL_HEIGHT (f) - FRAME_INTERNAL_BORDER_WIDTH (f),
596 FRAME_PIXEL_WIDTH (f),
597 FRAME_INTERNAL_BORDER_WIDTH (f), 0);
598 x_clear_area (FRAME_X_DISPLAY (f),
599 FRAME_X_WINDOW (f),
600 FRAME_PIXEL_WIDTH (f) - FRAME_INTERNAL_BORDER_WIDTH (f),
601 0,
602 FRAME_INTERNAL_BORDER_WIDTH (f),
603 FRAME_PIXEL_HEIGHT (f), 0);
604 }
605}
606
571/* Function to handle resize of our frame. As we have a Gtk+ tool bar 607/* Function to handle resize of our frame. As we have a Gtk+ tool bar
572 and a Gtk+ menu bar, we get resize events for the edit part of the 608 and a Gtk+ menu bar, we get resize events for the edit part of the
573 frame only. We let Gtk+ deal with the Gtk+ parts. 609 frame only. We let Gtk+ deal with the Gtk+ parts.
@@ -584,8 +620,8 @@ xg_frame_resized (f, pixelwidth, pixelheight)
584 if (pixelwidth == -1 && pixelheight == -1) 620 if (pixelwidth == -1 && pixelheight == -1)
585 { 621 {
586 if (FRAME_GTK_WIDGET (f) && GTK_WIDGET_MAPPED (FRAME_GTK_WIDGET (f))) 622 if (FRAME_GTK_WIDGET (f) && GTK_WIDGET_MAPPED (FRAME_GTK_WIDGET (f)))
587 gdk_window_get_geometry(FRAME_GTK_WIDGET (f)->window, 0, 0, 623 gdk_window_get_geometry (FRAME_GTK_WIDGET (f)->window, 0, 0,
588 &pixelwidth, &pixelheight, 0); 624 &pixelwidth, &pixelheight, 0);
589 else return; 625 else return;
590 } 626 }
591 627
@@ -601,6 +637,7 @@ xg_frame_resized (f, pixelwidth, pixelheight)
601 FRAME_PIXEL_WIDTH (f) = pixelwidth; 637 FRAME_PIXEL_WIDTH (f) = pixelwidth;
602 FRAME_PIXEL_HEIGHT (f) = pixelheight; 638 FRAME_PIXEL_HEIGHT (f) = pixelheight;
603 639
640 xg_clear_under_internal_border (f);
604 change_frame_size (f, rows, columns, 0, 1, 0); 641 change_frame_size (f, rows, columns, 0, 1, 0);
605 SET_FRAME_GARBAGED (f); 642 SET_FRAME_GARBAGED (f);
606 cancel_mouse_face (f); 643 cancel_mouse_face (f);
@@ -637,6 +674,10 @@ xg_frame_set_char_size (f, cols, rows)
637 after calculating that value. */ 674 after calculating that value. */
638 pixelwidth = FRAME_TEXT_COLS_TO_PIXEL_WIDTH (f, cols); 675 pixelwidth = FRAME_TEXT_COLS_TO_PIXEL_WIDTH (f, cols);
639 676
677
678 /* Do this before resize, as we don't know yet if we will be resized. */
679 xg_clear_under_internal_border (f);
680
640 /* Must resize our top level widget. Font size may have changed, 681 /* Must resize our top level widget. Font size may have changed,
641 but not rows/cols. */ 682 but not rows/cols. */
642 gtk_window_resize (GTK_WINDOW (FRAME_GTK_OUTER_WIDGET (f)), 683 gtk_window_resize (GTK_WINDOW (FRAME_GTK_OUTER_WIDGET (f)),
@@ -3201,15 +3242,43 @@ xg_update_scrollbar_pos (f, scrollbar_id, top, left, width, height)
3201 { 3242 {
3202 GtkWidget *wfixed = f->output_data.x->edit_widget; 3243 GtkWidget *wfixed = f->output_data.x->edit_widget;
3203 GtkWidget *wparent = gtk_widget_get_parent (wscroll); 3244 GtkWidget *wparent = gtk_widget_get_parent (wscroll);
3245 GtkFixed *wf = GTK_FIXED (wfixed);
3246
3247 /* Clear out old position. */
3248 GList *iter;
3249 int oldx = -1, oldy = -1, oldw, oldh;
3250 for (iter = wf->children; iter; iter = iter->next)
3251 if (((GtkFixedChild *)iter->data)->widget == wparent)
3252 {
3253 GtkFixedChild *ch = (GtkFixedChild *)iter->data;
3254 if (ch->x != left || ch->y != top)
3255 {
3256 oldx = ch->x;
3257 oldy = ch->y;
3258 gtk_widget_get_size_request (wscroll, &oldw, &oldh);
3259 }
3260 break;
3261 }
3204 3262
3205 /* Move and resize to new values. */ 3263 /* Move and resize to new values. */
3206 gtk_fixed_move (GTK_FIXED (wfixed), wparent, left, top); 3264 gtk_fixed_move (GTK_FIXED (wfixed), wparent, left, top);
3207 gtk_widget_set_size_request (wscroll, width, height); 3265 gtk_widget_set_size_request (wscroll, width, height);
3208 gtk_widget_queue_draw (wparent); 3266 gtk_widget_queue_draw (wfixed);
3209 gdk_window_process_all_updates (); 3267 gdk_window_process_all_updates ();
3268 if (oldx != -1)
3269 {
3270 /* Clear under old scroll bar position. This must be done after
3271 the gtk_widget_queue_draw and gdk_window_process_all_updates
3272 above. */
3273 x_clear_area (FRAME_X_DISPLAY (f),
3274 FRAME_X_WINDOW (f),
3275 oldx, oldy, oldw, oldh, 0);
3276 }
3277
3210 /* GTK does not redraw until the main loop is entered again, but 3278 /* GTK does not redraw until the main loop is entered again, but
3211 if there are no X events pending we will not enter it. So we sync 3279 if there are no X events pending we will not enter it. So we sync
3212 here to get some events. */ 3280 here to get some events. */
3281
3213 x_sync (f); 3282 x_sync (f);
3214 SET_FRAME_GARBAGED (f); 3283 SET_FRAME_GARBAGED (f);
3215 cancel_mouse_face (f); 3284 cancel_mouse_face (f);
diff --git a/src/keyboard.c b/src/keyboard.c
index 7a137ea0dca..13d13cd3276 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -9502,7 +9502,13 @@ read_key_sequence (keybuf, bufsize, prompt, dont_downcase_last,
9502 key = read_char (NILP (prompt), nmaps, 9502 key = read_char (NILP (prompt), nmaps,
9503 (Lisp_Object *) submaps, last_nonmenu_event, 9503 (Lisp_Object *) submaps, last_nonmenu_event,
9504 &used_mouse_menu, NULL); 9504 &used_mouse_menu, NULL);
9505 if (INTEGERP (key) && XINT (key) == -2) /* wrong_kboard_jmpbuf */ 9505 if ((INTEGERP (key) && XINT (key) == -2) /* wrong_kboard_jmpbuf */
9506 /* When switching to a new tty (with a new keyboard),
9507 read_char returns the new buffer, rather than -2
9508 (Bug#5095). This is because `terminal-init-xterm'
9509 calls read-char, which eats the wrong_kboard_jmpbuf
9510 return. Any better way to fix this? -- cyd */
9511 || (interrupted_kboard != current_kboard))
9506 { 9512 {
9507 int found = 0; 9513 int found = 0;
9508 struct kboard *k; 9514 struct kboard *k;
diff --git a/src/nsfns.m b/src/nsfns.m
index 642ff794c05..08564c7216c 100644
--- a/src/nsfns.m
+++ b/src/nsfns.m
@@ -206,30 +206,28 @@ ns_get_window (Lisp_Object maybeFrame)
206static NSScreen * 206static NSScreen *
207ns_get_screen (Lisp_Object screen) 207ns_get_screen (Lisp_Object screen)
208{ 208{
209 struct terminal *terminal = get_terminal (screen, 1); 209 struct frame *f;
210 struct terminal *terminal;
211
212 if (EQ (Qt, screen)) /* not documented */
213 return [NSScreen mainScreen];
214
215 terminal = get_terminal (screen, 1);
210 if (terminal->type != output_ns) 216 if (terminal->type != output_ns)
211 // Not sure if this special case for nil is needed. It does seem to be 217 return NULL;
212 // important in xfns.c for the make-frame call in frame-initialize, 218
213 // so let's keep it here for now. 219 if (NILP (screen))
214 return (NILP (screen) ? [NSScreen mainScreen] : NULL); 220 f = SELECTED_FRAME ();
221 else if (FRAMEP (screen))
222 f = XFRAME (screen);
215 else 223 else
216 { 224 {
217 struct ns_display_info *dpyinfo = terminal->display_info.ns; 225 struct ns_display_info *dpyinfo = terminal->display_info.ns;
218 struct frame *f = dpyinfo->x_focus_frame; 226 f = (dpyinfo->x_focus_frame || dpyinfo->x_highlight_frame);
219 if (!f)
220 f = dpyinfo->x_highlight_frame;
221 if (!f)
222 return NULL;
223 else
224 {
225 id window = nil;
226 Lisp_Object frame;
227 eassert (FRAME_NS_P (f));
228 XSETFRAME (frame, f);
229 window = ns_get_window (frame);
230 return window ? [window screen] : NULL;
231 }
232 } 227 }
228
229 return ((f && FRAME_NS_P (f)) ? [[FRAME_NS_VIEW (f) window] screen]
230 : NULL);
233} 231}
234 232
235 233
@@ -2325,15 +2323,21 @@ that stands for the selected frame's display. */)
2325 Lisp_Object display; 2323 Lisp_Object display;
2326{ 2324{
2327 int top; 2325 int top;
2326 NSScreen *screen;
2328 NSRect vScreen; 2327 NSRect vScreen;
2329 2328
2330 check_ns (); 2329 check_ns ();
2331 vScreen = [ns_get_screen (display) visibleFrame]; 2330 screen = ns_get_screen (display);
2332 top = vScreen.origin.y == 0.0 ? 2331 if (!screen)
2333 (int) [ns_get_screen (display) frame].size.height - vScreen.size.height : 0; 2332 return Qnil;
2333
2334 vScreen = [screen visibleFrame];
2334 2335
2336 /* NS coordinate system is upside-down.
2337 Transform to screen-specific coordinates. */
2335 return list4 (make_number ((int) vScreen.origin.x), 2338 return list4 (make_number ((int) vScreen.origin.x),
2336 make_number (top), 2339 make_number ((int) [screen frame].size.height
2340 - vScreen.size.height - vScreen.origin.y),
2337 make_number ((int) vScreen.size.width), 2341 make_number ((int) vScreen.size.width),
2338 make_number ((int) vScreen.size.height)); 2342 make_number ((int) vScreen.size.height));
2339} 2343}
diff --git a/src/xftfont.c b/src/xftfont.c
index 82701ce0afe..26294ff16a6 100644
--- a/src/xftfont.c
+++ b/src/xftfont.c
@@ -237,6 +237,56 @@ xftfont_fix_match (pat, match)
237 } 237 }
238} 238}
239 239
240static void
241xftfont_add_rendering_parameters (pat, entity)
242 FcPattern *pat;
243 Lisp_Object entity;
244{
245 Lisp_Object tail;
246 int ival;
247
248 for (tail = AREF (entity, FONT_EXTRA_INDEX); CONSP (tail); tail = XCDR (tail))
249 {
250 Lisp_Object key = XCAR (XCAR (tail));
251 Lisp_Object val = XCDR (XCAR (tail));
252
253 if (EQ (key, QCantialias))
254 FcPatternAddBool (pat, FC_ANTIALIAS, NILP (val) ? FcFalse : FcTrue);
255 else if (EQ (key, QChinting))
256 FcPatternAddBool (pat, FC_HINTING, NILP (val) ? FcFalse : FcTrue);
257 else if (EQ (key, QCautohint))
258 FcPatternAddBool (pat, FC_AUTOHINT, NILP (val) ? FcFalse : FcTrue);
259 else if (EQ (key, QChintstyle))
260 {
261 if (INTEGERP (val))
262 FcPatternAddInteger (pat, FC_HINT_STYLE, XINT (val));
263 else if (SYMBOLP (val)
264 && FcNameConstant (SDATA (SYMBOL_NAME (val)), &ival))
265 FcPatternAddInteger (pat, FC_HINT_STYLE, ival);
266 }
267 else if (EQ (key, QCrgba))
268 {
269 if (INTEGERP (val))
270 FcPatternAddInteger (pat, FC_RGBA, XINT (val));
271 else if (SYMBOLP (val)
272 && FcNameConstant (SDATA (SYMBOL_NAME (val)), &ival))
273 FcPatternAddInteger (pat, FC_RGBA, ival);
274 }
275 else if (EQ (key, QClcdfilter))
276 {
277 if (INTEGERP (val))
278 FcPatternAddInteger (pat, FC_LCD_FILTER, ival = XINT (val));
279 else if (SYMBOLP (val)
280 && FcNameConstant (SDATA (SYMBOL_NAME (val)), &ival))
281 FcPatternAddInteger (pat, FC_LCD_FILTER, ival);
282 }
283#ifdef FC_EMBOLDEN
284 else if (EQ (key, QCembolden))
285 FcPatternAddBool (pat, FC_EMBOLDEN, NILP (val) ? FcFalse : FcTrue);
286#endif
287 }
288}
289
240static Lisp_Object 290static Lisp_Object
241xftfont_open (f, entity, pixel_size) 291xftfont_open (f, entity, pixel_size)
242 FRAME_PTR f; 292 FRAME_PTR f;
@@ -245,7 +295,7 @@ xftfont_open (f, entity, pixel_size)
245{ 295{
246 FcResult result; 296 FcResult result;
247 Display *display = FRAME_X_DISPLAY (f); 297 Display *display = FRAME_X_DISPLAY (f);
248 Lisp_Object val, filename, index, tail, font_object; 298 Lisp_Object val, filename, index, font_object;
249 FcPattern *pat = NULL, *match; 299 FcPattern *pat = NULL, *match;
250 struct xftfont_info *xftfont_info = NULL; 300 struct xftfont_info *xftfont_info = NULL;
251 struct font *font; 301 struct font *font;
@@ -253,7 +303,7 @@ xftfont_open (f, entity, pixel_size)
253 XftFont *xftfont = NULL; 303 XftFont *xftfont = NULL;
254 int spacing; 304 int spacing;
255 char name[256]; 305 char name[256];
256 int len, i, ival; 306 int len, i;
257 XGlyphInfo extents; 307 XGlyphInfo extents;
258 FT_Face ft_face; 308 FT_Face ft_face;
259 FcMatrix *matrix; 309 FcMatrix *matrix;
@@ -297,46 +347,7 @@ xftfont_open (f, entity, pixel_size)
297 over 10x20-ISO8859-1.pcf.gz). */ 347 over 10x20-ISO8859-1.pcf.gz). */
298 FcPatternAddCharSet (pat, FC_CHARSET, ftfont_get_fc_charset (entity)); 348 FcPatternAddCharSet (pat, FC_CHARSET, ftfont_get_fc_charset (entity));
299 349
300 for (tail = AREF (entity, FONT_EXTRA_INDEX); CONSP (tail); tail = XCDR (tail)) 350 xftfont_add_rendering_parameters (pat, entity);
301 {
302 Lisp_Object key, val;
303
304 key = XCAR (XCAR (tail)), val = XCDR (XCAR (tail));
305 if (EQ (key, QCantialias))
306 FcPatternAddBool (pat, FC_ANTIALIAS, NILP (val) ? FcFalse : FcTrue);
307 else if (EQ (key, QChinting))
308 FcPatternAddBool (pat, FC_HINTING, NILP (val) ? FcFalse : FcTrue);
309 else if (EQ (key, QCautohint))
310 FcPatternAddBool (pat, FC_AUTOHINT, NILP (val) ? FcFalse : FcTrue);
311 else if (EQ (key, QChintstyle))
312 {
313 if (INTEGERP (val))
314 FcPatternAddInteger (pat, FC_HINT_STYLE, XINT (val));
315 else if (SYMBOLP (val)
316 && FcNameConstant (SDATA (SYMBOL_NAME (val)), &ival))
317 FcPatternAddInteger (pat, FC_HINT_STYLE, ival);
318 }
319 else if (EQ (key, QCrgba))
320 {
321 if (INTEGERP (val))
322 FcPatternAddInteger (pat, FC_RGBA, XINT (val));
323 else if (SYMBOLP (val)
324 && FcNameConstant (SDATA (SYMBOL_NAME (val)), &ival))
325 FcPatternAddInteger (pat, FC_RGBA, ival);
326 }
327 else if (EQ (key, QClcdfilter))
328 {
329 if (INTEGERP (val))
330 FcPatternAddInteger (pat, FC_LCD_FILTER, ival = XINT (val));
331 else if (SYMBOLP (val)
332 && FcNameConstant (SDATA (SYMBOL_NAME (val)), &ival))
333 FcPatternAddInteger (pat, FC_LCD_FILTER, ival);
334 }
335#ifdef FC_EMBOLDEN
336 else if (EQ (key, QCembolden))
337 FcPatternAddBool (pat, FC_EMBOLDEN, NILP (val) ? FcFalse : FcTrue);
338#endif
339 }
340 351
341 FcPatternAddString (pat, FC_FILE, (FcChar8 *) SDATA (filename)); 352 FcPatternAddString (pat, FC_FILE, (FcChar8 *) SDATA (filename));
342 FcPatternAddInteger (pat, FC_INDEX, XINT (index)); 353 FcPatternAddInteger (pat, FC_INDEX, XINT (index));
@@ -712,6 +723,53 @@ xftfont_end_for_frame (f)
712 return 0; 723 return 0;
713} 724}
714 725
726static int
727xftfont_cached_font_ok (f, font_object, entity)
728 struct frame *f;
729 Lisp_Object font_object;
730 Lisp_Object entity;
731
732{
733 struct xftfont_info *info = (struct xftfont_info *) XFONT_OBJECT (font_object);
734 FcPattern *oldpat = info->xftfont->pattern;
735 Display *display = FRAME_X_DISPLAY (f);
736 FcPattern *pat = FcPatternCreate ();
737 FcBool b1, b2;
738 int ok = 0, i1, i2, r1, r2;
739
740 xftfont_add_rendering_parameters (pat, entity);
741 XftDefaultSubstitute (display, FRAME_X_SCREEN_NUMBER (f), pat);
742
743 r1 = FcPatternGetBool (pat, FC_ANTIALIAS, 0, &b1);
744 r2 = FcPatternGetBool (oldpat, FC_ANTIALIAS, 0, &b2);
745 if (r1 != r2 || b1 != b2) goto out;
746 r1 = FcPatternGetBool (pat, FC_HINTING, 0, &b1);
747 r2 = FcPatternGetBool (oldpat, FC_HINTING, 0, &b2);
748 if (r1 != r2 || b1 != b2) goto out;
749 r1 = FcPatternGetBool (pat, FC_AUTOHINT, 0, &b1);
750 r2 = FcPatternGetBool (oldpat, FC_AUTOHINT, 0, &b2);
751 if (r1 != r2 || b1 != b2) goto out;
752#ifdef FC_EMBOLDEN
753 r1 = FcPatternGetBool (pat, FC_EMBOLDEN, 0, &b1);
754 r2 = FcPatternGetBool (oldpat, FC_EMBOLDEN, 0, &b2);
755 if (r1 != r2 || b1 != b2) goto out;
756#endif
757 r1 = FcPatternGetInteger (pat, FC_HINT_STYLE, 0, &i1);
758 r2 = FcPatternGetInteger (oldpat, FC_HINT_STYLE, 0, &i2);
759 if (r1 != r2 || i1 != i2) goto out;
760 r1 = FcPatternGetInteger (pat, FC_LCD_FILTER, 0, &i1);
761 r2 = FcPatternGetInteger (oldpat, FC_LCD_FILTER, 0, &i2);
762 if (r1 != r2 || i1 != i2) goto out;
763 r1 = FcPatternGetInteger (pat, FC_RGBA, 0, &i1);
764 r2 = FcPatternGetInteger (oldpat, FC_RGBA, 0, &i2);
765 if (r1 != r2 || i1 != i2) goto out;
766
767 ok = 1;
768 out:
769 FcPatternDestroy (pat);
770 return ok;
771}
772
715void 773void
716syms_of_xftfont () 774syms_of_xftfont ()
717{ 775{
@@ -737,6 +795,7 @@ syms_of_xftfont ()
737 xftfont_driver.text_extents = xftfont_text_extents; 795 xftfont_driver.text_extents = xftfont_text_extents;
738 xftfont_driver.draw = xftfont_draw; 796 xftfont_driver.draw = xftfont_draw;
739 xftfont_driver.end_for_frame = xftfont_end_for_frame; 797 xftfont_driver.end_for_frame = xftfont_end_for_frame;
798 xftfont_driver.cached_font_ok = xftfont_cached_font_ok;
740 799
741 register_font_driver (&xftfont_driver, NULL); 800 register_font_driver (&xftfont_driver, NULL);
742} 801}
diff --git a/src/xterm.c b/src/xterm.c
index 7f9f6f3c05e..efd30f4a601 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -2951,6 +2951,12 @@ x_clear_frame (struct frame *f)
2951 colors or something like that, then they should be notified. */ 2951 colors or something like that, then they should be notified. */
2952 x_scroll_bar_clear (f); 2952 x_scroll_bar_clear (f);
2953 2953
2954#if defined (USE_GTK) && defined (USE_TOOLKIT_SCROLL_BARS)
2955 /* Make sure scroll bars are redrawn. As they aren't redrawn by
2956 redisplay, do it here. */
2957 gtk_widget_queue_draw (FRAME_GTK_WIDGET (f));
2958#endif
2959
2954 XFlush (FRAME_X_DISPLAY (f)); 2960 XFlush (FRAME_X_DISPLAY (f));
2955 2961
2956 UNBLOCK_INPUT; 2962 UNBLOCK_INPUT;
@@ -8064,32 +8070,7 @@ x_new_font (f, font_object, fontset)
8064 doing it because it's done in Fx_show_tip, and it leads to 8070 doing it because it's done in Fx_show_tip, and it leads to
8065 problems because the tip frame has no widget. */ 8071 problems because the tip frame has no widget. */
8066 if (NILP (tip_frame) || XFRAME (tip_frame) != f) 8072 if (NILP (tip_frame) || XFRAME (tip_frame) != f)
8067 { 8073 x_set_window_size (f, 0, FRAME_COLS (f), FRAME_LINES (f));
8068 int rows, cols;
8069
8070 /* When the frame is maximized/fullscreen or running under for
8071 example Xmonad, x_set_window_size will be a no-op.
8072 In that case, the right thing to do is extend rows/cols to
8073 the current frame size. We do that first if x_set_window_size
8074 turns out to not be a no-op (there is no way to know).
8075 The size will be adjusted again if the frame gets a
8076 ConfigureNotify event as a result of x_set_window_size. */
8077 int pixelh = FRAME_PIXEL_HEIGHT (f);
8078#ifdef USE_X_TOOLKIT
8079 /* The menu bar is not part of text lines. The tool bar
8080 is however. */
8081 pixelh -= FRAME_MENUBAR_HEIGHT (f);
8082#endif
8083 rows = FRAME_PIXEL_HEIGHT_TO_TEXT_LINES (f, pixelh);
8084 /* Update f->scroll_bar_actual_width because it is used in
8085 FRAME_PIXEL_WIDTH_TO_TEXT_COLS. */
8086 f->scroll_bar_actual_width
8087 = FRAME_SCROLL_BAR_COLS (f) * FRAME_COLUMN_WIDTH (f);
8088 cols = FRAME_PIXEL_WIDTH_TO_TEXT_COLS (f, FRAME_PIXEL_WIDTH (f));
8089
8090 change_frame_size (f, rows, cols, 0, 1, 0);
8091 x_set_window_size (f, 0, FRAME_COLS (f), FRAME_LINES (f));
8092 }
8093 } 8074 }
8094 8075
8095#ifdef HAVE_X_I18N 8076#ifdef HAVE_X_I18N
@@ -8977,6 +8958,32 @@ x_set_window_size (f, change_gravity, cols, rows)
8977{ 8958{
8978 BLOCK_INPUT; 8959 BLOCK_INPUT;
8979 8960
8961 if (NILP (tip_frame) || XFRAME (tip_frame) != f)
8962 {
8963 int r, c;
8964
8965 /* When the frame is maximized/fullscreen or running under for
8966 example Xmonad, x_set_window_size_1 will be a no-op.
8967 In that case, the right thing to do is extend rows/cols to
8968 the current frame size. We do that first if x_set_window_size_1
8969 turns out to not be a no-op (there is no way to know).
8970 The size will be adjusted again if the frame gets a
8971 ConfigureNotify event as a result of x_set_window_size. */
8972 int pixelh = FRAME_PIXEL_HEIGHT (f);
8973#ifdef USE_X_TOOLKIT
8974 /* The menu bar is not part of text lines. The tool bar
8975 is however. */
8976 pixelh -= FRAME_MENUBAR_HEIGHT (f);
8977#endif
8978 r = FRAME_PIXEL_HEIGHT_TO_TEXT_LINES (f, pixelh);
8979 /* Update f->scroll_bar_actual_width because it is used in
8980 FRAME_PIXEL_WIDTH_TO_TEXT_COLS. */
8981 f->scroll_bar_actual_width
8982 = FRAME_SCROLL_BAR_COLS (f) * FRAME_COLUMN_WIDTH (f);
8983 c = FRAME_PIXEL_WIDTH_TO_TEXT_COLS (f, FRAME_PIXEL_WIDTH (f));
8984 change_frame_size (f, r, c, 0, 1, 0);
8985 }
8986
8980#ifdef USE_GTK 8987#ifdef USE_GTK
8981 if (FRAME_GTK_WIDGET (f)) 8988 if (FRAME_GTK_WIDGET (f))
8982 xg_frame_set_char_size (f, cols, rows); 8989 xg_frame_set_char_size (f, cols, rows);