(defun open-url-on-point()
"open url on point use default browser"
(interactive)
;;(message "%s" (browse-url-url-at-point))
(let ((url (browse-url-url-at-point)))
(if url
(browse-url url)
(error "No URL found")))
)
(with-eval-after-load 'markdown-mode ;;试了markdown 没有效
(define-key markdown-mode-map "<return>" 'open-url-on-point)
)
(with-eval-after-load 'markdown-mode ;;试了markdown 没有效
(define-key markdown-mode-map (kbd "RET") 'open-url-on-point)
)
还是没有效果
我试了这个是可以的呀。
上面if语句的else部分的信息提示换成 (newline)