Posts

Showing posts from October, 2021

SVG widget in GNU Emacs

Image
  (Top) SVG sprite sheet (Bottom) widgets from sprite sheet (Left) SVG widget in Emacs buffer Now you can use SVG widget in GNU Emacs. That is, use an SVG image or fragment as background for push-button widget in Emacs buffer. You can also specify the width and height of the widget for finer control. Generally speaking, you can use any type of image for this purpose. But SVG suits best because you can draw widget of any size without any distortion.   The ability to use SVG fragment means you can define multiple symbols in an SVG and use the same as a sprite sheet or a symbol library for your UI requirements. Thus the number of files to be managed is reduced. An SVG symbol library is a simple SVG file with each symbol as a direct descendant of the root node. Video above shows an example of such usage. Another use case would be better looking customize form. Or at the very least, rounded "Save" and "Cancel" buttons. In other words, a more visually appealing UI in grap

SPICE simulation in GNU Emacs

Image
Now you can manage and run SPICE simulation within GNU Emacs using ngspice. To visualize the output, the code uses ngspice control card to run gnuplot.   .emacs ;; Check the location of spice-mode.el (load "~/spice-mode.el") (setq spice-simulator "Ngspice"       spice-waveform-viewer "ngplot") ;; ngplot is a new custom viewer defined in elisp which uses gnuplot   Install ngspice and gnuplot # apt install ngspice gnuplot Download https://gitlab.com/atamariya/emacs/-/blob/dev/lisp/spice-mode.el . Load the file (load "~/spice-mode.el") Open a new buffer and activate mode using M-x spice-mode . Select simulator Ngspice and waveform viewer ngplot via menu or by setting variables (same as in .emacs above). Enter circuit definition. Run the simulation using C-c C-r (spice-compile). Go to error, if any, using 'next-error' ( M-x next-error or M-g n ). Plot the results using C-c C-v (spice-plot). Enter the fields (e.g. int out) to be plotted. S