Showing posts with label Firefox. Show all posts
Showing posts with label Firefox. Show all posts

Sunday, October 30, 2011

Searching the Internet from any buffer in Emacs

From the post here by Peter Munster, here's a method to search for any keyword that you're reading in the emacs buffer.

(defun pm/region-or-word (prompt)
  "Read a string from the minibuffer, prompting with PROMPT.
If `transient-mark-mode' is non-nil and the mark is active,
it defaults to the current region, else to the word at or before
point. This function returns a list (string) for use in `interactive'."
  (list (read-string prompt (or (and transient-mark-mode mark-active
                                     (buffer-substring-no-properties
                                      (region-beginning) (region-end)))
                            (current-word)))))
 
(defun pm/google (string)
  "Ask a WWW browser to google string.
Prompts for a string, defaulting to the active region or the current word at
or before point."
  (interactive (pm/region-or-word "Google: "))
  (browse-url (concat "http://google.com/search?num=100&q=" string)))

This will work if you have set

;;point to the appropriate browser
(setq browse-url-firefox-program "C:/Program Files/Mozilla Firefox/firefox.exe")

(setq browse-url-browser-function 'browse-url-firefox
          browse-url-new-window-flag nil
          browse-url-firefox-new-window-is-tab t)


Put this in your .emacs and when you see a word or highlight a region, issue a M-x pm/google (you can rename the function to a mnemonic, if you want to) and it will search for the word before point or region in google.  You probably would want to change the search engine if you want to some other search.

Wednesday, January 6, 2010

Firefox and Geolocation services

I think it is a bad idea to have this turned on by default.  There is too little privacy already and anything that triangulates you is a weapon sooner or later.  I have been reading Mozilla's Geolocation page and wondering why the permissions have been designed the way it is.  The default is to share your location and to undo it, you have to do it site by site.

That is weird as you'd probably have to do it laboriously for each site.

Why not have a privacy tab panel to gather the sites that you have already given permission and nuke it selectively or all of them at one go?

Well, I have simply turned off the entire feature by changing the default in the about:config settings as mentioned in the above page.


Monday, June 1, 2009

Firefox users flip out over sneak MS add-on

This is certainly not going to go down well, is it?  Basically, Microsoft is supposedly pushing an add on that users cannot uninstall and probably not want in the first place.

The last paragraph alone is enough to make people think more about switching to Linux.

Methinks, there might be a lawsuit in the offing.