unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Lennart Borgman <lennart.borgman@gmail.com>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: Juanma Barranquero <lekktu@gmail.com>, 6871@debbugs.gnu.org
Subject: bug#6871: Please make linum-mode per buffer, not per major mode
Date: Fri, 20 Aug 2010 03:11:21 +0200	[thread overview]
Message-ID: <AANLkTimuWS8JaVkgvvniVtq1vFqcEF1_JcoPAxoh6v3-@mail.gmail.com> (raw)
In-Reply-To: <jwvsk2aw7lk.fsf-monnier+emacs@gnu.org>

[-- Attachment #1: Type: text/plain, Size: 822 bytes --]

On Fri, Aug 20, 2010 at 12:43 AM, Stefan Monnier
<monnier@iro.umontreal.ca> wrote:
>> Normally in my own code I just fix all the issues I see on the fly so
>> to say. That is faster since I have already looked at the code then
>> and knows what to do. Later (which may be much later) I might forget
>> about exactly how to do it.
>
> I have my own branch with a hodge-podge of changes in random order.
> When I want to install a change from there to the trunk, I do a diff of
> the relevant files and then pick the relevant parts and add
> a ChangeLog message.

Seems easiest, but I am not sure how to make the diff file. I just
edited the diff file I had. Does this work, i.e. how does the program
patch handle this?

I have attached a patch done this way for just making linum-mode per
buffer instead of per major mode.

[-- Attachment #2: linum-multi-major-1.diff --]
[-- Type: application/octet-stream, Size: 1570 bytes --]

=== modified file 'lisp/linum.el'
--- trunk/lisp/linum.el	2010-01-13 08:35:10 +0000
+++ patched/lisp/linum.el	2010-08-19 04:22:04 +0000
@@ -38,6 +38,8 @@
   "Functions run in each buffer before line numbering starts.")
 
 (mapc #'make-variable-buffer-local '(linum-overlays linum-available))
+(put 'linum-overlays  'permanent-local t)
+(put 'linum-available 'permanent-local t)
 
 (defgroup linum nil
   "Show line numbers in the left margin."
@@ -115,3 +109,4 @@
   "Update line numbers for the current buffer."
   (linum-update (current-buffer)))
+(put 'linum-update-current 'permanent-local-hook t)
 
@@ -171,19 +178,22 @@
 (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)))
+(put 'linum-after-change 'permanent-local-hook t)
 
 (defun linum-after-scroll (win start)
  (linum-update (window-buffer win)))
+(put 'linum-after-scroll 'permanent-local-hook t)
 
 ;; (defun linum-after-size (frame)
 ;;   (linum-after-config))
 
 (defun linum-schedule ()
   ;; schedule an update; the delay gives Emacs a chance for display changes
-  (run-with-idle-timer 0 nil #'linum-update-current))
+  (run-with-idle-timer 0 nil #'linum-update-current-buffer))
+(put 'linum-schedule 'permanent-local-hook t)
 
 ;; (defun linum-after-config ()
 ;;   (walk-windows (lambda (w) (linum-update (window-buffer w))) nil 'visible))


[-- Attachment #3: linum-multi-major-1.chlog --]
[-- Type: application/octet-stream, Size: 131 bytes --]

2010-08-20  Lennart Borgman  <lennart.borgman@gmail.com>

	* linum.el: Made linum-mode per buffer rather than per major mode.


  reply	other threads:[~2010-08-20  1:11 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-17  2:06 bug#6871: Please make linum-mode per buffer, not per major mode Lennart Borgman
2010-08-17  8:59 ` Stefan Monnier
2010-08-17 11:23   ` Lennart Borgman
2010-08-17 12:11     ` Stefan Monnier
2010-08-17 12:35       ` Lennart Borgman
2010-08-18  7:19         ` Stefan Monnier
2010-08-19  4:29           ` Lennart Borgman
2010-08-19 12:13             ` Juanma Barranquero
2010-08-19 13:25               ` Lennart Borgman
2010-08-19 13:38                 ` Juanma Barranquero
2010-08-19 14:00                   ` Lennart Borgman
2010-08-19 14:40                     ` Juanma Barranquero
2010-08-19 21:23                       ` Lennart Borgman
2010-08-19 21:57                         ` Juanma Barranquero
2010-08-19 22:21                           ` Lennart Borgman
2010-08-20  9:05                             ` Eli Zaretskii
2010-08-19 22:43                         ` Stefan Monnier
2010-08-20  1:11                           ` Lennart Borgman [this message]
2010-08-20 12:59                             ` Stefan Monnier
2010-08-19 14:45                 ` Stefan Monnier
2010-08-19 21:19                   ` Lennart Borgman
2010-08-17 23:47 ` MON KEY
2010-08-18  0:14   ` Lennart Borgman
2010-08-18  7:20   ` Stefan Monnier
2010-08-19 17:49     ` MON KEY
2010-08-19 21:18       ` Lennart Borgman
2020-09-19 15:52 ` Lars Ingebrigtsen

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=AANLkTimuWS8JaVkgvvniVtq1vFqcEF1_JcoPAxoh6v3-@mail.gmail.com \
    --to=lennart.borgman@gmail.com \
    --cc=6871@debbugs.gnu.org \
    --cc=lekktu@gmail.com \
    --cc=monnier@iro.umontreal.ca \
    /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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).