Re: ;;; anything.el --- open anything

2007-07-25 Thread Tassilo Horn
[EMAIL PROTECTED] writes:

Hi Bill,

 Actually, the macro should be:

 (defmacro anything-add-to-actions (var action)
   `(setq ,var (cons (car ,var)
   (append
(cdr ,var)
(list ',action)

Yep, that looks nice. I made some little changes, so that multiple
evaluations don't add an action several times and added documentation.

Thanks a lot,
Tassilo
-- 
[Emacs] is written in Lisp, which is the only computer language that is
beautiful.  -- Neal Stephenson, _In the Beginning was the Command Line_



___
gnu-emacs-sources mailing list
gnu-emacs-sources@gnu.org
http://lists.gnu.org/mailman/listinfo/gnu-emacs-sources


Re: ;;; anything.el --- open anything

2007-07-25 Thread Holger Schauer
On 5074 September 1993, [EMAIL PROTECTED] wrote:
 Anything doesn't work on XEmacs (not yet at least). An XEmacs user is
 trying to get it working, but as of now there are showstopper
 problems, so it's not really usable.

FWIW, I have it working here on XEmacs 21.5.twenty-something. A short
list of problems I ran into:

- The require function of XEmacs doesn't take three arguments.
- XEmacs doesn't like a timer value of 0.
- woman doesn't exist (i.e. (when require 'foo) isn't doing 
  what you expect).

Besides that I haven't really used anything up to now, so I may be
missing other problems.

Holger

-- 
---  http://hillview.bugwriter.net/---
Drucker? Wer braucht denn - als _Schueler_ -
 Geraetschaften zum automatischen Beschriften toter Baeume?
  -- Holger Lubitz in de.comp.os.linux.misc
___
gnu-emacs-sources mailing list
gnu-emacs-sources@gnu.org
http://lists.gnu.org/mailman/listinfo/gnu-emacs-sources


install-elisp.el --- Simple Emacs Lisp installer using curl

2007-07-25 Thread rubikitch
 Automate Emacs Lisp installation.
 (1) download Emacs Lisp
 (2) save to your repository
 (3) byte compile
 (4) load
 (5) show Emacs Lisp

 M-x install-elisp
 M-x install-elisp-from-emacswiki

For example, if you want to upgrade anything.el, you have only to issue:
M-x install-elisp-from-emacswiki anything.el

;;; install-elisp.el --- Simple Emacs Lisp installer using curl
;; $Id: install-elisp.el,v 1.2 2007/07/24 10:44:31 rubikitch Exp $

;; Copyright (C) 2007  rubikitch

;; Author: rubikitch [EMAIL PROTECTED]
;; Keywords: lisp, convenience, maint
;; URL: http://www.emacswiki.org/cgi-bin/wiki/download/install-elisp.el

;; This file 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 file 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., 51 Franklin Street, Fifth Floor,
;; Boston, MA 02110-1301, USA.

;;; Commentary:

;; Automate Emacs Lisp installation.
;; (1) download Emacs Lisp
;; (2) save to your repository
;; (3) byte compile
;; (4) load
;; (5) show Emacs Lisp

;;; Installation:

;; To use this program, you must have curl, command-line HTTP client.

;; You need to add to .emacs:  
;;   (require 'install-elisp)
;;   (setq install-elisp-repository-directory ~/emacs/lisp/)

;;; Usage:

;; M-x install-elisp
;; M-x install-elisp-from-emacswiki
;;
;; It is convenient to add to your Emacs Lisp programs:
;;   (install-elisp http://your.site/hogehoge.el;)
;; because users have only to evaluate this sexp by C-x C-e.

;; If you want to complete EmacsWiki pagename, eval:
;;   (install-elisp http://www.emacswiki.org/cgi-bin/wiki/download/oddmuse.el;)
;; It is very convenient to access EmacsWiki with oddmuse.el.

;;; Upgrade this program:

;; Simply eval:
;;  (install-elisp-from-emacswiki install-elisp.el)

;;; Related project:

;; Emacs Lisp Package Archive: http://tromey.com/elpa/

;;; History:

;; $Log: install-elisp.el,v $
;; Revision 1.2  2007/07/24 10:44:31  rubikitch
;; Fixed a serious bug.
;; New variable: install-elisp-use-view-mode
;;
;; Revision 1.1  2007/07/24 10:39:40  rubikitch
;; Initial revision
;;

;;; Code:

(defvar install-elisp-repository-directory nil
  Directory to save Emacs Lisp programs downloaded by install-elisp.el.
You MUST set it in .emacs.

Developer's note: The default is nil to prevent install-elisp from installing 
wrong place.)

(defvar install-elisp-use-view-mode t
  If non-nil, turn on `view-mode' for installed Emacs Lisp program.)

(defun %install-elisp-create-buffer (url)
  (let ((buffer (generate-new-buffer  *install-elisp-tmp*)))
(shell-command (format curl --silent '%s' url) buffer)
(switch-to-buffer buffer)))

;;;###autoload
(defun install-elisp (url optional filename)
  Retrieve Emacs Lisp program from URL and save and byte-compile and load.
If optional FILENAME is supplied, save URL as FILENAME, otherwise URL's 
basename.
  (interactive sInstall Emacs Lisp from URL: )
  (if (null install-elisp-repository-directory)
  (with-output-to-temp-buffer *Help*
(princ You must prepare to use install-elisp program!
Set `install-elisp-repository-directory' to your local Emacs Lisp repository 
directory in your ~/.emacs.

For example: (setq install-elisp-repository-directory \~/emacs/lisp/\)))
(%install-elisp-create-buffer url)
(write-file (expand-file-name (or filename (file-name-nondirectory url))
  install-elisp-repository-directory))
(byte-compile-file buffer-file-name t)
(and install-elisp-use-view-mode (view-mode 1

(defun %install-elisp-from (baseurl)
  Return higher-order function installing from BASEURL, which accepts an 
argument FILENAME.
  `(lambda (filename)
 (install-elisp (concat ,baseurl filename) filename)))

;;;###autoload
(defun install-elisp-from-emacswiki (filename)
  Install Emacs Lisp program from the EmacsWiki.
  (interactive (list (if (fboundp 'oddmuse-read-pagename)
 (oddmuse-read-pagename EmacsWiki)
   (read-string PageName: 
  (funcall (%install-elisp-from 
http://www.emacswiki.org/cgi-bin/wiki/download/;) filename))


(provide 'install-elisp)

;; How to save (DO NOT REMOVE!!)
;; (emacswiki-post install-elisp.el)
;;; install-elisp.el ends here

--
rubikitch
http://www.rubyist.net/~rubikitch/


___
gnu-emacs-sources mailing list
gnu-emacs-sources@gnu.org
http://lists.gnu.org/mailman/listinfo/gnu-emacs-sources


Re: ;;; anything.el --- open anything

2007-07-25 Thread rubikitch
From: [EMAIL PROTECTED] [EMAIL PROTECTED]
Subject: ;;; anything.el --- open anything
Date: Fri, 22 Jun 2007 04:38:35 -0700

 This package provides a single command (M-x anything) and as I type
 the results are shown in a structured format. No need to tell emacs
 first I want to switch to a buffer, open a file or a manual page. See
 the commentary in the header.

Cool! I love it!!

I like menu using `read-char' rather than TAB and digit shortcut.
So I hacked up it.

(defvar anything-select-in-minibuffer-keys asdfjkl;)

;; It is based on anything-select-action, so it needs refactoring.
(defun anything-select-action-in-minibuffer ()
  Select an action for the currently selected candidate in minibuffer.
  (interactive)
  (if anything-saved-sources
  (error Already showing the action list))

  (setq anything-saved-selection (anything-get-selection))
  (unless anything-saved-selection
(error Nothing is selected.))

  (let ((actions (anything-get-action)))
(message %s (apply #'concat
 (loop for action in actions
   for i from 0 collecting
   (format [%c]%s\n
   (elt anything-select-in-minibuffer-keys 
i)
   (car action)
(let* ((key (read-char))
   (idx (rindex anything-select-in-minibuffer-keys key)))
  (or idx (error bad selection))
  (setq anything-saved-action (cdr (elt actions idx)))
  (anything-exit-minibuffer

(defvar anything-saved-action nil
  Saved value of the currently selected action by key.)
;; Redefined
(defun anything-execute-selection-action ()
  If a candidate was selected then perform the associated
action.
  (let* ((selection (if anything-saved-selection
;; the action list is shown
anything-saved-selection
  (anything-get-selection)))
 (action (or anything-saved-action
 (if anything-saved-sources
 ;; the action list is shown
 (anything-get-selection)
   (anything-get-action)

(if (anything-list-but-not-lambda-p action)
;; select the default action
(setq action (cdar action)))

(if (and selection action)
(funcall action selection

(define-key anything-map \C-k 'anything-select-action-in-minibuffer)

--
rubikitch
http://www.rubyist.net/~rubikitch/


___
gnu-emacs-sources mailing list
gnu-emacs-sources@gnu.org
http://lists.gnu.org/mailman/listinfo/gnu-emacs-sources


Re: install-elisp.el --- Simple Emacs Lisp installer using curl

2007-07-25 Thread rubikitch
From: Richard Stallman [EMAIL PROTECTED]
Subject: Re: install-elisp.el --- Simple Emacs Lisp installer using curl
Date: Wed, 25 Jul 2007 16:12:14 -0400

 wget is a GNU package, so we would rather use that.
 Can you make it use wget?

Yes, I updated.

http://www.emacswiki.org/cgi-bin/wiki/download/install-elisp.el
--
rubikitch
http://www.rubyist.net/~rubikitch/


___
gnu-emacs-sources mailing list
gnu-emacs-sources@gnu.org
http://lists.gnu.org/mailman/listinfo/gnu-emacs-sources


Re: install-elisp.el --- Simple Emacs Lisp installer using curl

2007-07-25 Thread Ted Zlatanov
On Thu, 26 Jul 2007 04:45:56 +0900 (JST) [EMAIL PROTECTED] wrote: 

r From: Ted Zlatanov [EMAIL PROTECTED]
r Subject: Re: install-elisp.el --- Simple Emacs Lisp installer using curl
r Date: Wed, 25 Jul 2007 14:16:48 -0400

 I'm attaching a simple patch to customize the retrieval program.  Please
 consider using defcustom instead of defvar, though (I used defvar to be
 consistent).

r Thank you. Updated.

r http://www.emacswiki.org/cgi-bin/wiki/download/install-elisp.el

 (defcustom install-elisp-use-url-retrieve (fboundp 
 'url-retrieve-synchronously)
   If nil, use curl instead.)

 ...

 (defcustom install-elisp-retrieval-program curl --silent '%s'
   URL retrieving program used when `install-elisp-use-url-retrieve' is nil.
 If you use wget, set it to \wget -q -O- '%s'\.)

You can unite these two into a single defcustom that lets you choose
between predefined strings (curl and wget), a symbol ('url-retrieve) and
a user-defined string.  Usually this kind of variable is called a
method, e.g.

(defcustom install-elisp-retrieval-method ...)

And then in your code you say

(if (equal install-elisp-retrieval-method 'url-retrieve)
...
(if (stringp install-elisp-retrieval-method)
...

I hope this helps.

 Also consider security implications of downloading code from a wiki.
 Maybe there could be a way for authors to publish PGP keys outside or
 inside the wiki, and those keys can authenticate the code on the wiki?

r I have already implemented confirmation for security reason.

 (defcustom install-elisp-confirm-flag t
   If non-nil, do install confirmation.
 You should set it non-nil for security reason.)

I don't think this is sufficient.  Users will just answer yes.  If
you're interested in working with the EmacsWiki administrators on
signing source code, you should contact them.  There are better ways of
doing this, is what I'm trying to say.

Ted
___
gnu-emacs-sources mailing list
gnu-emacs-sources@gnu.org
http://lists.gnu.org/mailman/listinfo/gnu-emacs-sources


Re: [OT] Re: realplay.el interface with Real Player v. 1879

2007-07-25 Thread Galen Boyer
On Sat, 21 Jul 2007, [EMAIL PROTECTED] wrote:

 Our message is that non-free software is unjust and illegitimate.  

Hi Richard,

I'm an Oracle professional.  I don't see any free software close to as
good as their database software.  Its a fairly easy argument to make
that if all software were free, Oracle wouldn't be in business,
therefore nobody would be able to use a database as good as Oracle's is
today.

Isn't it a bit of an illegitimate charter to try and get people to not
use the best software available just because it does not have the
freedoms GNU expouses?  If GNU got it way, all the world, in some
cases, would have to be subjected to substandard software just because
all of software had to be free.  In some cases, the world would have to
go without their software needs being fulfilled because there were no
free software to support those needs, at all.

My argument for free software has always been how great the software is
that is free.  For example, I can't praise Emacs enough amongst my
colleagues.  But, at the same time, I've never argued that all software
should be free.  That seems unfair to those using commercial software
that is better than the free alternatives.

-- 
Galen Boyer
___
gnu-emacs-sources mailing list
gnu-emacs-sources@gnu.org
http://lists.gnu.org/mailman/listinfo/gnu-emacs-sources


Re: install-elisp.el --- Simple Emacs Lisp installer using curl

2007-07-25 Thread Richard Stallman
wget is a GNU package, so we would rather use that.
Can you make it use wget?


___
gnu-emacs-sources mailing list
gnu-emacs-sources@gnu.org
http://lists.gnu.org/mailman/listinfo/gnu-emacs-sources


[EMAIL PROTECTED]: install-elisp.el --- Simple Emacs Lisp installer using curl]

2007-07-25 Thread Jürgen Hötzel
On Wed, Jul 25, 2007 at 11:07:07PM +0900, [EMAIL PROTECTED] wrote:

 ;; To use this program, you must have curl, command-line HTTP client.

GNU Emacs provides a builtin URL retrieval tool: Try 'url-retrieve.

Jürgen



___
gnu-emacs-sources mailing list
gnu-emacs-sources@gnu.org
http://lists.gnu.org/mailman/listinfo/gnu-emacs-sources


Re: install-elisp.el --- Simple Emacs Lisp installer using curl

2007-07-25 Thread rubikitch
I updated install-elisp.el. Thank you for quick comments.

http://www.emacswiki.org/cgi-bin/wiki/download/install-elisp.el
;;  (install-elisp-from-emacswiki install-elisp.el)

;; Revision 1.6  2007/07/25 17:58:39  rubikitch
;; New command: dired-install-elisp-from-emacswiki
;;
;; Revision 1.5  2007/07/25 17:50:30  rubikitch
;; `install-elisp-repository-directory': ~/.emacs.d/ by default.
;;
;; Revision 1.4  2007/07/25 17:47:21  rubikitch
;; rename function: %install-elisp-from - install-elisp-from
;;
;; Revision 1.3  2007/07/25 17:46:13  rubikitch
;; use `url-retrieve-synchronously' if available

--
rubikitch
http://www.rubyist.net/~rubikitch/


___
gnu-emacs-sources mailing list
gnu-emacs-sources@gnu.org
http://lists.gnu.org/mailman/listinfo/gnu-emacs-sources


Re: install-elisp.el --- Simple Emacs Lisp installer using curl

2007-07-25 Thread Ted Zlatanov
On Wed, 25 Jul 2007 23:07:07 +0900 (JST) [EMAIL PROTECTED] wrote: 

r  Automate Emacs Lisp installation.
r  (1) download Emacs Lisp
r  (2) save to your repository
r  (3) byte compile
r  (4) load
r  (5) show Emacs Lisp

r  M-x install-elisp
r  M-x install-elisp-from-emacswiki

r For example, if you want to upgrade anything.el, you have only to issue:
r M-x install-elisp-from-emacswiki anything.el

Neat idea.

I'm attaching a simple patch to customize the retrieval program.  Please
consider using defcustom instead of defvar, though (I used defvar to be
consistent).

Also consider security implications of downloading code from a wiki.
Maybe there could be a way for authors to publish PGP keys outside or
inside the wiki, and those keys can authenticate the code on the wiki?

Ted

Index: install-elisp.el
===
RCS file: /home/tzz/cvsroot/emacs/install-elisp.el,v
retrieving revision 1.2
diff -r1.2 install-elisp.el
88a89,90
 (defvar install-elisp-retrieval-program curl --silent '%s')
 
94c96
 (shell-command (format curl --silent '%s' url) buffer)
---
 (shell-command (format install-elisp-retrieval-program url) buffer)
___
gnu-emacs-sources mailing list
gnu-emacs-sources@gnu.org
http://lists.gnu.org/mailman/listinfo/gnu-emacs-sources