emacs as mouseless interface to OS X
emacs as mouseless interface to OS X
- Subject: emacs as mouseless interface to OS X
- From: fred lakin <email@hidden>
- Date: Sun, 15 Jul 2007 14:09:31 -0700 (PDT)
This is for the emacs heads, although other folks might find it
mildly interesting, at least until the code starts.
You wrote:
mr> Date: Sun, 15 Jul 2007 11:59:34 -0700
mr> From: Michael Reilly <email@hidden>
mr> Subject: Re: LyX under X11 behaviour
mr> To: Martin Costabel <email@hidden>
mc > no menu bars, no drop-down or pop-up menus,
mr> No great loss - I don't use any of these. I can type a lot faster then the time
mr> it takes to move to the mouse, move the mouse, go through a menu and then get
mr> back to the keyboard.
I too hate to use the mouse unless I'm drawing stuff. It's slow
and hard on the wrist/arm. Also pure menus cascade endlessly when
there are lots of choices in a complex command space. I note that
various third-party pkgs now support keyboard driven "launcher"
(is that right term?) interfaces for OS X.
I use emacs for this. Below find short example that should work;
crude but short.
So, Michael, Martin, Phil and other emacs users out there,
reactions or suggestions?
thanks,
-f
====================================
;;;;*** emacs INTERFACE WITH OS X
;;for calling in code, uses Preview to open path if file is .ps, .pdf, .gif, .jpg ...
(defun preview-on-file (filepath)
(interactive)
(eshell-command (format "open -a /Applications/Preview.app %s" filepath)))
;;for invoking INTERACTIVELY via M-x
; if in dired, then uses Preview on file on that line
; if not in dired, then prompts for file first, then uses Preview on file
(defun command-preview-on-file ()
(interactive)
(let ((filepath (if (in-dired-buffer-p)
(dired-get-filename)
(expand-file-name (read-file-name "Preview on file: ")))))
(when filepath (preview-on-file filepath))))
;;hmmm, some versions of emacs don't have this fun?
(when (not (fboundp 'in-dired-buffer-p))
(defun in-dired-buffer-p ()
(and major-mode (eq major-mode 'dired-mode)))
)
;;the same strategy, eshell-command on app and filepath, seems to work for iTunes and other apps
; ie itunes-on-file, quicktime-on-file, textedit-on-file, neooffice-on-file, vlc-on-file, etc ...
; but some apps -- iPhoto and PhotoShop Elements -- don't seem to honor the command line filepath
; convention. or am I doing something wrong?
_______________________________________________
Do not post admin requests to the list. They will be ignored.
X11-users mailing list (email@hidden)
This email sent to email@hidden