help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: "Anything" package requires w3m command...


From: Elena
Subject: Re: "Anything" package requires w3m command...
Date: Mon, 20 Dec 2010 05:42:40 -0800 (PST)
User-agent: G2/1.0

On Dec 20, 12:40 pm, Sébastien Vauban <wxhgmqzgw...@spammotel.com>
wrote:
> Hi Elena and Thierry,
>
> Thanks Elena for having gone ahead with this thread... and contacted Thierry.
>
> Regarding `w3m-bookmark', I indeed saw such messages in the past. It must be
> related to the problem.
>
> --8<---------------cut here---------------start------------->8---
> Debugger entered--Lisp error: (error "Install w3m command in `exec-path' or 
> set `w3m-command' variable correctly")
>   signal(error ("Install w3m command in `exec-path' or set `w3m-command' 
> variable correctly"))
>   error("Install w3m command in `exec-path' or set `w3m-command' variable 
> correctly")
>   (progn (error "Install w3m command in `exec-path' or set `w3m-command' 
> variable correctly"))
>   (if (not (stringp w3m-command)) (progn (error "Install w3m command in 
> `exec-path' or set `w3m-command' variable correctly")))
>   (when (not (stringp w3m-command)) (error "Install w3m command in 
> `exec-path' or set `w3m-command' variable correctly"))
>   eval-buffer(#<buffer  *load*<3>> nil "c:/home/sva/src/emacs-w3m/w3m.el" nil 
> t)  ; Reading at buffer position 11512
>   load-with-code-conversion("c:/home/sva/src/emacs-w3m/w3m.el" 
> "c:/home/sva/src/emacs-w3m/w3m.el" nil t)
>   orig-require(w3m nil nil)
>   (let ((my/require-depth ...)) (orig-require feature filename noerror))
>   (cond ((member feature features) (message "%sRequiring `%s' (already 
> loaded)" ... feature)) (t (message "%sRequiring `%s'" ... feature) (let ... 
> ...) (message "%sRequiring `%s'...done" ... feature)))
>   require(w3m)
>   eval-buffer(#<buffer  *load*<2>> nil 
> "c:/home/sva/src/emacs-w3m/w3m-bookmark.el" nil t)  ; Reading at buffer 
> position 1346
>   load-with-code-conversion("c:/home/sva/src/emacs-w3m/w3m-bookmark.el" 
> "c:/home/sva/src/emacs-w3m/w3m-bookmark.el" t t)
>   orig-require(w3m-bookmark nil t)
>   (let ((my/require-depth ...)) (orig-require feature filename noerror))
>   (cond ((member feature features) (message "%sRequiring `%s' (already 
> loaded)" ... feature)) (t (message "%sRequiring `%s'" ... feature) (let ... 
> ...) (message "%sRequiring `%s'...done" ... feature)))
>   require(w3m-bookmark nil t)
>   (progn (require (quote w3m-bookmark) nil t))
>   (eval-when-compile (require (quote w3m-bookmark) nil t))
>   eval-buffer(#<buffer  *load*> nil 
> "c:/home/sva/Downloads/emacs/site-lisp/anything-config/anything-config.el" 
> nil t)  ; Reading at buffer position 176537
>   
> load-with-code-conversion("c:/home/sva/Downloads/emacs/site-lisp/anything-config/anything-config.el"
>  "c:/home/sva/Downloads/emacs/site-lisp/anything-config/anything-config.el" 
> nil t)
>   orig-require(anything-config nil nil)
>   (let ((my/require-depth ...)) (orig-require feature filename noerror))
>   (cond ((member feature features) (message "%sRequiring `%s' (already 
> loaded)" ... feature)) (t (message "%sRequiring `%s'" ... feature) (let ... 
> ...) (message "%sRequiring `%s'...done" ... feature)))
>   require(anything-config)
> --8<---------------cut here---------------end--------------->8---

Yes, that's the same problem.  I think a fix would be to add "emacs-
w3m" directory only when "w3m-command" is defined and available, like
this (snippet not tested, I'm busy right now):

;; Add emacs-w3m path to load-path only when w3m-command is available.
(when w3m-command
        (if (executable-find w3m-command)
                (add-to-list 'load-path "/path/to/emacs-w3m")
                (warn "Executable %s not found, emacs-w3m package not added to 
load-
path." w3m-command))

>
> Now, following Thierry's advice, I've git pull'ed `anything' just 10 min ago,
> and tried to relaunch my Emacs.
>
> I now have a different error (maybe hiding the above one, from a previous
> run):
>
> --8<---------------cut here---------------start------------->8---
> Warning (initialization): An error occurred while loading 
> `c:/home/sva/.emacs':
>
> error: No buffer named *anything*
>
> 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.
> --8<---------------cut here---------------end--------------->8---
>
> and the following backtrace:
>
> with the following lines in my `.emacs':
>
> --8<---------------cut here---------------start------------->8---
>  ;; open anything
>  (when (require 'anything)
>
>    (defun my/anything ()
>      (interactive)
>      (anything :sources
>                '(
>                  anything-c-source-buffers
>                  anything-c-source-file-name-history
>                  ;; anything-c-source-info-pages
>                                         ; get rid of messages echo'ed in
>                                         ; minibuffer prompt
>                  anything-c-source-info-elisp
>                  anything-c-source-man-pages
>                  anything-c-source-locate
>                  anything-c-source-emacs-commands
>                  )
>                :buffer " *my/anything*"))
>
>    ;; select anything
>    (global-set-key (kbd "<f3>") 'my/anything))
>
>  (setq anything-command-map-prefix-key "<f4>")
>
>  (when (require 'anything-config)
>
>    (require 'anything-c-yasnippet)
>
>    ;; source of candidates for anything
>    (anything-set-sources
>     `(
>       ,anything-c-source-buffers
>       ,anything-c-source-file-name-history
>       ,anything-c-source-files-in-current-dir
>       ,anything-c-source-man-pages
>       ,anything-c-source-recentf
>       ,anything-c-source-bookmarks
>       ,anything-c-source-locate      ; find files everywhere
>       ,anything-c-source-emacs-functions
>       ,anything-c-source-info-cl
>       ,anything-c-source-info-elisp
>       ))
>
>    ;; do not show more candidates than this limit from individual
>    ;; sources
>    (setq anything-candidate-number-limit 999)
>
>    ;; the user has to be idle for this many seconds, before candidates
>    ;; from *delayed* sources are collected (useful for sources involving
>    ;; heavy operations, so that candidates from the source are not
>    ;; retrieved unnecessarily if the user keeps typing)
>    (setq anything-idle-delay 0.9) ; 1.3 works nicely
>
>    ;; the user has to be idle for this many seconds, before ALL
>    ;; candidates are collected (also effective for *non-delayed*
>    ;; sources)
>    (setq anything-input-idle-delay 0.4) ; 0.6 works nicely
>
>    ;; uses the current window to show the candidates
>    (setq anything-samewindow t)
>
>    ;; candidates separator of `multiline' source
>    (setq anything-candidate-separator
>          (propertize "--separator-------------------------------"
>                      'face 'separator-face))
>
>    ;; suppress displaying sources which are out of screen at first
>    (setq anything-quick-update t)
>
>    ;; don't save history information to file
>    (remove-hook 'kill-emacs-hook 'anything-c-adaptive-save-history))
> --8<---------------cut here---------------end--------------->8---
>
> Do you have an idea why this is occurring?

I've read something about this issue, but I don't remember what the
fix was.  If I'm not mistaken, creating "*anything*" buffer in advance
fixed the issue.  Sorry for not being able to provide definitive
answers right now.

>
> Best regards,
>   Seb
>
> PS- By far, what I really want `anything' for is the `locate' stuff...
>
> PS2- My `require' is wrapped to output debug messages:
>
> --8<---------------cut here---------------start------------->8---
>          ;; REPLACES ORIGINAL in `C source code' (dumped)
>          ;; redefine require to leave a trace of packages being loaded
>          (if (not (fboundp 'orig-require))
>              (fset 'orig-require (symbol-function 'require))
>            (message "The code to redefine `require' should not be loaded 
> twice"))
>
>          (defvar my/require-depth 0)
>
>          (defun require (feature &optional filename noerror)
>            "Leave a trace of packages being loaded."
>            (cond ((member feature features)
>                   (message "%sRequiring `%s' (already loaded)"
>                            (concat (make-string (* 2 my/require-depth) ? )
>                                    "+-> ")
>                            feature))
>                  (t
>                   (message "%sRequiring `%s'"
>                            (concat (make-string (* 2 my/require-depth) ? )
>                                    "+-> ")
>                            feature)
>                   (let ((my/require-depth (+ 1 my/require-depth)))
>                     (orig-require feature filename noerror))
>                   (message "%sRequiring `%s'...done"
>                            (concat (make-string (* 2 my/require-depth) ? )
>                                    "+-> ")
>                            feature))))))
> --8<---------------cut here---------------end--------------->8---

This is a very useful snippet of code!  Thanks for sharing.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]