-;;; linum.el --- display line numbers in the left margin
+;;; linum.el --- display line numbers in the left margin -*- lexical-binding: t -*-
-;; Copyright (C) 2008, 2009 Free Software Foundation, Inc.
+;; Copyright (C) 2008-2011 Free Software Foundation, Inc.
;; Author: Markus Triska <markus.triska@gmx.at>
;; Maintainer: FSF
;; Keywords: convenience
+;; Version: 0.9x
;; This file is part of GNU Emacs.
(mapc #'delete-overlay linum-overlays)
(setq linum-overlays nil)
(dolist (w (get-buffer-window-list (current-buffer) nil t))
- (set-window-margins w 0)))
+ (set-window-margins w 0 (cdr (window-margins w)))))
(defun linum-update-current ()
"Update line numbers for the current buffer."
(overlay-put ov 'before-string
(propertize " " 'display `((margin left-margin) ,str)))
(overlay-put ov 'linum-str str))))
- (forward-line)
+ ;; Text may contain those nasty intangible properties, but that
+ ;; shouldn't prevent us from counting those lines.
+ (let ((inhibit-point-motion-hooks t))
+ (forward-line))
(setq line (1+ line)))
- (set-window-margins win width)))
+ (set-window-margins win width (cdr (window-margins win)))))
-(defun linum-after-change (beg end len)
+(defun linum-after-change (beg end _len)
;; update overlays on deletions, and after newlines are inserted
(when (or (= beg end)
(= end (point-max))
(string-match-p "\n" (buffer-substring-no-properties beg end)))
(linum-update-current)))
-(defun linum-after-scroll (win start)
+(defun linum-after-scroll (win _start)
(linum-update (window-buffer win)))
;; (defun linum-after-size (frame)
(provide 'linum)
-;; arch-tag: dea45631-ed3c-4867-8b49-1c41c80aec6a
;;; linum.el ends here