bug-gnu-emacs
[Top][All Lists]
Advanced

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

Re: shell-command-on-region fooled by long lines


From: Kevin Rodgers
Subject: Re: shell-command-on-region fooled by long lines
Date: Fri, 03 Feb 2006 09:31:19 -0700
User-agent: Mozilla Thunderbird 0.9 (X11/20041105)

Kevin Rodgers wrote:
Oops.  A final newline is ignored when displaying the message in the
echo area, so the call to count-screen-lines should specify nil for
the COUNT-FINAL-NEWLINE argument:

Sorry, I forgot to handle the trivial 1-line string cases:

2006-02-03  Kevin Rodgers  <ihs_4664@yahoo.com>

        * simple.el (display-message-or-buffer): Compare the number of
        characters to the frame width when determining whether a 1-line
        message string will fit in the echo area.  Count screen lines
        instead of buffer lines when determining whether a multi-line
        message will fit in the echo area/minibuffer window.

*** simple.el~  Thu Feb  2 09:31:34 2006
--- simple.el   Fri Feb  3 09:30:19 2006
***************
*** 1901,1911 ****

  Optional arguments NOT-THIS-WINDOW and FRAME are as for `display-buffer',
  and only used if a buffer is displayed."
!   (cond ((and (stringp message) (not (string-match "\n" message)))
         ;; Trivial case where we can use the echo area
         (message "%s" message))
        ((and (stringp message)
!             (= (string-match "\n" message) (1- (length message))))
         ;; Trivial case where we can just remove single trailing newline
         (message "%s" (substring message 0 (1- (length message)))))
        (t
--- 1901,1914 ----

  Optional arguments NOT-THIS-WINDOW and FRAME are as for `display-buffer',
  and only used if a buffer is displayed."
!   (cond ((and (stringp message)
!               (not (string-match "\n" message))
!               (<= (length message) (frame-width)))
         ;; Trivial case where we can use the echo area
         (message "%s" message))
        ((and (stringp message)
!             (equal (string-match "\n" message) (1- (length message)))
!             (<= (1- (length message)) (frame-width)))
         ;; Trivial case where we can just remove single trailing newline
         (message "%s" (substring message 0 (1- (length message)))))
        (t
***************
*** 1922,1928 ****
           (let ((lines
                  (if (= (buffer-size) 0)
                      0
!                   (count-lines (point-min) (point-max)))))
             (cond ((= lines 0))
                   ((and (or (<= lines 1)
                             (<= lines
--- 1925,1931 ----
           (let ((lines
                  (if (= (buffer-size) 0)
                      0
!                   (count-screen-lines nil nil nil (minibuffer-window)))))
             (cond ((= lines 0))
                   ((and (or (<= lines 1)
                             (<= lines

--
Kevin Rodgers





reply via email to

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