Using Git Delta with Magit
Git Delta is a command line utility that beautifies git diffs in the terminal. But did you know that it can do the same in Magit too?
Git Delta is a command line utility that beautifies git diffs in the terminal. But did you know that it can do the same in Magit too?
You can phonetically write a non-English language on an English keyword in Emacs, and that transforms into that non-English script. This is called transliteration, and I demonstrate that for the Gujarati language in this post.
How to view GitHub Pull Request branches locally in the cloned repo, and more importantly, how to do that automatically from within Emacs.
Setting a different font for a specific script or language in Emacs.
My diagrammatic take on summarizing all the Emacs advice combinators.
How to define a custom org-global-cycle
-like command that collapses
only the Org subtrees with specific properties.
How I fixed my site content and went down from 46 HTML validations errors down to 0!
Using the org-map-entries
API to loop through selected or all
headings in an Org file.
Quick introduction to Org mode’s :LOGBOOK:
feature and how I use it
to record time-stamped notes for blog post updates.
A guide on how to build Org mode from its main branch and load in Emacs without any path shadowing.
Quick tip on how to create git patch files in Emacs using Magit.
In this post, I introduce a little library I created for ox-hugo
to
have a robust mechanism for generating TOML from any Lisp expression.
Creating a specification for an Emacs-Lisp library to convert Lisp data expressions into easy-to-read TOML strings.
In my previous post, I talked about how info:
Org link export
support got added to ox-hugo
. This post is about making those
exported links a tiny 🤏 bit better.
Journey of Org links from copying (storing) them, inserting them in
Org documents and exporting them. The focus of this post is on the
info:
type Org links, but the same concept would apply to any Org
link type.
A short guide for getting the single quotes rendered as expected
(straight or curved) in Emacs Lisp function and variable documentation
strings and message
outputs.
Using the :around
advice to prevent messages from being displayed in
the echo area or the ∗Messages∗ buffer.
A quick introduction to using ERT (Emacs Lisp Regression Testing) for your next elisp library.
Adding sidenotes using a Hugo shortcode and ox-hugo.
I ventured out to start writing about a 100+ line Emacs Lisp snippet in my config, and then I thought — Wouldn’t it be nice if I can quickly split out that huge snippet into smaller Org Src blocks?
And so this blog post happened.
You write it just like that in the title — “Org” with capital “O”, and then lower-case “mode” separated by a space.
Spoiled by being able to access in-built docs in Emacs at fingertips,
here’s an attempt to kind-of do that for Nim documentation too,
using devdocs.io
.
How to trim the FontAwesome JS for your website, using Emacs Lisp.
My notes on Org Table Spreadsheet feature.
A handy flow-chart if you are confused about when commits happen to
Org bugfix
branch vs main
branch, what ends up in the GNU Elpa
version, and so on.
Using field-formatters to format results of Org table formulae.
Huh? 😕
Well, a mechanic usually wouldn’t give you a time estimate in seconds, but a tool I am using prints something like this at the end:
The simulation took 54227.9 seconds in CPU time.
That triggered me to write a “little” script to convert seconds to human time i.e. time in days, hours, minutes and seconds.
I never quite liked the trend to have upper-cased keywords in Org
documents, like #+TITLE
.
So it was a pleasure to see that trend start changing in this Org
commit.. so that that same keyword would now be written as #+title
.
The Org and Worg git repos can be committed to only via ssh protocol (and not https), and for technical reasons, I cannot commit to those repos via ssh from my primary development machine. So I ended up with a flow that involves pushing commits to those repos using my Nexus 6p phone.
Magit is how I git, and I love to primarily work from the
∗magit-log∗ buffer (M-x magit-status
, l b). But the default
column widths were not optimal on a Nexus 6p 5.7" screen. And that’s
what inspired this tweak, which looks great on a regular desktop
monitor too.
I use emacs – with a server1 and client setup – so that I
can quickly open new files in it using emacsclient
. My typical setup
is to have xterm
+ tmux
on one monitor and a single emacs(client)
frame on another. But there are times when I do not want to
shift focus from one monitor to another, like when I just need to
review some log file. So I started using an alias to emacs -nw -Q
to
quickly open log files, review, filter, and C-x C-c
.
Of course, that’s not where this post ends. An alias was no longer adequate to do what I wanted it to do more ..
Using emacsclient instead of the emacs binary is a very useful technique to prevent loading emacs from scratch each time you open a new file. That technique is useful on Windows too. But for this to work on Windows, we need some more elisp and Windows environment variable configuration than just the below code,
(require 'server)
;; Start a server if (server-running-p) does not return t (e.g. if it
;; returns nil or :other)
(or (eq (server-running-p) t)
(server-start))
In almost all of my ediff
use cases, I would have windows open
side-by-side in a frame, and then I would want to do a diff between
the two using ediff-buffers
.
But emacs doesn’t know that I obviously want to diff those two
side-by-side buffers! So it always asks me to select the buffers to be
diffed. The same problem is when using ediff-files
too.
So I came up with the following helper function to pick the correct
ediff
command.
In Magit buffer *magit: ..*
,
x
origin/master
I am in the process of converting traditional verilog test benches to
SystemVerilog UVM test benches. As per the UVM methodology, it is recommended to
use `uvm_info
instead of $display
statements so that the info
statement
encodes a Message ID and Message Verbosity along with the message required
to be printed.
I won’t go in more detail about UVM and verilog as this post is about how I can save a macro that I use very frequently into an elisp function.
Lately I was having an issue in the org to html conversion where the newline characters got appended with funky unicode characters.
Full detail is in this reddit post I started.
At times you might need your org exported pdf to have the exact font rendering
as generated by a snippet of LaTeX code. To do that, wrap that code inbetween
the \(
and \)
delimiters.
Set the buffer major mode to org-mode
. If the file extension is
.org
, that major mode would be set automatically by emacs.
Follow the below steps to create a table ..
This posts explain how the emacs in-built query-replace-regexp
command can be used to convert upper-cased strings to lower case.
I have a couple of theme packages installed on my emacs but I would like to assign a default theme.
I set the zenburn theme via a function zenburn
. I set the
leuven theme via another function leuven
. But in my emacs
startup I didn’t want to hard-code either of these function and thus
arose the need to set a variable to one of these functions.
Update (2017/02/23) — Now I use GNU Global with Universal
Ctags as back-end to generate the tag files. In emacs, I use the
ggtags
package – [config].
This post still has value if you are interesting in configuring
ctags
only.
This posts shows how to set up ctags
to parse SystemVerilog code and
how to access that tag database in emacs.