emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: PATCH: make linum.el play nicely with other margin-setting extension


From: martin rudalics
Subject: Re: PATCH: make linum.el play nicely with other margin-setting extensions
Date: Fri, 13 Nov 2015 11:01:26 +0100

>     (mapc #'delete-overlay linum-overlays)
>     (setq linum-overlays nil)
>     (dolist (w (get-buffer-window-list (current-buffer) nil t))
> -    (set-window-margins w 0 (cdr (window-margins w)))))
> +    ;; restore margins if needed
> +    (let ((set-margins (window-parameter w 'linum--set-margins))
> +          (current-margins (window-margins w)))
> +      (when (and set-margins
> +                 (equal set-margins current-margins))

I suppose this will reset the left margin to zero when the "other mode"
was started after ‘linum-mode’ and incidentally used the same margin
width as ‘linum-mode’.  Maybe nothing reasonable can be done about that.

Alternatively, we could invent a new window parameter, say
‘left-margin-min-width’, and have packages like ‘linum-mode’ respect it.

martin




reply via email to

[Prev in Thread] Current Thread [Next in Thread]