changeset 107158:a54a2fe12bf1

from trunk
author Kenichi Handa <handa@m17n.org>
date Sat, 13 Feb 2010 09:37:27 +0900
parents 79ae69c59078 (current diff) 00c6bb12d924 (diff)
children 70d9e7f7518f
files
diffstat 19 files changed, 229 insertions(+), 109 deletions(-) [+]
line wrap: on
line diff
--- a/doc/emacs/ChangeLog	Mon Feb 08 16:08:18 2010 +0900
+++ b/doc/emacs/ChangeLog	Sat Feb 13 09:37:27 2010 +0900
@@ -1,3 +1,7 @@
+2010-02-08  Glenn Morris  <rgm@gnu.org>
+
+	* buffers.texi (Uniquify): Must explicitly load library.  (Bug#5529)
+
 2010-02-01  Stefan Monnier  <monnier@iro.umontreal.ca>
 
 	* display.texi (Useless Whitespace, Text Display):
--- a/doc/emacs/buffers.texi	Mon Feb 08 16:08:18 2010 +0900
+++ b/doc/emacs/buffers.texi	Sat Feb 13 09:37:27 2010 +0900
@@ -583,7 +583,8 @@
 
 @vindex uniquify-buffer-name-style
   Other methods work by adding parts of each file's directory to the
-buffer name.  To select one, customize the variable
+buffer name.  To select one, load the library @file{uniquify} (e.g.
+using @code{(require 'uniquify)}), and customize the variable
 @code{uniquify-buffer-name-style} (@pxref{Easy Customization}).
 
   To begin with, the @code{forward} naming method includes part of the
--- a/etc/NEWS	Mon Feb 08 16:08:18 2010 +0900
+++ b/etc/NEWS	Sat Feb 13 09:37:27 2010 +0900
@@ -273,6 +273,11 @@
 
 To disable this check, set compose-mail-user-agent-warnings to nil.
 
+** The default value of mail-interactive is t, since Emacs 23.1.
+(This was not announced at the time.)  It means that when sending mail,
+Emacs will wait for the process sending mail to return.  If you
+experience delays when sending mail, you may wish to set this to nil.
+
 ** nXML mode is now the default for editing XML files.
 
 ** Shell
--- a/lisp/ChangeLog	Mon Feb 08 16:08:18 2010 +0900
+++ b/lisp/ChangeLog	Sat Feb 13 09:37:27 2010 +0900
@@ -1,7 +1,60 @@
+2010-02-12  Juri Linkov  <juri@jurta.org>
+
+	* arc-mode.el (archive-unique-fname): Make directories for nested
+	archives.  (Bug#5540)
+
+2010-02-12  Juri Linkov  <juri@jurta.org>
+
+	* ffap.el (dired-at-point): Fix docstring.  (Bug#5565)
+
+2010-02-11  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+	* subr.el (copy-overlay): Handle deleted overlays.
+
+	* man.el (Man-completion-table): Don't signal an error if we can't run
+	manual-program (bug#4056).
+
+2010-02-10  Juanma Barranquero  <lekktu@gmail.com>
+
+	* textmodes/artist.el (artist-mt): Fix typos in docstring.
+
+2010-02-10  Thierry Volpiatto  <thierry.volpiatto@gmail.com>
+
+	* info.el (Info-bookmark-jump): Simplify.
+
+	* bookmark.el (bookmark-handle-bookmark): Catch the right error.
+	(bookmark-default-handler): Accept new bookmark field `buffer'.
+
+2010-02-10  Chong Yidong  <cyd@stupidchicken.com>
+
+	* iswitchb.el (iswitchb-completions): Revert last change.
+
+2010-02-10  Michael Albinus  <michael.albinus@gmx.de>
+
+	* ls-lisp.el (ls-lisp-insert-directory): When WILDCARD-REGEXP and
+	FULL-DIRECTORY-P are nil, and FILE is absolute, expand it.
+	This prevents file names like "~/" being listed literally.
+
+2010-02-10  Dan Nicolaescu  <dann@ics.uci.edu>
+
+	* term/xterm.el (xterm-maybe-set-dark-background-mode):
+	Remove dead code.  (Bug#5546)
+
+2010-02-09  Chong Yidong  <cyd@stupidchicken.com>
+
+	* eshell/em-ls.el (eshell-ls-applicable): Frob file attributes
+	correctly (Bug#5548).
+
+2010-02-08  Jose E. Marchesi  <jemarch@gnu.org>
+
+	* progmodes/ada-mode.el (ada-in-numeric-literal-p): New function.
+	(ada-adjust-case): Don't adjust case in hexadecimal number
+	literals.
+
 2010-02-08  Kenichi Handa  <handa@m17n.org>
 
 	* international/mule-util.el (with-coding-priority): Add autoload
-	cookie for putting `lisp-indent-funciton'.
+	cookie for putting `lisp-indent-function'.
 
 2010-02-07  Glenn Morris  <rgm@gnu.org>
 
@@ -277,10 +330,9 @@
 
 2010-01-25  Mark A. Hershberger  <mah@everybody.org>
 
-	* progmodes/python.el: Replace reference to obsolete
-	c-subward-mode.
-
-	* vc-bzr.el: (vc-bzr-revision-table) New function.
+	* progmodes/python.el: Replace reference to obsolete c-subword-mode.
+
+	* vc-bzr.el (vc-bzr-revision-table): New function.
 
 2010-01-25  Eric Hanchrow  <eric.hanchrow@gmail.com>  (tiny change)
 
@@ -313,7 +365,7 @@
 
 2010-01-23  Stephen Leake  <stephen_leake@member.fsf.org>
 
-        * progmodes/ada-mode.el (ada-in-paramlist-p): Pragma syntax
+	* progmodes/ada-mode.el (ada-in-paramlist-p): Pragma syntax
 	is the same as subprogram call, not declaration.  (Bug#5435).
 
 2010-01-23  Michael Albinus  <michael.albinus@gmx.de>
@@ -3709,7 +3761,7 @@
 	(verilog-read-decls): Fix AUTOREG not detecting "assign {a,b}".
 	Reported by Wade Smith.
 
-	(verilog-batch-execute-func) Comment on function usage.
+	(verilog-batch-execute-func): Comment on function usage.
 
 2009-11-05  Michael McNamara  <mac@mail.brushroad.com>
 
@@ -4366,7 +4418,7 @@
 	(tramp-handle-file-truename): Use it.
 	(tramp-handle-file-exists-p): Check file-attributes cache, assume
 	file exists if cache value present.
-	(tramp-check-cached-permissions) New defun.
+	(tramp-check-cached-permissions): New defun.
 	(tramp-handle-file-readable-p): Use it.
 	(tramp-handle-file-writable-p): Likewise.
 	(tramp-handle-file-executable-p): Likewise.
@@ -4597,7 +4649,7 @@
 	from `rfn-eshadow-update-overlay-hook' when unloading.
 	(tramp-methods): Add `tramp-copy-keep-tmpfile' for "rsync" and
 	"rsyncc".  Adjust doc string.
-	(tramp-temp-buffer-file-name) New buffer-local defvar.
+	(tramp-temp-buffer-file-name): New buffer-local defvar.
 	(tramp-handle-insert-file-contents, tramp-handle-write-region):
 	Keep temporary file when indicated by method ("rsync" and
 	"rsyncc").
@@ -8009,7 +8061,7 @@
 	Don't modify last-coding-system-used by accident.
 	(tramp-completion-file-name-handler): Apply the checks here,
 	instead during registration.
-	(tramp-register-file-name-handlers) Renamed from
+	(tramp-register-file-name-handlers): Renamed from
 	`tramp-register-file-name-handler'.  Register both
 	`tramp-file-name-handler' and `tramp-completion-file-name-handler'.
 	(tramp-register-completion-file-name-handler): Remove.  (Bug#4260)
@@ -10103,7 +10155,7 @@
 
 	* net/tramp.el (tramp-do-copy-or-rename-file-directly):
 	Handle also the 'rename case, when setting file modes.  (Bug#3712)
-	(tramp-default-file-modes) Remove execute permissions.
+	(tramp-default-file-modes): Remove execute permissions.
 
 	* net/tramp-gvfs.el (tramp-gvfs-methods): Add "synce" method.
 	(top): Add a default for "synce" in `tramp-default-user-alist'.
@@ -10128,7 +10180,7 @@
 
 	* language/chinese.el ("Chinese-GB", "Chinese-BIG5")
 	("Chinese-CNS", "Chinese-EUC-TW", "Chinese-GBK"): Add a
-	setup-funcion to make char-widht-table suitable for respective
+	setup-function to make char-width-table suitable for respective
 	environments, and an exit-function to cancel that.
 
 	* language/japan-util.el (setup-japanese-environment-internal):
@@ -10188,7 +10240,7 @@
 	to support safe execution at almost anyline.
 	(verilog-calc-1): Properly support indenting deep inside generate
 	blocks.
-	(verilog-init-font) Remove definition & use of verilog-init-font,
+	(verilog-init-font): Remove definition & use of verilog-init-font,
 	as it is redundant with font-lock-defaults.
 	(verilog-mode): Alter the definition of verilog-font-lock-defaults
 	to avoid circular calls if syntax-ppss is a function (as is the
@@ -10202,7 +10254,7 @@
 	(verilog-defun-level-not-generate-re, verilog-defun-level-re)
 	(verilog-defun-level-generate-only-re): Really fix the defun-list
 	compilation issue.
-	(verilog-calc-1) (verilog-beg-of-statement): Enhance support for
+	(verilog-calc-1, verilog-beg-of-statement): Enhance support for
 	coverpoint, constraint and cross statements.
 	(verilog-defun-level-list, verilog-generate-defun-level-list)
 	(verilog-all-defun-level-list): Redo these specifications - it is
--- a/lisp/arc-mode.el	Mon Feb 08 16:08:18 2010 +0900
+++ b/lisp/arc-mode.el	Sat Feb 13 09:37:27 2010 +0900
@@ -834,6 +834,11 @@
 	  ;; reconstructed in the temporary directory.
 	  (make-directory (file-name-directory tmpfile) t)
 	  (make-temp-file tmpfile))
+      ;; Maked sure all the leading directories in `fullname' exist
+      ;; under archive-tmpdir.  This is necessary for nested archives
+      ;; (`archive-extract' sets `archive-remote' to t in case
+      ;; an archive occurs inside another archive).
+      (make-directory (file-name-directory fullname) t)
       fullname)))
 
 (defun archive-maybe-copy (archive)
--- a/lisp/bookmark.el	Mon Feb 08 16:08:18 2010 +0900
+++ b/lisp/bookmark.el	Sat Feb 13 09:37:27 2010 +0900
@@ -1068,7 +1068,7 @@
       (funcall (or (bookmark-get-handler bookmark)
                    'bookmark-default-handler)
                (bookmark-get-bookmark bookmark))
-    (file-error
+    (bookmark-error-no-filename         ;file-error
      ;; We were unable to find the marked file, so ask if user wants to
      ;; relocate the bookmark, else remind them to consider deletion.
      (when (stringp bookmark)
@@ -1116,24 +1116,28 @@
 BMK-RECORD is a bookmark record, not a bookmark name (i.e., not a string).
 Changes current buffer and point and returns nil, or signals a `file-error'."
   (let ((file          (bookmark-get-filename bmk-record))
+	(buf           (bookmark-prop-get bmk-record 'buffer))
         (forward-str   (bookmark-get-front-context-string bmk-record))
         (behind-str    (bookmark-get-rear-context-string bmk-record))
         (place         (bookmark-get-position bmk-record)))
-    (if (not file)
-        (signal 'bookmark-error-no-filename (list 'stringp file))
-      (set-buffer (find-file-noselect file))
-      (if place (goto-char place))
-      ;; Go searching forward first.  Then, if forward-str exists and
-      ;; was found in the file, we can search backward for behind-str.
-      ;; Rationale is that if text was inserted between the two in the
-      ;; file, it's better to be put before it so you can read it,
-      ;; rather than after and remain perhaps unaware of the changes.
-      (if forward-str
-          (if (search-forward forward-str (point-max) t)
-              (goto-char (match-beginning 0))))
-      (if behind-str
-          (if (search-backward behind-str (point-min) t)
-              (goto-char (match-end 0)))))
+    (set-buffer
+     (cond
+      ((and file (file-readable-p file) (not (buffer-live-p buf)))
+       (find-file-noselect file))
+      ;; No file found.  See if buffer BUF have been created.
+      ((and buf (get-buffer buf)))
+      (t ;; If not, raise error.
+       (signal 'bookmark-error-no-filename (list 'stringp file)))))
+    (if place (goto-char place))
+    ;; Go searching forward first.  Then, if forward-str exists and
+    ;; was found in the file, we can search backward for behind-str.
+    ;; Rationale is that if text was inserted between the two in the
+    ;; file, it's better to be put before it so you can read it,
+    ;; rather than after and remain perhaps unaware of the changes.
+    (when (and forward-str (search-forward forward-str (point-max) t))
+      (goto-char (match-beginning 0)))
+    (when (and behind-str (search-backward behind-str (point-min) t))
+      (goto-char (match-end 0)))
     nil))
 
 ;;;###autoload
--- a/lisp/eshell/em-ls.el	Mon Feb 08 16:08:18 2010 +0900
+++ b/lisp/eshell/em-ls.el	Sat Feb 13 09:37:27 2010 +0900
@@ -225,18 +225,28 @@
       (eq (aref (nth 8 attrs) 0) type)))
 
 (defmacro eshell-ls-applicable (attrs index func file)
-  "Test whether, for ATTRS, the user UID can do what corresponds to INDEX.
-This is really just for efficiency, to avoid having to stat the file
-yet again."
-  `(if (numberp (nth 2 ,attrs))
-       (if (= (user-uid) (nth 2 ,attrs))
-	   (not (eq (aref (nth 8 ,attrs) ,index) ?-))
-	 (,(eval func) ,file))
-     (not (eq (aref (nth 8 ,attrs)
-		    (+ ,index (if (member (nth 2 ,attrs)
-					  (eshell-current-ange-uids))
-				  0 6)))
-	      ?-))))
+  "Test whether, for ATTRS, the user can do what corresponds to INDEX.
+ATTRS is a string of file modes.  See `file-attributes'.
+If we cannot determine the answer using ATTRS (e.g., if we need
+to know what group the user is in), compute the return value by
+calling FUNC with FILE as an argument."
+  `(let ((owner (nth 2 ,attrs))
+	 (modes (nth 8 ,attrs)))
+     (cond ((cond ((numberp owner)
+		   (= owner (user-uid)))
+		  ((stringp owner)
+		   (or (string-equal owner (user-login-name))
+		       (member owner (eshell-current-ange-uids)))))
+	    ;; The user owns this file.
+	    (not (eq (aref modes ,index) ?-)))
+	   ((eq (aref modes (+ ,index 3))
+		(aref modes (+ ,index 6)))
+	    ;; If the "group" and "other" fields give identical
+	    ;; results, use that.
+	    (not (eq (aref modes (+ ,index 3)) ?-)))
+	   (t
+	    ;; Otherwise call FUNC.
+	    (,(eval func) ,file)))))
 
 (defcustom eshell-ls-highlight-alist nil
   "*This alist correlates test functions to color.
--- a/lisp/ffap.el	Mon Feb 08 16:08:18 2010 +0900
+++ b/lisp/ffap.el	Sat Feb 13 09:37:27 2010 +0900
@@ -1796,7 +1796,8 @@
 
 ;;;###autoload
 (defun dired-at-point (&optional filename)
-  "Start Dired, defaulting to file at point.  See `ffap'."
+  "Start Dired, defaulting to file at point.  See `ffap'.
+If `dired-at-point-require-prefix' is set, the prefix meaning is reversed."
   (interactive)
   (if (and (called-interactively-p 'interactive)
 	   (if dired-at-point-require-prefix
--- a/lisp/info.el	Mon Feb 08 16:08:18 2010 +0900
+++ b/lisp/info.el	Sat Feb 13 09:37:27 2010 +0900
@@ -4797,7 +4797,7 @@
     ;; Use bookmark-default-handler to move to the appropriate location
     ;; within the node.
     (bookmark-default-handler
-     (list* "" `(buffer . ,buf) (bookmark-get-bookmark-record bmk)))))
+     `("" (buffer . ,buf) . ,(bookmark-get-bookmark-record bmk)))))
 
 (provide 'info)
 
--- a/lisp/iswitchb.el	Mon Feb 08 16:08:18 2010 +0900
+++ b/lisp/iswitchb.el	Sat Feb 13 09:37:27 2010 +0900
@@ -1274,7 +1274,7 @@
     ;; consult the list of past visited files, to see if we can find
     ;; the file which the user might thought was still open.
     (when (and iswitchb-use-virtual-buffers (null comps)
-	       (or recentf-list bookmark-alist))
+	       recentf-list)
       (setq iswitchb-virtual-buffers nil)
       (let ((head recentf-list) name)
 	(while head
@@ -1289,30 +1289,15 @@
 	      (setq iswitchb-virtual-buffers
 		    (cons (cons name (car head))
 			  iswitchb-virtual-buffers)))
-	  (setq head (cdr head))))
-      (let ((head bookmark-alist) name path)
-	(while head
-	  (if (and (setq path (cdr (assq 'filename (cdar head))))
-		   (setq name (file-name-nondirectory path))
-		   (string-match (if iswitchb-regexp
-				     iswitchb-text
-				   (regexp-quote iswitchb-text)) name)
-		   (null (get-file-buffer path))
-		   (not (assoc name iswitchb-virtual-buffers))
-		   (not (iswitchb-ignore-buffername-p name))
-		   (file-exists-p path))
-	      (setq iswitchb-virtual-buffers
-		    (cons (cons name path)
-			  iswitchb-virtual-buffers)))
-	  (setq head (cdr head))))
-      (setq iswitchb-virtual-buffers (nreverse iswitchb-virtual-buffers)
-	    comps (mapcar 'car iswitchb-virtual-buffers))
+	  (setq head (cdr head)))
+	(setq iswitchb-virtual-buffers (nreverse iswitchb-virtual-buffers)
+	      comps (mapcar 'car iswitchb-virtual-buffers))
 	(let ((comp comps))
 	  (while comp
 	    (put-text-property 0 (length (car comp))
 			       'face 'iswitchb-virtual-matches
 			       (car comp))
-	    (setq comp (cdr comp)))))
+	    (setq comp (cdr comp))))))
 
     (cond ((null comps) (format " %sNo match%s"
 				open-bracket-determined
--- a/lisp/ls-lisp.el	Mon Feb 08 16:08:18 2010 +0900
+++ b/lisp/ls-lisp.el	Sat Feb 13 09:37:27 2010 +0900
@@ -400,6 +400,7 @@
     ;; If not full-directory-p, FILE *must not* end in /, as
     ;; file-attributes will not recognize a symlink to a directory,
     ;; so must make it a relative filename as ls does:
+    (if (file-name-absolute-p file) (setq file (expand-file-name file)))
     (if (eq (aref file (1- (length file))) ?/)
 	(setq file (substring file 0 -1)))
     (let ((fattr (file-attributes file 'string)))
--- a/lisp/man.el	Mon Feb 08 16:08:18 2010 +0900
+++ b/lisp/man.el	Sat Feb 13 09:37:27 2010 +0900
@@ -771,8 +771,13 @@
           ;; quote anything.
           (let ((process-environment (copy-sequence process-environment)))
             (setenv "COLUMNS" "999") ;; don't truncate long names
-            (call-process manual-program nil '(t nil) nil
-                          "-k" (concat "^" prefix)))
+            ;; manual-program might not even exist.  And since it's
+            ;; run differently in Man-getpage-in-background, an error
+            ;; here may not necessarily mean that we'll also get an
+            ;; error later.
+            (ignore-errors
+              (call-process manual-program nil '(t nil) nil
+                            "-k" (concat "^" prefix))))
           (goto-char (point-min))
           (while (re-search-forward "^\\([^ \t\n]+\\)\\(?: ?\\((.+?)\\)\\(?:[ \t]+- \\(.*\\)\\)?\\)?" nil t)
             (push (propertize (concat (match-string 1) (match-string 2))
--- a/lisp/progmodes/ada-mode.el	Mon Feb 08 16:08:18 2010 +0900
+++ b/lisp/progmodes/ada-mode.el	Sat Feb 13 09:37:27 2010 +0900
@@ -1017,6 +1017,9 @@
 			  (line-beginning-position) (point))))
   (or (ada-in-string-p parse-result) (ada-in-comment-p parse-result)))
 
+(defsubst ada-in-numeric-literal-p ()
+  "Return t if point is after a prefix of a numeric literal."
+  (looking-back "\\([0-9]+#[0-9a-fA-F_]+\\)"))
 
 ;;------------------------------------------------------------------
 ;; Contextual menus
@@ -1606,6 +1609,8 @@
 		 (eq (char-syntax (char-before)) ?w)
 		 ;;  if in a string or a comment
 		 (not (ada-in-string-or-comment-p))
+		 ;;  if in a numeric literal
+		 (not (ada-in-numeric-literal-p))
 		 )
 	    (if (save-excursion
 		  (forward-word -1)
--- a/lisp/subr.el	Mon Feb 08 16:08:18 2010 +0900
+++ b/lisp/subr.el	Sat Feb 13 09:37:27 2010 +0900
@@ -2232,10 +2232,14 @@
 
 (defun copy-overlay (o)
   "Return a copy of overlay O."
-  (let ((o1 (make-overlay (overlay-start o) (overlay-end o)
-			  ;; FIXME: there's no easy way to find the
-			  ;; insertion-type of the two markers.
-			  (overlay-buffer o)))
+  (let ((o1 (if (overlay-buffer o)
+                (make-overlay (overlay-start o) (overlay-end o)
+                              ;; FIXME: there's no easy way to find the
+                              ;; insertion-type of the two markers.
+                              (overlay-buffer o))
+              (let ((o1 (make-overlay (point-min) (point-min))))
+                (delete-overlay o1)
+                o1)))
 	(props (overlay-properties o)))
     (while props
       (overlay-put o1 (pop props) (pop props)))
--- a/lisp/term/xterm.el	Mon Feb 08 16:08:18 2010 +0900
+++ b/lisp/term/xterm.el	Sat Feb 13 09:37:27 2010 +0900
@@ -679,7 +679,6 @@
   ;; Use the heuristic in `frame-set-background-mode' to decide if a
   ;; frame is dark.
   (when (< (+ redc greenc bluec) (* .6 (+ 65535 65535 65535)))
-    (setq xterm-background-mode-changed t)
     (set-terminal-parameter nil 'background-mode 'dark)
     t))
 
--- a/lisp/textmodes/artist.el	Mon Feb 08 16:08:18 2010 +0900
+++ b/lisp/textmodes/artist.el	Sat Feb 13 09:37:27 2010 +0900
@@ -859,15 +859,15 @@
   can have arrows.  The function is called with no arguments and
   must return nil or t.
 ARROW-SET-FN is a function that is called to set arrow end-points.
-  Arguments and return values for this funcion are described below.
+  Arguments and return values for this function are described below.
 INIT-FN is, if non-nil, a function that is called when the first
   point of the shape is set.  Arguments and return values for
-  this funcion are described below.
+  this function are described below.
 PREP-FILL-FN is, if non-nil, a function that is called after
   the last point is set, but before the filling is done.
-  Arguments and return values for this funcion are described below.
+  Arguments and return values for this function are described below.
 EXIT-FN is, if non-nil, a function that is called after filling
-  is done.  Arguments and return values for this funcion are
+  is done.  Arguments and return values for this function are
   described below.
 DRAW-HOW defines the kind of shape.  The kinds of shapes are:
   `artist-do-continously'  -- Do drawing operation continuously,
@@ -876,7 +876,7 @@
   1                        -- Do drawing operation only once.
   2                        -- The drawing operation requires two points.
 DRAW-FN is the function to call for drawing.  Arguments and
-  return values for this funcion are described below.
+  return values for this function are described below.
 EXTRA-DRAW-INFO the layout of this depends on the value of DRAW-HOW:
   If DRAW-HOW is `artist-do-continously':
 
@@ -894,20 +894,20 @@
     (UNDRAW-FN FILL-PRED FILL-FN)
 
     UNDRAW-FN is a function to call for undrawing the shape.
-      Arguments and return values for this funcion are
+      Arguments and return values for this function are
       described below.
     FILL-PRED is a function that is called to find out if the shape
       can have arrows.  The function must take no arguments and
       return nil or t.
     FILL-FN  is a function to call for filling the shape.
-      Arguments and return values for this funcion are
+      Arguments and return values for this function are
       described below.
 
   If DRAW-HOW is 1:
 
     ()
 
-Note! All symbols and keywords (both in the `funcion-call' INFO-PART
+Note! All symbols and keywords (both in the `function-call' INFO-PART
       as well as in the `graphics-operation' INFO-PART) must be unique.
 
 The following table describe function arguments and return value
--- a/src/ChangeLog	Mon Feb 08 16:08:18 2010 +0900
+++ b/src/ChangeLog	Sat Feb 13 09:37:27 2010 +0900
@@ -1,3 +1,20 @@
+2010-02-10  Jan Djärv  <jan.h.d@swipnet.se>
+
+	* xsmfns.c (x_session_initialize): Move initialization of ice_fd and
+	doing_interact here.
+	(ice_connection_closed): New function.
+	(x_session_check_input, smc_die_CB, ice_io_error_handler)
+	(ice_conn_watch_CB, x_session_close): Call ice_connection_closed.
+	(x_session_check_input): Call IceCloseConnection if IceProcessMessages
+	returns I/O error.
+	(ice_conn_watch_CB): Call add_keyboard_wait_descriptor on ice_fd,
+	bug #5512.
+
+2010-02-08  Francis Devereux  <francis@devrx.org>  (tiny change)
+
+	* nsfont.m (nsfont_open): The system's value for the font descent
+	is negative, so round it down to avoid clipping.
+
 2010-02-06  Chong Yidong  <cyd@stupidchicken.com>
 
 	* charset.c (load_charset_map_from_file)
@@ -78,7 +95,7 @@
 2010-01-25  Jan Djärv  <jan.h.d@swipnet.se>
 
 	* xfns.c (Fx_create_frame): If frame height is too big, try
-	sizes 24 and 10. Bug #3643.
+	sizes 24 and 10.  Bug #3643.
 
 2010-01-24  Stefan Monnier  <monnier@iro.umontreal.ca>
 
@@ -165,7 +182,7 @@
 	* xfns.c (x_get_current_desktop, x_get_desktop_workarea): New functions.
 	(Fx_create_frame): Call x_get_current_desktop and x_get_desktop_workarea
 	to find out usable size of the desktop.  Don't make frames larger than
-	this. Bug #3643.
+	this.  Bug #3643.
 
 2010-01-15  Kenichi Handa  <handa@m17n.org>
 
@@ -310,7 +327,7 @@
 
 2010-01-08  Jan Djärv  <jan.h.d@swipnet.se>
 
-	* dispnew.c (change_frame_size_1): newwidth == FRAME_COLS  (f) must
+	* dispnew.c (change_frame_size_1): newwidth == FRAME_COLS (f) must
 	also be true before we can return early (bug #5339).
 
 2010-01-06  David Reitter  <david.reitter@gmail.com>
@@ -342,7 +359,7 @@
 
 	* xterm.c (x_new_font): Move code for setting rows/cols before
 	resizing ...
-	(x_set_window_size): ... to here. bug #2568.
+	(x_set_window_size): ... to here.  Bug #2568.
 
 	* gtkutil.c (xg_clear_under_internal_border): New function.
 	(xg_frame_resized, xg_frame_set_char_size):
@@ -1581,7 +1598,7 @@
 	Fix printf format.
 	(ns_query_color): Use CGFloat where appropriate.
 	(EmacsView<NSTextInput>, EmacsScroller): Fix method signatures.
-	(EmacsScroller-mouseDown:) Use long format in printf, and cast
+	(EmacsScroller-mouseDown:): Use long format in printf, and cast
 	argument.
 
 	* config.in (NS_HAVE_NSINTEGER): Drop.
@@ -4057,7 +4074,7 @@
 
 2009-02-12  Stefan Monnier  <monnier@iro.umontreal.ca>
 
-	* keyboard.c (adjust_point_for_property): Allow stopping betwen two
+	* keyboard.c (adjust_point_for_property): Allow stopping between two
 	invisible areas.
 
 2009-02-12  Jason Rumney  <jasonr@gnu.org>
--- a/src/nsfont.m	Mon Feb 08 16:08:18 2010 +0900
+++ b/src/nsfont.m	Sat Feb 13 09:37:27 2010 +0900
@@ -844,8 +844,10 @@
     /* max bounds */
     font_info->max_bounds.ascent =
       lrint (hshrink * [sfont ascender] + expand * hd/2);
+    /* [sfont descender] is usually negative.  Use floor to avoid
+       clipping descenders. */
     font_info->max_bounds.descent =
-      -lrint (hshrink* [sfont descender] - expand*hd/2);
+      -lrint (floor(hshrink* [sfont descender] - expand*hd/2));
     font_info->height =
       font_info->max_bounds.ascent + font_info->max_bounds.descent;
     font_info->max_bounds.width = lrint (font_info->width);
@@ -880,8 +882,8 @@
 #endif
 
     /* set up metrics portion of font struct */
-    font->ascent = [sfont ascender];
-    font->descent = -[sfont descender];
+    font->ascent = lrint([sfont ascender]);
+    font->descent = -lrint(floor([sfont descender]));
     font->min_width = ns_char_width(sfont, '|');
     font->space_width = lrint (ns_char_width (sfont, ' '));
     font->average_width = lrint (font_info->width);
--- a/src/xsmfns.c	Mon Feb 08 16:08:18 2010 +0900
+++ b/src/xsmfns.c	Sat Feb 13 09:37:27 2010 +0900
@@ -52,11 +52,11 @@
 
 /* The descriptor that we use to check for data from the session manager.  */
 
-static int ice_fd = -1;
+static int ice_fd;
 
 /* A flag that says if we are in shutdown interactions or not.  */
 
-static int doing_interact = False;
+static int doing_interact;
 
 /* The session manager object for the session manager connection.  */
 
@@ -90,6 +90,14 @@
 
 #define NOSPLASH_OPT "--no-splash"
 
+static void
+ice_connection_closed ()
+{
+  if (ice_fd >= 0)
+    delete_keyboard_wait_descriptor (ice_fd);
+  ice_fd = -1;
+}
+
 
 /* Handle any messages from the session manager.  If no connection is
    open to a session manager, just return 0.
@@ -101,9 +109,9 @@
 {
   SELECT_TYPE read_fds;
   EMACS_TIME tmout;
+  int ret;
 
   if (ice_fd == -1) return 0;
-
   FD_ZERO (&read_fds);
   FD_SET (ice_fd, &read_fds);
 
@@ -116,26 +124,33 @@
      will be called.  */
   emacs_event.kind = NO_EVENT;
 
-  if (select (ice_fd+1, &read_fds,
-              (SELECT_TYPE *)0, (SELECT_TYPE *)0, &tmout) < 0)
+  ret = select (ice_fd+1, &read_fds,
+                (SELECT_TYPE *)0, (SELECT_TYPE *)0, &tmout);
+
+  if (ret < 0)
     {
-      ice_fd = -1;
-      return 0;
+      ice_connection_closed ();
     }
-
+  else if (ret > 0 && FD_ISSET (ice_fd, &read_fds))
+    {
+      ret = IceProcessMessages (SmcGetIceConnection (smc_conn),
+                                (IceReplyWaitInfo *)0, (Bool *)0);
+      if (ret != IceProcessMessagesSuccess)
+        {
+          /* Either IO error or Connection closed.  */
+          if (ret == IceProcessMessagesIOError)
+            IceCloseConnection (SmcGetIceConnection (smc_conn));
 
-  if (FD_ISSET (ice_fd, &read_fds))
-    IceProcessMessages (SmcGetIceConnection (smc_conn),
-                        (IceReplyWaitInfo *)0, (Bool *)0);
-
+          ice_connection_closed ();
+        }
+    }
 
   /* Check if smc_interact_CB was called and we shall generate a
      SAVE_SESSION_EVENT.  */
-  if (emacs_event.kind == NO_EVENT)
-    return 0;
+  if (emacs_event.kind != NO_EVENT)
+    bcopy (&emacs_event, bufp, sizeof (struct input_event));
 
-  bcopy (&emacs_event, bufp, sizeof (struct input_event));
-  return 1;
+  return emacs_event.kind != NO_EVENT ? 1 : 0;
 }
 
 /* Return non-zero if we have a connection to a session manager.  */
@@ -284,7 +299,7 @@
      SmPointer clientData;
 {
   SmcCloseConnection (smcConn, 0, 0);
-  ice_fd = -1;
+  ice_connection_closed ();
 }
 
 /* We don't use the next two but they are mandatory, leave them empty.
@@ -356,7 +371,7 @@
      IceConn iceConn;
 {
   /* Connection probably gone.  */
-  ice_fd = -1;
+  ice_connection_closed ();
 }
 
 /* This is called when the ICE connection is created or closed.  The SM library
@@ -371,7 +386,7 @@
 {
   if (! opening)
     {
-      ice_fd = -1;
+      ice_connection_closed ();
       return;
     }
 
@@ -384,6 +399,8 @@
   if (interrupt_input)
     init_sigio (ice_fd);
 #endif /* ! defined (SIGIO) */
+
+  add_keyboard_wait_descriptor (ice_fd);
 }
 
 /* Create the client leader window.  */
@@ -426,6 +443,9 @@
   SmcCallbacks callbacks;
   int  name_len = 0;
 
+  ice_fd = -1;
+  doing_interact = False;
+
   /* Check if we where started by the session manager.  If so, we will
      have a previous id.  */
   if (! EQ (Vx_session_previous_id, Qnil) && STRINGP (Vx_session_previous_id))
@@ -497,7 +517,7 @@
 void
 x_session_close ()
 {
-  ice_fd = -1;
+  ice_connection_closed ();
 }