From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "James Aguilar" Newsgroups: gmane.emacs.help Subject: Re: How to apply a minor mode to all buffers Date: Thu, 18 Jan 2007 14:33:14 -0800 Message-ID: References: <877ivkjb66.fsf@trick.ulm.malte.spiess> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0582852856==" X-Trace: sea.gmane.org 1169159620 5439 80.91.229.12 (18 Jan 2007 22:33:40 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 18 Jan 2007 22:33:40 +0000 (UTC) Cc: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Jan 18 23:33:36 2007 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1H7fp5-00032v-3c for geh-help-gnu-emacs@m.gmane.org; Thu, 18 Jan 2007 23:33:31 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1H7fp5-0008Pz-VN for geh-help-gnu-emacs@m.gmane.org; Thu, 18 Jan 2007 17:33:31 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1H7for-0008PY-Ii for help-gnu-emacs@gnu.org; Thu, 18 Jan 2007 17:33:17 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1H7for-0008On-7H for help-gnu-emacs@gnu.org; Thu, 18 Jan 2007 17:33:17 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1H7foq-0008OU-EG for help-gnu-emacs@gnu.org; Thu, 18 Jan 2007 17:33:16 -0500 Original-Received: from [66.249.82.228] (helo=wx-out-0506.google.com) by monty-python.gnu.org with esmtp (Exim 4.52) id 1H7fop-0008Di-Kx for help-gnu-emacs@gnu.org; Thu, 18 Jan 2007 17:33:15 -0500 Original-Received: by wx-out-0506.google.com with SMTP id s17so359358wxc for ; Thu, 18 Jan 2007 14:33:14 -0800 (PST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:references; b=fEVARXAzJWsmU+iRD62cSExBRly6v+3imEFmFRkIk/NXFXoA1hSYVoe641HIogpeCW00RTmLoZbC1rY947pzmlS3fRfi5VRHfZksQxvlIjyjOh2hAjkiKrrjkR1Us+f2afVhpCIZkw6UIHYlNalOdDGMCq8n5VDiis6SqMbdVJ8= Original-Received: by 10.90.32.14 with SMTP id f14mr1970316agf.1169159594739; Thu, 18 Jan 2007 14:33:14 -0800 (PST) Original-Received: by 10.90.102.12 with HTTP; Thu, 18 Jan 2007 14:33:14 -0800 (PST) Original-To: "Drew Adams" In-Reply-To: X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:40441 Archived-At: --===============0582852856== Content-Type: multipart/alternative; boundary="----=_Part_8402_22744347.1169159594555" ------=_Part_8402_22744347.1169159594555 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline On 1/18/07, Drew Adams wrote: > > Library `column-marker.el' provides commands that create column markers in > the current buffer. AFAIK, no automatic way is provided to get the same > effect in all buffers. However, you can always use a column-marker command > in a mode hook, so that each buffer of that mode calls the command to > create > the same column marker. So there is no simple way to just make it apply to all buffers? There's no "all-modes-hook" or anything like that? This is so frustrating. Someone must have needed this functionality before I did. Can I make edits to the mode to make it global? I'm thinking about margin.el, which uses the command margin-mode. Here's the code in question: ;;;###autoload (define-minor-mode margin-mode "Minor mode that displays a margin" nil " | " nil ;;Does the first nil here determine whether the mode is on or off by default? (if margin-mode (progn (margin-overlay-on) (jit-lock-register 'margin-change) (setq margin-mode t)) ;; else (progn (margin-overlay-off) (jit-lock-unregister 'margin-change) (setq margin-mode nil)))) I thought that I might be able to change that to make it global somehow. In another section of code somewhere else, I saw :global t at the beginning of the define-minor-mode function. However, it didn't work properly. Are there other things I need to do? Would setting the first nil to t do the trick? Yours, James Aguilar -- [?] James Aguilar [@] 333 Rengstorff Ave #23, Mountain View, CA, 94043 [#] 314 494 0450 [!] Lately things just dont seem the same ------=_Part_8402_22744347.1169159594555 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline On 1/18/07, Drew Adams <drew.adams@oracle.com> wrote:
Library `column-marker.el' provides commands that create column markers in
the current buffer. AFAIK, no automatic way is provided to get the same
effect in all buffers. However, you can always use a column-marker command
in a mode hook, so that each buffer of that mode calls the command to create
the same column marker.

So there is no simple way to just make it apply to all buffers?  There's no "all-modes-hook" or anything like that?  This is so frustrating.  Someone must have needed this functionality before I did.

Can I make edits to the mode to make it global?  I'm thinking about margin.el, which uses the command margin-mode.  Here's the code in question:

;;;###autoload
(define-minor-mode margin-mode
  "Minor mode that displays a margin"
  nil " | " nil ;;Does the first nil here determine whether the mode is on or off by default?
  (if margin-mode
      (progn
        (margin-overlay-on)
        (jit-lock-register 'margin-change)
        (setq margin-mode t))
    ;; else
    (progn
      (margin-overlay-off)
      (jit-lock-unregister 'margin-change)
      (setq margin-mode nil))))

I thought that I might be able to change that to make it global somehow.  In another section of code somewhere else, I saw :global t at the beginning of the define-minor-mode function.  However, it didn't work properly.  Are there other things I need to do?  Would setting the first nil to t do the trick?

Yours,
James Aguilar
--
[?] James Aguilar
[@] 333 Rengstorff Ave #23, Mountain View, CA, 94043
[#] 314 494 0450
[!] Lately things just dont seem the same ------=_Part_8402_22744347.1169159594555-- --===============0582852856== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ help-gnu-emacs mailing list help-gnu-emacs@gnu.org http://lists.gnu.org/mailman/listinfo/help-gnu-emacs --===============0582852856==--