rolandwalker / browse-url-dwim Goto Github PK
View Code? Open in Web Editor NEWContext-sensitive external browse URL or Internet search from Emacs
Context-sensitive external browse URL or Internet search from Emacs
Hello Roland,
Some years back, I wrote a browse-url library similar to browse-url-dwim, in that it would search for for urls around the current context, and present a menu to choose from among the urls that were found, if more than one was found. Once you had selected an url though, it would ask you what you wanted to do with it - a selection of web browsers (user-configured), copy, or one could imagine other useful things like bookmarking via org-mode, etc.
This library has remained unfinished and somewhat buggy in my .emacs for several years, and now I am looking around to see whether there is some alternative, or whether I should finish it and make a package, and that is how I discovered browse-url-dwim.
Would you be interested in browse-url-dwim having an optional action menu as I have described, thus we could perhaps combine our efforts instead of there being two very similar browse-url libraries in the world?
Thank you,
John Foerch
(retroj or jjf on Freenode)
I want to bind the (C-c b) to 'org-iswtchb, then did (setq browse-url-dwim-keystrokes nil). But the (C-c b) still is binded to (browse-url-dwim URL). How I can unset it?
Thanks.
I've modified the file browse-url-dwim.el to add a custom variable that lets the user specify the max length for the suggested URL within a prompt. This was necessary because the call to browse-url-dwim-get-url provided no opportunity to pass this value in.
Patch below (minimal modifications needed)
*** /Users/cmcmahan/Downloads/browse-url-dwim-orig.el 2014-07-30 19:35:24.000000000 -0400
--- /Users/cmcmahan/Downloads/browse-url-dwim.el 2014-07-30 19:32:37.000000000 -0400
***************
*** 207,212 ****
--- 207,217 ----
:type 'boolean
:group 'browse-url-dwim)
+ (defcustom browse-url-dwim-max-prompt-length 40
+ "The maximum length for a default URL when prompted."
+ :type 'integer
+ :group 'browse-url-dwim)
+
(defcustom browse-url-dwim-always-confirm-extraction t
"Always prompt for confirmation of URLs detected from context."
:type 'boolean
***************
*** 488,501 ****
The revised string is returned.
! Optional LENGTH-LIMIT (default 40) limits the length of the
! inserted default.
PROMPT-STRING is expected to end with \": \", which will be added if
not present.
DEFAULT-STRING may be nil, in which case no default is inserted."
! (setq length-limit (min (or length-limit 40) (length default-string)))
(save-match-data
(if (not default-string)
(replace-regexp-in-string "[: ]*\\'" ": " prompt-string)
--- 493,507 ----
The revised string is returned.
! Optional LENGTH-LIMIT limits the length of the inserted default.
! Defaults to the value of `browse-url-dwim-max-prompt-length' when
! not specified.
PROMPT-STRING is expected to end with \": \", which will be added if
not present.
DEFAULT-STRING may be nil, in which case no default is inserted."
! (setq length-limit (min (or length-limit browse-url-dwim-max-prompt-length) (length default-string)))
(save-match-data
(if (not default-string)
(replace-regexp-in-string "[: ]*\\'" ": " prompt-string)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.