all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* trailing whitespace visible on some buffers
@ 2002-09-14  9:45 Luis O. Silva
  2002-09-17 10:30 ` Calendar's buffer hooks (was trailing whitespace visible on some buffers) Luis O. Silva
       [not found] ` <mailman.1032257775.4079.help-gnu-emacs@gnu.org>
  0 siblings, 2 replies; 12+ messages in thread
From: Luis O. Silva @ 2002-09-14  9:45 UTC (permalink / raw)


Dear Emacs community,

This is an elementary question, but I haven't found the
solution of my problem.

I want to set the buffer-local variable
`show-trailing-whitespace' to `t' for all buffers except
for *info*, *diary*, *calendar*, and *mail presentation*. In
the emacs node of info I found how to set local variables to
different _modes_ using "hooks", but I don't know how to set
buffer-local variables to concrete buffers.

Thank you very much in advance,
luis


-- 
Luis Octavio Silva P.
St. Petersburg State University.
66/3 Botanicheskaya St., Apt.119/2
Stary Peterhof
St. Petersburg, Russia.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: trailing whitespace visible on some buffers
       [not found] <mailman.1031996832.11463.help-gnu-emacs@gnu.org>
@ 2002-09-14  9:57 ` Edward O'Connor
  2002-09-14 12:46   ` Luis O. Silva
       [not found]   ` <mailman.1032006733.12614.help-gnu-emacs@gnu.org>
  2002-09-16 17:39 ` Michael J Downes
  1 sibling, 2 replies; 12+ messages in thread
From: Edward O'Connor @ 2002-09-14  9:57 UTC (permalink / raw)


> This is an elementary question, but I haven't found the solution
> of my problem.
> 
> I want to set the buffer-local variable
> `show-trailing-whitespace' to `t' for all buffers

(setq-default show-trailing-whitespace t)

> except for *info*, *diary*, *calendar*, and *mail presentation*.

(let ((hook (lambda () (setq show-trailing-whitespace nil))))
  (mapc (lambda (var)
          (add-hook var hook))
        '(info-mode-hook calendar-mode-hook diary-hook)))

Untested.

Sorry, I don't know what the *mail presentation* buffer is.


HTH

-- 
Edward O'Connor
ted@oconnor.cx

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: trailing whitespace visible on some buffers
  2002-09-14  9:57 ` trailing whitespace visible on some buffers Edward O'Connor
@ 2002-09-14 12:46   ` Luis O. Silva
       [not found]   ` <mailman.1032006733.12614.help-gnu-emacs@gnu.org>
  1 sibling, 0 replies; 12+ messages in thread
From: Luis O. Silva @ 2002-09-14 12:46 UTC (permalink / raw)
  Cc: help-gnu-emacs

Edward,

Thank you for your message (Sat, 14 Sep 2002 09:57:12 GMT), in
which, among other things, you wrote:

   >> This is an elementary question, but I haven't found the
   >> solution of my problem.
   >>
   >> I want to set the buffer-local variable
   >> `show-trailing-whitespace' to `t' for all buffers

   Edward> (setq-default show-trailing-whitespace t)

   >> except for *info*, *diary*, *calendar*, and *mail
   >> presentation*.

   Edward> (let ((hook (lambda () (setq
   Edward> show-trailing-whitespace nil)))) (mapc (lambda
   Edward> (var) (add-hook var hook)) '(info-mode-hook
   Edward> calendar-mode-hook diary-hook)))

   Edward> Untested.

Well, I've tested it and, unfortunately, it doesn't work for
me. I don't understand why it doesn't work, since your
suggestion seems to be appropriate (given my limited knowledge
of lisp).

   Edward> Sorry, I don't know what the *mail presentation*
   Edward> buffer is.

I mean the presentation of my mail folders in VM (View Mail).

   Edward> HTH

On the basis of your suggestion I made some tests without
success. I always have to do `M-x set variable RET
show-trailing-whitespace RET nil RET' once per buffer to do
the trick. May be there are other suggestions?

Thank you
luis


-- 
Luis Octavio Silva P.
St. Petersburg State University.
66/3 Botanicheskaya St., Apt.119/2
Stary Peterhof
St. Petersburg, Russia.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: trailing whitespace visible on some buffers
       [not found]   ` <mailman.1032006733.12614.help-gnu-emacs@gnu.org>
@ 2002-09-14 18:56     ` Karl Eichwalder
  2002-09-15  9:55       ` Luis O. Silva
  0 siblings, 1 reply; 12+ messages in thread
From: Karl Eichwalder @ 2002-09-14 18:56 UTC (permalink / raw)


"Luis O. Silva" <silva@paloma.spbu.ru> writes:

>    Edward> Untested.
>
> Well, I've tested it and, unfortunately, it doesn't work for
> me. I don't understand why it doesn't work, since your
> suggestion seems to be appropriate (given my limited knowledge
> of lisp).

E.g., it's "Info-mode-hook" (note the upper case letter).  I'm using
this simple code:

(add-hook 'Info-mode-hook
          (lambda ()
	    ;; (define-key Info-mode-map "=" 'delete-other-windows)
	    ;; (define-key Info-mode-map "1" 'delete-other-windows)
	    (setq show-trailing-whitespace nil)))

I didn't check the other mode hook names.

-- 
ke@suse.de (work) / keichwa@gmx.net (home):              |
http://www.suse.de/~ke/                                  |      ,__o
Free Translation Project:                                |    _-\_<,
http://www.iro.umontreal.ca/contrib/po/HTML/             |   (*)/'(*)

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: trailing whitespace visible on some buffers
  2002-09-14 18:56     ` Karl Eichwalder
@ 2002-09-15  9:55       ` Luis O. Silva
  0 siblings, 0 replies; 12+ messages in thread
From: Luis O. Silva @ 2002-09-15  9:55 UTC (permalink / raw)
  Cc: help-gnu-emacs

Dear Karl,

Thank you for your message (Sat, 14 Sep 2002 20:56:23 +0200),
in which, among other things, you wrote:

   Karl> "Luis O. Silva" <silva@paloma.spbu.ru> writes:

   Edward> Untested.
   >>
   >> Well, I've tested it and, unfortunately, it doesn't work for
   >> me. I don't understand why it doesn't work, since your
   >> suggestion seems to be appropriate (given my limited knowledge
   >> of lisp).

   Karl> E.g., it's "Info-mode-hook" (note the upper case letter)...

Yes, after testing Edward's suggestion I found that the problem
was that I was using incorrect mode hook names.

   Karl> (add-hook 'Info-mode-hook
   Karl>           (lambda ()
   Karl> 	    ;; (define-key Info-mode-map "=" 'delete-other-windows)
   Karl> 	    ;; (define-key Info-mode-map "1" 'delete-other-windows)
   Karl> 	    (setq show-trailing-whitespace nil)))

Thanks to you I've solved my problem with *info* (thanks to
Edward I solved it for *diary*). It remains the
*calendar*. I've probed some mode hook names (including
calendar-load-hook) without success. Are there some
suggestions on this?

Thank you very much
luis



-- 
Luis Octavio Silva P.
St. Petersburg State University.
66/3 Botanicheskaya St., Apt.119/2
Stary Peterhof
St. Petersburg, Russia.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: trailing whitespace visible on some buffers
       [not found] <mailman.1031996832.11463.help-gnu-emacs@gnu.org>
  2002-09-14  9:57 ` trailing whitespace visible on some buffers Edward O'Connor
@ 2002-09-16 17:39 ` Michael J Downes
  2002-09-17  7:00   ` Luis O. Silva
  1 sibling, 1 reply; 12+ messages in thread
From: Michael J Downes @ 2002-09-16 17:39 UTC (permalink / raw)


"Luis O. Silva" <silva@paloma.spbu.ru> wrote:

> This is an elementary question, but I haven't found the
> solution of my problem.
> 
> I want to set the buffer-local variable
> `show-trailing-whitespace' to `t' for all buffers except
> for *info*, *diary*, *calendar*, and *mail presentation*.

Did you consider writing a bug report to suggest that the superfluous
whitespace should be removed from all the info files that come in the Emacs
distribution (which would make a significant improvement, at least)?
I see it too but I did not [yet] manage to write a bug report about it.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: trailing whitespace visible on some buffers
  2002-09-16 17:39 ` Michael J Downes
@ 2002-09-17  7:00   ` Luis O. Silva
  0 siblings, 0 replies; 12+ messages in thread
From: Luis O. Silva @ 2002-09-17  7:00 UTC (permalink / raw)
  Cc: help-gnu-emacs

Dear Michael,

Thank you for your message (16 Sep 2002 10:39:51 -0700), in
which, among other things, you wrote[1]:

   Michael> Did you consider writing a bug report to suggest
   Michael> that the superfluous whitespace should be removed
   Michael> from all the info files that come in the Emacs
   Michael> distribution (which would make a significant
   Michael> improvement, at least)?

Yes, I've considered it. However I think that the bug isn't in
the Emacs info documents, but in info formating machine, since
what we see has been formatted with texinfo, hasn't it? After
formating there musn't be trailing whitespaces. Please correct
me if I'm wrong, I'm a complete ignorant, who wants to post
his first bug report to the correct address.

Thank you very much,
luis


Footnotes:
[1] The excerpts of your message are prefixed by "Michael>".

-- 
Luis Octavio Silva P.
St. Petersburg State University.
66/3 Botanicheskaya St., Apt.119/2
Stary Peterhof
St. Petersburg, Russia.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Calendar's buffer hooks (was trailing whitespace visible on some buffers)
  2002-09-14  9:45 trailing whitespace visible on some buffers Luis O. Silva
@ 2002-09-17 10:30 ` Luis O. Silva
       [not found] ` <mailman.1032257775.4079.help-gnu-emacs@gnu.org>
  1 sibling, 0 replies; 12+ messages in thread
From: Luis O. Silva @ 2002-09-17 10:30 UTC (permalink / raw)
  Cc: help-gnu-emacs

Dear Emacs community,

On Sat, 14 Sep 2002 13:45:34 +0400, I wrote:

   Luis> I want to set the buffer-local variable
   Luis> `show-trailing-whitespace' to `t' for all buffers
   Luis> except for *info*, *diary*, *calendar*, and *mail
   Luis> presentation*. In the emacs node of info I found how
   Luis> to set local variables to different _modes_ using
   Luis> "hooks", but I don't know how to set buffer-local
   Luis> variables to concrete buffers.

With your help I've almost solved the problem, I just need to
know the name of the hooks that take place after the
*calendar* buffer is created.

I've tried the following variants: (after making visible
whitespaces globally)

1. (add-hook 'today-visible-calendar-hook
          (lambda ()
            (setq show-trailing-whitespace nil)))

==> the whitespaces disappear only when I scroll the calendar
   or hit "d" or "h".

2. (add-hook 'calendar-load-hook
          (lambda ()
            (setq show-trailing-whitespace nil)))

==> whitespaces don't disappear.

Any suggestions?

Thanks in advance


-- 
Luis Octavio Silva P.
St. Petersburg State University.
66/3 Botanicheskaya St., Apt.119/2
Stary Peterhof
St. Petersburg, Russia.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Calendar's buffer hooks (was trailing whitespace visible on some buffers)
       [not found] ` <mailman.1032257775.4079.help-gnu-emacs@gnu.org>
@ 2002-09-17 10:49   ` Simon Hooper
  2002-09-18  8:36     ` Calendar's buffer hooks Karl Eichwalder
  0 siblings, 1 reply; 12+ messages in thread
From: Simon Hooper @ 2002-09-17 10:49 UTC (permalink / raw)


In article <mailman.1032257775.4079.help-gnu-emacs@gnu.org>, Luis O. Silva wrote:
> .....I've almost solved the problem, I just need to know the name of
> the hooks that take place after the *calendar* buffer is created.
>
> I've tried the following variants: (after making visible
> whitespaces globally)
>
> 1. (add-hook 'today-visible-calendar-hook
>           (lambda ()
>             (setq show-trailing-whitespace nil)))
>
>==> the whitespaces disappear only when I scroll the calendar
>    or hit "d" or "h".
>
> 2. (add-hook 'calendar-load-hook
>           (lambda ()
>             (setq show-trailing-whitespace nil)))
>
>==> whitespaces don't disappear.

I've been trying to do the same thing for a while. Unfortunately my
knowledge of lisp is nonexistent :( I use the diary and calendar and
have been using the following in my ~/.emacs

(defun simon-calendar-function ()
  (turn-off-auto-fill)
  (turn-off-filladapt-mode)
  (flyspell-mode nil)
  (setq show-trailing-whitespace nil)
)
(add-hook 'calendar-mode-hook 'simon-calendar-function)
(add-hook 'diary-hook 'simon-calendar-function)

This works fine for the diary, but I still have the white space
markers in my calendar. I have also tried using the calendar-load-hook.

Any ideas?

Simon.


-- 
Simon Hooper

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Calendar's buffer hooks
  2002-09-17 10:49   ` Simon Hooper
@ 2002-09-18  8:36     ` Karl Eichwalder
  2002-09-19  5:32       ` Luis O. Silva
       [not found]       ` <mailman.1032412637.13710.help-gnu-emacs@gnu.org>
  0 siblings, 2 replies; 12+ messages in thread
From: Karl Eichwalder @ 2002-09-18  8:36 UTC (permalink / raw)


Simon Hooper <simon@trickshot.nu> writes:

> (add-hook 'calendar-mode-hook 'simon-calendar-function)

calendar-mode-hook isn't defined.  Try:

(add-hook 'initial-calendar-window-hook 'simon-calendar-function)

I just found it's documented in the manual:

File: elisp,  Node: Calendar Customizing,  Next: Holiday Customizing,  Up: Calendar

Customizing the Calendar

[...]

   Starting the calendar runs the normal hook
`initial-calendar-window-hook'.  Recomputation of the calendar display
does not run this hook.  But if you leave the calendar with the `q'
command and reenter it, the hook runs again.


-- 
ke@suse.de (work) / keichwa@gmx.net (home):              |
http://www.suse.de/~ke/                                  |      ,__o
Free Translation Project:                                |    _-\_<,
http://www.iro.umontreal.ca/contrib/po/HTML/             |   (*)/'(*)

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Calendar's buffer hooks
  2002-09-18  8:36     ` Calendar's buffer hooks Karl Eichwalder
@ 2002-09-19  5:32       ` Luis O. Silva
       [not found]       ` <mailman.1032412637.13710.help-gnu-emacs@gnu.org>
  1 sibling, 0 replies; 12+ messages in thread
From: Luis O. Silva @ 2002-09-19  5:32 UTC (permalink / raw)
  Cc: help-gnu-emacs

Karl,

On Wed, 18 Sep 2002 10:36:32 +0200, Karl Eichwalder writes:

   Karl> Simon Hooper <simon@trickshot.nu> writes:
   >> (add-hook 'calendar-mode-hook 'simon-calendar-function)

   Karl> calendar-mode-hook isn't defined.  Try:

   Karl> (add-hook 'initial-calendar-window-hook
   Karl> 'simon-calendar-function)

   Karl> I just found it's documented in the manual:

I don't know why but, when using
`initial-calendar-window-hook' in the following:

(setq-default show-trailing-whitespace t)
...
...
(add-hook 'initial-calendar-window-hook
          (lambda ()
            (setq show-trailing-whitespace nil)))

the trailing whitespace disappears only partially (!!!???) and,
after some event take place (or after some time --~30 sec.)
(!!!???), it disappears completely. The result is similar to
the one obtained using the hook: `today-visible-calendar-hook'.

Could anybody explain why this delay happens?
Thank you.

luis


-- 
Luis Octavio Silva P.
St. Petersburg State University.
66/3 Botanicheskaya St., Apt.119/2
Stary Peterhof
St. Petersburg, Russia.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Calendar's buffer hooks
       [not found]       ` <mailman.1032412637.13710.help-gnu-emacs@gnu.org>
@ 2002-09-20 18:51         ` Karl Eichwalder
  0 siblings, 0 replies; 12+ messages in thread
From: Karl Eichwalder @ 2002-09-20 18:51 UTC (permalink / raw)


"Luis O. Silva" <silva@paloma.spbu.ru> writes:

> (setq-default show-trailing-whitespace t)
> ...
> ...
> (add-hook 'initial-calendar-window-hook
>           (lambda ()
>             (setq show-trailing-whitespace nil)))
>
> the trailing whitespace disappears only partially (!!!???) and,
> after some event take place (or after some time --~30 sec.)
> (!!!???), it disappears completely. The result is similar to
> the one obtained using the hook: `today-visible-calendar-hook'.

It works for me as it should.  Please, consider to file a bug report
after updating to version 21.2.

For bug reporting read the manual: C-h r mBugs RET .

-- 
ke@suse.de (work) / keichwa@gmx.net (home):              |
http://www.suse.de/~ke/                                  |      ,__o
Free Translation Project:                                |    _-\_<,
http://www.iro.umontreal.ca/contrib/po/HTML/             |   (*)/'(*)

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2002-09-20 18:51 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-09-14  9:45 trailing whitespace visible on some buffers Luis O. Silva
2002-09-17 10:30 ` Calendar's buffer hooks (was trailing whitespace visible on some buffers) Luis O. Silva
     [not found] ` <mailman.1032257775.4079.help-gnu-emacs@gnu.org>
2002-09-17 10:49   ` Simon Hooper
2002-09-18  8:36     ` Calendar's buffer hooks Karl Eichwalder
2002-09-19  5:32       ` Luis O. Silva
     [not found]       ` <mailman.1032412637.13710.help-gnu-emacs@gnu.org>
2002-09-20 18:51         ` Karl Eichwalder
     [not found] <mailman.1031996832.11463.help-gnu-emacs@gnu.org>
2002-09-14  9:57 ` trailing whitespace visible on some buffers Edward O'Connor
2002-09-14 12:46   ` Luis O. Silva
     [not found]   ` <mailman.1032006733.12614.help-gnu-emacs@gnu.org>
2002-09-14 18:56     ` Karl Eichwalder
2002-09-15  9:55       ` Luis O. Silva
2002-09-16 17:39 ` Michael J Downes
2002-09-17  7:00   ` Luis O. Silva

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.