unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* recentf-mode works 'by hand' but not if started from .emacs
@ 2007-01-12 15:14 roland.rau
  2007-01-13  0:09 ` B. T. Raven
  2007-01-15  7:38 ` Greg Bognar
  0 siblings, 2 replies; 15+ messages in thread
From: roland.rau @ 2007-01-12 15:14 UTC (permalink / raw)


Dear all,

I wanted to enable the recentf-mode in GNU Emacs.
If I do
M-x recentf-mode
it works fine.
If I write down
(recentf-mode t)
in a Lisp Interaction Bufffer and 'C-x,C-e' it, it also works.

If I put, however, the same code at the end of my .emacs file
(recentf-mode t)
I get an error (without it, I have no errors during startup).

Can somebody tell me what I did wrong?
Thanks,
Roland

As usual, I guess the following information is required:
a) Emacs version
(version)
"GNU Emacs 22.0.50.1 (i386-mingw-nt5.1.2600)
 of 2006-08-30 on W2ONE"
b) Error Protocol (from *Messages*)
(C:\rolandprogs\Emacs\emacs\bin\emacs.exe
--load=C:/rolandprogs/Emacs/EmacsW32/bin/gnuservauto.el)
Loading encoded-kb...done
Adding c:/rolandprogs/Emacs/EmacsW32/lisp/ to load-path
Loading c:/rolandprogs/auctex/auctex-11.14/tex-site.el (source)...done
Loading c:/rolandprogs/ess/ess-5.3.1/lisp/ess-site.el (source)...
Loading regexp-opt...done
enabling speedbar support
Loading c:/rolandprogs/ess/ess-5.3.1/lisp/ess-site.el (source)...done
Loading pc-select...done
Loading delsel...done
Loading time...done
Loading c:/HOME/nc.el (source)...
Loading advice...done
Loading c:/HOME/nc.el (source)...done
Loading paren...done
Loading c:/HOME/haskell-site-file.el (source)...done
Loading c:/HOME/recentf.el (source)...done
Loading c:/HOME/.recentf...done
Cleaning up the recentf list...
Loading cl-macs...done
Cleaning up the recentf list...done


An error has occurred while loading `c:/HOME/.emacs':

Wrong type argument: keymapp, nil

To ensure normal operation, you should investigate and remove the
cause of the error in your initialization file.  Start Emacs with
the `--debug-init' option to view a complete error backtrace.

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: recentf-mode works 'by hand' but not if started from .emacs
  2007-01-12 15:14 recentf-mode works 'by hand' but not if started from .emacs roland.rau
@ 2007-01-13  0:09 ` B. T. Raven
  2007-01-15 17:40   ` Roland Rau
  2007-01-15  7:38 ` Greg Bognar
  1 sibling, 1 reply; 15+ messages in thread
From: B. T. Raven @ 2007-01-13  0:09 UTC (permalink / raw)



<roland.rau@gmail.com> wrote in message
news:1168614875.355310.217590@q2g2000cwa.googlegroups.com...
> Dear all,
>
> I wanted to enable the recentf-mode in GNU Emacs.
> If I do
> M-x recentf-mode
> it works fine.
> If I write down
> (recentf-mode t)
> in a Lisp Interaction Bufffer and 'C-x,C-e' it, it also works.
>
> If I put, however, the same code at the end of my .emacs file
> (recentf-mode t)
> I get an error (without it, I have no errors during startup).
>
> Can somebody tell me what I did wrong?
> Thanks,
> Roland
>
> As usual, I guess the following information is required:
> a) Emacs version
> (version)
> "GNU Emacs 22.0.50.1 (i386-mingw-nt5.1.2600)
>  of 2006-08-30 on W2ONE"
> b) Error Protocol (from *Messages*)
> (C:\rolandprogs\Emacs\emacs\bin\emacs.exe
> --load=C:/rolandprogs/Emacs/EmacsW32/bin/gnuservauto.el)
> Loading encoded-kb...done
> Adding c:/rolandprogs/Emacs/EmacsW32/lisp/ to load-path
> Loading c:/rolandprogs/auctex/auctex-11.14/tex-site.el (source)...done
> Loading c:/rolandprogs/ess/ess-5.3.1/lisp/ess-site.el (source)...
> Loading regexp-opt...done
> enabling speedbar support
> Loading c:/rolandprogs/ess/ess-5.3.1/lisp/ess-site.el (source)...done
> Loading pc-select...done
> Loading delsel...done
> Loading time...done
> Loading c:/HOME/nc.el (source)...
> Loading advice...done
> Loading c:/HOME/nc.el (source)...done
> Loading paren...done
> Loading c:/HOME/haskell-site-file.el (source)...done
> Loading c:/HOME/recentf.el (source)...done
> Loading c:/HOME/.recentf...done
> Cleaning up the recentf list...
> Loading cl-macs...done
> Cleaning up the recentf list...done
>
>
> An error has occurred while loading `c:/HOME/.emacs':
>
> Wrong type argument: keymapp, nil
>
> To ensure normal operation, you should investigate and remove the
> cause of the error in your initialization file.  Start Emacs with
> the `--debug-init' option to view a complete error backtrace.
>

Apparently this variable cannot be set directly, only through the
Customize menu or the function (or command) (recentf-mode). I think I set
these through Customize but I don't understand the syntax. The function
and variable have the same name. Anyway it works:

(custom-set-variables
...
.
 '(recentf-max-menu-items 20)
 '(recentf-max-saved-items 40)
 '(recentf-mode t nil (recentf))
.
.
.
)

This is in 21.3 but I don't see any major differences in this
functionality between vers 21 and 22.

Ed

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: recentf-mode works 'by hand' but not if started from .emacs
  2007-01-12 15:14 recentf-mode works 'by hand' but not if started from .emacs roland.rau
  2007-01-13  0:09 ` B. T. Raven
@ 2007-01-15  7:38 ` Greg Bognar
  2007-01-15 17:41   ` Roland Rau
  1 sibling, 1 reply; 15+ messages in thread
From: Greg Bognar @ 2007-01-15  7:38 UTC (permalink / raw)


On Fri, 12 Jan 2007 07:14:36 -0800, roland.rau wrote:

> Dear all,
> 
> I wanted to enable the recentf-mode in GNU Emacs. If I do
> M-x recentf-mode
> it works fine.
> If I write down
> (recentf-mode t)
> in a Lisp Interaction Bufffer and 'C-x,C-e' it, it also works.
> 
> If I put, however, the same code at the end of my .emacs file
> (recentf-mode t)
> I get an error (without it, I have no errors during startup).
> 
> Can somebody tell me what I did wrong? Thanks,

I have this:

(recentf-mode 1)
(setq recentf-save-file "~/.Emacs/.recentfiles"
      recentf-max-menu-items 18
      recentf-menu-filter 'recentf-show-basenames-ascending)
(load recentf-save-file)

... and it works perfectly.

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: recentf-mode works 'by hand' but not if started from .emacs
  2007-01-13  0:09 ` B. T. Raven
@ 2007-01-15 17:40   ` Roland Rau
  0 siblings, 0 replies; 15+ messages in thread
From: Roland Rau @ 2007-01-15 17:40 UTC (permalink / raw)


B. T. Raven wrote:
> 
> (custom-set-variables
> ...
> .
>  '(recentf-max-menu-items 20)
>  '(recentf-max-saved-items 40)
>  '(recentf-mode t nil (recentf))
> .
> .
> .
> )
I tried it and it produced no errors. But I also had no other behavior. :-(

I thought the simplest solution is to do a global keymapping:
(global-set-key [f8] 'recentf-mode)


Thanks,
Roland

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: recentf-mode works 'by hand' but not if started from .emacs
  2007-01-15  7:38 ` Greg Bognar
@ 2007-01-15 17:41   ` Roland Rau
  2007-01-15 20:40     ` Greg Bognar
  0 siblings, 1 reply; 15+ messages in thread
From: Roland Rau @ 2007-01-15 17:41 UTC (permalink / raw)


Greg Bognar wrote:
> 
> I have this:
> 
> (recentf-mode 1)
> (setq recentf-save-file "~/.Emacs/.recentfiles"
>       recentf-max-menu-items 18
>       recentf-menu-filter 'recentf-show-basenames-ascending)
> (load recentf-save-file)
> 
> ... and it works perfectly.
> 

Thanks, surprisingly the behavior of 'my' emacs did not change. :-(

I thought the simplest solution is to do a global keymapping:
(global-set-key [f8] 'recentf-mode)


Thanks,
Roland

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: recentf-mode works 'by hand' but not if started from .emacs
  2007-01-15 17:41   ` Roland Rau
@ 2007-01-15 20:40     ` Greg Bognar
  2007-01-15 23:44       ` Roland Rau
  0 siblings, 1 reply; 15+ messages in thread
From: Greg Bognar @ 2007-01-15 20:40 UTC (permalink / raw)


On Mon, 15 Jan 2007 12:41:00 -0500, Roland Rau wrote:

> Greg Bognar wrote:
>> 
>> I have this:
>> 
>> (recentf-mode 1)
>> (setq recentf-save-file "~/.Emacs/.recentfiles"
>>       recentf-max-menu-items 18
>>       recentf-menu-filter 'recentf-show-basenames-ascending)
>> (load recentf-save-file)
>> 
>> ... and it works perfectly.
>> 
>> 
> Thanks, surprisingly the behavior of 'my' emacs did not change. :-(
> 
> I thought the simplest solution is to do a global keymapping:
> (global-set-key [f8] 'recentf-mode)

I am a bit confused.  Here's an excerpt from recentf.el:

;;; recentf.el --- setup a menu of recently opened files
[...]
;;; Commentary:

;; This package maintains a menu for visiting files that were operated
;; on recently.  When enabled a new "Open Recent" sub menu is
;; displayed in the "Files" menu. 
[...]

Why do you want to bind it to any key?  You should just put the code in
your .emacs, and use the submenu of the file menu to open recent files. 
Does that work?

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: recentf-mode works 'by hand' but not if started from .emacs
  2007-01-15 20:40     ` Greg Bognar
@ 2007-01-15 23:44       ` Roland Rau
  2007-01-16  3:22         ` Greg Bognar
  0 siblings, 1 reply; 15+ messages in thread
From: Roland Rau @ 2007-01-15 23:44 UTC (permalink / raw)


Greg Bognar wrote:
> On Mon, 15 Jan 2007 12:41:00 -0500, Roland Rau wrote:
> 
>> Greg Bognar wrote:
>>> I have this:
>>>
>>> (recentf-mode 1)
>>> (setq recentf-save-file "~/.Emacs/.recentfiles"
>>>       recentf-max-menu-items 18
>>>       recentf-menu-filter 'recentf-show-basenames-ascending)
>>> (load recentf-save-file)
>>>
> Why do you want to bind it to any key?  You should just put the code in
> your .emacs, and use the submenu of the file menu to open recent files. 
> Does that work?

When I included the aforementioned code snipped in my .emacs file, I had 
the same behavior again as I had in my initial post. So I decided to map 
it to one key and then, surprisingly, everything works...

Thanks,
Roland

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: recentf-mode works 'by hand' but not if started from .emacs
  2007-01-15 23:44       ` Roland Rau
@ 2007-01-16  3:22         ` Greg Bognar
  2007-01-16 15:20           ` Roland Rau
  0 siblings, 1 reply; 15+ messages in thread
From: Greg Bognar @ 2007-01-16  3:22 UTC (permalink / raw)


On Mon, 15 Jan 2007 18:44:14 -0500, Roland Rau wrote:

> Greg Bognar wrote:
>> On Mon, 15 Jan 2007 12:41:00 -0500, Roland Rau wrote:
>> 
>>> Greg Bognar wrote:
>>>> I have this:
>>>>
>>>> (recentf-mode 1)
>>>> (setq recentf-save-file "~/.Emacs/.recentfiles"
>>>>       recentf-max-menu-items 18
>>>>       recentf-menu-filter 'recentf-show-basenames-ascending)
>>>> (load recentf-save-file)
>>>>
>> Why do you want to bind it to any key?  You should just put the code in
>> your .emacs, and use the submenu of the file menu to open recent files.
>> Does that work?
> 
> When I included the aforementioned code snipped in my .emacs file, I had
> the same behavior again as I had in my initial post. So I decided to map
> it to one key and then, surprisingly, everything works...

Do you have the file that holds the list of recent files, that is,
~/.Emacs/.recentfiles (or whatever you set that variable or, if you don't
set it, ~/.recentf, which I think is that default)?  Have you modified the
menus?  What happens if you run Emacs with an ~/.emacs which only
contains the line (recentf-mode 1)?  Do you get the submenu in the File
menu?

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: recentf-mode works 'by hand' but not if started from .emacs
  2007-01-16  3:22         ` Greg Bognar
@ 2007-01-16 15:20           ` Roland Rau
  2007-01-16 16:53             ` rgb
  0 siblings, 1 reply; 15+ messages in thread
From: Roland Rau @ 2007-01-16 15:20 UTC (permalink / raw)


Greg Bognar wrote:
> 
> Do you have the file that holds the list of recent files, that is,
> ~/.Emacs/.recentfiles (or whatever you set that variable or, if you don't
> set it, ~/.recentf, which I think is that default)? 
I have the default setting, i.e .recentf in my home directory.

> Have you modified the menus?  
No.

What happens if you run Emacs with an ~/.emacs which only
> contains the line (recentf-mode 1)?  Do you get the submenu in the File
> menu?
I get the same error message as in my initial post.

Thanks again. Do you have any other idea?

Best,
Roland

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: recentf-mode works 'by hand' but not if started from .emacs
  2007-01-16 15:20           ` Roland Rau
@ 2007-01-16 16:53             ` rgb
  2007-01-16 17:21               ` Roland Rau
  0 siblings, 1 reply; 15+ messages in thread
From: rgb @ 2007-01-16 16:53 UTC (permalink / raw)



Roland Rau wrote:
> Greg Bognar wrote:
> >
> > Do you have the file that holds the list of recent files, that is,
> > ~/.Emacs/.recentfiles (or whatever you set that variable or, if you don't
> > set it, ~/.recentf, which I think is that default)?
> I have the default setting, i.e .recentf in my home directory.
>
> > Have you modified the menus?
> No.
>
> What happens if you run Emacs with an ~/.emacs which only
> > contains the line (recentf-mode 1)?  Do you get the submenu in the File
> > menu?
> I get the same error message as in my initial post.
>
> Thanks again. Do you have any other idea?
> 
You need (require 'recentf) in your .emacs!

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: recentf-mode works 'by hand' but not if started from .emacs
  2007-01-16 16:53             ` rgb
@ 2007-01-16 17:21               ` Roland Rau
  2007-01-16 18:05                 ` rgb
  0 siblings, 1 reply; 15+ messages in thread
From: Roland Rau @ 2007-01-16 17:21 UTC (permalink / raw)


rgb wrote:
> Roland Rau wrote:
>> Greg Bognar wrote:
>>> Do you have the file that holds the list of recent files, that is,
>>> ~/.Emacs/.recentfiles (or whatever you set that variable or, if you don't
>>> set it, ~/.recentf, which I think is that default)?
>> I have the default setting, i.e .recentf in my home directory.
>>
>>> Have you modified the menus?
>> No.
>>
>> What happens if you run Emacs with an ~/.emacs which only
>>> contains the line (recentf-mode 1)?  Do you get the submenu in the File
>>> menu?
>> I get the same error message as in my initial post.
>>
>> Thanks again. Do you have any other idea?
>>
> You need (require 'recentf) in your .emacs!
> 
But this does not give me the menu on top, right?
If I include and have it followed by the (recentf-mode t), I have again 
the same error. :-(

Thanks,
Roland

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: recentf-mode works 'by hand' but not if started from .emacs
  2007-01-16 17:21               ` Roland Rau
@ 2007-01-16 18:05                 ` rgb
  2007-01-16 18:48                   ` Drew Adams
  2007-01-16 20:08                   ` Roland Rau
  0 siblings, 2 replies; 15+ messages in thread
From: rgb @ 2007-01-16 18:05 UTC (permalink / raw)


> >> What happens if you run Emacs with an ~/.emacs which only
> >>> contains the line (recentf-mode 1)?  Do you get the submenu in the File
> >>> menu?
> >> I get the same error message as in my initial post.
> >>
> >> Thanks again. Do you have any other idea?
> >>
> > You need (require 'recentf) in your .emacs!
> >
> But this does not give me the menu on top, right?
> If I include and have it followed by the (recentf-mode t), I have again
> the same error. :-(
>
As I re-read this post 2 things jump out at me.
1) When it 'works' you are doing something that makes recentf autoload
   Thus my suggestion that you need (require 'recentf)
2) every time you get the error you are using (recentf-mode t)
rather than putting '(recentf-mode t) in your (custom-set-variables ...
section.

There is obviously a difference although I have no idea what it might
be.  Turning on debug-on-error should show a trace of the activity that
leads to your error.

^ permalink raw reply	[flat|nested] 15+ messages in thread

* RE: recentf-mode works 'by hand' but not if started from .emacs
  2007-01-16 18:05                 ` rgb
@ 2007-01-16 18:48                   ` Drew Adams
  2007-01-16 20:08                   ` Roland Rau
  1 sibling, 0 replies; 15+ messages in thread
From: Drew Adams @ 2007-01-16 18:48 UTC (permalink / raw)


> 2) every time you get the error you are using (recentf-mode t)
> rather than putting '(recentf-mode t) in your (custom-set-variables ...
> section.

I haven't been following this thread, but shouldn't the arg to recentf-mode
be a number: positive to turn it on, negative to turn it off? IOW, try this
(which is what I use):

 (recentf-mode 1)

This is the standard convention for turning modes on and off, BTW.

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: recentf-mode works 'by hand' but not if started from .emacs
  2007-01-16 18:05                 ` rgb
  2007-01-16 18:48                   ` Drew Adams
@ 2007-01-16 20:08                   ` Roland Rau
  2007-01-17  4:29                     ` Greg Bognar
  1 sibling, 1 reply; 15+ messages in thread
From: Roland Rau @ 2007-01-16 20:08 UTC (permalink / raw)


rgb wrote:
>>>> What happens if you run Emacs with an ~/.emacs which only
>>>>> contains the line (recentf-mode 1)?  Do you get the submenu in the File
>>>>> menu?
>>>> I get the same error message as in my initial post.
>>>>
>>>> Thanks again. Do you have any other idea?
>>>>
>>> You need (require 'recentf) in your .emacs!
>>>
>> But this does not give me the menu on top, right?
>> If I include and have it followed by the (recentf-mode t), I have again
>> the same error. :-(
>>
> As I re-read this post 2 things jump out at me.
> 1) When it 'works' you are doing something that makes recentf autoload
>    Thus my suggestion that you need (require 'recentf)
> 2) every time you get the error you are using (recentf-mode t)
> rather than putting '(recentf-mode t) in your (custom-set-variables ...
> section.
> 
> There is obviously a difference although I have no idea what it might
> be.  Turning on debug-on-error should show a trace of the activity that
> leads to your error.
> 
Thanks for all your help. I am using MS Windows at work but, at home, my 
computer is running GNU/Linux. So I will actually try it out at home. 
Maybe your suggestions work there and this will allow me maybe to narrow 
down what the problem could be.

Thanks,
Roland

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: recentf-mode works 'by hand' but not if started from .emacs
  2007-01-16 20:08                   ` Roland Rau
@ 2007-01-17  4:29                     ` Greg Bognar
  0 siblings, 0 replies; 15+ messages in thread
From: Greg Bognar @ 2007-01-17  4:29 UTC (permalink / raw)


> I am using MS Windows at work but, at home, my computer is running
> GNU/Linux.

If running Emacs with only (recentf-mode 1) in your .emacs produces the
error, then it might be a bug with recentf.el, especially if you do not
get the same error on GNU/Linux.  Let us know.

^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2007-01-17  4:29 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-01-12 15:14 recentf-mode works 'by hand' but not if started from .emacs roland.rau
2007-01-13  0:09 ` B. T. Raven
2007-01-15 17:40   ` Roland Rau
2007-01-15  7:38 ` Greg Bognar
2007-01-15 17:41   ` Roland Rau
2007-01-15 20:40     ` Greg Bognar
2007-01-15 23:44       ` Roland Rau
2007-01-16  3:22         ` Greg Bognar
2007-01-16 15:20           ` Roland Rau
2007-01-16 16:53             ` rgb
2007-01-16 17:21               ` Roland Rau
2007-01-16 18:05                 ` rgb
2007-01-16 18:48                   ` Drew Adams
2007-01-16 20:08                   ` Roland Rau
2007-01-17  4:29                     ` Greg Bognar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).