Printing from the Command Line (and emacs)

Helpful Resource: https://www.cyberciti.biz/tips/linux-unix-sets-the-page-size-to-size.html Command Note lp print with good defaults lpc status all See printer settings lprm clear print jobs export PRINTER='Sharp-MX-2700N’ Set the target printer before printing lpoptions See available options I generally print PDFs, using the excellent pdf-tools. This provides C-c C-p which will print with the $PRINTER and settings you’ve configured, but sometimes you need more customization.

How to find the highlight face in emacs?

https://www.reddit.com/r/emacs/comments/fcernd/how_to_find_the_highlight_face_in_emacs/ The doom themes I try all have too un-obvious a background color for selected text – the text of future matches when doing an interactive search, or the highlight color of matches while I’m spell-checking, or the mark area when I am highlighting a section of text. I assume these are all the same face, because they look the same. Does anyone know which face this should be so I can customize it, and secondly, can tell me how I could figure out the answer to this question on my own without reading a lot of code?

Image previews with helm-follow-mode

When using helm-find-file you can use helm-follow-mode to cause images to show themselves as you move over them, replacing the need to start up some other program to preview images. The shortcut for that while within helm-find-file is C-c C-f. By default, you will be ejected from the follow mode as soon as you move over a non-image file. The following customizatoin will give it a little more tolerance: (setq helm-follow-input-idle-delay 0.

Emacs Gnus delay (schedule) email sending

I always forget how to schedule my emails and it’s a pain to look up because Gnus uses the word “delay” instead of “schedule”, so here it is. Note that for gnus message scheduling (delaying) to work, you will need a line like this in your init file: (gnus-delay-initialize) In a message buffer with Gnus you can execute C-c C-j (gnus-delay-article) to schedule an item for a later sending. After that I see it scheduled in my nndraft:delayed folder with a “date” line describing the time at which it will be sent.

Extracting pages of pdfs

Using qpdf: qpdf --pages ./decree.pdf 1,11 -- ./fulldecree.pdf sup.pdf The cryptic – is because –pages allows pages to be extracted from multiple pdf sources

Bulk multi-line find and replacement with Dired instead of SED

Scenario: I have a directory full of code files (in this case, 51 of them) that each need a find-and-replace executed; however, it is adding a line to part of the code, so replace one line with several. This means that SED cannot do the trick; you’ll get errors like, > > > sed: -e expression #1, char 49: unterminated `s' command Rather than spending the time figuring out how to encode things for SED, the simplest solution was just to use emacs inimitable dired.

Newsticker failure

https://emacs.stackexchange.com/questions/55125/newsticker-failure-wrong-type-argument-listp/55126 Suddenly newsticker is failing to load. I get the following stack trace on error. I have made no recent upgrades. Debugger entered–Lisp error: (wrong-type-argument listp \.\.\.) newsticker–stat-num-items(Bus\ Driver\ Diaries new immortal) apply(newsticker–stat-num-items Bus\ Driver\ Diaries (new immortal)) newsticker–stat-num-items-for-group(Bus\ Driver\ Diaries new immortal) newsticker–treeview-tree-get-tag(“Bus Driver Diaries” nil “feeds-4”) #f(compiled-function (g) #<bytecode 0x2370c3d>)(“Bus Driver Diaries”) mapcar(#f(compiled-function (g) #<bytecode 0x2370c3d>) (“Sacha Chua” “Good Questions” “Quote of the day” “Tory C Anderson” “Bus Driver Diaries” “Dadacity” “Austen Knows Best” “Every Day Miracles” “Vi Hart” “Brain Pickings” “Inside Clojure” “Reddit Clojure” “Reddit Emacs” “Reddit Postgres” “Reddit Programming Languages”))

Orgmode Agenda wasn't showing custom items

I had a problem where my orgmode agenda had stopped displaying my “scheduled” items, which I require for my workflow. I must have been playing around with the customize group when I broke this, because that’s where I found the answer: I had set a non-zero number and needed to reset to 0 here: customize-variable Org Scheduled Delay Days

Gimp change all fonts: use a plugin?

Recently many fonts are unusable in gimp because the underlying Pango library ceased to support bitmap fonts, resulting in the majority of fonts on my system being unusable by Gimp (including anything Adobe). When editing a form I filled out with gimp last year, I need to change all text fields (ie each field of the form) to one of the working fonts. This tedious task demands a more efficient solution if I’m going to be doing it repeatedly; apparently, it might be time for learning gimp plugins.

How to Save an Emacs Keyboard Macro Permanently

Courtesy of gnu manual, we can permanently save a keyboard macro for future use: https://www.gnu.org/software/emacs/manual/html_node/emacs/Save-Keyboard-Macro.html The steps are as follows: perform macro (start with f3, then do your stuff and return to where you started, then stop recording with <f4>) name that macro kmacro-name-last-macro insert macro code into buffer insert-kbd-macro <RET> macro-name I want the ability to go into a let-form and, in the spirit of REPL debugging and development, bind the X VAL part of a (let [ .