<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[127178] trunk/dports/aqua/emacs-app</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="https://trac.macports.org/changeset/127178">127178</a></dd>
<dt>Author</dt> <dd>hum@macports.org</dd>
<dt>Date</dt> <dd>2014-10-22 03:36:55 -0700 (Wed, 22 Oct 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>emacs-app: update to 24.4; delete obsolete patches and variants; update inline patch.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkdportsaquaemacsappPortfile">trunk/dports/aqua/emacs-app/Portfile</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkdportsaquaemacsappfilespatchinline24420140820diff">trunk/dports/aqua/emacs-app/files/patch-inline-24.4-20140820.diff</a></li>
</ul>

<h3>Removed Paths</h3>
<ul>
<li><a href="#trunkdportsaquaemacsappfilespatchmacemacsjpinlinediff">trunk/dports/aqua/emacs-app/files/patch-macemacsjp-inline.diff</a></li>
<li><a href="#trunkdportsaquaemacsappfilespatchmaverickshomediff">trunk/dports/aqua/emacs-app/files/patch-mavericks-home.diff</a></li>
<li><a href="#trunkdportsaquaemacsappfilespatchmavericksmemleakdiff">trunk/dports/aqua/emacs-app/files/patch-mavericks-memleak.diff</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkdportsaquaemacsappPortfile"></a>
<div class="modfile"><h4>Modified: trunk/dports/aqua/emacs-app/Portfile (127177 => 127178)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/dports/aqua/emacs-app/Portfile        2014-10-22 10:34:11 UTC (rev 127177)
+++ trunk/dports/aqua/emacs-app/Portfile        2014-10-22 10:36:55 UTC (rev 127178)
</span><span class="lines">@@ -4,8 +4,7 @@
</span><span class="cx"> PortSystem          1.0
</span><span class="cx"> 
</span><span class="cx"> name                emacs-app
</span><del>-version             24.3
-revision            5
</del><ins>+version             24.4
</ins><span class="cx"> categories          aqua editors
</span><span class="cx"> maintainers         hum css openmaintainer
</span><span class="cx"> 
</span><span class="lines">@@ -25,8 +24,8 @@
</span><span class="cx"> master_sites        gnu:emacs
</span><span class="cx"> distname            emacs-${version}
</span><span class="cx"> dist_subdir         emacs
</span><del>-checksums           rmd160  b67e847861002bbb76ae6588ff659408763313cf \
-                    sha256  0098ca3204813d69cd8412045ba33e8701fa2062f4bff56bedafc064979eef41
</del><ins>+checksums           rmd160  52bec18c5f8e4ee7ea3b765620c0f19d2ee524c9 \
+                    sha256  a93c4f1afa5ade65a0c9723975f0a5fdf6641cc4638fdafb3ed9942c23c32cc6
</ins><span class="cx"> 
</span><span class="cx"> conflicts           emacs-app-devel
</span><span class="cx"> 
</span><span class="lines">@@ -38,11 +37,6 @@
</span><span class="cx"> 
</span><span class="cx"> patchfiles          patch-src_emacs.c.diff
</span><span class="cx"> 
</span><del>-if {${os.platform} == &quot;darwin&quot; &amp;&amp; ${os.major} &gt;= 13} {
-    patchfiles-append patch-mavericks-home.diff \
-                      patch-mavericks-memleak.diff
-}

</del><span class="cx"> post-patch {
</span><span class="cx">     reinplace &quot;s|__PREFIX__|${prefix}|&quot; ${worksrcpath}/src/emacs.c
</span><span class="cx"> }
</span><span class="lines">@@ -62,25 +56,15 @@
</span><span class="cx">         ${destroot}${applications_dir}/Emacs.app/Contents/Resources/site-lisp/site-start.el
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-variant fullscreen description {Obsolete compatibility variant} {}
-
-variant oldfullscreen description {Obsolete compatibility variant} {}
-
-variant inline description {Apply inline patch from MacEmacsJP} {
-    # inline patch fetched from MacEmacsJP.
-    # patch-macemacsjp-inline.diff
-    # http://svn.sourceforge.jp/svnroot/macemacsjp/inline_patch/trunk/emacs-inline.patch
-    # revision 583 (2013/04/13) modified for emacs-24.3.
-    patchfiles-append   patch-macemacsjp-inline.diff
</del><ins>+variant inline description {Apply inline patch} {
+    # inline patch for 24.4
+    # http://plamo.linet.gr.jp/~matsuki/mac/emacs-24.4-20140820-inline.patch.bz2
+    patchfiles-append   patch-inline-24.4-20140820.diff
</ins><span class="cx">     # http://sakito.jp/emacs/emacs24.html
</span><span class="cx">     depends_build-append port:autoconf port:automake port:libtool
</span><span class="cx">     build.target        bootstrap
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-variant jpfont requires inline description {Obsolete compatibility variant} {}
-
-variant patches requires inline description {Obsolete compatibility variant} {}
-
</del><span class="cx"> default_variants    +inline
</span><span class="cx"> 
</span><span class="cx"> livecheck.type      regex
</span></span></pre></div>
<a id="trunkdportsaquaemacsappfilespatchinline24420140820diff"></a>
<div class="addfile"><h4>Added: trunk/dports/aqua/emacs-app/files/patch-inline-24.4-20140820.diff (0 => 127178)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/dports/aqua/emacs-app/files/patch-inline-24.4-20140820.diff                                (rev 0)
+++ trunk/dports/aqua/emacs-app/files/patch-inline-24.4-20140820.diff        2014-10-22 10:36:55 UTC (rev 127178)
</span><span class="lines">@@ -0,0 +1,1240 @@
</span><ins>+diff -rcN ../emacs-24.4-20140820.orig/configure.ac configure.ac
+*** ../emacs-24.4-20140820.orig/configure.ac        2014-08-20 00:08:02.000000000 +0900
+--- configure.ac        2014-08-20 19:13:44.000000000 +0900
+***************
+*** 1825,1831 ****
+       INSTALL_ARCH_INDEP_EXTRA=
+    fi
+  
+!   NS_OBJC_OBJ=&quot;nsterm.o nsfns.o nsmenu.o nsselect.o nsimage.o nsfont.o $macfont_file&quot;
+  fi
+  CFLAGS=&quot;$tmp_CFLAGS&quot;
+  CPPFLAGS=&quot;$tmp_CPPFLAGS&quot;
+--- 1825,1831 ----
+       INSTALL_ARCH_INDEP_EXTRA=
+    fi
+  
+!   NS_OBJC_OBJ=&quot;nsterm.o nsfns.o nsmenu.o nsselect.o nsimage.o nsfont.o macim.o $macfont_file&quot;
+  fi
+  CFLAGS=&quot;$tmp_CFLAGS&quot;
+  CPPFLAGS=&quot;$tmp_CPPFLAGS&quot;
+***************
+*** 4880,4886 ****
+     ## 0x690 is the total size of 30 segment load commands (at 56
+     ## each); under Cocoa 31 commands are required.
+     if test &quot;$HAVE_NS&quot; = &quot;yes&quot;; then
+!      libs_nsgui=&quot;-framework AppKit&quot;
+       if test &quot;$NS_IMPL_COCOA&quot; = &quot;yes&quot;; then
+          libs_nsgui=&quot;$libs_nsgui -framework IOKit&quot;
+       fi
+--- 4880,4886 ----
+     ## 0x690 is the total size of 30 segment load commands (at 56
+     ## each); under Cocoa 31 commands are required.
+     if test &quot;$HAVE_NS&quot; = &quot;yes&quot;; then
+!      libs_nsgui=&quot;-framework AppKit -framework Carbon -framework Cocoa&quot;
+       if test &quot;$NS_IMPL_COCOA&quot; = &quot;yes&quot;; then
+          libs_nsgui=&quot;$libs_nsgui -framework IOKit&quot;
+       fi
+diff -rcN ../emacs-24.4-20140820.orig/lisp/term/common-win.el lisp/term/common-win.el
+*** ../emacs-24.4-20140820.orig/lisp/term/common-win.el        2014-08-20 00:08:02.000000000 +0900
+--- lisp/term/common-win.el        2014-08-20 19:13:44.000000000 +0900
+***************
+*** 136,141 ****
+--- 136,142 ----
+                 (cons (logior (lsh 0 16)  12) 'ns-new-frame)
+                 (cons (logior (lsh 0 16)  13) 'ns-toggle-toolbar)
+                 (cons (logior (lsh 0 16)  14) 'ns-show-prefs)
++                (cons (logior (lsh 0 16)  15) 'mac-change-input-method)
+                 ))))
+      (set-terminal-parameter frame 'x-setup-function-keys t)))
+  
+diff -rcN ../emacs-24.4-20140820.orig/lisp/term/ns-win.el lisp/term/ns-win.el
+*** ../emacs-24.4-20140820.orig/lisp/term/ns-win.el        2014-08-20 00:08:02.000000000 +0900
+--- lisp/term/ns-win.el        2014-08-20 19:13:44.000000000 +0900
+***************
+*** 168,173 ****
+--- 168,174 ----
+  (define-key global-map [ns-new-frame] 'make-frame)
+  (define-key global-map [ns-toggle-toolbar] 'ns-toggle-toolbar)
+  (define-key global-map [ns-show-prefs] 'customize)
++ (define-key global-map [mac-change-input-method] 'mac-change-input-method)
+  
+  
+  ;; Set up a number of aliases and other layers to pretend we're using
+***************
+*** 253,266 ****
+  ;; editing window.)
+  
+  (defface ns-working-text-face
+!   '((t :underline t))
+    &quot;Face used to highlight working text during compose sequence insert.&quot;
+    :group 'ns)
+  
+  (defvar ns-working-overlay nil
+    &quot;Overlay used to highlight working text during compose sequence insert.
+  When text is in th echo area, this just stores the length of the working text.&quot;)
+  
+  (defvar ns-working-text)                 nsterm.m
+  
+  ;; Test if in echo area, based on mac-win.el 2007/08/26 unicode-2.
+--- 254,283 ----
+  ;; editing window.)
+  
+  (defface ns-working-text-face
+!   '((((background dark)) :underline &quot;gray80&quot;)
+!     (t :underline &quot;gray20&quot;))
+    &quot;Face used to highlight working text during compose sequence insert.&quot;
+    :group 'ns)
+  
++ (defface ns-marked-text-face
++   '((((background dark)) :underline &quot;gray80&quot;)
++     (t :underline &quot;gray20&quot;))
++   &quot;Face used to highlight marked text during compose sequence insert.&quot;
++   :group 'ns)
++ 
++ (defface ns-unmarked-text-face
++   '((((background dark)) :underline &quot;gray20&quot;)
++     (t :underline &quot;gray80&quot;))
++   &quot;Face used to highlight marked text during compose sequence insert.&quot;
++   :group 'ns)
++ 
+  (defvar ns-working-overlay nil
+    &quot;Overlay used to highlight working text during compose sequence insert.
+  When text is in th echo area, this just stores the length of the working text.&quot;)
+  
++ (defvar ns-marked-overlay nil
++   &quot;Overlay used to highlight marked text during compose sequence insert.&quot;)
++ 
+  (defvar ns-working-text)                 nsterm.m
+  
+  ;; Test if in echo area, based on mac-win.el 2007/08/26 unicode-2.
+***************
+*** 268,284 ****
+  (defun ns-in-echo-area ()
+    &quot;Whether, for purposes of inserting working composition text, the minibuffer
+  is currently being used.&quot;
+!   (or isearch-mode
+!       (and cursor-in-echo-area (current-message))
+!       ;; Overlay strings are not shown in some cases.
+!       (get-char-property (point) 'invisible)
+!       (and (not (bobp))
+!            (or (and (get-char-property (point) 'display)
+!                     (eq (get-char-property (1- (point)) 'display)
+!                         (get-char-property (point) 'display)))
+!                (and (get-char-property (point) 'composition)
+!                     (eq (get-char-property (1- (point)) 'composition)
+!                         (get-char-property (point) 'composition)))))))
+  
+  ;; The 'interactive' here stays for subinvocations, so the ns-in-echo-area
+  ;; always returns nil for some reason.  If this WASN'T the case, we could
+--- 285,303 ----
+  (defun ns-in-echo-area ()
+    &quot;Whether, for purposes of inserting working composition text, the minibuffer
+  is currently being used.&quot;
+!   (setq mac-in-echo-area 
+!         (or isearch-mode
+!             (and cursor-in-echo-area (current-message))
+!             ;; Overlay strings are not shown in some cases.
+!             (get-char-property (point) 'invisible)
+!             (and (not (bobp))
+!                  (or (and (get-char-property (point) 'display)
+!                           (eq (get-char-property (1- (point)) 'display)
+!                               (get-char-property (point) 'display)))
+!                      (and (get-char-property (point) 'composition)
+!                           (eq (get-char-property (1- (point)) 'composition)
+!                               (get-char-property (point) 'composition)))))))
+!   mac-in-echo-area)
+  
+  ;; The 'interactive' here stays for subinvocations, so the ns-in-echo-area
+  ;; always returns nil for some reason.  If this WASN'T the case, we could
+***************
+*** 287,292 ****
+--- 306,312 ----
+  (defun ns-put-working-text ()
+    (interactive)
+    (if (ns-in-echo-area) (ns-echo-working-text) (ns-insert-working-text)))
++ 
+  (defun ns-unput-working-text ()
+    (interactive)
+    (ns-delete-working-text))
+***************
+*** 308,326 ****
+  (defun ns-echo-working-text ()
+    &quot;Echo contents of `ns-working-text' in message display area.
+  See `ns-insert-working-text'.&quot;
+-   (ns-delete-working-text)
+    (let* ((msg (current-message))
+!          (msglen (length msg))
+!          message-log-max)
+      (setq ns-working-overlay (length ns-working-text))
+      (setq msg (concat msg ns-working-text))
+      (put-text-property msglen (+ msglen ns-working-overlay)
+!                        'face 'ns-working-text-face msg)
+      (message &quot;%s&quot; msg)))
+  
+  (defun ns-delete-working-text()
+!   &quot;Delete working text and clear `ns-working-overlay'.&quot;
+    (interactive)
+    (cond
+     ((and (overlayp ns-working-overlay)
+           ;; Still alive?
+--- 328,408 ----
+  (defun ns-echo-working-text ()
+    &quot;Echo contents of `ns-working-text' in message display area.
+  See `ns-insert-working-text'.&quot;
+    (let* ((msg (current-message))
+!          (msglen (length msg))
+!          message-log-max)
+!     (if (integerp ns-working-overlay)
+!         (progn
+!           (setq msg (substring msg 0 (- (length msg) ns-working-overlay)))
+!           (setq msglen (length msg))))
+      (setq ns-working-overlay (length ns-working-text))
+      (setq msg (concat msg ns-working-text))
+      (put-text-property msglen (+ msglen ns-working-overlay)
+!                         'face 'ns-working-text-face msg)
+!      (message &quot;%s&quot; msg)))
+! 
+! (defun ns-put-marked-text (event)
+!   (interactive &quot;e&quot;)
+! 
+!   (let ((pos (nth 1 event))
+!         (len (nth 2 event)))
+!     (if (ns-in-echo-area)
+!         (ns-echo-marked-text pos len)
+!       (ns-insert-marked-text pos len))))
+! 
+! (defun ns-insert-marked-text (pos len)
+!   &quot;Insert contents of `ns-working-text' as UTF-8 string and mark with
+! `ns-working-overlay' and `ns-marked-overlay'.  Any previously existing
+! working text is cleared first. The overlay is assigned the faces 
+! `ns-working-text-face' and `ns-marked-text-face'.&quot;
+!   (ns-delete-working-text)
+!   (let ((start (point)))
+!     (if (&lt;= pos (length ns-working-text))
+!       (progn
+!         (put-text-property pos len 'face 'ns-working-text-face ns-working-text)
+!         (insert ns-working-text)
+!         (if (= len 0)
+!             (overlay-put (setq ns-working-overlay
+!                                (make-overlay start (point) (current-buffer) nil t))
+!                          'face 'ns-working-text-face)
+!           (overlay-put (setq ns-working-overlay
+!                              (make-overlay start (point) (current-buffer) nil t))
+!                        'face 'ns-unmarked-text-face)
+!           (overlay-put (setq ns-marked-overlay 
+!                              (make-overlay (+ start pos) (+ start pos len)
+!                                            (current-buffer) nil t))
+!                        'face 'ns-marked-text-face))
+!         (goto-char (+ start pos))))))
+!     
+! (defun ns-echo-marked-text (pos len)
+!   &quot;Echo contents of `ns-working-text' in message display area.
+! See `ns-insert-working-text'.&quot;
+!   (let* ((msg (current-message))
+!          (msglen (length msg))
+!          message-log-max)
+!     (when (integerp ns-working-overlay)
+!       (setq msg (substring msg 0 (- (length msg) ns-working-overlay)))
+!       (setq msglen (length msg)))
+!     (setq ns-working-overlay (length ns-working-text))
+!     (setq msg (concat msg ns-working-text))
+!     (if (= len 0)
+!         (put-text-property msglen (+ msglen ns-working-overlay)
+!                            'face 'ns-working-text-face msg)
+!       (put-text-property msglen (+ msglen ns-working-overlay)
+!                          'face 'ns-unmarked-text-face msg)
+!       (put-text-property (+ msglen pos) (+ msglen pos len)
+!                          'face 'ns-marked-text-face msg))
+      (message &quot;%s&quot; msg)))
+  
+  (defun ns-delete-working-text()
+!   &quot;Delete working text and clear `ns-working-overlay' and `ns-marked-overlay'.&quot;
+    (interactive)
++   (when (and (overlayp ns-marked-overlay)
++              ;; Still alive
++              (overlay-buffer ns-marked-overlay))
++     (with-current-buffer (overlay-buffer ns-marked-overlay)
++       (delete-overlay ns-marked-overlay)))
++   (setq ns-marked-overlay nil)
+    (cond
+     ((and (overlayp ns-working-overlay)
+           ;; Still alive?
+***************
+*** 964,969 ****
+--- 1046,1511 ----
+  (add-to-list 'window-system-initialization-alist '(ns . ns-initialize-window-system))
+  
+  
++ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
++ ;;
++ ;; Implementation of Input Method Extension for MacOS X
++ ;; written by Taiichi Hashimoto &lt;taiichi2@mac.com&gt;
++ ;;
++ 
++ (defvar mac-input-method-parameters
++   '(
++     (&quot;com.apple.inputmethod.Kotoeri.Roman&quot;
++      (title . &quot;A&quot;)
++      (cursor-color)
++      (cursor-type))
++     (&quot;com.apple.inputmethod.Kotoeri.Japanese&quot;
++      (title . &quot;あ&quot;)
++      (cursor-color)
++      (cursor-type))
++     (&quot;com.apple.inputmethod.Kotoeri.Japanese.Katakana&quot;
++      (title . &quot;ア&quot;)
++      (cursor-color)
++      (cursor-type))
++     (&quot;com.apple.inputmethod.Kotoeri.Japanese.FullWidthRoman&quot;
++      (title . &quot;A&quot;)
++      (cursor-color)
++      (cursor-type))
++     (&quot;com.apple.inputmethod.Kotoeri.Japanese.HalfWidthKana&quot;
++      (title . &quot;ア&quot;)
++      (cursor-color)
++      (cursor-type))
++     (&quot;com.apple.inputmethod.kotoeri.Ainu&quot;
++      (title . &quot;アイヌ&quot;)
++      (cursor-color)
++      (cursor-type))
++     (&quot;com.apple.inputmethod.Korean.2SetKorean&quot;
++      (title . &quot;가2&quot;)
++      (cursor-color)
++      (cursor-type))
++     (&quot;com.apple.inputmethod.Korean.3SetKorean&quot;
++      (title . &quot;가3&quot;)
++      (cursor-color)
++      (cursor-type))
++     (&quot;com.apple.inputmethod.Korean.390Sebulshik&quot;
++      (title . &quot;가5&quot;)
++      (cursor-color)
++      (cursor-type))
++     (&quot;com.apple.inputmethod.Korean.GongjinCheongRomaja&quot;
++      (title . &quot;가G&quot;)
++      (cursor-color)
++      (cursor-type))
++     (&quot;com.apple.inputmethod.Korean.HNCRomaja&quot;
++      (title . &quot;가H&quot;)
++      (cursor-color)
++      (cursor-type))
++     (&quot;com.apple.inputmethod.Tamil.AnjalIM&quot;
++      (title . &quot;Anjal&quot;)
++      (cursor-color)
++      (cursor-type))
++     (&quot;com.apple.inputmethod.Tamil.Tamil99&quot;
++      (title . &quot;Tamil&quot;)
++      (cursor-color)
++      (cursor-type))
++     (&quot;com.apple.inputmethod.VietnameseIM.VietnameseSimpleTelex&quot;
++      (title . &quot;ST&quot;)
++      (cursor-color)
++      (cursor-type))
++     (&quot;com.apple.inputmethod.VietnameseIM.VietnameseTelex&quot;
++      (title . &quot;TX&quot;)
++      (cursor-color)
++      (cursor-type))
++     (&quot;com.apple.inputmethod.VietnameseIM.VietnameseVNI&quot;
++      (title . &quot;VN&quot;)
++      (cursor-color)
++      (cursor-type))
++     (&quot;com.apple.inputmethod.VietnameseIM.VietnameseVIQR&quot;
++      (title . &quot;VQ&quot;)
++      (cursor-color)
++      (cursor-type))
++     (&quot;com.apple.inputmethod.SCIM.ITABC&quot;
++      (title . &quot;拼&quot;)
++      (cursor-color)
++      (cursor-type))
++     (&quot;com.apple.inputmethod.SCIM.WBX&quot;
++      (title . &quot;型&quot;)
++      (cursor-color)
++      (cursor-type))
++     (&quot;com.apple.inputmethod.SCIM.WBH&quot;
++      (title . &quot;画&quot;)
++      (cursor-color)
++      (cursor-type))
++     (&quot;com.apple.inputmethod.TCIM.Zhuyin&quot;
++      (title . &quot;注&quot;)
++      (cursor-color)
++      (cursor-type))
++     (&quot;com.apple.inputmethod.TCIM.Pinyin&quot;
++      (title . &quot;拼&quot;)
++      (cursor-color)
++      (cursor-type))
++     (&quot;com.apple.inputmethod.TCIM.Cangjie&quot;
++      (title . &quot;倉&quot;)
++      (cursor-color)
++      (cursor-type))
++     (&quot;com.apple.inputmethod.TCIM.Jianyi&quot;
++      (title . &quot;速&quot;)
++      (cursor-color)
++      (cursor-type))
++     (&quot;com.apple.inputmethod.TCIM.Dayi&quot;
++      (title . &quot;易&quot;)
++      (cursor-color)
++      (cursor-type))
++     (&quot;com.apple.inputmethod.TCIM.Hanin&quot;
++      (title . &quot;漢&quot;)
++      (cursor-color)
++      (cursor-type))
++     (&quot;com.google.inputmethod.Japanese.Roman&quot;
++      (title . &quot;G&quot;)
++      (cursor-color)
++      (cursor-type))
++     (&quot;com.google.inputmethod.Japanese.base&quot;
++      (title . &quot;ぐ&quot;)
++      (cursor-color)
++      (cursor-type))
++     (&quot;com.google.inputmethod.Japanese.Katakana&quot;
++      (title . &quot;グ&quot;)
++      (cursor-color)
++      (cursor-type))
++     (&quot;com.google.inputmethod.Japanese.FullWidthRoman&quot;
++      (title . &quot;G&quot;)
++      (cursor-color)
++      (cursor-type))
++     (&quot;com.google.inputmethod.Japanese.HalfWidthKana&quot;
++      (title . &quot;グ&quot;)
++      (cursor-color)
++      (cursor-type))
++     (&quot;jp.monokakido.inputmethod.Kawasemi.Roman&quot;
++      (title . &quot;K&quot;)
++      (cursor-color)
++      (cursor-type))
++     (&quot;jp.monokakido.inputmethod.Kawasemi.Japanese&quot;
++      (title . &quot;か&quot;)
++      (cursor-color)
++      (cursor-type))
++     (&quot;jp.monokakido.inputmethod.Kawasemi.Japanese.Katakana&quot;
++      (title . &quot;カ&quot;)
++      (cursor-color)
++      (cursor-type))
++     (&quot;jp.monokakido.inputmethod.Kawasemi.Japanese.FullWidthRoman&quot;
++      (title . &quot;K&quot;)
++      (cursor-color)
++      (cursor-type))
++     (&quot;jp.monokakido.inputmethod.Kawasemi.Japanese.HalfWidthKana&quot;
++      (title . &quot;カ&quot;)
++      (cursor-color)
++      (cursor-type))
++     (&quot;jp.monokakido.inputmethod.Kawasemi.Japanese.HalfWidthRoman&quot;
++      (title . &quot;_K&quot;)
++      (cursor-color)
++      (cursor-type))
++     (&quot;jp.monokakido.inputmethod.Kawasemi.Japanese.Code&quot;
++      (title . &quot;C&quot;)
++      (cursor-color)
++      (cursor-type))
++     (&quot;com.justsystems.inputmethod.atok21.Roman&quot;
++      (title . &quot;A&quot;)
++      (cursor-color)
++      (cursor-type))
++     (&quot;com.justsystems.inputmethod.atok21.Japanese&quot;
++      (title . &quot;あ&quot;)
++      (cursor-color)
++      (cursor-type))
++     (&quot;com.justsystems.inputmethod.atok21.Japanese.Katakana&quot;
++      (title . &quot;ア&quot;)
++      (cursor-color)
++      (cursor-type))
++     (&quot;com.justsystems.inputmethod.atok21.Japanese.FullWidthRoman&quot;
++      (title . &quot;英&quot;)
++      (cursor-color)
++      (cursor-type))
++     (&quot;com.justsystems.inputmethod.atok21.Japanese.HalfWidthEiji&quot;
++      (title . &quot;半英&quot;)
++      (cursor-color)
++      (cursor-type))
++     (&quot;com.justsystems.inputmethod.atok22.Roman&quot;
++      (title . &quot;A&quot;)
++      (cursor-color)
++      (cursor-type))
++     (&quot;com.justsystems.inputmethod.atok22.Japanese&quot;
++      (title . &quot;あ&quot;)
++      (cursor-color)
++      (cursor-type))
++     (&quot;com.justsystems.inputmethod.atok22.Japanese.Katakana&quot;
++      (title . &quot;ア&quot;)
++      (cursor-color)
++      (cursor-type))
++     (&quot;com.justsystems.inputmethod.atok22.Japanese.FullWidthRoman&quot;
++      (title . &quot;英&quot;)
++      (cursor-color)
++      (cursor-type))
++     (&quot;com.justsystems.inputmethod.atok22.Japanese.HalfWidthEiji&quot;
++      (title . &quot;半英&quot;)
++      (cursor-color)
++      (cursor-type))
++     (&quot;com.justsystems.inputmethod.atok23.Roman&quot;
++      (title . &quot;A&quot;)
++      (cursor-color)
++      (cursor-type))
++     (&quot;com.justsystems.inputmethod.atok23.Japanese&quot;
++      (title . &quot;あ&quot;)
++      (cursor-color)
++      (cursor-type))
++     (&quot;com.justsystems.inputmethod.atok23.Japanese.Katakana&quot;
++      (title . &quot;ア&quot;)
++      (cursor-color)
++      (cursor-type))
++     (&quot;com.justsystems.inputmethod.atok23.Japanese.FullWidthRoman&quot;
++      (title . &quot;英&quot;)
++      (cursor-color)
++      (cursor-type))
++     (&quot;com.justsystems.inputmethod.atok23.Japanese.HalfWidthEiji&quot;
++      (title . &quot;半英&quot;)
++      (cursor-color)
++      (cursor-type))
++     (&quot;com.justsystems.inputmethod.atok24.Roman&quot;
++      (title . &quot;A&quot;)
++      (cursor-color)
++      (cursor-type))
++     (&quot;com.justsystems.inputmethod.atok24.Japanese&quot;
++      (title . &quot;あ&quot;)
++      (cursor-color)
++      (cursor-type))
++     (&quot;com.justsystems.inputmethod.atok24.Japanese.Katakana&quot;
++      (title . &quot;ア&quot;)
++      (cursor-color)
++      (cursor-type))
++     (&quot;com.justsystems.inputmethod.atok24.Japanese.FullWidthRoman&quot;
++      (title . &quot;英&quot;)
++      (cursor-color)
++      (cursor-type))
++     (&quot;com.justsystems.inputmethod.atok24.Japanese.HalfWidthEiji&quot;
++      (title . &quot;半英&quot;)
++      (cursor-color)
++      (cursor-type))
++     (&quot;com.justsystems.inputmethod.atok25.Roman&quot;
++      (title . &quot;A&quot;)
++      (cursor-color)
++      (cursor-type))
++     (&quot;com.justsystems.inputmethod.atok25.Japanese&quot;
++      (title . &quot;あ&quot;)
++      (cursor-color)
++      (cursor-type))
++     (&quot;com.justsystems.inputmethod.atok25.Japanese.Katakana&quot;
++      (title . &quot;ア&quot;)
++      (cursor-color)
++      (cursor-type))
++     (&quot;com.justsystems.inputmethod.atok25.Japanese.FullWidthRoman&quot;
++      (title . &quot;英&quot;)
++      (cursor-color)
++      (cursor-type))
++     (&quot;com.justsystems.inputmethod.atok25.Japanese.HalfWidthEiji&quot;
++      (title . &quot;半英&quot;)
++      (cursor-color)
++      (cursor-type))
++     )
++   &quot;Alist of Mac script code vs parameters for input method on MacOSX.&quot;)
++ 
++ 
++ (defun mac-get-input-method-parameter (is key)
++   &quot;Function to get a parameter of a input method.&quot;
++   (interactive)
++   (assq key (cdr (assoc is mac-input-method-parameters))))
++ 
++ (defun mac-get-input-method-title (&amp;optional input-source)
++   &quot;Return input method title of input source.
++    If input-source is nil, return one of current frame.&quot;
++   (if input-source
++       (cdr (mac-get-input-method-parameter input-source 'title))
++     current-input-method-title))
++ 
++ (defun mac-get-cursor-type (&amp;optional input-source)
++   &quot;Return cursor type of input source.
++    If input-source is nil, return one of current frame.&quot;
++   (if input-source
++       (or (cdr (mac-get-input-method-parameter input-source 'cursor-type))
++           (cdr (assq 'cursor-type default-frame-alist))
++           cursor-type)
++     (cdr (assq 'cursor-type (frame-parameters (selected-frame))))))
++ 
++ (defun mac-get-cursor-color (&amp;optional input-source)
++   &quot;Return cursor color of input source.
++    If input-source is nil, return one of current frame.&quot;
++   (if input-source
++       (or (cdr (mac-get-input-method-parameter input-source 'cursor-color))
++           (cdr (assq 'cursor-color default-frame-alist)))
++     (cdr (assq 'cursor-color (frame-parameters (selected-frame))))))
++ 
++ 
++ (defun mac-set-input-method-parameter (is key value)
++   &quot;Function to set a parameter of a input method.&quot;
++   (let* ((is-param (assoc is mac-input-method-parameters))
++          (param (assq key is-param)))
++     (if is-param
++         (if param
++             (setcdr param value)
++           (setcdr is-param (cons (cons key value) (cdr is-param))))
++       (setq mac-input-method-parameters
++             (cons (list is (cons key value))
++                   mac-input-method-parameters)))))
++ 
++ 
++ (defun mac-input-method-update (is)
++   &quot;Funtion to update parameters of a input method.&quot;
++   (interactive)
++ 
++   (let ((title (mac-get-input-method-title is))
++         (type (mac-get-cursor-type is))
++         (color (mac-get-cursor-color is)))
++     (if (and title (not (equal title (mac-get-input-method-title))))
++         (setq current-input-method-title title))
++     (if (and type (not (equal type (mac-get-cursor-type))))
++         (setq cursor-type type))
++     (if (and color (not (equal color (mac-get-cursor-color))))
++         (set-cursor-color color))
++     (force-mode-line-update)
++     (if isearch-mode (isearch-update))))
++ 
++ 
++ (defun mac-toggle-input-method (&amp;optional arg)
++   &quot;Function to toggle input method on MacOSX.&quot;
++   (interactive)
++   
++   (if arg
++       (progn
++         (make-local-variable 'input-method-function)
++         (setq inactivate-current-input-method-function 'mac-toggle-input-method)
++         (setq input-method-function nil)
++         (setq describe-current-input-method-function nil)
++         (mac-toggle-input-source t))
++     (kill-local-variable 'input-method-function)
++     (setq describe-current-input-method-function nil)
++     (mac-toggle-input-source nil)))
++ 
++ 
++ (defun mac-change-language-to-us ()
++   &quot;Function to change language to us.&quot;
++   (interactive)
++   (mac-toggle-input-method nil))
++ 
++ 
++ (defun mac-handle-input-method-change ()
++   &quot;Function run when a input method change.&quot;
++   (interactive)
++ 
++   (if (equal default-input-method &quot;MacOSX&quot;)
++       (let ((input-source (mac-get-current-input-source))
++           (ascii-capable (mac-input-source-is-ascii-capable)))
++         
++         (cond ((and (not current-input-method) (not ascii-capable))
++                (set-input-method &quot;MacOSX&quot;))
++               ((and (equal current-input-method &quot;MacOSX&quot;) ascii-capable)
++                (toggle-input-method nil)))
++         (mac-input-method-update input-source))))
++ 
++ ;;
++ ;; Emacs input method for input method on MacOSX.
++ ;;
++ (register-input-method &quot;MacOSX&quot; &quot;MacOSX&quot; 'mac-toggle-input-method
++                        &quot;Mac&quot; &quot;Input Method on MacOSX System&quot;)
++ 
++ 
++ ;;
++ ;; Minor mode of using input methods on MacOS X
++ ;;
++ (define-minor-mode mac-input-method-mode
++   &quot;Use input methods on MacOSX.&quot;
++   :init-value nil
++   :group 'ns
++   :global t
++ 
++   (if mac-input-method-mode
++       (progn
++         (setq default-input-method &quot;MacOSX&quot;)
++         (add-hook 'minibuffer-setup-hook 'mac-change-language-to-us)
++         (mac-translate-from-yen-to-backslash))
++     (setq default-input-method nil)))
++ 
++ ;;
++ ;; Valiable and functions to pass key(shortcut) to system.
++ ;;
++ (defvar mac-keys-passed-to-system nil
++   &quot;A list of keys passed to system on MacOSX.&quot;)
++ 
++ (defun mac-add-key-passed-to-system (key)
++   (let ((shift   '(shift shft))
++         (control '(control ctrl ctl))
++         (option  '(option opt alternate alt))
++         (command '(command cmd)))
++ 
++     (add-to-list 'mac-keys-passed-to-system
++                  (cond ((symbolp key)
++                         (cond ((memq key shift)
++                                (cons ns-shift-key-mask nil))
++                               ((memq key control)
++                                (cons ns-control-key-mask nil))
++                               ((memq key option)
++                                (cons ns-alternate-key-mask nil))
++                               ((memq key command)
++                                (cons ns-command-key-mask nil))
++                               (t (cons nil nil))))
++                        ((numberp key) (cons 0 key))
++                        ((listp key)
++                         (let ((l key) (k nil) (m 0))
++                           (while l
++                             (cond ((memq (car l) shift)
++                                    (setq m (logior m ns-shift-key-mask)))
++                                   ((memq (car l) control)
++                                    (setq m (logior m ns-control-key-mask)))
++                                   ((memq (car l) option)
++                                    (setq m (logior m ns-alternate-key-mask)))
++                                   ((memq (car l) command)
++                                        (setq m (logior m ns-command-key-mask)))
++                                   ((numberp (car l))
++                                    (if (not k) (setq k (car l)))))
++                             (setq l (cdr l)))
++                           (cons m k)))
++                        (t (cons nil nil))))))
++ 
++ 
++ ;;
++ ;; Entry Emacs event for inline input method on MacOSX.
++ ;;
++ (define-key special-event-map
++   [mac-change-input-method] 'mac-handle-input-method-change)
++       
++ ;;
++ ;; Convert yen to backslash for JIS keyboard.
++ ;;
++ (defun mac-translate-from-yen-to-backslash () 
++   ;; Convert yen to backslash for JIS keyboard.
++   (interactive)
++ 
++   (define-key global-map [165] nil)
++   (define-key global-map [2213] nil)
++   (define-key global-map [3420] nil)
++   (define-key global-map [67109029] nil)
++   (define-key global-map [67111077] nil)
++   (define-key global-map [8388773] nil)
++   (define-key global-map [134219941] nil)
++   (define-key global-map [75497596] nil)
++   (define-key global-map [201328805] nil)
++   (define-key function-key-map [165] [?\\])
++   (define-key function-key-map [2213] [?\\]) ;; for Intel
++   (define-key function-key-map [3420] [?\\]) ;; for PowerPC
++   (define-key function-key-map [67109029] [?\C-\\])
++   (define-key function-key-map [67111077] [?\C-\\])
++   (define-key function-key-map [8388773] [?\M-\\])
++   (define-key function-key-map [134219941] [?\M-\\])
++   (define-key function-key-map [75497596] [?\C-\M-\\])
++   (define-key function-key-map [201328805] [?\C-\M-\\])
++ )
++ 
++ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
++ 
+  (provide 'ns-win)
+  
+  ;;; ns-win.el ends here
+diff -rcN ../emacs-24.4-20140820.orig/src/Makefile.in src/Makefile.in
+*** ../emacs-24.4-20140820.orig/src/Makefile.in        2014-08-20 00:08:02.000000000 +0900
+--- src/Makefile.in        2014-08-20 19:13:44.000000000 +0900
+***************
+*** 366,373 ****
+  SOME_MACHINE_OBJECTS = dosfns.o msdos.o \
+    xterm.o xfns.o xmenu.o xselect.o xrdb.o xsmfns.o fringe.o image.o \
+    fontset.o dbusbind.o cygw32.o \
+!   nsterm.o nsfns.o nsmenu.o nsselect.o nsimage.o nsfont.o macfont.o \
+!   w32.o w32console.o w32fns.o w32heap.o w32inevt.o w32notify.o \
+    w32menu.o w32proc.o w32reg.o w32select.o w32term.o w32xfns.o \
+    w16select.o widget.o xfont.o ftfont.o xftfont.o ftxfont.o gtkutil.o \
+    xsettings.o xgselect.o termcap.o
+--- 366,373 ----
+  SOME_MACHINE_OBJECTS = dosfns.o msdos.o \
+    xterm.o xfns.o xmenu.o xselect.o xrdb.o xsmfns.o fringe.o image.o \
+    fontset.o dbusbind.o cygw32.o \
+!   nsterm.o nsfns.o nsmenu.o nsselect.o nsimage.o nsfont.o macfont.o macim.o \
+!   w32.o w32console.o w32fns.o w32heap.o w32inevt.o \
+    w32menu.o w32proc.o w32reg.o w32select.o w32term.o w32xfns.o \
+    w16select.o widget.o xfont.o ftfont.o xftfont.o ftxfont.o gtkutil.o \
+    xsettings.o xgselect.o termcap.o
+diff -rcN ../emacs-24.4-20140820.orig/src/keyboard.c src/keyboard.c
+*** ../emacs-24.4-20140820.orig/src/keyboard.c        2014-08-20 00:08:02.000000000 +0900
+--- src/keyboard.c        2014-08-20 19:13:44.000000000 +0900
+***************
+*** 3965,3972 ****
+          {
+            if (event-&gt;code == KEY_NS_PUT_WORKING_TEXT)
+              obj = list1 (intern (&quot;ns-put-working-text&quot;));
+!           else
+              obj = list1 (intern (&quot;ns-unput-working-text&quot;));
+            kbd_fetch_ptr = event + 1;
+            if (used_mouse_menu)
+              *used_mouse_menu = 1;
+--- 3965,3974 ----
+          {
+            if (event-&gt;code == KEY_NS_PUT_WORKING_TEXT)
+              obj = list1 (intern (&quot;ns-put-working-text&quot;));
+!           else if (event-&gt;code == KEY_NS_UNPUT_WORKING_TEXT)
+              obj = list1 (intern (&quot;ns-unput-working-text&quot;));
++           else if (event-&gt;code == KEY_NS_PUT_MARKED_TEXT)
++             obj = Fcons (intern (&quot;ns-put-marked-text&quot;), event-&gt;arg);
+            kbd_fetch_ptr = event + 1;
+            if (used_mouse_menu)
+              *used_mouse_menu = 1;
+***************
+*** 11753,11758 ****
+--- 11755,11762 ----
+                              &quot;ns-put-working-text&quot;);
+    initial_define_lispy_key (Vspecial_event_map, &quot;ns-unput-working-text&quot;,
+                              &quot;ns-unput-working-text&quot;);
++   initial_define_lispy_key (Vspecial_event_map, &quot;ns-put-marked-text&quot;,
++                             &quot;ns-put-marked-text&quot;);
+    /* Here we used to use `ignore-event' which would simple set prefix-arg to
+       current-prefix-arg, as is done in `handle-switch-frame'.
+       But `handle-switch-frame is not run from the special-map.
+diff -rcN ../emacs-24.4-20140820.orig/src/macim.m src/macim.m
+*** ../emacs-24.4-20140820.orig/src/macim.m        1970-01-01 09:00:00.000000000 +0900
+--- src/macim.m        2014-08-20 19:13:44.000000000 +0900
+***************
+*** 0 ****
+--- 1,173 ----
++ /* Implementation of Input Method Extension for MacOS X.
++    Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
++    Taiichi Hashimoto &lt;taiichi2@mac.com&gt;.
++ */
++ 
++ #include &quot;config.h&quot;
++ 
++ #ifdef NS_IMPL_COCOA
++ 
++ #include &lt;math.h&gt;
++ #include &lt;sys/types.h&gt;
++ #include &lt;time.h&gt;
++ #include &lt;signal.h&gt;
++ #include &lt;unistd.h&gt;
++ 
++ #include &lt;Carbon/Carbon.h&gt;
++ 
++ #include &quot;lisp.h&quot;
++ #include &quot;blockinput.h&quot;
++ 
++ #include &quot;termhooks.h&quot;
++ #include &quot;keyboard.h&quot;
++ #include &quot;buffer.h&quot;
++ 
++ //extern Lisp_Object Qcurrent_input_method;
++ //extern int cursor_in_echo_area;
++ static Lisp_Object Qmac_keys_passed_to_system;
++ 
++ void mac_init_input_method ();
++ int mac_pass_key_to_system (int code, int modifiers);
++ int mac_pass_key_directly_to_emacs ();
++ int mac_store_change_input_method_event ();
++ 
++ DEFUN (&quot;mac-input-source-is-ascii-capable&quot;, Fmac_input_source_is_ascii_capable, Smac_input_source_is_ascii_capable,
++        0, 0, 0,
++        doc: /* Is current input source ascii capable? */)
++      (void)
++ {
++   TISInputSourceRef is = TISCopyCurrentKeyboardInputSource();
++   CFBooleanRef ret = TISGetInputSourceProperty(is, kTISPropertyInputSourceIsASCIICapable);
++   
++   return CFBooleanGetValue(ret)? Qt : Qnil;
++ }
++ 
++ DEFUN (&quot;mac-get-input-source-list&quot;, Fmac_get_input_source_list, Smac_get_input_source_list,
++        0, 0, 0,
++        doc: /* get input source list on MacOSX */)
++      (void)
++ {
++   NSArray *is_list = (NSArray *)TISCreateInputSourceList(NULL, false);
++   int list_size = [is_list count];
++   Lisp_Object list[list_size];
++   int i;
++ 
++   for (i = 0; i &lt; list_size; i++) {
++     TISInputSourceRef is = (TISInputSourceRef)[is_list objectAtIndex:i];
++     NSString *id = (NSString *)TISGetInputSourceProperty(is, kTISPropertyInputSourceID);
++     list[i] = make_string([id UTF8String],
++                           [id lengthOfBytesUsingEncoding:NSUTF8StringEncoding]);
++   }
++ 
++   return Flist(list_size, list);
++ }
++ 
++ DEFUN (&quot;mac-get-current-input-source&quot;, Fmac_get_current_input_source, Smac_get_current_input_source,
++        0, 0, 0,
++        doc: /* get current input source on MacOSX */)
++      (void)
++ {
++   TISInputSourceRef is = TISCopyCurrentKeyboardInputSource();
++   NSString *id = (NSString *)TISGetInputSourceProperty(is, kTISPropertyInputSourceID);
++ 
++   return make_string([id UTF8String],
++                      [id lengthOfBytesUsingEncoding:NSUTF8StringEncoding]);
++ }
++ 
++ DEFUN (&quot;mac-toggle-input-source&quot;, Fmac_toggle_input_source, Smac_toggle_input_source,
++        1, 1, 0,
++        doc: /* toggle input source on MacOSX */)
++      (arg)
++      Lisp_Object arg;
++ {
++   TISInputSourceRef is = NULL;
++ 
++   if (NILP (arg))
++     {
++       is = TISCopyCurrentASCIICapableKeyboardInputSource();
++     }
++   else
++     {
++       NSString *locale;
++       NSArray *languages = [NSLocale preferredLanguages];
++       if (languages != nil) {
++           locale = [languages objectAtIndex:0];
++       } else {
++           locale = [[NSLocale currentLocale]
++                           objectForKey:NSLocaleLanguageCode];
++       }
++       is = TISCopyInputSourceForLanguage((CFStringRef)locale);
++     }
++   if (is) TISSelectInputSource(is);
++ 
++   return arg;
++ }
++ 
++ int
++ mac_store_change_input_method_event ()
++ {
++   Lisp_Object dim;
++   int ret = FALSE;
++   
++   dim = Fsymbol_value (intern (&quot;default-input-method&quot;));
++   if (STRINGP (dim) &amp;&amp; strcmp(SDATA (dim), &quot;MacOSX&quot;) == 0)
++     {
++       ret = TRUE;
++     }
++ 
++   return ret;
++ }
++ 
++ int
++ mac_pass_key_to_system (int code, int modifiers)
++ {
++   Lisp_Object keys = Fsymbol_value (Qmac_keys_passed_to_system);
++   Lisp_Object m, k; 
++ 
++   while (!NILP (keys))
++     {
++       m = XCAR (XCAR (keys));
++       k = XCDR (XCAR (keys));
++       keys = XCDR (keys);
++ 
++       if (NUMBERP (m) &amp;&amp; modifiers == XINT (m))
++         if (NILP (k)
++             || (NUMBERP (k) &amp;&amp; code == XINT (k)))
++           return TRUE;
++     }
++   
++   return FALSE;
++ }
++ 
++ int
++ mac_pass_key_directly_to_emacs (void)
++ {
++ 
++   if (NILP (Fmac_input_source_is_ascii_capable()))
++     {
++       if (NILP (Vmac_use_input_method_on_system)
++           || this_command_key_count 
++           || cursor_in_echo_area 
++           || !NILP (BVAR (current_buffer, read_only)))
++         return TRUE;
++     }
++ 
++   return FALSE;
++ }
++ 
++ 
++ void mac_init_input_method (void)
++ {
++   Qmac_keys_passed_to_system = intern (&quot;mac-keys-passed-to-system&quot;);
++   staticpro (&amp;Qmac_keys_passed_to_system);
++ 
++   DEFVAR_LISP (&quot;mac-use-input-method-on-system&quot;, Vmac_use_input_method_on_system,
++                doc: /* If it is non-nil, use input method on system. */);
++   Vmac_use_input_method_on_system = Qt;
++ 
++   defsubr (&amp;Smac_input_source_is_ascii_capable);
++   defsubr (&amp;Smac_get_input_source_list);
++   defsubr (&amp;Smac_get_current_input_source);
++   defsubr (&amp;Smac_toggle_input_source);
++ }
++ #endif
+diff -rcN ../emacs-24.4-20140820.orig/src/nsfns.m src/nsfns.m
+*** ../emacs-24.4-20140820.orig/src/nsfns.m        2014-08-20 00:08:02.000000000 +0900
+--- src/nsfns.m        2014-08-20 19:13:44.000000000 +0900
+***************
+*** 546,552 ****
+    ns_set_name_internal (f, name);
+  }
+  
+- 
+  void
+  ns_set_name_as_filename (struct frame *f)
+  {
+--- 546,551 ----
+***************
+*** 2987,2992 ****
+--- 2986,3009 ----
+                 doc: /* Toolkit version for NS Windowing.  */);
+    Vns_version_string = ns_appkit_version_str ();
+  
++ 
++   DEFVAR_LISP (&quot;ns-shift-key-mask&quot;, Vns_shift_key_mask,
++                doc: /* Shift key mask defined in system. */);
++   Vns_shift_key_mask = make_number (NSShiftKeyMask);
++ 
++   DEFVAR_LISP (&quot;ns-control-key-mask&quot;, Vns_control_key_mask,
++                doc: /* Control key mask defined in system. */);
++   Vns_control_key_mask = make_number (NSControlKeyMask);
++ 
++   DEFVAR_LISP (&quot;ns-alternate-key-mask&quot;, Vns_alternate_key_mask,
++                doc: /* Alternate key mask defined in system. */);
++   Vns_alternate_key_mask = make_number (NSAlternateKeyMask);
++ 
++   DEFVAR_LISP (&quot;ns-command-key-mask&quot;, Vns_command_key_mask,
++                doc: /* Command key mask defined in system. */);
++   Vns_command_key_mask = make_number (NSCommandKeyMask);
++ 
++ 
+    defsubr (&amp;Sns_read_file_name);
+    defsubr (&amp;Sns_get_resource);
+    defsubr (&amp;Sns_set_resource);
+***************
+*** 3030,3035 ****
+--- 3047,3056 ----
+    defsubr (&amp;Sx_show_tip);
+    defsubr (&amp;Sx_hide_tip);
+  
++ #ifdef NS_IMPL_COCOA
++   mac_init_input_method ();
++ #endif
++ 
+    as_status = 0;
+    as_script = Qnil;
+    as_result = 0;
+diff -rcN ../emacs-24.4-20140820.orig/src/nsterm.h src/nsterm.h
+*** ../emacs-24.4-20140820.orig/src/nsterm.h        2014-08-20 00:08:02.000000000 +0900
+--- src/nsterm.h        2014-08-20 19:13:44.000000000 +0900
+***************
+*** 482,487 ****
+--- 482,489 ----
+  #define KEY_NS_NEW_FRAME               ((1&lt;&lt;28)|(0&lt;&lt;16)|12)
+  #define KEY_NS_TOGGLE_TOOLBAR          ((1&lt;&lt;28)|(0&lt;&lt;16)|13)
+  #define KEY_NS_SHOW_PREFS              ((1&lt;&lt;28)|(0&lt;&lt;16)|14)
++ #define KEY_MAC_CHANGE_INPUT_METHOD    ((1&lt;&lt;28)|(0&lt;&lt;16)|15)
++ #define KEY_NS_PUT_MARKED_TEXT         ((1&lt;&lt;28)|(0&lt;&lt;16)|16)
+  
+  /* could use list to store these, but rest of emacs has a big infrastructure
+     for managing a table of bitmap &quot;records&quot; */
+diff -rcN ../emacs-24.4-20140820.orig/src/nsterm.m src/nsterm.m
+*** ../emacs-24.4-20140820.orig/src/nsterm.m        2014-08-20 00:08:02.000000000 +0900
+--- src/nsterm.m        2014-08-20 19:13:44.000000000 +0900
+***************
+*** 4262,4267 ****
+--- 4262,4270 ----
+    /*   [[NSNotificationCenter defaultCenter] addObserver: NSApp
+                                           selector: @selector (logNotification:)
+                                               name: nil object: nil]; */
++   [[NSDistributedNotificationCenter defaultCenter] addObserver: NSApp
++                                         selector: @selector (changeInputMethod:)
++                                                    name: @&quot;AppleSelectedInputSourcesChangedNotification&quot; object: nil];
+  
+    dpyinfo = xzalloc (sizeof *dpyinfo);
+  
+***************
+*** 4539,4544 ****
+--- 4542,4562 ----
+      NSLog (@&quot;notification: '%@'&quot;, [notification name]);
+  }
+  
++ - (void)changeInputMethod: (NSNotification *)notification
++ {
++ 
++   struct frame *emacsframe = SELECTED_FRAME ();
++ 
++   if (mac_store_change_input_method_event())
++     {
++       if (!emacs_event)
++         return;
++       emacs_event-&gt;kind = NS_NONKEY_EVENT;
++       emacs_event-&gt;code = KEY_MAC_CHANGE_INPUT_METHOD;
++       emacs_event-&gt;modifiers = 0;
++       EV_TRAILER ((id)nil);
++     }
++ }
+  
+  - (void)sendEvent: (NSEvent *)theEvent
+  /* --------------------------------------------------------------------------
+***************
+*** 5315,5321 ****
+               code, fnKeysym, flags, emacs_event-&gt;modifiers);
+  
+        /* if it was a function key or had modifiers, pass it directly to emacs */
+!       if (fnKeysym || (emacs_event-&gt;modifiers
+                         &amp;&amp; (emacs_event-&gt;modifiers != shift_modifier)
+                         &amp;&amp; [[theEvent charactersIgnoringModifiers] length] &gt; 0))
+  /*[[theEvent characters] length] */
+--- 5333,5340 ----
+               code, fnKeysym, flags, emacs_event-&gt;modifiers);
+  
+        /* if it was a function key or had modifiers, pass it directly to emacs */
+!       if (mac_pass_key_directly_to_emacs ()
+!           ||fnKeysym || (emacs_event-&gt;modifiers
+                         &amp;&amp; (emacs_event-&gt;modifiers != shift_modifier)
+                         &amp;&amp; [[theEvent charactersIgnoringModifiers] length] &gt; 0))
+  /*[[theEvent characters] length] */
+***************
+*** 5330,5338 ****
+                ? MULTIBYTE_CHAR_KEYSTROKE_EVENT : ASCII_KEYSTROKE_EVENT;
+  
+            emacs_event-&gt;code = code;
+!           EV_TRAILER (theEvent);
+!           processingCompose = NO;
+!           return;
+          }
+      }
+  
+--- 5349,5367 ----
+                ? MULTIBYTE_CHAR_KEYSTROKE_EVENT : ASCII_KEYSTROKE_EVENT;
+  
+            emacs_event-&gt;code = code;
+!           /* The function mac_pass_key_to_system decides 
+!              whether it is passed directly to emacs or not. */
+!           if (emacs_event-&gt;kind == NON_ASCII_KEYSTROKE_EVENT
+!               || !mac_pass_key_to_system (code, flags
+!                                           &amp; (NSShiftKeyMask
+!                                              | NSControlKeyMask
+!                                              | NSAlternateKeyMask
+!                                              | NSCommandKeyMask)))
+!             {
+!               EV_TRAILER (theEvent);
+!               processingCompose = NO;
+!               return;
+!             }
+          }
+      }
+  
+***************
+*** 5432,5441 ****
+             (unsigned long)selRange.length,
+             (unsigned long)selRange.location);
+  
+-   if (workingText != nil)
+-     [self deleteWorkingText];
+    if ([str length] == 0)
+!     return;
+  
+    if (!emacs_event)
+      return;
+--- 5461,5479 ----
+             (unsigned long)selRange.length,
+             (unsigned long)selRange.location);
+  
+    if ([str length] == 0)
+!     {
+!       [self deleteWorkingText];
+!       return;
+!     }
+!   else
+!     {
+!       if (workingText != nil) {
+!         [workingText release];
+!         workingText = nil;
+!         processingCompose = NO;
+!       }
+!     }
+  
+    if (!emacs_event)
+      return;
+***************
+*** 5445,5451 ****
+    ns_working_text = build_string ([workingText UTF8String]);
+  
+    emacs_event-&gt;kind = NS_TEXT_EVENT;
+!   emacs_event-&gt;code = KEY_NS_PUT_WORKING_TEXT;
+    EV_TRAILER ((id)nil);
+  }
+  
+--- 5483,5491 ----
+    ns_working_text = build_string ([workingText UTF8String]);
+  
+    emacs_event-&gt;kind = NS_TEXT_EVENT;
+!   emacs_event-&gt;code = KEY_NS_PUT_MARKED_TEXT;
+!   emacs_event-&gt;arg = Fcons (make_number (selRange.location),
+!                             Fcons (make_number (selRange.length), Qnil));
+    EV_TRAILER ((id)nil);
+  }
+  
+***************
+*** 5500,5514 ****
+  {
+    NSRect rect;
+    NSPoint pt;
+!   struct window *win = XWINDOW (FRAME_SELECTED_WINDOW (emacsframe));
+    if (NS_KEYLOG)
+      NSLog (@&quot;firstRectForCharRange request&quot;);
+  
+    rect.size.width = theRange.length * FRAME_COLUMN_WIDTH (emacsframe);
+    rect.size.height = FRAME_LINE_HEIGHT (emacsframe);
+    pt.x = WINDOW_TEXT_TO_FRAME_PIXEL_X (win, win-&gt;phys_cursor.x);
+    pt.y = WINDOW_TO_FRAME_PIXEL_Y (win, win-&gt;phys_cursor.y
+!                                        +FRAME_LINE_HEIGHT (emacsframe));
+  
+    pt = [self convertPoint: pt toView: nil];
+    pt = [[self window] convertBaseToScreen: pt];
+--- 5540,5562 ----
+  {
+    NSRect rect;
+    NSPoint pt;
+!   //  struct window *win = XWINDOW (FRAME_SELECTED_WINDOW (emacsframe));
+!   struct window *win;
+    if (NS_KEYLOG)
+      NSLog (@&quot;firstRectForCharRange request&quot;);
++     
++   if (NILP (Vmac_in_echo_area))
++     win = XWINDOW (FRAME_SELECTED_WINDOW (emacsframe));
++     else if (WINDOWP (echo_area_window))
++     win = XWINDOW (echo_area_window);
++   else
++     win = XWINDOW (FRAME_SELECTED_WINDOW (emacsframe));
+  
+    rect.size.width = theRange.length * FRAME_COLUMN_WIDTH (emacsframe);
+    rect.size.height = FRAME_LINE_HEIGHT (emacsframe);
+    pt.x = WINDOW_TEXT_TO_FRAME_PIXEL_X (win, win-&gt;phys_cursor.x);
+    pt.y = WINDOW_TO_FRAME_PIXEL_Y (win, win-&gt;phys_cursor.y
+!                                        +FRAME_LINE_HEIGHT (emacsframe)+2);
+  
+    pt = [self convertPoint: pt toView: nil];
+    pt = [[self window] convertBaseToScreen: pt];
+***************
+*** 7783,7788 ****
+--- 7831,7840 ----
+  baseline level.  The default value is nil.  */);
+    x_underline_at_descent_line = 0;
+  
++   DEFVAR_LISP (&quot;mac-in-echo-area&quot;, Vmac_in_echo_area,
++                doc: /* state of cursor in echo area. */);
++   Vmac_in_echo_area = Qnil;
++ 
+    /* Tell Emacs about this window system.  */
+    Fprovide (Qns, Qnil);
+  
+diff -rcN ../emacs-24.4-20140820.orig/src/termhooks.h src/termhooks.h
+*** ../emacs-24.4-20140820.orig/src/termhooks.h        2014-08-20 00:08:02.000000000 +0900
+--- src/termhooks.h        2014-08-20 19:13:44.000000000 +0900
+***************
+*** 56,61 ****
+--- 56,62 ----
+    output_x_window,
+    output_msdos_raw,
+    output_w32,
++   output_mac,
+    output_ns
+  };
+  
</ins></span></pre></div>
<a id="trunkdportsaquaemacsappfilespatchmacemacsjpinlinediff"></a>
<div class="delfile"><h4>Deleted: trunk/dports/aqua/emacs-app/files/patch-macemacsjp-inline.diff (127177 => 127178)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/dports/aqua/emacs-app/files/patch-macemacsjp-inline.diff        2014-10-22 10:34:11 UTC (rev 127177)
+++ trunk/dports/aqua/emacs-app/files/patch-macemacsjp-inline.diff        2014-10-22 10:36:55 UTC (rev 127178)
</span><span class="lines">@@ -1,1269 +0,0 @@
</span><del>-diff -r -N -p -x '*.elc' ../emacs-24.3.org/lisp/term/common-win.el lisp/term/common-win.el
-*** ../emacs-24.3.org/lisp/term/common-win.el        2013-01-02 05:37:17.000000000 +0900
---- lisp/term/common-win.el        2013-04-13 21:49:53.000000000 +0900
-*************** is not used).&quot;
-*** 127,132 ****
---- 127,133 ----
-                 (cons (logior (lsh 0 16)  12) 'ns-new-frame)
-                 (cons (logior (lsh 0 16)  13) 'ns-toggle-toolbar)
-                 (cons (logior (lsh 0 16)  14) 'ns-show-prefs)
-+                (cons (logior (lsh 0 16)  15) 'mac-change-input-method)
-                 ))))
-      (set-terminal-parameter frame 'x-setup-function-keys t)))
-  
-diff -r -N -p -x '*.elc' ../emacs-24.3.org/lisp/term/ns-win.el lisp/term/ns-win.el
-*** ../emacs-24.3.org/lisp/term/ns-win.el        2013-01-02 05:37:17.000000000 +0900
---- lisp/term/ns-win.el        2013-04-13 21:50:48.000000000 +0900
-*************** The properties returned may include `top
-*** 171,176 ****
---- 171,177 ----
-  (define-key global-map [ns-new-frame] 'make-frame)
-  (define-key global-map [ns-toggle-toolbar] 'ns-toggle-toolbar)
-  (define-key global-map [ns-show-prefs] 'customize)
-+ (define-key global-map [mac-change-input-method] 'mac-change-input-method)
-  
-  
-  ;; Set up a number of aliases and other layers to pretend we're using
-*************** The properties returned may include `top
-*** 256,269 ****
-  ;; editing window.)
-  
-  (defface ns-working-text-face
-!   '((t :underline t))
-    &quot;Face used to highlight working text during compose sequence insert.&quot;
-    :group 'ns)
-  
-  (defvar ns-working-overlay nil
-    &quot;Overlay used to highlight working text during compose sequence insert.
-  When text is in th echo area, this just stores the length of the working text.&quot;)
-  
-  (defvar ns-working-text)                 nsterm.m
-  
-  ;; Test if in echo area, based on mac-win.el 2007/08/26 unicode-2.
---- 257,286 ----
-  ;; editing window.)
-  
-  (defface ns-working-text-face
-!   '((((background dark)) :underline &quot;gray80&quot;)
-!     (t :underline &quot;gray20&quot;))
-    &quot;Face used to highlight working text during compose sequence insert.&quot;
-    :group 'ns)
-  
-+ (defface ns-marked-text-face
-+   '((((background dark)) :underline &quot;gray80&quot;)
-+     (t :underline &quot;gray20&quot;))
-+   &quot;Face used to highlight marked text during compose sequence insert.&quot;
-+   :group 'ns)
-+ 
-+ (defface ns-unmarked-text-face
-+   '((((background dark)) :underline &quot;gray20&quot;)
-+     (t :underline &quot;gray80&quot;))
-+   &quot;Face used to highlight marked text during compose sequence insert.&quot;
-+   :group 'ns)
-+ 
-  (defvar ns-working-overlay nil
-    &quot;Overlay used to highlight working text during compose sequence insert.
-  When text is in th echo area, this just stores the length of the working text.&quot;)
-  
-+ (defvar ns-marked-overlay nil
-+   &quot;Overlay used to highlight marked text during compose sequence insert.&quot;)
-+ 
-  (defvar ns-working-text)                 nsterm.m
-  
-  ;; Test if in echo area, based on mac-win.el 2007/08/26 unicode-2.
-*************** When text is in th echo area, this just 
-*** 271,287 ****
-  (defun ns-in-echo-area ()
-    &quot;Whether, for purposes of inserting working composition text, the minibuffer
-  is currently being used.&quot;
-!   (or isearch-mode
-!       (and cursor-in-echo-area (current-message))
-!       ;; Overlay strings are not shown in some cases.
-!       (get-char-property (point) 'invisible)
-!       (and (not (bobp))
-!            (or (and (get-char-property (point) 'display)
-!                     (eq (get-char-property (1- (point)) 'display)
-!                         (get-char-property (point) 'display)))
-!                (and (get-char-property (point) 'composition)
-!                     (eq (get-char-property (1- (point)) 'composition)
-!                         (get-char-property (point) 'composition)))))))
-  
-  ;; The 'interactive' here stays for subinvocations, so the ns-in-echo-area
-  ;; always returns nil for some reason.  If this WASN'T the case, we could
---- 288,306 ----
-  (defun ns-in-echo-area ()
-    &quot;Whether, for purposes of inserting working composition text, the minibuffer
-  is currently being used.&quot;
-!   (setq mac-in-echo-area 
-!         (or isearch-mode
-!             (and cursor-in-echo-area (current-message))
-!             ;; Overlay strings are not shown in some cases.
-!             (get-char-property (point) 'invisible)
-!             (and (not (bobp))
-!                  (or (and (get-char-property (point) 'display)
-!                           (eq (get-char-property (1- (point)) 'display)
-!                               (get-char-property (point) 'display)))
-!                      (and (get-char-property (point) 'composition)
-!                           (eq (get-char-property (1- (point)) 'composition)
-!                               (get-char-property (point) 'composition)))))))
-!   mac-in-echo-area)
-  
-  ;; The 'interactive' here stays for subinvocations, so the ns-in-echo-area
-  ;; always returns nil for some reason.  If this WASN'T the case, we could
-*************** is currently being used.&quot;
-*** 290,295 ****
---- 309,315 ----
-  (defun ns-put-working-text ()
-    (interactive)
-    (if (ns-in-echo-area) (ns-echo-working-text) (ns-insert-working-text)))
-+ 
-  (defun ns-unput-working-text ()
-    (interactive)
-    (ns-delete-working-text))
-*************** The overlay is assigned the face `ns-wor
-*** 311,329 ****
-  (defun ns-echo-working-text ()
-    &quot;Echo contents of `ns-working-text' in message display area.
-  See `ns-insert-working-text'.&quot;
--   (ns-delete-working-text)
-    (let* ((msg (current-message))
-!          (msglen (length msg))
-!          message-log-max)
-      (setq ns-working-overlay (length ns-working-text))
-      (setq msg (concat msg ns-working-text))
-      (put-text-property msglen (+ msglen ns-working-overlay)
-!                        'face 'ns-working-text-face msg)
-      (message &quot;%s&quot; msg)))
-  
-  (defun ns-delete-working-text()
-!   &quot;Delete working text and clear `ns-working-overlay'.&quot;
-    (interactive)
-    (cond
-     ((and (overlayp ns-working-overlay)
-           ;; Still alive?
---- 331,411 ----
-  (defun ns-echo-working-text ()
-    &quot;Echo contents of `ns-working-text' in message display area.
-  See `ns-insert-working-text'.&quot;
-    (let* ((msg (current-message))
-!          (msglen (length msg))
-!          message-log-max)
-!     (if (integerp ns-working-overlay)
-!         (progn
-!           (setq msg (substring msg 0 (- (length msg) ns-working-overlay)))
-!           (setq msglen (length msg))))
-      (setq ns-working-overlay (length ns-working-text))
-      (setq msg (concat msg ns-working-text))
-      (put-text-property msglen (+ msglen ns-working-overlay)
-!                         'face 'ns-working-text-face msg)
-!      (message &quot;%s&quot; msg)))
-! 
-! (defun ns-put-marked-text (event)
-!   (interactive &quot;e&quot;)
-! 
-!   (let ((pos (nth 1 event))
-!         (len (nth 2 event)))
-!     (if (ns-in-echo-area)
-!         (ns-echo-marked-text pos len)
-!       (ns-insert-marked-text pos len))))
-! 
-! (defun ns-insert-marked-text (pos len)
-!   &quot;Insert contents of `ns-working-text' as UTF-8 string and mark with
-! `ns-working-overlay' and `ns-marked-overlay'.  Any previously existing
-! working text is cleared first. The overlay is assigned the faces 
-! `ns-working-text-face' and `ns-marked-text-face'.&quot;
-!   (ns-delete-working-text)
-!   (let ((start (point)))
-!     (if (&lt;= pos (length ns-working-text))
-!       (progn
-!         (put-text-property pos len 'face 'ns-working-text-face ns-working-text)
-!         (insert ns-working-text)
-!         (if (= len 0)
-!             (overlay-put (setq ns-working-overlay
-!                                (make-overlay start (point) (current-buffer) nil t))
-!                          'face 'ns-working-text-face)
-!           (overlay-put (setq ns-working-overlay
-!                              (make-overlay start (point) (current-buffer) nil t))
-!                        'face 'ns-unmarked-text-face)
-!           (overlay-put (setq ns-marked-overlay 
-!                              (make-overlay (+ start pos) (+ start pos len)
-!                                            (current-buffer) nil t))
-!                        'face 'ns-marked-text-face))
-!         (goto-char (+ start pos))))))
-!     
-! (defun ns-echo-marked-text (pos len)
-!   &quot;Echo contents of `ns-working-text' in message display area.
-! See `ns-insert-working-text'.&quot;
-!   (let* ((msg (current-message))
-!          (msglen (length msg))
-!          message-log-max)
-!     (when (integerp ns-working-overlay)
-!       (setq msg (substring msg 0 (- (length msg) ns-working-overlay)))
-!       (setq msglen (length msg)))
-!     (setq ns-working-overlay (length ns-working-text))
-!     (setq msg (concat msg ns-working-text))
-!     (if (= len 0)
-!         (put-text-property msglen (+ msglen ns-working-overlay)
-!                            'face 'ns-working-text-face msg)
-!       (put-text-property msglen (+ msglen ns-working-overlay)
-!                          'face 'ns-unmarked-text-face msg)
-!       (put-text-property (+ msglen pos) (+ msglen pos len)
-!                          'face 'ns-marked-text-face msg))
-      (message &quot;%s&quot; msg)))
-  
-  (defun ns-delete-working-text()
-!   &quot;Delete working text and clear `ns-working-overlay' and `ns-marked-overlay'.&quot;
-    (interactive)
-+   (when (and (overlayp ns-marked-overlay)
-+              ;; Still alive
-+              (overlay-buffer ns-marked-overlay))
-+     (with-current-buffer (overlay-buffer ns-marked-overlay)
-+       (delete-overlay ns-marked-overlay)))
-+   (setq ns-marked-overlay nil)
-    (cond
-     ((and (overlayp ns-working-overlay)
-           ;; Still alive?
-*************** See the documentation of `create-fontset
-*** 943,948 ****
---- 1025,1490 ----
-  (add-to-list 'window-system-initialization-alist '(ns . ns-initialize-window-system))
-  
-  
-+ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-+ ;;
-+ ;; Implementation of Input Method Extension for MacOS X
-+ ;; written by Taiichi Hashimoto &lt;taiichi2@mac.com&gt;
-+ ;;
-+ 
-+ (defvar mac-input-method-parameters
-+   '(
-+     (&quot;com.apple.inputmethod.Kotoeri.Roman&quot;
-+      (title . &quot;A&quot;)
-+      (cursor-color)
-+      (cursor-type))
-+     (&quot;com.apple.inputmethod.Kotoeri.Japanese&quot;
-+      (title . &quot;あ&quot;)
-+      (cursor-color)
-+      (cursor-type))
-+     (&quot;com.apple.inputmethod.Kotoeri.Japanese.Katakana&quot;
-+      (title . &quot;ア&quot;)
-+      (cursor-color)
-+      (cursor-type))
-+     (&quot;com.apple.inputmethod.Kotoeri.Japanese.FullWidthRoman&quot;
-+      (title . &quot;A&quot;)
-+      (cursor-color)
-+      (cursor-type))
-+     (&quot;com.apple.inputmethod.Kotoeri.Japanese.HalfWidthKana&quot;
-+      (title . &quot;ア&quot;)
-+      (cursor-color)
-+      (cursor-type))
-+     (&quot;com.apple.inputmethod.kotoeri.Ainu&quot;
-+      (title . &quot;アイヌ&quot;)
-+      (cursor-color)
-+      (cursor-type))
-+     (&quot;com.apple.inputmethod.Korean.2SetKorean&quot;
-+      (title . &quot;가2&quot;)
-+      (cursor-color)
-+      (cursor-type))
-+     (&quot;com.apple.inputmethod.Korean.3SetKorean&quot;
-+      (title . &quot;가3&quot;)
-+      (cursor-color)
-+      (cursor-type))
-+     (&quot;com.apple.inputmethod.Korean.390Sebulshik&quot;
-+      (title . &quot;가5&quot;)
-+      (cursor-color)
-+      (cursor-type))
-+     (&quot;com.apple.inputmethod.Korean.GongjinCheongRomaja&quot;
-+      (title . &quot;가G&quot;)
-+      (cursor-color)
-+      (cursor-type))
-+     (&quot;com.apple.inputmethod.Korean.HNCRomaja&quot;
-+      (title . &quot;가H&quot;)
-+      (cursor-color)
-+      (cursor-type))
-+     (&quot;com.apple.inputmethod.Tamil.AnjalIM&quot;
-+      (title . &quot;Anjal&quot;)
-+      (cursor-color)
-+      (cursor-type))
-+     (&quot;com.apple.inputmethod.Tamil.Tamil99&quot;
-+      (title . &quot;Tamil&quot;)
-+      (cursor-color)
-+      (cursor-type))
-+     (&quot;com.apple.inputmethod.VietnameseIM.VietnameseSimpleTelex&quot;
-+      (title . &quot;ST&quot;)
-+      (cursor-color)
-+      (cursor-type))
-+     (&quot;com.apple.inputmethod.VietnameseIM.VietnameseTelex&quot;
-+      (title . &quot;TX&quot;)
-+      (cursor-color)
-+      (cursor-type))
-+     (&quot;com.apple.inputmethod.VietnameseIM.VietnameseVNI&quot;
-+      (title . &quot;VN&quot;)
-+      (cursor-color)
-+      (cursor-type))
-+     (&quot;com.apple.inputmethod.VietnameseIM.VietnameseVIQR&quot;
-+      (title . &quot;VQ&quot;)
-+      (cursor-color)
-+      (cursor-type))
-+     (&quot;com.apple.inputmethod.SCIM.ITABC&quot;
-+      (title . &quot;拼&quot;)
-+      (cursor-color)
-+      (cursor-type))
-+     (&quot;com.apple.inputmethod.SCIM.WBX&quot;
-+      (title . &quot;型&quot;)
-+      (cursor-color)
-+      (cursor-type))
-+     (&quot;com.apple.inputmethod.SCIM.WBH&quot;
-+      (title . &quot;画&quot;)
-+      (cursor-color)
-+      (cursor-type))
-+     (&quot;com.apple.inputmethod.TCIM.Zhuyin&quot;
-+      (title . &quot;注&quot;)
-+      (cursor-color)
-+      (cursor-type))
-+     (&quot;com.apple.inputmethod.TCIM.Pinyin&quot;
-+      (title . &quot;拼&quot;)
-+      (cursor-color)
-+      (cursor-type))
-+     (&quot;com.apple.inputmethod.TCIM.Cangjie&quot;
-+      (title . &quot;倉&quot;)
-+      (cursor-color)
-+      (cursor-type))
-+     (&quot;com.apple.inputmethod.TCIM.Jianyi&quot;
-+      (title . &quot;速&quot;)
-+      (cursor-color)
-+      (cursor-type))
-+     (&quot;com.apple.inputmethod.TCIM.Dayi&quot;
-+      (title . &quot;易&quot;)
-+      (cursor-color)
-+      (cursor-type))
-+     (&quot;com.apple.inputmethod.TCIM.Hanin&quot;
-+      (title . &quot;漢&quot;)
-+      (cursor-color)
-+      (cursor-type))
-+     (&quot;com.google.inputmethod.Japanese.Roman&quot;
-+      (title . &quot;G&quot;)
-+      (cursor-color)
-+      (cursor-type))
-+     (&quot;com.google.inputmethod.Japanese.base&quot;
-+      (title . &quot;ぐ&quot;)
-+      (cursor-color)
-+      (cursor-type))
-+     (&quot;com.google.inputmethod.Japanese.Katakana&quot;
-+      (title . &quot;グ&quot;)
-+      (cursor-color)
-+      (cursor-type))
-+     (&quot;com.google.inputmethod.Japanese.FullWidthRoman&quot;
-+      (title . &quot;G&quot;)
-+      (cursor-color)
-+      (cursor-type))
-+     (&quot;com.google.inputmethod.Japanese.HalfWidthKana&quot;
-+      (title . &quot;グ&quot;)
-+      (cursor-color)
-+      (cursor-type))
-+     (&quot;jp.monokakido.inputmethod.Kawasemi.Roman&quot;
-+      (title . &quot;K&quot;)
-+      (cursor-color)
-+      (cursor-type))
-+     (&quot;jp.monokakido.inputmethod.Kawasemi.Japanese&quot;
-+      (title . &quot;か&quot;)
-+      (cursor-color)
-+      (cursor-type))
-+     (&quot;jp.monokakido.inputmethod.Kawasemi.Japanese.Katakana&quot;
-+      (title . &quot;カ&quot;)
-+      (cursor-color)
-+      (cursor-type))
-+     (&quot;jp.monokakido.inputmethod.Kawasemi.Japanese.FullWidthRoman&quot;
-+      (title . &quot;K&quot;)
-+      (cursor-color)
-+      (cursor-type))
-+     (&quot;jp.monokakido.inputmethod.Kawasemi.Japanese.HalfWidthKana&quot;
-+      (title . &quot;カ&quot;)
-+      (cursor-color)
-+      (cursor-type))
-+     (&quot;jp.monokakido.inputmethod.Kawasemi.Japanese.HalfWidthRoman&quot;
-+      (title . &quot;_K&quot;)
-+      (cursor-color)
-+      (cursor-type))
-+     (&quot;jp.monokakido.inputmethod.Kawasemi.Japanese.Code&quot;
-+      (title . &quot;C&quot;)
-+      (cursor-color)
-+      (cursor-type))
-+     (&quot;com.justsystems.inputmethod.atok21.Roman&quot;
-+      (title . &quot;A&quot;)
-+      (cursor-color)
-+      (cursor-type))
-+     (&quot;com.justsystems.inputmethod.atok21.Japanese&quot;
-+      (title . &quot;あ&quot;)
-+      (cursor-color)
-+      (cursor-type))
-+     (&quot;com.justsystems.inputmethod.atok21.Japanese.Katakana&quot;
-+      (title . &quot;ア&quot;)
-+      (cursor-color)
-+      (cursor-type))
-+     (&quot;com.justsystems.inputmethod.atok21.Japanese.FullWidthRoman&quot;
-+      (title . &quot;英&quot;)
-+      (cursor-color)
-+      (cursor-type))
-+     (&quot;com.justsystems.inputmethod.atok21.Japanese.HalfWidthEiji&quot;
-+      (title . &quot;半英&quot;)
-+      (cursor-color)
-+      (cursor-type))
-+     (&quot;com.justsystems.inputmethod.atok22.Roman&quot;
-+      (title . &quot;A&quot;)
-+      (cursor-color)
-+      (cursor-type))
-+     (&quot;com.justsystems.inputmethod.atok22.Japanese&quot;
-+      (title . &quot;あ&quot;)
-+      (cursor-color)
-+      (cursor-type))
-+     (&quot;com.justsystems.inputmethod.atok22.Japanese.Katakana&quot;
-+      (title . &quot;ア&quot;)
-+      (cursor-color)
-+      (cursor-type))
-+     (&quot;com.justsystems.inputmethod.atok22.Japanese.FullWidthRoman&quot;
-+      (title . &quot;英&quot;)
-+      (cursor-color)
-+      (cursor-type))
-+     (&quot;com.justsystems.inputmethod.atok22.Japanese.HalfWidthEiji&quot;
-+      (title . &quot;半英&quot;)
-+      (cursor-color)
-+      (cursor-type))
-+     (&quot;com.justsystems.inputmethod.atok23.Roman&quot;
-+      (title . &quot;A&quot;)
-+      (cursor-color)
-+      (cursor-type))
-+     (&quot;com.justsystems.inputmethod.atok23.Japanese&quot;
-+      (title . &quot;あ&quot;)
-+      (cursor-color)
-+      (cursor-type))
-+     (&quot;com.justsystems.inputmethod.atok23.Japanese.Katakana&quot;
-+      (title . &quot;ア&quot;)
-+      (cursor-color)
-+      (cursor-type))
-+     (&quot;com.justsystems.inputmethod.atok23.Japanese.FullWidthRoman&quot;
-+      (title . &quot;英&quot;)
-+      (cursor-color)
-+      (cursor-type))
-+     (&quot;com.justsystems.inputmethod.atok23.Japanese.HalfWidthEiji&quot;
-+      (title . &quot;半英&quot;)
-+      (cursor-color)
-+      (cursor-type))
-+     (&quot;com.justsystems.inputmethod.atok24.Roman&quot;
-+      (title . &quot;A&quot;)
-+      (cursor-color)
-+      (cursor-type))
-+     (&quot;com.justsystems.inputmethod.atok24.Japanese&quot;
-+      (title . &quot;あ&quot;)
-+      (cursor-color)
-+      (cursor-type))
-+     (&quot;com.justsystems.inputmethod.atok24.Japanese.Katakana&quot;
-+      (title . &quot;ア&quot;)
-+      (cursor-color)
-+      (cursor-type))
-+     (&quot;com.justsystems.inputmethod.atok24.Japanese.FullWidthRoman&quot;
-+      (title . &quot;英&quot;)
-+      (cursor-color)
-+      (cursor-type))
-+     (&quot;com.justsystems.inputmethod.atok24.Japanese.HalfWidthEiji&quot;
-+      (title . &quot;半英&quot;)
-+      (cursor-color)
-+      (cursor-type))
-+     (&quot;com.justsystems.inputmethod.atok25.Roman&quot;
-+      (title . &quot;A&quot;)
-+      (cursor-color)
-+      (cursor-type))
-+     (&quot;com.justsystems.inputmethod.atok25.Japanese&quot;
-+      (title . &quot;あ&quot;)
-+      (cursor-color)
-+      (cursor-type))
-+     (&quot;com.justsystems.inputmethod.atok25.Japanese.Katakana&quot;
-+      (title . &quot;ア&quot;)
-+      (cursor-color)
-+      (cursor-type))
-+     (&quot;com.justsystems.inputmethod.atok25.Japanese.FullWidthRoman&quot;
-+      (title . &quot;英&quot;)
-+      (cursor-color)
-+      (cursor-type))
-+     (&quot;com.justsystems.inputmethod.atok25.Japanese.HalfWidthEiji&quot;
-+      (title . &quot;半英&quot;)
-+      (cursor-color)
-+      (cursor-type))
-+     )
-+   &quot;Alist of Mac script code vs parameters for input method on MacOSX.&quot;)
-+ 
-+ 
-+ (defun mac-get-input-method-parameter (is key)
-+   &quot;Function to get a parameter of a input method.&quot;
-+   (interactive)
-+   (assq key (cdr (assoc is mac-input-method-parameters))))
-+ 
-+ (defun mac-get-input-method-title (&amp;optional input-source)
-+   &quot;Return input method title of input source.
-+    If input-source is nil, return one of current frame.&quot;
-+   (if input-source
-+       (cdr (mac-get-input-method-parameter input-source 'title))
-+     current-input-method-title))
-+ 
-+ (defun mac-get-cursor-type (&amp;optional input-source)
-+   &quot;Return cursor type of input source.
-+    If input-source is nil, return one of current frame.&quot;
-+   (if input-source
-+       (or (cdr (mac-get-input-method-parameter input-source 'cursor-type))
-+           (cdr (assq 'cursor-type default-frame-alist))
-+           cursor-type)
-+     (cdr (assq 'cursor-type (frame-parameters (selected-frame))))))
-+ 
-+ (defun mac-get-cursor-color (&amp;optional input-source)
-+   &quot;Return cursor color of input source.
-+    If input-source is nil, return one of current frame.&quot;
-+   (if input-source
-+       (or (cdr (mac-get-input-method-parameter input-source 'cursor-color))
-+           (cdr (assq 'cursor-color default-frame-alist)))
-+     (cdr (assq 'cursor-color (frame-parameters (selected-frame))))))
-+ 
-+ 
-+ (defun mac-set-input-method-parameter (is key value)
-+   &quot;Function to set a parameter of a input method.&quot;
-+   (let* ((is-param (assoc is mac-input-method-parameters))
-+          (param (assq key is-param)))
-+     (if is-param
-+         (if param
-+             (setcdr param value)
-+           (setcdr is-param (cons (cons key value) (cdr is-param))))
-+       (setq mac-input-method-parameters
-+             (cons (list is (cons key value))
-+                   mac-input-method-parameters)))))
-+ 
-+ 
-+ (defun mac-input-method-update (is)
-+   &quot;Funtion to update parameters of a input method.&quot;
-+   (interactive)
-+ 
-+   (let ((title (mac-get-input-method-title is))
-+         (type (mac-get-cursor-type is))
-+         (color (mac-get-cursor-color is)))
-+     (if (and title (not (equal title (mac-get-input-method-title))))
-+         (setq current-input-method-title title))
-+     (if (and type (not (equal type (mac-get-cursor-type))))
-+         (setq cursor-type type))
-+     (if (and color (not (equal color (mac-get-cursor-color))))
-+         (set-cursor-color color))
-+     (force-mode-line-update)
-+     (if isearch-mode (isearch-update))))
-+ 
-+ 
-+ (defun mac-toggle-input-method (&amp;optional arg)
-+   &quot;Function to toggle input method on MacOSX.&quot;
-+   (interactive)
-+   
-+   (if arg
-+       (progn
-+         (make-local-variable 'input-method-function)
-+         (setq inactivate-current-input-method-function 'mac-toggle-input-method)
-+         (setq input-method-function nil)
-+         (setq describe-current-input-method-function nil)
-+         (mac-toggle-input-source t))
-+     (kill-local-variable 'input-method-function)
-+     (setq describe-current-input-method-function nil)
-+     (mac-toggle-input-source nil)))
-+ 
-+ 
-+ (defun mac-change-language-to-us ()
-+   &quot;Function to change language to us.&quot;
-+   (interactive)
-+   (mac-toggle-input-method nil))
-+ 
-+ 
-+ (defun mac-handle-input-method-change ()
-+   &quot;Function run when a input method change.&quot;
-+   (interactive)
-+ 
-+   (if (equal default-input-method &quot;MacOSX&quot;)
-+       (let ((input-source (mac-get-current-input-source))
-+           (ascii-capable (mac-input-source-is-ascii-capable)))
-+         
-+         (cond ((and (not current-input-method) (not ascii-capable))
-+                (set-input-method &quot;MacOSX&quot;))
-+               ((and (equal current-input-method &quot;MacOSX&quot;) ascii-capable)
-+                (toggle-input-method nil)))
-+         (mac-input-method-update input-source))))
-+ 
-+ ;;
-+ ;; Emacs input method for input method on MacOSX.
-+ ;;
-+ (register-input-method &quot;MacOSX&quot; &quot;MacOSX&quot; 'mac-toggle-input-method
-+                        &quot;Mac&quot; &quot;Input Method on MacOSX System&quot;)
-+ 
-+ 
-+ ;;
-+ ;; Minor mode of using input methods on MacOS X
-+ ;;
-+ (define-minor-mode mac-input-method-mode
-+   &quot;Use input methods on MacOSX.&quot;
-+   :init-value nil
-+   :group 'ns
-+   :global t
-+ 
-+   (if mac-input-method-mode
-+       (progn
-+         (setq default-input-method &quot;MacOSX&quot;)
-+         (add-hook 'minibuffer-setup-hook 'mac-change-language-to-us)
-+         (mac-translate-from-yen-to-backslash))
-+     (setq default-input-method nil)))
-+ 
-+ ;;
-+ ;; Valiable and functions to pass key(shortcut) to system.
-+ ;;
-+ (defvar mac-keys-passed-to-system nil
-+   &quot;A list of keys passed to system on MacOSX.&quot;)
-+ 
-+ (defun mac-add-key-passed-to-system (key)
-+   (let ((shift   '(shift shft))
-+         (control '(control ctrl ctl))
-+         (option  '(option opt alternate alt))
-+         (command '(command cmd)))
-+ 
-+     (add-to-list 'mac-keys-passed-to-system
-+                  (cond ((symbolp key)
-+                         (cond ((memq key shift)
-+                                (cons ns-shift-key-mask nil))
-+                               ((memq key control)
-+                                (cons ns-control-key-mask nil))
-+                               ((memq key option)
-+                                (cons ns-alternate-key-mask nil))
-+                               ((memq key command)
-+                                (cons ns-command-key-mask nil))
-+                               (t (cons nil nil))))
-+                        ((numberp key) (cons 0 key))
-+                        ((listp key)
-+                         (let ((l key) (k nil) (m 0))
-+                           (while l
-+                             (cond ((memq (car l) shift)
-+                                    (setq m (logior m ns-shift-key-mask)))
-+                                   ((memq (car l) control)
-+                                    (setq m (logior m ns-control-key-mask)))
-+                                   ((memq (car l) option)
-+                                    (setq m (logior m ns-alternate-key-mask)))
-+                                   ((memq (car l) command)
-+                                        (setq m (logior m ns-command-key-mask)))
-+                                   ((numberp (car l))
-+                                    (if (not k) (setq k (car l)))))
-+                             (setq l (cdr l)))
-+                           (cons m k)))
-+                        (t (cons nil nil))))))
-+ 
-+ 
-+ ;;
-+ ;; Entry Emacs event for inline input method on MacOSX.
-+ ;;
-+ (define-key special-event-map
-+   [mac-change-input-method] 'mac-handle-input-method-change)
-+       
-+ ;;
-+ ;; Convert yen to backslash for JIS keyboard.
-+ ;;
-+ (defun mac-translate-from-yen-to-backslash () 
-+   ;; Convert yen to backslash for JIS keyboard.
-+   (interactive)
-+ 
-+   (define-key global-map [165] nil)
-+   (define-key global-map [2213] nil)
-+   (define-key global-map [3420] nil)
-+   (define-key global-map [67109029] nil)
-+   (define-key global-map [67111077] nil)
-+   (define-key global-map [8388773] nil)
-+   (define-key global-map [134219941] nil)
-+   (define-key global-map [75497596] nil)
-+   (define-key global-map [201328805] nil)
-+   (define-key function-key-map [165] [?\\])
-+   (define-key function-key-map [2213] [?\\]) ;; for Intel
-+   (define-key function-key-map [3420] [?\\]) ;; for PowerPC
-+   (define-key function-key-map [67109029] [?\C-\\])
-+   (define-key function-key-map [67111077] [?\C-\\])
-+   (define-key function-key-map [8388773] [?\M-\\])
-+   (define-key function-key-map [134219941] [?\M-\\])
-+   (define-key function-key-map [75497596] [?\C-\M-\\])
-+   (define-key function-key-map [201328805] [?\C-\M-\\])
-+ )
-+ 
-+ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-+ 
-  (provide 'ns-win)
-  
-  ;;; ns-win.el ends here
-diff -r -N -p ../emacs-24.3.org/src/Makefile.in src/Makefile.in
-*** ../emacs-24.3.org/src/Makefile.in        2013-01-02 05:37:17.000000000 +0900
---- src/Makefile.in        2013-04-13 21:49:53.000000000 +0900
-*************** obj = $(base_obj) $(NS_OBJC_OBJ)
-*** 356,362 ****
-  SOME_MACHINE_OBJECTS = dosfns.o msdos.o \
-    xterm.o xfns.o xmenu.o xselect.o xrdb.o xsmfns.o fringe.o image.o \
-    fontset.o dbusbind.o cygw32.o \
-!   nsterm.o nsfns.o nsmenu.o nsselect.o nsimage.o nsfont.o \
-    w32.o w32console.o w32fns.o w32heap.o w32inevt.o \
-    w32menu.o w32proc.o w32reg.o w32select.o w32term.o w32xfns.o \
-    w16select.o widget.o xfont.o ftfont.o xftfont.o ftxfont.o gtkutil.o \
---- 356,362 ----
-  SOME_MACHINE_OBJECTS = dosfns.o msdos.o \
-    xterm.o xfns.o xmenu.o xselect.o xrdb.o xsmfns.o fringe.o image.o \
-    fontset.o dbusbind.o cygw32.o \
-!   nsterm.o nsfns.o nsmenu.o nsselect.o nsimage.o nsfont.o macim.o \
-    w32.o w32console.o w32fns.o w32heap.o w32inevt.o \
-    w32menu.o w32proc.o w32reg.o w32select.o w32term.o w32xfns.o \
-    w16select.o widget.o xfont.o ftfont.o xftfont.o ftxfont.o gtkutil.o \
-diff -r -N -p ../emacs-24.3.org/src/keyboard.c src/keyboard.c
-*** ../emacs-24.3.org/src/keyboard.c        2013-02-13 13:25:53.000000000 +0900
---- src/keyboard.c        2013-04-13 21:49:53.000000000 +0900
-*************** kbd_buffer_get_event (KBOARD **kbp,
-*** 3862,3869 ****
-          {
-            if (event-&gt;code == KEY_NS_PUT_WORKING_TEXT)
-              obj = Fcons (intern (&quot;ns-put-working-text&quot;), Qnil);
-!           else
-              obj = Fcons (intern (&quot;ns-unput-working-text&quot;), Qnil);
-            kbd_fetch_ptr = event + 1;
-            if (used_mouse_menu)
-              *used_mouse_menu = 1;
---- 3862,3871 ----
-          {
-            if (event-&gt;code == KEY_NS_PUT_WORKING_TEXT)
-              obj = Fcons (intern (&quot;ns-put-working-text&quot;), Qnil);
-!           else if (event-&gt;code == KEY_NS_UNPUT_WORKING_TEXT)
-              obj = Fcons (intern (&quot;ns-unput-working-text&quot;), Qnil);
-+           else if (event-&gt;code == KEY_NS_PUT_MARKED_TEXT)
-+             obj = Fcons (intern (&quot;ns-put-marked-text&quot;), event-&gt;arg);
-            kbd_fetch_ptr = event + 1;
-            if (used_mouse_menu)
-              *used_mouse_menu = 1;
-*************** keys_of_keyboard (void)
-*** 12088,12093 ****
---- 12090,12097 ----
-                              &quot;ns-put-working-text&quot;);
-    initial_define_lispy_key (Vspecial_event_map, &quot;ns-unput-working-text&quot;,
-                              &quot;ns-unput-working-text&quot;);
-+   initial_define_lispy_key (Vspecial_event_map, &quot;ns-put-marked-text&quot;,
-+                             &quot;ns-put-marked-text&quot;);
-    /* Here we used to use `ignore-event' which would simple set prefix-arg to
-       current-prefix-arg, as is done in `handle-switch-frame'.
-       But `handle-switch-frame is not run from the special-map.
-diff -r -N -p ../emacs-24.3.org/src/macim.m src/macim.m
-*** ../emacs-24.3.org/src/macim.m        1970-01-01 09:00:00.000000000 +0900
---- src/macim.m        2013-04-13 21:50:24.000000000 +0900
-***************
-*** 0 ****
---- 1,184 ----
-+ /* Implementation of Input Method Extension for MacOS X.
-+    Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
-+    Taiichi Hashimoto &lt;taiichi2@mac.com&gt;.
-+ */
-+ 
-+ #include &quot;config.h&quot;
-+ 
-+ #ifdef NS_IMPL_COCOA
-+ 
-+ #include &lt;math.h&gt;
-+ #include &lt;sys/types.h&gt;
-+ #include &lt;time.h&gt;
-+ #include &lt;signal.h&gt;
-+ #include &lt;unistd.h&gt;
-+ 
-+ #include &lt;Carbon/Carbon.h&gt;
-+ 
-+ #include &quot;lisp.h&quot;
-+ #include &quot;blockinput.h&quot;
-+ 
-+ enum output_method
-+ {
-+   output_initial,
-+   output_termcap,
-+   output_x_window,
-+   output_msdos_raw,
-+   output_w32,
-+   output_mac,
-+   output_ns
-+ } output_method;
-+ 
-+ #include &quot;termhooks.h&quot;
-+ #include &quot;keyboard.h&quot;
-+ #include &quot;buffer.h&quot;
-+ 
-+ //extern Lisp_Object Qcurrent_input_method;
-+ //extern int cursor_in_echo_area;
-+ static Lisp_Object Qmac_keys_passed_to_system;
-+ 
-+ void mac_init_input_method ();
-+ int mac_pass_key_to_system (int code, int modifiers);
-+ int mac_pass_key_directly_to_emacs ();
-+ int mac_store_change_input_method_event ();
-+ 
-+ DEFUN (&quot;mac-input-source-is-ascii-capable&quot;, Fmac_input_source_is_ascii_capable, Smac_input_source_is_ascii_capable,
-+        0, 0, 0,
-+        doc: /* Is current input source ascii capable? */)
-+      (void)
-+ {
-+   TISInputSourceRef is = TISCopyCurrentKeyboardInputSource();
-+   CFBooleanRef ret = TISGetInputSourceProperty(is, kTISPropertyInputSourceIsASCIICapable);
-+   
-+   return CFBooleanGetValue(ret)? Qt : Qnil;
-+ }
-+ 
-+ DEFUN (&quot;mac-get-input-source-list&quot;, Fmac_get_input_source_list, Smac_get_input_source_list,
-+        0, 0, 0,
-+        doc: /* get input source list on MacOSX */)
-+      (void)
-+ {
-+   NSArray *is_list = (NSArray *)TISCreateInputSourceList(NULL, false);
-+   int list_size = [is_list count];
-+   Lisp_Object list[list_size];
-+   int i;
-+ 
-+   for (i = 0; i &lt; list_size; i++) {
-+     TISInputSourceRef is = (TISInputSourceRef)[is_list objectAtIndex:i];
-+     NSString *id = (NSString *)TISGetInputSourceProperty(is, kTISPropertyInputSourceID);
-+     list[i] = make_string([id UTF8String],
-+                           [id lengthOfBytesUsingEncoding:NSUTF8StringEncoding]);
-+   }
-+ 
-+   return Flist(list_size, list);
-+ }
-+ 
-+ DEFUN (&quot;mac-get-current-input-source&quot;, Fmac_get_current_input_source, Smac_get_current_input_source,
-+        0, 0, 0,
-+        doc: /* get current input source on MacOSX */)
-+      (void)
-+ {
-+   TISInputSourceRef is = TISCopyCurrentKeyboardInputSource();
-+   NSString *id = (NSString *)TISGetInputSourceProperty(is, kTISPropertyInputSourceID);
-+ 
-+   return make_string([id UTF8String],
-+                      [id lengthOfBytesUsingEncoding:NSUTF8StringEncoding]);
-+ }
-+ 
-+ DEFUN (&quot;mac-toggle-input-source&quot;, Fmac_toggle_input_source, Smac_toggle_input_source,
-+        1, 1, 0,
-+        doc: /* toggle input source on MacOSX */)
-+      (arg)
-+      Lisp_Object arg;
-+ {
-+   TISInputSourceRef is = NULL;
-+ 
-+   if (NILP (arg))
-+     {
-+       is = TISCopyCurrentASCIICapableKeyboardInputSource();
-+     }
-+   else
-+     {
-+       NSString *locale;
-+       NSArray *languages = [NSLocale preferredLanguages];
-+       if (languages != nil) {
-+           locale = [languages objectAtIndex:0];
-+       } else {
-+           locale = [[NSLocale currentLocale]
-+                           objectForKey:NSLocaleLanguageCode];
-+       }
-+       is = TISCopyInputSourceForLanguage((CFStringRef)locale);
-+     }
-+   if (is) TISSelectInputSource(is);
-+ 
-+   return arg;
-+ }
-+ 
-+ int
-+ mac_store_change_input_method_event ()
-+ {
-+   Lisp_Object dim;
-+   int ret = FALSE;
-+   
-+   dim = Fsymbol_value (intern (&quot;default-input-method&quot;));
-+   if (STRINGP (dim) &amp;&amp; strcmp(SDATA (dim), &quot;MacOSX&quot;) == 0)
-+     {
-+       ret = TRUE;
-+     }
-+ 
-+   return ret;
-+ }
-+ 
-+ int
-+ mac_pass_key_to_system (int code, int modifiers)
-+ {
-+   Lisp_Object keys = Fsymbol_value (Qmac_keys_passed_to_system);
-+   Lisp_Object m, k; 
-+ 
-+   while (!NILP (keys))
-+     {
-+       m = XCAR (XCAR (keys));
-+       k = XCDR (XCAR (keys));
-+       keys = XCDR (keys);
-+ 
-+       if (NUMBERP (m) &amp;&amp; modifiers == XINT (m))
-+         if (NILP (k)
-+             || (NUMBERP (k) &amp;&amp; code == XINT (k)))
-+           return TRUE;
-+     }
-+   
-+   return FALSE;
-+ }
-+ 
-+ int
-+ mac_pass_key_directly_to_emacs (void)
-+ {
-+ 
-+   if (NILP (Fmac_input_source_is_ascii_capable()))
-+     {
-+       if (NILP (Vmac_use_input_method_on_system)
-+           || this_command_key_count 
-+           || cursor_in_echo_area 
-+           || !NILP (BVAR (current_buffer, read_only)))
-+         return TRUE;
-+     }
-+ 
-+   return FALSE;
-+ }
-+ 
-+ 
-+ void mac_init_input_method (void)
-+ {
-+   Qmac_keys_passed_to_system = intern (&quot;mac-keys-passed-to-system&quot;);
-+   staticpro (&amp;Qmac_keys_passed_to_system);
-+ 
-+   DEFVAR_LISP (&quot;mac-use-input-method-on-system&quot;, Vmac_use_input_method_on_system,
-+                doc: /* If it is non-nil, use input method on system. */);
-+   Vmac_use_input_method_on_system = Qt;
-+ 
-+   defsubr (&amp;Smac_input_source_is_ascii_capable);
-+   defsubr (&amp;Smac_get_input_source_list);
-+   defsubr (&amp;Smac_get_current_input_source);
-+   defsubr (&amp;Smac_toggle_input_source);
-+ }
-+ #endif
-diff -r -N -p ../emacs-24.3.org/src/nsfns.m src/nsfns.m
-*** ../emacs-24.3.org/src/nsfns.m        2013-01-02 05:37:17.000000000 +0900
---- src/nsfns.m        2013-04-13 21:49:53.000000000 +0900
-*************** static ptrdiff_t image_cache_refcount;
-*** 107,113 ****
-  
-     ========================================================================== */
-  
-- 
-  void
-  check_ns (void)
-  {
---- 107,112 ----
-*************** be used as the image of the icon represe
-*** 2702,2707 ****
---- 2701,2724 ----
-                 doc: /* Toolkit version for NS Windowing.  */);
-    Vns_version_string = ns_appkit_version_str ();
-  
-+ 
-+   DEFVAR_LISP (&quot;ns-shift-key-mask&quot;, Vns_shift_key_mask,
-+                doc: /* Shift key mask defined in system. */);
-+   Vns_shift_key_mask = make_number (NSShiftKeyMask);
-+ 
-+   DEFVAR_LISP (&quot;ns-control-key-mask&quot;, Vns_control_key_mask,
-+                doc: /* Control key mask defined in system. */);
-+   Vns_control_key_mask = make_number (NSControlKeyMask);
-+ 
-+   DEFVAR_LISP (&quot;ns-alternate-key-mask&quot;, Vns_alternate_key_mask,
-+                doc: /* Alternate key mask defined in system. */);
-+   Vns_alternate_key_mask = make_number (NSAlternateKeyMask);
-+ 
-+   DEFVAR_LISP (&quot;ns-command-key-mask&quot;, Vns_command_key_mask,
-+                doc: /* Command key mask defined in system. */);
-+   Vns_command_key_mask = make_number (NSCommandKeyMask);
-+ 
-+ 
-    defsubr (&amp;Sns_read_file_name);
-    defsubr (&amp;Sns_get_resource);
-    defsubr (&amp;Sns_set_resource);
-*************** be used as the image of the icon represe
-*** 2746,2751 ****
---- 2763,2772 ----
-    defsubr (&amp;Sx_show_tip);
-    defsubr (&amp;Sx_hide_tip);
-  
-+ #ifdef NS_IMPL_COCOA
-+   mac_init_input_method ();
-+ #endif
-+ 
-    /* used only in fontset.c */
-    check_window_system_func = check_ns;
-  
-diff -r -N -p ../emacs-24.3.org/src/nsterm.h src/nsterm.h
-*** ../emacs-24.3.org/src/nsterm.h        2013-01-02 05:37:17.000000000 +0900
---- src/nsterm.h        2013-04-13 21:49:53.000000000 +0900
-*************** typedef unsigned int NSUInteger;
-*** 420,425 ****
---- 420,427 ----
-  #define KEY_NS_NEW_FRAME               ((1&lt;&lt;28)|(0&lt;&lt;16)|12)
-  #define KEY_NS_TOGGLE_TOOLBAR          ((1&lt;&lt;28)|(0&lt;&lt;16)|13)
-  #define KEY_NS_SHOW_PREFS              ((1&lt;&lt;28)|(0&lt;&lt;16)|14)
-+ #define KEY_MAC_CHANGE_INPUT_METHOD    ((1&lt;&lt;28)|(0&lt;&lt;16)|15)
-+ #define KEY_NS_PUT_MARKED_TEXT         ((1&lt;&lt;28)|(0&lt;&lt;16)|16)
-  
-  /* could use list to store these, but rest of emacs has a big infrastructure
-     for managing a table of bitmap &quot;records&quot; */
-diff -r -N -p ../emacs-24.3.org/src/nsterm.m src/nsterm.m
-*** ../emacs-24.3.org/src/nsterm.m        2013-01-04 18:38:13.000000000 +0900
---- src/nsterm.m        2013-04-13 21:53:51.000000000 +0900
-*************** ns_term_init (Lisp_Object display_name)
-*** 4049,4054 ****
---- 4049,4057 ----
-    /*   [[NSNotificationCenter defaultCenter] addObserver: NSApp
-                                           selector: @selector (logNotification:)
-                                               name: nil object: nil]; */
-+   [[NSDistributedNotificationCenter defaultCenter] addObserver: NSApp
-+                                         selector: @selector (changeInputMethod:)
-+                                                    name: @&quot;AppleSelectedInputSourcesChangedNotification&quot; object: nil];
-  
-    dpyinfo = xzalloc (sizeof *dpyinfo);
-  
-*************** ns_term_shutdown (int sig)
-*** 4278,4283 ****
---- 4281,4301 ----
-      NSLog (@&quot;notification: '%@'&quot;, [notification name]);
-  }
-  
-+ - (void)changeInputMethod: (NSNotification *)notification
-+ {
-+ 
-+   struct frame *emacsframe = SELECTED_FRAME ();
-+ 
-+   if (mac_store_change_input_method_event())
-+     {
-+       if (!emacs_event)
-+         return;
-+       emacs_event-&gt;kind = NS_NONKEY_EVENT;
-+       emacs_event-&gt;code = KEY_MAC_CHANGE_INPUT_METHOD;
-+       emacs_event-&gt;modifiers = 0;
-+       EV_TRAILER ((id)nil);
-+     }
-+ }
-  
-  - (void)sendEvent: (NSEvent *)theEvent
-  /* --------------------------------------------------------------------------
-*************** not_in_argv (NSString *arg)
-*** 4957,4963 ****
-               code, fnKeysym, flags, emacs_event-&gt;modifiers);
-  
-        /* if it was a function key or had modifiers, pass it directly to emacs */
-!       if (fnKeysym || (emacs_event-&gt;modifiers
-                         &amp;&amp; (emacs_event-&gt;modifiers != shift_modifier)
-                         &amp;&amp; [[theEvent charactersIgnoringModifiers] length] &gt; 0))
-  /*[[theEvent characters] length] */
---- 4975,4982 ----
-               code, fnKeysym, flags, emacs_event-&gt;modifiers);
-  
-        /* if it was a function key or had modifiers, pass it directly to emacs */
-!       if (mac_pass_key_directly_to_emacs ()
-!           ||fnKeysym || (emacs_event-&gt;modifiers
-                         &amp;&amp; (emacs_event-&gt;modifiers != shift_modifier)
-                         &amp;&amp; [[theEvent charactersIgnoringModifiers] length] &gt; 0))
-  /*[[theEvent characters] length] */
-*************** not_in_argv (NSString *arg)
-*** 4972,4979 ****
-                ? MULTIBYTE_CHAR_KEYSTROKE_EVENT : ASCII_KEYSTROKE_EVENT;
-  
-            emacs_event-&gt;code = code;
-!           EV_TRAILER (theEvent);
-!           return;
-          }
-      }
-  
---- 4991,5008 ----
-                ? MULTIBYTE_CHAR_KEYSTROKE_EVENT : ASCII_KEYSTROKE_EVENT;
-  
-            emacs_event-&gt;code = code;
-!           /* The function mac_pass_key_to_system decides 
-!              whether it is passed directly to emacs or not. */
-!           if (emacs_event-&gt;kind == NON_ASCII_KEYSTROKE_EVENT
-!               || !mac_pass_key_to_system (code, flags
-!                                           &amp; (NSShiftKeyMask
-!                                              | NSControlKeyMask
-!                                              | NSAlternateKeyMask
-!                                              | NSCommandKeyMask)))
-!             {
-!               EV_TRAILER (theEvent);
-!               return;
-!             }
-          }
-      }
-  
-*************** not_in_argv (NSString *arg)
-*** 5067,5076 ****
-      NSLog (@&quot;setMarkedText '%@' len =%d range %d from %d&quot;, str, [str length],
-             selRange.length, selRange.location);
-  
--   if (workingText != nil)
--     [self deleteWorkingText];
-    if ([str length] == 0)
-!     return;
-  
-    if (!emacs_event)
-      return;
---- 5096,5114 ----
-      NSLog (@&quot;setMarkedText '%@' len =%d range %d from %d&quot;, str, [str length],
-             selRange.length, selRange.location);
-  
-    if ([str length] == 0)
-!     {
-!       [self deleteWorkingText];
-!       return;
-!     }
-!   else
-!     {
-!       if (workingText != nil) {
-!         [workingText release];
-!         workingText = nil;
-!         processingCompose = NO;
-!       }
-!     }
-  
-    if (!emacs_event)
-      return;
-*************** not_in_argv (NSString *arg)
-*** 5080,5086 ****
-    ns_working_text = build_string ([workingText UTF8String]);
-  
-    emacs_event-&gt;kind = NS_TEXT_EVENT;
-!   emacs_event-&gt;code = KEY_NS_PUT_WORKING_TEXT;
-    EV_TRAILER ((id)nil);
-  }
-  
---- 5118,5126 ----
-    ns_working_text = build_string ([workingText UTF8String]);
-  
-    emacs_event-&gt;kind = NS_TEXT_EVENT;
-!   emacs_event-&gt;code = KEY_NS_PUT_MARKED_TEXT;
-!   emacs_event-&gt;arg = Fcons (make_number (selRange.location),
-!                             Fcons (make_number (selRange.length), Qnil));
-    EV_TRAILER ((id)nil);
-  }
-  
-*************** not_in_argv (NSString *arg)
-*** 5135,5149 ****
-  {
-    NSRect rect;
-    NSPoint pt;
-!   struct window *win = XWINDOW (FRAME_SELECTED_WINDOW (emacsframe));
-    if (NS_KEYLOG)
-      NSLog (@&quot;firstRectForCharRange request&quot;);
-  
-    rect.size.width = theRange.length * FRAME_COLUMN_WIDTH (emacsframe);
-    rect.size.height = FRAME_LINE_HEIGHT (emacsframe);
-    pt.x = WINDOW_TEXT_TO_FRAME_PIXEL_X (win, win-&gt;phys_cursor.x);
-    pt.y = WINDOW_TO_FRAME_PIXEL_Y (win, win-&gt;phys_cursor.y
-!                                        +FRAME_LINE_HEIGHT (emacsframe));
-  
-    pt = [self convertPoint: pt toView: nil];
-    pt = [[self window] convertBaseToScreen: pt];
---- 5175,5197 ----
-  {
-    NSRect rect;
-    NSPoint pt;
-!   //  struct window *win = XWINDOW (FRAME_SELECTED_WINDOW (emacsframe));
-!   struct window *win;
-    if (NS_KEYLOG)
-      NSLog (@&quot;firstRectForCharRange request&quot;);
-+     
-+   if (NILP (Vmac_in_echo_area))
-+     win = XWINDOW (FRAME_SELECTED_WINDOW (emacsframe));
-+     else if (WINDOWP (echo_area_window))
-+     win = XWINDOW (echo_area_window);
-+   else
-+     win = XWINDOW (FRAME_SELECTED_WINDOW (emacsframe));
-  
-    rect.size.width = theRange.length * FRAME_COLUMN_WIDTH (emacsframe);
-    rect.size.height = FRAME_LINE_HEIGHT (emacsframe);
-    pt.x = WINDOW_TEXT_TO_FRAME_PIXEL_X (win, win-&gt;phys_cursor.x);
-    pt.y = WINDOW_TO_FRAME_PIXEL_Y (win, win-&gt;phys_cursor.y
-!                                        +FRAME_LINE_HEIGHT (emacsframe)+2);
-  
-    pt = [self convertPoint: pt toView: nil];
-    pt = [[self window] convertBaseToScreen: pt];
-*************** variable `x-use-underline-position-prope
-*** 7173,7178 ****
---- 7221,7230 ----
-  baseline level.  The default value is nil.  */);
-    x_underline_at_descent_line = 0;
-  
-+   DEFVAR_LISP (&quot;mac-in-echo-area&quot;, Vmac_in_echo_area,
-+                doc: /* state of cursor in echo area. */);
-+   Vmac_in_echo_area = Qnil;
-+ 
-    /* Tell emacs about this window system. */
-    Fprovide (intern (&quot;ns&quot;), Qnil);
-  }
-*** ../emacs-24.3.org/configure        2013-03-08 17:13:36.000000000 +0900
---- configure        2013-04-13 23:11:56.000000000 +0900
-*************** if test &quot;${HAVE_NS}&quot; = yes; then
-*** 9650,9656 ****
-       leimdir=&quot;\${ns_appresdir}/leim&quot;
-       INSTALL_ARCH_INDEP_EXTRA=
-    fi
-!   NS_OBJC_OBJ=&quot;nsterm.o nsfns.o nsmenu.o nsselect.o nsimage.o nsfont.o&quot;
-  fi
-  CFLAGS=&quot;$tmp_CFLAGS&quot;
-  CPPFLAGS=&quot;$tmp_CPPFLAGS&quot;
---- 9650,9656 ----
-       leimdir=&quot;\${ns_appresdir}/leim&quot;
-       INSTALL_ARCH_INDEP_EXTRA=
-    fi
-!   NS_OBJC_OBJ=&quot;nsterm.o nsfns.o nsmenu.o nsselect.o nsimage.o nsfont.o macim.o&quot;
-  fi
-  CFLAGS=&quot;$tmp_CFLAGS&quot;
-  CPPFLAGS=&quot;$tmp_CPPFLAGS&quot;
-*************** case &quot;$opsys&quot; in
-*** 24618,24624 ****
-     ## 0x690 is the total size of 30 segment load commands (at 56
-     ## each); under Cocoa 31 commands are required.
-     if test &quot;$HAVE_NS&quot; = &quot;yes&quot;; then
-!      libs_nsgui=&quot;-framework AppKit&quot;
-       headerpad_extra=6C8
-     else
-       libs_nsgui=
---- 24618,24624 ----
-     ## 0x690 is the total size of 30 segment load commands (at 56
-     ## each); under Cocoa 31 commands are required.
-     if test &quot;$HAVE_NS&quot; = &quot;yes&quot;; then
-!      libs_nsgui=&quot;-framework AppKit -framework Carbon -framework Cocoa&quot;
-       headerpad_extra=6C8
-     else
-       libs_nsgui=
-*** ../emacs-24.3.org/configure.ac        2013-03-05 17:24:59.000000000 +0900
---- configure.ac        2013-04-13 23:11:56.000000000 +0900
-*************** if test &quot;${HAVE_NS}&quot; = yes; then
-*** 1571,1577 ****
-       leimdir=&quot;\${ns_appresdir}/leim&quot;
-       INSTALL_ARCH_INDEP_EXTRA=
-    fi
-!   NS_OBJC_OBJ=&quot;nsterm.o nsfns.o nsmenu.o nsselect.o nsimage.o nsfont.o&quot;
-  fi
-  CFLAGS=&quot;$tmp_CFLAGS&quot;
-  CPPFLAGS=&quot;$tmp_CPPFLAGS&quot;
---- 1571,1577 ----
-       leimdir=&quot;\${ns_appresdir}/leim&quot;
-       INSTALL_ARCH_INDEP_EXTRA=
-    fi
-!   NS_OBJC_OBJ=&quot;nsterm.o nsfns.o nsmenu.o nsselect.o nsimage.o nsfont.o macim.o&quot;
-  fi
-  CFLAGS=&quot;$tmp_CFLAGS&quot;
-  CPPFLAGS=&quot;$tmp_CPPFLAGS&quot;
-*************** case &quot;$opsys&quot; in
-*** 4322,4328 ****
-     ## 0x690 is the total size of 30 segment load commands (at 56
-     ## each); under Cocoa 31 commands are required.
-     if test &quot;$HAVE_NS&quot; = &quot;yes&quot;; then
-!      libs_nsgui=&quot;-framework AppKit&quot;
-       headerpad_extra=6C8
-     else
-       libs_nsgui=
---- 4322,4328 ----
-     ## 0x690 is the total size of 30 segment load commands (at 56
-     ## each); under Cocoa 31 commands are required.
-     if test &quot;$HAVE_NS&quot; = &quot;yes&quot;; then
-!      libs_nsgui=&quot;-framework AppKit -framework Carbon -framework Cocoa&quot;
-       headerpad_extra=6C8
-     else
-       libs_nsgui=
</del></span></pre></div>
<a id="trunkdportsaquaemacsappfilespatchmaverickshomediff"></a>
<div class="delfile"><h4>Deleted: trunk/dports/aqua/emacs-app/files/patch-mavericks-home.diff (127177 => 127178)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/dports/aqua/emacs-app/files/patch-mavericks-home.diff        2014-10-22 10:34:11 UTC (rev 127177)
+++ trunk/dports/aqua/emacs-app/files/patch-mavericks-home.diff        2014-10-22 10:36:55 UTC (rev 127178)
</span><span class="lines">@@ -1,19 +0,0 @@
</span><del>---- src/emacs.c.orig        2011-01-09 02:45:14.000000000 +0900
-+++ src/emacs.c        2011-09-09 23:13:44.000000000 +0900
-@@ -1156,10 +1156,13 @@
-   if (!noninteractive)
-     {
- #ifdef NS_IMPL_COCOA
--      if (skip_args &lt; argc)
-+      /* Started from GUI? */
-+      /* FIXME: Do the right thing if getenv returns NULL, or if
-+         chdir fails.  */
-+      if (! inhibit_window_system &amp;&amp; ! isatty (0))
-+        chdir (getenv (&quot;HOME&quot;));
-+      if (skip_args &lt; argc)
-         {
--          /* FIXME: Do the right thing if getenv returns NULL, or if
--             chdir fails.  */
-           if (!strncmp (argv[skip_args], &quot;-psn&quot;, 4))
-             {
-               skip_args += 1;
</del></span></pre></div>
<a id="trunkdportsaquaemacsappfilespatchmavericksmemleakdiff"></a>
<div class="delfile"><h4>Deleted: trunk/dports/aqua/emacs-app/files/patch-mavericks-memleak.diff (127177 => 127178)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/dports/aqua/emacs-app/files/patch-mavericks-memleak.diff        2014-10-22 10:34:11 UTC (rev 127177)
+++ trunk/dports/aqua/emacs-app/files/patch-mavericks-memleak.diff        2014-10-22 10:36:55 UTC (rev 127178)
</span><span class="lines">@@ -1,85 +0,0 @@
</span><del>---- src/nsterm.h
-+++ src/nsterm.h
-@@ -55,6 +55,10 @@ along with GNU Emacs.  If not, see &lt;http://www.gnu.org/licenses/&gt;.  */
- /* We override sendEvent: as a means to stop/start the event loop */
- @interface EmacsApp : NSApplication
- {
-+#if MAC_OS_X_VERSION_MAX_ALLOWED &gt;= MAC_OS_X_VERSION_10_9
-+  BOOL shouldKeepRunning;
-+  BOOL isFirst;
-+#endif
- }
- - (void)logNotification: (NSNotification *)notification;
- - (void)sendEvent: (NSEvent *)theEvent;
-diff --git a/src/nsterm.m b/src/nsterm.m
-index a57e744..324f065 100644
---- src/nsterm.m
-+++ src/nsterm.m
-@@ -3373,7 +3373,7 @@ ns_read_socket (struct terminal *terminal, struct input_event *hold_quit)
-   if ([NSApp modalWindow] != nil)
-     return -1;

--  if (hold_event_q.nr &gt; 0) 
-+  if (hold_event_q.nr &gt; 0)
-     {
-       int i;
-       for (i = 0; i &lt; hold_event_q.nr; ++i)
-@@ -3447,7 +3447,7 @@ ns_select (int nfds, fd_set *readfds, fd_set *writefds,

- /*  NSTRACE (ns_select); */

--  if (hold_event_q.nr &gt; 0) 
-+  if (hold_event_q.nr &gt; 0)
-     {
-       /* We already have events pending. */
-       kill (0, SIGIO);
-@@ -4270,6 +4270,49 @@ ns_term_shutdown (int sig)

- @implementation EmacsApp

-+#if MAC_OS_X_VERSION_MAX_ALLOWED &gt;= MAC_OS_X_VERSION_10_9
-+- (id)init
-+{
-+  if (self = [super init])
-+    self-&gt;isFirst = YES;
-+
-+  return self;
-+}
-+
-+- (void)run
-+{
-+    NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
-+
-+    if (isFirst) [self finishLaunching];
-+    isFirst = NO;
-+
-+    shouldKeepRunning = YES;
-+    do
-+    {
-+        [pool release];
-+        pool = [[NSAutoreleasePool alloc] init];
-+
-+        NSEvent *event =
-+          [self nextEventMatchingMask:NSAnyEventMask
-+                            untilDate:[NSDate distantFuture]
-+                               inMode:NSDefaultRunLoopMode
-+                              dequeue:YES];
-+        [self sendEvent:event];
-+        [self updateWindows];
-+    } while (shouldKeepRunning);
-+
-+    [pool release];
-+}
-+
-+- (void)stop: (id)sender
-+{
-+    shouldKeepRunning = NO;
-+    // Stop possible dialog also.  Noop if no dialog present.
-+    // The file dialog still leaks 7k - 10k on 10.9 though.
-+    [super stop:sender];
-+}
-+#endif
-+
- - (void)logNotification: (NSNotification *)notification
- {
-   const char *name = [[notification name] UTF8String];
</del></span></pre>
</div>
</div>

</body>
</html>