------------------------------------------------------------ revno: 115223 fixes bug: http://debbugs.gnu.org/15969 committer: Glenn Morris branch nick: trunk timestamp: Sun 2013-11-24 19:25:13 -0800 message: * erc/erc-button.el (erc-nick-popup): Make `nick' available in the eval environment. diff: === modified file 'lisp/erc/ChangeLog' --- lisp/erc/ChangeLog 2013-11-04 19:35:37 +0000 +++ lisp/erc/ChangeLog 2013-11-25 03:25:13 +0000 @@ -1,3 +1,8 @@ +2013-11-25 Glenn Morris + + * erc-button.el (erc-nick-popup): Make `nick' available in the + eval environment. (Bug#15969) + 2013-11-04 Stefan Monnier * erc-pcomplete.el (erc-pcomplete): Set this-command. === modified file 'lisp/erc/erc-button.el' --- lisp/erc/erc-button.el 2013-09-19 02:21:31 +0000 +++ lisp/erc/erc-button.el 2013-11-25 03:25:13 +0000 @@ -514,7 +514,7 @@ (code (cdr (assoc action erc-nick-popup-alist)))) (when code (erc-set-active-buffer (current-buffer)) - (eval code)))) + (eval code `((nick . ,nick)))))) ;;; Callback functions (defun erc-button-describe-symbol (symbol-name) ------------------------------------------------------------ revno: 115222 committer: Glenn Morris branch nick: trunk timestamp: Sun 2013-11-24 19:10:54 -0800 message: src/lread.c comment diff: === modified file 'src/lread.c' --- src/lread.c 2013-11-25 02:36:41 +0000 +++ src/lread.c 2013-11-25 03:10:54 +0000 @@ -4195,6 +4195,14 @@ changed from the default that was saved before dumping, don't change it further. Changes can only be due to site-lisp files that were processed during dumping. */ + /* FIXME? AFAICS, it does not make sense to change load-path in a + dumped site-lisp file, so maybe we should just drop this check. + E.g., if you add an element to load-path, you are going to be + adding it to PATH_DUMPLOADSEARCH, which refers to the source directory. + This will make no sense (and may not still exist) in an installed Emacs. + And the only change it is sensible to make to load-path is to add + something to the front, which you should do with configure's + --enable-locallisppath option if you really want to have it dumped. */ if (initialized) { if (changed || NILP (Fequal (dump_path, Vload_path))) ------------------------------------------------------------ revno: 115221 committer: Stefan Monnier branch nick: trunk timestamp: Sun 2013-11-24 21:41:02 -0500 message: * lisp/frame.el (handle-focus-in, handle-focus-out): Move from frame.c. Remove blink-cursor code. (blink-cursor-timer-function, blink-cursor-suspend): Don't special-case GUIs. (blink-cursor-mode): Use focus-in/out-hook. * src/frame.c (Fhandle_focus_in, Fhandle_focus_out): Move to frame.el. (syms_of_frame): Don't defsubr them. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-11-25 02:28:02 +0000 +++ lisp/ChangeLog 2013-11-25 02:41:02 +0000 @@ -1,3 +1,11 @@ +2013-11-25 Stefan Monnier + + * frame.el (handle-focus-in, handle-focus-out): Move from frame.c. + Remove blink-cursor code. + (blink-cursor-timer-function, blink-cursor-suspend): + Don't special-case GUIs. + (blink-cursor-mode): Use focus-in/out-hook. + 2013-11-25 Dmitry Gutov * vc/vc-git.el (vc-git-annotate-extract-revision-at-line): Make it @@ -86,13 +94,13 @@ 2013-11-21 Leo Liu - * progmodes/octave.el (octave-mode, inferior-octave-mode): Fix - obsolete variable comment-use-global-state. + * progmodes/octave.el (octave-mode, inferior-octave-mode): + Fix obsolete variable comment-use-global-state. 2013-11-21 RĂ¼diger Sonderfeld - * progmodes/octave.el (octave-mode-map, octave-mode-menu): Add - `octave-source-file'. + * progmodes/octave.el (octave-mode-map, octave-mode-menu): + Add `octave-source-file'. (octave-source-file): New function. (Bug#15935) 2013-11-21 Kenjiro Nakayama (tiny change) === modified file 'lisp/frame.el' --- lisp/frame.el 2013-10-22 08:07:51 +0000 +++ lisp/frame.el 2013-11-25 02:41:02 +0000 @@ -120,6 +120,21 @@ (delete-frame frame t) ;; Gildea@x.org says it is ok to ask questions before terminating. (save-buffers-kill-emacs)))) + +(defun handle-focus-in (_event) + "Handle a focus-in event. +Focus-in events are usually bound to this function. +Focus-in events occur when a frame has focus, but a switch-frame event +is not generated. +This function runs the hook `focus-in-hook'." + (run-hooks 'focus-in-hook)) + +(defun handle-focus-out (_event) + "Handle a focus-out event. +Focus-out events are usually bound to this function. +Focus-out events occur when no frame has focus. +This function runs the hook `focus-out-hook'." + (run-hooks 'focus-out-hook)) ;;;; Arrangement of frames at startup @@ -1727,12 +1742,11 @@ "Timer function of timer `blink-cursor-timer'." (internal-show-cursor nil (not (internal-show-cursor-p))) ;; Each blink is two calls to this function. - (when (memq window-system '(x ns w32)) - (setq blink-cursor-blinks-done (1+ blink-cursor-blinks-done)) - (when (and (> blink-cursor-blinks 0) - (<= (* 2 blink-cursor-blinks) blink-cursor-blinks-done)) - (blink-cursor-suspend) - (add-hook 'post-command-hook 'blink-cursor-check)))) + (setq blink-cursor-blinks-done (1+ blink-cursor-blinks-done)) + (when (and (> blink-cursor-blinks 0) + (<= (* 2 blink-cursor-blinks) blink-cursor-blinks-done)) + (blink-cursor-suspend) + (add-hook 'post-command-hook 'blink-cursor-check))) (defun blink-cursor-end () @@ -1747,15 +1761,14 @@ (setq blink-cursor-timer nil))) (defun blink-cursor-suspend () - "Suspend cursor blinking on NS, X and W32. + "Suspend cursor blinking. This is called when no frame has focus and timers can be suspended. Timers are restarted by `blink-cursor-check', which is called when a frame receives focus." - (when (memq window-system '(x ns w32)) - (blink-cursor-end) - (when blink-cursor-idle-timer - (cancel-timer blink-cursor-idle-timer) - (setq blink-cursor-idle-timer nil)))) + (blink-cursor-end) + (when blink-cursor-idle-timer + (cancel-timer blink-cursor-idle-timer) + (setq blink-cursor-idle-timer nil))) (defun blink-cursor-check () "Check if cursor blinking shall be restarted. @@ -1789,13 +1802,15 @@ (if blink-cursor-idle-timer (cancel-timer blink-cursor-idle-timer)) (setq blink-cursor-idle-timer nil) (blink-cursor-end) + (remove-hook 'focus-in-hook #'blink-cursor-check) + (remove-hook 'focus-out-hook #'blink-cursor-suspend) (when blink-cursor-mode - ;; Hide the cursor. - ;;(internal-show-cursor nil nil) + (add-hook 'focus-in-hook #'blink-cursor-check) + (add-hook 'focus-out-hook #'blink-cursor-suspend) (setq blink-cursor-idle-timer (run-with-idle-timer blink-cursor-delay blink-cursor-delay - 'blink-cursor-start)))) + #'blink-cursor-start)))) ;; Frame maximization/fullscreen === modified file 'src/ChangeLog' --- src/ChangeLog 2013-11-25 02:36:41 +0000 +++ src/ChangeLog 2013-11-25 02:41:02 +0000 @@ -1,3 +1,8 @@ +2013-11-25 Stefan Monnier + + * frame.c (Fhandle_focus_in, Fhandle_focus_out): Move to frame.el. + (syms_of_frame): Don't defsubr them. + 2013-11-25 Glenn Morris * lread.c (load_path_default): Change the sense of the argument. === modified file 'src/frame.c' --- src/frame.c 2013-11-19 02:32:26 +0000 +++ src/frame.c 2013-11-25 02:41:02 +0000 @@ -887,31 +887,6 @@ return do_switch_frame (frame, 1, 0, norecord); } -DEFUN ("handle-focus-in", Fhandle_focus_in, Shandle_focus_in, 1, 1, "e", - doc: /* Handle a focus-in event. -Focus in events are usually bound to this function. -Focus in events occur when a frame has focus, but a switch-frame event -is not generated. -This function runs the hook `focus-in-hook'. -It also checks if blink-cursor timers should be turned on again. */) - (Lisp_Object event) -{ - Frun_hooks (1, &Qfocus_in_hook); - return call0 (intern ("blink-cursor-check")); -} - -DEFUN ("handle-focus-out", Fhandle_focus_out, Shandle_focus_out, 1, 1, "e", - doc: /* Handle a focus-out event. -Focus out events are usually bound to this function. -Focus out events occur when no frame has focus. -This function runs the hook `focus-out-hook'. -It also checks if blink-cursor timers should be turned off. */) - (Lisp_Object event) -{ - Frun_hooks (1, &Qfocus_out_hook); - return call0 (intern ("blink-cursor-suspend")); -} - DEFUN ("handle-switch-frame", Fhandle_switch_frame, Shandle_switch_frame, 1, 1, "e", doc: /* Handle a switch-frame event EVENT. Switch-frame events are usually bound to this function. @@ -926,7 +901,8 @@ /* Preserve prefix arg that the command loop just cleared. */ kset_prefix_arg (current_kboard, Vcurrent_prefix_arg); Frun_hooks (1, &Qmouse_leave_buffer_hook); - Fhandle_focus_in (event); // switch-frame implies a focus in. + /* `switch-frame' implies a focus in. */ + call1 (intern ("handle-focus-in"), event); return do_switch_frame (event, 0, 0, Qnil); } @@ -4542,8 +4518,6 @@ defsubr (&Swindow_system); defsubr (&Smake_terminal_frame); defsubr (&Shandle_switch_frame); - defsubr (&Shandle_focus_in); - defsubr (&Shandle_focus_out); defsubr (&Sselect_frame); defsubr (&Sselected_frame); defsubr (&Sframe_list); ------------------------------------------------------------ revno: 115220 committer: Glenn Morris branch nick: trunk timestamp: Sun 2013-11-24 18:36:41 -0800 message: Further tweaks to the setting of Vload_path This is giving me a headache... * src/lread.c (load_path_default): Change the sense of the argument. (init_lread): When EMACSLOADPATH is set, do not ignore changes from dump_path. When it is not, avoid checking dump_path twice. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2013-11-25 01:35:45 +0000 +++ src/ChangeLog 2013-11-25 02:36:41 +0000 @@ -1,5 +1,9 @@ 2013-11-25 Glenn Morris + * lread.c (load_path_default): Change the sense of the argument. + (init_lread): When EMACSLOADPATH is set, do not ignore changes + from dump_path. When it is not, avoid checking dump_path twice. + * lread.c (init_lread): Fix 2013-11-23 goof that was checking uninstalled dump_path against installed Vload_path. (Bug#15964) === modified file 'src/lread.c' --- src/lread.c 2013-11-25 01:35:45 +0000 +++ src/lread.c 2013-11-25 02:36:41 +0000 @@ -4167,7 +4167,7 @@ leim and site-lisp. */ Lisp_Object -load_path_default (bool ignore_existing) +load_path_default (bool changed) { Lisp_Object lpath = Qnil; const char *normal; @@ -4193,11 +4193,11 @@ the source directory, instead of the path of the installed elisp libraries. However, if it appears that Vload_path has already been changed from the default that was saved before dumping, don't - change it further. Changes can only be due to EMACSLOADPATH, or - site-lisp files that were processed during dumping. */ + change it further. Changes can only be due to site-lisp + files that were processed during dumping. */ if (initialized) { - if (!ignore_existing && NILP (Fequal (dump_path, Vload_path))) + if (changed || NILP (Fequal (dump_path, Vload_path))) { /* Do not make any changes. */ return Vload_path; @@ -4332,19 +4332,27 @@ { /* First, set Vload_path. */ + /* NB: Do not change Vload_path before calling load_path_default, + since it may check it against dump_path. + (This behavior could be changed.) */ + /* We explicitly ignore EMACSLOADPATH when dumping. */ if (NILP (Vpurify_flag) && egetenv ("EMACSLOADPATH")) { - Vload_path = decode_env_path ("EMACSLOADPATH", 0, 1); + Lisp_Object elpath = decode_env_path ("EMACSLOADPATH", 0, 1); /* Check (non-nil) user-supplied elements. */ - load_path_check (Vload_path); + load_path_check (elpath); - /* Replace any nil elements from the environment with the default. */ - if (!NILP (Fmemq (Qnil, Vload_path))) - { - Lisp_Object lpath = Vload_path; - Lisp_Object elem, default_lpath = load_path_default (1); + /* If no nils in the environment variable, use as-is. + Otherwise, replace any nils with the default. */ + if (NILP (Fmemq (Qnil, elpath))) + { + Vload_path = elpath; + } + else + { + Lisp_Object elem, default_lpath = load_path_default (0); /* Check defaults, before adding site-lisp. */ load_path_check (default_lpath); @@ -4361,11 +4369,11 @@ Vload_path = Qnil; /* Replace nils from EMACSLOADPATH by default. */ - while (CONSP (lpath)) + while (CONSP (elpath)) { Lisp_Object arg[2]; - elem = XCAR (lpath); - lpath = XCDR (lpath); + elem = XCAR (elpath); + elpath = XCDR (elpath); arg[0] = Vload_path; arg[1] = NILP (elem) ? default_lpath : Fcons (elem, Qnil); Vload_path = Fappend (2, arg); @@ -4374,8 +4382,13 @@ } else /* Vpurify_flag || !EMACSLOADPATH */ { - Lisp_Object lpath = Vload_path; - Vload_path = load_path_default (0); +#ifdef CANNOT_DUMP + bool changed = 0; +#else + bool changed = initialized && NILP (Fequal (dump_path, Vload_path)); +#endif + + Vload_path = load_path_default (changed); /* Check before adding site-lisp directories. The install should have created them, but they are not @@ -4384,10 +4397,9 @@ load_path_check (Vload_path); /* Add the site-lisp directories at the front, unless the - load-path has somehow already been changed (this can only be - from a site-load file during dumping?) from the dumped value. - FIXME? Should we ignore any dump_path changes? */ - if (initialized && !no_site_lisp && !NILP (Fequal (dump_path, lpath))) + load-path has already been changed. + FIXME? Should we ignore changed here? */ + if (initialized && !no_site_lisp && !changed) { Lisp_Object sitelisp; sitelisp = decode_env_path (0, PATH_SITELOADSEARCH, 0); ------------------------------------------------------------ revno: 115219 fixes bug: http://debbugs.gnu.org/13886 committer: Dmitry Gutov branch nick: trunk timestamp: Mon 2013-11-25 04:28:02 +0200 message: * lisp/vc/vc-git.el (vc-git-annotate-extract-revision-at-line): Make it work when annotation is invisible. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-11-24 22:53:35 +0000 +++ lisp/ChangeLog 2013-11-25 02:28:02 +0000 @@ -1,3 +1,8 @@ +2013-11-25 Dmitry Gutov + + * vc/vc-git.el (vc-git-annotate-extract-revision-at-line): Make it + work when annotation is invisible (Bug#13886). + 2013-11-24 Simon Schubert <2@0x2c.org> (tiny change) * json.el (json-alist-p): Only return non-nil if the alist has === modified file 'lisp/vc/vc-git.el' --- lisp/vc/vc-git.el 2013-11-19 20:23:53 +0000 +++ lisp/vc/vc-git.el 2013-11-25 02:28:02 +0000 @@ -931,7 +931,7 @@ (defun vc-git-annotate-extract-revision-at-line () (save-excursion - (move-beginning-of-line 1) + (beginning-of-line) (when (looking-at "\\([0-9a-f^][0-9a-f]+\\) \\(\\([^(]+\\) \\)?") (let ((revision (match-string-no-properties 1))) (if (match-beginning 2) ------------------------------------------------------------ revno: 115218 committer: Glenn Morris branch nick: trunk timestamp: Sun 2013-11-24 17:36:14 -0800 message: Makefile.in comment. diff: === modified file 'Makefile.in' --- Makefile.in 2013-11-20 01:48:50 +0000 +++ Makefile.in 2013-11-25 01:36:14 +0000 @@ -547,9 +547,12 @@ ## Note that the Makefiles in the etc directory are potentially useful ## in an installed Emacs, so should not be excluded. -## We used to create locallisppath, but if it points to non-standard -## locations, is not really Emacs's job to create these directories, -## so it is no longer done. +## We always create the _default_ locallisppath directories, and +## ensure that they contain a subdirs.el file (via write_subdir). +## This is true even if locallisppath has a non-default value. +## In case of non-default value, we used to create the specified directories, +## but not add subdirs.el to them. This was a strange halfway house. +## Nowadays we do not create non-default directories. ## Note that we use tar instead of plain old cp -R/-r because the latter ## is apparently not portable (even in 2012!). ------------------------------------------------------------ revno: 115217 fixes bug: http://debbugs.gnu.org/15964 committer: Glenn Morris branch nick: trunk timestamp: Sun 2013-11-24 17:35:45 -0800 message: * src/lread.c (init_lread): Fix 2013-11-23 goof that was checking uninstalled dump_path against installed Vload_path. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2013-11-24 18:28:33 +0000 +++ src/ChangeLog 2013-11-25 01:35:45 +0000 @@ -1,3 +1,8 @@ +2013-11-25 Glenn Morris + + * lread.c (init_lread): Fix 2013-11-23 goof that was checking + uninstalled dump_path against installed Vload_path. (Bug#15964) + 2013-11-24 Stefan Monnier Export get_pos_property to Elisp. === modified file 'src/lread.c' --- src/lread.c 2013-11-23 03:23:20 +0000 +++ src/lread.c 2013-11-25 01:35:45 +0000 @@ -4374,6 +4374,7 @@ } else /* Vpurify_flag || !EMACSLOADPATH */ { + Lisp_Object lpath = Vload_path; Vload_path = load_path_default (0); /* Check before adding site-lisp directories. @@ -4386,8 +4387,7 @@ load-path has somehow already been changed (this can only be from a site-load file during dumping?) from the dumped value. FIXME? Should we ignore any dump_path changes? */ - if (initialized && !no_site_lisp && - ! NILP (Fequal (dump_path, Vload_path))) + if (initialized && !no_site_lisp && !NILP (Fequal (dump_path, lpath))) { Lisp_Object sitelisp; sitelisp = decode_env_path (0, PATH_SITELOADSEARCH, 0); ------------------------------------------------------------ revno: 115216 committer: Dmitry Gutov branch nick: trunk timestamp: Mon 2013-11-25 00:53:35 +0200 message: Fixup two last lisp/ChangeLog entries diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-11-24 22:49:37 +0000 +++ lisp/ChangeLog 2013-11-24 22:53:35 +0000 @@ -1,9 +1,9 @@ -2013-11-24 Simon Schubert <2@0x2c.org> +2013-11-24 Simon Schubert <2@0x2c.org> (tiny change) * json.el (json-alist-p): Only return non-nil if the alist has simple keys (Bug#13518). -2013-11-22 Mihir Rege (tiny change) +2013-11-24 Mihir Rege (tiny change) * progmodes/js.el (js--ctrl-statement-indentation): Fix indent when control-statement is the first statement in a buffer (Bug#15956). ------------------------------------------------------------ revno: 115215 fixes bug: http://debbugs.gnu.org/13518 author: Simon Schubert <2@0x2c.org> committer: Dmitry Gutov branch nick: trunk timestamp: Mon 2013-11-25 00:49:37 +0200 message: * lisp/json.el (json-alist-p): Only return non-nil if the alist has simple keys. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-11-24 22:01:08 +0000 +++ lisp/ChangeLog 2013-11-24 22:49:37 +0000 @@ -1,3 +1,8 @@ +2013-11-24 Simon Schubert <2@0x2c.org> + + * json.el (json-alist-p): Only return non-nil if the alist has + simple keys (Bug#13518). + 2013-11-22 Mihir Rege (tiny change) * progmodes/js.el (js--ctrl-statement-indentation): Fix indent === modified file 'lisp/json.el' --- lisp/json.el 2013-08-09 21:22:44 +0000 +++ lisp/json.el 2013-11-24 22:49:37 +0000 @@ -126,9 +126,10 @@ (mapconcat 'identity strings separator)) (defun json-alist-p (list) - "Non-null if and only if LIST is an alist." + "Non-null if and only if LIST is an alist with simple keys." (while (consp list) - (setq list (if (consp (car list)) + (setq list (if (and (consp (car list)) + (atom (caar list))) (cdr list) 'not-alist))) (null list)) ------------------------------------------------------------ revno: 115214 fixes bug: http://debbugs.gnu.org/15956 author: Mihir Rege committer: Dmitry Gutov branch nick: trunk timestamp: Mon 2013-11-25 00:01:08 +0200 message: * lisp/progmodes/js.el (js--ctrl-statement-indentation): Fix indent when control-statement is the first statement in a buffer. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-11-24 21:23:47 +0000 +++ lisp/ChangeLog 2013-11-24 22:01:08 +0000 @@ -1,3 +1,8 @@ +2013-11-22 Mihir Rege (tiny change) + + * progmodes/js.el (js--ctrl-statement-indentation): Fix indent + when control-statement is the first statement in a buffer (Bug#15956). + 2013-11-24 Dmitry Gutov * imenu.el (imenu-generic-skip-comments-and-strings): === modified file 'lisp/progmodes/js.el' --- lisp/progmodes/js.el 2013-08-09 21:22:44 +0000 +++ lisp/progmodes/js.el 2013-11-24 22:01:08 +0000 @@ -1749,8 +1749,8 @@ (when (save-excursion (and (not (eq (point-at-bol) (point-min))) (not (looking-at "[{]")) + (js--re-search-backward "[[:graph:]]" nil t) (progn - (js--re-search-backward "[[:graph:]]" nil t) (or (eobp) (forward-char)) (when (= (char-before) ?\)) (backward-list)) (skip-syntax-backward " ") ------------------------------------------------------------ revno: 115213 fixes bug: http://debbugs.gnu.org/15560 committer: Dmitry Gutov branch nick: trunk timestamp: Sun 2013-11-24 23:23:47 +0200 message: * lisp/imenu.el (imenu-generic-skip-comments-and-strings): New option. (imenu--generic-function): Use it. diff: === modified file 'etc/NEWS' --- etc/NEWS 2013-11-24 18:28:33 +0000 +++ etc/NEWS 2013-11-24 21:23:47 +0000 @@ -639,6 +639,10 @@ +++ ** There is a new macro `skip-unless' for skipping ERT tests. See the manual. +** Imenu + +*** New option `imenu-generic-skip-comments-and-strings'. + * New Modes and Packages in Emacs 24.4 === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-11-24 14:08:02 +0000 +++ lisp/ChangeLog 2013-11-24 21:23:47 +0000 @@ -1,3 +1,9 @@ +2013-11-24 Dmitry Gutov + + * imenu.el (imenu-generic-skip-comments-and-strings): + New option (Bug#15560). + (imenu--generic-function): Use it. + 2013-11-24 Jorgen Schaefer * minibuffer.el (completion--in-region-1): Scroll the correct === modified file 'lisp/imenu.el' --- lisp/imenu.el 2013-02-28 17:15:08 +0000 +++ lisp/imenu.el 2013-11-24 21:23:47 +0000 @@ -185,6 +185,13 @@ :type 'string :group 'imenu) +(defcustom imenu-generic-skip-comments-and-strings t + "When non-nil, ignore text inside comments and strings. +Only affects `imenu--generic-function'." + :type 'boolean + :group 'imenu + :version "24.4") + ;;;###autoload (defvar imenu-generic-expression nil "List of definition matchers for creating an Imenu index. @@ -796,7 +803,9 @@ ;; starting with its title (or nil). (menu (assoc menu-title index-alist))) ;; Insert the item unless it is already present. - (unless (member item (cdr menu)) + (unless (or (member item (cdr menu)) + (and imenu-generic-skip-comments-and-strings + (nth 8 (syntax-ppss)))) (setcdr menu (cons item (cdr menu))))) ;; Go to the start of the match, to make sure we ------------------------------------------------------------ revno: 115212 committer: Stefan Monnier branch nick: trunk timestamp: Sun 2013-11-24 13:28:33 -0500 message: Export get_pos_property to Elisp. * src/editfns.c (Fget_pos_property): Rename from get_pos_property. (syms_of_editfns): Export it to Elisp. diff: === modified file 'etc/NEWS' --- etc/NEWS 2013-11-24 09:31:51 +0000 +++ etc/NEWS 2013-11-24 18:28:33 +0000 @@ -731,6 +731,8 @@ * Lisp Changes in Emacs 24.4 +** New function get-pos-property. + ** New hook `pre-redisplay-function'. +++ === modified file 'src/ChangeLog' --- src/ChangeLog 2013-11-24 18:20:18 +0000 +++ src/ChangeLog 2013-11-24 18:28:33 +0000 @@ -1,5 +1,9 @@ 2013-11-24 Stefan Monnier + Export get_pos_property to Elisp. + * editfns.c (Fget_pos_property): Rename from get_pos_property. + (syms_of_editfns): Export it to Elisp. + * data.c (Fmake_variable_buffer_local): Mention `permanent-local'. 2013-11-23 Romain Francoise === modified file 'src/editfns.c' --- src/editfns.c 2013-11-06 10:14:50 +0000 +++ src/editfns.c 2013-11-24 18:28:33 +0000 @@ -343,16 +343,15 @@ return idx; } -/* Return the value of property PROP, in OBJECT at POSITION. - It's the value of PROP that a char inserted at POSITION would get. - OBJECT is optional and defaults to the current buffer. - If OBJECT is a buffer, then overlay properties are considered as well as - text properties. - If OBJECT is a window, then that window's buffer is used, but - window-specific overlays are considered only if they are associated - with OBJECT. */ -Lisp_Object -get_pos_property (Lisp_Object position, register Lisp_Object prop, Lisp_Object object) +DEFUN ("get-pos-property", Fget_pos_property, Sget_pos_property, 2, 3, 0, + doc: /* Return the value of POSITION's property PROP, in OBJECT. +Almost identical to `get-char-property' except for the following difference: +Whereas `get-char-property' returns the property of the char at (i.e. right +after) POSITION, this pays attention to properties's stickiness and overlays's +advancement settings, in order to find the property of POSITION itself, +i.e. the property that a char would inherit if it were inserted +at POSITION. */) + (Lisp_Object position, register Lisp_Object prop, Lisp_Object object) { CHECK_NUMBER_COERCE_MARKER (position); @@ -484,7 +483,7 @@ specially. */ if (NILP (merge_at_boundary)) { - Lisp_Object field = get_pos_property (pos, Qfield, Qnil); + Lisp_Object field = Fget_pos_property (pos, Qfield, Qnil); if (!EQ (field, after_field)) at_field_end = 1; if (!EQ (field, before_field)) @@ -683,7 +682,7 @@ && (!NILP (Fget_char_property (new_pos, Qfield, Qnil)) || !NILP (Fget_char_property (old_pos, Qfield, Qnil)) /* To recognize field boundaries, we must also look at the - previous positions; we could use `get_pos_property' + previous positions; we could use `Fget_pos_property' instead, but in itself that would fail inside non-sticky fields (like comint prompts). */ || (XFASTINT (new_pos) > BEGV @@ -694,10 +693,12 @@ /* Field boundaries are again a problem; but now we must decide the case exactly, so we need to call `get_pos_property' as well. */ - || (NILP (get_pos_property (old_pos, inhibit_capture_property, Qnil)) + || (NILP (Fget_pos_property (old_pos, inhibit_capture_property, Qnil)) && (XFASTINT (old_pos) <= BEGV - || NILP (Fget_char_property (old_pos, inhibit_capture_property, Qnil)) - || NILP (Fget_char_property (prev_old, inhibit_capture_property, Qnil)))))) + || NILP (Fget_char_property + (old_pos, inhibit_capture_property, Qnil)) + || NILP (Fget_char_property + (prev_old, inhibit_capture_property, Qnil)))))) /* It is possible that NEW_POS is not within the same field as OLD_POS; try to move NEW_POS so that it is. */ { @@ -717,7 +718,7 @@ /* NEW_POS should be constrained, but only if either ONLY_IN_LINE is nil (in which case any constraint is OK), or NEW_POS and FIELD_BOUND are on the same line (in which - case the constraint is OK even if ONLY_IN_LINE is non-nil). */ + case the constraint is OK even if ONLY_IN_LINE is non-nil). */ && (NILP (only_in_line) /* This is the ONLY_IN_LINE case, check that NEW_POS and FIELD_BOUND are on the same line by seeing whether @@ -4836,6 +4837,7 @@ defsubr (&Sbuffer_substring); defsubr (&Sbuffer_substring_no_properties); defsubr (&Sbuffer_string); + defsubr (&Sget_pos_property); defsubr (&Spoint_marker); defsubr (&Smark_marker); === modified file 'src/intervals.c' --- src/intervals.c 2013-10-11 06:32:29 +0000 +++ src/intervals.c 2013-11-24 18:28:33 +0000 @@ -2232,7 +2232,7 @@ editing a field with a `local-map' property, we want insertion at the end to obey the `local-map' property. */ if (NILP (prop)) - prop = get_pos_property (lispy_position, type, lispy_buffer); + prop = Fget_pos_property (lispy_position, type, lispy_buffer); SET_BUF_BEGV_BOTH (buffer, old_begv, old_begv_byte); SET_BUF_ZV_BOTH (buffer, old_zv, old_zv_byte); === modified file 'src/intervals.h' --- src/intervals.h 2013-09-20 15:34:36 +0000 +++ src/intervals.h 2013-11-24 18:28:33 +0000 @@ -296,8 +296,6 @@ Lisp_Object, Lisp_Object*); extern int text_property_stickiness (Lisp_Object prop, Lisp_Object pos, Lisp_Object buffer); -extern Lisp_Object get_pos_property (Lisp_Object pos, Lisp_Object prop, - Lisp_Object object); extern void syms_of_textprop (void); === modified file 'src/keyboard.c' --- src/keyboard.c 2013-11-14 17:43:49 +0000 +++ src/keyboard.c 2013-11-24 18:28:33 +0000 @@ -1771,8 +1771,8 @@ than skip both boundaries. However, this code also stops anywhere in a non-sticky text-property, which breaks (e.g.) Org mode. */ - && (val = get_pos_property (make_number (end), - Qinvisible, Qnil), + && (val = Fget_pos_property (make_number (end), + Qinvisible, Qnil), TEXT_PROP_MEANS_INVISIBLE (val)) #endif && !NILP (val = get_char_property_and_overlay @@ -1789,8 +1789,8 @@ } while (beg > BEGV #if 0 - && (val = get_pos_property (make_number (beg), - Qinvisible, Qnil), + && (val = Fget_pos_property (make_number (beg), + Qinvisible, Qnil), TEXT_PROP_MEANS_INVISIBLE (val)) #endif && !NILP (val = get_char_property_and_overlay @@ -1843,12 +1843,12 @@ to the other end would mean moving backwards and thus could lead to an infinite loop. */ ; - else if (val = get_pos_property (make_number (PT), - Qinvisible, Qnil), + else if (val = Fget_pos_property (make_number (PT), + Qinvisible, Qnil), TEXT_PROP_MEANS_INVISIBLE (val) - && (val = get_pos_property - (make_number (PT == beg ? end : beg), - Qinvisible, Qnil), + && (val = (Fget_pos_property + (make_number (PT == beg ? end : beg), + Qinvisible, Qnil)), !TEXT_PROP_MEANS_INVISIBLE (val))) (check_composition = check_display = 1, SET_PT (PT == beg ? end : beg)); === modified file 'src/xterm.c' --- src/xterm.c 2013-11-12 06:07:37 +0000 +++ src/xterm.c 2013-11-24 18:28:33 +0000 @@ -5774,7 +5774,7 @@ *FINISH is X_EVENT_DROP if event should not be passed to the toolkit. *EVENT is unchanged unless we're processing KeyPress event. - We return the number of characters stored into the buffer. */ + We return the number of characters stored into the buffer. */ static int handle_one_xevent (struct x_display_info *dpyinfo, ------------------------------------------------------------ revno: 115211 committer: Stefan Monnier branch nick: trunk timestamp: Sun 2013-11-24 13:20:18 -0500 message: * src/data.c (Fmake_variable_buffer_local): Mention `permanent-local'. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2013-11-23 11:32:05 +0000 +++ src/ChangeLog 2013-11-24 18:20:18 +0000 @@ -1,3 +1,7 @@ +2013-11-24 Stefan Monnier + + * data.c (Fmake_variable_buffer_local): Mention `permanent-local'. + 2013-11-23 Romain Francoise * fileio.c (init_fileio): Move `write_region_inhibit_fsync' === modified file 'src/data.c' --- src/data.c 2013-11-21 06:46:59 +0000 +++ src/data.c 2013-11-24 18:20:18 +0000 @@ -1551,8 +1551,12 @@ a `let'-style binding made in this buffer is in effect, does not make the variable buffer-local. Return VARIABLE. -In most cases it is better to use `make-local-variable', -which makes a variable local in just one buffer. +This globally affects all uses of this variable, so it belongs together with +the variable declaration, rather than with its uses (if you just want to make +a variable local to the current buffer for one particular use, use +`make-local-variable'). Buffer-local bindings are normally cleared +while setting up a new major mode, unless they have a `permanent-local' +property. The function `default-value' gets the default value and `set-default' sets it. */) (register Lisp_Object variable) ------------------------------------------------------------ revno: 115210 committer: Jorgen Schaefer branch nick: trunk timestamp: Sun 2013-11-24 15:08:02 +0100 message: Scroll correct window when showing completion options. * minibuffer.el (completion--in-region-1): Scroll the correct window. (Bug#13898) diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-11-24 09:31:51 +0000 +++ lisp/ChangeLog 2013-11-24 14:08:02 +0000 @@ -1,3 +1,8 @@ +2013-11-24 Jorgen Schaefer + + * minibuffer.el (completion--in-region-1): Scroll the correct + window. (Bug#13898) + 2013-11-24 Bozhidar Batsov * emacs-lisp/helpers.el: Add some string helpers. === modified file 'lisp/minibuffer.el' --- lisp/minibuffer.el 2013-10-04 02:12:16 +0000 +++ lisp/minibuffer.el 2013-11-24 14:08:02 +0000 @@ -1067,7 +1067,8 @@ ;; If end is in view, scroll up to the beginning. (set-window-start window (point-min) nil) ;; Else scroll down one screen. - (scroll-other-window)) + (with-selected-window window + (scroll-up))) nil))) ;; If we're cycling, keep on cycling. ((and completion-cycling completion-all-sorted-completions) ------------------------------------------------------------ revno: 115209 committer: Bozhidar Batsov branch nick: master timestamp: Sun 2013-11-24 11:31:51 +0200 message: * lisp/emacs-lisp/helpers.el: Add some string helpers. (string-trim-left): Removes leading whitespace. (string-trim-right): Removes trailing whitespace. (string-trim): Removes leading and trailing whitespace. diff: === modified file 'etc/NEWS' --- etc/NEWS 2013-11-24 08:49:44 +0000 +++ etc/NEWS 2013-11-24 09:31:51 +0000 @@ -769,6 +769,9 @@ ** New library helpers.el for misc helper functions *** `hash-table-keys' *** `hash-table-values' +*** `string-trim-left' +*** `string-trim-right' +*** `string-trim' ** Obsoleted functions: *** `log10' === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-11-24 08:49:44 +0000 +++ lisp/ChangeLog 2013-11-24 09:31:51 +0000 @@ -1,5 +1,10 @@ 2013-11-24 Bozhidar Batsov + * emacs-lisp/helpers.el: Add some string helpers. + (string-trim-left): Removes leading whitespace. + (string-trim-right): Removes trailing whitespace. + (string-trim): Removes leading and trailing whitespace. + * subr.el (string-suffix-p): New function. 2013-11-23 Glenn Morris === modified file 'lisp/emacs-lisp/helpers.el' --- lisp/emacs-lisp/helpers.el 2013-11-04 19:25:09 +0000 +++ lisp/emacs-lisp/helpers.el 2013-11-24 09:31:51 +0000 @@ -37,6 +37,22 @@ (maphash (lambda (_k v) (push v values)) hash-table) values)) +(defsubst string-trim-left (string) + "Remove leading whitespace from STRING." + (if (string-match "\\`[ \t\n\r]+" string) + (replace-match "" t t string) + string)) + +(defsubst string-trim-right (string) + "Remove trailing whitespace from STRING." + (if (string-match "[ \t\n\r]+\\'" string) + (replace-match "" t t string) + string)) + +(defsubst string-trim (string) + "Remove leading and trailing whitespace from STRING." + (string-trim-left (string-trim-right string))) + (provide 'helpers) ;;; helpers.el ends here