GithubHelp home page GithubHelp logo

browse-url-dwim's People

Contributors

rolandwalker avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

browse-url-dwim's Issues

action menu?

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)

Ability to set default length of suggested URL within a prompt

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.