emacs/var/elfeed/db/data/ef/ef68dc3b3e9ccb7cca1096d1da1ce88d0d27cdbc
2022-01-03 12:49:32 -06:00

37 lines
2.6 KiB
Plaintext

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" lang="" xml:lang="">
<head>
<meta charset="utf-8" />
<meta name="generator" content="pandoc" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes" />
<meta name="author" content="By Pedro Delfino" />
<title>The power of enable-mode: an illustrative example with nosound</title>
<style type="text/css">
code{white-space: pre-wrap;}
span.smallcaps{font-variant: small-caps;}
span.underline{text-decoration: underline;}
div.column{display: inline-block; vertical-align: top; width: 50%;}
</style>
<!--[if lt IE 9]>
<script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv-printshiv.min.js"></script>
<![endif]-->
</head>
<body>
<header>
<h1 class="title">The power of enable-mode: an illustrative example with nosound</h1>
<p class="author">By Pedro Delfino</p>
</header>
<p>In Nyxt, every buffer has its own configuration (state). Hence, by applying modes such as nosound-mode, we can change a buffer's state- muting it.</p>
<p>But, what if you wanted to mute multiple buffers? Or maybe all of them?</p>
<p>Well, this can be done! First, you need to execute the command enable-mode (<code>C-space</code> <code>enable-mode</code>).</p>
<p>Then, the prompt will ask you which buffers you would like to act on. Using <code>M-a</code> (alt-a) you can select all of them if you want.</p>
<p>After pressing return with the chosen buffers being selected, you will see another list with all modes available to use. In this illustrative example, we are using nosound-mode.</p>
<p>After choosing nosound-mode, you'll notice that all sound coming from your selected buffers will be muted. If you go and check each previously selected buffer you will notice that <code>nosound-mode</code> is displayed in the status bar.</p>
<p><img src="../static/image/article/enable-mode-no-sound.gif" /></p>
<p>This idea can be easily generalized, and you can think of enable-mode as a leverage to do similar things with other modes. For instance, putting all (or some) buffers in dark-mode when you're feeling like batman :)</p>
<p>If you like math, think about this as a function composition <strong>f(g(x), xs)</strong>. Enable-mode (<em>f</em>) receives a list of variables/buffers (<em>xs</em>) and a function <em>g</em> (another Nyxt mode) that will be applied to each variable (<em>x</em>).</p>
<p>This is pretty different from the regular user experience of clicking in and out in each tab of those popular browsers out there, right?</p>
<p>And this is just an appetizer, stay tuned. May the power of Nyxt be with you!</p>
</body>
</html>