changeset 110835:526c42ed21b1

merge emacs-23
author Kenichi Handa <handa@m17n.org>
date Sat, 02 Oct 2010 11:05:56 +0900
parents b997f43af473 (current diff) 5481007b7ce9 (diff)
children 093225094d08 394a9ff3e3cf
files
diffstat 4 files changed, 45 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/lib-src/ChangeLog	Sat Oct 02 10:44:50 2010 +0900
+++ b/lib-src/ChangeLog	Sat Oct 02 11:05:56 2010 +0900
@@ -1,3 +1,8 @@
+2010-10-01  Glenn Morris  <rgm@gnu.org>
+
+	* emacsclient.c (set_local_socket) [DARWIN_OS]: Try as a fall-back
+	DARWIN_USER_TEMP_DIR.  (Bug#3992)
+
 2010-05-07  Chong Yidong  <cyd@stupidchicken.com>
 
 	* Version 23.2 released.
--- a/lib-src/emacsclient.c	Sat Oct 02 10:44:50 2010 +0900
+++ b/lib-src/emacsclient.c	Sat Oct 02 11:05:56 2010 +0900
@@ -1249,7 +1249,18 @@
       {
 	tmpdir = egetenv ("TMPDIR");
 	if (!tmpdir)
-	  tmpdir = "/tmp";
+          {
+#ifdef DARWIN_OS
+            size_t n = confstr (_CS_DARWIN_USER_TEMP_DIR, NULL, (size_t) 0);
+            if (n > 0)
+              {
+                tmpdir = alloca (n);
+                confstr (_CS_DARWIN_USER_TEMP_DIR, tmpdir, n);
+              }
+            else
+#endif
+              tmpdir = "/tmp";
+          }
 	socket_name = alloca (strlen (tmpdir) + strlen (server_name)
 			      + EXTRA_SPACE);
 	sprintf (socket_name, "%s/emacs%d/%s",
--- a/lisp/ChangeLog	Sat Oct 02 10:44:50 2010 +0900
+++ b/lisp/ChangeLog	Sat Oct 02 11:05:56 2010 +0900
@@ -1,3 +1,8 @@
+2010-09-30  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+	* minibuffer.el (completion--replace):
+	Better preserve markers (bug#7138).
+
 2010-09-29  Juanma Barranquero  <lekktu@gmail.com>
 
 	* server.el (server-process-filter): Doc fix.
@@ -10,8 +15,8 @@
 
 	* Makefile.in (ELCFILES): Update.
 
-	* emacs-lisp/byte-opt.el (byte-optimize-form-code-walker): Avoid
-	infinite recursion on erroneous lambda form.  (Bug#7114)
+	* emacs-lisp/byte-opt.el (byte-optimize-form-code-walker):
+	Avoid infinite recursion on erroneous lambda form.  (Bug#7114)
 
 2010-09-27  Kenichi Handa  <handa@m17n.org>
 
--- a/lisp/minibuffer.el	Sat Oct 02 10:44:50 2010 +0900
+++ b/lisp/minibuffer.el	Sat Oct 02 11:05:56 2010 +0900
@@ -475,10 +475,30 @@
 (defun completion--replace (beg end newtext)
   "Replace the buffer text between BEG and END with NEWTEXT.
 Moves point to the end of the new text."
-  ;; This should be in subr.el.
+  ;; Maybe this should be in subr.el.
   ;; You'd think this is trivial to do, but details matter if you want
   ;; to keep markers "at the right place" and be robust in the face of
   ;; after-change-functions that may themselves modify the buffer.
+  (let ((prefix-len 0))
+    ;; Don't touch markers in the shared prefix (if any).
+    (while (and (< prefix-len (length newtext))
+                (< (+ beg prefix-len) end)
+                (eq (char-after (+ beg prefix-len))
+                    (aref newtext prefix-len)))
+      (setq prefix-len (1+ prefix-len)))
+    (unless (zerop prefix-len)
+      (setq beg (+ beg prefix-len))
+      (setq newtext (substring newtext prefix-len))))
+  (let ((suffix-len 0))
+    ;; Don't touch markers in the shared suffix (if any).
+    (while (and (< suffix-len (length newtext))
+                (< beg (- end suffix-len))
+                (eq (char-before (- end suffix-len))
+                    (aref newtext (- (length newtext) suffix-len 1))))
+      (setq suffix-len (1+ suffix-len)))
+    (unless (zerop suffix-len)
+      (setq end (- end suffix-len))
+      (setq newtext (substring newtext 0 (- suffix-len)))))
   (goto-char beg)
   (insert newtext)
   (delete-region (point) (+ (point) (- end beg))))