aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEli Zaretskii2012-10-09 20:28:06 +0200
committerEli Zaretskii2012-10-09 20:28:06 +0200
commitb97f22cdad55a0964758cef3a19ce3fa1098657d (patch)
tree8d078a5b2aab3f55708a5f8eeaf8ca0f022e6ee3
parent87c141ce9750881f6203148e3c49d00710cd472e (diff)
parentb15736e6e33a52021a2a91b0b3360cd5a9803405 (diff)
downloademacs-b97f22cdad55a0964758cef3a19ce3fa1098657d.tar.gz
emacs-b97f22cdad55a0964758cef3a19ce3fa1098657d.zip
Merge from trunk.
-rw-r--r--admin/ChangeLog5
-rw-r--r--admin/admin.el27
-rw-r--r--autogen/config.in2
-rwxr-xr-xautogen/configure2
-rw-r--r--configure.ac4
-rw-r--r--doc/misc/ChangeLog4
-rw-r--r--doc/misc/trampver.texi2
-rw-r--r--etc/NEWS3
-rw-r--r--lisp/ChangeLog82
-rw-r--r--lisp/bindings.el38
-rw-r--r--lisp/cedet/ChangeLog6
-rw-r--r--lisp/cedet/semantic/bovine/el.el2
-rw-r--r--lisp/emacs-lisp/cl-loaddefs.el2
-rw-r--r--lisp/emacs-lisp/cl-macs.el43
-rw-r--r--lisp/ffap.el18
-rw-r--r--lisp/generic-x.el79
-rw-r--r--lisp/gnus/ChangeLog5
-rw-r--r--lisp/gnus/shr.el2
-rw-r--r--lisp/net/tramp-cache.el39
-rw-r--r--lisp/net/tramp-gvfs.el8
-rw-r--r--lisp/net/tramp-sh.el95
-rw-r--r--lisp/net/tramp-smb.el23
-rw-r--r--lisp/net/tramp.el55
-rw-r--r--lisp/net/trampver.el4
-rw-r--r--lisp/newcomment.el12
-rw-r--r--lisp/progmodes/cc-bytecomp.el24
-rw-r--r--lisp/progmodes/cc-vars.el10
-rw-r--r--lisp/progmodes/python.el163
-rw-r--r--lisp/term/w32-win.el2
-rw-r--r--lisp/w32-fns.el2
-rw-r--r--nt/ChangeLog5
-rw-r--r--nt/config.nt3
-rw-r--r--src/ChangeLog49
-rw-r--r--src/conf_post.h16
-rw-r--r--src/emacs.c24
-rw-r--r--src/frame.c8
-rw-r--r--src/image.c25
-rw-r--r--src/keyboard.c6
-rw-r--r--src/makefile.w32-in12
-rw-r--r--src/nsfont.m19
-rw-r--r--src/termhooks.h2
-rw-r--r--src/w32fns.c24
-rw-r--r--src/w32select.h2
-rw-r--r--src/w32term.c3
-rw-r--r--src/xdisp.c5
45 files changed, 546 insertions, 420 deletions
diff --git a/admin/ChangeLog b/admin/ChangeLog
index 7d4921887ce..c10ec67147b 100644
--- a/admin/ChangeLog
+++ b/admin/ChangeLog
@@ -1,3 +1,8 @@
12012-10-09 Glenn Morris <rgm@gnu.org>
2
3 * admin.el (cusver-scan-cus-start): New function.
4 (cusver-check): Scan old cus-start.el.
5
12012-10-07 Glenn Morris <rgm@gnu.org> 62012-10-07 Glenn Morris <rgm@gnu.org>
2 7
3 * admin.el (cusver-new-version): Set default. 8 * admin.el (cusver-new-version): Set default.
diff --git a/admin/admin.el b/admin/admin.el
index 3e3fbba7202..59d085b6405 100644
--- a/admin/admin.el
+++ b/admin/admin.el
@@ -446,8 +446,6 @@ If optional OLD is non-nil, also include defvars."
446 (1+ emacs-minor-version)) 446 (1+ emacs-minor-version))
447 "Version number that new defcustoms should have.") 447 "Version number that new defcustoms should have.")
448 448
449;; TODO do something about renamed variables with aliases to the old name?
450;; Scan old cus-start.el to find variables moved from C to lisp?
451(defun cusver-scan (file &optional old) 449(defun cusver-scan (file &optional old)
452 "Scan FILE for `defcustom' calls. 450 "Scan FILE for `defcustom' calls.
453Return a list with elements of the form (VAR . VER), 451Return a list with elements of the form (VAR . VER),
@@ -486,6 +484,21 @@ If optional argument OLD is non-nil, also scan for defvars."
486 (message "%sdone" m) 484 (message "%sdone" m)
487 alist)) 485 alist))
488 486
487(defun cusver-scan-cus-start (file)
488 "Scan cus-start.el and return an alist with elements (VAR . VER)."
489 (if (file-readable-p file)
490 (with-temp-buffer
491 (insert-file-contents file)
492 (when (search-forward "(let ((all '(" nil t)
493 (backward-char 1)
494 (let (var ver alist)
495 (dolist (elem (ignore-errors (read (current-buffer))))
496 (when (symbolp (setq var (car-safe elem)))
497 (or (stringp (setq ver (nth 3 elem)))
498 (setq ver nil))
499 (setq alist (cons (cons var ver) alist))))
500 alist)))))
501
489(define-button-type 'cusver-xref 'action #'cusver-goto-xref) 502(define-button-type 'cusver-xref 'action #'cusver-goto-xref)
490 503
491(defun cusver-goto-xref (button) 504(defun cusver-goto-xref (button)
@@ -501,11 +514,9 @@ If optional argument OLD is non-nil, also scan for defvars."
501 (pop-to-buffer (current-buffer)))))) 514 (pop-to-buffer (current-buffer))))))
502 515
503;; You should probably at least do a grep over the old directory 516;; You should probably at least do a grep over the old directory
504;; to check the results of this look sensible. Eg cus-start if 517;; to check the results of this look sensible.
505;; something moved from C to Lisp. 518;; TODO Check cus-start if something moved from C to Lisp.
506;; TODO handle renamed things with aliases to the old names. 519;; TODO Handle renamed things with aliases to the old names.
507;; What to do about new files? Does everything in there need a :version,
508;; or eg just the defgroup?
509(defun cusver-check (newdir olddir version) 520(defun cusver-check (newdir olddir version)
510 "Check that defcustoms have :version tags where needed. 521 "Check that defcustoms have :version tags where needed.
511NEWDIR is the current lisp/ directory, OLDDIR is that from the previous 522NEWDIR is the current lisp/ directory, OLDDIR is that from the previous
@@ -537,6 +548,8 @@ changes (in a non-trivial way). This function does not check for that."
537 (message "Reading old defcustoms...") 548 (message "Reading old defcustoms...")
538 (dolist (file oldfiles) 549 (dolist (file oldfiles)
539 (setq oldcus (append oldcus (cusver-scan file t)))) 550 (setq oldcus (append oldcus (cusver-scan file t))))
551 (setq oldcus (append oldcus (cusver-scan-cus-start
552 (expand-file-name "cus-start.el" olddir))))
540 ;; newcus has elements (FILE (VAR VER) ... ). 553 ;; newcus has elements (FILE (VAR VER) ... ).
541 ;; oldcus just (VAR . VER). 554 ;; oldcus just (VAR . VER).
542 (message "Checking for version tags...") 555 (message "Checking for version tags...")
diff --git a/autogen/config.in b/autogen/config.in
index 7aaf6650fa0..c5f32371dd7 100644
--- a/autogen/config.in
+++ b/autogen/config.in
@@ -692,7 +692,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
692 Mac OS X. */ 692 Mac OS X. */
693#undef HAVE_NS 693#undef HAVE_NS
694 694
695/* Define to use native Windows GUI. */ 695/* Define to use native MS Windows GUI. */
696#undef HAVE_NTGUI 696#undef HAVE_NTGUI
697 697
698/* Define to 1 if libotf has OTF_get_variation_glyphs. */ 698/* Define to 1 if libotf has OTF_get_variation_glyphs. */
diff --git a/autogen/configure b/autogen/configure
index 163bbaf8719..67e1039d54c 100755
--- a/autogen/configure
+++ b/autogen/configure
@@ -2084,7 +2084,7 @@ Optional Packages:
2084 --without-xaw3d don't use Xaw3d 2084 --without-xaw3d don't use Xaw3d
2085 --without-xim don't use X11 XIM 2085 --without-xim don't use X11 XIM
2086 --with-ns use NeXTstep (Cocoa or GNUstep) windowing system 2086 --with-ns use NeXTstep (Cocoa or GNUstep) windowing system
2087 --with-w32 use native Windows GUI 2087 --with-w32 use native MS Windows GUI
2088 --without-gpm don't use -lgpm for mouse support on a GNU/Linux 2088 --without-gpm don't use -lgpm for mouse support on a GNU/Linux
2089 console 2089 console
2090 --without-dbus don't compile with D-Bus support 2090 --without-dbus don't compile with D-Bus support
diff --git a/configure.ac b/configure.ac
index 3679424e664..5520dd6a903 100644
--- a/configure.ac
+++ b/configure.ac
@@ -177,7 +177,7 @@ OPTION_DEFAULT_ON([toolkit-scroll-bars],[don't use Motif or Xaw3d scroll bars])
177OPTION_DEFAULT_ON([xaw3d],[don't use Xaw3d]) 177OPTION_DEFAULT_ON([xaw3d],[don't use Xaw3d])
178OPTION_DEFAULT_ON([xim],[don't use X11 XIM]) 178OPTION_DEFAULT_ON([xim],[don't use X11 XIM])
179OPTION_DEFAULT_OFF([ns],[use NeXTstep (Cocoa or GNUstep) windowing system]) 179OPTION_DEFAULT_OFF([ns],[use NeXTstep (Cocoa or GNUstep) windowing system])
180OPTION_DEFAULT_OFF([w32], [use native Windows GUI]) 180OPTION_DEFAULT_OFF([w32], [use native MS Windows GUI])
181 181
182OPTION_DEFAULT_ON([gpm],[don't use -lgpm for mouse support on a GNU/Linux console]) 182OPTION_DEFAULT_ON([gpm],[don't use -lgpm for mouse support on a GNU/Linux console])
183OPTION_DEFAULT_ON([dbus],[don't compile with D-Bus support]) 183OPTION_DEFAULT_ON([dbus],[don't compile with D-Bus support])
@@ -1586,7 +1586,7 @@ if test "${with_w32}" != no; then
1586 AC_CHECK_HEADER([windows.h], [HAVE_W32=yes], 1586 AC_CHECK_HEADER([windows.h], [HAVE_W32=yes],
1587 [AC_MSG_ERROR([`--with-w32' was specified, but windows.h 1587 [AC_MSG_ERROR([`--with-w32' was specified, but windows.h
1588 cannot be found.])]) 1588 cannot be found.])])
1589 AC_DEFINE(HAVE_NTGUI, 1, [Define to use native Windows GUI.]) 1589 AC_DEFINE(HAVE_NTGUI, 1, [Define to use native MS Windows GUI.])
1590 W32_OBJ="w32fns.o w32menu.o w32reg.o w32font.o w32term.o" 1590 W32_OBJ="w32fns.o w32menu.o w32reg.o w32font.o w32term.o"
1591 W32_OBJ="$W32_OBJ w32xfns.o w32select.o w32uniscribe.o" 1591 W32_OBJ="$W32_OBJ w32xfns.o w32select.o w32uniscribe.o"
1592 W32_LIBS="$W32_LIBS -lkernel32 -luser32 -lgdi32 -lole32 -lcomdlg32" 1592 W32_LIBS="$W32_LIBS -lkernel32 -luser32 -lgdi32 -lole32 -lcomdlg32"
diff --git a/doc/misc/ChangeLog b/doc/misc/ChangeLog
index 5fdd4acde95..3ee183ff255 100644
--- a/doc/misc/ChangeLog
+++ b/doc/misc/ChangeLog
@@ -1,3 +1,7 @@
12012-10-09 Michael Albinus <michael.albinus@gmx.de>
2
3 * trampver.texi: Update release number.
4
12012-10-06 Glenn Morris <rgm@gnu.org> 52012-10-06 Glenn Morris <rgm@gnu.org>
2 6
3 * erc.texi: Include emacsver.texi, and use EMACSVER rather than 7 * erc.texi: Include emacsver.texi, and use EMACSVER rather than
diff --git a/doc/misc/trampver.texi b/doc/misc/trampver.texi
index d902ac0fb97..96043a07300 100644
--- a/doc/misc/trampver.texi
+++ b/doc/misc/trampver.texi
@@ -8,7 +8,7 @@
8@c In the Tramp CVS, the version number is auto-frobbed from 8@c In the Tramp CVS, the version number is auto-frobbed from
9@c configure.ac, so you should edit that file and run 9@c configure.ac, so you should edit that file and run
10@c "autoconf && ./configure" to change the version number. 10@c "autoconf && ./configure" to change the version number.
11@set trampver 2.2.6 11@set trampver 2.2.7-pre
12 12
13@c Other flags from configuration 13@c Other flags from configuration
14@set instprefix /usr/local 14@set instprefix /usr/local
diff --git a/etc/NEWS b/etc/NEWS
index 8364b6dd557..2b934741c2c 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -431,6 +431,9 @@ The option `follow-intercept-processes' has been removed.
431specifying URL types which should be converted to remote file names at 431specifying URL types which should be converted to remote file names at
432the FFAP prompt. The default is now '("ftp"). 432the FFAP prompt. The default is now '("ftp").
433 433
434** Generic-x
435`javascript-generic-mode' is now an obsolete alias for `js-mode'.
436
434** Ibuffer 437** Ibuffer
435 438
436*** New `derived-mode' filter, bound to `/ M'. 439*** New `derived-mode' filter, bound to `/ M'.
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 406c50ee9c8..ef9e06b7d58 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,85 @@
12012-10-09 Stefan Monnier <monnier@iro.umontreal.ca>
2
3 * newcomment.el (comment-start-skip, comment-end-skip, comment-end):
4 Don't document nil as a useful value (bug#12583).
5
62012-10-09 Michael Albinus <michael.albinus@gmx.de>
7
8 * net/tramp.el (tramp-debug-message):
9 Remove "tramp-with-progress-reporter" from regexp of ignored functions.
10 (with-tramp-progress-reporter): Rename from
11 `tramp-with-progress-reporter'.
12 (with-tramp-file-property, with-tramp-connection-property):
13 Move from tramp-cache.el, rename from `with-file-property' and
14 `with-connection-property', respectively.
15
16 * net/tramp-cache.el: Remove `with-file-property' and
17 `with-connection-property'.
18
19 * net/tramp.el:
20 * net/tramp-gvfs.el:
21 * net/tramp-sh.el:
22 * net/tramp-smb.el: Adapt callees.
23
24 * net/trampver.el: Update release number.
25
262012-10-09 Glenn Morris <rgm@gnu.org>
27
28 * w32-fns.el (set-message-beep):
29 * term/w32-win.el (set-message-beep): Update declarations.
30
312012-10-09 Stefan Monnier <monnier@iro.umontreal.ca>
32
33 * bindings.el (mode-line-toggle-read-only, mode-line-toggle-modified)
34 (mode-line-widen, mode-line-input-method-map)
35 (mode-line-coding-system-map, mode-line-remote)
36 (mode-line-unbury-buffer, mode-line-bury-buffer)
37 (mode-line-next-buffer, mode-line-previous-buffer):
38 Replace save-selected-window+select-window => with-selected-window.
39
40 * progmodes/cc-bytecomp.el (cc-bytecomp-defmacro): Remove, unused.
41 * progmodes/cc-vars.el (bq-process): Remove, unused.
42
43 * emacs-lisp/cl-macs.el (cl-defstruct): Obey the :read-only property.
44
452012-10-09 Fabián Ezequiel Gallina <fgallina@cuca>
46
47 Implemented `backward-up-list'-like navigation.
48 * progmodes/python.el (python-nav-up-list)
49 (python-nav-backward-up-list): New functions.
50 (python-mode-map): Define substitute key for backward-up-list to
51 python-nav-backward-up-list.
52
532012-10-08 Fabián Ezequiel Gallina <fgallina@cuca>
54
55 * progmodes/python.el (python-fill-paragraph): Rename from
56 python-fill-paragraph-function. Fixed fill-paragraph for
57 decorators (Bug#12605).
58
592012-10-08 Fabián Ezequiel Gallina <fgallina@cuca>
60
61 * progmodes/python.el (python-shell-output-filter): Handle extra
62 carriage return in OSX (Bug#12409).
63
642012-10-08 Fabián Ezequiel Gallina <fgallina@cuca>
65
66 Fix shell handling of unbalanced quotes and parens in output.
67 * progmodes/python.el (python-rx-constituents): Add string-delimiter.
68 (python-syntax-propertize-function): Use it.
69 (python-shell-output-syntax-table): New var.
70 (inferior-python-mode): Prevent unbalanced parens/quotes from
71 previous output mess with current input context.
72
732012-10-08 Juanma Barranquero <lekktu@gmail.com>
74
75 * generic-x.el (javascript-generic-mode, javascript-generic-mode-hook):
76 Make obsolete aliases of js-mode and js-mode-hook (from js.el).
77
782012-10-08 Michael Albinus <michael.albinus@gmx.de>
79
80 * ffap.el (ffap-replace-file-component): Support Tramp file name
81 syntax, not only ange-ftp's one.
82
12012-10-08 Glenn Morris <rgm@gnu.org> 832012-10-08 Glenn Morris <rgm@gnu.org>
2 84
3 * cus-start.el (message-log-max): Set :version. 85 * cus-start.el (message-log-max): Set :version.
diff --git a/lisp/bindings.el b/lisp/bindings.el
index b4f9d29fe52..de5dd48c291 100644
--- a/lisp/bindings.el
+++ b/lisp/bindings.el
@@ -38,23 +38,20 @@ corresponding to the mode line clicked."
38(defun mode-line-toggle-read-only (event) 38(defun mode-line-toggle-read-only (event)
39 "Like `toggle-read-only', for the mode-line." 39 "Like `toggle-read-only', for the mode-line."
40 (interactive "e") 40 (interactive "e")
41 (save-selected-window 41 (with-selected-window (posn-window (event-start event))
42 (select-window (posn-window (event-start event)))
43 (read-only-mode 'toggle))) 42 (read-only-mode 'toggle)))
44 43
45(defun mode-line-toggle-modified (event) 44(defun mode-line-toggle-modified (event)
46 "Toggle the buffer-modified flag from the mode-line." 45 "Toggle the buffer-modified flag from the mode-line."
47 (interactive "e") 46 (interactive "e")
48 (save-selected-window 47 (with-selected-window (posn-window (event-start event))
49 (select-window (posn-window (event-start event)))
50 (set-buffer-modified-p (not (buffer-modified-p))) 48 (set-buffer-modified-p (not (buffer-modified-p)))
51 (force-mode-line-update))) 49 (force-mode-line-update)))
52 50
53(defun mode-line-widen (event) 51(defun mode-line-widen (event)
54 "Widen a buffer from the mode-line." 52 "Widen a buffer from the mode-line."
55 (interactive "e") 53 (interactive "e")
56 (save-selected-window 54 (with-selected-window (posn-window (event-start event))
57 (select-window (posn-window (event-start event)))
58 (widen) 55 (widen)
59 (force-mode-line-update))) 56 (force-mode-line-update)))
60 57
@@ -63,17 +60,13 @@ corresponding to the mode line clicked."
63 (define-key map [mode-line mouse-2] 60 (define-key map [mode-line mouse-2]
64 (lambda (e) 61 (lambda (e)
65 (interactive "e") 62 (interactive "e")
66 (save-selected-window 63 (with-selected-window (posn-window (event-start e))
67 (select-window
68 (posn-window (event-start e)))
69 (toggle-input-method) 64 (toggle-input-method)
70 (force-mode-line-update)))) 65 (force-mode-line-update))))
71 (define-key map [mode-line mouse-3] 66 (define-key map [mode-line mouse-3]
72 (lambda (e) 67 (lambda (e)
73 (interactive "e") 68 (interactive "e")
74 (save-selected-window 69 (with-selected-window (posn-window (event-start e))
75 (select-window
76 (posn-window (event-start e)))
77 (describe-current-input-method)))) 70 (describe-current-input-method))))
78 (purecopy map))) 71 (purecopy map)))
79 72
@@ -82,16 +75,14 @@ corresponding to the mode line clicked."
82 (define-key map [mode-line mouse-1] 75 (define-key map [mode-line mouse-1]
83 (lambda (e) 76 (lambda (e)
84 (interactive "e") 77 (interactive "e")
85 (save-selected-window 78 (with-selected-window (posn-window (event-start e))
86 (select-window (posn-window (event-start e)))
87 (when (and enable-multibyte-characters 79 (when (and enable-multibyte-characters
88 buffer-file-coding-system) 80 buffer-file-coding-system)
89 (describe-coding-system buffer-file-coding-system))))) 81 (describe-coding-system buffer-file-coding-system)))))
90 (define-key map [mode-line mouse-3] 82 (define-key map [mode-line mouse-3]
91 (lambda (e) 83 (lambda (e)
92 (interactive "e") 84 (interactive "e")
93 (save-selected-window 85 (with-selected-window (posn-window (event-start e))
94 (select-window (posn-window (event-start e)))
95 (call-interactively 'set-buffer-file-coding-system)))) 86 (call-interactively 'set-buffer-file-coding-system))))
96 (purecopy map)) 87 (purecopy map))
97 "Local keymap for the coding-system part of the mode line.") 88 "Local keymap for the coding-system part of the mode line.")
@@ -237,8 +228,7 @@ mnemonics of the following coding systems:
237 'mouse-face 'mode-line-highlight 228 'mouse-face 'mode-line-highlight
238 'help-echo (purecopy (lambda (window _object _point) 229 'help-echo (purecopy (lambda (window _object _point)
239 (format "%s" 230 (format "%s"
240 (save-selected-window 231 (with-selected-window window
241 (select-window window)
242 (concat 232 (concat
243 (if (file-remote-p default-directory) 233 (if (file-remote-p default-directory)
244 "Current directory is remote: " 234 "Current directory is remote: "
@@ -474,15 +464,13 @@ By default, this shows the information specified by
474(defun mode-line-unbury-buffer (event) "\ 464(defun mode-line-unbury-buffer (event) "\
475Call `unbury-buffer' in this window." 465Call `unbury-buffer' in this window."
476 (interactive "e") 466 (interactive "e")
477 (save-selected-window 467 (with-selected-window (posn-window (event-start event))
478 (select-window (posn-window (event-start event)))
479 (unbury-buffer))) 468 (unbury-buffer)))
480 469
481(defun mode-line-bury-buffer (event) "\ 470(defun mode-line-bury-buffer (event) "\
482Like `bury-buffer', but temporarily select EVENT's window." 471Like `bury-buffer', but temporarily select EVENT's window."
483 (interactive "e") 472 (interactive "e")
484 (save-selected-window 473 (with-selected-window (posn-window (event-start event))
485 (select-window (posn-window (event-start event)))
486 (bury-buffer))) 474 (bury-buffer)))
487 475
488(defun mode-line-other-buffer () "\ 476(defun mode-line-other-buffer () "\
@@ -493,15 +481,13 @@ Switch to the most recently selected buffer other than the current one."
493(defun mode-line-next-buffer (event) 481(defun mode-line-next-buffer (event)
494 "Like `next-buffer', but temporarily select EVENT's window." 482 "Like `next-buffer', but temporarily select EVENT's window."
495 (interactive "e") 483 (interactive "e")
496 (save-selected-window 484 (with-selected-window (posn-window (event-start event))
497 (select-window (posn-window (event-start event)))
498 (next-buffer))) 485 (next-buffer)))
499 486
500(defun mode-line-previous-buffer (event) 487(defun mode-line-previous-buffer (event)
501 "Like `previous-buffer', but temporarily select EVENT's window." 488 "Like `previous-buffer', but temporarily select EVENT's window."
502 (interactive "e") 489 (interactive "e")
503 (save-selected-window 490 (with-selected-window (posn-window (event-start event))
504 (select-window (posn-window (event-start event)))
505 (previous-buffer))) 491 (previous-buffer)))
506 492
507(defmacro bound-and-true-p (var) 493(defmacro bound-and-true-p (var)
diff --git a/lisp/cedet/ChangeLog b/lisp/cedet/ChangeLog
index ea102dddf2f..14e8d6c1d64 100644
--- a/lisp/cedet/ChangeLog
+++ b/lisp/cedet/ChangeLog
@@ -1,3 +1,9 @@
12012-10-08 David Engster <deng@randomsample.de>>
2
3 * semantic/bovine/el.el: Add `semantic-default-elisp-setup' to
4 `emacs-lisp-mode-hook'. This was accidentally removed during the
5 CEDET update (2012-10-01T18:10:29Z!cyd@gnu.org).
6
12012-10-07 David Engster <deng@randomsample.de> 72012-10-07 David Engster <deng@randomsample.de>
2 8
3 * semantic/wisent/python.el (semantic-ctxt-current-function) 9 * semantic/wisent/python.el (semantic-ctxt-current-function)
diff --git a/lisp/cedet/semantic/bovine/el.el b/lisp/cedet/semantic/bovine/el.el
index 7bad1483dc3..ea99df9edb9 100644
--- a/lisp/cedet/semantic/bovine/el.el
+++ b/lisp/cedet/semantic/bovine/el.el
@@ -944,6 +944,8 @@ ELisp variables can be pretty long, so track this one too.")
944 "Setup hook function for Emacs Lisp files and Semantic." 944 "Setup hook function for Emacs Lisp files and Semantic."
945 ) 945 )
946 946
947(add-hook 'emacs-lisp-mode-hook 'semantic-default-elisp-setup)
948
947;;; LISP MODE 949;;; LISP MODE
948;; 950;;
949;; @TODO: Lisp supports syntaxes that Emacs Lisp does not. 951;; @TODO: Lisp supports syntaxes that Emacs Lisp does not.
diff --git a/lisp/emacs-lisp/cl-loaddefs.el b/lisp/emacs-lisp/cl-loaddefs.el
index e25ac5f9708..d05fbc42060 100644
--- a/lisp/emacs-lisp/cl-loaddefs.el
+++ b/lisp/emacs-lisp/cl-loaddefs.el
@@ -260,7 +260,7 @@ Remove from SYMBOL's plist the property PROPNAME and its value.
260;;;;;; cl-typecase cl-ecase cl-case cl-load-time-value cl-eval-when 260;;;;;; cl-typecase cl-ecase cl-case cl-load-time-value cl-eval-when
261;;;;;; cl-destructuring-bind cl-function cl-defmacro cl-defun cl-gentemp 261;;;;;; cl-destructuring-bind cl-function cl-defmacro cl-defun cl-gentemp
262;;;;;; cl-gensym cl--compiler-macro-cXXr cl--compiler-macro-list*) 262;;;;;; cl-gensym cl--compiler-macro-cXXr cl--compiler-macro-list*)
263;;;;;; "cl-macs" "cl-macs.el" "6951d080daefb5194b1d21fe9b2deae4") 263;;;;;; "cl-macs" "cl-macs.el" "885919e79dbcd11081cfb2e039b470c7")
264;;; Generated autoloads from cl-macs.el 264;;; Generated autoloads from cl-macs.el
265 265
266(autoload 'cl--compiler-macro-list* "cl-macs" "\ 266(autoload 'cl--compiler-macro-list* "cl-macs" "\
diff --git a/lisp/emacs-lisp/cl-macs.el b/lisp/emacs-lisp/cl-macs.el
index 99bae1944e8..592c33d21c5 100644
--- a/lisp/emacs-lisp/cl-macs.el
+++ b/lisp/emacs-lisp/cl-macs.el
@@ -2324,26 +2324,29 @@ value, that slot cannot be set via `setf'.
2324 (if (= pos 0) '(car cl-x) 2324 (if (= pos 0) '(car cl-x)
2325 `(nth ,pos cl-x)))) forms) 2325 `(nth ,pos cl-x)))) forms)
2326 (push (cons accessor t) side-eff) 2326 (push (cons accessor t) side-eff)
2327 ;; Don't bother defining a setf-expander, since gv-get can use 2327 (if (cadr (memq :read-only (cddr desc)))
2328 ;; the compiler macro to get the same result. 2328 (push `(gv-define-expander ,accessor
2329 ;;(push `(gv-define-setter ,accessor (cl-val cl-x) 2329 (lambda (_cl-do _cl-x)
2330 ;; ,(if (cadr (memq :read-only (cddr desc))) 2330 (error "%s is a read-only slot" ',accessor)))
2331 ;; `(progn (ignore cl-x cl-val) 2331 forms)
2332 ;; (error "%s is a read-only slot" 2332 ;; For normal slots, we don't need to define a setf-expander,
2333 ;; ',accessor)) 2333 ;; since gv-get can use the compiler macro to get the
2334 ;; ;; If cl is loaded only for compilation, 2334 ;; same result.
2335 ;; ;; the call to cl--struct-setf-expander would 2335 ;; (push `(gv-define-setter ,accessor (cl-val cl-x)
2336 ;; ;; cause a warning because it may not be 2336 ;; ;; If cl is loaded only for compilation,
2337 ;; ;; defined at run time. Suppress that warning. 2337 ;; ;; the call to cl--struct-setf-expander would
2338 ;; `(progn 2338 ;; ;; cause a warning because it may not be
2339 ;; (declare-function 2339 ;; ;; defined at run time. Suppress that warning.
2340 ;; cl--struct-setf-expander "cl-macs" 2340 ;; (progn
2341 ;; (x name accessor pred-form pos)) 2341 ;; (declare-function
2342 ;; (cl--struct-setf-expander 2342 ;; cl--struct-setf-expander "cl-macs"
2343 ;; cl-val cl-x ',name ',accessor 2343 ;; (x name accessor pred-form pos))
2344 ;; ,(and pred-check `',pred-check) 2344 ;; (cl--struct-setf-expander
2345 ;; ,pos)))) 2345 ;; cl-val cl-x ',name ',accessor
2346 ;; forms) 2346 ;; ,(and pred-check `',pred-check)
2347 ;; ,pos)))
2348 ;; forms)
2349 )
2347 (if print-auto 2350 (if print-auto
2348 (nconc print-func 2351 (nconc print-func
2349 (list `(princ ,(format " %s" slot) cl-s) 2352 (list `(princ ,(format " %s" slot) cl-s)
diff --git a/lisp/ffap.el b/lisp/ffap.el
index f3e8d4c194e..4c75609fe01 100644
--- a/lisp/ffap.el
+++ b/lisp/ffap.el
@@ -482,18 +482,12 @@ Returned values:
482 482
483(defun ffap-replace-file-component (fullname name) 483(defun ffap-replace-file-component (fullname name)
484 "In remote FULLNAME, replace path with NAME. May return nil." 484 "In remote FULLNAME, replace path with NAME. May return nil."
485 ;; Use ange-ftp or efs if loaded, but do not load them otherwise. 485 ;; Use efs if loaded, but do not load it otherwise.
486 (let (found) 486 (if (fboundp 'efs-replace-path-component)
487 (mapc 487 (funcall efs-replace-path-component fullname name)
488 (function (lambda (sym) (and (fboundp sym) (setq found sym)))) 488 (and (stringp fullname)
489 '( 489 (stringp name)
490 efs-replace-path-component 490 (concat (file-remote-p fullname) name))))
491 ange-ftp-replace-path-component
492 ange-ftp-replace-name-component
493 ))
494 (and found
495 (fset 'ffap-replace-file-component found)
496 (funcall found fullname name))))
497;; (ffap-replace-file-component "/who@foo.com:/whatever" "/new") 491;; (ffap-replace-file-component "/who@foo.com:/whatever" "/new")
498 492
499(defun ffap-file-suffix (file) 493(defun ffap-file-suffix (file)
diff --git a/lisp/generic-x.el b/lisp/generic-x.el
index ce1599b9010..878021ec5c5 100644
--- a/lisp/generic-x.el
+++ b/lisp/generic-x.el
@@ -646,83 +646,10 @@ like an INI file. You can add this hook to `find-file-hook'."
646 "Generic mode for Sys V pkginfo files.")) 646 "Generic mode for Sys V pkginfo files."))
647 647
648;; Javascript mode 648;; Javascript mode
649;; Includes extra keywords from Armando Singer [asinger@MAIL.COLGATE.EDU] 649;; Obsolete; defer to js-mode from js.el.
650(when (memq 'javascript-generic-mode generic-extras-enable-list) 650(when (memq 'javascript-generic-mode generic-extras-enable-list)
651 651 (define-obsolete-function-alias 'javascript-generic-mode 'js-mode "24.3")
652(define-generic-mode javascript-generic-mode 652 (define-obsolete-variable-alias 'javascript-generic-mode-hook 'js-mode-hook "24.3"))
653 '("//" ("/*" . "*/"))
654 '("break"
655 "case"
656 "continue"
657 "default"
658 "delete"
659 "do"
660 "else"
661 "export"
662 "for"
663 "function"
664 "if"
665 "import"
666 "in"
667 "new"
668 "return"
669 "switch"
670 "this"
671 "typeof"
672 "var"
673 "void"
674 "while"
675 "with"
676 ;; words reserved for ECMA extensions below
677 "catch"
678 "class"
679 "const"
680 "debugger"
681 "enum"
682 "extends"
683 "finally"
684 "super"
685 "throw"
686 "try"
687 ;; Java Keywords reserved by JavaScript
688 "abstract"
689 "boolean"
690 "byte"
691 "char"
692 "double"
693 "false"
694 "final"
695 "float"
696 "goto"
697 "implements"
698 "instanceof"
699 "int"
700 "interface"
701 "long"
702 "native"
703 "null"
704 "package"
705 "private"
706 "protected"
707 "public"
708 "short"
709 "static"
710 "synchronized"
711 "throws"
712 "transient"
713 "true")
714 '(("^\\s-*function\\s-+\\([A-Za-z0-9_]+\\)"
715 (1 font-lock-function-name-face))
716 ("^\\s-*var\\s-+\\([A-Za-z0-9_]+\\)"
717 (1 font-lock-variable-name-face)))
718 '("\\.js\\'")
719 (list
720 (function
721 (lambda ()
722 (setq imenu-generic-expression
723 '((nil "^function\\s-+\\([A-Za-z0-9_]+\\)" 1)
724 ("*Variables*" "^var\\s-+\\([A-Za-z0-9_]+\\)" 1))))))
725 "Generic mode for JavaScript files."))
726 653
727;; VRML files 654;; VRML files
728(when (memq 'vrml-generic-mode generic-extras-enable-list) 655(when (memq 'vrml-generic-mode generic-extras-enable-list)
diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog
index f79353ebfb3..c6b2a4c37a7 100644
--- a/lisp/gnus/ChangeLog
+++ b/lisp/gnus/ChangeLog
@@ -1,3 +1,8 @@
12012-10-09 Lars Magne Ingebrigtsen <larsi@gnus.org>
2
3 * shr.el (shr-insert): \r is also not inserted, so don't try to delete
4 it.
5
12012-10-06 Glenn Morris <rgm@gnu.org> 62012-10-06 Glenn Morris <rgm@gnu.org>
2 7
3 * gnus-notifications.el (gnus-notifications): 8 * gnus-notifications.el (gnus-notifications):
diff --git a/lisp/gnus/shr.el b/lisp/gnus/shr.el
index e7a6c5d2081..03704554459 100644
--- a/lisp/gnus/shr.el
+++ b/lisp/gnus/shr.el
@@ -391,7 +391,7 @@ size, and full-buffer size."
391 (shr-indent)) 391 (shr-indent))
392 (end-of-line)) 392 (end-of-line))
393 (insert " "))) 393 (insert " ")))
394 (unless (string-match "[ \t\n ]\\'" text) 394 (unless (string-match "[ \t\r\n ]\\'" text)
395 (delete-char -1))))) 395 (delete-char -1)))))
396 396
397(defun shr-find-fill-point () 397(defun shr-find-fill-point ()
diff --git a/lisp/net/tramp-cache.el b/lisp/net/tramp-cache.el
index fe5eb0049d0..e4fca46ce2d 100644
--- a/lisp/net/tramp-cache.el
+++ b/lisp/net/tramp-cache.el
@@ -139,27 +139,6 @@ Returns VALUE."
139 value)) 139 value))
140 140
141;;;###tramp-autoload 141;;;###tramp-autoload
142(defmacro with-file-property (vec file property &rest body)
143 "Check in Tramp cache for PROPERTY, otherwise execute BODY and set cache.
144FILE must be a local file name on a connection identified via VEC."
145 `(if (file-name-absolute-p ,file)
146 (let ((value (tramp-get-file-property ,vec ,file ,property 'undef)))
147 (when (eq value 'undef)
148 ;; We cannot pass @body as parameter to
149 ;; `tramp-set-file-property' because it mangles our
150 ;; debug messages.
151 (setq value (progn ,@body))
152 (tramp-set-file-property ,vec ,file ,property value))
153 value)
154 ,@body))
155
156;;;###tramp-autoload
157(put 'with-file-property 'lisp-indent-function 3)
158(put 'with-file-property 'edebug-form-spec t)
159(tramp-compat-font-lock-add-keywords
160 'emacs-lisp-mode '("\\<with-file-property\\>"))
161
162;;;###tramp-autoload
163(defun tramp-flush-file-property (vec file) 142(defun tramp-flush-file-property (vec file)
164 "Remove all properties of FILE in the cache context of VEC." 143 "Remove all properties of FILE in the cache context of VEC."
165 ;; Remove file property of symlinks. 144 ;; Remove file property of symlinks.
@@ -250,24 +229,6 @@ PROPERTY is set persistent when KEY is a vector."
250 value)) 229 value))
251 230
252;;;###tramp-autoload 231;;;###tramp-autoload
253(defmacro with-connection-property (key property &rest body)
254 "Check in Tramp for property PROPERTY, otherwise executes BODY and set."
255 `(let ((value (tramp-get-connection-property ,key ,property 'undef)))
256 (when (eq value 'undef)
257 ;; We cannot pass ,@body as parameter to
258 ;; `tramp-set-connection-property' because it mangles our debug
259 ;; messages.
260 (setq value (progn ,@body))
261 (tramp-set-connection-property ,key ,property value))
262 value))
263
264;;;###tramp-autoload
265(put 'with-connection-property 'lisp-indent-function 2)
266(put 'with-connection-property 'edebug-form-spec t)
267(tramp-compat-font-lock-add-keywords
268 'emacs-lisp-mode '("\\<with-connection-property\\>"))
269
270;;;###tramp-autoload
271(defun tramp-flush-connection-property (key) 232(defun tramp-flush-connection-property (key)
272 "Remove all properties identified by KEY. 233 "Remove all properties identified by KEY.
273KEY identifies the connection, it is either a process or a vector." 234KEY identifies the connection, it is either a process or a vector."
diff --git a/lisp/net/tramp-gvfs.el b/lisp/net/tramp-gvfs.el
index f78122ec704..60b39606d86 100644
--- a/lisp/net/tramp-gvfs.el
+++ b/lisp/net/tramp-gvfs.el
@@ -537,7 +537,7 @@ is no information where to trace the message.")
537 "Like `copy-file' for Tramp files." 537 "Like `copy-file' for Tramp files."
538 (with-parsed-tramp-file-name 538 (with-parsed-tramp-file-name
539 (if (tramp-tramp-file-p filename) filename newname) nil 539 (if (tramp-tramp-file-p filename) filename newname) nil
540 (tramp-with-progress-reporter 540 (with-tramp-progress-reporter
541 v 0 (format "Copying %s to %s" filename newname) 541 v 0 (format "Copying %s to %s" filename newname)
542 (condition-case err 542 (condition-case err
543 (let ((args 543 (let ((args
@@ -741,7 +741,7 @@ is no information where to trace the message.")
741 "Like `rename-file' for Tramp files." 741 "Like `rename-file' for Tramp files."
742 (with-parsed-tramp-file-name 742 (with-parsed-tramp-file-name
743 (if (tramp-tramp-file-p filename) filename newname) nil 743 (if (tramp-tramp-file-p filename) filename newname) nil
744 (tramp-with-progress-reporter 744 (with-tramp-progress-reporter
745 v 0 (format "Renaming %s to %s" filename newname) 745 v 0 (format "Renaming %s to %s" filename newname)
746 (condition-case err 746 (condition-case err
747 (rename-file 747 (rename-file
@@ -1056,7 +1056,7 @@ ADDRESS can have the form \"xx:xx:xx:xx:xx:xx\" or \"[xx:xx:xx:xx:xx:xx]\"."
1056 (catch 'mounted 1056 (catch 'mounted
1057 (dolist 1057 (dolist
1058 (elt 1058 (elt
1059 (with-file-property vec "/" "list-mounts" 1059 (with-tramp-file-property vec "/" "list-mounts"
1060 (with-tramp-dbus-call-method vec t 1060 (with-tramp-dbus-call-method vec t
1061 :session tramp-gvfs-service-daemon tramp-gvfs-path-mounttracker 1061 :session tramp-gvfs-service-daemon tramp-gvfs-path-mounttracker
1062 tramp-gvfs-interface-mounttracker "listMounts")) 1062 tramp-gvfs-interface-mounttracker "listMounts"))
@@ -1199,7 +1199,7 @@ connection if a previous connection has died for some reason."
1199 (tramp-gvfs-object-path 1199 (tramp-gvfs-object-path
1200 (tramp-make-tramp-file-name method user host "")))) 1200 (tramp-make-tramp-file-name method user host ""))))
1201 1201
1202 (tramp-with-progress-reporter 1202 (with-tramp-progress-reporter
1203 vec 3 1203 vec 3
1204 (if (zerop (length user)) 1204 (if (zerop (length user))
1205 (format "Opening connection for %s using %s" host method) 1205 (format "Opening connection for %s using %s" host method)
diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el
index 2c1af3e83fa..ec321d00506 100644
--- a/lisp/net/tramp-sh.el
+++ b/lisp/net/tramp-sh.el
@@ -1058,7 +1058,7 @@ target of the symlink differ."
1058 "Like `file-truename' for Tramp files." 1058 "Like `file-truename' for Tramp files."
1059 (with-parsed-tramp-file-name (expand-file-name filename) nil 1059 (with-parsed-tramp-file-name (expand-file-name filename) nil
1060 (tramp-make-tramp-file-name method user host 1060 (tramp-make-tramp-file-name method user host
1061 (with-file-property v localname "file-truename" 1061 (with-tramp-file-property v localname "file-truename"
1062 (let ((result nil)) ; result steps in reverse order 1062 (let ((result nil)) ; result steps in reverse order
1063 (tramp-message v 4 "Finding true name for `%s'" filename) 1063 (tramp-message v 4 "Finding true name for `%s'" filename)
1064 (cond 1064 (cond
@@ -1167,7 +1167,7 @@ target of the symlink differ."
1167(defun tramp-sh-handle-file-exists-p (filename) 1167(defun tramp-sh-handle-file-exists-p (filename)
1168 "Like `file-exists-p' for Tramp files." 1168 "Like `file-exists-p' for Tramp files."
1169 (with-parsed-tramp-file-name filename nil 1169 (with-parsed-tramp-file-name filename nil
1170 (with-file-property v localname "file-exists-p" 1170 (with-tramp-file-property v localname "file-exists-p"
1171 (or (not (null (tramp-get-file-property 1171 (or (not (null (tramp-get-file-property
1172 v localname "file-attributes-integer" nil))) 1172 v localname "file-attributes-integer" nil)))
1173 (not (null (tramp-get-file-property 1173 (not (null (tramp-get-file-property
@@ -1185,7 +1185,8 @@ target of the symlink differ."
1185 ;; Don't modify `last-coding-system-used' by accident. 1185 ;; Don't modify `last-coding-system-used' by accident.
1186 (let ((last-coding-system-used last-coding-system-used)) 1186 (let ((last-coding-system-used last-coding-system-used))
1187 (with-parsed-tramp-file-name (expand-file-name filename) nil 1187 (with-parsed-tramp-file-name (expand-file-name filename) nil
1188 (with-file-property v localname (format "file-attributes-%s" id-format) 1188 (with-tramp-file-property
1189 v localname (format "file-attributes-%s" id-format)
1189 (save-excursion 1190 (save-excursion
1190 (tramp-convert-file-attributes 1191 (tramp-convert-file-attributes
1191 v 1192 v
@@ -1481,7 +1482,8 @@ and gid of the corresponding user is taken. Both parameters must be integers."
1481 1482
1482(defun tramp-remote-selinux-p (vec) 1483(defun tramp-remote-selinux-p (vec)
1483 "Check, whether SELINUX is enabled on the remote host." 1484 "Check, whether SELINUX is enabled on the remote host."
1484 (with-connection-property (tramp-get-connection-process vec) "selinux-p" 1485 (with-tramp-connection-property
1486 (tramp-get-connection-process vec) "selinux-p"
1485 (let ((result (tramp-find-executable 1487 (let ((result (tramp-find-executable
1486 vec "getenforce" (tramp-get-remote-path vec) t t))) 1488 vec "getenforce" (tramp-get-remote-path vec) t t)))
1487 (and result 1489 (and result
@@ -1493,7 +1495,7 @@ and gid of the corresponding user is taken. Both parameters must be integers."
1493(defun tramp-sh-handle-file-selinux-context (filename) 1495(defun tramp-sh-handle-file-selinux-context (filename)
1494 "Like `file-selinux-context' for Tramp files." 1496 "Like `file-selinux-context' for Tramp files."
1495 (with-parsed-tramp-file-name filename nil 1497 (with-parsed-tramp-file-name filename nil
1496 (with-file-property v localname "file-selinux-context" 1498 (with-tramp-file-property v localname "file-selinux-context"
1497 (let ((context '(nil nil nil nil)) 1499 (let ((context '(nil nil nil nil))
1498 (regexp (concat "\\([a-z0-9_]+\\):" "\\([a-z0-9_]+\\):" 1500 (regexp (concat "\\([a-z0-9_]+\\):" "\\([a-z0-9_]+\\):"
1499 "\\([a-z0-9_]+\\):" "\\([a-z0-9_]+\\)"))) 1501 "\\([a-z0-9_]+\\):" "\\([a-z0-9_]+\\)")))
@@ -1537,7 +1539,7 @@ and gid of the corresponding user is taken. Both parameters must be integers."
1537(defun tramp-sh-handle-file-executable-p (filename) 1539(defun tramp-sh-handle-file-executable-p (filename)
1538 "Like `file-executable-p' for Tramp files." 1540 "Like `file-executable-p' for Tramp files."
1539 (with-parsed-tramp-file-name filename nil 1541 (with-parsed-tramp-file-name filename nil
1540 (with-file-property v localname "file-executable-p" 1542 (with-tramp-file-property v localname "file-executable-p"
1541 ;; Examine `file-attributes' cache to see if request can be 1543 ;; Examine `file-attributes' cache to see if request can be
1542 ;; satisfied without remote operation. 1544 ;; satisfied without remote operation.
1543 (or (tramp-check-cached-permissions v ?x) 1545 (or (tramp-check-cached-permissions v ?x)
@@ -1546,7 +1548,7 @@ and gid of the corresponding user is taken. Both parameters must be integers."
1546(defun tramp-sh-handle-file-readable-p (filename) 1548(defun tramp-sh-handle-file-readable-p (filename)
1547 "Like `file-readable-p' for Tramp files." 1549 "Like `file-readable-p' for Tramp files."
1548 (with-parsed-tramp-file-name filename nil 1550 (with-parsed-tramp-file-name filename nil
1549 (with-file-property v localname "file-readable-p" 1551 (with-tramp-file-property v localname "file-readable-p"
1550 ;; Examine `file-attributes' cache to see if request can be 1552 ;; Examine `file-attributes' cache to see if request can be
1551 ;; satisfied without remote operation. 1553 ;; satisfied without remote operation.
1552 (or (tramp-check-cached-permissions v ?r) 1554 (or (tramp-check-cached-permissions v ?r)
@@ -1600,13 +1602,13 @@ and gid of the corresponding user is taken. Both parameters must be integers."
1600 ;; desirable to return t immediately for "/method:foo:". It can 1602 ;; desirable to return t immediately for "/method:foo:". It can
1601 ;; be expected that this is always a directory. 1603 ;; be expected that this is always a directory.
1602 (or (zerop (length localname)) 1604 (or (zerop (length localname))
1603 (with-file-property v localname "file-directory-p" 1605 (with-tramp-file-property v localname "file-directory-p"
1604 (tramp-run-test "-d" filename))))) 1606 (tramp-run-test "-d" filename)))))
1605 1607
1606(defun tramp-sh-handle-file-writable-p (filename) 1608(defun tramp-sh-handle-file-writable-p (filename)
1607 "Like `file-writable-p' for Tramp files." 1609 "Like `file-writable-p' for Tramp files."
1608 (with-parsed-tramp-file-name filename nil 1610 (with-parsed-tramp-file-name filename nil
1609 (with-file-property v localname "file-writable-p" 1611 (with-tramp-file-property v localname "file-writable-p"
1610 (if (file-exists-p filename) 1612 (if (file-exists-p filename)
1611 ;; Examine `file-attributes' cache to see if request can be 1613 ;; Examine `file-attributes' cache to see if request can be
1612 ;; satisfied without remote operation. 1614 ;; satisfied without remote operation.
@@ -1619,7 +1621,7 @@ and gid of the corresponding user is taken. Both parameters must be integers."
1619(defun tramp-sh-handle-file-ownership-preserved-p (filename) 1621(defun tramp-sh-handle-file-ownership-preserved-p (filename)
1620 "Like `file-ownership-preserved-p' for Tramp files." 1622 "Like `file-ownership-preserved-p' for Tramp files."
1621 (with-parsed-tramp-file-name filename nil 1623 (with-parsed-tramp-file-name filename nil
1622 (with-file-property v localname "file-ownership-preserved-p" 1624 (with-tramp-file-property v localname "file-ownership-preserved-p"
1623 (let ((attributes (file-attributes filename))) 1625 (let ((attributes (file-attributes filename)))
1624 ;; Return t if the file doesn't exist, since it's true that no 1626 ;; Return t if the file doesn't exist, since it's true that no
1625 ;; information would be lost by an (attempted) delete and create. 1627 ;; information would be lost by an (attempted) delete and create.
@@ -1637,7 +1639,7 @@ and gid of the corresponding user is taken. Both parameters must be integers."
1637 (let* ((temp 1639 (let* ((temp
1638 (copy-tree 1640 (copy-tree
1639 (with-parsed-tramp-file-name directory nil 1641 (with-parsed-tramp-file-name directory nil
1640 (with-file-property 1642 (with-tramp-file-property
1641 v localname 1643 v localname
1642 (format "directory-files-and-attributes-%s" id-format) 1644 (format "directory-files-and-attributes-%s" id-format)
1643 (save-excursion 1645 (save-excursion
@@ -1987,7 +1989,7 @@ file names."
1987 (tramp-error 1989 (tramp-error
1988 v 'file-already-exists "File %s already exists" newname)) 1990 v 'file-already-exists "File %s already exists" newname))
1989 1991
1990 (tramp-with-progress-reporter 1992 (with-tramp-progress-reporter
1991 v 0 (format "%s %s to %s" 1993 v 0 (format "%s %s to %s"
1992 (if (eq op 'copy) "Copying" "Renaming") 1994 (if (eq op 'copy) "Copying" "Renaming")
1993 filename newname) 1995 filename newname)
@@ -2505,7 +2507,7 @@ This is like `dired-recursive-delete-directory' for Tramp files."
2505 nil) 2507 nil)
2506 ((and suffix (nth 2 suffix)) 2508 ((and suffix (nth 2 suffix))
2507 ;; We found an uncompression rule. 2509 ;; We found an uncompression rule.
2508 (tramp-with-progress-reporter 2510 (with-tramp-progress-reporter
2509 v 0 (format "Uncompressing %s" file) 2511 v 0 (format "Uncompressing %s" file)
2510 (when (tramp-send-command-and-check 2512 (when (tramp-send-command-and-check
2511 v (concat (nth 2 suffix) " " 2513 v (concat (nth 2 suffix) " "
@@ -2517,7 +2519,7 @@ This is like `dired-recursive-delete-directory' for Tramp files."
2517 (t 2519 (t
2518 ;; We don't recognize the file as compressed, so compress it. 2520 ;; We don't recognize the file as compressed, so compress it.
2519 ;; Try gzip. 2521 ;; Try gzip.
2520 (tramp-with-progress-reporter v 0 (format "Compressing %s" file) 2522 (with-tramp-progress-reporter v 0 (format "Compressing %s" file)
2521 (when (tramp-send-command-and-check 2523 (when (tramp-send-command-and-check
2522 v (concat "gzip -f " 2524 v (concat "gzip -f "
2523 (tramp-shell-quote-argument localname))) 2525 (tramp-shell-quote-argument localname)))
@@ -2673,7 +2675,7 @@ the result will be a local, non-Tramp, filename."
2673 (string-match "\\`su\\(do\\)?\\'" method)) 2675 (string-match "\\`su\\(do\\)?\\'" method))
2674 (setq uname (concat uname user))) 2676 (setq uname (concat uname user)))
2675 (setq uname 2677 (setq uname
2676 (with-connection-property v uname 2678 (with-tramp-connection-property v uname
2677 (tramp-send-command 2679 (tramp-send-command
2678 v (format "cd %s; pwd" (tramp-shell-quote-argument uname))) 2680 v (format "cd %s; pwd" (tramp-shell-quote-argument uname)))
2679 (with-current-buffer (tramp-get-buffer v) 2681 (with-current-buffer (tramp-get-buffer v)
@@ -2943,7 +2945,7 @@ the result will be a local, non-Tramp, filename."
2943 ;; Use inline encoding for file transfer. 2945 ;; Use inline encoding for file transfer.
2944 (rem-enc 2946 (rem-enc
2945 (save-excursion 2947 (save-excursion
2946 (tramp-with-progress-reporter 2948 (with-tramp-progress-reporter
2947 v 3 (format "Encoding remote file %s" filename) 2949 v 3 (format "Encoding remote file %s" filename)
2948 (tramp-barf-unless-okay 2950 (tramp-barf-unless-okay
2949 v (format rem-enc (tramp-shell-quote-argument localname)) 2951 v (format rem-enc (tramp-shell-quote-argument localname))
@@ -2957,7 +2959,7 @@ the result will be a local, non-Tramp, filename."
2957 (with-temp-buffer 2959 (with-temp-buffer
2958 (set-buffer-multibyte nil) 2960 (set-buffer-multibyte nil)
2959 (insert-buffer-substring (tramp-get-buffer v)) 2961 (insert-buffer-substring (tramp-get-buffer v))
2960 (tramp-with-progress-reporter 2962 (with-tramp-progress-reporter
2961 v 3 (format "Decoding remote file %s with function %s" 2963 v 3 (format "Decoding remote file %s with function %s"
2962 filename loc-dec) 2964 filename loc-dec)
2963 (funcall loc-dec (point-min) (point-max)) 2965 (funcall loc-dec (point-min) (point-max))
@@ -2975,7 +2977,7 @@ the result will be a local, non-Tramp, filename."
2975 (let (file-name-handler-alist 2977 (let (file-name-handler-alist
2976 (coding-system-for-write 'binary)) 2978 (coding-system-for-write 'binary))
2977 (write-region (point-min) (point-max) tmpfile2)) 2979 (write-region (point-min) (point-max) tmpfile2))
2978 (tramp-with-progress-reporter 2980 (with-tramp-progress-reporter
2979 v 3 (format "Decoding remote file %s with command %s" 2981 v 3 (format "Decoding remote file %s with command %s"
2980 filename loc-dec) 2982 filename loc-dec)
2981 (unwind-protect 2983 (unwind-protect
@@ -3203,7 +3205,7 @@ Returns a file name in `tramp-auto-save-directory' for autosaving this file."
3203 (set-buffer-multibyte nil) 3205 (set-buffer-multibyte nil)
3204 ;; Use encoding function or command. 3206 ;; Use encoding function or command.
3205 (if (functionp loc-enc) 3207 (if (functionp loc-enc)
3206 (tramp-with-progress-reporter 3208 (with-tramp-progress-reporter
3207 v 3 (format "Encoding region using function `%s'" 3209 v 3 (format "Encoding region using function `%s'"
3208 loc-enc) 3210 loc-enc)
3209 (let ((coding-system-for-read 'binary)) 3211 (let ((coding-system-for-read 'binary))
@@ -3221,7 +3223,7 @@ Returns a file name in `tramp-auto-save-directory' for autosaving this file."
3221 (tramp-compat-temporary-file-directory))) 3223 (tramp-compat-temporary-file-directory)))
3222 (funcall loc-enc (point-min) (point-max)))) 3224 (funcall loc-enc (point-min) (point-max))))
3223 3225
3224 (tramp-with-progress-reporter 3226 (with-tramp-progress-reporter
3225 v 3 (format "Encoding region using command `%s'" 3227 v 3 (format "Encoding region using command `%s'"
3226 loc-enc) 3228 loc-enc)
3227 (unless (zerop (tramp-call-local-coding-command 3229 (unless (zerop (tramp-call-local-coding-command
@@ -3235,7 +3237,7 @@ Returns a file name in `tramp-auto-save-directory' for autosaving this file."
3235 ;; Send buffer into remote decoding command which 3237 ;; Send buffer into remote decoding command which
3236 ;; writes to remote file. Because this happens on 3238 ;; writes to remote file. Because this happens on
3237 ;; the remote host, we cannot use the function. 3239 ;; the remote host, we cannot use the function.
3238 (tramp-with-progress-reporter 3240 (with-tramp-progress-reporter
3239 v 3 3241 v 3
3240 (format "Decoding region into remote file %s" filename) 3242 (format "Decoding region into remote file %s" filename)
3241 (goto-char (point-max)) 3243 (goto-char (point-max))
@@ -3335,7 +3337,7 @@ Returns a file name in `tramp-auto-save-directory' for autosaving this file."
3335 "Like `vc-registered' for Tramp files." 3337 "Like `vc-registered' for Tramp files."
3336 (tramp-compat-with-temp-message "" 3338 (tramp-compat-with-temp-message ""
3337 (with-parsed-tramp-file-name file nil 3339 (with-parsed-tramp-file-name file nil
3338 (tramp-with-progress-reporter 3340 (with-tramp-progress-reporter
3339 v 3 (format "Checking `vc-registered' for %s" file) 3341 v 3 (format "Checking `vc-registered' for %s" file)
3340 3342
3341 ;; There could be new files, created by the vc backend. We 3343 ;; There could be new files, created by the vc backend. We
@@ -3433,7 +3435,7 @@ Only send the definition if it has not already been done."
3433 (let ((scripts (tramp-get-connection-property 3435 (let ((scripts (tramp-get-connection-property
3434 (tramp-get-connection-process vec) "scripts" nil))) 3436 (tramp-get-connection-process vec) "scripts" nil)))
3435 (unless (member name scripts) 3437 (unless (member name scripts)
3436 (tramp-with-progress-reporter vec 5 (format "Sending script `%s'" name) 3438 (with-tramp-progress-reporter vec 5 (format "Sending script `%s'" name)
3437 ;; The script could contain a call of Perl. This is masked with `%s'. 3439 ;; The script could contain a call of Perl. This is masked with `%s'.
3438 (tramp-barf-unless-okay 3440 (tramp-barf-unless-okay
3439 vec 3441 vec
@@ -3602,7 +3604,7 @@ file exists and nonzero exit status otherwise."
3602 3604
3603(defun tramp-open-shell (vec shell) 3605(defun tramp-open-shell (vec shell)
3604 "Opens shell SHELL." 3606 "Opens shell SHELL."
3605 (tramp-with-progress-reporter 3607 (with-tramp-progress-reporter
3606 vec 5 (format "Opening remote shell `%s'" shell) 3608 vec 5 (format "Opening remote shell `%s'" shell)
3607 ;; Find arguments for this shell. 3609 ;; Find arguments for this shell.
3608 (let ((tramp-end-of-output tramp-initial-end-of-output) 3610 (let ((tramp-end-of-output tramp-initial-end-of-output)
@@ -3638,7 +3640,7 @@ file exists and nonzero exit status otherwise."
3638 (tramp-file-name-method vec) 'tramp-remote-shell))) 3640 (tramp-file-name-method vec) 'tramp-remote-shell)))
3639 shell) 3641 shell)
3640 (setq shell 3642 (setq shell
3641 (with-connection-property vec "remote-shell" 3643 (with-tramp-connection-property vec "remote-shell"
3642 ;; CCC: "root" does not exist always, see QNAP 459. 3644 ;; CCC: "root" does not exist always, see QNAP 459.
3643 ;; Which check could we apply instead? 3645 ;; Which check could we apply instead?
3644 (tramp-send-command vec "echo ~root" t) 3646 (tramp-send-command vec "echo ~root" t)
@@ -3673,7 +3675,7 @@ file exists and nonzero exit status otherwise."
3673 (tramp-open-shell vec shell)) 3675 (tramp-open-shell vec shell))
3674 3676
3675 ;; Busyboxes tend to behave strange. We check for the existence. 3677 ;; Busyboxes tend to behave strange. We check for the existence.
3676 (with-connection-property vec "busybox" 3678 (with-tramp-connection-property vec "busybox"
3677 (tramp-send-command vec (format "%s --version" shell) t) 3679 (tramp-send-command vec (format "%s --version" shell) t)
3678 (let ((case-fold-search t)) 3680 (let ((case-fold-search t))
3679 (and (string-match "busybox" (buffer-string)) t)))))) 3681 (and (string-match "busybox" (buffer-string)) t))))))
@@ -3798,7 +3800,7 @@ process to set up. VEC specifies the connection."
3798 ;; successfully, sending 625 bytes failed. Emacs makes a hack when 3800 ;; successfully, sending 625 bytes failed. Emacs makes a hack when
3799 ;; this host type is detected locally. It cannot handle remote 3801 ;; this host type is detected locally. It cannot handle remote
3800 ;; hosts, though. 3802 ;; hosts, though.
3801 (with-connection-property proc "chunksize" 3803 (with-tramp-connection-property proc "chunksize"
3802 (cond 3804 (cond
3803 ((and (integerp tramp-chunksize) (> tramp-chunksize 0)) 3805 ((and (integerp tramp-chunksize) (> tramp-chunksize 0))
3804 tramp-chunksize) 3806 tramp-chunksize)
@@ -4327,7 +4329,7 @@ connection if a previous connection has died for some reason."
4327 (when (and (boundp 'non-essential) (symbol-value 'non-essential)) 4329 (when (and (boundp 'non-essential) (symbol-value 'non-essential))
4328 (throw 'non-essential 'non-essential)) 4330 (throw 'non-essential 'non-essential))
4329 4331
4330 (tramp-with-progress-reporter 4332 (with-tramp-progress-reporter
4331 vec 3 4333 vec 3
4332 (if (zerop (length (tramp-file-name-user vec))) 4334 (if (zerop (length (tramp-file-name-user vec)))
4333 (format "Opening connection for %s using %s" 4335 (format "Opening connection for %s using %s"
@@ -4773,7 +4775,7 @@ This is used internally by `tramp-file-mode-from-int'."
4773;; Variables local to connection. 4775;; Variables local to connection.
4774 4776
4775(defun tramp-get-remote-path (vec) 4777(defun tramp-get-remote-path (vec)
4776 (with-connection-property 4778 (with-tramp-connection-property
4777 ;; When `tramp-own-remote-path' is in `tramp-remote-path', we 4779 ;; When `tramp-own-remote-path' is in `tramp-remote-path', we
4778 ;; cache the result for the session only. Otherwise, the result 4780 ;; cache the result for the session only. Otherwise, the result
4779 ;; is cached persistently. 4781 ;; is cached persistently.
@@ -4845,7 +4847,7 @@ This is used internally by `tramp-file-mode-from-int'."
4845 remote-path))))) 4847 remote-path)))))
4846 4848
4847(defun tramp-get-ls-command (vec) 4849(defun tramp-get-ls-command (vec)
4848 (with-connection-property vec "ls" 4850 (with-tramp-connection-property vec "ls"
4849 (tramp-message vec 5 "Finding a suitable `ls' command") 4851 (tramp-message vec 5 "Finding a suitable `ls' command")
4850 (or 4852 (or
4851 (catch 'ls-found 4853 (catch 'ls-found
@@ -4871,7 +4873,7 @@ This is used internally by `tramp-file-mode-from-int'."
4871 4873
4872(defun tramp-get-ls-command-with-dired (vec) 4874(defun tramp-get-ls-command-with-dired (vec)
4873 (save-match-data 4875 (save-match-data
4874 (with-connection-property vec "ls-dired" 4876 (with-tramp-connection-property vec "ls-dired"
4875 (tramp-message vec 5 "Checking, whether `ls --dired' works") 4877 (tramp-message vec 5 "Checking, whether `ls --dired' works")
4876 ;; Some "ls" versions are sensible wrt the order of arguments, 4878 ;; Some "ls" versions are sensible wrt the order of arguments,
4877 ;; they fail when "-al" is after the "--dired" argument (for 4879 ;; they fail when "-al" is after the "--dired" argument (for
@@ -4880,7 +4882,7 @@ This is used internally by `tramp-file-mode-from-int'."
4880 vec (format "%s --dired -al /dev/null" (tramp-get-ls-command vec)))))) 4882 vec (format "%s --dired -al /dev/null" (tramp-get-ls-command vec))))))
4881 4883
4882(defun tramp-get-test-command (vec) 4884(defun tramp-get-test-command (vec)
4883 (with-connection-property vec "test" 4885 (with-tramp-connection-property vec "test"
4884 (tramp-message vec 5 "Finding a suitable `test' command") 4886 (tramp-message vec 5 "Finding a suitable `test' command")
4885 (if (tramp-send-command-and-check vec "test 0") 4887 (if (tramp-send-command-and-check vec "test 0")
4886 "test" 4888 "test"
@@ -4890,7 +4892,7 @@ This is used internally by `tramp-file-mode-from-int'."
4890 ;; Does `test A -nt B' work? Use abominable `find' construct if it 4892 ;; Does `test A -nt B' work? Use abominable `find' construct if it
4891 ;; doesn't. BSD/OS 4.0 wants the parentheses around the command, 4893 ;; doesn't. BSD/OS 4.0 wants the parentheses around the command,
4892 ;; for otherwise the shell crashes. 4894 ;; for otherwise the shell crashes.
4893 (with-connection-property vec "test-nt" 4895 (with-tramp-connection-property vec "test-nt"
4894 (or 4896 (or
4895 (progn 4897 (progn
4896 (tramp-send-command 4898 (tramp-send-command
@@ -4908,17 +4910,17 @@ This is used internally by `tramp-file-mode-from-int'."
4908 "tramp_test_nt %s %s")))) 4910 "tramp_test_nt %s %s"))))
4909 4911
4910(defun tramp-get-file-exists-command (vec) 4912(defun tramp-get-file-exists-command (vec)
4911 (with-connection-property vec "file-exists" 4913 (with-tramp-connection-property vec "file-exists"
4912 (tramp-message vec 5 "Finding command to check if file exists") 4914 (tramp-message vec 5 "Finding command to check if file exists")
4913 (tramp-find-file-exists-command vec))) 4915 (tramp-find-file-exists-command vec)))
4914 4916
4915(defun tramp-get-remote-ln (vec) 4917(defun tramp-get-remote-ln (vec)
4916 (with-connection-property vec "ln" 4918 (with-tramp-connection-property vec "ln"
4917 (tramp-message vec 5 "Finding a suitable `ln' command") 4919 (tramp-message vec 5 "Finding a suitable `ln' command")
4918 (tramp-find-executable vec "ln" (tramp-get-remote-path vec)))) 4920 (tramp-find-executable vec "ln" (tramp-get-remote-path vec))))
4919 4921
4920(defun tramp-get-remote-perl (vec) 4922(defun tramp-get-remote-perl (vec)
4921 (with-connection-property vec "perl" 4923 (with-tramp-connection-property vec "perl"
4922 (tramp-message vec 5 "Finding a suitable `perl' command") 4924 (tramp-message vec 5 "Finding a suitable `perl' command")
4923 (let ((result 4925 (let ((result
4924 (or (tramp-find-executable vec "perl5" (tramp-get-remote-path vec)) 4926 (or (tramp-find-executable vec "perl5" (tramp-get-remote-path vec))
@@ -4926,16 +4928,16 @@ This is used internally by `tramp-file-mode-from-int'."
4926 vec "perl" (tramp-get-remote-path vec))))) 4928 vec "perl" (tramp-get-remote-path vec)))))
4927 ;; We must check also for some Perl modules. 4929 ;; We must check also for some Perl modules.
4928 (when result 4930 (when result
4929 (with-connection-property vec "perl-file-spec" 4931 (with-tramp-connection-property vec "perl-file-spec"
4930 (tramp-send-command-and-check 4932 (tramp-send-command-and-check
4931 vec (format "%s -e 'use File::Spec;'" result))) 4933 vec (format "%s -e 'use File::Spec;'" result)))
4932 (with-connection-property vec "perl-cwd-realpath" 4934 (with-tramp-connection-property vec "perl-cwd-realpath"
4933 (tramp-send-command-and-check 4935 (tramp-send-command-and-check
4934 vec (format "%s -e 'use Cwd \"realpath\";'" result)))) 4936 vec (format "%s -e 'use Cwd \"realpath\";'" result))))
4935 result))) 4937 result)))
4936 4938
4937(defun tramp-get-remote-stat (vec) 4939(defun tramp-get-remote-stat (vec)
4938 (with-connection-property vec "stat" 4940 (with-tramp-connection-property vec "stat"
4939 (tramp-message vec 5 "Finding a suitable `stat' command") 4941 (tramp-message vec 5 "Finding a suitable `stat' command")
4940 (let ((result (tramp-find-executable 4942 (let ((result (tramp-find-executable
4941 vec "stat" (tramp-get-remote-path vec))) 4943 vec "stat" (tramp-get-remote-path vec)))
@@ -4953,7 +4955,7 @@ This is used internally by `tramp-file-mode-from-int'."
4953 result))) 4955 result)))
4954 4956
4955(defun tramp-get-remote-readlink (vec) 4957(defun tramp-get-remote-readlink (vec)
4956 (with-connection-property vec "readlink" 4958 (with-tramp-connection-property vec "readlink"
4957 (tramp-message vec 5 "Finding a suitable `readlink' command") 4959 (tramp-message vec 5 "Finding a suitable `readlink' command")
4958 (let ((result (tramp-find-executable 4960 (let ((result (tramp-find-executable
4959 vec "readlink" (tramp-get-remote-path vec)))) 4961 vec "readlink" (tramp-get-remote-path vec))))
@@ -4963,12 +4965,12 @@ This is used internally by `tramp-file-mode-from-int'."
4963 result)))) 4965 result))))
4964 4966
4965(defun tramp-get-remote-trash (vec) 4967(defun tramp-get-remote-trash (vec)
4966 (with-connection-property vec "trash" 4968 (with-tramp-connection-property vec "trash"
4967 (tramp-message vec 5 "Finding a suitable `trash' command") 4969 (tramp-message vec 5 "Finding a suitable `trash' command")
4968 (tramp-find-executable vec "trash" (tramp-get-remote-path vec)))) 4970 (tramp-find-executable vec "trash" (tramp-get-remote-path vec))))
4969 4971
4970(defun tramp-get-remote-id (vec) 4972(defun tramp-get-remote-id (vec)
4971 (with-connection-property vec "id" 4973 (with-tramp-connection-property vec "id"
4972 (tramp-message vec 5 "Finding POSIX `id' command") 4974 (tramp-message vec 5 "Finding POSIX `id' command")
4973 (or 4975 (or
4974 (catch 'id-found 4976 (catch 'id-found
@@ -4982,7 +4984,7 @@ This is used internally by `tramp-file-mode-from-int'."
4982 (tramp-error vec 'file-error "Couldn't find a POSIX `id' command")))) 4984 (tramp-error vec 'file-error "Couldn't find a POSIX `id' command"))))
4983 4985
4984(defun tramp-get-remote-uid (vec id-format) 4986(defun tramp-get-remote-uid (vec id-format)
4985 (with-connection-property vec (format "uid-%s" id-format) 4987 (with-tramp-connection-property vec (format "uid-%s" id-format)
4986 (let ((res (tramp-send-command-and-read 4988 (let ((res (tramp-send-command-and-read
4987 vec 4989 vec
4988 (format "%s -u%s %s" 4990 (format "%s -u%s %s"
@@ -4994,7 +4996,7 @@ This is used internally by `tramp-file-mode-from-int'."
4994 (if (and (equal id-format 'integer) (not (integerp res))) -1 res)))) 4996 (if (and (equal id-format 'integer) (not (integerp res))) -1 res))))
4995 4997
4996(defun tramp-get-remote-gid (vec id-format) 4998(defun tramp-get-remote-gid (vec id-format)
4997 (with-connection-property vec (format "gid-%s" id-format) 4999 (with-tramp-connection-property vec (format "gid-%s" id-format)
4998 (let ((res (tramp-send-command-and-read 5000 (let ((res (tramp-send-command-and-read
4999 vec 5001 vec
5000 (format "%s -g%s %s" 5002 (format "%s -g%s %s"
@@ -5020,7 +5022,7 @@ the length of the file to be compressed.
5020If no corresponding command is found, nil is returned." 5022If no corresponding command is found, nil is returned."
5021 (when (and (integerp tramp-inline-compress-start-size) 5023 (when (and (integerp tramp-inline-compress-start-size)
5022 (> size tramp-inline-compress-start-size)) 5024 (> size tramp-inline-compress-start-size))
5023 (with-connection-property (tramp-get-connection-process vec) prop 5025 (with-tramp-connection-property (tramp-get-connection-process vec) prop
5024 (tramp-find-inline-compress vec) 5026 (tramp-find-inline-compress vec)
5025 (tramp-get-connection-property 5027 (tramp-get-connection-property
5026 (tramp-get-connection-process vec) prop nil)))) 5028 (tramp-get-connection-process vec) prop nil))))
@@ -5041,7 +5043,8 @@ function cell is returned to be applied on a buffer."
5041 ;; no inline coding is found. 5043 ;; no inline coding is found.
5042 (ignore-errors 5044 (ignore-errors
5043 (let ((coding 5045 (let ((coding
5044 (with-connection-property (tramp-get-connection-process vec) prop 5046 (with-tramp-connection-property
5047 (tramp-get-connection-process vec) prop
5045 (tramp-find-inline-encoding vec) 5048 (tramp-find-inline-encoding vec)
5046 (tramp-get-connection-property 5049 (tramp-get-connection-property
5047 (tramp-get-connection-process vec) prop nil))) 5050 (tramp-get-connection-process vec) prop nil)))
diff --git a/lisp/net/tramp-smb.el b/lisp/net/tramp-smb.el
index f1d54b6fd3c..567f8f2969a 100644
--- a/lisp/net/tramp-smb.el
+++ b/lisp/net/tramp-smb.el
@@ -355,7 +355,7 @@ pass to the OPERATION."
355 (let ((t1 (tramp-tramp-file-p dirname)) 355 (let ((t1 (tramp-tramp-file-p dirname))
356 (t2 (tramp-tramp-file-p newname))) 356 (t2 (tramp-tramp-file-p newname)))
357 (with-parsed-tramp-file-name (if t1 dirname newname) nil 357 (with-parsed-tramp-file-name (if t1 dirname newname) nil
358 (tramp-with-progress-reporter 358 (with-tramp-progress-reporter
359 v 0 (format "Copying %s to %s" dirname newname) 359 v 0 (format "Copying %s to %s" dirname newname)
360 (cond 360 (cond
361 ;; We must use a local temporary directory. 361 ;; We must use a local temporary directory.
@@ -491,7 +491,7 @@ KEEP-DATE has no effect in case NEWNAME resides on an SMB server.
491PRESERVE-UID-GID and PRESERVE-SELINUX-CONTEXT are completely ignored." 491PRESERVE-UID-GID and PRESERVE-SELINUX-CONTEXT are completely ignored."
492 (setq filename (expand-file-name filename) 492 (setq filename (expand-file-name filename)
493 newname (expand-file-name newname)) 493 newname (expand-file-name newname))
494 (tramp-with-progress-reporter 494 (with-tramp-progress-reporter
495 (tramp-dissect-file-name (if (file-remote-p filename) filename newname)) 495 (tramp-dissect-file-name (if (file-remote-p filename) filename newname))
496 0 (format "Copying %s to %s" filename newname) 496 0 (format "Copying %s to %s" filename newname)
497 497
@@ -642,7 +642,8 @@ PRESERVE-UID-GID and PRESERVE-SELINUX-CONTEXT are completely ignored."
642 (unless id-format (setq id-format 'integer)) 642 (unless id-format (setq id-format 'integer))
643 (ignore-errors 643 (ignore-errors
644 (with-parsed-tramp-file-name filename nil 644 (with-parsed-tramp-file-name filename nil
645 (with-file-property v localname (format "file-attributes-%s" id-format) 645 (with-tramp-file-property
646 v localname (format "file-attributes-%s" id-format)
646 (if (and (tramp-smb-get-share v) (tramp-smb-get-stat-capability v)) 647 (if (and (tramp-smb-get-share v) (tramp-smb-get-stat-capability v))
647 (tramp-smb-do-file-attributes-with-stat v id-format) 648 (tramp-smb-do-file-attributes-with-stat v id-format)
648 ;; Reading just the filename entry via "dir localname" is not 649 ;; Reading just the filename entry via "dir localname" is not
@@ -753,7 +754,7 @@ PRESERVE-UID-GID and PRESERVE-SELINUX-CONTEXT are completely ignored."
753 v 'file-error 754 v 'file-error
754 "Cannot make local copy of non-existing file `%s'" filename)) 755 "Cannot make local copy of non-existing file `%s'" filename))
755 (let ((tmpfile (tramp-compat-make-temp-file filename))) 756 (let ((tmpfile (tramp-compat-make-temp-file filename)))
756 (tramp-with-progress-reporter 757 (with-tramp-progress-reporter
757 v 3 (format "Fetching %s to tmp file %s" filename tmpfile) 758 v 3 (format "Fetching %s to tmp file %s" filename tmpfile)
758 (unless (tramp-smb-send-command 759 (unless (tramp-smb-send-command
759 v (format "get \"%s\" \"%s\"" 760 v (format "get \"%s\" \"%s\""
@@ -771,7 +772,7 @@ PRESERVE-UID-GID and PRESERVE-SELINUX-CONTEXT are completely ignored."
771 (all-completions 772 (all-completions
772 filename 773 filename
773 (with-parsed-tramp-file-name directory nil 774 (with-parsed-tramp-file-name directory nil
774 (with-file-property v localname "file-name-all-completions" 775 (with-tramp-file-property v localname "file-name-all-completions"
775 (save-match-data 776 (save-match-data
776 (let ((entries (tramp-smb-get-file-entries directory))) 777 (let ((entries (tramp-smb-get-file-entries directory)))
777 (mapcar 778 (mapcar
@@ -1119,7 +1120,7 @@ target of the symlink differ."
1119 (if (file-remote-p filename) filename newname)) 1120 (if (file-remote-p filename) filename newname))
1120 'file-already-exists newname)) 1121 'file-already-exists newname))
1121 1122
1122 (tramp-with-progress-reporter 1123 (with-tramp-progress-reporter
1123 (tramp-dissect-file-name (if (file-remote-p filename) filename newname)) 1124 (tramp-dissect-file-name (if (file-remote-p filename) filename newname))
1124 0 (format "Renaming %s to %s" filename newname) 1125 0 (format "Renaming %s to %s" filename newname)
1125 1126
@@ -1253,7 +1254,7 @@ errors for shares like \"C$/\", which are common in Microsoft Windows."
1253 (list start end tmpfile append 'no-message lockname confirm) 1254 (list start end tmpfile append 'no-message lockname confirm)
1254 (list start end tmpfile append 'no-message lockname))) 1255 (list start end tmpfile append 'no-message lockname)))
1255 1256
1256 (tramp-with-progress-reporter 1257 (with-tramp-progress-reporter
1257 v 3 (format "Moving tmp file %s to %s" tmpfile filename) 1258 v 3 (format "Moving tmp file %s to %s" tmpfile filename)
1258 (unwind-protect 1259 (unwind-protect
1259 (unless (tramp-smb-send-command 1260 (unless (tramp-smb-send-command
@@ -1312,7 +1313,7 @@ Either the shares are listed, or the `dir' command is executed.
1312Result is a list of (LOCALNAME MODE SIZE MONTH DAY TIME YEAR)." 1313Result is a list of (LOCALNAME MODE SIZE MONTH DAY TIME YEAR)."
1313 (with-parsed-tramp-file-name (file-name-as-directory directory) nil 1314 (with-parsed-tramp-file-name (file-name-as-directory directory) nil
1314 (setq localname (or localname "/")) 1315 (setq localname (or localname "/"))
1315 (with-file-property v localname "file-entries" 1316 (with-tramp-file-property v localname "file-entries"
1316 (with-current-buffer (tramp-get-connection-buffer v) 1317 (with-current-buffer (tramp-get-connection-buffer v)
1317 (let* ((share (tramp-smb-get-share v)) 1318 (let* ((share (tramp-smb-get-share v))
1318 (cache (tramp-get-connection-property v "share-cache" nil)) 1319 (cache (tramp-get-connection-property v "share-cache" nil))
@@ -1497,7 +1498,7 @@ Result is the list (LOCALNAME MODE SIZE MTIME)."
1497 ;; When we are not logged in yet, we return nil. 1498 ;; When we are not logged in yet, we return nil.
1498 (if (let ((p (tramp-get-connection-process vec))) 1499 (if (let ((p (tramp-get-connection-process vec)))
1499 (and p (processp p) (memq (process-status p) '(run open)))) 1500 (and p (processp p) (memq (process-status p) '(run open))))
1500 (with-connection-property 1501 (with-tramp-connection-property
1501 (tramp-get-connection-process vec) "cifs-capabilities" 1502 (tramp-get-connection-process vec) "cifs-capabilities"
1502 (save-match-data 1503 (save-match-data
1503 (when (tramp-smb-send-command vec "posix") 1504 (when (tramp-smb-send-command vec "posix")
@@ -1515,7 +1516,7 @@ Result is the list (LOCALNAME MODE SIZE MTIME)."
1515 ;; When we are not logged in yet, we return nil. 1516 ;; When we are not logged in yet, we return nil.
1516 (if (let ((p (tramp-get-connection-process vec))) 1517 (if (let ((p (tramp-get-connection-process vec)))
1517 (and p (processp p) (memq (process-status p) '(run open)))) 1518 (and p (processp p) (memq (process-status p) '(run open))))
1518 (with-connection-property 1519 (with-tramp-connection-property
1519 (tramp-get-connection-process vec) "stat-capability" 1520 (tramp-get-connection-process vec) "stat-capability"
1520 (tramp-smb-send-command vec "stat .")))) 1521 (tramp-smb-send-command vec "stat ."))))
1521 1522
@@ -1625,7 +1626,7 @@ If ARGUMENT is non-nil, use it as argument for
1625 (setq args (append args (list argument)))) 1626 (setq args (append args (list argument))))
1626 1627
1627 ;; OK, let's go. 1628 ;; OK, let's go.
1628 (tramp-with-progress-reporter 1629 (with-tramp-progress-reporter
1629 vec 3 1630 vec 3
1630 (format "Opening connection for //%s%s/%s" 1631 (format "Opening connection for //%s%s/%s"
1631 (if (not (zerop (length user))) (concat user "@") "") 1632 (if (not (zerop (length user))) (concat user "@") "")
diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el
index b1532eb2ae4..874c0aa7fef 100644
--- a/lisp/net/tramp.el
+++ b/lisp/net/tramp.el
@@ -1353,8 +1353,7 @@ ARGS to actually emit the message (if applicable)."
1353 "tramp-debug-message" 1353 "tramp-debug-message"
1354 "tramp-error" 1354 "tramp-error"
1355 "tramp-error-with-buffer" 1355 "tramp-error-with-buffer"
1356 "tramp-message" 1356 "tramp-message")
1357 "tramp-with-progress-reporter")
1358 t) 1357 t)
1359 "$") 1358 "$")
1360 fn))) 1359 fn)))
@@ -1498,7 +1497,7 @@ If VAR is nil, then we bind `v' to the structure and `method', `user',
1498 (when (string-match message (or (current-message) "")) 1497 (when (string-match message (or (current-message) ""))
1499 (tramp-compat-funcall 'progress-reporter-update reporter value)))) 1498 (tramp-compat-funcall 'progress-reporter-update reporter value))))
1500 1499
1501(defmacro tramp-with-progress-reporter (vec level message &rest body) 1500(defmacro with-tramp-progress-reporter (vec level message &rest body)
1502 "Executes BODY, spinning a progress reporter with MESSAGE. 1501 "Executes BODY, spinning a progress reporter with MESSAGE.
1503If LEVEL does not fit for visible messages, or if this is a 1502If LEVEL does not fit for visible messages, or if this is a
1504nested call of the macro, there are only traces without a visible 1503nested call of the macro, there are only traces without a visible
@@ -1527,7 +1526,42 @@ progress reporter."
1527 (tramp-message ,vec ,level "%s...done" ,message)))) 1526 (tramp-message ,vec ,level "%s...done" ,message))))
1528 1527
1529(tramp-compat-font-lock-add-keywords 1528(tramp-compat-font-lock-add-keywords
1530 'emacs-lisp-mode '("\\<tramp-with-progress-reporter\\>")) 1529 'emacs-lisp-mode '("\\<with-tramp-progress-reporter\\>"))
1530
1531(defmacro with-tramp-file-property (vec file property &rest body)
1532 "Check in Tramp cache for PROPERTY, otherwise execute BODY and set cache.
1533FILE must be a local file name on a connection identified via VEC."
1534 `(if (file-name-absolute-p ,file)
1535 (let ((value (tramp-get-file-property ,vec ,file ,property 'undef)))
1536 (when (eq value 'undef)
1537 ;; We cannot pass @body as parameter to
1538 ;; `tramp-set-file-property' because it mangles our
1539 ;; debug messages.
1540 (setq value (progn ,@body))
1541 (tramp-set-file-property ,vec ,file ,property value))
1542 value)
1543 ,@body))
1544
1545(put 'with-tramp-file-property 'lisp-indent-function 3)
1546(put 'with-tramp-file-property 'edebug-form-spec t)
1547(tramp-compat-font-lock-add-keywords
1548 'emacs-lisp-mode '("\\<with-tramp-file-property\\>"))
1549
1550(defmacro with-tramp-connection-property (key property &rest body)
1551 "Check in Tramp for property PROPERTY, otherwise executes BODY and set."
1552 `(let ((value (tramp-get-connection-property ,key ,property 'undef)))
1553 (when (eq value 'undef)
1554 ;; We cannot pass ,@body as parameter to
1555 ;; `tramp-set-connection-property' because it mangles our debug
1556 ;; messages.
1557 (setq value (progn ,@body))
1558 (tramp-set-connection-property ,key ,property value))
1559 value))
1560
1561(put 'with-tramp-connection-property 'lisp-indent-function 2)
1562(put 'with-tramp-connection-property 'edebug-form-spec t)
1563(tramp-compat-font-lock-add-keywords
1564 'emacs-lisp-mode '("\\<with-tramp-connection-property\\>"))
1531 1565
1532(defalias 'tramp-drop-volume-letter 1566(defalias 'tramp-drop-volume-letter
1533 (if (memq system-type '(cygwin windows-nt)) 1567 (if (memq system-type '(cygwin windows-nt))
@@ -2860,7 +2894,7 @@ User is always nil."
2860 (setq filename (expand-file-name filename)) 2894 (setq filename (expand-file-name filename))
2861 (let (result local-copy remote-copy) 2895 (let (result local-copy remote-copy)
2862 (with-parsed-tramp-file-name filename nil 2896 (with-parsed-tramp-file-name filename nil
2863 (tramp-with-progress-reporter 2897 (with-tramp-progress-reporter
2864 v 3 (format "Inserting `%s'" filename) 2898 v 3 (format "Inserting `%s'" filename)
2865 (unwind-protect 2899 (unwind-protect
2866 (if (not (file-exists-p filename)) 2900 (if (not (file-exists-p filename))
@@ -2983,7 +3017,7 @@ User is always nil."
2983 (if (not (file-exists-p file)) 3017 (if (not (file-exists-p file))
2984 nil 3018 nil
2985 (let ((tramp-message-show-message (not nomessage))) 3019 (let ((tramp-message-show-message (not nomessage)))
2986 (tramp-with-progress-reporter v 0 (format "Loading %s" file) 3020 (with-tramp-progress-reporter v 0 (format "Loading %s" file)
2987 (let ((local-copy (file-local-copy file))) 3021 (let ((local-copy (file-local-copy file)))
2988 ;; MUST-SUFFIX doesn't exist on XEmacs, so let it default to nil. 3022 ;; MUST-SUFFIX doesn't exist on XEmacs, so let it default to nil.
2989 (unwind-protect 3023 (unwind-protect
@@ -3127,7 +3161,7 @@ beginning of local filename are not substituted."
3127 "Send the login name." 3161 "Send the login name."
3128 (when (not (stringp tramp-current-user)) 3162 (when (not (stringp tramp-current-user))
3129 (setq tramp-current-user 3163 (setq tramp-current-user
3130 (with-connection-property vec "login-as" 3164 (with-tramp-connection-property vec "login-as"
3131 (save-window-excursion 3165 (save-window-excursion
3132 (let ((enable-recursive-minibuffers t)) 3166 (let ((enable-recursive-minibuffers t))
3133 (pop-to-buffer (tramp-get-connection-buffer vec)) 3167 (pop-to-buffer (tramp-get-connection-buffer vec))
@@ -3417,13 +3451,13 @@ the remote host use line-endings as defined in the variable
3417(defun tramp-get-inode (vec) 3451(defun tramp-get-inode (vec)
3418 "Returns the virtual inode number. 3452 "Returns the virtual inode number.
3419If it doesn't exist, generate a new one." 3453If it doesn't exist, generate a new one."
3420 (with-file-property vec (tramp-file-name-localname vec) "inode" 3454 (with-tramp-file-property vec (tramp-file-name-localname vec) "inode"
3421 (setq tramp-inodes (1+ tramp-inodes)))) 3455 (setq tramp-inodes (1+ tramp-inodes))))
3422 3456
3423(defun tramp-get-device (vec) 3457(defun tramp-get-device (vec)
3424 "Returns the virtual device number. 3458 "Returns the virtual device number.
3425If it doesn't exist, generate a new one." 3459If it doesn't exist, generate a new one."
3426 (with-connection-property (tramp-get-connection-process vec) "device" 3460 (with-tramp-connection-property (tramp-get-connection-process vec) "device"
3427 (cons -1 (setq tramp-devices (1+ tramp-devices))))) 3461 (cons -1 (setq tramp-devices (1+ tramp-devices)))))
3428 3462
3429(defun tramp-equal-remote (file1 file2) 3463(defun tramp-equal-remote (file1 file2)
@@ -3545,7 +3579,7 @@ would yield `t'. On the other hand, the following check results in nil:
3545 3579
3546(defun tramp-get-remote-tmpdir (vec) 3580(defun tramp-get-remote-tmpdir (vec)
3547 "Return directory for temporary files on the remote host identified by VEC." 3581 "Return directory for temporary files on the remote host identified by VEC."
3548 (with-connection-property vec "tmpdir" 3582 (with-tramp-connection-property vec "tmpdir"
3549 (let ((dir (tramp-make-tramp-file-name 3583 (let ((dir (tramp-make-tramp-file-name
3550 (tramp-file-name-method vec) 3584 (tramp-file-name-method vec)
3551 (tramp-file-name-user vec) 3585 (tramp-file-name-user vec)
@@ -3833,7 +3867,6 @@ Only works for Bourne-like shells."
3833;; * In Emacs 21, `insert-directory' shows total number of bytes used 3867;; * In Emacs 21, `insert-directory' shows total number of bytes used
3834;; by the files in that directory. Add this here. 3868;; by the files in that directory. Add this here.
3835;; * Avoid screen blanking when hitting `g' in dired. (Eli Tziperman) 3869;; * Avoid screen blanking when hitting `g' in dired. (Eli Tziperman)
3836;; * Make ffap.el grok Tramp filenames. (Eli Tziperman)
3837;; * abbreviate-file-name 3870;; * abbreviate-file-name
3838;; * Better error checking. At least whenever we see something 3871;; * Better error checking. At least whenever we see something
3839;; strange when doing zerop, we should kill the process and start 3872;; strange when doing zerop, we should kill the process and start
diff --git a/lisp/net/trampver.el b/lisp/net/trampver.el
index 2d0a8e3d23d..331884691f4 100644
--- a/lisp/net/trampver.el
+++ b/lisp/net/trampver.el
@@ -31,7 +31,7 @@
31;; should be changed only there. 31;; should be changed only there.
32 32
33;;;###tramp-autoload 33;;;###tramp-autoload
34(defconst tramp-version "2.2.6" 34(defconst tramp-version "2.2.7-pre"
35 "This version of Tramp.") 35 "This version of Tramp.")
36 36
37;;;###tramp-autoload 37;;;###tramp-autoload
@@ -44,7 +44,7 @@
44 (= emacs-major-version 21) 44 (= emacs-major-version 21)
45 (>= emacs-minor-version 4))) 45 (>= emacs-minor-version 4)))
46 "ok" 46 "ok"
47 (format "Tramp 2.2.6 is not fit for %s" 47 (format "Tramp 2.2.7-pre is not fit for %s"
48 (when (string-match "^.*$" (emacs-version)) 48 (when (string-match "^.*$" (emacs-version))
49 (match-string 0 (emacs-version))))))) 49 (match-string 0 (emacs-version)))))))
50 (unless (string-match "\\`ok\\'" x) (error "%s" x))) 50 (unless (string-match "\\`ok\\'" x) (error "%s" x)))
diff --git a/lisp/newcomment.el b/lisp/newcomment.el
index 6d2eed71948..a754c89c4ae 100644
--- a/lisp/newcomment.el
+++ b/lisp/newcomment.el
@@ -117,20 +117,20 @@ Comments might be indented to a different value in order not to go beyond
117If there are any \\(...\\) pairs, the comment delimiter text is held to begin 117If there are any \\(...\\) pairs, the comment delimiter text is held to begin
118at the place matched by the close of the first pair.") 118at the place matched by the close of the first pair.")
119;;;###autoload 119;;;###autoload
120(put 'comment-start-skip 'safe-local-variable 'string-or-null-p) 120(put 'comment-start-skip 'safe-local-variable 'stringp)
121 121
122;;;###autoload 122;;;###autoload
123(defvar comment-end-skip nil 123(defvar comment-end-skip nil
124 "Regexp to match the end of a comment plus everything back to its body.") 124 "Regexp to match the end of a comment plus everything back to its body.")
125;;;###autoload 125;;;###autoload
126(put 'comment-end-skip 'safe-local-variable 'string-or-null-p) 126(put 'comment-end-skip 'safe-local-variable 'stringp)
127 127
128;;;###autoload 128;;;###autoload
129(defvar comment-end (purecopy "") 129(defvar comment-end (purecopy "")
130 "String to insert to end a new comment. 130 "String to insert to end a new comment.
131Should be an empty string if comments are terminated by end-of-line.") 131Should be an empty string if comments are terminated by end-of-line.")
132;;;###autoload 132;;;###autoload
133(put 'comment-end 'safe-local-variable 'string-or-null-p) 133(put 'comment-end 'safe-local-variable 'stringp)
134 134
135;;;###autoload 135;;;###autoload
136(defvar comment-indent-function 'comment-indent-default 136(defvar comment-indent-function 'comment-indent-default
@@ -327,9 +327,9 @@ terminated by the end of line (i.e. `comment-end' is empty)."
327;;;###autoload 327;;;###autoload
328(defun comment-normalize-vars (&optional noerror) 328(defun comment-normalize-vars (&optional noerror)
329 "Check and setup the variables needed by other commenting functions. 329 "Check and setup the variables needed by other commenting functions.
330Any command calling functions from newcomment.el, being entry points, should 330Any command calling functions from newcomment.el should call this function
331call this function before any other, so the rest of the code can assume that 331before any other, so the rest of the code can assume that the variables are
332the variables are properly set." 332properly set."
333 (unless (and (not comment-start) noerror) 333 (unless (and (not comment-start) noerror)
334 (unless comment-start 334 (unless comment-start
335 (let ((cs (read-string "No comment syntax is defined. Use: "))) 335 (let ((cs (read-string "No comment syntax is defined. Use: ")))
diff --git a/lisp/progmodes/cc-bytecomp.el b/lisp/progmodes/cc-bytecomp.el
index bd9805673a4..4236f1c983f 100644
--- a/lisp/progmodes/cc-bytecomp.el
+++ b/lisp/progmodes/cc-bytecomp.el
@@ -338,30 +338,6 @@ at compile time, e.g. for macros and inline functions."
338 (cc-bytecomp-debug-msg 338 (cc-bytecomp-debug-msg
339 "cc-bytecomp-defun: Covered function %s" ',fun)))))) 339 "cc-bytecomp-defun: Covered function %s" ',fun))))))
340 340
341(put 'cc-bytecomp-defmacro 'lisp-indent-function 'defun)
342(defmacro cc-bytecomp-defmacro (fun &rest temp-macro)
343 "Bind the symbol as a macro during compilation (and evaluation) of the
344file. Don't use outside `eval-when-compile'."
345 `(let ((orig-fun (assq ',fun cc-bytecomp-original-functions)))
346 (if (not orig-fun)
347 (setq orig-fun
348 (list ',fun
349 nil
350 (if (fboundp ',fun)
351 (progn
352 (cc-bytecomp-debug-msg
353 "cc-bytecomp-defmacro: Saving %s" ',fun)
354 (symbol-function ',fun))
355 (cc-bytecomp-debug-msg
356 "cc-bytecomp-defmacro: Saving %s as unbound" ',fun)
357 'unbound))
358 cc-bytecomp-original-functions
359 (cons orig-fun cc-bytecomp-original-functions)))
360 (defmacro ,fun ,@temp-macro)
361 (cc-bytecomp-debug-msg
362 "cc-bytecomp-defmacro: Bound macro %s" ',fun)
363 (setcar (cdr orig-fun) (symbol-function ',fun))))
364
365(defmacro cc-bytecomp-put (symbol propname value) 341(defmacro cc-bytecomp-put (symbol propname value)
366 "Set a property on a symbol during compilation (and evaluation) of 342 "Set a property on a symbol during compilation (and evaluation) of
367the file. Don't use outside `eval-when-compile'." 343the file. Don't use outside `eval-when-compile'."
diff --git a/lisp/progmodes/cc-vars.el b/lisp/progmodes/cc-vars.el
index 5201e4a26ed..d56c1124a9c 100644
--- a/lisp/progmodes/cc-vars.el
+++ b/lisp/progmodes/cc-vars.el
@@ -49,16 +49,6 @@
49 (require 'custom) 49 (require 'custom)
50 (require 'widget)) 50 (require 'widget))
51 51
52(cc-eval-when-compile
53 ;; Need the function form of `backquote', which isn't standardized
54 ;; between Emacsen. It's called `bq-process' in XEmacs, and
55 ;; `backquote-process' in Emacs. `backquote-process' returns a
56 ;; slightly more convoluted form, so let `bq-process' be the norm.
57 (if (fboundp 'backquote-process)
58 (cc-bytecomp-defmacro bq-process (form)
59 `(cdr (backquote-process ,form)))))
60
61
62;;; Helpers 52;;; Helpers
63 53
64;; This widget exists in newer versions of the Custom library 54;; This widget exists in newer versions of the Custom library
diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el
index 6b0dc954ca7..5bf64c18f99 100644
--- a/lisp/progmodes/python.el
+++ b/lisp/progmodes/python.el
@@ -235,6 +235,9 @@
235 (substitute-key-definition 'forward-sentence 235 (substitute-key-definition 'forward-sentence
236 'python-nav-forward-block 236 'python-nav-forward-block
237 map global-map) 237 map global-map)
238 (substitute-key-definition 'backward-up-list
239 'python-nav-backward-up-list
240 map global-map)
238 (define-key map "\C-c\C-j" 'imenu) 241 (define-key map "\C-c\C-j" 'imenu)
239 ;; Indent specific 242 ;; Indent specific
240 (define-key map "\177" 'python-indent-dedent-line-backspace) 243 (define-key map "\177" 'python-indent-dedent-line-backspace)
@@ -337,19 +340,28 @@
337 "==" ">=" "is" "not"))) 340 "==" ">=" "is" "not")))
338 ;; FIXME: Use regexp-opt. 341 ;; FIXME: Use regexp-opt.
339 (assignment-operator . ,(rx (or "=" "+=" "-=" "*=" "/=" "//=" "%=" "**=" 342 (assignment-operator . ,(rx (or "=" "+=" "-=" "*=" "/=" "//=" "%=" "**="
340 ">>=" "<<=" "&=" "^=" "|=")))) 343 ">>=" "<<=" "&=" "^=" "|=")))
341 "Additional Python specific sexps for `python-rx'")) 344 (string-delimiter . ,(rx (and
342 345 ;; Match even number of backslashes.
343(defmacro python-rx (&rest regexps) 346 (or (not (any ?\\ ?\' ?\")) point
344 "Python mode specialized rx macro. 347 ;; Quotes might be preceded by a escaped quote.
348 (and (or (not (any ?\\)) point) ?\\
349 (* ?\\ ?\\) (any ?\' ?\")))
350 (* ?\\ ?\\)
351 ;; Match single or triple quotes of any kind.
352 (group (or "\"" "\"\"\"" "'" "'''"))))))
353 "Additional Python specific sexps for `python-rx'")
354
355 (defmacro python-rx (&rest regexps)
356 "Python mode specialized rx macro.
345This variant of `rx' supports common python named REGEXPS." 357This variant of `rx' supports common python named REGEXPS."
346 (let ((rx-constituents (append python-rx-constituents rx-constituents))) 358 (let ((rx-constituents (append python-rx-constituents rx-constituents)))
347 (cond ((null regexps) 359 (cond ((null regexps)
348 (error "No regexp")) 360 (error "No regexp"))
349 ((cdr regexps) 361 ((cdr regexps)
350 (rx-to-string `(and ,@regexps) t)) 362 (rx-to-string `(and ,@regexps) t))
351 (t 363 (t
352 (rx-to-string (car regexps) t))))) 364 (rx-to-string (car regexps) t))))))
353 365
354 366
355;;; Font-lock and syntax 367;;; Font-lock and syntax
@@ -498,16 +510,7 @@ The type returned can be `comment', `string' or `paren'."
498 510
499(defconst python-syntax-propertize-function 511(defconst python-syntax-propertize-function
500 (syntax-propertize-rules 512 (syntax-propertize-rules
501 ((rx 513 ((python-rx string-delimiter)
502 (and
503 ;; Match even number of backslashes.
504 (or (not (any ?\\ ?\' ?\")) point
505 ;; Quotes might be preceded by a escaped quote.
506 (and (or (not (any ?\\)) point) ?\\
507 (* ?\\ ?\\) (any ?\' ?\")))
508 (* ?\\ ?\\)
509 ;; Match single or triple quotes of any kind.
510 (group (or "\"" "\"\"\"" "'" "'''"))))
511 (0 (ignore (python-syntax-stringify)))))) 514 (0 (ignore (python-syntax-stringify))))))
512 515
513(defsubst python-syntax-count-quotes (quote-char &optional point limit) 516(defsubst python-syntax-count-quotes (quote-char &optional point limit)
@@ -1409,6 +1412,67 @@ move backward N times."
1409 (python-nav--backward-sexp) 1412 (python-nav--backward-sexp)
1410 (setq arg (1+ arg)))) 1413 (setq arg (1+ arg))))
1411 1414
1415(defun python-nav--up-list (&optional dir)
1416 "Internal implementation of `python-nav-up-list'.
1417DIR is always 1 or -1 and comes sanitized from
1418`python-nav-up-list' calls."
1419 (let ((context (python-syntax-context-type))
1420 (forward-p (> dir 0)))
1421 (cond
1422 ((memq context '(string comment)))
1423 ((eq context 'paren)
1424 (let ((forward-sexp-function))
1425 (up-list dir)))
1426 ((and forward-p (python-info-end-of-block-p))
1427 (let ((parent-end-pos
1428 (save-excursion
1429 (let ((indentation (and
1430 (python-nav-beginning-of-block)
1431 (current-indentation))))
1432 (while (and indentation
1433 (> indentation 0)
1434 (>= (current-indentation) indentation)
1435 (python-nav-backward-block)))
1436 (python-nav-end-of-block)))))
1437 (and (> (or parent-end-pos (point)) (point))
1438 (goto-char parent-end-pos))))
1439 (forward-p (python-nav-end-of-block))
1440 ((and (not forward-p)
1441 (> (current-indentation) 0)
1442 (python-info-beginning-of-block-p))
1443 (let ((prev-block-pos
1444 (save-excursion
1445 (let ((indentation (current-indentation)))
1446 (while (and (python-nav-backward-block)
1447 (> (current-indentation) indentation))))
1448 (point))))
1449 (and (> (point) prev-block-pos)
1450 (goto-char prev-block-pos))))
1451 ((not forward-p) (python-nav-beginning-of-block)))))
1452
1453(defun python-nav-up-list (&optional arg)
1454 "Move forward out of one level of parentheses (or blocks).
1455With ARG, do this that many times.
1456A negative argument means move backward but still to a less deep spot.
1457This command assumes point is not in a string or comment."
1458 (interactive "^p")
1459 (or arg (setq arg 1))
1460 (while (> arg 0)
1461 (python-nav--up-list 1)
1462 (setq arg (1- arg)))
1463 (while (< arg 0)
1464 (python-nav--up-list -1)
1465 (setq arg (1+ arg))))
1466
1467(defun python-nav-backward-up-list (&optional arg)
1468 "Move backward out of one level of parentheses (or blocks).
1469With ARG, do this that many times.
1470A negative argument means move backward but still to a less deep spot.
1471This command assumes point is not in a string or comment."
1472 (interactive "^p")
1473 (or arg (setq arg 1))
1474 (python-nav-up-list (- arg)))
1475
1412 1476
1413;;; Shell integration 1477;;; Shell integration
1414 1478
@@ -1609,6 +1673,20 @@ OUTPUT is a string with the contents of the buffer."
1609 1673
1610(defvar python-shell--parent-buffer nil) 1674(defvar python-shell--parent-buffer nil)
1611 1675
1676(defvar python-shell-output-syntax-table
1677 (let ((table (make-syntax-table python-dotty-syntax-table)))
1678 (modify-syntax-entry ?\' "." table)
1679 (modify-syntax-entry ?\" "." table)
1680 (modify-syntax-entry ?\( "." table)
1681 (modify-syntax-entry ?\[ "." table)
1682 (modify-syntax-entry ?\{ "." table)
1683 (modify-syntax-entry ?\) "." table)
1684 (modify-syntax-entry ?\] "." table)
1685 (modify-syntax-entry ?\} "." table)
1686 table)
1687 "Syntax table for shell output.
1688It makes parens and quotes be treated as punctuation chars.")
1689
1612(define-derived-mode inferior-python-mode comint-mode "Inferior Python" 1690(define-derived-mode inferior-python-mode comint-mode "Inferior Python"
1613 "Major mode for Python inferior process. 1691 "Major mode for Python inferior process.
1614Runs a Python interpreter as a subprocess of Emacs, with Python 1692Runs a Python interpreter as a subprocess of Emacs, with Python
@@ -1637,7 +1715,6 @@ variable.
1637 python-shell-prompt-regexp 1715 python-shell-prompt-regexp
1638 python-shell-prompt-block-regexp 1716 python-shell-prompt-block-regexp
1639 python-shell-prompt-pdb-regexp)) 1717 python-shell-prompt-pdb-regexp))
1640 (set-syntax-table python-mode-syntax-table)
1641 (setq mode-line-process '(":%s")) 1718 (setq mode-line-process '(":%s"))
1642 (make-local-variable 'comint-output-filter-functions) 1719 (make-local-variable 'comint-output-filter-functions)
1643 (add-hook 'comint-output-filter-functions 1720 (add-hook 'comint-output-filter-functions
@@ -1658,10 +1735,21 @@ variable.
1658 (make-local-variable 'python-pdbtrack-tracked-buffer) 1735 (make-local-variable 'python-pdbtrack-tracked-buffer)
1659 (make-local-variable 'python-shell-internal-last-output) 1736 (make-local-variable 'python-shell-internal-last-output)
1660 (when python-shell-enable-font-lock 1737 (when python-shell-enable-font-lock
1738 (set-syntax-table python-mode-syntax-table)
1661 (set (make-local-variable 'font-lock-defaults) 1739 (set (make-local-variable 'font-lock-defaults)
1662 '(python-font-lock-keywords nil nil nil nil)) 1740 '(python-font-lock-keywords nil nil nil nil))
1663 (set (make-local-variable 'syntax-propertize-function) 1741 (set (make-local-variable 'syntax-propertize-function)
1664 python-syntax-propertize-function)) 1742 (syntax-propertize-rules
1743 (comint-prompt-regexp
1744 (0 (ignore
1745 (put-text-property
1746 comint-last-input-start end 'syntax-table
1747 python-shell-output-syntax-table)
1748 (font-lock-unfontify-region comint-last-input-start end))))
1749 ((python-rx string-delimiter)
1750 (0 (ignore
1751 (and (not (eq (get-text-property start 'field) 'output))
1752 (python-syntax-stringify))))))))
1665 (compilation-shell-minor-mode 1)) 1753 (compilation-shell-minor-mode 1))
1666 1754
1667(defun python-shell-make-comint (cmd proc-name &optional pop internal) 1755(defun python-shell-make-comint (cmd proc-name &optional pop internal)
@@ -1842,7 +1930,9 @@ detecting a prompt at the end of the buffer."
1842 python-shell-output-filter-buffer 1930 python-shell-output-filter-buffer
1843 (concat python-shell-output-filter-buffer string)) 1931 (concat python-shell-output-filter-buffer string))
1844 (when (string-match 1932 (when (string-match
1845 (format "\n\\(?:%s\\|%s\\|%s\\)$" 1933 ;; XXX: It seems on OSX an extra carriage return is attached
1934 ;; at the end of output, this handles that too.
1935 (format "\r?\n\\(?:%s\\|%s\\|%s\\)$"
1846 python-shell-prompt-regexp 1936 python-shell-prompt-regexp
1847 python-shell-prompt-block-regexp 1937 python-shell-prompt-block-regexp
1848 python-shell-prompt-pdb-regexp) 1938 python-shell-prompt-pdb-regexp)
@@ -2246,28 +2336,28 @@ inferior python process is updated properly."
2246 2336
2247(defcustom python-fill-comment-function 'python-fill-comment 2337(defcustom python-fill-comment-function 'python-fill-comment
2248 "Function to fill comments. 2338 "Function to fill comments.
2249This is the function used by `python-fill-paragraph-function' to 2339This is the function used by `python-fill-paragraph' to
2250fill comments." 2340fill comments."
2251 :type 'symbol 2341 :type 'symbol
2252 :group 'python) 2342 :group 'python)
2253 2343
2254(defcustom python-fill-string-function 'python-fill-string 2344(defcustom python-fill-string-function 'python-fill-string
2255 "Function to fill strings. 2345 "Function to fill strings.
2256This is the function used by `python-fill-paragraph-function' to 2346This is the function used by `python-fill-paragraph' to
2257fill strings." 2347fill strings."
2258 :type 'symbol 2348 :type 'symbol
2259 :group 'python) 2349 :group 'python)
2260 2350
2261(defcustom python-fill-decorator-function 'python-fill-decorator 2351(defcustom python-fill-decorator-function 'python-fill-decorator
2262 "Function to fill decorators. 2352 "Function to fill decorators.
2263This is the function used by `python-fill-paragraph-function' to 2353This is the function used by `python-fill-paragraph' to
2264fill decorators." 2354fill decorators."
2265 :type 'symbol 2355 :type 'symbol
2266 :group 'python) 2356 :group 'python)
2267 2357
2268(defcustom python-fill-paren-function 'python-fill-paren 2358(defcustom python-fill-paren-function 'python-fill-paren
2269 "Function to fill parens. 2359 "Function to fill parens.
2270This is the function used by `python-fill-paragraph-function' to 2360This is the function used by `python-fill-paragraph' to
2271fill parens." 2361fill parens."
2272 :type 'symbol 2362 :type 'symbol
2273 :group 'python) 2363 :group 'python)
@@ -2344,7 +2434,7 @@ SYMMETRIC:
2344 :safe (lambda (val) 2434 :safe (lambda (val)
2345 (memq val '(django onetwo pep-257 pep-257-nn symmetric nil)))) 2435 (memq val '(django onetwo pep-257 pep-257-nn symmetric nil))))
2346 2436
2347(defun python-fill-paragraph-function (&optional justify) 2437(defun python-fill-paragraph (&optional justify)
2348 "`fill-paragraph-function' handling multi-line strings and possibly comments. 2438 "`fill-paragraph-function' handling multi-line strings and possibly comments.
2349If any of the current line is in or at the end of a multi-line string, 2439If any of the current line is in or at the end of a multi-line string,
2350fill the string or the paragraph of it that point is in, preserving 2440fill the string or the paragraph of it that point is in, preserving
@@ -2363,8 +2453,7 @@ Optional argument JUSTIFY defines if the paragraph should be justified."
2363 (funcall python-fill-string-function justify)) 2453 (funcall python-fill-string-function justify))
2364 ;; Decorators 2454 ;; Decorators
2365 ((equal (char-after (save-excursion 2455 ((equal (char-after (save-excursion
2366 (back-to-indentation) 2456 (python-nav-beginning-of-statement))) ?@)
2367 (point))) ?@)
2368 (funcall python-fill-decorator-function justify)) 2457 (funcall python-fill-decorator-function justify))
2369 ;; Parens 2458 ;; Parens
2370 ((or (python-syntax-context 'paren) 2459 ((or (python-syntax-context 'paren)
@@ -2376,12 +2465,12 @@ Optional argument JUSTIFY defines if the paragraph should be justified."
2376 (t t)))) 2465 (t t))))
2377 2466
2378(defun python-fill-comment (&optional justify) 2467(defun python-fill-comment (&optional justify)
2379 "Comment fill function for `python-fill-paragraph-function'. 2468 "Comment fill function for `python-fill-paragraph'.
2380JUSTIFY should be used (if applicable) as in `fill-paragraph'." 2469JUSTIFY should be used (if applicable) as in `fill-paragraph'."
2381 (fill-comment-paragraph justify)) 2470 (fill-comment-paragraph justify))
2382 2471
2383(defun python-fill-string (&optional justify) 2472(defun python-fill-string (&optional justify)
2384 "String fill function for `python-fill-paragraph-function'. 2473 "String fill function for `python-fill-paragraph'.
2385JUSTIFY should be used (if applicable) as in `fill-paragraph'." 2474JUSTIFY should be used (if applicable) as in `fill-paragraph'."
2386 (let* ((marker (point-marker)) 2475 (let* ((marker (point-marker))
2387 (str-start-pos 2476 (str-start-pos
@@ -2451,12 +2540,12 @@ JUSTIFY should be used (if applicable) as in `fill-paragraph'."
2451 (indent-according-to-mode))))) t) 2540 (indent-according-to-mode))))) t)
2452 2541
2453(defun python-fill-decorator (&optional justify) 2542(defun python-fill-decorator (&optional justify)
2454 "Decorator fill function for `python-fill-paragraph-function'. 2543 "Decorator fill function for `python-fill-paragraph'.
2455JUSTIFY should be used (if applicable) as in `fill-paragraph'." 2544JUSTIFY should be used (if applicable) as in `fill-paragraph'."
2456 t) 2545 t)
2457 2546
2458(defun python-fill-paren (&optional justify) 2547(defun python-fill-paren (&optional justify)
2459 "Paren fill function for `python-fill-paragraph-function'. 2548 "Paren fill function for `python-fill-paragraph'.
2460JUSTIFY should be used (if applicable) as in `fill-paragraph'." 2549JUSTIFY should be used (if applicable) as in `fill-paragraph'."
2461 (save-restriction 2550 (save-restriction
2462 (narrow-to-region (progn 2551 (narrow-to-region (progn
@@ -3107,7 +3196,7 @@ if that value is non-nil."
3107 3196
3108 (set (make-local-variable 'paragraph-start) "\\s-*$") 3197 (set (make-local-variable 'paragraph-start) "\\s-*$")
3109 (set (make-local-variable 'fill-paragraph-function) 3198 (set (make-local-variable 'fill-paragraph-function)
3110 'python-fill-paragraph-function) 3199 'python-fill-paragraph)
3111 3200
3112 (set (make-local-variable 'beginning-of-defun-function) 3201 (set (make-local-variable 'beginning-of-defun-function)
3113 #'python-beginning-of-defun-function) 3202 #'python-beginning-of-defun-function)
diff --git a/lisp/term/w32-win.el b/lisp/term/w32-win.el
index 841a45c23a2..ad6e1125027 100644
--- a/lisp/term/w32-win.el
+++ b/lisp/term/w32-win.el
@@ -89,7 +89,7 @@
89(make-obsolete 'w32-default-color-map nil "24.1") 89(make-obsolete 'w32-default-color-map nil "24.1")
90 90
91(declare-function w32-send-sys-command "w32fns.c") 91(declare-function w32-send-sys-command "w32fns.c")
92(declare-function set-message-beep "w32console.c") 92(declare-function set-message-beep "w32fns.c")
93 93
94;; Conditional on new-fontset so bootstrapping works on non-GUI compiles 94;; Conditional on new-fontset so bootstrapping works on non-GUI compiles
95(if (fboundp 'new-fontset) 95(if (fboundp 'new-fontset)
diff --git a/lisp/w32-fns.el b/lisp/w32-fns.el
index 813a8fd4d96..5d9b68e9de5 100644
--- a/lisp/w32-fns.el
+++ b/lisp/w32-fns.el
@@ -32,7 +32,7 @@
32 32
33;;;; Function keys 33;;;; Function keys
34 34
35(declare-function set-message-beep "w32console.c") 35(declare-function set-message-beep "w32fns.c")
36(declare-function w32-get-locale-info "w32proc.c") 36(declare-function w32-get-locale-info "w32proc.c")
37(declare-function w32-get-valid-locale-ids "w32proc.c") 37(declare-function w32-get-valid-locale-ids "w32proc.c")
38 38
diff --git a/nt/ChangeLog b/nt/ChangeLog
index b0dcb9982f1..e659b87eb76 100644
--- a/nt/ChangeLog
+++ b/nt/ChangeLog
@@ -1,3 +1,8 @@
12012-10-08 Juanma Barranquero <lekktu@gmail.com>
2
3 * config.nt: Sync with autogen/config.in.
4 (HAVE_NTGUI): New macro.
5
12012-10-02 Eli Zaretskii <eliz@gnu.org> 62012-10-02 Eli Zaretskii <eliz@gnu.org>
2 7
3 * preprep.c (RVA_TO_PTR): Cast the result to 'void *', to avoid 8 * preprep.c (RVA_TO_PTR): Cast the result to 'void *', to avoid
diff --git a/nt/config.nt b/nt/config.nt
index e342c78e20f..cd695bc4e34 100644
--- a/nt/config.nt
+++ b/nt/config.nt
@@ -701,6 +701,9 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
701 Mac OS X. */ 701 Mac OS X. */
702#undef HAVE_NS 702#undef HAVE_NS
703 703
704/* Define to use native Windows GUI. */
705#define HAVE_NTGUI 1
706
704/* Define to 1 if libotf has OTF_get_variation_glyphs. */ 707/* Define to 1 if libotf has OTF_get_variation_glyphs. */
705#undef HAVE_OTF_GET_VARIATION_GLYPHS 708#undef HAVE_OTF_GET_VARIATION_GLYPHS
706 709
diff --git a/src/ChangeLog b/src/ChangeLog
index d0670d05af3..25a4e92a1ca 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,15 +1,52 @@
12012-10-09 Eli Zaretskii <eliz@gnu.org>
2
3 * w32fns.c (w32_last_error): Change the return value to DWORD, to
4 match what GetLastError returns. Explain why the function is
5 needed.
6
7 * frame.c (delete_frame): Rename local variable 'tooltip_frame' to
8 'is_tooltip_frame', to avoid confusion with its global namesake.
9
102012-10-08 Daniel Colascione <dancol@dancol.org>
11
12 * xdisp.c (start_hourglass): Call w32_note_current_window when
13 HAVE_NTGUI, not just WINDOWSNT, resolving a problem in the cygw32
14 build that caused Emacs to display the hourglass cursor forever.
15
16 * w32fns.c (Fx_display_color_cells): Instead of using NCOLORS,
17 which is broken under remote desktop, calculate the number of
18 colors available for a display based on the display's number of
19 planes and number of bits per pixel per plane. (bug#10397).
20
212012-10-08 Jan Djärv <jan.h.d@swipnet.se>
22
23 * nsfont.m (Vfonts_in_cache): New variable.
24 (nsfont_open): Use unsignedLongLongValue for cache in case wide ints
25 are used. Add cached fonts to Vfonts_in_cache.
26 (syms_of_nsfont): Initialize and staticpro Vfonts_in_cache.
27
282012-10-08 Juanma Barranquero <lekktu@gmail.com>
29
30 * makefile.w32-in (LOCAL_FLAGS): Don't define HAVE_NTGUI, it's now
31 in nt/config.nt.
32 (FONT_H): Define after FRAME_H.
33 ($(BLD)/emacs.$(O), $(BLD)/process.$(O), $(BLD)/w32heap.$(O)):
34 Update dependencies.
35
36 * w32term.c: Remove leftover declaration of keyboard_codepage.
37
12012-10-08 Eli Zaretskii <eliz@gnu.org> 382012-10-08 Eli Zaretskii <eliz@gnu.org>
2 39
3 * makefile.w32-in (FONT_H): Add $(FRAME_H). 40 * makefile.w32-in (FONT_H): Add $(FRAME_H).
4 (W32TERM_H): Add $(ATIMER_H) and $(FRAME_H). 41 (W32TERM_H): Add $(ATIMER_H) and $(FRAME_H).
5 ($(BLD)/emacs.$(O), $(BLD)/w32console.$(O)): Update dependencies. 42 ($(BLD)/emacs.$(O), $(BLD)/w32console.$(O)): Update dependencies.
6 (GLOBAL_SOURCES): Add cygw32.c. 43 (GLOBAL_SOURCES): Add cygw32.c.
7 ($(BLD)/unexw32.$(O)): 44 ($(BLD)/unexw32.$(O)):
8 ($(BLD)/w32.$(O)): 45 ($(BLD)/w32.$(O)):
9 ($(BLD)/w32console.$(O)): 46 ($(BLD)/w32console.$(O)):
10 ($(BLD)/w32fns.$(O)): 47 ($(BLD)/w32fns.$(O)):
11 ($(BLD)/w32heap.$(O)): 48 ($(BLD)/w32heap.$(O)):
12 ($(BLD)/w32menu.$(O)): 49 ($(BLD)/w32menu.$(O)):
13 ($(BLD)/w32proc.$(O)): Add w32common.h. 50 ($(BLD)/w32proc.$(O)): Add w32common.h.
14 51
15 * w32fns.c (w32_color_map_lookup, x_to_w32_color): Argument is now 52 * w32fns.c (w32_color_map_lookup, x_to_w32_color): Argument is now
diff --git a/src/conf_post.h b/src/conf_post.h
index 53fc941f464..aa008107ba6 100644
--- a/src/conf_post.h
+++ b/src/conf_post.h
@@ -142,19 +142,19 @@ You lose; /* Emacs for DOS must be compiled with DJGPP */
142#endif 142#endif
143#endif 143#endif
144 144
145#if defined(HAVE_NTGUI) && !defined(DebPrint) 145#if defined HAVE_NTGUI && !defined DebPrint
146# if defined(EMACSDEBUG) 146# ifdef EMACSDEBUG
147extern void _DebPrint (const char *fmt, ...); 147extern void _DebPrint (const char *fmt, ...);
148# define DebPrint(stuff) _DebPrint stuff 148# define DebPrint(stuff) _DebPrint stuff
149# else 149# else
150# define DebPrint(stuff) 150# define DebPrint(stuff)
151# endif /* EMACSDEBUG */ 151# endif
152#endif /* DebPrint */ 152#endif
153 153
154#if defined(CYGWIN) && defined(HAVE_NTGUI) 154#if defined CYGWIN && defined HAVE_NTGUI
155#define NTGUI_UNICODE /* Cygwin runs only on UNICODE-supporting systems */ 155# define NTGUI_UNICODE /* Cygwin runs only on UNICODE-supporting systems */
156#define _WIN32_WINNT 0x500 /* Win2k */ 156# define _WIN32_WINNT 0x500 /* Win2k */
157#endif /* CYGWIN && HAVE_NTGUI */ 157#endif
158 158
159#ifdef emacs /* Don't do this for lib-src. */ 159#ifdef emacs /* Don't do this for lib-src. */
160/* Tell regex.c to use a type compatible with Emacs. */ 160/* Tell regex.c to use a type compatible with Emacs. */
diff --git a/src/emacs.c b/src/emacs.c
index 1d416984d2d..c84da7411ad 100644
--- a/src/emacs.c
+++ b/src/emacs.c
@@ -34,18 +34,15 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
34#ifdef WINDOWSNT 34#ifdef WINDOWSNT
35#include <fcntl.h> 35#include <fcntl.h>
36#include "w32.h" 36#include "w32.h"
37#endif
38
39#if defined (WINDOWSNT)
40#include "w32heap.h" 37#include "w32heap.h"
41#endif 38#endif
42 39
43#if defined (WINDOWSNT) || defined (HAVE_NTGUI) 40#if defined WINDOWSNT || defined HAVE_NTGUI
44#include "w32select.h" 41#include "w32select.h"
45#include "w32font.h" 42#include "w32font.h"
46#endif 43#endif
47 44
48#if defined (HAVE_NTGUI) && defined (CYGWIN) 45#if defined HAVE_NTGUI && defined CYGWIN
49#include "cygw32.h" 46#include "cygw32.h"
50#endif 47#endif
51 48
@@ -179,7 +176,7 @@ static uprintmax_t heap_bss_diff;
179 We mark being in the exec'd process by a daemon name argument of 176 We mark being in the exec'd process by a daemon name argument of
180 form "--daemon=\nFD0,FD1\nNAME" where FD are the pipe file descriptors, 177 form "--daemon=\nFD0,FD1\nNAME" where FD are the pipe file descriptors,
181 NAME is the original daemon name, if any. */ 178 NAME is the original daemon name, if any. */
182#if defined (NS_IMPL_COCOA) || (defined (HAVE_NTGUI) && defined (CYGWIN)) 179#if defined NS_IMPL_COCOA || (defined HAVE_NTGUI && defined CYGWIN)
183# define DAEMON_MUST_EXEC 180# define DAEMON_MUST_EXEC
184#endif 181#endif
185 182
@@ -698,7 +695,7 @@ main (int argc, char **argv)
698 char *dname_arg = 0; 695 char *dname_arg = 0;
699#ifdef DAEMON_MUST_EXEC 696#ifdef DAEMON_MUST_EXEC
700 char dname_arg2[80]; 697 char dname_arg2[80];
701#endif /* DAEMON_MUST_EXEC */ 698#endif
702 char *ch_to_dir; 699 char *ch_to_dir;
703 700
704#if GC_MARK_STACK 701#if GC_MARK_STACK
@@ -1378,9 +1375,9 @@ Using an Emacs configured with --with-x-toolkit=lucid does not have this problem
1378#ifdef WINDOWSNT 1375#ifdef WINDOWSNT
1379 syms_of_ntproc (); 1376 syms_of_ntproc ();
1380#endif /* WINDOWSNT */ 1377#endif /* WINDOWSNT */
1381#if defined (CYGWIN) && defined (HAVE_NTGUI) 1378#if defined CYGWIN && defined HAVE_NTGUI
1382 syms_of_cygw32 (); 1379 syms_of_cygw32 ();
1383#endif /* defined(CYGWIN) && defined (HAVE_NTGUI) */ 1380#endif
1384 syms_of_window (); 1381 syms_of_window ();
1385 syms_of_xdisp (); 1382 syms_of_xdisp ();
1386 syms_of_font (); 1383 syms_of_font ();
@@ -1415,9 +1412,9 @@ Using an Emacs configured with --with-x-toolkit=lucid does not have this problem
1415 syms_of_fontset (); 1412 syms_of_fontset ();
1416#endif /* HAVE_NTGUI */ 1413#endif /* HAVE_NTGUI */
1417 1414
1418#if defined (WINDOWSNT) || defined (HAVE_NTGUI) 1415#if defined WINDOWSNT || defined HAVE_NTGUI
1419 syms_of_w32select (); 1416 syms_of_w32select ();
1420#endif /* WINDOWSNT || HAVE_NTGUI */ 1417#endif
1421 1418
1422#ifdef MSDOS 1419#ifdef MSDOS
1423 syms_of_xmenu (); 1420 syms_of_xmenu ();
@@ -1466,10 +1463,9 @@ Using an Emacs configured with --with-x-toolkit=lucid does not have this problem
1466 globals_of_w32menu (); 1463 globals_of_w32menu ();
1467#endif /* HAVE_NTGUI */ 1464#endif /* HAVE_NTGUI */
1468 1465
1469#if defined (WINDOWSNT) || defined (HAVE_NTGUI) 1466#if defined WINDOWSNT || defined HAVE_NTGUI
1470 globals_of_w32select (); 1467 globals_of_w32select ();
1471#endif /* WINDOWSNT || HAVE_NTGUI */ 1468#endif
1472
1473 } 1469 }
1474 1470
1475 init_charset (); 1471 init_charset ();
diff --git a/src/frame.c b/src/frame.c
index 599d8879169..017d051fc1d 100644
--- a/src/frame.c
+++ b/src/frame.c
@@ -1124,7 +1124,7 @@ delete_frame (Lisp_Object frame, Lisp_Object force)
1124 struct frame *sf = SELECTED_FRAME (); 1124 struct frame *sf = SELECTED_FRAME ();
1125 struct kboard *kb; 1125 struct kboard *kb;
1126 1126
1127 int minibuffer_selected, tooltip_frame; 1127 int minibuffer_selected, is_tooltip_frame;
1128 1128
1129 if (EQ (frame, Qnil)) 1129 if (EQ (frame, Qnil))
1130 { 1130 {
@@ -1176,13 +1176,13 @@ delete_frame (Lisp_Object frame, Lisp_Object force)
1176 } 1176 }
1177 } 1177 }
1178 1178
1179 tooltip_frame = !NILP (Fframe_parameter (frame, intern ("tooltip"))); 1179 is_tooltip_frame = !NILP (Fframe_parameter (frame, intern ("tooltip")));
1180 1180
1181 /* Run `delete-frame-functions' unless FORCE is `noelisp' or 1181 /* Run `delete-frame-functions' unless FORCE is `noelisp' or
1182 frame is a tooltip. FORCE is set to `noelisp' when handling 1182 frame is a tooltip. FORCE is set to `noelisp' when handling
1183 a disconnect from the terminal, so we don't dare call Lisp 1183 a disconnect from the terminal, so we don't dare call Lisp
1184 code. */ 1184 code. */
1185 if (NILP (Vrun_hooks) || tooltip_frame) 1185 if (NILP (Vrun_hooks) || is_tooltip_frame)
1186 ; 1186 ;
1187 else if (EQ (force, Qnoelisp)) 1187 else if (EQ (force, Qnoelisp))
1188 pending_funcalls 1188 pending_funcalls
@@ -1461,7 +1461,7 @@ delete_frame (Lisp_Object frame, Lisp_Object force)
1461 } 1461 }
1462 1462
1463 /* Cause frame titles to update--necessary if we now have just one frame. */ 1463 /* Cause frame titles to update--necessary if we now have just one frame. */
1464 if (!tooltip_frame) 1464 if (!is_tooltip_frame)
1465 update_mode_lines = 1; 1465 update_mode_lines = 1;
1466 1466
1467 return Qnil; 1467 return Qnil;
diff --git a/src/image.c b/src/image.c
index 6058bdf444c..9b41cf74993 100644
--- a/src/image.c
+++ b/src/image.c
@@ -75,11 +75,12 @@ typedef struct x_bitmap_record Bitmap_Record;
75#endif /* HAVE_X_WINDOWS */ 75#endif /* HAVE_X_WINDOWS */
76 76
77#ifdef HAVE_NTGUI 77#ifdef HAVE_NTGUI
78# ifdef WINDOWSNT 78
79/* We only need (or want) w32.h when we're _not_ 79/* We need (or want) w32.h only when we're _not_ compiling for Cygwin. */
80 * compiling for Cygwin */ 80#ifdef WINDOWSNT
81# include "w32.h" 81# include "w32.h"
82# endif /* WINDOWSNT */ 82#endif
83
83/* W32_TODO : Color tables on W32. */ 84/* W32_TODO : Color tables on W32. */
84#undef COLOR_TABLE_SUPPORT 85#undef COLOR_TABLE_SUPPORT
85 86
@@ -571,7 +572,7 @@ extern Lisp_Object Vlibrary_cache;
571 do { Vlibrary_cache = Fcons (Fcons (type, status), Vlibrary_cache); } while (0) 572 do { Vlibrary_cache = Fcons (Fcons (type, status), Vlibrary_cache); } while (0)
572#else 573#else
573#define CACHE_IMAGE_TYPE(type, status) 574#define CACHE_IMAGE_TYPE(type, status)
574#endif /* WINDOWSNT */ 575#endif
575 576
576#define ADD_IMAGE_TYPE(type) \ 577#define ADD_IMAGE_TYPE(type) \
577 do { Vimage_types = Fcons (type, Vimage_types); } while (0) 578 do { Vimage_types = Fcons (type, Vimage_types); } while (0)
@@ -594,7 +595,7 @@ define_image_type (struct image_type *type)
594 595
595 if (type->init) 596 if (type->init)
596 { 597 {
597#if defined (HAVE_NTGUI) && defined (WINDOWSNT) 598#if defined HAVE_NTGUI && defined WINDOWSNT
598 /* If we failed to load the library before, don't try again. */ 599 /* If we failed to load the library before, don't try again. */
599 Lisp_Object tested = Fassq (target_type, Vlibrary_cache); 600 Lisp_Object tested = Fassq (target_type, Vlibrary_cache);
600 if (CONSP (tested) && NILP (XCDR (tested))) 601 if (CONSP (tested) && NILP (XCDR (tested)))
@@ -3013,7 +3014,7 @@ static const struct image_keyword xpm_format[XPM_LAST] =
3013 {":background", IMAGE_STRING_OR_NIL_VALUE, 0} 3014 {":background", IMAGE_STRING_OR_NIL_VALUE, 0}
3014}; 3015};
3015 3016
3016#if defined(HAVE_NTGUI) && defined(WINDOWSNT) 3017#if defined HAVE_NTGUI && defined WINDOWSNT
3017static bool init_xpm_functions (void); 3018static bool init_xpm_functions (void);
3018#else 3019#else
3019#define init_xpm_functions NULL 3020#define init_xpm_functions NULL
@@ -3240,7 +3241,7 @@ init_xpm_functions (void)
3240 3241
3241#endif /* WINDOWSNT */ 3242#endif /* WINDOWSNT */
3242 3243
3243#if defined (HAVE_NTGUI) && !defined (WINDOWSNT) 3244#if defined HAVE_NTGUI && !defined WINDOWSNT
3244/* Glue for code below */ 3245/* Glue for code below */
3245#define fn_XpmReadFileToImage XpmReadFileToImage 3246#define fn_XpmReadFileToImage XpmReadFileToImage
3246#define fn_XpmCreateImageFromBuffer XpmCreateImageFromBuffer 3247#define fn_XpmCreateImageFromBuffer XpmCreateImageFromBuffer
@@ -5352,7 +5353,7 @@ static const struct image_keyword png_format[PNG_LAST] =
5352 {":background", IMAGE_STRING_OR_NIL_VALUE, 0} 5353 {":background", IMAGE_STRING_OR_NIL_VALUE, 0}
5353}; 5354};
5354 5355
5355#if defined(HAVE_NTGUI) && defined (WINDOWSNT) 5356#if defined HAVE_NTGUI && defined WINDOWSNT
5356static bool init_png_functions (void); 5357static bool init_png_functions (void);
5357#else 5358#else
5358#define init_png_functions NULL 5359#define init_png_functions NULL
@@ -6011,7 +6012,7 @@ static const struct image_keyword jpeg_format[JPEG_LAST] =
6011 {":background", IMAGE_STRING_OR_NIL_VALUE, 0} 6012 {":background", IMAGE_STRING_OR_NIL_VALUE, 0}
6012}; 6013};
6013 6014
6014#if defined(HAVE_NTGUI) && defined(WINDOWSNT) 6015#if defined HAVE_NTGUI && defined WINDOWSNT
6015static bool init_jpeg_functions (void); 6016static bool init_jpeg_functions (void);
6016#else 6017#else
6017#define init_jpeg_functions NULL 6018#define init_jpeg_functions NULL
@@ -6075,7 +6076,7 @@ jpeg_image_p (Lisp_Object object)
6075 different name. This name, jpeg_boolean, remains in effect through 6076 different name. This name, jpeg_boolean, remains in effect through
6076 the rest of image.c. 6077 the rest of image.c.
6077*/ 6078*/
6078#if defined (CYGWIN) && defined (HAVE_NTGUI) 6079#if defined CYGWIN && defined HAVE_NTGUI
6079#define boolean jpeg_boolean 6080#define boolean jpeg_boolean
6080#endif 6081#endif
6081#include <jpeglib.h> 6082#include <jpeglib.h>
@@ -7071,7 +7072,7 @@ static const struct image_keyword gif_format[GIF_LAST] =
7071 {":background", IMAGE_STRING_OR_NIL_VALUE, 0} 7072 {":background", IMAGE_STRING_OR_NIL_VALUE, 0}
7072}; 7073};
7073 7074
7074#if defined(HAVE_NTGUI) && defined(WINDOWSNT) 7075#if defined HAVE_NTGUI && defined WINDOWSNT
7075static bool init_gif_functions (void); 7076static bool init_gif_functions (void);
7076#else 7077#else
7077#define init_gif_functions NULL 7078#define init_gif_functions NULL
diff --git a/src/keyboard.c b/src/keyboard.c
index 8316223cd28..2a37e510ba4 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -313,7 +313,7 @@ static Lisp_Object Qmouse_fixup_help_message;
313/* Symbols to denote kinds of events. */ 313/* Symbols to denote kinds of events. */
314static Lisp_Object Qfunction_key; 314static Lisp_Object Qfunction_key;
315Lisp_Object Qmouse_click; 315Lisp_Object Qmouse_click;
316#if defined (HAVE_NTGUI) 316#ifdef HAVE_NTGUI
317Lisp_Object Qlanguage_change; 317Lisp_Object Qlanguage_change;
318#ifdef WINDOWSNT 318#ifdef WINDOWSNT
319Lisp_Object Qfile_notify; 319Lisp_Object Qfile_notify;
@@ -3950,7 +3950,7 @@ kbd_buffer_get_event (KBOARD **kbp,
3950 x_activate_menubar (XFRAME (event->frame_or_window)); 3950 x_activate_menubar (XFRAME (event->frame_or_window));
3951 } 3951 }
3952#endif 3952#endif
3953#if defined (HAVE_NTGUI) 3953#ifdef HAVE_NTGUI
3954 else if (event->kind == LANGUAGE_CHANGE_EVENT) 3954 else if (event->kind == LANGUAGE_CHANGE_EVENT)
3955 { 3955 {
3956 /* Make an event (language-change (FRAME CODEPAGE LANGUAGE-ID)). */ 3956 /* Make an event (language-change (FRAME CODEPAGE LANGUAGE-ID)). */
@@ -11407,7 +11407,7 @@ syms_of_keyboard (void)
11407 DEFSYM (Qconfig_changed_event, "config-changed-event"); 11407 DEFSYM (Qconfig_changed_event, "config-changed-event");
11408 DEFSYM (Qmenu_enable, "menu-enable"); 11408 DEFSYM (Qmenu_enable, "menu-enable");
11409 11409
11410#if defined (HAVE_NTGUI) 11410#ifdef HAVE_NTGUI
11411 DEFSYM (Qlanguage_change, "language-change"); 11411 DEFSYM (Qlanguage_change, "language-change");
11412 DEFSYM (Qfile_notify, "file-notify"); 11412 DEFSYM (Qfile_notify, "file-notify");
11413#endif 11413#endif
diff --git a/src/makefile.w32-in b/src/makefile.w32-in
index 29b7925f1b9..f96f765a7fa 100644
--- a/src/makefile.w32-in
+++ b/src/makefile.w32-in
@@ -27,7 +27,7 @@ EMACSLOADPATH=$(CURDIR)/../lisp
27# Size in MBs of the static heap in temacs.exe. 27# Size in MBs of the static heap in temacs.exe.
28HEAPSIZE = $(EMACS_HEAPSIZE) 28HEAPSIZE = $(EMACS_HEAPSIZE)
29 29
30LOCAL_FLAGS = -Demacs=1 -I../lib -I../nt/inc -DHAVE_NTGUI=1 $(EMACS_EXTRA_C_FLAGS) 30LOCAL_FLAGS = -Demacs=1 -I../lib -I../nt/inc $(EMACS_EXTRA_C_FLAGS)
31 31
32SRC = . 32SRC = .
33EMACS = $(BLD)/emacs.exe 33EMACS = $(BLD)/emacs.exe
@@ -424,11 +424,11 @@ DISPEXTERN_H = $(SRC)/dispextern.h \
424 $(W32GUI_H) 424 $(W32GUI_H)
425FILEMODE_H = $(GNU_LIB)/filemode.h \ 425FILEMODE_H = $(GNU_LIB)/filemode.h \
426 $(NT_INC)/sys/stat.h 426 $(NT_INC)/sys/stat.h
427FONT_H = $(SRC)/font.h \
428 $(FRAME_H) \
429 $(CCL_H)
430FRAME_H = $(SRC)/frame.h \ 427FRAME_H = $(SRC)/frame.h \
431 $(DISPEXTERN_H) 428 $(DISPEXTERN_H)
429FONT_H = $(SRC)/font.h \
430 $(CCL_H) \
431 $(FRAME_H)
432FTOASTR_H = $(GNU_LIB)/ftoastr.h \ 432FTOASTR_H = $(GNU_LIB)/ftoastr.h \
433 $(GNU_LIB)/intprops.h 433 $(GNU_LIB)/intprops.h
434GRP_H = $(NT_INC)/grp.h \ 434GRP_H = $(NT_INC)/grp.h \
@@ -801,7 +801,6 @@ $(BLD)/emacs.$(O) : \
801 $(SRC)/w32.h \ 801 $(SRC)/w32.h \
802 $(SRC)/w32heap.h \ 802 $(SRC)/w32heap.h \
803 $(SRC)/w32select.h \ 803 $(SRC)/w32select.h \
804 $(SRC)/w32font.h \
805 $(NT_INC)/sys/file.h \ 804 $(NT_INC)/sys/file.h \
806 $(NT_INC)/unistd.h \ 805 $(NT_INC)/unistd.h \
807 $(GNU_LIB)/ignore-value.h \ 806 $(GNU_LIB)/ignore-value.h \
@@ -817,6 +816,7 @@ $(BLD)/emacs.$(O) : \
817 $(SYSSIGNAL_H) \ 816 $(SYSSIGNAL_H) \
818 $(SYSTTY_H) \ 817 $(SYSTTY_H) \
819 $(TERMHOOKS_H) \ 818 $(TERMHOOKS_H) \
819 $(W32FONT_H) \
820 $(W32TERM_H) \ 820 $(W32TERM_H) \
821 $(WINDOW_H) 821 $(WINDOW_H)
822 822
@@ -1191,8 +1191,8 @@ $(BLD)/w32.$(O) : \
1191 1191
1192$(BLD)/w32heap.$(O) : \ 1192$(BLD)/w32heap.$(O) : \
1193 $(SRC)/w32heap.c \ 1193 $(SRC)/w32heap.c \
1194 $(SRC)/w32heap.h \
1195 $(SRC)/w32common.h \ 1194 $(SRC)/w32common.h \
1195 $(SRC)/w32heap.h \
1196 $(CONFIG_H) \ 1196 $(CONFIG_H) \
1197 $(LISP_H) 1197 $(LISP_H)
1198 1198
diff --git a/src/nsfont.m b/src/nsfont.m
index b13c96aa6ed..20a8f5d4028 100644
--- a/src/nsfont.m
+++ b/src/nsfont.m
@@ -53,6 +53,9 @@ extern float ns_antialias_threshold;
53extern int ns_tmp_flags; 53extern int ns_tmp_flags;
54extern struct nsfont_info *ns_tmp_font; 54extern struct nsfont_info *ns_tmp_font;
55 55
56static Lisp_Object Vfonts_in_cache;
57
58
56/* font glyph and metrics caching functions, implemented at end */ 59/* font glyph and metrics caching functions, implemented at end */
57static void ns_uni_to_glyphs (struct nsfont_info *font_info, 60static void ns_uni_to_glyphs (struct nsfont_info *font_info,
58 unsigned char block); 61 unsigned char block);
@@ -799,8 +802,7 @@ nsfont_open (FRAME_PTR f, Lisp_Object font_entity, int pixel_size)
799 { 802 {
800 if (NSFONT_TRACE) 803 if (NSFONT_TRACE)
801 fprintf(stderr, "*** nsfont_open CACHE HIT!\n"); 804 fprintf(stderr, "*** nsfont_open CACHE HIT!\n");
802 /* FIXME: Cast from (unsigned long) to Lisp_Object. */ 805 XHASH (font_object) = [cached unsignedLongLongValue];
803 XHASH (font_object) = [cached unsignedLongValue];
804 return font_object; 806 return font_object;
805 } 807 }
806 else 808 else
@@ -808,9 +810,13 @@ nsfont_open (FRAME_PTR f, Lisp_Object font_entity, int pixel_size)
808 font_object = font_make_object (VECSIZE (struct nsfont_info), 810 font_object = font_make_object (VECSIZE (struct nsfont_info),
809 font_entity, pixel_size); 811 font_entity, pixel_size);
810 if (!synthItal) 812 if (!synthItal)
811 [fontCache setObject: [NSNumber numberWithUnsignedLong: 813 {
812 (unsigned long) XHASH (font_object)] 814 [fontCache setObject: [NSNumber
813 forKey: nsfont]; 815 numberWithUnsignedLongLong:
816 (unsigned long long) XHASH (font_object)]
817 forKey: nsfont];
818 Vfonts_in_cache = Fcons (font_object, Vfonts_in_cache);
819 }
814 } 820 }
815 821
816 font_info = (struct nsfont_info *) XFONT_OBJECT (font_object); 822 font_info = (struct nsfont_info *) XFONT_OBJECT (font_object);
@@ -1529,4 +1535,7 @@ syms_of_nsfont (void)
1529 doc: /* Internal use: maps font registry to Unicode script. */); 1535 doc: /* Internal use: maps font registry to Unicode script. */);
1530 1536
1531 ascii_printable = NULL; 1537 ascii_printable = NULL;
1538
1539 Vfonts_in_cache = Qnil;
1540 staticpro (&Vfonts_in_cache);
1532} 1541}
diff --git a/src/termhooks.h b/src/termhooks.h
index 285a1824ecb..bac86423a4b 100644
--- a/src/termhooks.h
+++ b/src/termhooks.h
@@ -107,7 +107,7 @@ enum event_kind
107 HORIZ_WHEEL_EVENT, /* A wheel event generated by a second 107 HORIZ_WHEEL_EVENT, /* A wheel event generated by a second
108 horizontal wheel that is present on some 108 horizontal wheel that is present on some
109 mice. See WHEEL_EVENT. */ 109 mice. See WHEEL_EVENT. */
110#if defined (HAVE_NTGUI) 110#ifdef HAVE_NTGUI
111 LANGUAGE_CHANGE_EVENT, /* A LANGUAGE_CHANGE_EVENT is 111 LANGUAGE_CHANGE_EVENT, /* A LANGUAGE_CHANGE_EVENT is
112 generated when HAVE_NTGUI or on Mac OS 112 generated when HAVE_NTGUI or on Mac OS
113 when the keyboard layout or input 113 when the keyboard layout or input
diff --git a/src/w32fns.c b/src/w32fns.c
index 6eb12ee917e..aa1647fcaa4 100644
--- a/src/w32fns.c
+++ b/src/w32fns.c
@@ -4645,22 +4645,14 @@ If omitted or nil, that stands for the selected frame's display. */)
4645 (Lisp_Object display) 4645 (Lisp_Object display)
4646{ 4646{
4647 struct w32_display_info *dpyinfo = check_x_display_info (display); 4647 struct w32_display_info *dpyinfo = check_x_display_info (display);
4648 HDC hdc;
4649 int cap; 4648 int cap;
4650 4649
4651 hdc = GetDC (dpyinfo->root_window); 4650 /* Don't use NCOLORS: it returns incorrect results under remote
4652 if (dpyinfo->has_palette) 4651 * desktop. We force 24+ bit depths to 24-bit, both to prevent an
4653 cap = GetDeviceCaps (hdc, SIZEPALETTE); 4652 * overflow and because probably is more meaningful on Windows
4654 else 4653 * anyway. */
4655 cap = GetDeviceCaps (hdc, NUMCOLORS);
4656
4657 /* We force 24+ bit depths to 24-bit, both to prevent an overflow
4658 and because probably is more meaningful on Windows anyway */
4659 if (cap < 0)
4660 cap = 1 << min (dpyinfo->n_planes * dpyinfo->n_cbits, 24);
4661
4662 ReleaseDC (dpyinfo->root_window, hdc);
4663 4654
4655 cap = 1 << min (dpyinfo->n_planes * dpyinfo->n_cbits, 24);
4664 return make_number (cap); 4656 return make_number (cap);
4665} 4657}
4666 4658
@@ -6994,8 +6986,10 @@ w32_strerror (int error_no)
6994 return buf; 6986 return buf;
6995} 6987}
6996 6988
6997/* For convenience when debugging. */ 6989/* For convenience when debugging. (You cannot call GetLastError
6998int 6990 directly from GDB: it will crash, because it uses the __stdcall
6991 calling convention, not the _cdecl convention assumed by GDB.) */
6992DWORD
6999w32_last_error (void) 6993w32_last_error (void)
7000{ 6994{
7001 return GetLastError (); 6995 return GetLastError ();
diff --git a/src/w32select.h b/src/w32select.h
index e895c3d9bf2..4f4de59f7fe 100644
--- a/src/w32select.h
+++ b/src/w32select.h
@@ -1,6 +1,6 @@
1/* Selection processing for Emacs on the Microsoft W32 API. 1/* Selection processing for Emacs on the Microsoft W32 API.
2 2
3Copyright (C) 1993-1994, 2001-2011 Free Software Foundation, Inc. 3Copyright (C) 1993-1994, 2001-2012 Free Software Foundation, Inc.
4 4
5This file is part of GNU Emacs. 5This file is part of GNU Emacs.
6 6
diff --git a/src/w32term.c b/src/w32term.c
index b18d07135ed..806b82297f1 100644
--- a/src/w32term.c
+++ b/src/w32term.c
@@ -201,9 +201,6 @@ static int input_signal_count;
201int w32_message_fd = -1; 201int w32_message_fd = -1;
202#endif /* CYGWIN */ 202#endif /* CYGWIN */
203 203
204/* Keyboard code page - may be changed by language-change events. */
205static int keyboard_codepage;
206
207static void x_update_window_end (struct window *, int, int); 204static void x_update_window_end (struct window *, int, int);
208static void w32_handle_tool_bar_click (struct frame *, 205static void w32_handle_tool_bar_click (struct frame *,
209 struct input_event *); 206 struct input_event *);
diff --git a/src/xdisp.c b/src/xdisp.c
index 2047c0e78c1..1e61a74068b 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -29379,9 +29379,10 @@ start_hourglass (void)
29379 else 29379 else
29380 delay = make_emacs_time (DEFAULT_HOURGLASS_DELAY, 0); 29380 delay = make_emacs_time (DEFAULT_HOURGLASS_DELAY, 0);
29381 29381
29382#ifdef WINDOWSNT 29382#ifdef HAVE_NTGUI
29383 extern void w32_note_current_window (void);
29383 w32_note_current_window (); 29384 w32_note_current_window ();
29384#endif 29385#endif /* HAVE_NTGUI */
29385 29386
29386 hourglass_atimer = start_atimer (ATIMER_RELATIVE, delay, 29387 hourglass_atimer = start_atimer (ATIMER_RELATIVE, delay,
29387 show_hourglass, NULL); 29388 show_hourglass, NULL);