Search code examples
emacsconfigurationcalendar

How to correctly align the layout of the Emacs Calendar after changing some faces ?


I'm trying to customize my Emacs/OrgMode and I face an alignment's problem when using the calendar. See the picture here

I tried to customize some calendar-* variables such as the calendar-intermonth-spacing, calendar-intermonth-header or calendar-column-width but these change did not help.

Is it always possible to get a correct alignment in the calendar view?


Solution

  • See the function face-remap-add-relative: https://www.gnu.org/software/emacs/manual/html_node/elisp/Face-Remapping.html

    Here is an example:

    (defun set-buffer-to-courier ()
      (face-remap-add-relative 'default '(:family "Courier" :height 120)))
    
    (add-hook 'calendar-mode-hook 'set-buffer-to-courier)