[97048] trunk/dports/aqua/emacs-app

hum at macports.org hum at macports.org
Sat Aug 25 07:22:45 PDT 2012


Revision: 97048
          https://trac.macports.org/changeset/97048
Author:   hum at macports.org
Date:     2012-08-25 07:22:41 -0700 (Sat, 25 Aug 2012)
Log Message:
-----------
emacs-app: add a patchfile of nsterm.m to send control characters via screen sharing, see #35797; set default_variants to +patches.

Modified Paths:
--------------
    trunk/dports/aqua/emacs-app/Portfile

Added Paths:
-----------
    trunk/dports/aqua/emacs-app/files/patch-src_nsterm.m.diff

Modified: trunk/dports/aqua/emacs-app/Portfile
===================================================================
--- trunk/dports/aqua/emacs-app/Portfile	2012-08-25 13:11:32 UTC (rev 97047)
+++ trunk/dports/aqua/emacs-app/Portfile	2012-08-25 14:22:41 UTC (rev 97048)
@@ -5,7 +5,7 @@
 
 name                emacs-app
 version             24.1
-revision            1
+revision            2
 categories          aqua editors
 maintainers         css hum openmaintainer
 
@@ -33,7 +33,10 @@
 
 depends_lib         port:ncurses
 
-patchfiles          patch-src_emacs.c.diff
+# patch-src_nsterm.m.diff
+# https://lists.libreplanet.org/archive/html/emacs-diffs/2012-07/msg00287.html (#35797)
+patchfiles          patch-src_emacs.c.diff \
+                    patch-src_nsterm.m.diff
 
 post-patch {
     reinplace "s|__PREFIX__|${prefix}|" ${worksrcpath}/src/emacs.c
@@ -83,6 +86,8 @@
 
 variant patches requires fullscreen inline description {Add all patches: fullscreen and inline} {}
 
+default_variants    +patches
+
 livecheck.type      regex
 livecheck.url       http://ftp.gnu.org/gnu/emacs/?C=M&O=D
 livecheck.regex     emacs-(\\d+\\.\\d+\\w*)\\.tar

Added: trunk/dports/aqua/emacs-app/files/patch-src_nsterm.m.diff
===================================================================
--- trunk/dports/aqua/emacs-app/files/patch-src_nsterm.m.diff	                        (rev 0)
+++ trunk/dports/aqua/emacs-app/files/patch-src_nsterm.m.diff	2012-08-25 14:22:41 UTC (rev 97048)
@@ -0,0 +1,80 @@
+--- src/nsterm.m.orig      2012-07-13 18:03:10 +0000
++++ src/nsterm.m      2012-07-16 11:02:09 +0000
+@@ -4720,8 +4720,13 @@
+ 
+   if (!processingCompose)
+     {
++      /* When using screen sharing, no left or right information is sent,
++         so use Left key in those cases.  */
++      int is_left_key, is_right_key;
++
+       code = ([[theEvent charactersIgnoringModifiers] length] == 0) ?
+         0 : [[theEvent charactersIgnoringModifiers] characterAtIndex: 0];
++
+       /* (Carbon way: [theEvent keyCode]) */
+ 
+       /* is it a "function key"? */
+@@ -4746,13 +4751,17 @@
+       if (flags & NSShiftKeyMask)
+         emacs_event->modifiers |= shift_modifier;
+ 
+-      if ((flags & NSRightCommandKeyMask) == NSRightCommandKeyMask)
++      is_right_key = (flags & NSRightCommandKeyMask) == NSRightCommandKeyMask;
++      is_left_key = (flags & NSLeftCommandKeyMask) == NSLeftCommandKeyMask
++        || (! is_right_key && (flags & NSCommandKeyMask) == NSCommandKeyMask);
++      
++      if (is_right_key)
+         emacs_event->modifiers |= parse_solitary_modifier
+           (EQ (ns_right_command_modifier, Qleft)
+            ? ns_command_modifier
+            : ns_right_command_modifier);
+ 
+-      if ((flags & NSLeftCommandKeyMask) == NSLeftCommandKeyMask)
++      if (is_left_key)
+         {
+           emacs_event->modifiers |= parse_solitary_modifier
+             (ns_command_modifier);
+@@ -4789,13 +4798,17 @@
+             }
+         }
+ 
+-      if ((flags & NSRightControlKeyMask) == NSRightControlKeyMask)
++      is_right_key = (flags & NSRightControlKeyMask) == NSRightControlKeyMask;
++      is_left_key = (flags & NSLeftControlKeyMask) == NSLeftControlKeyMask
++        || (! is_right_key && (flags & NSControlKeyMask) == NSControlKeyMask);
++
++      if (is_right_key)
+           emacs_event->modifiers |= parse_solitary_modifier
+               (EQ (ns_right_control_modifier, Qleft)
+                ? ns_control_modifier
+                : ns_right_control_modifier);
+ 
+-      if ((flags & NSLeftControlKeyMask) == NSLeftControlKeyMask)
++      if (is_left_key)
+         emacs_event->modifiers |= parse_solitary_modifier
+           (ns_control_modifier);
+ 
+@@ -4806,7 +4819,13 @@
+       left_is_none = NILP (ns_alternate_modifier)
+         || EQ (ns_alternate_modifier, Qnone);
+ 
+-      if ((flags & NSRightAlternateKeyMask) == NSRightAlternateKeyMask)
++      is_right_key = (flags & NSRightAlternateKeyMask)
++        == NSRightAlternateKeyMask;
++      is_left_key = (flags & NSLeftAlternateKeyMask) == NSLeftAlternateKeyMask
++        || (! is_right_key
++            && (flags & NSAlternateKeyMask) == NSAlternateKeyMask);
++
++      if (is_right_key)
+         {
+           if ((NILP (ns_right_alternate_modifier)
+                || EQ (ns_right_alternate_modifier, Qnone)
+@@ -4826,7 +4845,7 @@
+                : ns_right_alternate_modifier);
+         }
+ 
+-      if ((flags & NSLeftAlternateKeyMask) == NSLeftAlternateKeyMask) /* default = meta */
++      if (is_left_key) /* default = meta */
+         {
+           if (left_is_none && !fnKeysym)
+             {   /* accept pre-interp alt comb */
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20120825/50c5034e/attachment.html>


More information about the macports-changes mailing list