3

I'm trying to understand this value assignment:

(setq mouse-wheel-scroll-amount '(2 ((shift) . 1)))

I know that shift is a bitwise shift. But I don't understand what is the result of this operation here (what is the value of mouse-wheel-scroll-amount). And for that matter, why did the coder decide to use this operation rather than giving a decimal value here.

Drew
  • 77,472
  • 10
  • 114
  • 243
NVaughan
  • 1,481
  • 12
  • 27

1 Answers1

6

shift in this case is a symbol, not a function. Note that the variable is given a quoted list, so nothing inside is evaluated.

From the documentation of this variable (which you can access via describe-variable), you can give different amounts of scrolling for different (keyboard) modifiers.

In this case, the normal scroll is 2 lines, or 1 if SHIFT is pressed.

Juancho
  • 5,455
  • 16
  • 20
  • @NVaughan I would add that the bitwise shift functions in elisp are lsh and ash, not shift. http://www.gnu.org/software/emacs/manual/html_node/elisp/Bitwise-Operations.html#Bitwise-Operations – JeanPierre May 18 '16 at 06:54