diff options
author | Glenn Morris <rgm@gnu.org> | 2011-01-15 12:38:27 -0800 |
---|---|---|
committer | Glenn Morris <rgm@gnu.org> | 2011-01-15 12:38:27 -0800 |
commit | d52969e8afaa19ed1acc01f4ff0bb651bf7869a7 (patch) | |
tree | a51a042adc70e362c982f1aec9e9e3d07097a85c /lisp/subr.el | |
parent | 362b9d483c714a8fd87966ddbd8686850f870e34 (diff) | |
parent | 9f19b8ddfe3a46d8a5ae86b6c8d2394562d02843 (diff) | |
download | emacs-d52969e8afaa19ed1acc01f4ff0bb651bf7869a7.tar.gz |
Merge from emacs-23 branch, up to 2010-05-20T21:33:58Z!juri@jurta.org.
Note:
emacs-23 2010-05-20T01:32:08Z!lekktu@gmail.com is rendered unnecessary by pre-existing 2010-05-20
trunk change.
Diffstat (limited to 'lisp/subr.el')
-rw-r--r-- | lisp/subr.el | 40 |
1 files changed, 29 insertions, 11 deletions
diff --git a/lisp/subr.el b/lisp/subr.el index 293d71b8915..25f36269df0 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -853,24 +853,37 @@ in the current Emacs session, then this function may return nil." (defsubst event-start (event) "Return the starting position of EVENT. -If EVENT is a mouse or key press or a mouse click, this returns the location -of the event. -If EVENT is a drag, this returns the drag's starting position. -The return value is of the form +EVENT should be a click, drag, or key press event. +If it is a key press event, the return value has the form + (WINDOW POS (0 . 0) 0) +If it is a click or drag event, it has the form (WINDOW AREA-OR-POS (X . Y) TIMESTAMP OBJECT POS (COL . ROW) IMAGE (DX . DY) (WIDTH . HEIGHT)) -The `posn-' functions access elements of such lists." +The `posn-' functions access elements of such lists. +For more information, see Info node `(elisp)Click Events'. + +If EVENT is a mouse or key press or a mouse click, this is the +position of the event. If EVENT is a drag, this is the starting +position of the drag." (if (consp event) (nth 1 event) (list (selected-window) (point) '(0 . 0) 0))) (defsubst event-end (event) "Return the ending location of EVENT. EVENT should be a click, drag, or key press event. -If EVENT is a click event, this function is the same as `event-start'. -The return value is of the form +If EVENT is a key press event, the return value has the form + (WINDOW POS (0 . 0) 0) +If EVENT is a click event, this function is the same as +`event-start'. For click and drag events, the return value has +the form (WINDOW AREA-OR-POS (X . Y) TIMESTAMP OBJECT POS (COL . ROW) IMAGE (DX . DY) (WIDTH . HEIGHT)) -The `posn-' functions access elements of such lists." +The `posn-' functions access elements of such lists. +For more information, see Info node `(elisp)Click Events'. + +If EVENT is a mouse or key press or a mouse click, this is the +position of the event. If EVENT is a drag, this is the starting +position of the drag." (if (consp event) (nth (if (consp (nth 2 event)) 2 1) event) (list (selected-window) (point) '(0 . 0) 0))) @@ -2364,11 +2377,16 @@ directory if it does not exist." ;; unless we're in batch mode or dumping Emacs (or noninteractive purify-flag - (file-accessible-directory-p (directory-file-name user-emacs-directory)) - (make-directory user-emacs-directory)) + (file-accessible-directory-p + (directory-file-name user-emacs-directory)) + (let ((umask (default-file-modes))) + (unwind-protect + (progn + (set-default-file-modes ?\700) + (make-directory user-emacs-directory)) + (set-default-file-modes umask)))) (abbreviate-file-name (expand-file-name new-name user-emacs-directory)))))) - ;;;; Misc. useful functions. |