;;; palm.el --- Install Emacs buffer on a Palm device ;; I'll let somebody else worry about the copyright. This code is the ;; FSF's lpr.el, heavily modified for use in installing a buffer on a ;; PalmOS device by Joe Pfeiffer, July 2000. My work depends heavily ;; enough on theirs that I'm leaving their copyright notice below, and ;; if anybody thinks I have a copyright on my changes I hereby assign ;; any rights I might have to the Free Software Foundation. ;; Copyright (C) 1985, 1988, 1992, 1994 Free Software Foundation, Inc. ;; Maintainer: FSF ;; Keywords: unix ;; This file is part of GNU Emacs. ;; GNU Emacs is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by ;; the Free Software Foundation; either version 2, or (at your option) ;; any later version. ;; GNU Emacs is distributed in the hope that it will be useful, ;; but WITHOUT ANY WARRANTY; without even the implied warranty of ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ;; GNU General Public License for more details. ;; You should have received a copy of the GNU General Public License ;; along with GNU Emacs; see the file COPYING. If not, write to the ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, ;; Boston, MA 02111-1307, USA. ;;; Commentary: ;; Command to install the current buffer on a PalmOS device in iSilo ;; format. Entry points are `palm-install-region' and ;; `palm-install-buffer'. Option variables include ;; `palm-xfer-command-name', `palm-xfer-options', `palm-port-name', ;; `iSilo-command-name' and `iSilo-switches'. ;;; Code: (defgroup palm nil "Install Emacs buffer on Palm device in iSilo format" :group 'wp) ;;;###autoload (defcustom palm-port-name "/dev/palm" "*Name of serial port used to transfer data to Palm, default /dev/palm." :type 'string :group 'palm) (defcustom palm-xfer-switches nil "*List of strings to pass as extra options for the palm-xfer program." :type '(repeat (string :tag "Argument")) :group 'palm) ;;;###autload (defcustom iSilo-switches nil "*List of strings to pass as extra options for the iSilo program." :type '(repeat (string :tag "Argument")) :group 'palm) ;;;###autoload (defcustom palm-xfer-command-name "pilot-xfer" "*Name of program for installing a .pdb file on a Palm." :type 'string :group 'palm) ;;;###autoload (defcustom iSilo-command-name "iSilo386" "*Name of program to convert text into iSilo format." :type 'string :group 'palm) ;;;###autoload (defun palm-install-buffer (name) "Convert buffer contents to iSilo format and install on Palm." (interactive "sName of iSilo Document: ") (palm-install-region-1 (point-min) (point-max) name)) ;;;###autoload (defun palm-install-region (start end name) "Convert region contents to iSilo format and install on Palm." (interactive "rsName of iSilo Document: ") (palm-install-region-1 start end name)) (defun palm-install-region-1 (start end name) (save-excursion (message "Writing to /tmp/iSilo.txt...") (write-region start end "/tmp/iSilo.txt" nil) (message "Converting to iSilo format...") (if iSilo-switches (call-process iSilo-command-name nil nil nil (concat "-i" name) iSilo-switches "/tmp/iSilo.txt") (call-process iSilo-command-name nil nil nil (concat "-i" name) "/tmp/iSilo.txt")) (message "Press hotsync button to transfer to Palm") (if palm-xfer-switches (call-process palm-xfer-command-name nil nil nil palm-port-name palm-xfer-switches "-i" "/tmp/iSilo.pdb") (call-process palm-xfer-command-name nil nil nil palm-port-name "-i" "/tmp/iSilo.pdb")) (delete-file "/tmp/iSilo.txt") (delete-file "/tmp/iSilo.pdb") (message "Done") )) (provide 'palm) ;;; palm.el ends here