[lisppaste-requests] XML-RPC: setting colorization-mode
Rüdiger Sonderfeld
sonderfeld at gmail.com
Sun May 25 23:16:23 UTC 2008
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hi Brian,
thanks for adding the feature. I enhanced the paste-code to use
colorization based on the current major-mode
(defun mode-to-lisp-org-colorization ()
(case major-mode
('c-mode "C")
('c++-mode "C++")
('common-lisp-mode "Common Lisp")
('emacs-lisp-mode "Emacs Lisp")
('erlang-mode "Erlang")
('haskell-mode "Haskell")
('java-mode "Java")
('lisp-mode "Common Lisp")
('objc-mode "Objective C")
('python-mode "Python")
('scheme-mode "Scheme")
('slime-mode "Common Lisp")
(t "None")))
Best Regards,
Rüdiger
Am 25.05.2008 um 23:41 schrieb Brian Mastenbrook:
> Hello Rüdiger,
>
> Thanks for the comments. I have added support for choosing
> colorization mode at paste time. The updated example code (which
> includes the refinements from your code) shows how it works:
>
> http://common-lisp.net/project/lisppaste/lisppaste.el
>
> Thanks,
>
> Brian
>
> On May 18, 2008, at 3:31 PM, Rüdiger Sonderfeld wrote:
>
>> -----BEGIN PGP SIGNED MESSAGE-----
>> Hash: SHA1
>>
>> Hi,
>> first of all great work! paste.lisp.org is the best pasting site!
>>
>> But I have a feature request for the XML-RPC-mode. It would be
>> great if the colorization-mode could be selected when using the
>> newpaste method.
>>
>> btw. I modified the example Emacs Lisp code if you are interested:
>>
>> ;; Paste to paste.lisp.org
>> (require 'xml-rpc)
>>
>> (defvar lisppaste-nick "ruediger")
>> (defun paste-region-to-lisp-org (region-begin region-end)
>> (interactive "r")
>> (let* ((content (buffer-substring region-begin region-end))
>> (title (read-from-minibuffer "Title: " (buffer-name)))
>> (ret (xml-rpc-method-call "http://common-lisp.net:8185/RPC2"
>> 'newpaste "None" lisppaste-nick
>> title
>> content))
>> (url-beg (search "http://" ret))
>> (url-end (search " " ret :start2 url-beg))
>> (url (substring ret url-beg url-end)))
>> (print ret)
>> (browse-url url)
>> url))
>>
>> Best Regards,
>> Rüdiger Sonderfeld
>>
>>
>> -----BEGIN PGP SIGNATURE-----
>> Version: GnuPG v1.4.8 (Darwin)
>>
>> iEYEARECAAYFAkgwkgkACgkQQaHusPTr7k28xwCfYGPHNYI1oJ5CQsr3D/neP8yw
>> 864AoKSUG88yLWiOMuXxKG5fn+pVU6uE
>> =wu7F
>> -----END PGP SIGNATURE-----
>> _______________________________________________
>> lisppaste-requests mailing list
>> lisppaste-requests at common-lisp.net
>> http://common-lisp.net/cgi-bin/mailman/listinfo/lisppaste-requests
>
> --
> Brian Mastenbrook
> brian at mastenbrook.net
> http://brian.mastenbrook.net/
>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.8 (Darwin)
iEYEARECAAYFAkg580cACgkQQaHusPTr7k2+rQCeP1F4updKaKSJDH1E2Ehe4RfY
icEAoMYDel8PEwhYaZ+k20xwcYLQTVFm
=xseA
-----END PGP SIGNATURE-----
More information about the lisppaste-requests
mailing list