Org-mode key bindings for emphasis markers (bold, italic, underline) - emacs

I set org-hide-emphasis-markers to true in my init file, so that all text marked as *bold* just shows up as bold. But now I'm wondering how to toggle this formatting on/off without making these characters visible again... is there a key binding for this? How about italics and underline?
Thanks!
-Adam

[This is a workaround, not a solution]
If you place the cursor after the bold text and press C-d, the trailing asterisk is deleted and the leading markup becomes visible. Similarly, if you place the cursor before the bold text and press C-d, the leading asterisk is deleted and the trailing markup becomes visible.

Related

How to remove this gray line that causes text to wrap in VS Code?

I've recently noticed that when typing out long lines of code, they split into multiple lines after this threshold and it bothers me. enter image description here
Not sure if it was a formatting extension that I put on here years ago, but I couldn't seem to locate it in the settings.
The grey line isn't what causes the wrapping. You can apply settings to have the grey line and not have wrapping. They grey line is displayed according to the editor.ruler setting.
In general text editor terminology, this wrapping you are observing is called "soft wrapping" (when an editor wraps long lines in its rendering of the text, but doesn't actually insert line-break characters, which is called "hard wrapping").
By default, soft-wrapping can be toggled by Alt+z (The command palette command is named View: Toggle Word Wrap).
The default setting of soft wrapping for VS Code is configurable by the editor.wordWrap setting. It has several values it can take on:
"bounded": lines wrap at the minimum of viewport width and editor.wordWrapColumn,
"off": Lines will never wrap
"on": Lines will wrap at the viewport width
"wordWrapColumn": Lines will wrap at editor.wordWrapColumn
The word wrap column is configurable by the editor.wordWrapColumn setting. See also the editor.wrappingIndent and wrappingStrategy settings.
This is a setting called rulers. Go into Settings and search "rulers". Then you will be able to edit the settings.json file. Under "editor.rulers" remove all values in the array so that it is empty. That should solve it.

VSCode Extension createTextEditorDecorationType ignore whitespace

I'm working on an extension which colors some text within the editor based on some condition. Unfortunately, it looks like the style applied to the text is also applied to the whitespace characters when the user has editor.renderWhitespace enabled.
I can't find anything in the API which gives the option of ignoring the whitespace when coloring.
Does anyone know of a way to leave the color of the whitespace characters intact?
There is a setting to change the color and opacity of whitespace characters when made visible as discussed here. It says that you could use:
"workbench.colorCustomizations": {
"editorWhitespace.foreground": "#FF0000"
}
The colors for the whitespace is taken from the invisibles property in themes, so the color is customizable via themes.
<key>invisibles</key>
<string>#3B3A32</string>
for more information please read this issue here

gtk turn on italic, bold, etc in textview

[Revised]
I am trying GTK3 TextView, in C. I know how to apply tags, such as italics, etc., to a region of text.
But how do I "turn on" a style (italics, bold, etc) while typing in the buffer? For example, suppose I am typing text and there are no styles set. Then I want to type in italics. I want to apply the italic tag to the insert point, after which whatever I typed would be in italics.
I notice that when you place the insert cursor to the right of any existing styled text, the tags of the previous character are inherited, but only if the style is in effect before and after the insert point. Interestingly, the trailing newline can be stylized, so when the insert point is at the end of a line and the last visible character has a style, then that style is inherited.
I've looked at some methods that use a key-press signal and then apply a text tag to the region of the untagged character just typed, but that is slow and looks odd on screen -- the plain char is displayed and then replaced by the tagged char.
I've also tried:
gtk_text_buffer_insert_markup(buf, &iter, "<i>", -1);
but that gets a Warning: Invalid markup string: ... Element 'markup' was closed, but the currently open element is 'i' and has no effect on the displayed text. Using <i></i> gets no warning but also has no effect. I finally resorted to:
gtk_text_buffer_insert_markup(buf, &iter, "<i> </i>", -1); // 2 spaces
gtk_text_iter_backward_char (&iter);
gtk_text_buffer_place_cursor(buf, &iter);
which lets me start typing in italics between 2 new spaces -- that's not so bad.
But clicking an "I" button to start typing in italics -- that is a basic editing function that has been around for decades. It must be possible in GTK somehow?
Any ideas?
thanks

how to add an empty (or default) Selection to font_formats and fontsize_formats?

in the configuration of tinyMCE I define some font selection:
font_formats: "Calibri=calibri,sans-serif; Arial=arial,sans-serif; Times New Roman=times new roman,sans-serif",
fontsize_formats: "8pt 10pt 12pt 14pt 18pt 24pt 36pt",
now the user can mark some text and assign a special font or a special fontsize to the marked text.
I would like the user to be able to undo this again. That means, later the user should be able to mark
this text again and to assign "no special font" or "no special fontsize" to the marked text.
But in the selection of font and fontsize there is no empty item and no "default"- item.
How can I add this to these font-select-boxes?
(I use tinyMCE 4.1.10)
You can add the Clear Formatting toolbar button by adding this to the toolbar in your init:
toolbar: '... | removeformat | ...'
...this will add a button that will clear formatting from the selected text (including formatting added via the two options you reference).

How to add padding to symbol text in Visio 2013?

In Visio 2013, I have a connector that is in a container that has a gray background color. I successfully changed the background color of the text block by following these steps:
Double-click the connector
Expand the font options by clicking on the icon in the lower-right portion of the 'Home > Font' ribbon area
Click on 'Text Block' tab in the 'Text' dialog
Select 'Solid color' and choose the background color that matches the gray container background color
That works as expected - my text background color is no longer the default white; it now matches the background color of the container.
However, I want to add spacing to the left and right of the text. I tried increasing the margins in the same 'Text Block' tab of the 'Text' dialog mentioned above. This increased the margins but did not extend the background color of the text. A also tried manually adding spaces to the left and right of the text. The leading spaces worked, but the trailing spaces where truncated. Is there any way to add left and right padding to the text (similar to css padding)?
Modifying the text block location/size may give you what you want, combined with text margins.
To modify the text block location, you have to click the text block tool, which is on a dropdown with the text tool (at least in Visio 2003).
I know this is an old question, but I had the same question myself and wasn't able to (quickly) find an answer out there either. I finally hit upon a trick that'll get the result we're looking for:
Instead of spaces, add leading and trailing characters to the longest line in the text box. (I use ".")
Change the color of ONLY those added characters so it matches the text box's background.
The text box's background reaches to the furthest edge of the text within, and we're just using that to get what we want. Since it's just moving the edge indirectly, I consider it a "trick" that we can use instead of a "fix".
Quick list of Cons:
The text box background color has to be solid, or close to it.
The "invisible" text will still exist, so it'll show up in a copy/paste of the text.
Similarly, it may make Searching/CTRL+F for things within the document/file more difficult.
You can use No-Break Space. Insert it from Insert > Symbol.