unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#35389: 27.0.50; [PATCH] Emacs on macOS sets mouse-wheel variables directly
@ 2019-04-23  9:47 Robert Pluim
  2019-04-23 11:17 ` Noam Postavsky
  0 siblings, 1 reply; 33+ messages in thread
From: Robert Pluim @ 2019-04-23  9:47 UTC (permalink / raw)
  To: 35389

I use the cus-edit+ package, which prompts you to save unsaved
customizations when you exit emacs. This triggers for me all the time,
because lisp/term/ns-win.el does 'setq' on mouse-wheel-scroll-amount
and mouse-wheel-progressive-speed, which I think is a no-no. The patch
below fixes it for me, but Iʼm utterly ignorant of customize, so
perhaps itʼs not the correct fix.

diff --git a/lisp/term/ns-win.el b/lisp/term/ns-win.el
index 6a668b213d..7899cbec3e 100644
--- a/lisp/term/ns-win.el
+++ b/lisp/term/ns-win.el
@@ -737,23 +737,15 @@ ns-version-string
 (defvar mouse-wheel-scroll-amount)
 (defvar mouse-wheel-progressive-speed)
 
-;; FIXME: This doesn't look right.  Is there a better way to do this
-;; that keeps customize happy?
 (when (featurep 'cocoa)
   (let ((appkit-version
          (progn (string-match "^appkit-\\([^\s-]*\\)" ns-version-string)
                 (string-to-number (match-string 1 ns-version-string)))))
     ;; Appkit 1138 ~= macOS 10.7.
     (when (>= appkit-version 1138)
-      (setq mouse-wheel-scroll-amount '(1 ((shift) . 5) ((control))))
-      (put 'mouse-wheel-scroll-amount 'customized-value
-           (list (custom-quote (symbol-value 'mouse-wheel-scroll-amount))))
-
-      (setq mouse-wheel-progressive-speed nil)
-      (put 'mouse-wheel-progressive-speed 'customized-value
-           (list (custom-quote
-                  (symbol-value 'mouse-wheel-progressive-speed)))))))
-
+      (custom-set-variables
+       (list 'mouse-wheel-scroll-amount ''(1 ((shift) . 5) ((control))) t)
+       (list 'mouse-wheel-progressive-speed nil t)))))
 
 ;;;; Color support.
 


In GNU Emacs 27.0.50 (build 6, x86_64-apple-darwin18.2.0, NS appkit-1671.20 Version 10.14.3 (Build 18D109))
 of 2019-04-19 built on rpluim-mac
Repository revision: e8124bfaaf8ba4a07beb4151fa7c5789a7de549c
Repository branch: master
Windowing system distributor 'Apple', version 10.3.1671
System Description:  Mac OS X 10.14.3





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

end of thread, other threads:[~2020-08-10 13:19 UTC | newest]

Thread overview: 33+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-04-23  9:47 bug#35389: 27.0.50; [PATCH] Emacs on macOS sets mouse-wheel variables directly Robert Pluim
2019-04-23 11:17 ` Noam Postavsky
2019-04-23 11:38   ` Robert Pluim
2019-05-10 15:29     ` Robert Pluim
2019-05-10 19:53       ` Eli Zaretskii
2019-05-10 21:25         ` Alan Third
2019-05-11  6:12           ` Eli Zaretskii
2019-05-11  9:54             ` Robert Pluim
2019-05-11 10:58               ` Eli Zaretskii
2019-05-11 22:50                 ` Alan Third
2019-05-12  4:58                   ` Eli Zaretskii
2019-05-12 11:05                     ` Alan Third
2019-05-12 14:36                       ` Eli Zaretskii
2019-05-19 12:41                         ` Alan Third
2019-05-12 23:29                       ` Tak Kunihiro
2019-05-13 14:26                         ` Eli Zaretskii
2019-05-16  9:00                           ` Tak Kunihiro
2019-05-16 13:55                             ` Eli Zaretskii
2019-05-16 23:24                               ` Tak Kunihiro
2019-05-17  5:39                                 ` Eli Zaretskii
2019-05-18  8:50                                   ` Tak Kunihiro
2019-05-18  9:16                                     ` Eli Zaretskii
2019-05-19 12:32                                       ` Alan Third
2019-05-22  6:22                                         ` Eli Zaretskii
2019-05-23  4:24                                           ` Tak Kunihiro
2019-05-23  4:55                                             ` Eli Zaretskii
2019-06-06  2:21                                           ` Tak Kunihiro
2019-06-07 18:31                                             ` Alan Third
2020-08-10 11:32                                               ` Lars Ingebrigtsen
2020-08-10 13:04                                                 ` Robert Pluim
2020-08-10 13:19                                                   ` Lars Ingebrigtsen
2019-05-11 22:53               ` Alan Third
2019-05-11 23:06             ` Alan Third

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