Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
emacs
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Michael Hauspie
emacs
Commits
91f782f5
Commit
91f782f5
authored
1 month ago
by
Michael Hauspie
Browse files
Options
Downloads
Patches
Plain Diff
Add font scaling tweak so that it works well with my org-present
configuration
parent
3fbb0731
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
configuration.org
+31
-5
31 additions, 5 deletions
configuration.org
with
31 additions
and
5 deletions
configuration.org
+
31
−
5
View file @
91f782f5
...
...
@@ -36,7 +36,7 @@ configuration loading. The threshold will be set lower at the end of
the configuration to make each GC call faster for normal emacs use.
#+begin_src emacs-lisp
(setq gc-cons-threshold (*
6
0 1024 1024))
(setq gc-cons-threshold (*
10
0 1024 1024))
#+end_src
* Personal information
...
...
@@ -314,6 +314,8 @@ buffer. I also like to have Emacs show me matching parenthesis. Also do not show
)
#+END_SRC
** Fonts
Select the font I will use depending on the system
#+begin_src emacs-lisp
...
...
@@ -329,12 +331,36 @@ Select the font I will use depending on the system
(setq mh-font-variable "DejaVu Sans")
)
)
(set-face-attribute 'default nil :font mh-font-fixed :weight 'normal :height 1
5
0)
(set-face-attribute 'fixed-pitch nil :font mh-font-fixed :weight 'normal
:height 150
)
(set-face-attribute 'variable-pitch nil :font mh-font-variable :weight 'normal
:height 150
)
(set-face-attribute 'default nil :font mh-font-fixed :weight 'normal :height 1
6
0)
(set-face-attribute 'fixed-pitch nil :font mh-font-fixed :weight 'normal)
(set-face-attribute 'variable-pitch nil :font mh-font-variable :weight 'normal)
(set-frame-font mh-font-fixed nil t)
#+end_src
*** Dynamic size modification
The default action (~text-scale-adjust~), do not affect faces whose font properties have an
explicity ~:height~ attribute except for /default/ and /header-line/ face. However, when using
~org-present~, I change some faces and do not use the /default/ one everywhere. So I change the way
font size is modified. This solution is adapted from
https://emacs-fu.blogspot.com/2008/12/zooming-inout.html
#+begin_src emacs-lisp
(defun my/text-zoom (n)
"with positive N, increase the font size, otherwise decrease it"
(set-face-attribute 'default nil :height
(+ (face-attribute 'default :height) (* (if (> n 0) 1 -1) 10)))
(set-face-attribute 'fixed-pitch nil :height
(+ (face-attribute 'fixed-pitch :height) (* (if (> n 0) 1 -1) 10)))
(set-face-attribute 'variable-pitch nil :height
(+ (face-attribute 'variable-pitch :height) (* (if (> n 0) 1 -1) 10)))
)
(global-set-key (kbd "C-+") #'(lambda nil (interactive) (my/text-zoom 1)))
(global-set-key (kbd "C--") #'(lambda nil (interactive) (my/text-zoom -1)))
#+end_src
** Modeline
Tweak how some modeline elements are displayed
...
...
@@ -688,7 +714,7 @@ it with =visual-fill-column= to enhance the visual look of the presentation.
(org-level-6)
(org-level-7)
(org-level-8)))
(set-face-attribute (car face) nil :font mh-font-fixed :weight 'medium ))
(set-face-attribute (car face) nil :font mh-font-fixed :weight 'medium
:height 1.0
))
;; Remove the blank line at top of the frame
(setq header-line-format nil)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment