emacs-wiki-discuss
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [emacs-wiki-discuss] Mac OS X Services Menu and Remember


From: Bruce Durling
Subject: Re: [emacs-wiki-discuss] Mac OS X Services Menu and Remember
Date: Sun, 5 Mar 2006 19:37:30 -0500

Philip,

Thanks for the suggestion. I'm sorry I haven't thanked you earlier, but I've been buried with work. I'll give you suggestion a go and post back to the list with the results.

I'm using GNU emacs out of cvs rather than Aquamacs, but I think I can figure out how this will fit into that.

cheers,
Bruce

On Feb 26, 2006, at 7:12 AM, Philipp Grau wrote:

Hello,

* Bruce Durling <address@hidden> [25.02.06 10:38]:
Does anyone know enough mac mojo to know how to add remember
selection to this list? I'll keep hunting around myself. Searching
for mac osx services on google is giving me a metric ton of results
and almost all of them don't have anything to do with the services menu.

Well, I have to admit that I have no real clue. But from what I see you have
to:

- Add a entry to Aquamacs Emacs.app/Contents/Info.plist to the
NSServices-Array. Just copy "New Buffer Containing Selection" and modify.

  I tried the following:
----------8<--------snipp---------8<-------------------------
<dict>
   <key>NSKeyEquivalent</key>
   <dict/>
   <key>NSMenuItem</key>
   <dict>
       <key>default</key>
       <string>Aquamacs Emacs/Remember selection</string>
   </dict>
   <key>NSMessage</key>
   <string>remember-selection</string>
   <key>NSPortName</key>
   <string>Aquamacs Emacs</string>
   <key>NSReturnTypes</key>
   <array/>
   <key>NSSendTypes</key>
   <array>
      <string>NSStringPboardType</string>
   </array>
</dict>
----------8<--------snipp---------8<-------------------------

- Modify Aquamacs Emacs.app/Resources/lisp/term/mac-win.el.gz:

Ungzip it and remove Aquamacs Emacs.app/Resources/lisp/term/mac- win.elc.

  Apply the following patch:

----------8<--------snipp---------8<-------------------------

--- mac-win.el.org      2006-02-26 13:03:27.000000000 +0100
+++ mac-win.el  2006-02-26 12:57:48.000000000 +0100
@@ -1543,6 +1543,12 @@
   (save-buffer) ; It pops up the save dialog.
   )

+(defun mac-services-remember-selection ()
+ "Create a new remember buffer containing the selection value for Services"
+  (interactive)
+  (remember)
+  (insert (x-selection-value mac-services-selection))
+  )
 (defun mac-services-mail-selection ()
"Prepare a mail buffer containing the selection value for Services."
   (interactive)
@@ -1572,6 +1578,8 @@
   'mac-services-open-file)
 (define-key mac-apple-event-map [services perform open-selection]
   'mac-services-open-selection)
+(define-key mac-apple-event-map [services perform remember-selection]
+  'mac-services-remember-selection)
 (define-key mac-apple-event-map [services perform mail-selection]
   'mac-services-mail-selection)
 (define-key mac-apple-event-map [services perform mail-to]
----------8<--------snipp---------8<-------------------------

- Logout (in order to reload the services menu)

- Login

- Open Safari, load a page, select some text, open
  Safari->Services->Aquoamacs Emacs->Remember Selection

- Enjoy (hopefully)

This work for me(TM).

Philipp




























































































I'm starting to get some traction with this, but if anyone has solved
it already it would be great to save some time and head scratching.
It would be well cool if this could work, because then I could add
things to planner from any Mac app by just selecting the text. w00t!

cheers,
Bruce
a loyal planner (and now muse-mode) addict
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (Darwin)

iD8DBQFD//GYQtGyfqBKsBwRAqvTAJ0VwK+DmM9R7/yVR426ZHMLUmBLaQCferwJ
UJ+GglJr/JDpHkcDm6Uhwjg=
=qfSF
-----END PGP SIGNATURE-----


_______________________________________________
emacs-wiki-discuss mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/emacs-wiki-discuss
\bye
Philipp


--
 Philipp Grau               | Freie Universitaet Berlin
address@hidden | Zentraleinrichtung fuer Datenverarbeitung
                            |
    We had joy, we had fun, | we had Pacman on the sun...


_______________________________________________
emacs-wiki-discuss mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/emacs-wiki-discuss





reply via email to

[Prev in Thread] Current Thread [Next in Thread]