From: Brendan Miller <catphive@catphive.net>
To: Drew Adams <drew.adams@oracle.com>
Cc: help-gnu-emacs@gnu.org
Subject: Re: visually mark off 80th column?
Date: Fri, 22 Jan 2010 16:02:26 -0800 [thread overview]
Message-ID: <ef38762f1001221602l4f921c28m82d165dda6d3c3bf@mail.gmail.com> (raw)
In-Reply-To: <95CD5818AC7A484F8B8F1AF467558CB0@us.oracle.com>
vline would be ideal... but I don't see a way to pin highlighting to
the 80th column.
Based on this thread and some others I've come up with this using the
highlight-80+ package.
;; highlight all characters past 80
(require 'highlight-80+)
(dolist (hook '(emacs-lisp-mode-hook
cperl-mode-hook
shell-mode-hook
text-mode-hook
change-log-mode-hook
makefile-mode-hook
message-mode-hook
texinfo-mode-hook
c-mode-common-hook
python-mode-hook))
(add-hook hook
'(lambda () (highlight-80+-mode))))
One minor point, is I really want this to apply to *all* modes, not
just the ones I thought to list here. Is there any global mode hook
that applies to everything? The only files I would ever edit with
emacs would have the 80 line rule apply to them i.e. I don't do word
processing in emacs.
On Fri, Jan 22, 2010 at 2:28 PM, Drew Adams <drew.adams@oracle.com> wrote:
>> M-: (column-marker-1 80)
>> *does* work, but for some reason just having:
>> (add-to-list 'load-path "~/emacs/")
>> (require 'column-marker)
>> (column-marker-1 80)
>>
>> In my .emacs file does nothing! Very confusing. I'll post my whole
>> .emacs file at the end, just in case I'm doing something that
>> conflicts...
>
> The reason is because `column-marker' is local to the current buffer. Doing what
> you did sets it (only) for the buffer that is current during loading of your
> .emacs.
>
> Set it in a mode hook, as I suggested, to turn it on automatically for any
> buffer of a particular mode. This is described in the file header.
>
>> I also notice that when I type M-: (column-marker-1 80) it only
>> highlights the part of the column that have characters, which isn't
>> really what I want. Is there any way to make this highlight the whole
>> column?
>
> Not that I know of.
>
> But you might be able to use `vline.el' (with `vline-style' = `compose') to do
> what you want. You will need to create a command that pins the highlighting to a
> particular column.
>
>
next prev parent reply other threads:[~2010-01-23 0:02 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-01-22 1:42 visually mark off 80th column? Brendan Miller
2010-01-22 1:53 ` Drew Adams
2010-01-22 19:23 ` Brendan Miller
2010-01-22 19:41 ` Drew Adams
[not found] ` <ef38762f1001221333n4387d296hc417e9af57e5b938@mail.gmail.com>
2010-01-22 21:33 ` Fwd: " Brendan Miller
2010-01-22 22:28 ` Drew Adams
2010-01-23 0:02 ` Brendan Miller [this message]
2010-01-23 0:15 ` Drew Adams
2010-01-23 15:31 ` Kevin Rodgers
[not found] <mailman.1914.1264124551.18930.help-gnu-emacs@gnu.org>
2010-01-25 18:03 ` Stefan Monnier
2010-01-25 21:03 ` Max Penet
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=ef38762f1001221602l4f921c28m82d165dda6d3c3bf@mail.gmail.com \
--to=catphive@catphive.net \
--cc=drew.adams@oracle.com \
--cc=help-gnu-emacs@gnu.org \
/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.