all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* About an example in Emacs Lisp manual
@ 2013-02-10 14:19 Xue Fuqiao
  0 siblings, 0 replies; 3+ messages in thread
From: Xue Fuqiao @ 2013-02-10 14:19 UTC (permalink / raw)
  To: help-gnu-emacs

In (info "(elisp) Translation Keymaps"):

    For example, here's how to define `C-c h' to turn the character that
  follows into a Hyper character:
     (defun hyperify (prompt)
       (let ((e (read-event)))
         (vector (if (numberp e)
                     (logior (lsh 1 24) e)
                   (if (memq 'hyper (event-modifiers e))
                       e
                     (add-event-modifier "H-" e))))))
     (defun add-event-modifier (string e)
       (let ((symbol (if (symbolp e) e (car e))))
         (setq symbol (intern (concat string
                                      (symbol-name symbol))))
         (if (symbolp e)
             symbol
           (cons symbol (cdr e)))))
     (define-key local-function-key-map "\C-ch" 'hyperify)

In the first `defun' form, if `e' is a number, (vector (logior (lsh 1 24) e)) will be returned.  I don't understand what the meaning of the bitwise-or and bit-shifting functions are here.  Can anybody explain it for me (and maybe for other people)?  Thanks.

-- 
Best regards, Xue Fuqiao.
http://www.emacswiki.org/emacs/XueFuqiao



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

end of thread, other threads:[~2013-02-10 15:31 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <mailman.19496.1360505980.855.help-gnu-emacs@gnu.org>
2013-02-10 15:07 ` About an example in Emacs Lisp manual Tom Capey
2013-02-10 15:31   ` Xue Fuqiao
2013-02-10 14:19 Xue Fuqiao

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.