emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: line-line-move-visual: was line motion problem


From: Vinicius Jose Latorre
Subject: Re: line-line-move-visual: was line motion problem
Date: Mon, 21 Jul 2008 22:58:47 -0300
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.15) Gecko/20080620 SeaMonkey/1.1.10

Chong Yidong wrote:
Vinicius Jose Latorre <address@hidden> writes:

Second, there is already whitespace-newline which is the face used to
visualize newlines.

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)))

Aha.  This certainly looks like a much better solution (it will have to
be rewritten properly using define-minor-mode, though).

Thanks.

What about the code below?


;;;###autoload
(define-minor-mode whitespace-newline-mode
 "Toggle newline minor mode visualization (\"nl\" on modeline).

If ARG is null, toggle newline visualization.
If ARG is a number greater than zero, turn on visualization;
otherwise, turn off visualization.
Only useful with a windowing system."
 :lighter    " nl"
 :init-value nil
 :global     nil
 :group      'whitespace
 (let ((whitespace-style '(newline-mark newline)))
   (whitespace-mode whitespace-newline-mode)))


;;;###autoload
(define-minor-mode global-whitespace-newline-mode
 "Toggle newline global minor mode visualization (\"NL\" on modeline).

If ARG is null, toggle newline visualization.
If ARG is a number greater than zero, turn on visualization;
otherwise, turn off visualization.
Only useful with a windowing system."
 :lighter    " NL"
 :init-value nil
 :global     t
 :group      'whitespace
 (let ((whitespace-style '(newline-mark newline)))
   (global-whitespace-mode global-whitespace-newline-mode)))





reply via email to

[Prev in Thread] Current Thread [Next in Thread]