changeset 110005:670be26d955d

Merge from mainline.
author Katsumi Yamaoka <yamaoka@jpl.org>
date Thu, 26 Aug 2010 22:46:08 +0000
parents 4cb81410d95d (current diff) f583ffa8d0d6 (diff)
children 6c405a2a9f8e
files
diffstat 20 files changed, 258 insertions(+), 111 deletions(-) [+]
line wrap: on
line diff
--- a/doc/misc/ChangeLog	Wed Aug 25 22:44:39 2010 +0000
+++ b/doc/misc/ChangeLog	Thu Aug 26 22:46:08 2010 +0000
@@ -1,3 +1,9 @@
+2010-08-26  Michael Albinus  <michael.albinus@gmx.de>
+
+	Sync with Tramp 2.1.19.
+
+	* trampver.texi: Update release number.
+
 2010-08-23  Michael Albinus  <michael.albinus@gmx.de>
 
 	* dbus.texi (Alternative Buses): New chapter.
--- a/doc/misc/trampver.texi	Wed Aug 25 22:44:39 2010 +0000
+++ b/doc/misc/trampver.texi	Thu Aug 26 22:46:08 2010 +0000
@@ -9,7 +9,7 @@
 @c In the Tramp CVS, the version number is auto-frobbed from
 @c configure.ac, so you should edit that file and run
 @c "autoconf && ./configure" to change the version number.
-@set trampver 2.1.19-pre
+@set trampver 2.1.19
 
 @c Other flags from configuration
 @set instprefix /usr/local
--- a/etc/ChangeLog	Wed Aug 25 22:44:39 2010 +0000
+++ b/etc/ChangeLog	Thu Aug 26 22:46:08 2010 +0000
@@ -1,3 +1,7 @@
+2010-08-25  Kenichi Handa  <handa@m17n.org>
+
+	* HELLO: Change designation sequences for Arabic text.
+
 2010-08-23  Michael Albinus  <michael.albinus@gmx.de>
 
 	* NEWS: dbus.el supports alternative buses.
--- a/etc/HELLO	Wed Aug 25 22:44:39 2010 +0000
+++ b/etc/HELLO	Thu Aug 26 22:46:08 2010 +0000
@@ -4,7 +4,7 @@
   Europe: ,A!(BHola!, Gr,A|_(B Gott, Hyv,Add(B p,Ad(Biv,Add(B, Tere ,Au(Bhtust, Bon,Cu(Bu
           Cze,B6f(B!, Dobr,B}(B den, ,L7T`PRabRcYbU(B!, ,FCei\(B ,Fsar(B, $,1J2J0J;J0J@JOJ=J1J0(B
   Africa: $(3!A!,!>(B
-  Middle/Near East: ,Hylem(B, ,GGdSqdGe(B ,GYdjce(B
+  Middle/Near East: ,Hylem(B, $,1-g.$-s.1.$-g.%(B $,1-y.$.*.#.%(B
   South Asia: $,19h9n9x:-9d:'(B, $,15h5n5x6-5d6'(B, $,1?(?.?8?M>u?>?0(B, $,1@H@N@X@m@5@^@P@"(B, $,1;6;A;#;?;,;G(B,
               $,1AFAzB4AvB=B AqB*(B, $,1<U<C<5<m<5<N<m(B, $,1=h=n=x>-=U=~=p=B(B, $(7"7"!#C!;"E"S"G!;"7"2"[!;"D"["#"G!>(B
   South East Asia: $,1\'\f\:\V\4\?\]\:(B, (1JP:R-4U(B, $,1H9H$HZHYH"H<HLH5HK(B, ,TJGQJ4U$CQ:(B, Ch,1`(Bo b,1U(Bn
@@ -16,7 +16,7 @@
 LANGUAGE (NATIVE NAME)	HELLO
 ----------------------	-----
 Amharic ($,1O M[MmN{(B)	$,1M`MKM](B
-Arabic $,1ro(B(,GGdYQHjqI(B)	,GGdSqdGe(B ,GYdjce(B
+Arabic $,1ro(B($,1-g.$-y-q-h.*.1-i(B)	$,1-g.$-s.1.$-g.%(B $,1-y.$.*.#.%(B
 Bengali ($,17,7>6b727>(B)	$,17(7.787M6u7>70(B
 Braille	$,2(3(1('('(5(B
 Burmese ($,1H9H\H4HZH9HL(B)	$,1H9H$HZHYH"H<HLH5HK(B
--- a/etc/NEWS	Wed Aug 25 22:44:39 2010 +0000
+++ b/etc/NEWS	Thu Aug 26 22:46:08 2010 +0000
@@ -176,8 +176,12 @@
 
 ** An Emacs Lisp package manager is now included.
 This is a convenient way to download and install additional packages,
-from elpa.gnu.org.  `M-x package-list-packages' shows a list of
-packages, which can be selected for installation.
+from elpa.gnu.org.
+
+*** `M-x list-packages' shows a list of packages, which can be
+selected for installation.
+
+*** New command `describe-package', bound to `C-h P'.
 
 *** By default, all installed packages are loaded and activated
 automatically when Emacs starts up.  To disable this, set
--- a/lisp/ChangeLog	Wed Aug 25 22:44:39 2010 +0000
+++ b/lisp/ChangeLog	Thu Aug 26 22:46:08 2010 +0000
@@ -1,3 +1,50 @@
+2010-08-26  Nathan Weizenbaum  <nweiz@cressida.sea.corp.google.com>  (tiny change)
+
+	* progmodes/js.el: Make indentation more customizable (Bug#6914).
+	(js-paren-indent-offset, js-square-indent-offset)
+	(js-curly-indent-offset): New options.
+	(js--proper-indentation): Use them.
+
+2010-08-26  Daniel Colascione  <dan.colascione@gmail.com>
+
+	* progmodes/sh-script.el (sh-get-indent-info): Use syntax-ppss
+	instead of inspecting font-lock properties (Bug#6916).
+
+2010-08-26  David Reitter  <david.reitter@gmail.com>
+
+	* server.el (server-visit-files): Run pre-command-hook and
+	post-command-hook for each buffer while it is current
+	(Bug#6910).
+	(server-execute): Do not run hooks here.
+
+2010-08-26  Michael Albinus  <michael.albinus@gmx.de>
+
+	Sync with Tramp 2.1.19.
+
+	* net/trampver.el: Update release number.
+
+2010-08-26  Chong Yidong  <cyd@stupidchicken.com>
+
+	* help.el (help-map): Bind `C-h P' to describe-package.
+
+	* menu-bar.el (menu-bar-describe-menu): Add describe-package.
+
+	* emacs-lisp/package.el (package-refresh-contents): Catch errors
+	when downloading archives.
+	(describe-package-1): Add package commentary.
+	(package-install-button-action): New function.
+	(package-menu-mode-map): Bind ? to package-menu-describe-package.
+	(package-menu-view-commentary): Function removed.
+	(package-list-packages-internal): Hide the `package' package too.
+
+2010-08-25  Kenichi Handa  <handa@m17n.org>
+
+	* language/misc-lang.el ("Arabic"): New language environment.
+	Setup composition-function-table for Arabic characters.
+
+	* international/fontset.el (setup-default-fontset): Fix typo for
+	arabic OTF spec (fini->fina).
+
 2010-08-25  Jan Djärv  <jan.h.d@swipnet.se>
 
 	* menu-bar.el (menu-bar-set-tool-bar-position): Set frame parameter
--- a/lisp/emacs-lisp/package.el	Wed Aug 25 22:44:39 2010 +0000
+++ b/lisp/emacs-lisp/package.el	Thu Aug 26 22:46:08 2010 +0000
@@ -216,6 +216,7 @@
 (declare-function lm-header "lisp-mnt" (header))
 (declare-function lm-commentary "lisp-mnt" (&optional file))
 (declare-function dired-delete-file "dired" (file &optional recursive trash))
+(defvar url-http-end-of-headers)
 
 (defcustom package-archives '(("gnu" . "http://elpa.gnu.org/packages/"))
   "An alist of archives from which to fetch.
@@ -1016,7 +1017,10 @@
   (unless (file-exists-p package-user-dir)
     (make-directory package-user-dir t))
   (dolist (archive package-archives)
-    (package--download-one-archive archive "archive-contents"))
+    (condition-case nil
+	(package--download-one-archive archive "archive-contents")
+      (error (message "Failed to download archive `%s'."
+		      (car archive)))))
   (package-read-all-archive-contents))
 
 ;;;###autoload
@@ -1052,9 +1056,7 @@
 					guess)
 			      "Describe package: ")
 			    packages nil t nil nil guess))
-     (list (if (equal val "")
-	       guess
-	     (intern val)))))
+     (list (if (equal val "") guess (intern val)))))
   (if (or (null package) (null (symbolp package)))
       (message "You did not specify a package")
     (help-setup-xref (list #'describe-package package)
@@ -1064,38 +1066,60 @@
 	(describe-package-1 package)))))
 
 (defun describe-package-1 (package)
-  (let ((desc (cdr (assq package package-alist)))
-	reqs version installable)
+  (let ((package-name (symbol-name package))
+	(built-in (assq package package--builtins))
+	desc pkg-dir reqs version installable)
     (prin1 package)
     (princ " is ")
-    (cond
-     (desc
-      ;; This package is loaded (i.e. in `package-alist').
-      (let (pkg-dir)
-	(setq version (package-version-join (package-desc-vers desc)))
-	(if (assq package package--builtins)
-	    (princ "a built-in package.\n\n")
-	  (setq pkg-dir (package--dir (symbol-name package) version))
-	  (if pkg-dir
-	      (progn
-		(insert "a package installed in `")
-		(help-insert-xref-button (file-name-as-directory pkg-dir)
-					 'help-package-def pkg-dir)
-		(insert "'.\n\n"))
-	    ;; This normally does not happen.
-	    (insert "a deleted package.\n\n")
-	    (setq version nil)))))
-     (t
-      ;; An uninstalled package.
-      (setq desc (cdr (assq package package-archive-contents))
+    (if (setq desc (cdr (assq package package-alist)))
+	;; This package is loaded (i.e. in `package-alist').
+	(progn
+	  (setq version (package-version-join (package-desc-vers desc)))
+	  (cond (built-in
+		 (princ "a built-in package.\n\n"))
+		((setq pkg-dir (package--dir package-name version))
+		 (insert "an installed package.\n\n"))
+		(t ;; This normally does not happen.
+		 (insert "a deleted package.\n\n")
+		 (setq version nil))))
+      ;; This package is not installed.
+      (setq desc    (cdr (assq package package-archive-contents))
 	    version (package-version-join (package-desc-vers desc))
 	    installable t)
-      (insert "an installable package.\n\n")))
-    (if version
-	(insert "      Version: " version "\n"))
+      (insert "an uninstalled package.\n\n"))
+
+    (insert "     " (propertize "Status" 'face 'bold) ": ")
+    (cond (pkg-dir
+	   (insert (propertize "Installed" 'face 'font-lock-comment-face))
+	   (insert " in `")
+	   ;; Todo: Add button for uninstalling.
+	   (help-insert-xref-button (file-name-as-directory pkg-dir)
+				    'help-package-def pkg-dir)
+	   (insert "'."))
+	  (installable
+	   (insert "Available -- ")
+	   (let ((button-text (if (display-graphic-p)
+				  "Install"
+				"[Install]"))
+		 (button-face (if (display-graphic-p)
+				  '(:box (:line-width 2 :color "dark grey")
+					 :background "light grey"
+					 :foreground "black")
+				'link)))
+	     (insert-text-button button-text
+				 'face button-face
+				 'follow-link t
+				 'package-symbol package
+				 'action 'package-install-button-action)))
+	  (built-in
+	   (insert (propertize "Built-in" 'face 'font-lock-builtin-face) "."))
+	  (t (insert "Deleted.")))
+    (insert "\n")
+    (when version
+      (insert "    " (propertize "Version" 'face 'bold) ": " version "\n"))
     (setq reqs (package-desc-reqs desc))
     (when reqs
-      (insert "     Requires: ")
+      (insert "   " (propertize "Requires" 'face 'bold) ": ")
       (let ((first t)
 	    name vers text)
 	(dolist (req reqs)
@@ -1110,28 +1134,45 @@
 		(t (insert ", ")))
 	  (help-insert-xref-button text 'help-package name))
 	(insert "\n")))
-    (insert "  Description: " (package-desc-doc desc) "\n")
-    ;; Todo: button for uninstalling a package.
-    (when installable
-      (let ((button-text (if (display-graphic-p)
-			     "Install"
-			   "[Install]"))
-	    (button-face (if (display-graphic-p)
-			     '(:box (:line-width 2 :color "dark grey")
-				    :background "light grey"
-				    :foreground "black")
-			   'link)))
-	(insert "\n")
-	(insert-text-button button-text
-			    'face button-face
-			    'follow-link t
-			    'package-symbol package
-			    'action (lambda (button)
-				      (package-install
-				       (button-get button 'package-symbol))
-				      (revert-buffer nil t)
-				      (goto-char (point-min))))
-	(insert "\n")))))
+    (insert "    " (propertize "Summary" 'face 'bold)
+	    ": " (package-desc-doc desc) "\n\n")
+
+    ;; Insert the package commentary.
+    ;; FIXME: We should try to be smarter about when to download.
+    (let ((readme (expand-file-name (concat package-name "-readme.txt")
+				    package-user-dir)))
+      ;; Try downloading the commentary.  If that fails, try an
+      ;; existing readme file in `package-user-dir'.
+      (cond ((let ((buffer
+		    (condition-case nil
+			(url-retrieve-synchronously
+			 (concat (package-archive-url package)
+				 package-name "-readme.txt"))
+		      (error nil)))
+		   response)
+	       (when buffer
+		 (with-current-buffer buffer
+		   (setq response (url-http-parse-response))
+		   (if (or (< response 200) (>= response 300))
+		       (setq response nil)
+		     (setq buffer-file-name
+			   (expand-file-name readme package-user-dir))
+		     (delete-region (point-min) (1+ url-http-end-of-headers))
+		     (save-buffer)))
+		 (when response
+		   (insert-buffer-substring buffer)
+		   (kill-buffer buffer)
+		   t))))
+	    ((file-readable-p readme)
+	     (insert-file-contents readme)
+	     (goto-char (point-max)))))))
+
+(defun package-install-button-action (button)
+  (let ((package (button-get button 'package-symbol)))
+    (when (y-or-n-p (format "Install package `%s'? " package))
+      (package-install package)
+      (revert-buffer nil t)
+      (goto-char (point-min)))))
 
 
 ;;;; Package menu mode.
@@ -1153,7 +1194,7 @@
     (define-key map "~" 'package-menu-mark-obsolete-for-deletion)
     (define-key map "x" 'package-menu-execute)
     (define-key map "h" 'package-menu-quick-help)
-    (define-key map "?" 'package-menu-view-commentary)
+    (define-key map "?" 'package-menu-describe-package)
     (define-key map [menu-bar package-menu] (cons "Package" menu-map))
     (define-key menu-map [mq]
       '(menu-item "Quit" quit-window
@@ -1297,32 +1338,8 @@
   (interactive)
   (message "n-ext, i-nstall, d-elete, u-nmark, x-ecute, r-efresh, h-elp"))
 
-(defun package-menu-view-commentary ()
-  "Display information about this package.
-For single-file packages, shows the commentary section from the header.
-For larger packages, shows the README file."
-  (interactive)
-  (let* ((pkg-name (package-menu-get-package))
-	 (buffer (url-retrieve-synchronously
-		  (concat (package-archive-url pkg-name)
-			  pkg-name
-			  "-readme.txt")))
-	 start-point ok)
-    (with-current-buffer buffer
-      ;; FIXME: it would be nice to work with any URL type.
-      (setq start-point url-http-end-of-headers)
-      (setq ok (eq (url-http-parse-response) 200)))
-    (let ((new-buffer (get-buffer-create "*Package Info*")))
-      (with-current-buffer new-buffer
-	(let ((buffer-read-only nil))
-	  (erase-buffer)
-	  (insert "Package information for " pkg-name "\n\n")
-	  (if ok
-	      (insert-buffer-substring buffer start-point)
-	    (insert "This package lacks a README file or commentary.\n"))
-	  (goto-char (point-min))
-	  (view-mode)))
-      (display-buffer new-buffer t))))
+(define-obsolete-function-alias
+  'package-menu-view-commentary 'package-menu-describe-package "24.1")
 
 ;; Return the name of the package on the current line.
 (defun package-menu-get-package ()
@@ -1426,7 +1443,7 @@
 	(setq name (car elt)
 	      desc (cdr elt)
 	      hold (assq name package-load-list))
-	(unless (eq name 'emacs)
+	(unless (memq name '(emacs package))
 	  (setq info-list
 		(package-list-maybe-add
 		 name (package-desc-vers desc)
--- a/lisp/help.el	Wed Aug 25 22:44:39 2010 +0000
+++ b/lisp/help.el	Thu Aug 26 22:46:08 2010 +0000
@@ -103,6 +103,7 @@
     (define-key map "m" 'describe-mode)
     (define-key map "n" 'view-emacs-news)
     (define-key map "p" 'finder-by-keyword)
+    (define-key map "P" 'describe-package)
     (define-key map "r" 'info-emacs-manual)
     (define-key map "s" 'describe-syntax)
     (define-key map "t" 'help-with-tutorial)
--- a/lisp/international/fontset.el	Wed Aug 25 22:44:39 2010 +0000
+++ b/lisp/international/fontset.el	Thu Aug 26 22:46:08 2010 +0000
@@ -433,7 +433,7 @@
 	       (nil . "koi8-r"))
 
      (arabic ,(font-spec :registry "iso10646-1"
-			 :otf '(arab nil (init medi fini liga)))
+			 :otf '(arab nil (init medi fina liga)))
 	     (nil . "MuleArabic-0")
 	     (nil . "MuleArabic-1")
 	     (nil . "MuleArabic-2")
--- a/lisp/international/mule-cmds.el	Wed Aug 25 22:44:39 2010 +0000
+++ b/lisp/international/mule-cmds.el	Thu Aug 26 22:46:08 2010 +0000
@@ -2179,7 +2179,7 @@
     ("af" . "Latin-1") ; Afrikaans
     ("am" "Ethiopic" utf-8) ; Amharic
     ("an" . "Latin-9") ; Aragonese
-    ; ar Arabic glibc uses 8859-6
+    ("ar" . "Arabic")
     ; as Assamese
     ; ay Aymara
     ("az" . "UTF-8") ; Azerbaijani
--- a/lisp/language/misc-lang.el	Wed Aug 25 22:44:39 2010 +0000
+++ b/lisp/language/misc-lang.el	Thu Aug 26 22:46:08 2010 +0000
@@ -40,8 +40,9 @@
 IPA is International Phonetic Alphabet for English, French, German
 and Italian.")))
 
-;; This is for Arabic.  But, as we still don't have Arabic language
-;; support, we at least define a coding system here.
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; Arabic
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 
 (define-coding-system 'iso-8859-6
   "ISO-8859-6 based encoding (MIME:ISO-8859-6)."
@@ -58,6 +59,19 @@
   :mime-charset 'windows-1256)
 (define-coding-system-alias 'cp1256 'windows-1256)
 
+(set-language-info-alist
+ "Arabic" '((charset unicode)
+	    (coding-system utf-8 iso-8859-6 windows-1256)
+	    (coding-priority utf-8 iso-8859-6 windows-1256)
+	    (input-method . "arabic")
+	    (sample-text . "Arabic	السّلام عليكم")
+	    (documentation . "Bidirectional editing is supported.")))
+
+(set-char-table-range
+ composition-function-table
+ '(#x600 . #x6FF)
+ (list ["[\u0600-\u06FF]+" 0 font-shape-gstring]))
+
 (provide 'misc-lang)
 
 ;; arch-tag: 6953585c-1a1a-4c09-be82-a2518afb6074
--- a/lisp/menu-bar.el	Wed Aug 25 22:44:39 2010 +0000
+++ b/lisp/menu-bar.el	Thu Aug 26 22:46:08 2010 +0000
@@ -1485,6 +1485,9 @@
 (define-key menu-bar-describe-menu [describe-current-display-table]
   `(menu-item ,(purecopy "Describe Display Table") describe-current-display-table
 	      :help ,(purecopy "Describe the current display table")))
+(define-key menu-bar-describe-menu [describe-package]
+  `(menu-item ,(purecopy "Describe Package...") describe-package
+              :help ,(purecopy "Display documentation of a Lisp package")))
 (define-key menu-bar-describe-menu [describe-face]
   `(menu-item ,(purecopy "Describe Face...") describe-face
               :help ,(purecopy "Display the properties of a face")))
@@ -1616,11 +1619,11 @@
 (define-key menu-bar-help-menu [sep2]
   menu-bar-separator)
 (define-key menu-bar-help-menu [external-packages]
-  `(menu-item ,(purecopy "External Packages") menu-bar-help-extra-packages
+  `(menu-item ,(purecopy "Finding Extra Packages") menu-bar-help-extra-packages
 	      :help ,(purecopy "Lisp packages distributed separately for use in Emacs")))
 (define-key menu-bar-help-menu [find-emacs-packages]
-  `(menu-item ,(purecopy "Find Emacs Packages") finder-by-keyword
-	      :help ,(purecopy "Find packages and features by keyword")))
+  `(menu-item ,(purecopy "Search Built-in Packages") finder-by-keyword
+	      :help ,(purecopy "Find built-in packages and features by keyword")))
 (define-key menu-bar-help-menu [more-manuals]
   `(menu-item ,(purecopy "More Manuals") ,menu-bar-manuals-menu))
 (define-key menu-bar-help-menu [emacs-manual]
--- a/lisp/net/tramp-uu.el	Wed Aug 25 22:44:39 2010 +0000
+++ b/lisp/net/tramp-uu.el	Thu Aug 26 22:46:08 2010 +0000
@@ -1,7 +1,7 @@
 ;;; tramp-uu.el --- uuencode in Lisp
 
-;; Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007,
-;;   2008, 2009, 2010 Free Software Foundation, Inc.
+;; Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008,
+;;   2009, 2010 Free Software Foundation, Inc.
 
 ;; Author: Kai Großjohann <kai.grossjohann@gmx.net>
 ;; Keywords: comm, terminals
--- a/lisp/net/tramp.el	Wed Aug 25 22:44:39 2010 +0000
+++ b/lisp/net/tramp.el	Thu Aug 26 22:46:08 2010 +0000
@@ -8995,6 +8995,13 @@
 ;; * Try telnet+curl as new method.  It might be useful for busybox,
 ;;   without built-in uuencode/uudecode.
 ;; * Load ~/.emacs_SHELLNAME on the remote host for `shell'.
+;; * I was wondering it it would be possible to use tramp even if I'm
+;;   actually using sshfs.  But when I launch a command I would like
+;;   to get it executed on the remote machine where the files really
+;;   are.  (Andrea Crotti)
+;; * Run emerge on two remote files.  Bug is described here:
+;;   <http://www.mail-archive.com/tramp-devel@nongnu.org/msg01041.html>.
+;;   (Bug#6850)
 
 ;; Functions for file-name-handler-alist:
 ;; diff-latest-backup-file -- in diff.el
--- a/lisp/net/trampver.el	Wed Aug 25 22:44:39 2010 +0000
+++ b/lisp/net/trampver.el	Thu Aug 26 22:46:08 2010 +0000
@@ -30,14 +30,14 @@
 ;; version check is defined in macro AC_EMACS_INFO of aclocal.m4;
 ;; should be changed only there.
 
-(defconst tramp-version "2.1.19-pre"
+(defconst tramp-version "2.1.19"
   "This version of Tramp.")
 
 (defconst tramp-bug-report-address "tramp-devel@gnu.org"
   "Email address to send bug reports to.")
 
 ;; Check for (X)Emacs version.
-(let ((x (if (or (>= emacs-major-version 22)	(and (featurep 'xemacs)	     (= emacs-major-version 21)	     (>= emacs-minor-version 4)))    "ok"    (format "Tramp 2.1.19-pre is not fit for %s"	    (when (string-match "^.*$" (emacs-version))	      (match-string 0 (emacs-version)))))))
+(let ((x (if (or (>= emacs-major-version 22)	(and (featurep 'xemacs)	     (= emacs-major-version 21)	     (>= emacs-minor-version 4)))    "ok"    (format "Tramp 2.1.19 is not fit for %s"	    (when (string-match "^.*$" (emacs-version))	      (match-string 0 (emacs-version)))))))
   (unless (string-match "\\`ok\\'" x) (error "%s" x)))
 
 (provide 'trampver)
--- a/lisp/progmodes/js.el	Wed Aug 25 22:44:39 2010 +0000
+++ b/lisp/progmodes/js.el	Thu Aug 26 22:46:08 2010 +0000
@@ -431,11 +431,32 @@
   :group 'js)
 
 (defcustom js-expr-indent-offset 0
-  "Number of additional spaces used for indentation of continued expressions.
+  "Number of additional spaces for indenting continued expressions.
 The value must be no less than minus `js-indent-level'."
   :type 'integer
   :group 'js)
 
+(defcustom js-paren-indent-offset 0
+  "Number of additional spaces for indenting expressions in parentheses.
+The value must be no less than minus `js-indent-level'."
+  :type 'integer
+  :group 'js
+  :version "24.1")
+
+(defcustom js-square-indent-offset 0
+  "Number of additional spaces for indenting expressions in square braces.
+The value must be no less than minus `js-indent-level'."
+  :type 'integer
+  :group 'js
+  :version "24.1")
+
+(defcustom js-curly-indent-offset 0
+  "Number of additional spaces for indenting expressions in curly braces.
+The value must be no less than minus `js-indent-level'."
+  :type 'integer
+  :group 'js
+  :version "24.1")
+
 (defcustom js-auto-indent-flag t
   "Whether to automatically indent when typing punctuation characters.
 If non-nil, the characters {}();,: also indent the current line
@@ -1769,14 +1790,17 @@
           ((eq (char-after) ?#) 0)
           ((save-excursion (js--beginning-of-macro)) 4)
           ((nth 1 parse-status)
+	   ;; A single closing paren/bracket should be indented at the
+	   ;; same level as the opening statement. Same goes for
+	   ;; "case" and "default".
            (let ((same-indent-p (looking-at
                                  "[]})]\\|\\_<case\\_>\\|\\_<default\\_>"))
                  (continued-expr-p (js--continued-expression-p)))
-             (goto-char (nth 1 parse-status))
+             (goto-char (nth 1 parse-status)) ; go to the opening char
              (if (looking-at "[({[]\\s-*\\(/[/*]\\|$\\)")
-                 (progn
+                 (progn ; nothing following the opening paren/bracket
                    (skip-syntax-backward " ")
-		   (when (eq (char-before) ?\)) (backward-list))
+                   (when (eq (char-before) ?\)) (backward-list))
                    (back-to-indentation)
                    (cond (same-indent-p
                           (current-column))
@@ -1784,7 +1808,14 @@
                           (+ (current-column) (* 2 js-indent-level)
                              js-expr-indent-offset))
                          (t
-                          (+ (current-column) js-indent-level))))
+                          (+ (current-column) js-indent-level
+                             (case (char-after (nth 1 parse-status))
+                               (?\( js-paren-indent-offset)
+                               (?\[ js-square-indent-offset)
+                               (?\{ js-curly-indent-offset))))))
+               ;; If there is something following the opening
+               ;; paren/bracket, everything else should be indented at
+               ;; the same level.
                (unless same-indent-p
                  (forward-char)
                  (skip-chars-forward " \t"))
--- a/lisp/progmodes/sh-script.el	Wed Aug 25 22:44:39 2010 +0000
+++ b/lisp/progmodes/sh-script.el	Thu Aug 26 22:46:08 2010 +0000
@@ -2207,10 +2207,9 @@
       ;; Note: setting result to t means we are done and will return nil.
       ;;(This function never returns just t.)
       (cond
-       ((or (and (boundp 'font-lock-string-face) (not (bobp))
-		 (eq (get-text-property (1- (point)) 'face)
-		     font-lock-string-face))
+       ((or (nth 3 (syntax-ppss (point)))
 	    (eq (get-text-property (point) 'face) sh-heredoc-face))
+	;; String continuation -- don't indent
 	(setq result t)
 	(setq have-result t))
        ((looking-at "\\s-*#")		; was (equal this-kw "#")
--- a/lisp/server.el	Wed Aug 25 22:44:39 2010 +0000
+++ b/lisp/server.el	Thu Aug 26 22:46:08 2010 +0000
@@ -1093,9 +1093,7 @@
     (condition-case err
         (let* ((buffers
                 (when files
-                  (run-hooks 'pre-command-hook)
-                  (prog1 (server-visit-files files proc nowait)
-                    (run-hooks 'post-command-hook)))))
+                  (server-visit-files files proc nowait))))
 
           (mapc 'funcall (nreverse commands))
 
@@ -1166,8 +1164,13 @@
 	       (obuf (get-file-buffer filen)))
 	  (add-to-history 'file-name-history filen)
 	  (if (null obuf)
-              (set-buffer (find-file-noselect filen))
+	      (progn
+		(run-hooks 'pre-command-hook)  
+		(set-buffer (find-file-noselect filen)))
             (set-buffer obuf)
+	    ;; separately for each file, in sync with post-command hooks,
+	    ;; with the new buffer current:
+	    (run-hooks 'pre-command-hook)  
             (cond ((file-exists-p filen)
                    (when (not (verify-visited-file-modtime obuf))
                      (revert-buffer t nil)))
@@ -1179,7 +1182,9 @@
             (unless server-buffer-clients
               (setq server-existing-buffer t)))
           (server-goto-line-column (cdr file))
-          (run-hooks 'server-visit-hook))
+          (run-hooks 'server-visit-hook)
+	  ;; hooks may be specific to current buffer:
+	  (run-hooks 'post-command-hook)) 
 	(unless nowait
 	  ;; When the buffer is killed, inform the clients.
 	  (add-hook 'kill-buffer-hook 'server-kill-buffer nil t)
--- a/src/ChangeLog	Wed Aug 25 22:44:39 2010 +0000
+++ b/src/ChangeLog	Thu Aug 26 22:46:08 2010 +0000
@@ -1,3 +1,8 @@
+2010-08-26  Kenichi Handa  <handa@m17n.org>
+
+	* xdisp.c (compute_stop_pos): Pay attention to bidi scan direction
+	on calling composition_compute_stop_pos.
+
 2010-08-25  Kenichi Handa  <handa@m17n.org>
 
 	* fontset.c (reorder_font_vector): Prefer a font-spec specifying
--- a/src/xdisp.c	Wed Aug 25 22:44:39 2010 +0000
+++ b/src/xdisp.c	Thu Aug 26 22:46:08 2010 +0000
@@ -3177,7 +3177,7 @@
 {
   register INTERVAL iv, next_iv;
   Lisp_Object object, limit, position;
-  EMACS_INT charpos, bytepos;
+  EMACS_INT charpos, bytepos, stoppos;
 
   /* If nowhere else, stop at the end.  */
   it->stop_charpos = it->end_charpos;
@@ -3267,8 +3267,12 @@
 	}
     }
 
+  if (it->bidi_p && it->bidi_it.scan_dir < 0)
+    stoppos = -1;
+  else
+    stoppos = it->stop_charpos;
   composition_compute_stop_pos (&it->cmp_it, charpos, bytepos,
-				it->stop_charpos, it->string);
+				stoppos, it->string);
 
   xassert (STRINGP (it->string)
 	   || (it->stop_charpos >= BEGV