GeistHaus
log in · sign up

https://ignaciopp.wordpress.com/feed

rss
10 posts
Polling state
Status active
Last polled May 18, 2026 23:45 UTC
Next poll May 20, 2026 01:50 UTC
Poll interval 86400s
Last-Modified Sun, 15 Mar 2026 22:26:39 GMT

Posts

playful emacs logo
Uncategorized
For pure fun I made this version of the beloved gnu emacs , editor’ name using only parenthesis characters of a fixed (Courier) font. I kind of like the result. Don’t you?
Show full content

For pure fun I made this version of the beloved gnu emacs , editor’ name using only parenthesis characters of a fixed (Courier) font. I kind of like the result. Don’t you?

ignacio
http://ignaciopp.wordpress.com/?p=4532
Extensions
Embark is a keyboard-based UI combinator of relevant command options, a Swiss army knife for working within Emacs.
emacsgnuConsultEmbark
Embark is a keyboard-based UI combinator of relevant command options, a Swiss army knife for working within Emacs. It integrates beautifully with other libraries, like Marginalia and Consult, to compound unobtrusive, powerful means to connect several Emacs parts, simplifying the editing flow and enriching user interactions. The library’s author, Omar Antolín, describes Embarks as a […]
Show full content

Embark is a keyboard-based UI combinator of relevant command options, a Swiss army knife for working within Emacs. It integrates beautifully with other libraries, like Marginalia and Consult, to compound unobtrusive, powerful means to connect several Emacs parts, simplifying the editing flow and enriching user interactions. The library’s author, Omar Antolín, describes Embarks as a tool to provide a keyboard-based equivalent for the right-click contextual menus in GUI apps. That alone, to readily count with such handy assortments of sensitive commands, is an incredible leverage for doing things more efficiently within the editor.

Embark-act allows selecting actions to be called for the object at or near point. It also permits doing additional tasks in flexible ways. So, besides the main action, one could conveniently carry on another task in between. Whether a candidate in a minibuffer selection, a region highlighted, a paragraph where our cursor is, a sexp, or the entire buffer you have open, Embark will handily show you a set of connected possible actions relevant to each target.

This excellent article from Karthinks points out that Embark operates on the premise of a shifted order of doing things. Instead of a “verb -> object” logic, it follows a swapped pattern of “object -> verb” (the grammar for target -> action, in Elisp terms). That is, rather than saying “open <file>”, when presented with a given candidate, it you choose what to do with that file (maybe open, delete it, insert-its-content-into-the-buffer, etc). A bunch of suitable actions appear to be discovered with this reversed grammar model, bringing power —like Yoda speaking in his oddly but wise backward-speech pattern.

Embark significantly boosts the power of users choosing actions. Therefore, any command is accessible to deal with whatever object we pick as a candidate. If it’s a file, file-related options are presented (such as copy, open, remove, etc.) If it’s a word, other pertinent commands will pop up as possible actions to call (move, uppercase, transpose, search-synonyms, etc.) The same regarding buffers, regions, sexp, and more. It returns relevant actions readily available, just a single shortcut letter away.

Whatever the thing, Embark presents sensitive options in place for the candidate (picking the nature of the target at point via metadata info that says what category of object it belongs to). By pulling from (easily configurable and expandable) maplists, these contextually relevant options provide quicker access to different actions for each candidate.

With Embark you are always closer, just a few keys away, from doing whatever you could do onto the targets. It even gives key bindings to unbound commands. All those single-key shortcuts act like abracadabras to magically ease things up within your flow.

There are about 320 available Embark functions classified for each object. (See them at https:/github.com/oantolin/embark/wiki/Default-Actions)

Its impact results in a Blizz of enhanced productivity.
The omniscient-like ubiquity of Embark makes doing things a snap. There are lots of other benefits and features worth checking, which you could read about at the library’s intro (https://github.com/oantolin/embark#quick-start)

Discover how deeply this UI innovating paradigm can benefit your editor´s usage. The genie of Embark and brothers went out of the bottle. Big thanks to Omar Antolin and Daniel Mendler, authors of Embark, Consult, and Marginalia, for these gems of tools that put (yet) more power into the hands of Emacs users!

Yoda_embark2
ignacio
http://ignaciopp.wordpress.com/?p=4509
Extensions
awk, how to represent a forwardslash in a regular expression
unixawkbashregexshellsys-admintechnologytips&tricks
Escaping a forwardslash in awk like awk  '/javascript\//' doesn’t work The way to do so is using the hexadecimal value of “/” which you can figure with the “od” unix command: echo "/" | od -x which returns: 0000000 0a2f 0000002 then doing: awk '/javascripta2f/' works fine!
Show full content

Escaping a forwardslash in awk like

awk  '/javascript\//'

doesn’t work
The way to do so is using the hexadecimal value of “/” which you can figure with the “od” unix command:

echo "/" | od -x

which returns:
0000000 0a2f
0000002

then doing:

awk '/javascripta2f/'

works fine!

ignacio
http://ignaciopp.wordpress.com/?p=960
Extensions
emacs, how to highlight what you just pasted
emacsgnucopycuteditorpastetext-editingtips&tricks
This is a way to select whatever text we had just inserted inside a buffer. I forgotten this trick until now that used it again. A small tip worth annotating that might come in handy for somebody else as well: 1) yank(paste) the text “C-y” 2) mark the point where the cursor landed, (using point-to-register), […]
Show full content

This is a way to select whatever text we had just inserted inside a buffer. I forgotten this trick until now that used it again. A small tip worth annotating that might come in handy for somebody else as well:
1) yank(paste) the text “C-y”
2) mark the point where the cursor landed, (using point-to-register), do “C-x r SPC” and pick any letter ( a-z)
3) go back to the point where you initially were, by doing “C-u SPC”
4) set the mark there,“C-SPC”
5) use “C-x r j” (+ the letter picked) to go up the point where the yanked text ends inside your buffer.
6) Voila, the text yanked is highlighted ready for whatever manipulation you need to do onto it.

ps: Of course in case you pasted text at the end of the buffer is simpler,
just a matter of:
“C-u SPC”
“C-SPC” to mark
“M – >” to go to the end

UPDATE: Actually, thanks to Peter (see comment below) I learned that this is possible just doing “C-x C-x after the yank if you have transient mark mode enabled” .

ignacio
http://ignaciopp.wordpress.com/?p=926
Extensions
(lame) use of macro to shortcut the org-cycle function to reveal-all
emacsgnuelisporg-modetechnology
A probably ridiculous thing to do, I know, but in hope of getting valuable help for you elisp expert guys out there (I’m all ears) I’m going ahead to show the unusual path I followed to simply bind the org-cicle invoked with an argument 64 (C-u C-u C-u) (This is also a litle probe of […]
Show full content

A probably ridiculous thing to do, I know, but in hope of getting valuable help for you elisp expert guys out there (I’m all ears) I’m going ahead to show the unusual path I followed to simply bind the org-cicle invoked with an argument 64 (C-u C-u C-u)

(This is also a litle probe of how magnanimously flexible the emacs lisp environment can actually be to allow us to record processes we want automated for later reuse)
Anyway:
1) I started to record the macro “C-(
2) made the call to org-cycle to reveal-all by previously pressing C-u three times “C-u C-u C-u M-x org-cycle
3) stopped recording macro “C-)
4) did “M-x kmacro-name-last-macro” (which provides the lambda form of the last created macro)
5) ran “M-x insert-kbd-macro
6) assigned a key binding to it (global-set-key(kbd “C-+”) ‘my-org-reveal-all)


(fset 'my-org-reveal-all
(lambda (&optional arg) "Keyboard macro." (interactive "p") (kmacro-exec-ring-item (quote ([21 21 21 134217816 111 114 103 45 99 121 99 108 101 return] 0 "%d")) arg)))

(global-set-key(kbd “C-+”) ‘my-org-reveal-all)

ignacio
http://ignaciopp.wordpress.com/?p=919
Extensions
backing up several databases, shell oneliner
gnuunixbashmysqlmysqldumponelinershellsys-admintechnologytips&tricks
Due to a disk failure on a server I needed to preserve several databases created for students. Some of them were empty, consecuently doing: mysqldump with the option --all-databases yielded an error and didn’t work. What worked instead, was iterating through and mysqldumping them individually with this shell oneliner: for I in $(mysql -uroot -p****** […]
Show full content

Due to a disk failure on a server I needed to preserve several databases created for students. Some of them were empty, consecuently doing:
mysqldump with the option --all-databases yielded an error and didn’t work.

What worked instead, was iterating through and mysqldumping them individually with this shell oneliner:

for I in $(mysql -uroot -p****** -e 'show databases'); do  mysqldump -uroot -p****** $I > $I.sql; done;

I compressed those created files into one tar inmediately after:

ls -1 | xargs tar -cvzf backupOfDatabases.tgz
ignacio
http://ignaciopp.wordpress.com/?p=903
Extensions
how to undefine a key binding in emacs
emacsgnudot-emacselisptext-editingtips&tricks
I just wanted to free a shortcut I had for “C-1” to let it behave the way it was meant with the command “digit-arguments”. This answer http://stackoverflow.com/questions/7549259/is-there-a-quick-way-to-unbind-keys-in-emacs came in handy. (global-unset-key (kbd “C-1”)) (define-key global-map (kbd “C-1”) ‘digit-argument) By the way (a little tip) you can go: C-<digit ARG) instead of the C-u method; say […]
Show full content

I just wanted to free a shortcut I had for “C-1” to let it behave the way it was meant with the command “digit-arguments”. This answer http://stackoverflow.com/questions/7549259/is-there-a-quick-way-to-unbind-keys-in-emacs came in handy.

(global-unset-key (kbd “C-1”))
(define-key global-map (kbd “C-1”) ‘digit-argument)

By the way (a little tip) you can go: C-<digit ARG) instead of the C-u method; say to move 11 characters back, “C-11 C-b” is quicker than “C-u 11 C-b”, one less hit!

ignacio
http://ignaciopp.wordpress.com/?p=889
Extensions
unix commands to handle a portion of a huge file from match
gnuprogrammingsedunixawkheadtailtext-editingtips&tricks
I needed to inspect a relatively small portion of a large log file (~1Gb), which will make chock even powerfull text-editors like vi(m) or emacs I proceded in two steps: 1) found the match in the file and pulled the line number —————————————————————————————- awk ‘/ May 10 /{a=$0; b = NR;}END{print a,” :: “,b}’ log.txt […]
Show full content

I needed to inspect a relatively small portion of a large log file (~1Gb), which will make chock even powerfull text-editors like vi(m) or emacs

I proceded in two steps:
1) found the match in the file and pulled the line number

—————————————————————————————-
awk ‘/ May 10 /{a=$0; b = NR;}END{print a,” :: “,b}’ log.txt
—————————————————————————————-
which yielded:
Thu May 10 02:17:05 ART 2012 :: 29199076

2) then I dumped the content from the that line and filtered it with head
—————————————————————-
tail -n +29199076 log.txt | head -n 100
—————————————————————-
That is possible with the trick of using “tail -n +(N)” which brings lines from the N line onwards

As and alternative to the last one, as explained here, sed could’ve been used in the following manner:
—————————————————————-
sed -n -e 29199076,29199176 -e 29199077q log.txt
—————————————————————-
(the last parameter, for efficiency, tells to quit at the limit line + 1 )

ignacio
http://ignaciopp.wordpress.com/?p=880
Extensions
disable “Alt+`” hotkeys in Ubuntu 11.10
emacsgnuprogramminglinuxtechnologytips&tricksubuntu
I finally got it on how to alter the combination of ALT + (backtick|tilde) keys (the backtick is the one above the tab key), which Ubuntu Oniric Ocelot (11.10) assigned to a new functionality for flipping through windows in the switcher. This system shortcut could surely come as a nasty surprise when you upgrade from […]
Show full content

I finally got it on how to alter the combination of ALT + (backtick|tilde) keys (the backtick is the one above the tab key), which Ubuntu Oniric Ocelot (11.10) assigned to a new functionality for flipping through windows in the switcher. This system shortcut could surely come as a nasty surprise when you upgrade from version 10.xx, turning unusable whatever command you might had bond in your applications. My emacs setup specially does make a lot of use of these two keys, so I wanted to thank the guy and record his solution found as a response buried in this support thread
Simply all it takes for disabling the default hotkeys is to:
1) get the CompizConfig Setting Manager
"sudo apt-get install config-editor" (it does not come included in Ubuntu Ocelot 11.10)
2) bring it up, (typing “CCSM” in your terminal)
3) look under Desktop -> Ubuntu Unity Plugin -> Switcher
resetting ALT+`
4) pick the last two shown there, and create a key combination for them (which very non-intuitively appear listed as “disabled”). The functions in question are:
:: key to flip through windows in the switcher
:: key to flip through windows in the switcher backwards
(note how in this case I had already set them to C-Alt 7 and C-Alt 8)

Yeah, it’s over babe, we’re back in business!

ignacio
CompizConfig Setting Manager
http://ignaciopp.wordpress.com/?p=853
Extensions
php numeric representation of day of week, beware of confusing date “w” with “N”
programmingmysqlphptips&tricks
Darn!, this is nothing but a little note of caution, a sad admission of stupidity or maybe even a tip to someone: if you ever find yourself in a tight schedule doing extra hours to finish up a project, don’t waste precious minutes debugging your app only due to having foolishly picked the php ISO-8601 […]
Show full content

Darn!, this is nothing but a little note of caution, a sad admission of stupidity or maybe even a tip to someone: if you ever find yourself in a tight schedule doing extra hours to finish up a project, don’t waste precious minutes debugging your app only due to having foolishly picked the php ISO-8601 numeric representation of the day of the week “N” (mon=0 … sun=7). Completing the missing dates from a set of database records will work flawlessly just with date(“w”), specially if you had pulled the existing days using mysql date_format(“w”).
Duhh!!

ignacio
http://ignaciopp.wordpress.com/?p=844
Extensions