From: Vinicius Jose Latorre <viniciusjl@ig.com.br>
To: David Reitter <david.reitter@gmail.com>
Cc: Chong Yidong <cyd@stupidchicken.com>,
raman@users.sourceforge.net, Dan Nicolaescu <dann@ics.uci.edu>,
Stefan Monnier <monnier@iro.umontreal.ca>,
emacs-devel@gnu.org, Miles Bader <miles@gnu.org>
Subject: Re: line-line-move-visual: was line motion problem
Date: Mon, 21 Jul 2008 20:05:22 -0300 [thread overview]
Message-ID: <48851632.5030302@ig.com.br> (raw)
In-Reply-To: <06ED973A-F762-4586-9913-37B3622C8644@gmail.com>
David Reitter wrote:
> On 21 Jul 2008, at 00:49, Chong Yidong wrote:
>> If anyone on this list has a patch that is still waiting for approval or
>> further comments, now would be a good time to ping.
>
>
> OK, there is still the paragraph marking function. The following two
> major items (and some smaller issues) have been addressed:
>
> Stefan Monnier:
>
>> My font doesn't seem to know the char 2230, and UnicodeData.txt doesn't
>> seem to know that char either. So we should probably use something
>> else.
>
> On 18 Jul 2008, at 11:30, Dan Nicolaescu wrote:
>>
>> whitespace.el already has many many ways of dealing with whitespaces,
>> wouldn't this mode be a better fit in whitespace.el?
>
>
> Any objections to the patch below.
> Can't put it in simple.el because make-glyph-code can't be autoloaded,
> and the code is probably happy in whitespace.el.
>
> - D
I have objections to this patch.
> *** whitespace.el 06 May 2008 03:57:59 -0400 1.80
> --- whitespace.el 21 Jul 2008 11:04:45 -0400
> ***************
> *** 2352,2357 ****
> --- 2352,2406 ----
> (whitespace-mode -1)))
> nil) ; continue standard unloading
>
> + \f
> + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
> +
> +
> +
> + ;; Show-newlines-mode
> + (defface blank-newline
> + '((((class color) (background dark))
> + (:foreground "lightgrey" :bold nil))
> + (((class color) (background light))
> + ( :foreground "lightgrey" :bold nil))
> + (t (:bold nil :underline t)))
> + "Face used to visualize NEWLINE char mapping.
> +
> + See `blank-display-mappings'."
> + :group 'blank)
First of all, there is no more blank package, it was replaced by
whitespace package.
Second, there is already whitespace-newline which is the face used to
visualize newlines.
> +
> + (defvar show-newlines-newline-code
> + (vector (make-glyph-code 182 'blank-newline) 10))
No need for this, please, see whitespace-display-mappings option
documentation.
> +
> + ;;;###autoload
> + (define-minor-mode show-newlines-mode
> + "Mark newlines in current buffer"
> + :group 'convenience
> +
> + (unless buffer-display-table
> + (setq buffer-display-table
> + (or standard-display-table (make-display-table))))
> + (aset buffer-display-table 10
> + (if show-newlines-mode show-newlines-newline-code)))
> +
> + ;;;###autoload
> + (define-minor-mode global-show-newlines-mode
> + "Mark newlines in all buffers"
> + :group 'convenience
> + :global t
> +
> + (unless standard-display-table
> + (setq standard-display-table (make-display-table)))
> + (if global-show-newlines-mode
> + (aset standard-display-table 10 show-newlines-newline-code)
> + (aset standard-display-table 10 nil))
> + (dolist (buffer (buffer-list))
> + (with-current-buffer buffer
> + (if buffer-display-table
> + (show-newlines-mode
> + (if global-show-newlines-mode 1 -1))))))
> +
> +
>
> (provide 'whitespace)
Again, no need for all of these functions.
If it is necessary to have specific functions to display newlines, it
should be something like this:
(defun whitespace-newline ()
(let ((whitespace-style '(newline-mark newline)))
(whitespace-mode 1)))
(defun global-whitespace-newline ()
(let ((whitespace-style '(newline-mark newline)))
(global-whitespace-mode 1)))
> *** menu-bar.el 10 Jul 2008 00:27:23 -0400 1.341
> --- menu-bar.el 21 Jul 2008 11:45:01 -0400
> ***************
> *** 653,659 ****
> (let ((need-save nil))
> ;; These are set with menu-bar-make-mm-toggle, which does not
> ;; put on a customized-value property.
> ! (dolist (elt '(line-number-mode column-number-mode
> size-indication-mode
> cua-mode show-paren-mode transient-mark-mode
> blink-cursor-mode display-time-mode display-battery-mode))
> (and (customize-mark-to-save elt)
> --- 653,660 ----
> (let ((need-save nil))
> ;; These are set with menu-bar-make-mm-toggle, which does not
> ;; put on a customized-value property.
> ! (dolist (elt '(global-show-newlines-mode line-number-mode
> ! column-number-mode size-indication-mode
> cua-mode show-paren-mode transient-mark-mode
> blink-cursor-mode display-time-mode display-battery-mode))
> (and (customize-mark-to-save elt)
> ***************
> *** 700,705 ****
> --- 701,714 ----
>
> (defvar menu-bar-showhide-menu (make-sparse-keymap "Show/Hide"))
>
> + (define-key menu-bar-showhide-menu [show-newlines-mode]
> + (menu-bar-make-mm-toggle global-show-newlines-mode
> + "Show Newlines"
> + "Show hard newlines"))
> +
> + (define-key menu-bar-showhide-menu [newlines-separator]
> + '("--"))
> +
> (define-key menu-bar-showhide-menu [column-number-mode]
> (menu-bar-make-mm-toggle column-number-mode
> "Column Numbers"
Why should the newline visualization be inserted into menu-bar?
Vinicius
next prev parent reply other threads:[~2008-07-21 23:05 UTC|newest]
Thread overview: 52+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-07-16 13:31 line-line-move-visual: was line motion problem T. V. Raman
2008-07-16 16:26 ` Stefan Monnier
2008-07-16 16:37 ` David Reitter
2008-07-16 16:47 ` Chong Yidong
2008-07-16 18:26 ` Chong Yidong
2008-07-17 23:44 ` Chong Yidong
2008-07-18 4:35 ` Miles Bader
2008-07-18 14:16 ` Stefan Monnier
2008-07-18 14:24 ` David Reitter
2008-07-18 15:21 ` Stefan Monnier
2008-07-18 15:30 ` Dan Nicolaescu
2008-07-18 15:50 ` Stefan Monnier
2008-07-19 0:10 ` Miles Bader
2008-07-21 15:49 ` David Reitter
2008-07-21 16:01 ` Chong Yidong
2008-07-21 17:31 ` Miles Bader
2008-07-21 19:24 ` Stefan Monnier
2008-07-21 20:18 ` Miles Bader
2008-07-21 17:36 ` David Reitter
2008-07-21 16:09 ` Dan Nicolaescu
2008-07-21 17:30 ` David Reitter
2008-07-21 17:33 ` David Reitter
2008-07-21 23:05 ` Vinicius Jose Latorre [this message]
2008-07-22 1:31 ` Chong Yidong
2008-07-22 1:58 ` Vinicius Jose Latorre
2008-07-22 2:20 ` David Reitter
2008-07-23 1:53 ` Vinicius Jose Latorre
2008-07-23 2:53 ` David Reitter
2008-07-23 3:19 ` Vinicius Jose Latorre
2008-07-23 10:58 ` David Reitter
2008-07-24 3:37 ` Vinicius Jose Latorre
[not found] ` <9B9CE742-E040-4484-9BDC-593DE5B6B037@gmail.com>
2008-07-26 0:15 ` Vinicius Jose Latorre
2008-07-26 0:32 ` Drew Adams
2008-07-26 2:11 ` Vinicius Jose Latorre
2008-07-26 2:39 ` Drew Adams
2008-07-26 13:46 ` Vinicius Jose Latorre
2008-07-26 10:44 ` David Reitter
2008-07-26 12:59 ` Vinicius Jose Latorre
2008-07-25 13:41 ` T. V. Raman
2008-07-18 21:07 ` David Reitter
2008-07-18 22:57 ` Jason Rumney
2008-07-18 16:08 ` Chong Yidong
2008-07-18 18:36 ` Stefan Monnier
2008-07-20 3:34 ` Chong Yidong
2008-07-20 3:43 ` Chong Yidong
2008-07-20 4:15 ` Miles Bader
2008-07-21 4:09 ` Chong Yidong
2008-07-28 13:45 ` Juri Linkov
2008-07-28 14:11 ` Miles Bader
2008-07-28 14:35 ` Juri Linkov
2008-07-28 14:12 ` Chong Yidong
2008-07-25 13:39 ` T. V. Raman
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=48851632.5030302@ig.com.br \
--to=viniciusjl@ig.com.br \
--cc=cyd@stupidchicken.com \
--cc=dann@ics.uci.edu \
--cc=david.reitter@gmail.com \
--cc=emacs-devel@gnu.org \
--cc=miles@gnu.org \
--cc=monnier@iro.umontreal.ca \
--cc=raman@users.sourceforge.net \
/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).