From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/27188 Path: main.gmane.org!not-for-mail From: Andrew J Cosgriff Newsgroups: gmane.emacs.gnus.general Subject: gnus-summary-save-article help Date: Wed, 24 Nov 1999 00:31:10 GMT Organization: horns. teeth. amazement. what ? Sender: owner-ding@hpc.uh.edu Message-ID: <1yemdgwx1i.fsf@earthling.aia.aig.com.au> NNTP-Posting-Host: coloc-standby.netfonds.no Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: main.gmane.org 1035164259 23297 80.91.224.250 (21 Oct 2002 01:37:39 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Mon, 21 Oct 2002 01:37:39 +0000 (UTC) Return-Path: Original-Received: from bart.math.uh.edu (bart.math.uh.edu [129.7.128.48]) by sclp3.sclp.com (8.8.5/8.8.5) with ESMTP id TAA19266 for ; Tue, 23 Nov 1999 19:32:17 -0500 (EST) Original-Received: from sina.hpc.uh.edu (lists@Sina.HPC.UH.EDU [129.7.3.5]) by bart.math.uh.edu (8.9.1/8.9.1) with ESMTP id SAB15459; Tue, 23 Nov 1999 18:31:48 -0600 (CST) Original-Received: by sina.hpc.uh.edu (TLB v0.09a (1.20 tibbs 1996/10/09 22:03:07)); Tue, 23 Nov 1999 18:32:00 -0600 (CST) Original-Received: from sclp3.sclp.com (root@sclp3.sclp.com [204.252.123.139]) by sina.hpc.uh.edu (8.9.3/8.9.3) with ESMTP id SAA04633 for ; Tue, 23 Nov 1999 18:31:44 -0600 (CST) Original-Received: from sunsite.auc.dk (sunsite.auc.dk [130.225.51.30]) by sclp3.sclp.com (8.8.5/8.8.5) with SMTP id TAA19251 for ; Tue, 23 Nov 1999 19:31:13 -0500 (EST) Original-Received: (qmail 20457 invoked by uid 509); 24 Nov 1999 00:31:11 -0000 Original-To: ding@gnus.org Original-Path: not-for-mail Original-Newsgroups: emacs.ding X-Attribution: ajc X-Face: PBPJ+.AE`FBN4$}HrwwEhJ)x?-5$MQ%Z)svNR@Q\WG6[GDr,}a@8ULwGWBsk,Pqxm!Z- X-PGP-Key-ID: C7BD53F5 X-URI: X-VCard-URI: X-Zippy-Says: After this, I'm going to BURN some RUBBER!! Original-Lines: 21 Original-NNTP-Posting-Host: 203.17.41.38 Original-X-Complaints-To: news@sunsite.auc.dk Original-X-Trace: sunsite.auc.dk 943403470 203.17.41.38 (Wed, 24 Nov 1999 01:31:10 MET) Original-NNTP-Posting-Date: Wed, 24 Nov 1999 01:31:10 MET Precedence: list X-Majordomo: 1.94.jlt7 Xref: main.gmane.org gmane.emacs.gnus.general:27188 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:27188 --=-=-= Ages ago (well, a few months) someone convinced me to hack together some lisp to write the current buffer out to my Palm V with the pilot-memo command-line thang. Then I caught the feeping creature disease and figured it'd be nice to save the current Gnus article, although I never quite got it to work properly - when (gnus-summary-article-subject) gets called it seems to return the subject line of the last article in the summary buffer, rather than the one I'm actually looking at. Help ! The (rather poor) code's attached. --=-=-= Content-Type: application/emacs-lisp Content-Disposition: attachment; filename=pilot-memo.el Content-Description: (try to) save your buffer off to a Palm device ;;; pilot-memo.el - write the current buffer out to ones' Palm device as a memo. ;; ;; Copyright (C) 1999 Andrew J Cosgriff ;; http://polydistortion.net/sw/emacs-lisp/ ;; ;; Author: Andrew J Cosgriff ;; Created: Wed Aug 18 22:31:35 1999 ;; Version: $Id: pilot-memo.el,v 1.7 1999/11/03 09:59:40 ajc Exp $ ;; Keywords: palm pilot memo ;; ;; This program 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. ;; ;; This program 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 this program; if not, you can either send email to this ;; program's maintainer or write to: The Free Software Foundation, ;; Inc.; 59 Temple Place, Suite 330; Boston, MA 02111-1307, USA. ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;;; Commentary: ;; ;; Inspired by David Maslen :) ;; ;; Usage : M-x save-buffer-to-pilot ;; ;; It prompts for the title of the memo. ;; ;;; TO DO: ;; ;; - ask what category to chuck it into ? we set a default now, at ;; least ;; ;; - add hooks for Gnus, w3 to pick the title (or at least suggest ;; one) - gnus done ! ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;;; History: ;; ;; 1.1 - Initial version ;; ;; 1.5 - variables are customizable ;; - allow setting of category to put it in (at customize-time, ;; anyway) ;; - Gnus binding - M-x gnus-summary-save-article-pilot ;; (what to bind this to ?) ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defconst pilot-memo-version (substring "$Revision: 1.7 $" 11 -2) "Version of pilot-memo.") ;; ;;; User Customizable Variables: ;; (defgroup pilot-memo nil "Upload emacs buffers to your Palm device.") (defcustom pilot-memo-category "Emacs" "Default category to upload memos into." :type 'string :group 'pilot-memo) (defcustom pilot-memo-install-memo-program "install-memo" "Program to run that will install the memo onto your Palm device." :type 'string :group 'pilot-memo) (defcustom pilot-memo-device (or (getenv "PILOTPORT") "/dev/ttyS0") "Device name for the serial port to which your Palm's hotsync cable is connected." :type 'string :group 'pilot-memo) ;; ;;; Code: ;; (defun pilot-get-temp-dir () (cond ((boundp 'temp-directory) temp-directory) ((boundp 'temporary-file-directory) temporary-file-directory) (t "."))) (defun save-buffer-to-pilot (title) (interactive (list (read-string "memo title: " (buffer-name)))) (let ((pilot-memo-buffer (get-buffer-create "*pilot-memo*")) (pilot-memo-filename (concat (pilot-get-temp-dir) "/pilot-memo.txt")) (pilot-memo-out-buffer (get-buffer-create "*Shell Command Output*"))) (save-excursion (copy-region-as-kill (point-min) (point-max)) (set-buffer pilot-memo-buffer) (erase-buffer) (insert title "\n") (yank) (delete-windows-on pilot-memo-buffer) (write-file pilot-memo-filename nil)) (kill-buffer pilot-memo-buffer) (message "Press the hotsync button...") (shell-command (concat pilot-memo-install-memo-program " -q -c \"" pilot-memo-category "\" -p " pilot-memo-device " " pilot-memo-filename)) ;; (set-buffer pilot-memo-out-buffer) ;; (if (<= 2 (count-lines (point-min) (point-max))) ;; (progn ;; (message "memo installed !") ;; (pop-to-buffer pilot-memo-out-buffer) ;; (local-set-key "q" (lambda () (interactive) (and (not (one-window-p)) (delete-window) (kill-buffer pilot-memo-out-buffer)))) ;; (shrink-window (- (window-displayed-height) (count-lines (point-min) (point-max)))))) (delete-file pilot-memo-filename))) (defun gnus-summary-save-article-pilot (&optional arg) "Save the current article to a memo on your Palm device. If N is a positive number, save the N next articles. If N is a negative number, save the N previous articles. If N is nil and any articles have been marked with the process mark, save those articles instead." (interactive "P") (let ((gnus-default-article-saver 'gnus-summary-save-in-pilot-memo)) (gnus-summary-save-article arg))) (defun gnus-summary-save-in-pilot-memo (&optional filename) "Save this article to a memo on your Palm device. Optional argument FILENAME specifies file name." (gnus-eval-in-buffer-window gnus-save-article-buffer (save-buffer-to-pilot (read-string "memo title: " (gnus-summary-article-subject))))) ;;; pilot-memo.el ends here --=-=-= Thanks heeps, andrew. -- Andrew J Cosgriff exterminate all rational thought ! ghosts telephone fish steroids zodiac --=-=-=--