Posts

Showing posts from August, 2022

Tumblr access from GNU Emacs

Image
Dashboard view (left) and detail view (right) tumblesocks-mode allows you to access Tumblr from GNU Emacs. Best part is - it has pagewise navigation by default instead of endless scroll. Use c for new post, f for follow, l for like and r for reblog. Since the repository is dormant and I needed some customization, I created a fork . It includes some UI changes, fix for emoji display, shorter tumblesocks alias and fix for displaying post at point, like post, reblog post, goto page etc.  

Compose Emoji in GNU Emacs

Image
  Modern emojis are composable - you can compose multiple emojis into a new one. Most commonly, this is done using Zero-Width Joiner or ZWJ character (#200D). Though not all combinations are valid. The valid combinations are defined by the font. e.g. you can combine as follows: Person + rocket = Astronaut Person + manual wheelchair = Person on wheelchair Following function will help you insert ZWJ in between selected text. (defun emoji-compose ()   "Compose emoji from components."   (interactive)   (unless (region-active-p)     (error "Select a sequence of emoji components"))   (let* ((start (1+ (region-beginning)))      (len (- (region-end) start)))     (goto-char start)     (dotimes (i len)       (insert #x200D)       (forward-char)))) For auto-completion, you can use company-emoji . References Unicode defined ZWJ sequences Unicode ZWJ specification  

Comics Builder in GNU Emacs

Image
  Generate comics strip from a script in GNU Emacs. First, create a folder containing artwork. You can use samples from [2]. It should have three subfolders - faces, poses and backgrounds. Images can be GIF, JPG or PNG. Filenames for face and poses follow a convention: <id>-<emotion>.<ext> . Please ensure you have atleast one file for neutral emotion . Set appropriate values for following variables: comics-artwork - Folder containing artwork comics-col-max - Maximum no. of columns (default: 2) comics-emotions - Alist of emotions and words used to describe them comics-avatars - A list of cons cells (FACE-ID . BODY-ID) Open a file containing the script (sample below) and run M-x comics. This will generate an SVG image for the comics strip which will fit the display window. Panels are rendered with fixed font-size so that it is always readable. Actors are assigned an avatar from comics-avatars sequentially as they appear in the script. Normally, all the actors are drawn

Twitter access from GNU Emacs

Image
  twittering-mode allows you to access Twitter from GNU Emacs. If you have curl installed on your system, it mostly works out of the box except for images. Use u for new tweet, RET for reply, and C-c C-m or C-c RET for retweet. For images, you need to follow these instructions . It basically defines a new format string %I for images in (twittering-generate-format-table).  ("I" .        (let* ((entities (cdr (assq 'entity ,status-sym)))               text)          (mapc (lambda (url-info)                  (setq text (or (cdr (assq 'media-url url-info)) "")))                (cdr (assq 'media entities)))          (if (string-equal "" text)              text            (let ((twittering-convert-fix-size 360))              (twittering-make-icon-string nil nil text)))))   You can also change the display format string to suit your needs. Typically, you'd change the faces and the placement of fill string.  (setq twittering-use-native-retweet t tw