Re: Remember 2.0 released

2008-04-18 Thread Tassilo Horn
Uwe Brauer [EMAIL PROTECTED] writes:

Hi Uwe,

 There is already a package called remember.el by 
 ;;; remember.el --- a mode for quickly jotting down things to remember
 ;; Copyright (C) 1999, 2000, 2001 John Wiegley

 May be you could use another name?

It's the same.  John is the original author, but since then its
maintainers were John Sullivan, Sacha Chua and Michael Olson.

Bye,
Tassilo
-- 
Richard Stallman can solve the halting problem... in polynomial time.



___
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-08-31 Thread Tassilo Horn
[EMAIL PROTECTED] (Michaël Cadilhac) writes:

Hi Michaël,

 (defvar anything-locate-options (if (eq system-type 'darwin)
 '(locate)
   '(locate -i  -r))
   A list where the `car' is the name of the locat program
 followed by options. The search pattern will be appended, so the
 \-r\ option should be the last option.)

 Added.

 Unfortunately, you've also added the typo ;-) -i  instead of -i.

Ah, cool.  Since I added it I was curious what locate complains about an
unknown option.

It's fixed in Git now and I'll upload it to emacswiki in a second.

Bye,
Tassilo
-- 
A morning without coffee is like something without something else.



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


Re: doc-view.el --- View PDF/PostStript/DVI files in Emacs

2007-08-26 Thread Tassilo Horn
Bill Clementson [EMAIL PROTECTED] writes:

Hi Bill,

 1. It is slow: It would probably be better to provide an async mode
 option. In other words, instead of waiting for the convert process
 to complete, let the user view the pages that have been generated
 and periodically, have doc-view automatically update the
 doc-view-current-files variable with the updated list of pages.

 I don't think that would help much.  The generation of the pictures
 is about the last 5-10% of the transformation.

Please update.  I changed it to use plain ghostscript now, which makes
it about 10 times faster.  The results are nearly as good.  The only
real downside is that I didn't figure out how I can trim the margins,
yet.

Bye,
Tassilo



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


Re: doc-view.el --- View PDF/PostStript/DVI files in Emacs

2007-08-26 Thread Tassilo Horn
Tim X [EMAIL PROTECTED] writes:

Hi Tim,

 5. Dired key: It would be nice to have a defcustom value that would
 specify a dired map key that would call doc-view on a file (with a
 new doc-view function that doesn't prompt for the file name). This
 would make it easier to browse pdf files in dired.

 Good idea.  I'll add that.  Do you have a good suggestion what key
 could be used and is free?

 How about b (for browse) or V (for View)?

 I think 'b' is available. However, you may find it useful to do what I
 did in my txutils.el package. I used defadvice around view-file (which
 is bound to v in dired).

Since I was asked to include doc-view.el in Emacs I'm not sure if
defadvice would be too good.  AFAIK RMS doesn't like it too much.

 So, now if I hit v on a pdf, ps, doc, ppt html etc file, it converts
 the file to either text or html and then displays it in a buffer (in
 the case of html output and .html files, it just uses browse-url to
 display the rendered version).

At least for PS files that may not be the right thing.  Users might want
to view it with `ps-mode' instead.

Bye,
Tassilo
-- 
GNU Emacs is a text editor for Über-Geeks.



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


Re: doc-view.el --- View PDF/PostStript/DVI files in Emacs

2007-08-26 Thread Tassilo Horn
Bill Clementson [EMAIL PROTECTED] writes:

Hi Bill,

 Wow, the performance increase with gs is incredible! That's really
 amazing. :-)

Yep, but it's a bummer that I dunno how to cut of the margins.

 BTW, you might want to add the following bindings to
 doc-view-mode-map:

 (define-key map (kbd C-p)   'scroll-down)
 (define-key map (kbd C-n)   'scroll-up)

Nope. :-)

I'll make C-v and M-v for scrolling, because that's the default.  C-p
and C-n will move to the previous/next page.

BTW: Please open a new thread on gnu.emacs.help for further discussions.
It seems that this group is not intended therfore and I don't want to
hijack it.

Bye,
Tassilo
-- 
When Chuck Norris works out on the Total Gym, the Total Gym feels like
it's been raped.



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


Re: doc-view.el --- View PDF/PostStript/DVI files in Emacs

2007-08-25 Thread Tassilo Horn
Bill Clementson [EMAIL PROTECTED] writes:

Hi Bill,

 Only the Macports install worked on my Powerbook G4 (and that took
 ages to build all the dependencies because Macports builds versions of
 the dependencies that work with the package you're installing even if
 you have non-Macports versions of the same progs installed and in your
 path). Tassilo, please forgive me for all the names I called you this
 afternoon for using git! ;-)

Haha, forgiven.

 But, back to doc-view.el. Did I mention that it is way cool? :-)

Thanks!

 There are a few ways that it could probably be made better though:

 1. It is slow: It would probably be better to provide an async mode
 option. In other words, instead of waiting for the convert process to
 complete, let the user view the pages that have been generated and
 periodically, have doc-view automatically update the
 doc-view-current-files variable with the updated list of pages.

I don't think that would help much.  The generation of the pictures is
about the last 5-10% of the transformation.

 2. Cancel key: There should be a key binding to cancel the convert
 process and (optionally) view what has been generated so far.

I've done that yesterday.  Get the current version.

 3. Page count: It would be useful to have a running update of how many
 pages have been converted so far in the minibuffer (or maybe the mode
 line so that the minibuffer isn't being continually updated and can be
 used for other commands).

See my answer to point 1.

 4. Batch mode: It would be nice to have an option to kick off a batch
 background process to do the conversion. For big documents, it isn't
 really practical to wait till it's been converted.

Well, why do you think you have to wait?  Go on with your work and
eventually the *DocView* buffer pops up.  (That's much better in the
current version now.)

 5. Dired key: It would be nice to have a defcustom value that would
 specify a dired map key that would call doc-view on a file (with a new
 doc-view function that doesn't prompt for the file name). This would
 make it easier to browse pdf files in dired.

Good idea.  I'll add that.  Do you have a good suggestion what key could
be used and is free?

 Did I mention that doc-view is way cool? :-)

And think of how cool it will be in 5 or ten years when we all have
64-core 50 GHz computers with 512 GB RAM!!!

Bye,
Tassilo
-- 
Scotty in Star  Trek often says Ye cannae change  the laws of physics.
This is  untrue. Chuck Norris can  change the laws of  physics. With his
fists.



___
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-08-24 Thread Tassilo Horn
Bill Clementson [EMAIL PROTECTED] writes:

Hi Bill,

 By the way, another thing that used to bug me was having the woman
 initialization done when I didn't configure the man pages source. In
 the end, I got around it by defining the vars in my .emacs file before
 the anything-config require - eg:

 (defvar anything-sources nil Prevent loading of woman)
 (defvar anything-c-source-man-pages nil Prevent loading of woman)
 (require 'anything-config)

 but, anything and anything-config should probably be making certain
 that they don't load things that the user doesn't want loaded.

I really think that's the best you can do.  The only thing to stop
evaluation of those defvars is to wrap them in a

  (when do-i-wanna-use-this-foo-source
 (defvar foo-source ...

which the user would have to set before requiring anything-config.  I
don't think that would be better.

Or do you have a better idea?

Bye,
Tassilo
-- 
Thousands  of years  ago Chuck  Norris  came across  a bear.  It was  so
terrified that it  fled north into the arctic. It  was also so terrified
that all of its decendents now have white hair.



___
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-08-24 Thread Tassilo Horn
Bill Clementson [EMAIL PROTECTED] writes:

Hi Bill,

 Or do you have a better idea?

 Something like the following should work:

 (defvar anything-c-man-pages nil All man pages on system)

 (defvar anything-c-source-man-pages
   `((name . Manual Pages)
 (candidates . (lambda ()
   (if (not anything-c-man-pages)
   (when (require 'woman nil t)
 (woman-file-name )
 (setq anything-c-man-pages 
   (sort (mapcar 'car
 woman-topic-all-completions)
 'string-lessp)))
 anything-c-man-pages)))
 (action . ((Show with Woman . woman)))
 (requires-pattern . 2)))

Oh, yes.  I added something like this for the man and the info source.

Bye,
Tassilo
-- 
Fighting patents one by one  will never eliminate the danger of software
patents,  any  more than  swatting  mosquitoes  will eliminate  malaria.
(Richard M. Stallman)



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


Re: doc-view.el --- View PDF/PostStript/DVI files in Emacs

2007-08-24 Thread Tassilo Horn
Xavier Maillard [EMAIL PROTECTED] writes:

Hi Xavier,

 I'll try to do that this evening.

Ok.  Today I made some major changes to make it more convenient to use,
because doc-view.el is going to be part of GNU Emacs in the near
future.  The current version is in my Git repository and a patch is sent
to emacs-devel. :-)

Bye,
Tassilo
-- 
The  desire  to  be  rewarded  for one's  creativity  does  not  justify
depriving  the world  in  general of  all  or part  of that  creativity.
(Richard M. Stallman)



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


Re: doc-view.el --- View PDF/PostStript/DVI files in Emacs

2007-08-23 Thread Tassilo Horn
Xavier Maillard [EMAIL PROTECTED] writes:

Hi Xavier,

 I've started to write something down onto emacwiki[1]. It needs still
 some work to be usefull.

 [1] http://www.emacswiki.org/cgi-bin/wiki/DocViewMode

I've seen it and I left a comment.  If you want you can upload it to
emacswiki and keep it current.  (I don't do that because I'm laz... ah,
too busy!)

Bye,
Tassilo
-- 
Chuck Norris is not Politically Correct. He is just Correct. Always. 



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


Re: In-buffer viewer for DVI files

2007-08-22 Thread Tassilo Horn
Tassilo Horn [EMAIL PROTECTED] writes:

Hi,

 that's really nice.  Indeed I wanted to write something like that for
 quite some time, but I never did so...

 Anyway, you could make it even better by making it a generic viewer
 for DVI, PostScript and PDF files.  ImageMagick's `convert' tool can
 convert any of those formats to PNG.

 $ convert pdf/dvi/ps file /some/dir/bar.png

 converts every page to a file bar-X.png in /some/dir/ where X is a
 number starting with 0 (page 1).

I started writing that mode and basically it works.  I need to fix some
things before it's really usable, but I think I can post it tomorrow.
:-)

Bye,
Tassilo



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


Re: In-buffer viewer for DVI files

2007-08-21 Thread Tassilo Horn
John Sturdy [EMAIL PROTECTED] writes:

Hi John,

 I found a machine I was using didn't have xdvi, so I wrote some elisp
 to call dvipng and put the resulting pages together in an Emacs
 buffer; then I made it into a major mode, with next and previous
 commands, etc.

that's really nice.  Indeed I wanted to write something like that for
quite some time, but I never did so...

Anyway, you could make it even better by making it a generic viewer for
DVI, PostScript and PDF files.  ImageMagick's `convert' tool can convert
any of those formats to PNG.

$ convert pdf/dvi/ps file /some/dir/bar.png

converts every page to a file bar-X.png in /some/dir/ where X is a
number starting with 0 (page 1).

I'm pretty sure that convert has an option to crop parts of the margins
of the pdf/ps/dvi files, so that you can make best use of the emacs
window's space.

What do you think?

Bye,
Tassilo



___
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-08-20 Thread Tassilo Horn
[EMAIL PROTECTED] writes:

Hi Bill,

 Do you use the latest version of anything-config? Tassilo fixed a bug
 in it shortly after he uploaded the new version.

There was exactly the same bug in the action transformer, too.  I didn't
return the unmodified actions, if the special entry was not selected.

 Yep, I'm using the latest anything-config (anything-c-
 version=2007-08-19 Sun 21:06).

It's fixed now.

Bye,
Tassilo
-- 
Chuck Norris was what Willis was talkin' about. 



___
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-08-19 Thread Tassilo Horn
Tassilo Horn [EMAIL PROTECTED] writes:

Hi,

 Tassilo's solution is good, but I also fixed anything.el, so that
 filtered candidate transformer is run also if the candidate list is
 empty. This is is alternative solution.

 So with the filtered-candidate-transformer attribute you can add an
 Add contact candidate to the list of candidates if it is empty and
 use the action-transformer attribute to change the action list if
 this special candidate is the current selection.

 Hey, that's a very elegant solution.  I'll implement that in
 anything-config.el.

Done and uploaded.

@Tamas: Why is the `anything-pattern' cleared when you hit TAB on a
candidate?  I'd say it's a bug, isn't it?

Bye,
Tassilo
-- 
The  desire  to  be  rewarded  for one's  creativity  does  not  justify
depriving  the world  in  general of  all  or part  of that  creativity.
(Richard M. Stallman)



___
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-08-13 Thread Tassilo Horn
[EMAIL PROTECTED] [EMAIL PROTECTED] writes:

Hi Tamas,

 One more unconventional example. :)

Indeed.

 It's an on-the-fly expression evaluator. You type the list expression
 and it shows the result instantly.

 (setq anything-sources
   '(((name . Calculation Result)
  (requires-pattern)
  (match (lambda (candidate)
   t))
  (candidates  dummy)
  (filtered-candidate-transformer .
   (lambda (candidates source)
 (list
  (condition-case nil
  (prin1-to-string
   (eval (read anything-pattern)))
(error error)
  (action (Do Nothing . ignore)

I renamed it to Evaluation Result and added it.  And I added an
on-the-fly math expression evaluator using `calc-eval' as Calculation
Result source.

Bye,
Tassilo
-- 
VI VI VI - The Roman Number Of The Beast



___
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-08-07 Thread Tassilo Horn
[EMAIL PROTECTED] [EMAIL PROTECTED] writes:

Hi Tamas,

 So it's an adaptive candidate sorter which learns which candidates
 you select frequently and makes them more accessible for you.

 Currently, the history of selections is stored and used per source, so
 for example a different entry is stored when something is selected
 from the File Name History or Recentf and such stored entries are used
 only when sorting File Name History or Recentf, respectively.

 I vaguely remember there was some reason why I selected history
 handling by source, but now I don't really know what's the advantage.
 Shouldn't selection history be stored by type instead, so that for
 example a selection from any file providing source would contribute to
 the common knowledge of what files one selects most frequently?

 What do you think?

I think that would make sense.  But how would you go with sources that
don't have a type field?

BTW: I think I let anything-adaptive out of anything-config as long as
heavy changes and enhancements are likely to happen.  When stuff has
matured, I'm happy to include it.

Bye,
Tassilo
-- 
If Chuck Norris wants your opinion, he'll beat it into you. 



___
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-08-07 Thread Tassilo Horn
[EMAIL PROTECTED] [EMAIL PROTECTED] writes:

 I think that would make sense.  But how would you go with sources
 that don't have a type field?

 I plan to generalize source attributes, so that type would be a
 fallback for those attributes which are not specified by the source.

 So, for example, instead of using anything-candidate-transformers,
 candidate transformation would be a simple source attribute which the
 source could specify directly, or via its type.

 So instead of

 (setq anything-candidate-transformers
   '((file . some-func)))

 it would either be

 (setq anything-sources '((name . Some Source)
  ...
  (candidate-transformer . some-func)))

 or

 (setq anything-sources '((name . Some Source)
  ...
  (type . file)))

 (setq anything-type-attributes
   '((file ((candidate-transformer . some-func)
...
   )))

Shouldn't it be `candidate-transformers' and a list of transformer
functions?  Then there would be no need to add `some-func' whose only
purpose is to aggregate the effects of some other transformer functions.
Then I simply could say

(defvar anything-type-attributes
'((file . (candidate-transformers
   ((anything-c-shadow-boring-files
 anything-c-shorten-home-path
  ...))

 And it would be the same for anything-candidate-transformers and
 anything-action-transformers, so these would all be obsoleted.

 That's of course impacts anything-config.el heavily, so I only want to
 do it if you agree

I agree. I'm not too happy with the current approach because there's
quite a lot duplicate code for action and candidate transformers.

 and when you have the time to work on it.

Well, the changes are not too complex, so I think I could port it to the
new framework in two hours, say.  If you say that the new stuff won't
change in the next time, I'll do it.

 Naturally, everything will be backward compatible until the transition
 is complete, so I won't remove the existing framework until then.

Ok.

 I plan to do it in incremental steps. The first step will be
 generalizing anything-filtered-candidate-transformers. You don't use
 it yet in anything-config.el, so that's the simplest, and it will help
 to finalize the adaptive sorter.

Yeah, that would be good.  I haven't looked into these till now.  Could
you PING me when that's implemented and tell me what source could
benefit from it, so that I can implement it to get a feeling.

 When it's done then the rest can be done incrementally.

 What do you think of this plan?

I think it's a good idea, so lets do it. ;-)

Bye,
Tassilo
-- 
According to  the Bible,  God created the  universe in six  days. Before
that, Chuck Norris created God by snapping his fingers.



___
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-08-04 Thread Tassilo Horn
[EMAIL PROTECTED] [EMAIL PROTECTED] writes:

Hi Tamas,

 Can't you do that with a defadvice?

Sure I can.

Bye,
Tassilo



___
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-08-03 Thread Tassilo Horn
[EMAIL PROTECTED] [EMAIL PROTECTED] writes:

Hi all,

the adaptive sorting thingy sounds great and of course I'm happy to
include it.  But this weekend is full of other tasks and I'm not even
sure if I have any network connection till monday, so this probably has
to wait a bit.

 I plan to remove all the example values and defuns from anything.el
 (except for anything-sources), since Tassilo does a great job with
 anything-config and there is no need to duplicate stuff.

Ah, that would be great.  After Bill told me that he had problems with
the latest changes in anything-config.el (I've removed the
eval-after-load [which was malformed, anyway] and required anything as
last operation in the file) I found out that I can choose between cancer
and pestilence:

  - If I load anything first, I cannot overwrite defvars, which is bad.
  - If I load anything after anything-config, all the defuns will be
redefined by anything which bad, too.

So in either case there are problems.

So if you remove the duplicate functions that would solve all problems
for us.  Could you please copy functions that are needed by
`anything-sources', e.g.  `anything-buffer-list' from anything-config?

I'm not sure, but I think that's the only one.  My version puts the
current buffer to the back of the list, so that you can easily switch
between two buffers without any keys except invoking anything and RET
(assuming the buffer source comes first).

I'll upload a new anything-config.el in 5 minutes that has a correctly
working eval-after-load to ensure that anything is loaded after
anything-config.  Everything should work fine when the functions that
are duplicated are removed from anything.el.

Have a nice weekend!
Tassilo
-- 
If programmers deserve to  be rewarded for creating innovative programs,
by the same  token they deserve to be punished if  they restrict the use
of these programs. (Richard M. Stallman)



___
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-08-02 Thread Tassilo Horn
[EMAIL PROTECTED] [EMAIL PROTECTED] writes:

Hi,

 Is there some reason why the following 2 bindings aren't part of
 anything-map:

 (define-key map (kbd M-v) 'anything-previous-page)
 (define-key map (kbd C-v) 'anything-next-page)


 The only reason is I saw no need, since it's very easy to customize
 the keyboard bindings.

 I don't use the default bindings either and I don't expect others to
 do so. People should tune them to their needs, similarly to anything
 sources, because there is no single default which would appeal to most
 users considering some use iswitchb and some doesn't and even those
 who do use it may or may not use
 anything-iswitchb-dont-touch-iswithcb- keys, etc.

 Actually, the thought already occurred to me anything-config could
 also offer custom keyboard configurations. For example, you could
 submit a configuration to Tassilo for people who prefer the standard
 Emacs bindings and don't use iswitchb, so they don't care if some of
 the bindings override iswitchb functions, because they don't use it.

 Similarly, other alternative keyboard configurations could also be
 offered and people simply would pick what they prefer.

IMHO it's faster to redefine the keymaps to whatever you like than to
read through three or for different keymap definitions to pick one that
fits only most of my needs.

As I don't use iswitchb I've overwritten those bindings:

(define-key anything-map (kbd M-p) 'anything-previous-history-element)
(define-key anything-map (kbd M-n) 'anything-next-history-element)
(define-key anything-map (kbd C-s) 'anything-isearch)
(define-key anything-map (kbd M-v) 'anything-previous-page)
(define-key anything-map (kbd C-v) 'anything-next-page)
(define-key anything-isearch-map (kbd C-s) 'anything-isearch-again)

On the other hand I think that using default keys by default would be
more sensible, because not too much people use iswitchb, I guess. So
maybe it'll be a good idea to add an option to anything-config.el that
defines standard keymaps.

 For example, I use a configuration which respects anything-iswitchb-
 dont-touch-iswithcb-keys, so I can use the standard iswitchb bindings,
 but override those bindings which I don't use in iswitchb.

 I would also like to have the default bindings for C-n  C-p in
 anything-map; however, I guess there's a conflict with binding C-n
 since iswitchb binds it. However, C-v  M-v should be ok to bind.

 If there's no good reason not to bind them, could you please add them
 to anything-map?

 Well, let's see first what Tassilo thinks about the idea above.

Now you've heard it. I'll add an option that will define standard
keymaps before loading anything.el.

What do you think should be its default? Standard keymaps would be more
logical for new users whereas the anything bindings would be good for
compatibility.

Bye,
Tassilo
-- 
Chuck Norris describes human beings as a sociable holder for blood and guts. 



___
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-08-02 Thread Tassilo Horn
[EMAIL PROTECTED] writes:

Hi Bill,

 Great, that works nicely - thanks!

 Could you also add the following:
   (define-key map (kbd C-n)  'anything-next-line)
   (define-key map (kbd C-p)  'anything-previous-line)

Sure. Will be done and uploaded in 5 minutes.

Bye,
Tassilo
-- 
A child of five could understand this! Fetch me a child of five!



___
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-31 Thread Tassilo Horn
[EMAIL PROTECTED] writes:

Hi Bill,

 Hey, that's nice. I'll integrate it in anything-config.el, but I'll
 modify it a bit to have the same interface as the action
 transformers.

Done!

 That would be nice - it would keep the action and candidate transform
 definitions consistent.

Yep.

 If you plan to add my code as an example transform, you probably
 should add delete-dups to it too:

No, I didn't do that, but you can easily add `delete-duplicates' as a
transformer to `anything-candidate-transformers-file'.

Not making it a default operation may save some processing costs for
users that don't need it.

Bye,
Tassilo
-- 
A morning without coffee is like something without something else.



___
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-28 Thread Tassilo Horn
[EMAIL PROTECTED] writes:

Hi Bill,

 It looks like anything-source-imenu was the cause of problems #1, #2,
  #3. A #4 issue that occurs with the anything-source-imenu code in
 anything-config.el is that it causes anything to not work if you call
 anything in a dired buffer. I've commented out the definition in
 anything-config.el and put the following replacement definition for
 anything-source-imenu in my .emacs file - it works ok for me and
 eliminates the 4 problems:

[...]

Thanks, I'll take your version. The imenu thing didn't work for me, too,
and I wanted to take it out again, because it only works if you invoke
anything from source cod buffers.

Thanks,
Tassilo
-- 
People sometimes  ask me if it  is a sin in  the Church of  Emacs to use
vi. Using a free  version of vi is not a sin; it  is a penance. So happy
hacking. (Richard M. Stallman)



___
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-28 Thread Tassilo Horn
[EMAIL PROTECTED] writes:

Hi Bill,

 (defvar anything-locate-options (if (eq system-type 'darwin)
   '(locate)
 '(locate -i  -r))
   A list where the `car' is the name of the locat program
 followed by options. The search pattern will be appended, so the
 \-r\ option should be the last option.)

Added.

Bye,
Tassilo
-- 
A morning without coffee is like something without something else.



___
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-27 Thread Tassilo Horn
[EMAIL PROTECTED] writes:

Hi Bill,

 (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 for adding it to anything-config.el - that's one less thing I
 need to have in my .emacs file! ;-)

Yesterday I enhanced it so that it can add an action to both a source or
a type actions variable. See its docstring for examples.

 An alternative would be to provide (in anything-config.el) a
 standard transformer function for a type and some example
 transforms that others can model their transforms after. For example,
 for the file transforms:

 (defvar anything-transform-actions-file nil Transforms for files.)

 (defun anything-transform-file-actions (actions candidate)
   Append useful actions to the list of actions.
   (when (and (listp actions)
anything-transform-actions-file)
 (loop for func in anything-transform-actions-file
 do (setq actions (or (funcall func actions candidate) actions))
 finally (return actions

 (setq anything-transform-actions-file
   (append anything-transform-actions-file
 '((lambda (actions candidate)
 (if (or (string= (file-name-extension candidate) el)
 (string= (file-name-extension candidate) elc))
 (append actions '((Load Emacs Lisp File . 
 load-file

 (setq anything-transform-actions-file
   (append anything-transform-actions-file
 '((lambda (actions candidate)
 (if (string= darwin (symbol-name system-type))
 (append actions
 '((Open File with default Tool .
(lambda (filename)
  (call-process /usr/bin/open nil 0 nil 
 filename))

 Then, it's just a matter of appending additonal transformers to the
 list.

 What do you think?

I've though about it already, and it's clear to me that some mechanism
like that has to be implemented. I'll give it a try today.

Bye,
Tassilo
-- 
Little  Miss Muffet  sat on  her tuffet,  until Chuck  Norris roundhouse
kicked her into a glacier.



___
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-27 Thread Tassilo Horn
Hi,

now there are the variables

anything-action-transformers-file
anything-action-transformers-buffer
anything-action-transformers-function
...

which should be lists of functions with parameters ACTIONS (the list of
actions so far) and CANDIDATE (the selected file / buffer / function /
...). Those functions may modify the list of actions somehow and return
it.

The function

anything-transform-file-actions

calls each function in `anything-action-transformers-file' and builds
the list of actions then. It's the same for all other types.

So now you can easily write transformer function an add them to the
appropriate `anything-action-transformers-TYPE' list.

Bye,
Tassilo
-- 
Every time  Chuck Norris  smiles, someone dies.  Unless he  smiles while
he's roundhouse kicking someone in the face. Then two people die.



___
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 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-24 Thread Tassilo Horn
Hi Tamas,

there's a little bug in anything.el. Sometimes when I invoke it several
times it'll error:

Debugger entered--Lisp error: (cl-assertion-failed header-pos)
  signal(cl-assertion-failed (header-pos))
  (or header-pos (signal (quote cl-assertion-failed) (list ...)))
  (progn (or header-pos (signal ... ...)) nil)
  (assert header-pos)
  (save-excursion (assert header-pos) (goto-char header-pos) 
(buffer-substring-no-properties (line-beginning-position) (line-end-position)))
  (let* ((header-pos ...) (source-name ...) (source ...) (action ...) (type 
...)) (unless action (unless type ...) (setq action ...)) (let* (...) (if 
transformer ... action)))
  (save-current-buffer (set-buffer anything-buffer) (let* (... ... ... ... ...) 
(unless action ... ...) (let* ... ...)))
  (with-current-buffer anything-buffer (let* (... ... ... ... ...) (unless 
action ... ...) (let* ... ...)))
  (if (= (buffer-size ...) 0) nil (with-current-buffer anything-buffer (let* 
... ... ...)))
  (unless (= (buffer-size ...) 0) (with-current-buffer anything-buffer (let* 
... ... ...)))
  anything-get-action()
  (if anything-saved-sources (anything-get-selection) (anything-get-action))
  (let* ((selection ...) (action ...)) (if (anything-list-but-not-lambda-p 
action) (setq action ...)) (if (and selection action) (funcall action 
selection)))
  anything-execute-selection-action()
  anything()
  call-interactively(anything)

If I kill the *anything* buffer it works again.

Bye,
Tassilo
-- 
People sometimes  ask me if it  is a sin in  the Church of  Emacs to use
vi. Using a free  version of vi is not a sin; it  is a penance. So happy
hacking. (Richard M. Stallman)



___
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-24 Thread Tassilo Horn
[EMAIL PROTECTED] [EMAIL PROTECTED] writes:

Hi Tamas,

 I think it happens only if your start anything when then *anything*
 buffer is current. Did you try it like this too?

Now I did so and it worked as expected.

 Hmm, my bug doesn't occur here anymore, so your bug is about something
 else. I can only do something with it if there is a way to reproduce
 it. I haven't encountered this assertion for quite a while.

Ok, the next time it happens I hope to find a way to reproduce it.

Bye,
Tassilo
-- 
Chuck Norris' tears cure cancer. Too bad he has never cried. Ever. 



___
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-24 Thread Tassilo Horn
[EMAIL PROTECTED] writes:

Hi Bill,

 Where is the repository for anything-config.el? I found an emacs wiki
 page - is that it?

The page on emacswiki that lists all this is

  http://www.emacswiki.org/cgi-bin/wiki/Anything

 Also, what is the best forum for posting mods to anything-config.el?

You can poste additions on that wiki page. If you want to modify
existing code, please clone the git repository and send me a patch or
the url of your repository, so that I can pull your changes.

 Isn't gnu.emacs.sources just supposed to be for source posting and not
 discussions?

Hm, I don't know. Maybe comp.emacs would be more appropriate, or
gnu.emacs.help? (Does anything work on XEmacs?)

 I've added a Mac-specific action to my anything-actions-file:
 (Open File with default Tool . (lambda (filename)
   (call-process /usr/bin/open nil 0
 nil filename)))

As open is not the default tool on all platforms, I thinkt the current
behavior of `anything-actions-file' is better. But you can

  (setq anything-external-commands-list '(open))

so that you save some processing time and only get open as completion
possibility when you choose

  Open File with external Tool.

 And, an action to find the source of an emacs function to the
 anything-actions-function file:
 (Find Function . (lambda (command-name)
 (find-function (intern command-name

Yes, why not? Of course fou could choose Describe Function and then
hit RET on the link...

But I'll add it.

Bye,
Tassilo
-- 
Chuck Norris does, in fact, live in a round house. 



___
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-23 Thread Tassilo Horn
Vagn Johansen [EMAIL PROTECTED] writes:

Hi Vagn,

 Should I add this source to anything-config.el?

 Yes. Call it anything-source-mac-spotlight instead. Few people know
 about mdfind. I only discovered it by accident.

Ok.

 Also I think you should remove the Delete File action in
 anything-actions-file.

At least I use it sometimes, but sorting in a dired action is a good
idea, anyway.

 It is more generic to go to a dired buffer:

  (Dired . (lambda (filename)
   (dired (file-name-directory filename))
   (dired-goto-file filename)))

 Deleting a file in Dired also checks if a corresponding buffer is open
 and offers to kill it.

I could implement this behavior for Delete File, too.

Bye and thanks for the contribution,
Tassilo
-- 
When Chuck Norris talks, everybody listens. And dies. 



___
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-23 Thread Tassilo Horn
Tassilo Horn [EMAIL PROTECTED] writes:

 Hi Vagn,

 Should I add this source to anything-config.el?

 Yes. Call it anything-source-mac-spotlight instead. Few people know
 about mdfind. I only discovered it by accident.

 Ok.

 Also I think you should remove the Delete File action in
 anything-actions-file.

 At least I use it sometimes, but sorting in a dired action is a good
 idea, anyway.

 It is more generic to go to a dired buffer:

  (Dired . (lambda (filename)
   (dired (file-name-directory filename))
   (dired-goto-file filename)))

 Deleting a file in Dired also checks if a corresponding buffer is open
 and offers to kill it.

 I could implement this behavior for Delete File, too.

 Bye and thanks for the contribution,
 Tassilo

DONE!

Bye,
Tassilo
-- 
Little known  medical fact: Chuck Norris invented  the Caesarean section
when he roundhouse-kicked his way out of his monther's womb.



___
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-22 Thread Tassilo Horn
Vagn Johansen [EMAIL PROTECTED] writes:

Hi Vagn,

 Just use the locate-like program mdfind.

 (defvar anything-source-mdfind
   '((name . mdfind)
  (candidates . (lambda ()
  (start-process mdfind-process nil
mdfind anything-pattern)))
  (action . ((Find file . find-file)
  (Open . 
(lambda (file-name)
  (shell-command
(concat open  (shell-quote-argument file-name))
nil)
  (type . file)
  (requires-pattern . 3))
   Source for retrieving files via mdfind.)

 (add-to-list 'anything-sources anything-source-mdfind)

Should I add this source to anything-config.el?

Bye,
Tassilo
-- 
The  desire  to  be  rewarded  for one's  creativity  does  not  justify
depriving  the world  in  general of  all  or part  of that  creativity.
(Richard M. Stallman)



___
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-21 Thread Tassilo Horn
[EMAIL PROTECTED] [EMAIL PROTECTED] writes:

Hi Tamas,

 That's nice, really nice. I'll have a lot of fun adding stuff to
 anything-config.el.

 BTW, don't you want to be in charge of anything-config.el?

Yes, why not? I'll create a emacswiki page for anything.el tomorrow (if
the weather is as bad as the news said).

 It may be better if its development is coordinated rather than
 everyone hacking away on it randomly.

 You seem to be suitable for the job if you're interested. ;)

Sure, I am.

Bye,
Tassilo
-- 
Most people fear the Reaper. Chuck Norris considers him a promising Rookie. 



___
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-20 Thread Tassilo Horn
Hey Tamas,

this patch adds a new buffer type with actions to switch or pop to it,
just displaying it or killing it.

--8---cut here---start-8---
diff -u /home/heimdall/elisp/anything.el.orig /home/heimdall/elisp/anything.el
--- /home/heimdall/elisp/anything.el.orig   2007-07-20 12:00:26.0 
+0200
+++ /home/heimdall/elisp/anything.el2007-07-20 11:59:14.0 +0200
@@ -58,8 +58,7 @@
 ;; This is only an example. Customize it to your own taste!
 (defvar anything-sources `(((name . Buffers)
 (candidates . anything-buffer-list)
-(action . ((Switch to Buffer . switch-to-buffer)
-   (Kill Buffer . kill-buffer
+(type . buffer))
 
((name . File Name History)
 (candidates . file-name-history)
@@ -195,7 +194,11 @@
  (Delete File . (lambda (file)
 (if (y-or-n-p (format Really delete file %s? 
   file))
-(delete-file file)))
+(delete-file file))
+(buffer . ((Switch to Buffer . switch-to-buffer)
+   (Pop to Buffer. pop-to-buffer)
+   (Display Buffer   . display-buffer)
+   (Kill Buffer  . kill-buffer)
   A list of (TYPE . ACTION) pairs specifying actions for sources
   which have no action defined. See the `action' attribute of
   `anything-sources' for possible action values.)

Diff finished.  Fri Jul 20 12:00:44 2007
--8---cut here---end---8---

Bye,
Tassilo
-- 
A child of five could understand this! Fetch me a child of five!



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