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: David Reitter
Subject: Re: line-line-move-visual: was line motion problem
Date: Fri, 18 Jul 2008 10:24:52 -0400

On 18 Jul 2008, at 10:16, Stefan Monnier wrote:

Also, what about dealing with fringe continuation glyphs? I understand that some people want them, even in visual-line-mode, but I think many won't want them, so it would be good if there were an easy setting that
would cause visual-line-mode suppress them.

I don't know how many people actually want them in visual-line-mode
(I'd like a fringe item at a hard newline, but until this is
implemented the next best thing is a display-table element for \n).

We could leave the continuation glyphs, but make them less conspicuous.

To mark hard newlines, try the code below.   I suggest to include this.


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


 ;; 2230 = \x8B6
(defvar show-newlines-newline-code (vector (make-glyph-code 2230 'blank-newline) 10))
(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))))
 (if show-newlines-mode
     (aset buffer-display-table 10 show-newlines-newline-code)
   (aset buffer-display-table 10 nil)))

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


(define-key-after menu-bar-showhide-menu [show-newlines-mode]
  (menu-bar-make-mm-toggle global-show-newlines-mode
                           "Show Newlines"
                           "Show hard newlines") 'highlight-paren-mode)

Attachment: smime.p7s
Description: S/MIME cryptographic signature


reply via email to

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