s***@gmail.com
2017-12-01 02:58:38 UTC
Hi,
I am running GNU Emacs 25.3 (9.0).
Trying to open a .pyc file (compiled python) while uncompile (using uncompyle2) it to the buffer.
Modified format-alist like this but it didn't work while I open a .pyc file, it still shows the binary.
(add-to-list 'format-alist '(pyc ; name
"" ; doc-str
"\\u03f30d0a" ; regexp
"/usr/local/bin/uncompyle2" ; from-fn
nil ; to-fn
nil ; modify
nil ; mode-fn
nil)) ; preserve
03f30d0a is the magic code of the .pyc file which I have double checked. However, I am not sure if "\\u03f30d0a" is right way to do the regex on hex.
Not much sample code I can look around, any help would be highly appreciated!
Thanks,
Larry
I am running GNU Emacs 25.3 (9.0).
Trying to open a .pyc file (compiled python) while uncompile (using uncompyle2) it to the buffer.
Modified format-alist like this but it didn't work while I open a .pyc file, it still shows the binary.
(add-to-list 'format-alist '(pyc ; name
"" ; doc-str
"\\u03f30d0a" ; regexp
"/usr/local/bin/uncompyle2" ; from-fn
nil ; to-fn
nil ; modify
nil ; mode-fn
nil)) ; preserve
03f30d0a is the magic code of the .pyc file which I have double checked. However, I am not sure if "\\u03f30d0a" is right way to do the regex on hex.
Not much sample code I can look around, any help would be highly appreciated!
Thanks,
Larry