├── .gitignore
├── LICENSE
├── README.org
├── images
├── arrow-styles.png
├── ascii-2-unicode-b.png
├── ascii-2-unicode.png
├── boxes-arrows.png
├── contour-tracing.png
├── decision-tree.png
├── document-command.png
├── draw-rectangle.png
├── fine-tweaking.png
├── flood-fill.png
├── foreign-language-sentence.png
├── four-styles.png
├── general-relativity-equation.png
├── insert-glyphs.png
├── line-spacing.png
├── lines-blocks.png
├── lisp-lists.png
├── macro-doted-line.png
├── macro-fancy-squares.png
├── mode-line.png
├── move-rectangle.png
├── plus-shape.png
├── same-sketch-several-styles.png
├── schrodinger-equation.png
├── sketched-objects.png
└── water-sketch.png
├── tests
├── bench1.el
├── bench10.el
├── bench11.el
├── bench12.el
├── bench13.el
├── bench14.el
├── bench15.el
├── bench16.el
├── bench17.el
├── bench18.el
├── bench19.el
├── bench2.el
├── bench20.el
├── bench21.el
├── bench22.el
├── bench23.el
├── bench24.el
├── bench25.el
├── bench26.el
├── bench3.el
├── bench4.el
├── bench5.el
├── bench6.el
├── bench7.el
├── bench8.el
├── bench9.el
└── uniline-bench.el
├── uniline.el
└── uniline.info
/.gitignore:
--------------------------------------------------------------------------------
1 | *~
2 | *.elc
3 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | GNU GENERAL PUBLIC LICENSE
2 | Version 3, 29 June 2007
3 |
4 | Copyright (C) 2007 Free Software Foundation, Inc.
5 | Everyone is permitted to copy and distribute verbatim copies
6 | of this license document, but changing it is not allowed.
7 |
8 | Preamble
9 |
10 | The GNU General Public License is a free, copyleft license for
11 | software and other kinds of works.
12 |
13 | The licenses for most software and other practical works are designed
14 | to take away your freedom to share and change the works. By contrast,
15 | the GNU General Public License is intended to guarantee your freedom to
16 | share and change all versions of a program--to make sure it remains free
17 | software for all its users. We, the Free Software Foundation, use the
18 | GNU General Public License for most of our software; it applies also to
19 | any other work released this way by its authors. You can apply it to
20 | your programs, too.
21 |
22 | When we speak of free software, we are referring to freedom, not
23 | price. Our General Public Licenses are designed to make sure that you
24 | have the freedom to distribute copies of free software (and charge for
25 | them if you wish), that you receive source code or can get it if you
26 | want it, that you can change the software or use pieces of it in new
27 | free programs, and that you know you can do these things.
28 |
29 | To protect your rights, we need to prevent others from denying you
30 | these rights or asking you to surrender the rights. Therefore, you have
31 | certain responsibilities if you distribute copies of the software, or if
32 | you modify it: responsibilities to respect the freedom of others.
33 |
34 | For example, if you distribute copies of such a program, whether
35 | gratis or for a fee, you must pass on to the recipients the same
36 | freedoms that you received. You must make sure that they, too, receive
37 | or can get the source code. And you must show them these terms so they
38 | know their rights.
39 |
40 | Developers that use the GNU GPL protect your rights with two steps:
41 | (1) assert copyright on the software, and (2) offer you this License
42 | giving you legal permission to copy, distribute and/or modify it.
43 |
44 | For the developers' and authors' protection, the GPL clearly explains
45 | that there is no warranty for this free software. For both users' and
46 | authors' sake, the GPL requires that modified versions be marked as
47 | changed, so that their problems will not be attributed erroneously to
48 | authors of previous versions.
49 |
50 | Some devices are designed to deny users access to install or run
51 | modified versions of the software inside them, although the manufacturer
52 | can do so. This is fundamentally incompatible with the aim of
53 | protecting users' freedom to change the software. The systematic
54 | pattern of such abuse occurs in the area of products for individuals to
55 | use, which is precisely where it is most unacceptable. Therefore, we
56 | have designed this version of the GPL to prohibit the practice for those
57 | products. If such problems arise substantially in other domains, we
58 | stand ready to extend this provision to those domains in future versions
59 | of the GPL, as needed to protect the freedom of users.
60 |
61 | Finally, every program is threatened constantly by software patents.
62 | States should not allow patents to restrict development and use of
63 | software on general-purpose computers, but in those that do, we wish to
64 | avoid the special danger that patents applied to a free program could
65 | make it effectively proprietary. To prevent this, the GPL assures that
66 | patents cannot be used to render the program non-free.
67 |
68 | The precise terms and conditions for copying, distribution and
69 | modification follow.
70 |
71 | TERMS AND CONDITIONS
72 |
73 | 0. Definitions.
74 |
75 | "This License" refers to version 3 of the GNU General Public License.
76 |
77 | "Copyright" also means copyright-like laws that apply to other kinds of
78 | works, such as semiconductor masks.
79 |
80 | "The Program" refers to any copyrightable work licensed under this
81 | License. Each licensee is addressed as "you". "Licensees" and
82 | "recipients" may be individuals or organizations.
83 |
84 | To "modify" a work means to copy from or adapt all or part of the work
85 | in a fashion requiring copyright permission, other than the making of an
86 | exact copy. The resulting work is called a "modified version" of the
87 | earlier work or a work "based on" the earlier work.
88 |
89 | A "covered work" means either the unmodified Program or a work based
90 | on the Program.
91 |
92 | To "propagate" a work means to do anything with it that, without
93 | permission, would make you directly or secondarily liable for
94 | infringement under applicable copyright law, except executing it on a
95 | computer or modifying a private copy. Propagation includes copying,
96 | distribution (with or without modification), making available to the
97 | public, and in some countries other activities as well.
98 |
99 | To "convey" a work means any kind of propagation that enables other
100 | parties to make or receive copies. Mere interaction with a user through
101 | a computer network, with no transfer of a copy, is not conveying.
102 |
103 | An interactive user interface displays "Appropriate Legal Notices"
104 | to the extent that it includes a convenient and prominently visible
105 | feature that (1) displays an appropriate copyright notice, and (2)
106 | tells the user that there is no warranty for the work (except to the
107 | extent that warranties are provided), that licensees may convey the
108 | work under this License, and how to view a copy of this License. If
109 | the interface presents a list of user commands or options, such as a
110 | menu, a prominent item in the list meets this criterion.
111 |
112 | 1. Source Code.
113 |
114 | The "source code" for a work means the preferred form of the work
115 | for making modifications to it. "Object code" means any non-source
116 | form of a work.
117 |
118 | A "Standard Interface" means an interface that either is an official
119 | standard defined by a recognized standards body, or, in the case of
120 | interfaces specified for a particular programming language, one that
121 | is widely used among developers working in that language.
122 |
123 | The "System Libraries" of an executable work include anything, other
124 | than the work as a whole, that (a) is included in the normal form of
125 | packaging a Major Component, but which is not part of that Major
126 | Component, and (b) serves only to enable use of the work with that
127 | Major Component, or to implement a Standard Interface for which an
128 | implementation is available to the public in source code form. A
129 | "Major Component", in this context, means a major essential component
130 | (kernel, window system, and so on) of the specific operating system
131 | (if any) on which the executable work runs, or a compiler used to
132 | produce the work, or an object code interpreter used to run it.
133 |
134 | The "Corresponding Source" for a work in object code form means all
135 | the source code needed to generate, install, and (for an executable
136 | work) run the object code and to modify the work, including scripts to
137 | control those activities. However, it does not include the work's
138 | System Libraries, or general-purpose tools or generally available free
139 | programs which are used unmodified in performing those activities but
140 | which are not part of the work. For example, Corresponding Source
141 | includes interface definition files associated with source files for
142 | the work, and the source code for shared libraries and dynamically
143 | linked subprograms that the work is specifically designed to require,
144 | such as by intimate data communication or control flow between those
145 | subprograms and other parts of the work.
146 |
147 | The Corresponding Source need not include anything that users
148 | can regenerate automatically from other parts of the Corresponding
149 | Source.
150 |
151 | The Corresponding Source for a work in source code form is that
152 | same work.
153 |
154 | 2. Basic Permissions.
155 |
156 | All rights granted under this License are granted for the term of
157 | copyright on the Program, and are irrevocable provided the stated
158 | conditions are met. This License explicitly affirms your unlimited
159 | permission to run the unmodified Program. The output from running a
160 | covered work is covered by this License only if the output, given its
161 | content, constitutes a covered work. This License acknowledges your
162 | rights of fair use or other equivalent, as provided by copyright law.
163 |
164 | You may make, run and propagate covered works that you do not
165 | convey, without conditions so long as your license otherwise remains
166 | in force. You may convey covered works to others for the sole purpose
167 | of having them make modifications exclusively for you, or provide you
168 | with facilities for running those works, provided that you comply with
169 | the terms of this License in conveying all material for which you do
170 | not control copyright. Those thus making or running the covered works
171 | for you must do so exclusively on your behalf, under your direction
172 | and control, on terms that prohibit them from making any copies of
173 | your copyrighted material outside their relationship with you.
174 |
175 | Conveying under any other circumstances is permitted solely under
176 | the conditions stated below. Sublicensing is not allowed; section 10
177 | makes it unnecessary.
178 |
179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
180 |
181 | No covered work shall be deemed part of an effective technological
182 | measure under any applicable law fulfilling obligations under article
183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or
184 | similar laws prohibiting or restricting circumvention of such
185 | measures.
186 |
187 | When you convey a covered work, you waive any legal power to forbid
188 | circumvention of technological measures to the extent such circumvention
189 | is effected by exercising rights under this License with respect to
190 | the covered work, and you disclaim any intention to limit operation or
191 | modification of the work as a means of enforcing, against the work's
192 | users, your or third parties' legal rights to forbid circumvention of
193 | technological measures.
194 |
195 | 4. Conveying Verbatim Copies.
196 |
197 | You may convey verbatim copies of the Program's source code as you
198 | receive it, in any medium, provided that you conspicuously and
199 | appropriately publish on each copy an appropriate copyright notice;
200 | keep intact all notices stating that this License and any
201 | non-permissive terms added in accord with section 7 apply to the code;
202 | keep intact all notices of the absence of any warranty; and give all
203 | recipients a copy of this License along with the Program.
204 |
205 | You may charge any price or no price for each copy that you convey,
206 | and you may offer support or warranty protection for a fee.
207 |
208 | 5. Conveying Modified Source Versions.
209 |
210 | You may convey a work based on the Program, or the modifications to
211 | produce it from the Program, in the form of source code under the
212 | terms of section 4, provided that you also meet all of these conditions:
213 |
214 | a) The work must carry prominent notices stating that you modified
215 | it, and giving a relevant date.
216 |
217 | b) The work must carry prominent notices stating that it is
218 | released under this License and any conditions added under section
219 | 7. This requirement modifies the requirement in section 4 to
220 | "keep intact all notices".
221 |
222 | c) You must license the entire work, as a whole, under this
223 | License to anyone who comes into possession of a copy. This
224 | License will therefore apply, along with any applicable section 7
225 | additional terms, to the whole of the work, and all its parts,
226 | regardless of how they are packaged. This License gives no
227 | permission to license the work in any other way, but it does not
228 | invalidate such permission if you have separately received it.
229 |
230 | d) If the work has interactive user interfaces, each must display
231 | Appropriate Legal Notices; however, if the Program has interactive
232 | interfaces that do not display Appropriate Legal Notices, your
233 | work need not make them do so.
234 |
235 | A compilation of a covered work with other separate and independent
236 | works, which are not by their nature extensions of the covered work,
237 | and which are not combined with it such as to form a larger program,
238 | in or on a volume of a storage or distribution medium, is called an
239 | "aggregate" if the compilation and its resulting copyright are not
240 | used to limit the access or legal rights of the compilation's users
241 | beyond what the individual works permit. Inclusion of a covered work
242 | in an aggregate does not cause this License to apply to the other
243 | parts of the aggregate.
244 |
245 | 6. Conveying Non-Source Forms.
246 |
247 | You may convey a covered work in object code form under the terms
248 | of sections 4 and 5, provided that you also convey the
249 | machine-readable Corresponding Source under the terms of this License,
250 | in one of these ways:
251 |
252 | a) Convey the object code in, or embodied in, a physical product
253 | (including a physical distribution medium), accompanied by the
254 | Corresponding Source fixed on a durable physical medium
255 | customarily used for software interchange.
256 |
257 | b) Convey the object code in, or embodied in, a physical product
258 | (including a physical distribution medium), accompanied by a
259 | written offer, valid for at least three years and valid for as
260 | long as you offer spare parts or customer support for that product
261 | model, to give anyone who possesses the object code either (1) a
262 | copy of the Corresponding Source for all the software in the
263 | product that is covered by this License, on a durable physical
264 | medium customarily used for software interchange, for a price no
265 | more than your reasonable cost of physically performing this
266 | conveying of source, or (2) access to copy the
267 | Corresponding Source from a network server at no charge.
268 |
269 | c) Convey individual copies of the object code with a copy of the
270 | written offer to provide the Corresponding Source. This
271 | alternative is allowed only occasionally and noncommercially, and
272 | only if you received the object code with such an offer, in accord
273 | with subsection 6b.
274 |
275 | d) Convey the object code by offering access from a designated
276 | place (gratis or for a charge), and offer equivalent access to the
277 | Corresponding Source in the same way through the same place at no
278 | further charge. You need not require recipients to copy the
279 | Corresponding Source along with the object code. If the place to
280 | copy the object code is a network server, the Corresponding Source
281 | may be on a different server (operated by you or a third party)
282 | that supports equivalent copying facilities, provided you maintain
283 | clear directions next to the object code saying where to find the
284 | Corresponding Source. Regardless of what server hosts the
285 | Corresponding Source, you remain obligated to ensure that it is
286 | available for as long as needed to satisfy these requirements.
287 |
288 | e) Convey the object code using peer-to-peer transmission, provided
289 | you inform other peers where the object code and Corresponding
290 | Source of the work are being offered to the general public at no
291 | charge under subsection 6d.
292 |
293 | A separable portion of the object code, whose source code is excluded
294 | from the Corresponding Source as a System Library, need not be
295 | included in conveying the object code work.
296 |
297 | A "User Product" is either (1) a "consumer product", which means any
298 | tangible personal property which is normally used for personal, family,
299 | or household purposes, or (2) anything designed or sold for incorporation
300 | into a dwelling. In determining whether a product is a consumer product,
301 | doubtful cases shall be resolved in favor of coverage. For a particular
302 | product received by a particular user, "normally used" refers to a
303 | typical or common use of that class of product, regardless of the status
304 | of the particular user or of the way in which the particular user
305 | actually uses, or expects or is expected to use, the product. A product
306 | is a consumer product regardless of whether the product has substantial
307 | commercial, industrial or non-consumer uses, unless such uses represent
308 | the only significant mode of use of the product.
309 |
310 | "Installation Information" for a User Product means any methods,
311 | procedures, authorization keys, or other information required to install
312 | and execute modified versions of a covered work in that User Product from
313 | a modified version of its Corresponding Source. The information must
314 | suffice to ensure that the continued functioning of the modified object
315 | code is in no case prevented or interfered with solely because
316 | modification has been made.
317 |
318 | If you convey an object code work under this section in, or with, or
319 | specifically for use in, a User Product, and the conveying occurs as
320 | part of a transaction in which the right of possession and use of the
321 | User Product is transferred to the recipient in perpetuity or for a
322 | fixed term (regardless of how the transaction is characterized), the
323 | Corresponding Source conveyed under this section must be accompanied
324 | by the Installation Information. But this requirement does not apply
325 | if neither you nor any third party retains the ability to install
326 | modified object code on the User Product (for example, the work has
327 | been installed in ROM).
328 |
329 | The requirement to provide Installation Information does not include a
330 | requirement to continue to provide support service, warranty, or updates
331 | for a work that has been modified or installed by the recipient, or for
332 | the User Product in which it has been modified or installed. Access to a
333 | network may be denied when the modification itself materially and
334 | adversely affects the operation of the network or violates the rules and
335 | protocols for communication across the network.
336 |
337 | Corresponding Source conveyed, and Installation Information provided,
338 | in accord with this section must be in a format that is publicly
339 | documented (and with an implementation available to the public in
340 | source code form), and must require no special password or key for
341 | unpacking, reading or copying.
342 |
343 | 7. Additional Terms.
344 |
345 | "Additional permissions" are terms that supplement the terms of this
346 | License by making exceptions from one or more of its conditions.
347 | Additional permissions that are applicable to the entire Program shall
348 | be treated as though they were included in this License, to the extent
349 | that they are valid under applicable law. If additional permissions
350 | apply only to part of the Program, that part may be used separately
351 | under those permissions, but the entire Program remains governed by
352 | this License without regard to the additional permissions.
353 |
354 | When you convey a copy of a covered work, you may at your option
355 | remove any additional permissions from that copy, or from any part of
356 | it. (Additional permissions may be written to require their own
357 | removal in certain cases when you modify the work.) You may place
358 | additional permissions on material, added by you to a covered work,
359 | for which you have or can give appropriate copyright permission.
360 |
361 | Notwithstanding any other provision of this License, for material you
362 | add to a covered work, you may (if authorized by the copyright holders of
363 | that material) supplement the terms of this License with terms:
364 |
365 | a) Disclaiming warranty or limiting liability differently from the
366 | terms of sections 15 and 16 of this License; or
367 |
368 | b) Requiring preservation of specified reasonable legal notices or
369 | author attributions in that material or in the Appropriate Legal
370 | Notices displayed by works containing it; or
371 |
372 | c) Prohibiting misrepresentation of the origin of that material, or
373 | requiring that modified versions of such material be marked in
374 | reasonable ways as different from the original version; or
375 |
376 | d) Limiting the use for publicity purposes of names of licensors or
377 | authors of the material; or
378 |
379 | e) Declining to grant rights under trademark law for use of some
380 | trade names, trademarks, or service marks; or
381 |
382 | f) Requiring indemnification of licensors and authors of that
383 | material by anyone who conveys the material (or modified versions of
384 | it) with contractual assumptions of liability to the recipient, for
385 | any liability that these contractual assumptions directly impose on
386 | those licensors and authors.
387 |
388 | All other non-permissive additional terms are considered "further
389 | restrictions" within the meaning of section 10. If the Program as you
390 | received it, or any part of it, contains a notice stating that it is
391 | governed by this License along with a term that is a further
392 | restriction, you may remove that term. If a license document contains
393 | a further restriction but permits relicensing or conveying under this
394 | License, you may add to a covered work material governed by the terms
395 | of that license document, provided that the further restriction does
396 | not survive such relicensing or conveying.
397 |
398 | If you add terms to a covered work in accord with this section, you
399 | must place, in the relevant source files, a statement of the
400 | additional terms that apply to those files, or a notice indicating
401 | where to find the applicable terms.
402 |
403 | Additional terms, permissive or non-permissive, may be stated in the
404 | form of a separately written license, or stated as exceptions;
405 | the above requirements apply either way.
406 |
407 | 8. Termination.
408 |
409 | You may not propagate or modify a covered work except as expressly
410 | provided under this License. Any attempt otherwise to propagate or
411 | modify it is void, and will automatically terminate your rights under
412 | this License (including any patent licenses granted under the third
413 | paragraph of section 11).
414 |
415 | However, if you cease all violation of this License, then your
416 | license from a particular copyright holder is reinstated (a)
417 | provisionally, unless and until the copyright holder explicitly and
418 | finally terminates your license, and (b) permanently, if the copyright
419 | holder fails to notify you of the violation by some reasonable means
420 | prior to 60 days after the cessation.
421 |
422 | Moreover, your license from a particular copyright holder is
423 | reinstated permanently if the copyright holder notifies you of the
424 | violation by some reasonable means, this is the first time you have
425 | received notice of violation of this License (for any work) from that
426 | copyright holder, and you cure the violation prior to 30 days after
427 | your receipt of the notice.
428 |
429 | Termination of your rights under this section does not terminate the
430 | licenses of parties who have received copies or rights from you under
431 | this License. If your rights have been terminated and not permanently
432 | reinstated, you do not qualify to receive new licenses for the same
433 | material under section 10.
434 |
435 | 9. Acceptance Not Required for Having Copies.
436 |
437 | You are not required to accept this License in order to receive or
438 | run a copy of the Program. Ancillary propagation of a covered work
439 | occurring solely as a consequence of using peer-to-peer transmission
440 | to receive a copy likewise does not require acceptance. However,
441 | nothing other than this License grants you permission to propagate or
442 | modify any covered work. These actions infringe copyright if you do
443 | not accept this License. Therefore, by modifying or propagating a
444 | covered work, you indicate your acceptance of this License to do so.
445 |
446 | 10. Automatic Licensing of Downstream Recipients.
447 |
448 | Each time you convey a covered work, the recipient automatically
449 | receives a license from the original licensors, to run, modify and
450 | propagate that work, subject to this License. You are not responsible
451 | for enforcing compliance by third parties with this License.
452 |
453 | An "entity transaction" is a transaction transferring control of an
454 | organization, or substantially all assets of one, or subdividing an
455 | organization, or merging organizations. If propagation of a covered
456 | work results from an entity transaction, each party to that
457 | transaction who receives a copy of the work also receives whatever
458 | licenses to the work the party's predecessor in interest had or could
459 | give under the previous paragraph, plus a right to possession of the
460 | Corresponding Source of the work from the predecessor in interest, if
461 | the predecessor has it or can get it with reasonable efforts.
462 |
463 | You may not impose any further restrictions on the exercise of the
464 | rights granted or affirmed under this License. For example, you may
465 | not impose a license fee, royalty, or other charge for exercise of
466 | rights granted under this License, and you may not initiate litigation
467 | (including a cross-claim or counterclaim in a lawsuit) alleging that
468 | any patent claim is infringed by making, using, selling, offering for
469 | sale, or importing the Program or any portion of it.
470 |
471 | 11. Patents.
472 |
473 | A "contributor" is a copyright holder who authorizes use under this
474 | License of the Program or a work on which the Program is based. The
475 | work thus licensed is called the contributor's "contributor version".
476 |
477 | A contributor's "essential patent claims" are all patent claims
478 | owned or controlled by the contributor, whether already acquired or
479 | hereafter acquired, that would be infringed by some manner, permitted
480 | by this License, of making, using, or selling its contributor version,
481 | but do not include claims that would be infringed only as a
482 | consequence of further modification of the contributor version. For
483 | purposes of this definition, "control" includes the right to grant
484 | patent sublicenses in a manner consistent with the requirements of
485 | this License.
486 |
487 | Each contributor grants you a non-exclusive, worldwide, royalty-free
488 | patent license under the contributor's essential patent claims, to
489 | make, use, sell, offer for sale, import and otherwise run, modify and
490 | propagate the contents of its contributor version.
491 |
492 | In the following three paragraphs, a "patent license" is any express
493 | agreement or commitment, however denominated, not to enforce a patent
494 | (such as an express permission to practice a patent or covenant not to
495 | sue for patent infringement). To "grant" such a patent license to a
496 | party means to make such an agreement or commitment not to enforce a
497 | patent against the party.
498 |
499 | If you convey a covered work, knowingly relying on a patent license,
500 | and the Corresponding Source of the work is not available for anyone
501 | to copy, free of charge and under the terms of this License, through a
502 | publicly available network server or other readily accessible means,
503 | then you must either (1) cause the Corresponding Source to be so
504 | available, or (2) arrange to deprive yourself of the benefit of the
505 | patent license for this particular work, or (3) arrange, in a manner
506 | consistent with the requirements of this License, to extend the patent
507 | license to downstream recipients. "Knowingly relying" means you have
508 | actual knowledge that, but for the patent license, your conveying the
509 | covered work in a country, or your recipient's use of the covered work
510 | in a country, would infringe one or more identifiable patents in that
511 | country that you have reason to believe are valid.
512 |
513 | If, pursuant to or in connection with a single transaction or
514 | arrangement, you convey, or propagate by procuring conveyance of, a
515 | covered work, and grant a patent license to some of the parties
516 | receiving the covered work authorizing them to use, propagate, modify
517 | or convey a specific copy of the covered work, then the patent license
518 | you grant is automatically extended to all recipients of the covered
519 | work and works based on it.
520 |
521 | A patent license is "discriminatory" if it does not include within
522 | the scope of its coverage, prohibits the exercise of, or is
523 | conditioned on the non-exercise of one or more of the rights that are
524 | specifically granted under this License. You may not convey a covered
525 | work if you are a party to an arrangement with a third party that is
526 | in the business of distributing software, under which you make payment
527 | to the third party based on the extent of your activity of conveying
528 | the work, and under which the third party grants, to any of the
529 | parties who would receive the covered work from you, a discriminatory
530 | patent license (a) in connection with copies of the covered work
531 | conveyed by you (or copies made from those copies), or (b) primarily
532 | for and in connection with specific products or compilations that
533 | contain the covered work, unless you entered into that arrangement,
534 | or that patent license was granted, prior to 28 March 2007.
535 |
536 | Nothing in this License shall be construed as excluding or limiting
537 | any implied license or other defenses to infringement that may
538 | otherwise be available to you under applicable patent law.
539 |
540 | 12. No Surrender of Others' Freedom.
541 |
542 | If conditions are imposed on you (whether by court order, agreement or
543 | otherwise) that contradict the conditions of this License, they do not
544 | excuse you from the conditions of this License. If you cannot convey a
545 | covered work so as to satisfy simultaneously your obligations under this
546 | License and any other pertinent obligations, then as a consequence you may
547 | not convey it at all. For example, if you agree to terms that obligate you
548 | to collect a royalty for further conveying from those to whom you convey
549 | the Program, the only way you could satisfy both those terms and this
550 | License would be to refrain entirely from conveying the Program.
551 |
552 | 13. Use with the GNU Affero General Public License.
553 |
554 | Notwithstanding any other provision of this License, you have
555 | permission to link or combine any covered work with a work licensed
556 | under version 3 of the GNU Affero General Public License into a single
557 | combined work, and to convey the resulting work. The terms of this
558 | License will continue to apply to the part which is the covered work,
559 | but the special requirements of the GNU Affero General Public License,
560 | section 13, concerning interaction through a network will apply to the
561 | combination as such.
562 |
563 | 14. Revised Versions of this License.
564 |
565 | The Free Software Foundation may publish revised and/or new versions of
566 | the GNU General Public License from time to time. Such new versions will
567 | be similar in spirit to the present version, but may differ in detail to
568 | address new problems or concerns.
569 |
570 | Each version is given a distinguishing version number. If the
571 | Program specifies that a certain numbered version of the GNU General
572 | Public License "or any later version" applies to it, you have the
573 | option of following the terms and conditions either of that numbered
574 | version or of any later version published by the Free Software
575 | Foundation. If the Program does not specify a version number of the
576 | GNU General Public License, you may choose any version ever published
577 | by the Free Software Foundation.
578 |
579 | If the Program specifies that a proxy can decide which future
580 | versions of the GNU General Public License can be used, that proxy's
581 | public statement of acceptance of a version permanently authorizes you
582 | to choose that version for the Program.
583 |
584 | Later license versions may give you additional or different
585 | permissions. However, no additional obligations are imposed on any
586 | author or copyright holder as a result of your choosing to follow a
587 | later version.
588 |
589 | 15. Disclaimer of Warranty.
590 |
591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
599 |
600 | 16. Limitation of Liability.
601 |
602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
610 | SUCH DAMAGES.
611 |
612 | 17. Interpretation of Sections 15 and 16.
613 |
614 | If the disclaimer of warranty and limitation of liability provided
615 | above cannot be given local legal effect according to their terms,
616 | reviewing courts shall apply local law that most closely approximates
617 | an absolute waiver of all civil liability in connection with the
618 | Program, unless a warranty or assumption of liability accompanies a
619 | copy of the Program in return for a fee.
620 |
621 | END OF TERMS AND CONDITIONS
622 |
623 | How to Apply These Terms to Your New Programs
624 |
625 | If you develop a new program, and you want it to be of the greatest
626 | possible use to the public, the best way to achieve this is to make it
627 | free software which everyone can redistribute and change under these terms.
628 |
629 | To do so, attach the following notices to the program. It is safest
630 | to attach them to the start of each source file to most effectively
631 | state the exclusion of warranty; and each file should have at least
632 | the "copyright" line and a pointer to where the full notice is found.
633 |
634 |
635 | Copyright (C)
636 |
637 | This program is free software: you can redistribute it and/or modify
638 | it under the terms of the GNU General Public License as published by
639 | the Free Software Foundation, either version 3 of the License, or
640 | (at your option) any later version.
641 |
642 | This program is distributed in the hope that it will be useful,
643 | but WITHOUT ANY WARRANTY; without even the implied warranty of
644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
645 | GNU General Public License for more details.
646 |
647 | You should have received a copy of the GNU General Public License
648 | along with this program. If not, see .
649 |
650 | Also add information on how to contact you by electronic and paper mail.
651 |
652 | If the program does terminal interaction, make it output a short
653 | notice like this when it starts in an interactive mode:
654 |
655 | Copyright (C)
656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
657 | This is free software, and you are welcome to redistribute it
658 | under certain conditions; type `show c' for details.
659 |
660 | The hypothetical commands `show w' and `show c' should show the appropriate
661 | parts of the General Public License. Of course, your program's commands
662 | might be different; for a GUI interface, you would use an "about box".
663 |
664 | You should also get your employer (if you work as a programmer) or school,
665 | if any, to sign a "copyright disclaimer" for the program, if necessary.
666 | For more information on this, and how to apply and follow the GNU GPL, see
667 | .
668 |
669 | The GNU General Public License does not permit incorporating your program
670 | into proprietary programs. If your program is a subroutine library, you
671 | may consider it more useful to permit linking proprietary applications with
672 | the library. If this is what you want to do, use the GNU Lesser General
673 | Public License instead of this License. But first, please read
674 | .
675 |
--------------------------------------------------------------------------------
/README.org:
--------------------------------------------------------------------------------
1 | # -*- mode: org; coding:utf-8; -*-
2 | #+TITLE: Uniline
3 | #+OPTIONS: ^:{} authors:Thierry Banel, toc:nil
4 | #+LATEX_HEADER: \usepackage{pmboxdraw}
5 |
6 | *New*: =Transient= interface (as an alternative to =Hydra=). Still
7 | experimental.
8 |
9 | * Getting started in 10 seconds
10 | :PROPERTIES:
11 | :CUSTOM_ID: getting-started-in-10-seconds
12 | :END:
13 |
14 | - Type =M-x uniline-mode=
15 | - Move cursor with the arrow-keys on the keyboard =→ ← ↑ ↓=
16 | - Quit =C-c C-c=
17 |
18 | * Table of Contents
19 | :PROPERTIES:
20 | :TOC: :include all :depth 3 :force () :ignore (this) :local (nothing)
21 | :CUSTOM_ID: table-of-contents
22 | :END:
23 |
24 | :CONTENTS:
25 | - [[#getting-started-in-10-seconds][Getting started in 10 seconds]]
26 | - [[#pure-unicode-text-diagrams-in-emacs][Pure UNICODE text diagrams in Emacs]]
27 | - [[#minor-mode][Minor mode]]
28 | - [[#drawing-lines][Drawing lines]]
29 | - [[#brush-style][Brush style]]
30 | - [[#the-insert-key][The key]]
31 | - [[#arrows-glyphs------][Arrows glyphs ▷ ▶ → ▹ ▸ ↔]]
32 | - [[#intersection-glyphs---][Intersection glyphs ■ ◆ ●]]
33 | - [[#drawing-rectangles][Drawing rectangles]]
34 | - [[#moving-rectangles][Moving rectangles]]
35 | - [[#copying-killing-yanking-rectangles][Copying, killing, yanking rectangles]]
36 | - [[#tracing-a-contour][Tracing a contour]]
37 | - [[#flood-fill][Flood-fill]]
38 | - [[#text-direction][Text direction]]
39 | - [[#macros][Macros]]
40 | - [[#fine-tweaking][Fine tweaking]]
41 | - [[#dashed-lines-and-other-styles][Dashed lines and other styles]]
42 | - [[#ascii-to-unicode][ASCII to UNICODE]]
43 | - [[#which-fonts][Which fonts?]]
44 | - [[#hydra-or-tansient][Hydra or Tansient?]]
45 | - [[#the-hydra-interface][The Hydra interface]]
46 | - [[#the-transient-interface][The Transient interface]]
47 | - [[#line-spacing][Line spacing]]
48 | - [[#how-uniline-behaves-with-its-environment][How Uniline behaves with its environment?]]
49 | - [[#compatibility-with-picture-mode][Compatibility with Picture-mode]]
50 | - [[#compatibility-with-artist-mode][Compatibility with Artist-mode]]
51 | - [[#compatibility-with-whitespace-mode][Compatibility with Whitespace-mode]]
52 | - [[#compatibility-with-org-mode][Compatibility with Org Mode]]
53 | - [[#org-mode-and-latex][Org Mode and LaTex]]
54 | - [[#what-about-t-tabs][What about \t tabs?]]
55 | - [[#what-about-l-page-separation][What about ^L page separation?]]
56 | - [[#emacs-on-the-linux-console][Emacs on the Linux console]]
57 | - [[#emacs-on-a-graphical-terminal-emulator][Emacs on a graphical terminal emulator]]
58 | - [[#emacs-on-windows][Emacs on Windows]]
59 | - [[#lisp-api][Lisp API]]
60 | - [[#installation][Installation]]
61 | - [[#related-packages][Related packages]]
62 | - [[#author-contributors][Author, contributors]]
63 | - [[#license][License]]
64 | :END:
65 |
66 | * Pure UNICODE text diagrams in Emacs
67 | :PROPERTIES:
68 | :CUSTOM_ID: pure-unicode-text-diagrams-in-emacs
69 | :END:
70 | Draw diagrams like those:
71 |
72 | Document a command:
73 |
74 | [[file:images/document-command.png]]
75 |
76 | #+begin_example
77 | pdfjam source.pdf 3-5,9
78 | ▲ ▲ ▲ ▲
79 | command╶╯ │ │ │
80 | input file╶──╯ │ │
81 | select pages 3,4,5╶───╯ │
82 | and page 9╶──────────────╯
83 | #+end_example
84 |
85 | Connect boxes with arrows:
86 |
87 | [[file:images/boxes-arrows.png]]
88 |
89 | #+begin_example
90 | ╭───────────────────────╮
91 | ╷123╭────▶┤ hundred and something │
92 | ╰───╯ ╰───────────────────────╯
93 | ╭────▶──╮A╷
94 | ╭───╮ ┏━━━┓ ╔═══╗ │ ╰─╯
95 | 0╶─→┤ 1 ┝━━━▶┫ 2 ┣═══▷╣ 3 ╟──●────▶──╮B╷
96 | ╰───╯ ┗━┯━┛ ╚═╤═╝ │ ╰─╯
97 | ╰────←───╯ ╰────▶──╮C╷
98 | ╰─╯
99 | ╔══════════╗
100 | ║ 1 ║ ▐▀▀▀▀▀▀▀▀▜
101 | ║ ╭─────╫───╮ ◁──▷ ▐ 3 ▐
102 | ╚════╪═════╝ 2 │ ▐▄▄▄▄▄▄▄▄▟
103 | ╰─────────╯
104 | #+end_example
105 |
106 | Explain decisions trees:
107 |
108 | [[file:images/decision-tree.png]]
109 |
110 | #+begin_example
111 | ┏━━━━━━━━━━━━┓
112 | ┃which color?┃
113 | ┗━┯━━━━━━━━━━┛
114 | │ ╭──────╮
115 | │ ╭──┤yellow├─▷╮good─choice╭□
116 | ▽ │ ╰──────╯ ╰═══════════╯
117 | ╰──● ╭───╮ ┏━━━━━┓
118 | ├──┤red├───▷┨dark?┠──╮
119 | │ ╰───╯ ┗━━━━━┛ │
120 | │ ╭───◁──────────────╯
121 | │ │ ╭───╮
122 | │ ╰─●─┤yes├▷╮regular─red╭─□
123 | │ │ ╰───╯ ╰═══════════╯
124 | │ │ ╭──╮
125 | │ ╰─┤no├─▷╮pink╭────────□
126 | │ ╰──╯ ╰════╯
127 | │ ╭────╮
128 | ├──┤blue├───▷╮next week╭──□
129 | │ ╰────╯ ╰═════════╯
130 | │ ╭─────╮
131 | ╰──┤white├──▷╮available╭──□
132 | ╰─────╯ ╰═════════╯
133 | #+end_example
134 |
135 | Draw lines or blocks:
136 |
137 | [[file:images/lines-blocks.png]]
138 |
139 | #+begin_example
140 | ╭─╮←─╮
141 | ╭╮ │ │ ╰──╴max 235
142 | ╭╮││ ╭╯ │
143 | │╰╯│╭─╯ │
144 | ╭╮ │ ││ │
145 | ╭─╮││╭╮ ╭──╮╭╮ │ ╰╯ ╰╮
146 | ╭╯ ╰╯╰╯│ ╭╯ ╰╯╰─╮ │ │ ╭╮
147 | ◁─╯ ╰──╯ ╰──╯ ╰─╯╰────▷
148 | ◀════════════════════════════════════════▶
149 | ╭────────╮
150 | ▲ │all time│
151 | ┃ ▄ ▗▟█ ←─┤highest │
152 | Qdx █▌ ████ ╰────────╯
153 | ┃ ▗▄█▌ █████▙
154 | ┃ ▟███████▄█████████▄▄▄ ▗▄
155 | ┃▐▄▄████████████████████████████▄▄▖
156 | ╺━━━━━━━━━━╸time╺━━━━━━━━━━━━━━━━▶
157 |
158 | #+end_example
159 |
160 | Outline the General Relativity equation:
161 |
162 | [[file:images/general-relativity-equation.png]]
163 |
164 | #+begin_example
165 |
166 | ╭─────────────────────╴G: Einstein tensor
167 | │ ╭────╴κ: Gravitational coupling constant
168 | ╭──▽───╮ ╭───▽──╮
169 | ┏━┷━━━━━━┷━━━━━━━━┷━━━━━━┷━━━┓
170 | ┃ R - gR/2 + Λg = (8πG/c⁴)×T ┃◁╴General Relativity equation
171 | ┗━△━━━△△━━━━━△△━━━━━━△━△━━━△━┛
172 | │ ││ ││ │ │ ╭╯
173 | │ ││ ││ │ │ ╰╴Energy-impulsion tensor
174 | │ ││ ││ │ ╰───╴Speed of light
175 | │ ││ ││ ╰─────╴Gravitational constant
176 | │ ││ ╰┴────────────╴Cosmological constant
177 | │ │╰──────┴────────────╴Scalar curvature
178 | │ ╰───────╰────────────╴Metric tensor
179 | ╰────────────────────────╴Ricci tensor
180 |
181 | #+end_example
182 |
183 | Outline the Schrödinger equation:
184 |
185 | [[file:images/schrodinger-equation.png]]
186 |
187 | #+begin_example
188 |
189 | ╭─────────────────────╴Derivative over time
190 | │ ╭──────────╭────╴State of quantum system at time t
191 | │ │ │ (the square of its absolute value
192 | ╭▽─╮ ╭─▽──╮ ╭─▽──╮ is the probability density)
193 | ┏━━━━━┷━━┷━┷━━━━┷━━━━━┷━━━━┷━┓
194 | ┃ i ħ d/dt |Ψ(t)> = Ĥ |Ψ(t)> ┃◁─╴Schrödinger equation
195 | ┗━△━△━━━━△━━━━△━━━━━△━━━━△━━━┛
196 | │ │ ╰────╰─────┤────╰───╴Time
197 | │ │ ╰────────╴Hamiltonian
198 | │ ╰────────────────────────╴Reduced Plank constant
199 | ╰──────────────────────────╴Imaginary number i²=-1
200 |
201 | #+end_example
202 |
203 | Explain the structure of a sentence in a foreign language (which one?):
204 |
205 | [[file:images/foreign-language-sentence.png]]
206 |
207 | #+begin_example
208 |
209 | ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
210 | ┃ the pretty table is standing ┃
211 | ┗┯━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
212 | │ ╭────┬─────┬─────╴radicals
213 | ↕ ╭┴╮ ╭┴─╮ ╭┴─╮
214 | ┏┷━━━┿━┿━━┿━━┿━━┿━━┿━━━┓
215 | ┃ la bela tablo staras ┃
216 | ┗━━━━┿━┿△━┿━━┿△━┿━━┿△━━┛
217 | ╰─╯│ ╰──╯│ ╰──╯│ ┏━━━━━suffixes━━━━━┓
218 | │ │ ╰──╂╴as: present tense┃
219 | │ │ ┃ os: future tense ┃
220 | │ │ ┃ is: past tense ┃
221 | │ ╰────────╂╴ o: noun ┃
222 | ╰──────────────╂╴ a: adjective ┃
223 | ┃ e: adverb ┃
224 | ┗━━━━━━━━━━━━━━━━━━┛
225 |
226 | #+end_example
227 |
228 | Explain Lisp lists:
229 |
230 | [[file:images/lisp-lists.png]]
231 |
232 | #+begin_example
233 | '(a b c)
234 | ┏━━━┳━━━┓ ┏━━━┳━━━┓ ┏━━━┳━━━┓
235 | ●━━━▶┫ ● ┃ ●─╂──▷┨ ● ┃ ●─╂──▷┨ ● ┃nil┃
236 | ┗━┿━┻━━━┛ ┗━┿━┻━━━┛ ┗━┿━┻━━━┛
237 | │ ╰──────────╮╰╮
238 | │ ╭─────┬───────────╮ │ │
239 | ╰─▷┤"a\0"│properties │ │ │
240 | ├─────┼───────────┤ │ │
241 | │"b\0"│properties ├◁╯ │
242 | ├─────┼───────────┤ │
243 | │"c\0"│properties ├◁──╯
244 | ├─────┼───────────┤
245 | │... │... │
246 | ╵ ╵ ╵
247 | #+end_example
248 |
249 | Draw sketched objects:
250 |
251 | [[file:images/sketched-objects.png]]
252 |
253 | #+begin_example
254 |
255 | ◀─(-)────────(+)──▶ ~╭──────╮~
256 | ▗──────────────╮ ~~│ ╭~~╮ │~~
257 | ▐ ╰╮ ~│ ╵ ╵ │~
258 | ╭□▐ 1.5 volts ╭╯□╮ ╰─╖ ╓─╯
259 | │ ▝▀▀▀▀▀▀▀▀▀▀▀▀▀▀▘ │ ╠━━╣
260 | │ ╰──────╯ │
261 | ╰─────────────────────────────╯
262 | #+end_example
263 |
264 | [[file:images/water-sketch.png]]
265 |
266 | #+begin_example
267 | ╶╮ ╭╴
268 | ┏┳┥▒▒▒▒▒▒▒┝╸
269 | ┃┃│▒▒eau▒▒│
270 | ┃┃│▒▒▒▒▒▒▒│ ╔═════╗
271 | ┃┃╰──╮▒╭──╯ ║ ╶╮ ▽ ╭╴
272 | ┃┃ ▒ ║ │ ░ │
273 | ┃┃ ▒ ║ │░░░░░░░░░░░░░░│
274 | ┃┃ ╚═════╝ │░░░░░░░░░░░░░░╞════▷▒▒
275 | ┃┃ │░░░░░akvo░░░░░│ ╶╮ ▒ ╭╴
276 | ┃┃ │░░░░░░░░░░░░░░│ │ ▒ │
277 | ┃┃ ╰─┲┳━━━━━━━━┳┱─╯ │▒▒▒▒▒▒▒▒▒▒▒│
278 | ┃┃ ┃┃ ┃┃ │▒▒▒water▒▒▒│
279 | ┃┃ ┃┃ ┃┃ │▒▒▒▒▒▒▒▒▒▒▒│
280 | ┃┃ ┃┃ ┃┃ ╰───────────╯
281 | ▝▀▀▀▀▀▀▘ ▝▀▘ ▝▀▘ ▀▀▀▀▀▀▀▀▀▀▀▀▀
282 | #+end_example
283 |
284 | Those diagrams are pure text. There is nothing graphic. They are
285 | achieved using UNICODE characters. Most often, the text file will be
286 | encoded as UTF-8.
287 |
288 | Creating such diagrams by hand is painfully slow. Use =Uniline= to
289 | draw lines while you move the cursor with keyboard arrows.
290 |
291 | *Beware!*
292 |
293 | If you see those diagrams miss-aligned, most likely the font used to
294 | display them does not support UNICODE block characters. See bellow the
295 | paragraph "Which fonts?".
296 |
297 | * Minor mode
298 | :PROPERTIES:
299 | :CUSTOM_ID: minor-mode
300 | :END:
301 | =Uniline= is a minor mode. Activate it temporarily:
302 |
303 | =M-x uniline-mode=
304 |
305 | Exit it with:
306 |
307 | =C-c C-c=
308 |
309 | The current major mode is still active underneath =uniline-mode=.
310 |
311 | While in =uniline-mode=, overwriting is active, as well as long lines
312 | truncation. Also, a hollow cursor is provided. Those settings are
313 | reset to their previous state when exiting =uniline-mode=.
314 |
315 | * Drawing lines
316 | :PROPERTIES:
317 | :CUSTOM_ID: drawing-lines
318 | :END:
319 | Use keyboard arrows to draw lines.
320 |
321 | By default, drawing lines only happens over empty space or over other
322 | lines. If there is already text, it will not be erased. However, by
323 | hitting the control-key while moving, lines overwrite whatever there
324 | is.
325 |
326 | The buffer is "infinite" in bottom and right directions. Which means
327 | that when the cursor ends up outside the buffer, white space
328 | characters are automatically added.
329 |
330 | The usual numeric prefix is available. For instance, to draw a line 12
331 | characters wide downward, type: =M-12 =
332 |
333 | * Brush style
334 | :PROPERTIES:
335 | :CUSTOM_ID: brush-style
336 | :END:
337 | Set the current brush with:
338 |
339 | - ~-~ single thin line
340 | =╭─┬─╮=
341 |
342 | - ~+~ single thick line
343 | =┏━┳━┓=
344 |
345 | - ~=~ double line
346 | =╔═╦═╗=
347 |
348 | - ~#~ quarter block
349 | =▙▄▟▀=
350 |
351 | - ~~ eraser
352 |
353 | - ~~ move without drawing anything
354 |
355 | The current bush and the current text direction (see below) are
356 | reflected in the mode-line (at the bottom of the Emacs screen). It
357 | looks like this:
358 |
359 | [[file:images/mode-line.png]]
360 |
361 | #+begin_example
362 |
363 | current text current
364 | direction╶────╮ ╭───╴brush
365 | ▼ ▼
366 | ══════════════════╧═══════╧══════════════
367 | U:** buff (... →Uniline┼ ...)
368 | ═════════════════════════════════════════
369 |
370 | #+end_example
371 |
372 | * The == key
373 | :PROPERTIES:
374 | :CUSTOM_ID: the-insert-key
375 | :END:
376 | The == key is a prefix for other keys:
377 | - for drawing arrows, squares, crosses, o-shapes glyphs,
378 | - for handling rectangles,
379 | - for inserting =# = - += which otherwise change the brush style,
380 | - for trying a choice of mono-spaced fonts.
381 |
382 | Why ==? Because:
383 | - =Uniline= tries to leave their original meaning to as many keys as
384 | possible,
385 | - the standard meaning of == is to toggle the =overwrite-mode=;
386 | but =Uniline= is already in =overwrite-mode=, and de-activating
387 | overwrite would break =Uniline=.
388 |
389 | So preempting == does not sacrifices anything.
390 |
391 | * Arrows glyphs =▷ ▶ → ▹ ▸ ↔=
392 | :PROPERTIES:
393 | :CUSTOM_ID: arrows-glyphs------
394 | :END:
395 | At any time, an arrow may be drawn. The arrow points in the direction
396 | that the line drawing follows.
397 |
398 | =Uniline= supports 6 arrows types: =▷ ▶ → ▹ ▸ ↔=
399 |
400 | [[file:images/arrow-styles.png]]
401 |
402 | #+begin_example
403 |
404 | □
405 | ╰─◁──▷─╮ □─╮ ╭─╮ ╭─╮ ╭─□
406 | ╭─◀──▶─╯ △ ▲ ↑ ▵ ▴ ↕
407 | ╰─←──→─╮ │ │ │ │ │ │
408 | ╭─◃──▹─╯ ▽ ▼ ↓ ▿ ▾ ↕
409 | ╰─◂──▸─╮ ╰─╯ ╰─╯ ╰─╯
410 | ╭─↔──↔─╯
411 | □
412 |
413 | #+end_example
414 |
415 | Actually, there are tons of arrows of all styles in the UNICODE
416 | standard. Unfortunately, support by fonts is weak. So =Uniline=
417 | restrains itself to those six safe arrows.
418 |
419 | To insert an arrow, type: = a= or = a a= or = a a a=. (=a=
420 | cycles through the 6 styles, =A= cycles backward).
421 |
422 | = 4 a= is equivalent to = a a a a=, which is also equivalent to
423 | = A A A=. Those 3 shortcuts insert an arrow of this style: =▵▹▿◃=. The
424 | actual direction where the arrow points follows the last movement of
425 | the cursor.
426 |
427 | To change the direction of the arrow, use shift-arrow, for example:
428 | =S-= will change from =→= to =↑=.
429 |
430 | * Intersection glyphs =■ ◆ ●=
431 | :PROPERTIES:
432 | :CUSTOM_ID: intersection-glyphs---
433 | :END:
434 | There are a few other UNICODE characters which are mono-space and
435 | symmetric in the 4 directions. They are great at line intersections:
436 |
437 | To insert a square =□ ■ ▫ ▪ ◇ ◆ ◊= type:
438 | = s s s...= (=s= cycles, =S= cycles backward).
439 |
440 | To insert a circular shape =· ∙ • ● ◦ Ø ø= type:
441 | = o o o...= (=o= cycles, =O= cycles backward).
442 |
443 | To insert a cross shape =╳ ÷ × ± ¤= type:
444 | = x x x...= (=x= cycles, =X= cycles backward).
445 |
446 | To insert a usual ASCII letter or symbol, just type it.
447 |
448 | As the keys =- + = #= are preempted by =Uniline= mode, to type them,
449 | prefix them with ==. Example: = -= inserts a =-= and
450 | = += inserts a =+=.
451 |
452 | [[file:images/insert-glyphs.png]]
453 |
454 | #+begin_example
455 |
456 |
457 | │
458 | ▼
459 | ╭┴╮ ╭───────╮ ╭─────────────────────╮
460 | │s├─▶─┤squares├──┤ □ ■ ▫ ▪ ◇ ◆ ◊ │
461 | ╰┬╯ ╰───────╯ ╰─────────────────────╯
462 | ╭┴╮ ╭───────╮ ╭─────────────────────╮
463 | │o├─▶─┼circles┼──┤ · ∙ • ● ◦ Ø ø │
464 | ╰┬╯ ╰───────╯ ╰─────────────────────╯
465 | ╭┴╮ ╭───────╮ ╭───────────────╮
466 | │x├─▶─┼crosses┼──┤ ╳ ÷ × ± ¤ │
467 | ╰┬╯ ╰───────╯ ╰───────────────╯
468 | ╭┴╮ ╭───╮
469 | │+├─▶────────────┤ + │
470 | ╰┬╯ ╰───╯
471 | ╭┴╮ ╭───╮
472 | │-├─▶────────────┤ - │
473 | ╰┬╯ ╰───╯
474 | ╭┴╮ ╭───╮
475 | │=├─▶────────────┤ = │
476 | ╰┬╯ ╰───╯
477 | ╭┴╮ ╭───╮
478 | │#├─▶────────────┤ # │
479 | ╰─╯ ╰───╯
480 |
481 | #+end_example
482 |
483 | * Drawing rectangles
484 | :PROPERTIES:
485 | :CUSTOM_ID: drawing-rectangles
486 | :END:
487 | To draw a rectangle in one shot, select a rectangular region with
488 | =C-SPC= or =C-x SPC= and move the cursor.
489 |
490 | You may also use =S-= (== being any of the 4
491 | directions) to extend the selection. The buffer grows as needed with
492 | white spaces to accommodate the selection. Selection extension mode is
493 | active when =shift-select-mode= is non-nil.
494 |
495 | If needed, change the brush with any of
496 | =- + = # =
497 |
498 | then hit
499 | - =r= to draw a rectangle inside the selection
500 | - =S-R= to draw a rectangle outside the selection
501 | - =C-r= to overwrite a rectangle inside the selection
502 | - =C-S-R= to overwrite a rectangle outside the selection
503 |
504 | [[file:images/draw-rectangle.png]]
505 |
506 | #+begin_example
507 | ╭───────╮ r: inside╮╭───────╮
508 | │ one │ ▗▄▄▄▄▄▄▖╭┤│▛▀▀▀▀▀▜│
509 | │ ┏━━━━┿━━━━━━┓ ▐╭────╮▌│╰┼▌ ▐│
510 | ╰──╂────╯ two ┃ ▐│ │▌│ │▙▄▄▄▄▄▟│
511 | ┃ ╔═══════╋═╗ ▐│ ├▌╯ ╰─────┬─╯
512 | ┗━━━╋━━━━━━━┛ ║ ▐╰────╯▌────────┴───╮
513 | ║ three ║ ▝▀▀▀▀▀▀▘ R: outside╯
514 | ╚═════════╝
515 |
516 | ╭─────────╮
517 | my text I │my text I│
518 | want to ╶─R─▷ │want to │
519 | box │box │
520 | ╰─────────╯
521 | #+end_example
522 |
523 | The usual =C-_= or =C-/= keys may be hit to undo, even with the region still
524 | active visually.
525 |
526 | * Moving rectangles
527 | :PROPERTIES:
528 | :CUSTOM_ID: moving-rectangles
529 | :END:
530 | Select a region, then press ==. The selection becomes rectangular if it
531 | was not.
532 |
533 | Use arrow keys to move the rectangle around. A numeric prefix may be
534 | used to move the rectangle that many characters. Be sure to specify
535 | the numeric prefix with just digits, without the =Alt= key. Typing
536 | =15 = moves the rectangle 15 characters to the left. =M-15 =
537 | does not work.
538 |
539 | Press =q=, ==, or =C-g= to stop moving the rectangle.
540 |
541 | The =C-_= key may also be used to undo the previous movements, even
542 | though the selection is still active.
543 |
544 | [[file:images/move-rectangle.png]]
545 |
546 | #+begin_example
547 | ▲
548 | │
549 |
550 | ╭─────┴──────╮
551 | │this is │
552 | │my rectangle│
553 | ◀───┤I want to ├──▶
554 | │move │
555 | ╰─────┬──────╯
556 |
557 | │
558 | ▼
559 | #+end_example
560 |
561 | * Copying, killing, yanking rectangles
562 | :PROPERTIES:
563 | :CUSTOM_ID: copying-killing-yanking-rectangles
564 | :END:
565 |
566 | A rectangle can be copied or killed, then yanked somewhere else. Press:
567 | - =c= to copy
568 | - =k= to kill
569 | - =y= to yank (aka paste)
570 |
571 | This is similar to the Emacs standard rectangle handling:
572 | - =C-x r r= copy rectangle to register
573 | - =C-x r k= kill rectangle
574 | - =C-x r y= yank killed rectangle
575 |
576 | The first difference is that =Uniline= rectangles when killed and
577 | yanked, do not move surrounding characters.
578 |
579 | The second difference is that the white characters of the yanked
580 | rectangle are considered transparent. The result is that only
581 | non-blank parts of the yanked rectangle are over-printed.
582 |
583 | =Uniline= and Emacs standard rectangle share the same storage for copied
584 | and killed rectangles, =killed-rectangle=. So, a rectangle can be killed
585 | one way, and yanked another way.
586 |
587 | * Tracing a contour
588 | :PROPERTIES:
589 | :CUSTOM_ID: tracing-a-contour
590 | :END:
591 |
592 | [[file:images/contour-tracing.png]]
593 |
594 | #+begin_example
595 | ╭──────────────╮
596 | ╭─╯A.written.text╰────────╮
597 | │outlined by the.`contour'│
598 | ╰─╮function.gets╶┬────────╯
599 | ╰╮a.surrounding╰───────╮
600 | ╰─╮line.in.the.current│
601 | ╰─╮brush.style╭─────╯
602 | ╰───────────╯
603 | #+end_example
604 |
605 | Choose or change the brush style with any of =-,+,=_,#,=. Put
606 | the cursor anywhere on the shape or outside but touching it. Then
607 | type:
608 |
609 | = c=
610 |
611 | A contour line is traced (or erased if brush style is ==)
612 | around the contiguous shape close to the cursor.
613 |
614 | When hitting capital letter: = C= the contour is
615 | overwritten. This means that if there was already a different style of
616 | line on the contour path, it is overwritten.
617 |
618 | The shape is distinguished because it floats in a blank characters
619 | ocean. For the shake of the contour function, blank characters are
620 | those containing lines as drawn by =Uniline= (including true blank
621 | characters). Locations outside the buffer are also considered blank.
622 |
623 | The algorithm has an upper limit of 10000 steps. This avoids an
624 | infinite loop in which the algorithm may end up in some rare
625 | cases. One of those cases is when the contour crosses a new-page
626 | character, displayed by Emacs as =^L=. 10000 steps require a fraction of
627 | a second to run. For shapes really huge, you may launch the contour
628 | command once again, at the point where the previous run ended.
629 |
630 | * Flood-fill
631 | :PROPERTIES:
632 | :CUSTOM_ID: flood-fill
633 | :END:
634 |
635 | [[file:images/flood-fill.png]]
636 |
637 | #+begin_example
638 |
639 | this.text.surrounds this.text.surrounds
640 | . / .▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒/
641 | . //╶───▷╴.▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒//
642 | ... //// ...▒▒▒▒▒▒▒▒▒▒▒▒////
643 | ...a.hole///// ...a.hole/////
644 |
645 | #+end_example
646 |
647 | A hollow shape is a contiguous region of identical characters (not
648 | necessarily blank), surrounded by a boundary of different
649 | characters. The end of the buffer in any direction is also considered
650 | a boundary.
651 |
652 | Put the cursor anywhere in the hole. Then type:
653 |
654 | = i=
655 |
656 | Answer by giving a character to fill the hole.
657 |
658 | If instead of a character, =SPC= or =DEL= is typed, then a shade of grey
659 | character is picked. =SPC= selects a darker grey than the one the point
660 | is on, while =DEL= selects a lighter. There are 5 shades of grey in the
661 | UNICODE standard: =" ░▒▓█"=. Those grey characters are well supported
662 | by the suggested fonts.
663 |
664 | =C-y= is also an option. The first character in the top of the kill
665 | ring will be chosen as the filling character. The kill ring is filled
666 | by functions like =C-k= or =M-w=.
667 |
668 | Typing == or =C-g= aborts the filling operation.
669 |
670 | A rectangular shape may also be filled.
671 | - Mark a region
672 | - = i=
673 | - answer which character should be used to fill.
674 |
675 | There is no limit on the area to fill. Therefore, the filling
676 | operation may flood the entire buffer (but no more).
677 |
678 | * Text direction
679 | :PROPERTIES:
680 | :CUSTOM_ID: text-direction
681 | :END:
682 | Usually, inserting text in a buffer moves the cursor to the right. (And
683 | sometimes to the left for some locales). Any of the 4 directions can be
684 | selected under =Uniline=. Just type any of:
685 |
686 | - = C-=
687 | - = C-=
688 | - = C-=
689 | - = C-=
690 |
691 | The current direction is reflected in the mode-line, just before the
692 | word ="uniline"=.
693 |
694 | * Macros
695 | :PROPERTIES:
696 | :CUSTOM_ID: macros
697 | :END:
698 | =Uniline= adds directional macros to the Emacs standard macros.
699 |
700 | Record a macro as usual with =C-x (= … =C-x )=.
701 |
702 | Then call it with the usual =C-x e=. But then, instead of executing
703 | the macro, a menu is offered to execute it in any of the 4 directions.
704 |
705 | When a macro is executed in a direction other than the one it was
706 | recorded, it is twisted in that direction. This means that recorded
707 | hits on the 4 keyboard arrows are rotated. It happens also for shift
708 | and control variations of those keys. Direction of text insertion is
709 | also rotated.
710 |
711 | There is still the classical =e= option to call the last recorded
712 | macro. So instead of the usual =C-x e=, type =C-x e e=. And of course,
713 | the usual repetition typing repeatedly =e= is available.
714 |
715 | Why are directional macros useful? To create fancy lines. For
716 | instance, if we want a doted line instead of the continuous one, we
717 | record a macro for one step:
718 |
719 | #+begin_example
720 | C-x ( ;; begin recording
721 | INS o ;; insert a small dot
722 | ;; draw a line over 2 characters
723 | C-x ) ;; stop recording
724 | #+end_example
725 |
726 | Then we call this macro repeatedly in any of the 4 directions:
727 |
728 | [[file:images/macro-doted-line.png]]
729 |
730 | #+begin_example
731 |
732 | ·─·─·─·─· ╷ ·──·
733 | │ │ │ │
734 | · · · ·
735 | │ │ │ │
736 | · ·─·─·─· ·
737 | │ │
738 | ·─·─·─·─·─·─·
739 |
740 | #+end_example
741 |
742 | We can draw complex shapes by just drawing one step. Hereafter, we
743 | call a macro in 4 directions, closing a square:
744 |
745 | [[file:images/macro-fancy-squares.png]]
746 |
747 | #+begin_example
748 |
749 | ╭╮╭╮╭╮╭╮╭╮╭╮ △ △ △ △ △ △ ╭─╮ ╭─╮ ╭─╮ ╭─╮ ╭─╮ ╭─╮ ╭─╮ ╭─╮
750 | ╭─╯╰╯╰╯╰╯╰╯╰╯│ ╶╯╶╯╶╯╶╯╶╯╶╯╷ ╭──╯∙╰─╯∙╰─╯∙╰─╯∙│ ▷┤□├▷┤□├▷┤□├▷┤□├▽
751 | ╰╮ ╰╮ ◁╮ ╰▷ │∙ │ ╭┴┼─╯ ╰─╯ ╰─╯ ╰─┼┴╮
752 | ╭╯ ╭╯ ╵ ╷ ╰╮ ╰╮ │□│ │□│
753 | ╰╮ ╰╮ ◁╮ ╰▷ │ ∙│ ╰┬╯ ╰┬╯
754 | ╭╯ ╭╯ ╵ ╷ ╭╯ ╭╯ △ ▽
755 | ╰╮ ╰╮ ◁╮ ╰▷ │∙ │ ╭┴╮ ╭┴╮
756 | ╭╯ ╭╯ ╵ ╷ ╰╮ ╰╮ │□│ │□│
757 | ╰╮ ╰╮ ◁╮ ╰▷ │ ∙│ ╰┬┼─╮ ╭─╮ ╭─╮ ╭─┼┬╯
758 | │╭╮╭╮╭╮╭╮╭╮╭─╯ ╵╭╴╭╴╭╴╭╴╭╴╭╴ │∙╭─╮∙╭─╮∙╭─╮∙╭──╯ △┤□├◁┤□├◁┤□├◁┤□├◁
759 | ╰╯╰╯╰╯╰╯╰╯╰╯ ▽ ▽ ▽ ▽ ▽ ▽ ╰─╯ ╰─╯ ╰─╯ ╰─╯ ╰─╯ ╰─╯ ╰─╯ ╰─╯
760 |
761 | #+end_example
762 |
763 | * Fine tweaking
764 | :PROPERTIES:
765 | :CUSTOM_ID: fine-tweaking
766 | :END:
767 |
768 | [[file:images/fine-tweaking.png]]
769 |
770 | #+begin_example
771 |
772 | convert this ═══▶ into that
773 | ╭───────────╮ ╭───────────╮
774 | │╶───┬────▷ │ │╶───╮────▷ │
775 | │ │ │ │ │ │
776 | │ │ │ │
777 | │ ▀▀▀ │ │ ▀▟▀ │
778 | ╰───────────╯ ╰───────────╯
779 |
780 | #+end_example
781 |
782 | At the crossing of lines, it may be appealing to do small
783 | adjustments. In the above example, we removed a segment of line which
784 | occupies 1/4 of a character. This cannot be achieve with line tracing
785 | alone. We also modified a quarter-block line in a non-obvious way.
786 |
787 | - Put the point (the cursor) on the character where lines cross each other.
788 | - type =INS S- S-=
789 |
790 | == here refers to the right part of the character under the
791 | point. The 1/4 line segment will cycle through all displayable
792 | forms. On the second stroke, no segment will be displayed, which is
793 | what we want.
794 |
795 | Caveat! The UNICODE standard does not define all possible combinations
796 | including double line segments. (It does for all combinations of thin
797 | and tick lines). So sometimes, when working with double lines, the
798 | process may be frustrating.
799 |
800 | This works also for lines made of quarter-blocks. There are 4
801 | quarter-blocks in a character, either on or off. Each of the 4 shifted
802 | keyboard arrows flips a quarter-block on-and-off.
803 |
804 | In the above example, the effect was achieved with:
805 | =INS S- S- S-=
806 |
807 | * Dashed lines and other styles
808 | :PROPERTIES:
809 | :CUSTOM_ID: dashed-lines-and-other-styles
810 | :END:
811 |
812 | [[file:images/four-styles.png]]
813 |
814 | #+begin_example
815 |
816 | ╭────▷───╮ ┏━━━━▶━━━┓ ╔════▶═══╗
817 | │ ╭─□──╮ │ ┃ ┏━■━━┓ ┃ ║ ╔═■══╗ ║
818 | △ │ │ ▽ ▲ ┃ ┃ ▼ ▲ ║ ║ ▼
819 | │ ╰───◦╯ │ ┃ ┗━━━•┛ ┃ ║ ╚═══•╝ ║
820 | ╰───◁────╯ ┗━━━◀━━━━┛ ╚═══◀════╝
821 |
822 | ╭╌╌╌╌▷╌╌╌╮ ┏╍╍╍╍▶╍╍╍┓
823 | ┆ ╭╌□╌╌╮ ┆ ┇ ┏╍■╍╍┓ ┇
824 | △ ┆ ┆ ▽ ▲ ┇ ┇ ▼
825 | ┆ ╰╌╌╌◦╯ ┆ ┇ ┗╍╍╍•┛ ┇
826 | ╰╌╌╌◁╌╌╌╌╯ ┗╍╍╍◀╍╍╍╍┛
827 |
828 | ╭┈┈┈┈▷┈┈┈╮ ┏┉┉┉┉▶┉┉┉┓
829 | ┊ ╭┈□┈┈╮ ┊ ┋ ┏┉■┉┉┓ ┋
830 | △ ┊ ┊ ▽ ▲ ┋ ┋ ▼
831 | ┊ ╰┈┈┈◦╯ ┊ ┋ ┗┉┉┉•┛ ┋
832 | ╰┈┈┈◁┈┈┈┈╯ ┗┉┉┉◀┉┉┉┉┛
833 |
834 | #+end_example
835 |
836 | A base drawing can be converted to dashed lines. Moreover, lines can
837 | be made either thin or thick.
838 |
839 | - Select the rectangular area you want to operate on (with mouse drag
840 | or =S-=, =S-= and so on).
841 | - Type =INS=, then =s= (as "style").
842 |
843 | You will be offered a choice of styles:
844 | - =3=: vertical lines will become 3 dashes per character, while
845 | horizontal ones will get 2 dashes per character.
846 | - =4=: vertical and horizontal lines will get 4 dashes per character.
847 | - =h=: thin lines corners, which are usually rounded, become hard angles.
848 | - =+=: thin lines corners and intersections become thick, empty glyphs
849 | get filled.
850 | - =-=: thick lines corners and intersections become thin, filled glyphs
851 | are emptied.
852 | - ===: thick and thin lines become double lines.
853 | - =0=: come back to standard base-line Uniline style: plain not-dashed
854 | lines, thin corner rounded, ASCII art is converted to UNICODE.
855 | - =a=: apply the =aa2u-rectangle= function from the unrelated
856 | =ascii-art-to-unicode= package, to convert ASCII art to UNICODE (this
857 | only works if =ascii-art-to-unicode= is already installed)
858 |
859 | Converting parts of a drawing from one style to another can produce
860 | nice looking sketches.
861 |
862 | [[file:images/same-sketch-several-styles.png]]
863 |
864 | #+begin_example
865 |
866 | ╭───╮ ╭───╮ ╭───╮
867 | │░░░│ │░░░│ │░░░┝━▶┓ ╭╌╌╌╌╌╮
868 | │░░░╰───╯░░░╰───╯░░░│ ┃ ┆░░░░░╰╌╌╌╌╌╮
869 | □░░░░░░░░░░░░░░░░░░░│ ┗━┥░░░░░░░░░░░┆
870 | │░░░╭───╮░░░╭───╮░░░│ ┆░░░░░╭╌╌╌╌╌╯
871 | ╰───╯ ╰─┰─╯ ╰─┰─╯ ╰╌╌┰╌╌╯
872 | ▲ ┃ ▼
873 | ┗━━━━━━━┻━━━━━━━━━┛
874 |
875 | ┏━━━┓ ┏━━━┓ ┏━━━┓
876 | ┃░░░┃ ┃░░░┃ ┃░░░┠─▷╮ ┏╍╍╍╍╍┓
877 | ┃░░░┗━━━┛░░░┗━━━┛░░░┃ │ ┇░░░░░┗╍╍╍╍╍┓
878 | ■░░░░░░░░░░░░░░░░░░░┃ ╰─┨░░░░░░░░░░░┇
879 | ┃░░░┏━━━┓░░░┏━━━┓░░░┃ ┇░░░░░┏╍╍╍╍╍┛
880 | ┗━━━┛ ┗━┯━┛ ┗━┯━┛ ┗╍╍┯╍╍┛
881 | △ │ ▽
882 | ╰───────┴─────────╯
883 |
884 | #+end_example
885 |
886 | * ASCII to UNICODE
887 | :PROPERTIES:
888 | :CUSTOM_ID: ascii-to-unicode
889 | :END:
890 |
891 | The standard base-line Uniline (=INS s 0=) or =aa2u-rectangle= (=INS s a=)
892 | conversions may be used to convert ASCII art to UNICODE. The original
893 | ASCII art may be drawn for instance by the =artist-mode= or the
894 | =picture-mode= packages.
895 |
896 | To use =aa2u-rectangle=, install the =ascii-art-to-unicode= package by
897 | Thien-Thi Nguyen (RIP), available on ELPA. Uniline does not requires a
898 | dependency on this package, by lazy evaluating any call to
899 | =aa2u-rectangle=.
900 | See https://elpa.gnu.org/packages/ascii-art-to-unicode.html
901 |
902 | [[file:images/ascii-2-unicode.png]]
903 |
904 | #+begin_example
905 |
906 | +-------------+ +--+
907 | | +-->-| +-----+ ASCII art
908 | | 1 +--------+--+ | 3 | made by
909 | +----+--------+ | +----+---+ Artist-mode
910 | | 2 +-<----+
911 | +-----------+
912 |
913 | ╭─────────────╮ ╭──╮
914 | │ ├──▷─│ ╰─────╮ Converted to
915 | │ 1 ╭────────┼──╮ │ 3 │ Uniline base style
916 | ╰────┼────────╯ │ ╰────┬───╯ INS s 0
917 | │ 2 ├─◁────╯
918 | ╰───────────╯
919 |
920 | ┌─────────────┐ ┌──┐
921 | │ ├──>─│ └─────┐ Converted by
922 | │ 1 ┌────────┼──┐ │ 3 │ aa2u-rectangle
923 | └────┼────────┘ │ └────┬───┘ INS s a
924 | │ 2 ├─<────┘
925 | └───────────┘
926 | #+end_example
927 |
928 | =INS s 0= with selection active calls the =uniline-change-style-standard=
929 | function. It converts what looks ASCII-art to UNICODE-art. Of course,
930 | there are ambiguities regarding whether a character is part of a
931 | sketch or not.
932 |
933 | The heuristic is to consider that a character is part of a sketch if
934 | it is surrounded by at least one other character which is part of a
935 | sketch. So, an isolated =-= minus character will be left alone, while
936 | two such characters =--= will be converted to UNICODE. Conversion will
937 | happens also for =<-= for instance.
938 |
939 | Here is a fairly convoluted ASCII-art example, along with its
940 | conversion by =INS s 0=:
941 |
942 | [[file:images/ascii-2-unicode-b.png]]
943 |
944 | #+begin_example
945 |
946 | ╭─↔--<-◁-◀--━+ +--->------==+
947 | /----/ Rectangle1 |-----+-----+ Rectangle2 v v
948 | | | ^ " | "quote" +-\ ▼
949 | ^^ \------------/ /-+-\ +------------+ " v
950 | | \--+------+--/ | | +----\----/--+ " >▷▶>
951 | \>--\ | | \---/ | | "
952 | v \==<===/ a=b 1=2 a-to-b +----+ ◁==/ >->
953 |
954 | ╭─↔──◁─◁─◀──━┑ ╭───▷──────══╕
955 | ╭────┤ Rectangle1 │─────╥─────┤ Rectangle2 ▽ ▽
956 | │ │ △ ║ │ "quote" ├─╖ ▼
957 | △^ ├────────────┤ ╭─╨─╮ ├────────────┤ ║ ▽
958 | │ ╰──┬──────┬──╯ │ │ ╰────┬────┬──╯ ║ ▷▷▶▷
959 | ╰▷──╮ │ │ ╰───╯ │ │ ║
960 | ▽ ╘══◁═══╛ a=b 1=2 a-to-b ╰────╯ ◁══╝ ▷─▷
961 |
962 | #+end_example
963 |
964 | * Which fonts?
965 | :PROPERTIES:
966 | :CUSTOM_ID: which-fonts
967 | :END:
968 | A mono-space character font must be used. It must also support UNICODE.
969 |
970 | Not all fonts are born equal.
971 |
972 | - =(set-frame-font "DejaVu Sans Mono" )=
973 | - =(set-frame-font "Unifont" )=
974 | - =(set-frame-font "Hack" )=
975 | - =(set-frame-font "JetBrains Mono" )=
976 | - =(set-frame-font "Cascadia Mono" )=
977 | - =(set-frame-font "Agave" )=
978 | - =(set-frame-font "JuliaMono" )=
979 | - =(set-frame-font "FreeMono" )=
980 | - =(set-frame-font "Iosevka Comfy Fixed")=
981 | - =(set-frame-font "Source Code Pro" )=
982 |
983 | Those fonts are known to support the required UNICODE characters, AND
984 | display them as mono-space. There are fonts advertised as mono-space
985 | which give arbitrary widths to non-ASCII characters. That is bad for
986 | the kind of drawings done by =Uniline=.
987 |
988 | You may want to try any of the 10 suggested fonts. Just hit the
989 | corresponding entry in the =Uniline= menu, or type = f=. You may
990 | also execute the above Lisp commands like that:
991 |
992 | =M-: (set-frame-font "DejaVu Sans Mono")=
993 |
994 | This setting is for the current session only. If you want to make it
995 | permanent, you may use the Emacs customization:
996 |
997 | = f *=
998 |
999 | or
1000 |
1001 | =M-x customize-face default=
1002 |
1003 | Beware that Emacs tries to compensate for missing UNICODE support by
1004 | the current font. Emacs substitutes one font for another, character
1005 | per character. The user may not notice until the drawings done under
1006 | Emacs are displayed on another text editor or on the Web.
1007 |
1008 | To know which font Emacs has chosen for a given character, type:
1009 |
1010 | =C-u C-x ==
1011 |
1012 | Note that none of those commands downloads a font from the Web.
1013 | The font should already be available.
1014 |
1015 | * Hydra or Tansient?
1016 | :PROPERTIES:
1017 | :CUSTOM_ID: hydra-or-tansient
1018 | :END:
1019 | Casual usage of =Uniline= should be easy: just move the point, and lines
1020 | are traced.
1021 |
1022 | More complex actions are summoned by the == key, with or without
1023 | selection. This is a single key to remember. Then a textual menu is
1024 | displayed, giving the possible keys continuations and their
1025 | meaning. All that is achieved by the =Hydra= or =Transient= libraries,
1026 | which are now part of Emacs (thanks!).
1027 |
1028 | The =Hydra= and =Transient= libraries offer similar features. Some users
1029 | may prefer one or the other.
1030 |
1031 | =Uniline= was developed from day one with =Hydra=. =Transient= is a late
1032 | addition. It is still experimental.
1033 |
1034 | A switch controls which interface to use:
1035 |
1036 | #+begin_src elisp
1037 | (setq uniline-interface-type :hydra)
1038 | (setq uniline-interface-type :transient)
1039 | #+end_src
1040 |
1041 | The switch is relevant only when installing =Uniline=. Later on,
1042 | changing the switch has no effect. To switch to the other interface,
1043 | reinstall =Uniline=.
1044 |
1045 | ** The Hydra interface
1046 | :PROPERTIES:
1047 | :CUSTOM_ID: the-hydra-interface
1048 | :END:
1049 |
1050 | Set the switch to Hydra before installing =Uniline=:
1051 |
1052 | #+begin_src elisp
1053 | (setq uniline-interface-type :hydra)
1054 | #+end_src
1055 |
1056 | The multi-lines Hydra's menus are quite useful for casual users. For
1057 | seasoned users, those huge textual menus may distract them from
1058 | their workflow.
1059 |
1060 | It is now possible to switch to less distracting textual menus. They
1061 | are displayed in the echo-area on a single line.
1062 |
1063 | To do so, type:
1064 | - =TAB= within a sub-mode (glyph insertion mode, rectangle handling,
1065 | etc.)
1066 | - =C-h TAB= at the top-level.
1067 |
1068 | This will flip between the two sizes of textual menus. It also affects
1069 | the welcome message, the one displayed when entering the =Uniline= minor
1070 | mode.
1071 |
1072 | The current size is controlled by the =uniline-hint-style= variable:
1073 | - =t= for full fledged messages over several lines
1074 | - =1= for one-liner messages
1075 | - =0= for no message at all
1076 |
1077 | The variable is "buffer-local", which means that it can take distinct
1078 | values on distinct buffers.
1079 |
1080 | There are no customizeable =Uniline= variables (not yet). This does not
1081 | prevent customizing =uniline-hint-style= for future sessions. For
1082 | instance, in the =~/.emacs= file, there might be:
1083 |
1084 | #+begin_src elisp
1085 | (use-package uniline
1086 | :config (set-default 'uniline-hint-style 1))
1087 | #+end_src
1088 |
1089 | This setting gives one-liner menus. It can be changed later on a
1090 | buffer per buffer basis with the =TAB= key. Note the use of
1091 | =set-default=. Using =setq= instead would assign the value =1= only in the
1092 | =~/.emacs= buffer.
1093 |
1094 | ** The Transient interface
1095 | :PROPERTIES:
1096 | :CUSTOM_ID: the-transient-interface
1097 | :END:
1098 |
1099 | Set the switch to =Transient= before installing =Uniline=:
1100 |
1101 | #+begin_src elisp
1102 | (setq uniline-interface-type :transient)
1103 | #+end_src
1104 |
1105 | =Transient= interface was added recently to =Uniline=. It is still
1106 | experimental.
1107 |
1108 | Beware that in its current state, =Uniline= as packaged into =Melpa=
1109 | declares =Hydra= as a dependency. There is no way to make the
1110 | dependencies conditional.
1111 |
1112 | =Transient= is not declared as a dependency. Therefore, when choosing
1113 | =Transient=, the =Transient= package should be installed manually (or
1114 | automatically as a dependency on an unrelated package, like =Magit=). It
1115 | should be installed before installing =Uniline=.
1116 |
1117 | The alternative to an installation-time switch would be to release two
1118 | packages: =Uniline-hydra= and =Uniline-transient=. This would be quite
1119 | disturbing.
1120 |
1121 | * Line spacing
1122 | :PROPERTIES:
1123 | :CUSTOM_ID: line-spacing
1124 | :END:
1125 | The =line-spacing= setting in Emacs can change the display of a sketch.
1126 |
1127 | The best looking effect is given by:
1128 | : (setq line-spacing nil)
1129 |
1130 | You may want to change your current setting. =Uniline= may handle this
1131 | variable some day. Right now, =line-spacing= is left as a matter of
1132 | choice for everyone.
1133 |
1134 | [[file:images/line-spacing.png]]
1135 |
1136 | #+begin_example
1137 |
1138 | ╭────┬────────┬────╮ ╺┯━━━━┯┯━━┯┯━┯┯━━━━━━━━┯┯━━━━━━━┯┯━━━━━━┯╸
1139 | │▒▒▒▒╰────────╯▒▒▒▒│ │ │╰is╯╰a╯│ ││ │╰around╯
1140 | │▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒│ ╰this╯ ╰sentence╯╰hanging╯
1141 | │▒▒▒╭─╮▒▒▒▒▒▒╭─╮▒▒▒│ △
1142 | │▒▒▒╰─╯▒▒▒▒▒▒╰─╯▒▒▒│ │ △
1143 | │▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒│ ╰─────────┬────────╯
1144 | ╰──────────────────╯ verbs
1145 | (setq line-spacing nil)
1146 |
1147 | #+end_example
1148 |
1149 | * How =Uniline= behaves with its environment?
1150 | :PROPERTIES:
1151 | :CUSTOM_ID: how-uniline-behaves-with-its-environment
1152 | :END:
1153 | ** Compatibility with Picture-mode
1154 | :PROPERTIES:
1155 | :CUSTOM_ID: compatibility-with-picture-mode
1156 | :END:
1157 |
1158 | =Picture-mode= and =uniline-mode= are compatible. Their features overlap
1159 | somehow:
1160 | - Both implement an unlimited buffer in east and south directions.
1161 | - Both visually truncate long lines (actual text is not truncated).
1162 | - Both set the overwrite mode (=uniline-mode= activates
1163 | =overwrite-mode=, while =picture-mode= re-implements it)
1164 | - Both are able to draw rectangles (=uniline-mode= in UNICODE,
1165 | =picture-mode= in ASCII), copy and yank them.
1166 |
1167 | They also have features unique to each:
1168 | - =Picture-mode= writes in 8 possible directions
1169 | - =Picture-mode= handles TAB stops
1170 | - =Uniline-mode= draws lines and arrows
1171 |
1172 | ** Compatibility with Artist-mode
1173 | :PROPERTIES:
1174 | :CUSTOM_ID: compatibility-with-artist-mode
1175 | :END:
1176 |
1177 | =Artist-mode= and =uniline-mode= are mostly incompatible. This is because
1178 | =artist-mode= preempts the arrow keys, which give access to a large part
1179 | of =uniline-mode= features.
1180 |
1181 | However, it is possible to use both one after the other.
1182 |
1183 | ** Compatibility with Whitespace-mode
1184 | :PROPERTIES:
1185 | :CUSTOM_ID: compatibility-with-whitespace-mode
1186 | :END:
1187 |
1188 | =Whitespace-mode= and =uniline-mode= are mostly compatible.
1189 |
1190 | Why activate =whitespace-mode= while in =uniline-mode=? Because
1191 | =Uniline= creates a lot of white-spaces to implement an infinite
1192 | buffer. And it is funny to look at this activity.
1193 |
1194 | To make =uniline-mode= and =whitespace-mode= fully compatible, disable
1195 | the newline visualization:
1196 |
1197 | - =M-x customize-variable whitespace-style=
1198 | - uncheck =(Mark) NEWLINEs=
1199 |
1200 | This is due to a glitch in =move-to-column= when a visual property is
1201 | attached to newlines. And =uniline-mode= makes heavy use of =move-to-column=.
1202 |
1203 | ** Compatibility with Org Mode
1204 | :PROPERTIES:
1205 | :CUSTOM_ID: compatibility-with-org-mode
1206 | :END:
1207 | You may want to customize the shift extension mode in =Org Mode=. This
1208 | is because =Org Mode= preempts =shift-select-mode= for other useful
1209 | purposes. Just type:
1210 |
1211 | #+begin_example
1212 | M-x customize-variable org-support-shift-select
1213 | #+end_example
1214 |
1215 | and choose "when outside special context", which sets it to =t=.
1216 |
1217 | You then get the shift-selection from =Org Mode=, not from =Uniline=. The
1218 | difference is that the =Uniline='s one handles the infinite-ness of the
1219 | buffer.
1220 |
1221 | Other than that, =Uniline= is compatible with =Org Mode=
1222 |
1223 | ** Org Mode and LaTex
1224 | :PROPERTIES:
1225 | :CUSTOM_ID: org-mode-and-latex
1226 | :END:
1227 | Use the =pmboxdraw= LaTex module. This gives limited support for "box
1228 | drawing" characters in LaTex documents.
1229 |
1230 | Example:
1231 |
1232 | #+begin_example
1233 |
1234 | #+LATEX_HEADER: \usepackage{pmboxdraw}
1235 |
1236 | #+begin_src text
1237 |
1238 | this works:
1239 | ┌─────┐ ┌────────────┐
1240 | │ ├───────┤ │
1241 | └─────┘ │ │
1242 | ┌─────┐ ┌────┤ │
1243 | │ ├──┘ │ │
1244 | └─────┘ ┌────┤ │
1245 | ┌─────┐ │ │ │
1246 | │ ├──┘ └────────────┘
1247 | └─────┘
1248 |
1249 | this does not quite work:
1250 | ┏━━━┓ ┏━━┓ ┏━━━━━┓
1251 | ┃ ┃ ┃ ┣━━━━━┫ ┃
1252 | ┃ ┗━━┛ ┃ ┏┛ ┃
1253 | ┗━━━━━━━━━┛ ┗━━━━━━┛
1254 |
1255 | but that is OK:
1256 | ┏━━━┓
1257 | ┃ ┃
1258 | ┗━━━┛
1259 |
1260 | that is OK too:
1261 | ╺════╦══╗ ╔════╗
1262 | ║ A║ ║ B ╚══╗
1263 | ╚══╝ ╚═══════╝
1264 |
1265 | this works:
1266 |
1267 | ├── dev
1268 | └┬┬ release
1269 | │├── new
1270 | │└── old
1271 | ├── graph
1272 | └── non-graph
1273 |
1274 | #+end_src
1275 |
1276 | #+end_example
1277 |
1278 | Note that corners of thin lines should be sharp. There is no support
1279 | for rounded corners. =Uniline= does not (yet) draw sharp thin
1280 | corners. But it can recognize them.
1281 |
1282 | To export this Org Mode example to PDF through LaTex, type:
1283 |
1284 | =C-c C-E l o=
1285 |
1286 | ** What about =\t= tabs?
1287 | :PROPERTIES:
1288 | :CUSTOM_ID: what-about-t-tabs
1289 | :END:
1290 | Some files may contain tabs (the character =\t=). Those include
1291 | programming code (Python, Perl, C++, D, Rust, JavaScript and so on).
1292 |
1293 | When =Uniline= draws something in the middle of a tab, it first
1294 | converts it to spaces, then proceeds as usual. This process is
1295 | invisible. So be cautious if tabs have a special meaning in the file.
1296 |
1297 | One way to see what is going on, is to activate the =whitespace-mode=.
1298 |
1299 | ** What about =^L= page separation?
1300 | :PROPERTIES:
1301 | :CUSTOM_ID: what-about-l-page-separation
1302 | :END:
1303 | =Uniline= does not work well with =^L= (page separation)
1304 | character. Nore with similar characters, like =^T=. When trying to
1305 | draw a line over such a character, the cursor may get stuck. This is
1306 | because those characters occupy twice the width of a normal character.
1307 |
1308 | Just try to get away from =^L=, =^T= and such when drawing with
1309 | =Uniline=.
1310 |
1311 | ** Emacs on the Linux console
1312 | :PROPERTIES:
1313 | :CUSTOM_ID: emacs-on-the-linux-console
1314 | :END:
1315 | Linux consoles are the 7 non-graphic screens which can be accessed
1316 | usually typing =C-M-F1=, =C-M-F2=, and so on. Such a screen is also
1317 | presented when connecting through =ssh= or =tls= into a non-graphical server.
1318 |
1319 | By default they use a font
1320 | named "Fixed" with poor support for Unicode. However, it supports
1321 | lines of the 3 types, mixing all of them in thin lines though.
1322 |
1323 | Another problem is that by default =S-= and =C-= are
1324 | indistinguishable from ==. Same problem with ==, ==, ==
1325 | and ==. This has nothing to do with Emacs. A solution can be
1326 | found here: https://www.emacswiki.org/emacs/MissingKeys
1327 |
1328 | ** Emacs on a graphical terminal emulator
1329 | :PROPERTIES:
1330 | :CUSTOM_ID: emacs-on-a-graphical-terminal-emulator
1331 | :END:
1332 | This is the Emacs launched from a terminal typing =emacs -nw=. In this
1333 | environment, == does not exists. It is replaced by
1334 | ==. This has already been taken into account by =Uniline=
1335 | by duplicating the key-bindings for the two flavors of this key.
1336 |
1337 | If you decide to bind globally =C-= to the toggling of
1338 | =Uniline= minor mode as suggested, then you will have to do the same
1339 | for =C-=, for example with =use-package= in your
1340 | =~/.emacs= file:
1341 |
1342 | #+begin_src elisp
1343 | (use-package uniline
1344 | :defer t
1345 | :bind ("C-" . uniline-mode)
1346 | :bind ("C-" . uniline-mode))
1347 | #+end_src
1348 |
1349 | ** Emacs on Windows
1350 | :PROPERTIES:
1351 | :CUSTOM_ID: emacs-on-windows
1352 | :END:
1353 | On Windows the only native mono-spaced fonts are =Lucida Console= and
1354 | =Courier New=. They are not mono-spaced for the Unicodes used by
1355 | =Uniline=.
1356 |
1357 | Often, the =Consolas= font is present on Windows. It supports quite well
1358 | the required Unicodes to draw lines. A few glyphs produce unaligned
1359 | result though. They should be avoided under =Consolas=: =△▶▹◇◆=
1360 |
1361 | Of course, other fonts may be installed. It is quite easy.
1362 |
1363 | * Lisp API
1364 | :PROPERTIES:
1365 | :CUSTOM_ID: lisp-api
1366 | :END:
1367 | Could Uniline be programmed (versus used interactively)?
1368 | Yes!
1369 |
1370 | The API is usable programatically:
1371 |
1372 | Move cursor while drawing lines by calling any of the 4 directions
1373 | functions:
1374 | - =uniline-write-up↑=
1375 | - =uniline-write-ri→=
1376 | - =uniline-write-dw↓=
1377 | - =uniline-write-lf←=
1378 |
1379 | They expect a repeat =count= (usually 1) and optionally =force=t= to
1380 | overwrite the buffer
1381 |
1382 | Set the current brush by calling any of the following:
1383 |
1384 | - =uniline--set-brush-nil ;; write nothing=
1385 | - =uniline--set-brush-0 ;; eraser=
1386 | - =uniline--set-brush-1 ;; single thin line╶─╴=
1387 | - =uniline--set-brush-2 ;; single thick line╺━╸=
1388 | - =uniline--set-brush-3 ;; double line╺═╸=
1389 | - =uniline--set-brush-block ;; blocks ▙▄▟▀=
1390 |
1391 | Those functions are equivalent to:
1392 |
1393 | - =(setq uniline--brush nil)=
1394 | - =(setq uniline--brush 0)=
1395 | - =(setq uniline--brush 1)=
1396 | - =(setq uniline--brush 2)=
1397 | - =(setq uniline--brush 3)=
1398 | - =(setq uniline--brush :block)=
1399 |
1400 | except the functions also update the mode-line.
1401 |
1402 | For instance, if we want to create a function to draw a "plus" sign,
1403 | we can code it as follows:
1404 |
1405 | #+begin_src elisp
1406 | (defun uniline-draw-plus ()
1407 | (interactive)
1408 | (uniline-write-ri→ 1)
1409 | (uniline-write-dw↓ 1)
1410 | (uniline-write-ri→ 1)
1411 | (uniline-write-dw↓ 1)
1412 | (uniline-write-lf← 1)
1413 | (uniline-write-dw↓ 1)
1414 | (uniline-write-lf← 1)
1415 | (uniline-write-up↑ 1)
1416 | (uniline-write-lf← 1)
1417 | (uniline-write-up↑ 1)
1418 | (uniline-write-ri→ 1)
1419 | (uniline-write-up↑ 1))
1420 | #+end_src
1421 |
1422 | Calling =M-x uniline-draw-plus= will result in this nice little
1423 | plus-shape:
1424 |
1425 | [[file:images/plus-shape.png]]
1426 |
1427 | #+begin_example
1428 | ╭╮
1429 | ╭╯╰╮
1430 | ╰╮╭╯
1431 | ╰╯
1432 | generated by
1433 | M-x uniline-draw-plus
1434 | #+end_example
1435 |
1436 | We may modify the function to accept the size of the shape as a
1437 | parameter:
1438 |
1439 | #+begin_src elisp
1440 | (defun uniline-draw-plus (size)
1441 | (interactive "Nsize? ")
1442 | (uniline-write-ri→ size)
1443 | (uniline-write-dw↓ size)
1444 | (uniline-write-ri→ size)
1445 | (uniline-write-dw↓ size)
1446 | (uniline-write-lf← size)
1447 | (uniline-write-dw↓ size)
1448 | (uniline-write-lf← size)
1449 | (uniline-write-up↑ size)
1450 | (uniline-write-lf← size)
1451 | (uniline-write-up↑ size)
1452 | (uniline-write-ri→ size)
1453 | (uniline-write-up↑ size))
1454 | #+end_src
1455 |
1456 | The =(interactive "Nsize? ")= form prompt user for the size of the shape
1457 | if not given as a parameter.
1458 |
1459 | This API works in any mode, not only in Uniline minor mode. They take
1460 | care of the infiniteness of the buffer in the right and down
1461 | directions.
1462 |
1463 | Other useful functions are:
1464 |
1465 | Drawing and moving many characters at once:
1466 |
1467 | - =uniline-contour=
1468 | - =uniline-fill=
1469 | - =uniline-draw-inner-rectangle=
1470 | - =uniline-draw-outer-rectangle=
1471 | - =uniline-copy-rectangle=
1472 | - =uniline-kill-rectangle=
1473 | - =uniline-yank-rectangle=
1474 | - =uniline-fill-rectangle=
1475 | - =uniline-move-rect-up↑=
1476 | - =uniline-move-rect-ri→=
1477 | - =uniline-move-rect-dw↓=
1478 | - =uniline-move-rect-lf←=
1479 |
1480 | Constants for the 4 directions:
1481 |
1482 | - =uniline-direction-up↑ ;; constant 0=
1483 | - =uniline-direction-ri→ ;; constant 1=
1484 | - =uniline-direction-dw↓ ;; constant 2=
1485 | - =uniline-direction-lf← ;; constant 3=
1486 |
1487 | Changing text direction:
1488 |
1489 | - =uniline-text-direction-up↑=
1490 | - =uniline-text-direction-ri→=
1491 | - =uniline-text-direction-dw↓=
1492 | - =uniline-text-direction-lf←=
1493 |
1494 | or (in this case the mode-line is not updated):
1495 |
1496 | - =(setq uniline-text-direction uniline-direction-up↑)=
1497 | - =(setq uniline-text-direction uniline-direction-ri→)=
1498 | - =(setq uniline-text-direction uniline-direction-dw↓)=
1499 | - =(setq uniline-text-direction uniline-direction-lf←)=
1500 |
1501 | Call macro in any direction:
1502 |
1503 | - =uniline-call-macro-in-direction-up↑=
1504 | - =uniline-call-macro-in-direction-ri→=
1505 | - =uniline-call-macro-in-direction-dw↓=
1506 | - =uniline-call-macro-in-direction-lf←=
1507 |
1508 | Insert glyphs:
1509 |
1510 | - =uniline-insert-fw-arrow=
1511 | - =uniline-insert-fw-square=
1512 | - =uniline-insert-fw-oshape=
1513 | - =uniline-insert-fw-cross=
1514 | - =uniline-insert-bw-arrow=
1515 | - =uniline-insert-bw-square=
1516 | - =uniline-insert-bw-oshape=
1517 | - =uniline-insert-bw-cross=
1518 |
1519 | Rotate arrow or tweak 4-half-lines or 4-block characters:
1520 |
1521 | - =uniline-rotate-up↑=
1522 | - =uniline-rotate-ri→=
1523 | - =uniline-rotate-dw↓=
1524 | - =uniline-rotate-lf←=
1525 |
1526 | Move point, possibly extending the buffer in right and bottom
1527 | directions:
1528 |
1529 | - =uniline-move-to-column=
1530 | - =uniline-move-to-line=
1531 | - =uniline-move-to-lin-col=
1532 | - =uniline-move-to-delta-column=
1533 | - =uniline-move-to-delta-line=
1534 |
1535 | * Installation
1536 | :PROPERTIES:
1537 | :CUSTOM_ID: installation
1538 | :END:
1539 |
1540 | Add the following lines to your =.emacs= file,
1541 | and reload it, if not already done:
1542 |
1543 | #+begin_src elisp
1544 | (add-to-list 'package-archives
1545 | '("melpa" . "http://melpa.org/packages/")
1546 | t)
1547 | (package-initialize)
1548 | #+end_src
1549 |
1550 | Alternately you may customize this variable:
1551 |
1552 | #+begin_example
1553 | M-x customize-variable package-archives
1554 | #+end_example
1555 |
1556 | Then download the package:
1557 |
1558 | #+begin_src elisp
1559 | (package-install "uniline")
1560 | #+end_src
1561 |
1562 | Alternately, you can download the Lisp file, and load it:
1563 |
1564 | #+begin_src elisp
1565 | (load-file "uniline.el")
1566 | #+end_src
1567 |
1568 | You may want to give =uniline-mode= a key-binding. =use-package=
1569 | in your =$HOME/.emacs= file is great for that:
1570 |
1571 | #+begin_src elisp
1572 | (use-package uniline
1573 | :defer t
1574 | :bind ("C-" . uniline-mode))
1575 | #+end_src
1576 |
1577 | In this example, =C-= was chosen. You can use whatever keys combination you want.
1578 | == happens to also be the key used inside =Uniline=.
1579 |
1580 | * Related packages
1581 | :PROPERTIES:
1582 | :CUSTOM_ID: related-packages
1583 | :END:
1584 |
1585 | - =artist-mode=: the ASCII art mode built into Emacs.
1586 |
1587 | - =ascii-art-to-unicode=: as the name suggest, converts ASCII drawings
1588 | to UNICODE, giving results similar to those of =Uniline=.
1589 |
1590 | - =picture-mode=: as in =Uniline=, the buffer is infinite in east & south
1591 | directions.
1592 |
1593 | - =ascii-art-to-unicode= ASCII art to UNICODE in Emacs. This is a
1594 | standard ELPA package by Thien-Thi Nguyen (rest in peace). Uniline
1595 | may call it to convert ASCII art drawings to equivalent
1596 | UNICODE. Uniline arranges to not require a dependency on
1597 | =ascii-art-to-unicode= by lazy evaluating a call to =aa2u=.
1598 |
1599 | - =org-pretty-table=: Org Mode tables /appear/ to be drawn in UNICODE
1600 | characters (actually they are still in ASCII).
1601 |
1602 | - =boxes=: draws artistic boxes around text, with nice looking unicorns,
1603 | flowers, parchments, all in ASCII art.
1604 |
1605 | - =org-drawio=: a bridge between the Draw.Io editor and Emacs, producing
1606 | drawing similar to those of =Uniline=, but in =.svg=.
1607 |
1608 | - =syntree=: draws ASCII trees on-the-fly from description.
1609 |
1610 | - =unicode-enbox=: create a UNICODE box around a text; input and output
1611 | are strings.
1612 |
1613 | - =unicode-fonts=: in Emacs, helps alleviate the lack of full UNICODE
1614 | coverage of most fonts.
1615 |
1616 | - =org-superstar=: prettify headings and plain lists in Org Mode, using
1617 | UNICODE glyphs.
1618 |
1619 | - =charmap=: UNICODE table viewer for Emacs.
1620 |
1621 | - =insert-char-preview=: insert UNICODEs with character preview in
1622 | completion prompt.
1623 |
1624 | - =list-unicode-display=: list all UNICODE characters, or a selection of
1625 | them.
1626 |
1627 | - =show-font=: show font features in a buffer.
1628 |
1629 | - =ob-svgbob=: convert your ascii diagram scribbles into happy little
1630 | SVG
1631 |
1632 | - =el-easydraw=: a full featured SVG editor right inside your Emacs
1633 |
1634 | - =asciiflow=: (not Emacs) draw on the web, then copy-paste your UNICODE text
1635 |
1636 | - =dot-to-ascii.ggerganov.com:= (not Emacs) describe your schema in the
1637 | Graphviz language, and copy-past your UNICODE text.
1638 |
1639 | - =monosketch=: (not Emacs) draw on the web, then copy-paste your UNICODE text
1640 |
1641 | - =ibm-box-drawing-hydra.el=: keyboard interface to insert UNICODE
1642 | box-drawing characters one at a time
1643 |
1644 | - =org-excalidraw=: integrate SVG images generated by excalidraw into
1645 | Org Mode
1646 |
1647 | - =rcd-box=: create tables surrounded by box-drawing characters from
1648 | Lisp descriptions
1649 |
1650 | - =ob-diagram=: generate various diagrams using diagrams backend
1651 |
1652 | - =ob-mermaid=: generate Mermaid diagrams within org-mode babel
1653 |
1654 | - =quail-boxdrawing.el=: input method for box drawing characters
1655 |
1656 | - =make-box.el=: box around part of a buffer
1657 |
1658 | - =vim drawit ascii diagrams=: in Vin, in ASCII
1659 |
1660 | * Author, contributors
1661 | :PROPERTIES:
1662 | :CUSTOM_ID: author-contributors
1663 | :END:
1664 | - Thierry Banel, author
1665 |
1666 | Feedback:
1667 |
1668 | - Chris Rayner (@riscy), gave recommendations prior to insertion in
1669 | MELPA
1670 |
1671 | - Adam Porter (@alphapapa), suggested submitting Uniline to ELPA;
1672 | should I?
1673 |
1674 | - Joost Kremers https://github.com/joostkremers found a bug in the
1675 | minor-mode key-binding definitions, and incompatibility with
1676 |
1677 | - DogLooksGood https://github.com/DogLooksGood gave feedback on
1678 | inserting usual characters not moving the cursor
1679 |
1680 | Utilities:
1681 |
1682 | - Oleh Krehel alias abo-abo for his package =hydra=
1683 |
1684 | - Thien-Thi Nguyen (RIP) for his package =ascii-art-to-unicode=
1685 |
1686 | * License
1687 | :PROPERTIES:
1688 | :CUSTOM_ID: license
1689 | :END:
1690 | Copyright (C) 2024-2025 Thierry Banel
1691 |
1692 | Uniline is free software: you can redistribute it and/or modify it under
1693 | the terms of the GNU General Public License as published by the Free
1694 | Software Foundation, either version 3 of the License, or (at your
1695 | option) any later version.
1696 |
1697 | Uniline is distributed in the hope that it will be useful, but WITHOUT
1698 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
1699 | FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
1700 | for more details.
1701 |
1702 | You should have received a copy of the GNU General Public License
1703 | along with this program. If not, see .
1704 |
--------------------------------------------------------------------------------
/images/arrow-styles.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tbanel/uniline/ad2c970cb1b5fcfca477b74ece597ca674d31f4f/images/arrow-styles.png
--------------------------------------------------------------------------------
/images/ascii-2-unicode-b.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tbanel/uniline/ad2c970cb1b5fcfca477b74ece597ca674d31f4f/images/ascii-2-unicode-b.png
--------------------------------------------------------------------------------
/images/ascii-2-unicode.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tbanel/uniline/ad2c970cb1b5fcfca477b74ece597ca674d31f4f/images/ascii-2-unicode.png
--------------------------------------------------------------------------------
/images/boxes-arrows.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tbanel/uniline/ad2c970cb1b5fcfca477b74ece597ca674d31f4f/images/boxes-arrows.png
--------------------------------------------------------------------------------
/images/contour-tracing.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tbanel/uniline/ad2c970cb1b5fcfca477b74ece597ca674d31f4f/images/contour-tracing.png
--------------------------------------------------------------------------------
/images/decision-tree.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tbanel/uniline/ad2c970cb1b5fcfca477b74ece597ca674d31f4f/images/decision-tree.png
--------------------------------------------------------------------------------
/images/document-command.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tbanel/uniline/ad2c970cb1b5fcfca477b74ece597ca674d31f4f/images/document-command.png
--------------------------------------------------------------------------------
/images/draw-rectangle.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tbanel/uniline/ad2c970cb1b5fcfca477b74ece597ca674d31f4f/images/draw-rectangle.png
--------------------------------------------------------------------------------
/images/fine-tweaking.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tbanel/uniline/ad2c970cb1b5fcfca477b74ece597ca674d31f4f/images/fine-tweaking.png
--------------------------------------------------------------------------------
/images/flood-fill.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tbanel/uniline/ad2c970cb1b5fcfca477b74ece597ca674d31f4f/images/flood-fill.png
--------------------------------------------------------------------------------
/images/foreign-language-sentence.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tbanel/uniline/ad2c970cb1b5fcfca477b74ece597ca674d31f4f/images/foreign-language-sentence.png
--------------------------------------------------------------------------------
/images/four-styles.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tbanel/uniline/ad2c970cb1b5fcfca477b74ece597ca674d31f4f/images/four-styles.png
--------------------------------------------------------------------------------
/images/general-relativity-equation.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tbanel/uniline/ad2c970cb1b5fcfca477b74ece597ca674d31f4f/images/general-relativity-equation.png
--------------------------------------------------------------------------------
/images/insert-glyphs.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tbanel/uniline/ad2c970cb1b5fcfca477b74ece597ca674d31f4f/images/insert-glyphs.png
--------------------------------------------------------------------------------
/images/line-spacing.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tbanel/uniline/ad2c970cb1b5fcfca477b74ece597ca674d31f4f/images/line-spacing.png
--------------------------------------------------------------------------------
/images/lines-blocks.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tbanel/uniline/ad2c970cb1b5fcfca477b74ece597ca674d31f4f/images/lines-blocks.png
--------------------------------------------------------------------------------
/images/lisp-lists.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tbanel/uniline/ad2c970cb1b5fcfca477b74ece597ca674d31f4f/images/lisp-lists.png
--------------------------------------------------------------------------------
/images/macro-doted-line.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tbanel/uniline/ad2c970cb1b5fcfca477b74ece597ca674d31f4f/images/macro-doted-line.png
--------------------------------------------------------------------------------
/images/macro-fancy-squares.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tbanel/uniline/ad2c970cb1b5fcfca477b74ece597ca674d31f4f/images/macro-fancy-squares.png
--------------------------------------------------------------------------------
/images/mode-line.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tbanel/uniline/ad2c970cb1b5fcfca477b74ece597ca674d31f4f/images/mode-line.png
--------------------------------------------------------------------------------
/images/move-rectangle.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tbanel/uniline/ad2c970cb1b5fcfca477b74ece597ca674d31f4f/images/move-rectangle.png
--------------------------------------------------------------------------------
/images/plus-shape.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tbanel/uniline/ad2c970cb1b5fcfca477b74ece597ca674d31f4f/images/plus-shape.png
--------------------------------------------------------------------------------
/images/same-sketch-several-styles.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tbanel/uniline/ad2c970cb1b5fcfca477b74ece597ca674d31f4f/images/same-sketch-several-styles.png
--------------------------------------------------------------------------------
/images/schrodinger-equation.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tbanel/uniline/ad2c970cb1b5fcfca477b74ece597ca674d31f4f/images/schrodinger-equation.png
--------------------------------------------------------------------------------
/images/sketched-objects.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tbanel/uniline/ad2c970cb1b5fcfca477b74ece597ca674d31f4f/images/sketched-objects.png
--------------------------------------------------------------------------------
/images/water-sketch.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tbanel/uniline/ad2c970cb1b5fcfca477b74ece597ca674d31f4f/images/water-sketch.png
--------------------------------------------------------------------------------
/tests/bench1.el:
--------------------------------------------------------------------------------
1 | ;;; uniline.el --- Draw lines, boxes, & arrows with the keyboard -*- coding:utf-8; lexical-binding: t; -*-
2 |
3 | ;; Copyright (C) 2024-2025 Thierry Banel
4 |
5 | ;; Author: Thierry Banel tbanelwebmin at free dot fr
6 | ;; Version: 1.0
7 | ;; URL: https://github.com/tbanel/uniline
8 |
9 | ;; Uniline is free software: you can redistribute it and/or modify
10 | ;; it under the terms of the GNU General Public License as published by
11 | ;; the Free Software Foundation, either version 3 of the License, or
12 | ;; (at your option) any later version.
13 |
14 | ;; Uniline is distributed in the hope that it will be useful,
15 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
16 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 | ;; GNU General Public License for more details.
18 |
19 | ;; You should have received a copy of the GNU General Public License
20 | ;; along with this program. If not, see .
21 |
22 | (uniline-bench
23 | "b RET c - C-SPC RET RET + a a a S- RET - "
24 |
25 | "\
26 | │
27 | bc╶┴─╮
28 | ╰─┰──╯
29 | ━━━━━━△━━◀━━━┛
30 | ")
31 |
--------------------------------------------------------------------------------
/tests/bench10.el:
--------------------------------------------------------------------------------
1 | ;;; uniline.el --- Draw lines, boxes, & arrows with the keyboard -*- coding:utf-8; lexical-binding: t; -*-
2 |
3 | ;; Copyright (C) 2024-2025 Thierry Banel
4 |
5 | ;; Author: Thierry Banel tbanelwebmin at free dot fr
6 | ;; Version: 1.0
7 | ;; URL: https://github.com/tbanel/uniline
8 |
9 | ;; Uniline is free software: you can redistribute it and/or modify
10 | ;; it under the terms of the GNU General Public License as published by
11 | ;; the Free Software Foundation, either version 3 of the License, or
12 | ;; (at your option) any later version.
13 |
14 | ;; Uniline is distributed in the hope that it will be useful,
15 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
16 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 | ;; GNU General Public License for more details.
18 |
19 | ;; You should have received a copy of the GNU General Public License
20 | ;; along with this program. If not, see .
21 |
22 | ;; a macro cannot be defined inside another macro,
23 | ;; so this macro is defined outside
24 | (setq last-kbd-macro (kbd " C- C- "))
25 |
26 | (uniline-bench
27 | " a a a a a a a a a a a a a a a a a a a a C-a C-k C-y C-a C-y C-a C-y C-a C-x e e e e "
28 | "\
29 | ╭╮╭╮╭╮╭╮╭╮╭╮
30 | ╶┼┴╯╰╯╰╯╰╯╰╯│
31 | ╰╴aaaaaaaaa╶╮aaaaaaa
32 | ╭aaaaaaaaaaa╯aaaaaaa
33 | ╰╴aaaaaaaaa╶╮aaaaaaa
34 | ╭╯ ╭╯
35 | ╰╮ ╰╮
36 | │╭╮╭╮╭╮╭╮╭─╯
37 | ╰╯╰╯╰╯╰╯╰╯
38 | ")
39 |
--------------------------------------------------------------------------------
/tests/bench11.el:
--------------------------------------------------------------------------------
1 | ;;; uniline.el --- Draw lines, boxes, & arrows with the keyboard -*- coding:utf-8; lexical-binding: t; -*-
2 |
3 | ;; Copyright (C) 2024-2025 Thierry Banel
4 |
5 | ;; Author: Thierry Banel tbanelwebmin at free dot fr
6 | ;; Version: 1.0
7 | ;; URL: https://github.com/tbanel/uniline
8 |
9 | ;; Uniline is free software: you can redistribute it and/or modify
10 | ;; it under the terms of the GNU General Public License as published by
11 | ;; the Free Software Foundation, either version 3 of the License, or
12 | ;; (at your option) any later version.
13 |
14 | ;; Uniline is distributed in the hope that it will be useful,
15 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
16 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 | ;; GNU General Public License for more details.
18 |
19 | ;; You should have received a copy of the GNU General Public License
20 | ;; along with this program. If not, see .
21 |
22 | (uniline-bench
23 | "C-q t a b s SPC ? C-a C-q C-q 2 SPC t a b s s "
24 | "\
25 | ╭─────tabs╮?
26 | │ │ 2 tabs
27 | ╶─╯ □
28 | ")
29 |
--------------------------------------------------------------------------------
/tests/bench12.el:
--------------------------------------------------------------------------------
1 | ;;; uniline.el --- Draw lines, boxes, & arrows with the keyboard -*- coding:utf-8; lexical-binding: t; -*-
2 |
3 | ;; Copyright (C) 2024-2025 Thierry Banel
4 |
5 | ;; Author: Thierry Banel tbanelwebmin at free dot fr
6 | ;; Version: 1.0
7 | ;; URL: https://github.com/tbanel/uniline
8 |
9 | ;; Uniline is free software: you can redistribute it and/or modify
10 | ;; it under the terms of the GNU General Public License as published by
11 | ;; the Free Software Foundation, either version 3 of the License, or
12 | ;; (at your option) any later version.
13 |
14 | ;; Uniline is distributed in the hope that it will be useful,
15 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
16 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 | ;; GNU General Public License for more details.
18 |
19 | ;; You should have received a copy of the GNU General Public License
20 | ;; along with this program. If not, see .
21 |
22 | (uniline-bench
23 | " S- S- S- S- S- S- S- S- S- S- S- S- S- S- S- S- S- i SPC