all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Wrap at Window Edge: Error in pre-command-hook...
@ 2011-10-25 19:31 Marius Hofert
  0 siblings, 0 replies; 2+ messages in thread
From: Marius Hofert @ 2011-10-25 19:31 UTC (permalink / raw)
  To: Emacs help

Hi,

I experience a rather strange behavior: If I open a file in visual line mode in Emacs 23.3 and then switch to Wrap at Window Edge (via Options -> Line Wrapping in this Buffer -> Wrap at Window Edge), I obtain:

Error in pre-command-hook: (wrong-type-argument symbolp (lambda nil (interactive) (if visual-line-mode (visual-line-mode 0)) (setq word-wrap nil) (if truncate-lines (toggle-truncate-lines -1))))

After that, Wrap at Window Edge is enabled, but I don't see the little squiggle arrows. 
If I go back to visual line mode and again switch to Wrap at Window Edge, I don't obtain the above error anymore. Still, I don't see the little arrows. The strange thing is, that earlier today, everything worked fine. The only thing I changed (I checked with a backup file from yesterday) is putting in the following in .emacs:  
(global-visual-line-mode t)
(global-set-key (kbd "C-x t") 'toggle-truncate-lines)
(global-set-key (kbd "C-x w") 'toggle-word-wrap)
But even if I remove these parts from .emacs, I get the above error/behavior. 

I also activated Options -> Enter Debugger on Error and reproduced the error, but there is no *Backtrace* buffer.

Cheers,

Marius

PS: This is on Mac OS X 10.7.2 with Emacs 23.3 (9.0)


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

* Re: Wrap at Window Edge: Error in pre-command-hook...
       [not found] <mailman.1051.1319571121.15868.help-gnu-emacs@gnu.org>
@ 2011-10-25 23:50 ` Stefan Monnier
  0 siblings, 0 replies; 2+ messages in thread
From: Stefan Monnier @ 2011-10-25 23:50 UTC (permalink / raw)
  To: help-gnu-emacs

> Error in pre-command-hook: (wrong-type-argument symbolp (lambda nil
> (interactive) (if visual-line-mode (visual-line-mode 0)) (setq word-wrap
> nil) (if truncate-lines (toggle-truncate-lines -1))))

Apparently, you're using a package which installs a pre-command-hook
which assumes that the value of `this-command' is a symbol (which is
almost always the case, but not always, e.g. not when you select "Wrap
at Window Edge").

In Emacs-24, the error message is a bit more precise and includes the
name of the hook function installed on pre-command-hook which caused
the error.


        Stefan


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

end of thread, other threads:[~2011-10-25 23:50 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <mailman.1051.1319571121.15868.help-gnu-emacs@gnu.org>
2011-10-25 23:50 ` Wrap at Window Edge: Error in pre-command-hook Stefan Monnier
2011-10-25 19:31 Marius Hofert

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.