Posts

Showing posts from April, 2025

Emacs: Binary File Viewer

Image
  Quick visualization tool for Binary data using C header definition. Semantic parses the C header file and generates a type definition. The type definition is passed to bindat-unpack along with the binary data. The result is displayed using speedbar . ;; Note: The command works on the binary data in the current buffer.   M-x hexl-form   (hexl-form)      The image shows the example included in the commentary section of bindat.el .   Conversions (format "%02X" 255) ;; => "FF" (string-to-number "FF" 16) ;; => 255   ;; Little endian unpacking (let* ((bindat-raw [1 2 3 4 5 6 7 8])           (bindat-idx 0))   (bindat--unpack-u64r))   ;; Little endian packing (let* ((bindat-raw [0 0 0 0 0 0 0 0])           (bindat-idx 0))   (bindat--pack-u64r #x0102030405060708)   bindat-raw)      Insert Binary Data Emacs creates a multibyte buffer ...

CEDET: Across the Language Barrier

Image
Emacs at its core is a Lisp interpreter written in C. If you are an Emacs developer, this means you often need to jump between C and Lisp programming languages. CEDET is capable of maintaining project-wide tag database and hence allows the user to seamlessly jump across the definitions in either C or Lisp.    Demo: Jump to definition across Lisp and C (including pre-processor) using CEDET . Note: Emacs provides necessary tools to make development easier.  find-function will also do the job. However, this article is about CEDET. Another useful application is when you are editing an HTML which usually entails editing HTML, CSS and JS. Setup instructions are here: https://lifeofpenguin.blogspot.com/2021/04/gnu-emacs-as-lightweight-ide.html