From: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: emacs-devel@gnu.org
Subject: Re: ruler support in hexl mode
Date: 12 Mar 2004 16:24:43 -0500 [thread overview]
Message-ID: <jwvekrx7owy.fsf-monnier+emacs@asado.iro.umontreal.ca> (raw)
In-Reply-To: <20040312.150538.157235451.jet@gyve.org>
> Based on Stefan and Kim's suggestions, I have revised the patch.
> I've moved the essential functions(`scroll-bar-columns' and `fringe-columns')
> in ruler-mode.el to frame.el and fringe.el and use new functions in
> ruler-mode.el and hexl.el.
Comments:
> +(defcustom hexl-use-ruler t
> + "If non-nil then show the ruler for hexl mode."
> + :type 'boolean
> + :group 'hexl)
I'd call it hexl-use-header-line, but maybe that's just me.
> +(defface hexl-ascii-overlay
> + ;; Definition borrowed from vcursor.el.
> + '((((class color)) (:foreground "blue" :background "cyan" :underline t))
> + (t (:inverse-video t :underline t)))
> + "Face for the overlay in ascii area of hexl mode buffer."
> + :group 'hexl)
I'd call it `hexl-ascii-cursor' since the user might not know it's an
overlay (and it could actually be implemented as a text-property tomorrow).
Also I'd stick to just `:inverse-video' as much as possible or more
specifically I'd try to make it look just like the normal cursor (since
there's conceptually no difference between the two).
> +(defcustom hexl-follow-line t
> + "If non-nil then turn `hl-line-mode' on."
> + :type 'boolean
> + :group 'hexl)
[...]
> + (if hexl-follow-line (hexl-follow-line 1)))
> (run-hooks 'hexl-mode-hook))
[...]
> +(defun hexl-follow-line (&optional arg)
> + "Toggle following line address in Hexl buffers.
> +With prefix ARG, turn on following if and only if ARG is positive.
> +When following is enabled, the line address corresponding to the
> +element under the point is highlighted.
> +Customize the variable `hexl-follow-line' to disable this feature."
> + (interactive "P")
> + (let ((on-p (if arg
> + (> (prefix-numeric-value arg) 0)
> + (not hexl-follow-line))))
> +
> + (setq hexl-follow-line on-p)
> + (hl-line-mode (if on-p 1 -1))))
You could define this with `define-minor-mode'.
But I'd recommend to go even further and replace the above with:
(defcustom hexl-mode-hook ()
"Blabla"
:type 'hook
:options '(hexl-follow-line))
(defun hexl-follow-line ()
(hl-line-mode 1))
-- Stefan
next prev parent reply other threads:[~2004-03-12 21:24 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-03-05 5:29 ruler support in hexl mode Masatake YAMATO
2004-03-08 20:05 ` Stefan Monnier
2004-03-09 12:11 ` Masatake YAMATO
2004-03-11 6:59 ` Masatake YAMATO
2004-03-11 16:27 ` Kim F. Storm
2004-03-11 17:43 ` Stefan Monnier
2004-03-11 23:56 ` Kim F. Storm
2004-03-12 6:05 ` Masatake YAMATO
2004-03-12 21:24 ` Stefan Monnier [this message]
2004-03-13 18:13 ` Masatake YAMATO
2004-03-15 7:37 ` Masatake YAMATO
2004-03-15 4:55 ` Richard Stallman
2004-03-15 11:00 ` Kim F. Storm
2004-03-16 19:02 ` Richard Stallman
2004-03-17 0:08 ` Kim F. Storm
2004-03-17 0:42 ` Stefan Monnier
2004-03-17 2:23 ` Kim F. Storm
2004-03-19 5:01 ` Richard Stallman
2004-03-19 10:06 ` Kim F. Storm
2004-03-19 13:33 ` Kim F. Storm
2004-03-08 21:00 ` Miles Bader
2004-03-11 14:41 ` Juanma Barranquero
2004-03-17 3:59 ` Miles Bader
2004-03-18 0:53 ` Juanma Barranquero
2004-03-20 4:48 ` Richard Stallman
2004-03-22 11:52 ` Juanma Barranquero
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=jwvekrx7owy.fsf-monnier+emacs@asado.iro.umontreal.ca \
--to=monnier@iro.umontreal.ca \
--cc=emacs-devel@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.