all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: npostavs@users.sourceforge.net
To: Jiege Chen <jiegec@qq.com>
Cc: 23777@debbugs.gnu.org
Subject: bug#23777: 25.0.95; Throwing (error "Selecting deleted buffer") in timer
Date: Sat, 09 Jul 2016 17:34:15 -0400	[thread overview]
Message-ID: <87y45ah4x4.fsf@users.sourceforge.net> (raw)
In-Reply-To: <nktuj0$8lm$1@ger.gmane.org> (Jiege Chen's message of "Tue, 28 Jun 2016 13:37:38 +0000 (UTC)")

Jiege Chen <jiegec@qq.com> writes:

> I removed that call in my init code, and the error is gone,
> at the price of some display inconsistency which is acceptable.
> There is room for improvement in nlinum--flush. 

How about this instead:

(defun my-nlinum-mode-hook ()
  (when nlinum-mode
    (setq-local nlinum-format
                (concat "%" (number-to-string
                             (ceiling (log (max 1 (count-lines (point-min)
                                                               (point-max)))
                                           10)))
                        "d"))))
(add-hook 'nlinum-mode-hook #'my-nlinum-mode-hook)

Actually, I think count-lines will be slow on big files, so you may want
to approximate with something like

(defun my-nlinum-mode-hook ()
  (when nlinum-mode
    (setq-local nlinum-format
                (concat "%" (number-to-string
                             (ceiling (log (max 1 (/ (buffer-size) 80)) 10)))
                        "d"))))





  reply	other threads:[~2016-07-09 21:34 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <m2k2ho9hs7.fsf@qq.com>
2016-06-16 14:04 ` bug#23777: 25.0.95; Throwing (error "Selecting deleted buffer") in timer Jiajie Chen
2016-06-17  3:51   ` Noam Postavsky
2016-06-18  0:09   ` Jiege Chen
2016-06-27 14:08   ` Jiajie Chen
2016-06-28  0:28     ` Noam Postavsky
2016-06-28  4:54       ` Jiege Chen
2016-06-28 13:37       ` Jiege Chen
2016-07-09 21:34         ` npostavs [this message]
2016-07-18  2:24           ` npostavs

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87y45ah4x4.fsf@users.sourceforge.net \
    --to=npostavs@users.sourceforge.net \
    --cc=23777@debbugs.gnu.org \
    --cc=jiegec@qq.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.