Apply a style in scribble - racket

I have the following style which should change the color to red (using color-property:
(define red
(style #f
(list (color-property "red"))))
How can I apply that style to a word in my text. Say I want WARNING!!! to appear in red.

You can use elem to apply a style to a piece of text.
So, your text could look like this:
#elem[#:style red]{WARNING!!!} This is a warning.

Related

Aligning lists in Emacs org-mode with a proportional font?

Does org-mode have a way to correctly align numbered lists (and other indented items) when using a proportional font, like Helvetica?
Thanks!
Not a full fix, but I use the following in my init.el:
;; Ensure the indent face is always fixed pitch. This matches my
;; headline font, and therefore we indent consistent with heading font
;; pitch.
(add-hook 'after-init-hook
(lambda ()
(set-face-attribute 'org-indent nil :inherit 'fixed-pitch)))
This gets the left-hand edge of indents working for me (so they match the indent of headings, for example), but isn't quite right if the bullet/list line is sufficiently long to wrap. Still, it fixes the main problem for me which was these items appearing to be at a higher level than the headings.

How to add padding to emacs -nw linum-mode?

I am using Emacs -nw in Ubuntu. I like to turn on linum-mode to see line numbers on the left margin, but the numbers are put right next to my code.
I would love it if there could be some 'padding', like 1-character long, between line number and code. sorry I can't post an image since they are asking for 10 reputation, which I dont have:(
How can I do this?
You can use the variable linum-format to achieve this. Its value can either be a format string or a function which is called with line number as an argument. emacswiki has a couple of example of setting it to a format string
1) The following adds a space after the line-number
(setq linum-format "%d ")
2) You can also add a solid line separator
(setq linum-format "%4d \u2502 ")
I guess the above are sufficient for your needs. You can also find an example of using a function as linum-format here. Add whichever format suits your needs to your init file
In addition to the other answer(s) in this thread, options for putting distance between the line numbers and the text include, but are not limited to, adjusting the fringe width (and also set the color if you so choose).
The fringe is like a vertical ruler that runs from the top to the bottom of the buffer -- the left fringe is sandwiched between the line numbers and the text. It can be invisible if it is the same color as the default background of the user, or it can be a different color.
(setq-default left-fringe-width 10)
(setq-default right-fringe-width 0)
(set-face-attribute 'fringe nil :background "black")

How to set color in Emacs display property?

I found Org-mode display superscript by modifying the display property with option org-script-display. The superscript/subscript display are toggled by options org-pretty-entities and org-pretty-entities-include-sub-superscripts.
I want to change superscript/subscript display property foreground color into "yellow".
I need to modify the option org-script-display.
But I failed when I set this option value with:
'(((raise -0.3)
(height 0.7)
(:foreground "yellow"))
((raise 0.3)
(height 0.7)
(:foreground "yellow"))
((raise -0.5))
((raise 0.5))
)
Does anybody knows how to set foreground colour here ?
You can't change the foreground color with a display spec. Se Display Property.
You'll need to change the face in order to use a different foreground color, however Org does not define customizable faces for subscripts and superscripts. You'd have to change the face property of these, but to do so you'd first have to find subscripts and superscripts in the text.
TLDR: You quite likely can't change the foreground color of Org mode superscripts and subscripts without writing a non-trivial amount of custom Emacs Lisp code.

Border/frame around Emacs frame

How to change the color of some outer or inner border? Whenever I change border-color of the frame, I don't see any changes and it is not allowing me to change the border width.
So far, what did work was
(set-frame-parameter (selected-frame) 'internal-border-width 15)
which adds some frame around the buffer.
But I don't know how to change the inner color. Does anyone know how to have a nice border/frame around the working space?
Any method goes.
EDIT: Added what sds accomplished:
I would like actually to have area around it to have a different color, so outside of the red.
I found an example (read: this is what I was after all along) of a frame I would like to accomplish.
It does appear that you cannot change the border width of an existing frame, but you can create a new frame with the border width you want:
(frame-parameter (make-frame '((border-width . 10))) 'border-width)
==> 10
However, the appearance of the new frame does not differ (as far as I can tell on ubuntu) from that of all the other frames (where border-width is 0);
which, I guess, is not all that surprising given that the window manager may not pay attention to [the border-width] you specify.
The more relevant question, I think, is what are you really trying to do?
Do you want Emacs windows (known as frames in the Emacs world) to differ visually from all the other windows?
If this is what you are after, then you have to realize that window decorations are the domain of the window manager (as mentioned above), and applications (like Emacs) can only affect those using "hints", and window managers are free to ignore them.
However, you can change the parameters of the fringe face:
(set-face-background 'fringe "red")
which should make the Emacs frame appearance very distinct.
I think you are specifying the fringe. You can set the fringe colour with this in your colour-theme function if you are using one.
(defun color-theme-whatever ()
"A color theme"
(color-theme-install
'(color-theme-whatever
((fringe ((t (:background "#111" :foreground "#444"))))))))

How to darken postscript text produced by emacs

I'm using emacs command ps-spool-buffer-with-faces command to make some postscript files of code I'm working on. The problem is that the font color seems to be light gray instead of black. I've poked around the postscript file & googled a bit, but have not found any solution. Does anyone know how to turn my gray font black?
Assuming you just want to print in black and white, try:
(setq ps-print-color-p nil)
Otherwise, you might take a look at other values for ps-print-color-p:
ps-print-color-p is a variable defined in `ps-print.el'.
Its value is t
Documentation:
Specify how buffer's text color is printed.
Valid values are:
nil Do not print colors.
t Print colors.
black-white Print colors on black/white printer.
See also `ps-black-white-faces'.
Any other value is treated as t.
You can customize this variable.
You can customize using M-xcustomize-variableRETps-print-color-pRET