[ESS] Feature Idea: open help in browser when viewing it in an emacs buffer

Vitalie Spinu spinuvit.list at gmail.com
Wed Nov 2 16:05:04 CET 2011


On Wed, Nov 2, 2011 at 12:37 PM, Rainer M Krug <r.m.krug at gmail.com> wrote:
> COuld you please share you emacs config in regard to ido to have a working
> setup for ESS with IDO

I am working on refactoring ess-help.el to use IDO whenever possible +
adding additional functionality like index and vignettes  browsing
listings from emacs. Most likely you will have them by the end of the
week.

Bellow is my set-up to get IDO to work for almost everything. To get
it work for M-x, like in the youtube video, you will need smex.


;;;_* Ido
(require 'ido)
(ido-mode t)

(setq ido-decorations (quote (" {" "}" " " " | ..." "[" "]" " [No
match]" " [Matched]" " [Not readable]" " [Too big]" " [Confirm]")))
(setq ido-enter-matching-directory (quote first))
(setq ido-everywhere t)
(setq ido-max-directory-size 300000)
(setq ido-use-filename-at-point (quote guess))
(setq ido-use-url-at-point t)

(defvar ido-enable-replace-completing-read t
  "If t, use ido-completing-read instead of completing-read if possible.

    Set it to nil using let in around-advice for functions where the
    original completing-read is required.  For example, if a function
    foo absolutely must use the original completing-read, define some
    advice like this:

    (defadvice foo (around original-completing-read-only activate)
      (let (ido-enable-replace-completing-read) ad-do-it))")

;; Replace completing-read wherever possible, unless directed otherwise
(defadvice completing-read
  (around use-ido-when-possible activate)
  (if (or (not ido-enable-replace-completing-read) ; Manual override disable ido
          (and (boundp 'ido-cur-list)
               ido-cur-list)) ; Avoid infinite loop from ido calling this
      ad-do-it
    (let ((allcomp (all-completions "" collection predicate)))
      (if allcomp
          (setq ad-return-value
                (ido-completing-read prompt
                                     allcomp
                                     nil require-match initial-input hist def))
        ad-do-it))))

;;;; ido expceptions
(defadvice write-file (around original-completing-read-only activate)
  (let (ido-enable-replace-completing-read) ad-do-it))

(require 'smex)
(smex-initialize)
(global-set-key (kbd "M-x") 'smex)
(global-set-key (kbd "M-X") 'smex-major-mode-commands)



Vitalie.



More information about the ESS-help mailing list