unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Alan Morgan <Alan.Morgan@nextlabs.com>
To: "20521@debbugs.gnu.org" <20521@debbugs.gnu.org>
Subject: bug#20521: Bug 2051
Date: Fri, 15 May 2015 13:39:13 -0700	[thread overview]
Message-ID: <0DBA2ACE64E8894F80DEC59F1EB9BE23048E1E55476B@NXT-EXCH.nextlabs.com> (raw)
In-Reply-To: <0DBA2ACE64E8894F80DEC59F1EB9BE23048E1E554241@NXT-EXCH.nextlabs.com>

[-- Attachment #1: Type: text/plain, Size: 2801 bytes --]

I have more information on this bug, although I still don't have a reproducible case. The problem happens when the *global* value of viper-current-state is changed from emacs-state to vi-state. Once this happens we are in trouble, because new buffers will not be assigned the vi key-bindings so anything other than cursor movement keys and a few others will do nothing. I made the following changes to viper-cmd.el in the function viper-change-state:

  ;; Always turn off quail mode in vi state
  (cond ((eq new-state 'vi-state) (viper-set-input-method nil)) ;intl input off
                (viper-special-input-method (viper-set-input-method t)) ;intl input on
                (t (viper-set-input-method nil)))

  (message (concat "Setting viper-current-state from " (prin1-to-string viper-current-state) " to " (prin1-to-string new-state) " via setq"))
  (global-viper-current-state)
  (setq viper-current-state new-state)
  (global-viper-current-state)

Global-viper-current-state is defined as follows:

(defun global-viper-current-state ()
  (message (concat "The global value of viper-current-state is " (prin1-to-string (default-value 'viper-current-state)))))

Most of the time I see the following:

Setting viper-current-state from emacs-state to insert-state via setq
The global value of viper-current-state is emacs-state [2 times]

But then, for no reason that I could see, I saw this:
Setting viper-current-state from emacs-state to vi-state via setq
The global value of viper-current-state is emacs-state
The global value of viper-current-state is vi-state

How on Earth? Perhaps setq is broken. Perhaps we aren't actually *in* a buffer when setq is called (is that possible?) and thus the global value is being set. I don't understand how this is possible and, now that I've uncovered this, I'm not sure what I can do to fix it.

Alan


 ---------------------------------------------------------------------
STATEMENT OF CONFIDENTIALITY
 
The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain confidential or privileged information. No representation is made on its accuracy or completeness of the information contained in this electronic message. Certain assumptions may have been made in the preparation of this material as at this date, and are subject to change without notice. If you are not the intended recipient, you are hereby notified that any dissemination, distribution or copying of this e-mail and any attachment(s) is strictly prohibited. Please reply to the sender at NextLabs Inc and destroy all copies of this message and any attachments from your system. ======================================================================

[-- Attachment #2: Type: text/html, Size: 5762 bytes --]

  reply	other threads:[~2015-05-15 20:39 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-06 23:35 bug#20521: Viper version is 3.14.2 of July 4, 2013; After some hours of use I don't enter viper mode automatically on new files Alan Morgan
2015-05-15 20:39 ` Alan Morgan [this message]
2015-05-15 21:08   ` bug#20521: Bug 2051 Nick Andryshak
2015-05-15 21:42     ` Drew Adams
2015-05-15 23:24       ` Nick Andryshak
2015-05-15 21:51     ` Alan Morgan
2015-05-27 16:50 ` bug#20521: setq-local definitely behaving oddly for viper mode Alan Morgan
2015-05-27 22:28   ` Johan Bockgård
2015-05-28  2:02     ` Stefan Monnier
2022-02-10  8:11     ` bug#20521: Viper version is 3.14.2 of July 4, 2013; After some hours of use I don't enter viper mode automatically on new files Lars Ingebrigtsen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=0DBA2ACE64E8894F80DEC59F1EB9BE23048E1E55476B@NXT-EXCH.nextlabs.com \
    --to=alan.morgan@nextlabs.com \
    --cc=20521@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).