Add /private/etc/ssl/cert.pem to gnutls-trustfiles:
Customize variable: gnutls-trustfiles
Select the last [INS]
Bundle filename: /private/etc/ssl/cert.pem
Select [ Apply and Save ]
Since there is a newline after the HTTP headers, the only alternative I'm aware of is using a re-search-forward:
(delete-region (point) (point-min))
is there a way to tell bug-reference-mode to use different URL formats for them?
If you are using Emacs 24+, there most certainly is.
The key to making bug-reference-mode more flexible lies in:
customising bug-reference-bug-regexp to match all your preferred bug reference formats (which should be differentiable); and
It seems to me that the question is a little vague: is the goal to recognize gzip-compressed data? If not, what formats need to be supported?
Focussing on the gzip case:
The way I see it, possible approaches depend on the use case. For instance, if the length of a possibly compressed response is expected to be small, one can try decompressing to test if it ...
To solve this issue it seems sufficient to:
Set gnutls-verify-error to t, and
Add an appropriate trusted root certificate file to gnutls-trustfiles - the default setting for that list does not include any existing files on OS X and it doesn't seem to default to using the system keychain.
This can be done, for example, by installing libressl from homebrew ...
A higher-level alternative to using url-http-end-of-headers, but equally undocumented, is url-insert-file-contents:
(json-parse-buffer :object-type 'alist))
or equivalently, prior to Emacs 27 compiled with native JSON support:
With respect to a "proper API", I think the short answer, at present, is "no" -- unless you are willing to rely on an external library. url-http-end-of-headers seems to be as good as it gets, although it isn't mentioned in the URL Programmer's Manual nor does it appear to be documented in emacs source.
M-x ffap RET does what you want (will be requested a confirmation though). You can bind it to double mouse click with
(global-set-key [double-mouse-1] 'ffap)
As the name suggests, ffap finds files at point, not just URLs. If you want a function tailored to URLs look at the builtin browse-url package (as suggested by Dan), which also lets you choose the ...
I agree with @Constantine, this looks like a bug. Consider submitting a bug report.
As for how to fix it, I personally prefer temporary overriding instead of advices (too many bad experiences with them), but none of the options is ideal.
You can temporarily override functions by wrapping your code in a cl-letf.
(cl-letf (((symbol-function 'url-handle-...
I had the same problem and I have finally got it working.
I applied the patch in https://debbugs.gnu.org/cgi/bugreport.cgi?bug=11788#52.
Then, to solve
error in process filter: url-http-generic-filter: Wrong type argument:
I just had to add a line to url-http.el:462 which was
(skip-chars-forward "HTTP/") ; Skip ...
Emacs search functions (such as re-search-forward, replace-regexp-in-string etc) store the search result as the Match data. The later search overwrites the previous search's Match data by default. If you have to do another search within one search, you need to save & restore the Match data before/after the inner search, Emacs provides save-match-data for ...
Suppose you have copied the link or address you want to process.
After you have created a similar command:
(defun normalize-string-to-make-it-file/path-safe ()
(read-string "Input: ")
You can use "normalize-string-to-make-it-file/path-safe" to ...
Your tern package was compiled with the older Emacs, but the newer Emacs has changed the representation of structs: the [cl-struct-url http nil nil 127.0.0.1 39585 / nil nil nil nil t] in your error message is an "old-style" struct, returned by the old url-parse-make-urlobj. This happens because this function was inlined when tern was compiled.
You can try ...
This took me forever to figure out, but it turns out Spacemacs had cached a bunch of environment variables. One in particular, $XAUTHORITY, was making it so that qutebrowser wouldn't start. Manually editing my spacemacs env file and updating that variable fixed the problem.
In Emacs 26.3 at least, the allowed characters are hard-coded in thing-at-point-bounds-of-url-at-point; so you would need to modify that function accordingly, to add a backslash to the allowed-chars binding. The comments below on escaping would apply here too: use "\\\\". (And likewise for having no idea whether or not this will have unwanted side-effects.)...
browse-url.el can easily be configured that way.
The following section of the doc of browse-url-browser-function is relevant:
If the value is not a function it should be a list of pairs
(REGEXP . FUNCTION). In this case the function called will be the one
associated with the first REGEXP which matches the current URL. The
function is passed the ...
This seems to be a bug in emacs at url-cache-extract with its use of erase-buffer and wiping out that marker. More details when I'm not mobile. I'll be submitting a bug report :-)
This seems to be a bug in either url-http-parse-headers or
url-cache-extract. Before url-http-parse-headers calls
url-cache-extract, url-http-end-of-headers is set correctly.
As the error implies, there was no such file /.../https/com/github/api/.... This is needed by
(url-cache-extract (url-cache-create-filename (url-view-url t)))
in url-http.el. Once I realized that url already had support for HTTP-304 caching, I discovered url-automatic-caching which seems to do the trick. However, now it's not setting url-http-end-of-...
The following minimal example code shows how to hide the urls in md-files:
(defun md-hide-urls ()
"Hide all urls in the current buffer."
(while (re-search-forward "\\(\\[.+\\]\\)\\((.+)\\)" nil t)
(put-text-property (match-beginning 2) (match-end 2) 'invisible t)))
Regular expression search via lisp is ...
,----[ C-h f url-handler-mode RET ]
| url-handler-mode is an interactive autoloaded compiled Lisp function
| in `url-handlers.el'.
| (url-handler-mode &optional ARG)
| Toggle using `url' library for URL filenames (URL Handler mode).
This is an example of what I have in my init file, just customize it a little bit and you're ready to go
(defun duckduckgo (what)
"Use ddg to search for WHAT."
(interactive "sSearch: ")
(browse-url-firefox (concat "https://duckduckgo.com/?t=lm&q="
This looks like a bug in url-handle-content-transfer-encoding: I believe it should check url-inhibit-uncompression. Consider submitting a bug report.
In the meantime you can add advice to this function, making it possible to (temporarily) disable it:
(defvar url-handle-content-transfer-encoding-disable nil)
(advice-add 'url-handle-content-transfer-encoding ...