commit fd93edbb1cabfdf0c732dbb0c6892a515b406a65 (HEAD, refs/remotes/origin/master) Author: Dima Kogan Date: Wed Mar 18 08:15:54 2015 +0100 Have gud-display-line not display source buffer in gud window. * lisp/progmodes/gud.el (gud-display-line): Make display-buffer not reuse selected window. (Bug#17675, Bug#19901, Bug#20034) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index e365346..d61a0a6 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,9 @@ +2015-03-18 Dima Kogan + + Have gud-display-line not display source buffer in gud window. + * lisp/progmodes/gud.el (gud-display-line): Make display-buffer + not reuse selected window. (Bug#17675, Bug#19901, Bug#20034) + 2015-03-17 Tassilo Horn * emacs-lisp/byte-run.el (macro-declarations-alist): New diff --git a/lisp/progmodes/gud.el b/lisp/progmodes/gud.el index 29a6dc6..9ab0667 100644 --- a/lisp/progmodes/gud.el +++ b/lisp/progmodes/gud.el @@ -2813,7 +2813,7 @@ Obeying it means displaying in another window the specified file and line." (gud-find-file true-file))) (window (and buffer (or (get-buffer-window buffer) - (display-buffer buffer)))) + (display-buffer buffer '(nil (inhibit-same-window . t)))))) (pos)) (when buffer (with-current-buffer buffer commit 9fdc166ee0ca212f7d5bf1cd9e1177932b0cd9aa Author: Tassilo Horn Date: Mon Mar 16 10:25:14 2015 +0100 Improve dynamic elisp keyword font-locking * emacs-lisp/byte-run.el (macro-declarations-alist): New declaration no-font-lock-keyword. (defmacro): Flush font-lock in existing elisp buffers. * emacs-lisp/lisp-mode.el (lisp--el-update-after-load) (lisp--el-update-macro-regexp, lisp--el-macro-regexp): Delete functions and defconst. (lisp--el-match-keyword): Rename from lisp--el-match-macro. (lisp--el-font-lock-flush-elisp-buffers): New function. (lisp-mode-variables): Remove code for updating lisp--el-macro-regexp, and add lisp--el-font-lock-flush-elisp-buffers to after-load-functions. diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 25571ba..e365346 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,18 @@ +2015-03-17 Tassilo Horn + + * emacs-lisp/byte-run.el (macro-declarations-alist): New + declaration no-font-lock-keyword. + (defmacro): Flush font-lock in existing elisp buffers. + + * emacs-lisp/lisp-mode.el (lisp--el-update-after-load) + (lisp--el-update-macro-regexp, lisp--el-macro-regexp): Delete + functions and defconst. + (lisp--el-match-keyword): Rename from lisp--el-match-macro. + (lisp--el-font-lock-flush-elisp-buffers): New function. + (lisp-mode-variables): Remove code for updating + lisp--el-macro-regexp, and add + lisp--el-font-lock-flush-elisp-buffers to after-load-functions. + 2015-03-17 Simen Heggestøyl * textmodes/css-mode.el (css--font-lock-keywords): Discriminate diff --git a/lisp/emacs-lisp/byte-run.el b/lisp/emacs-lisp/byte-run.el index caa7e3d..e0d6c3e 100644 --- a/lisp/emacs-lisp/byte-run.el +++ b/lisp/emacs-lisp/byte-run.el @@ -147,11 +147,16 @@ This is used by `declare'.") (defvar macro-declarations-alist (cons (list 'debug - #'(lambda (name _args spec) - (list 'progn :autoload-end - (list 'put (list 'quote name) - ''edebug-form-spec (list 'quote spec))))) - defun-declarations-alist) + #'(lambda (name _args spec) + (list 'progn :autoload-end + (list 'put (list 'quote name) + ''edebug-form-spec (list 'quote spec))))) + (cons + (list 'no-font-lock-keyword + #'(lambda (name _args val) + (list 'function-put (list 'quote name) + ''no-font-lock-keyword (list 'quote val)))) + defun-declarations-alist)) "List associating properties of macros to their macro expansion. Each element of the list takes the form (PROP FUN) where FUN is a function. For each (PROP . VALUES) in a macro's declaration, the FUN corresponding @@ -201,6 +206,19 @@ The return value is undefined. (message "Warning: Unknown macro property %S in %S" (car x) name)))) decls))) + ;; Refresh font-lock if this is a new macro, or it is an + ;; existing macro whose 'no-font-lock-keyword declaration + ;; has changed. + (if (and + ;; If lisp-mode hasn't been loaded, there's no reason + ;; to flush. + (fboundp 'lisp--el-font-lock-flush-elisp-buffers) + (or (not (fboundp name)) ;; new macro + (and (fboundp name) ;; existing macro + (member `(function-put ',name 'no-font-lock-keyword + ',(get name 'no-font-lock-keyword)) + declarations)))) + (lisp--el-font-lock-flush-elisp-buffers)) (if declarations (cons 'prog1 (cons def declarations)) def)))))) diff --git a/lisp/emacs-lisp/lisp-mode.el b/lisp/emacs-lisp/lisp-mode.el index b4f87fd..6b30773 100644 --- a/lisp/emacs-lisp/lisp-mode.el +++ b/lisp/emacs-lisp/lisp-mode.el @@ -181,32 +181,25 @@ nil))) res)) -(defconst lisp--el-macro-regexp nil - "A regular expression matching all loaded elisp macros. -Can be updated using `lisp--el-update-macro-regexp' after new -macros were defined.") - -(defun lisp--el-update-macro-regexp () - "Update `lisp--el-update-macro-regexp' from `obarray'. -Return non-nil only if the old and new value are different." - (let ((old-regex lisp--el-macro-regexp) - (elisp-macros nil)) - (mapatoms (lambda (a) - (when (or (macrop a) (special-form-p a)) - (push (symbol-name a) elisp-macros)))) - (setq lisp--el-macro-regexp - (concat "(" (regexp-opt elisp-macros t) "\\_>")) - (not (string= old-regex lisp--el-macro-regexp)))) - -(defun lisp--el-update-after-load (_file) - "Update `lisp--el-macro-regexp' and adjust font-lock in existing buffers." - (when (lisp--el-update-macro-regexp) +(defun lisp--el-match-keyword (limit) + (catch 'found + (while (re-search-forward "(\\(\\(?:\\sw\\|\\s_\\)+\\)\\_>" limit t) + (let ((sym (intern-soft (match-string 1)))) + (when (or (special-form-p sym) + (and (macrop sym) + (not (get sym 'no-font-lock-keyword)))) + (throw 'found t)))))) + +(defun lisp--el-font-lock-flush-elisp-buffers (&optional file) + ;; Don't flush during load unless called from after-load-functions. + ;; In that case, FILE is non-nil. It's somehow strange that + ;; load-in-progress is t when an after-load-function is called since + ;; that should run *after* the load... + (when (or (not load-in-progress) file) (dolist (buf (buffer-list)) - (when (derived-mode-p 'emacs-lisp-mode) - (font-lock-flush))))) - -(defun lisp--el-match-macro (limit) - (re-search-forward lisp--el-macro-regexp limit t)) + (with-current-buffer buf + (when (derived-mode-p 'emacs-lisp-mode) + (font-lock-flush)))))) (pcase-let ((`(,vdefs ,tdefs @@ -362,7 +355,7 @@ Return non-nil only if the old and new value are different." `( ;; Regexp negated char group. ("\\[\\(\\^\\)" 1 font-lock-negation-char-face prepend) ;; Control structures. Common Lisp forms. - (lisp--el-match-macro . 1) + (lisp--el-match-keyword . 1) ;; Exit/Feature symbols as constants. (,(concat "(\\(catch\\|throw\\|featurep\\|provide\\|require\\)\\_>" "[ \t']*\\(\\(?:\\sw\\|\\s_\\)+\\)?") @@ -543,9 +536,7 @@ font-lock keywords will not be case sensitive." . lisp-font-lock-syntactic-face-function))) (setq-local prettify-symbols-alist lisp--prettify-symbols-alist) (when elisp - (unless lisp--el-macro-regexp - (lisp--el-update-macro-regexp)) - (add-hook 'after-load-functions #'lisp--el-update-after-load) + (add-hook 'after-load-functions #'lisp--el-font-lock-flush-elisp-buffers) (setq-local electric-pair-text-pairs (cons '(?\` . ?\') electric-pair-text-pairs))) (setq-local electric-pair-skip-whitespace 'chomp) commit 1a93b9145d6f6aadb75f51eeb8d7b5bc45f06940 Author: Paul Eggert Date: Tue Mar 17 20:55:02 2015 -0700 * lisp/net/browse-url.el: Omit confusing documentation. diff --git a/lisp/net/browse-url.el b/lisp/net/browse-url.el index dff587e..b44bb71 100644 --- a/lisp/net/browse-url.el +++ b/lisp/net/browse-url.el @@ -862,8 +862,7 @@ first, if that exists." ;;;###autoload (defun browse-url-at-point (&optional arg) "Ask a WWW browser to load the URL at or before point. -Don't let you edit the URL like `browse-url'. Variable -`browse-url-browser-function' says which browser to use." +Variable `browse-url-browser-function' says which browser to use." (interactive "P") (let ((url (browse-url-url-at-point))) (if url @@ -876,9 +875,8 @@ Don't let you edit the URL like `browse-url'. Variable (defun browse-url-at-mouse (event) "Ask a WWW browser to load a URL clicked with the mouse. The URL is the one around or before the position of the mouse click -but point is not changed. Don't let you edit the URL like -`browse-url'. Variable `browse-url-browser-function' says which browser -to use." +but point is not changed. Variable `browse-url-browser-function' +says which browser to use." (interactive "e") (save-excursion (mouse-set-point event) commit f9e354ebea34aeb1ef47b13ad77f670c7acb5b13 Author: Paul Eggert Date: Tue Mar 17 17:09:34 2015 -0700 Spelling and wording fixes diff --git a/lisp/net/browse-url.el b/lisp/net/browse-url.el index 4b64d95..dff587e 100644 --- a/lisp/net/browse-url.el +++ b/lisp/net/browse-url.el @@ -42,7 +42,7 @@ ;; browse-url-netscape Netscape 1.1b1 ;; browse-url-mosaic XMosaic/mMosaic <= 2.4 ;; browse-url-cci XMosaic 2.5 -;; browse-url-conkeror Conkeror Dont know +;; browse-url-conkeror Conkeror Don't know ;; browse-url-w3 w3 0 ;; browse-url-w3-gnudoit w3 remotely ;; browse-url-text-* Any text browser 0 @@ -62,7 +62,7 @@ ;; control. . ;; Browsers can cache Web pages so it may be necessary to tell them to -;; reload the current page if it has changed (e.g. if you have edited +;; reload the current page if it has changed (e.g., if you have edited ;; it). There is currently no perfect automatic solution to this. ;; Netscape allows you to specify the id of the window you want to @@ -420,8 +420,8 @@ functionality is not available there." (defcustom browse-url-conkeror-new-window-is-buffer nil "Whether to open up new windows in a buffer or a new window. -If non-nill, then open the URL in a new buffer rather than a new window if -`browse-url-conkeror' is asked to open it in a new window" +If non-nil, then open the URL in a new buffer rather than a new window if +`browse-url-conkeror' is asked to open it in a new window." :type 'boolean :group 'browse-url) @@ -823,7 +823,7 @@ narrowed." ;;;###autoload (defun browse-url (url &rest args) "Ask a WWW browser to load URL. -Prompts for a URL, defaulting to the URL at or before point. Variable +Prompt for a URL, defaulting to the URL at or before point. Variable `browse-url-browser-function' says which browser to use. If the URL is a mailto: URL, consult `browse-url-mailto-function' first, if that exists." @@ -862,7 +862,7 @@ first, if that exists." ;;;###autoload (defun browse-url-at-point (&optional arg) "Ask a WWW browser to load the URL at or before point. -Doesn't let you edit the URL like `browse-url'. Variable +Don't let you edit the URL like `browse-url'. Variable `browse-url-browser-function' says which browser to use." (interactive "P") (let ((url (browse-url-url-at-point))) @@ -876,7 +876,7 @@ Doesn't let you edit the URL like `browse-url'. Variable (defun browse-url-at-mouse (event) "Ask a WWW browser to load a URL clicked with the mouse. The URL is the one around or before the position of the mouse click -but point is not changed. Doesn't let you edit the URL like +but point is not changed. Don't let you edit the URL like `browse-url'. Variable `browse-url-browser-function' says which browser to use." (interactive "e") @@ -1384,20 +1384,21 @@ used instead of `browse-url-new-window-flag'." ;;;###autoload (defun browse-url-conkeror (url &optional new-window) "Ask the Conkeror WWW browser to load URL. -Default to the URL around or before point. The strings in the variable -`browse-url-conkeror-arguments' are also passed to Conkeror. +Default to the URL around or before point. Also pass the strings +in the variable `browse-url-conkeror-arguments' to Conkeror. -When called interactively, if variable `browse-url-new-window-flag' -is non-nil, load the document in a new Conkeror window, otherwise use a random -existing one. A non-nil interactive prefix argument reverses the effect of -`browse-url-new-window-flag' +When called interactively, if variable +`browse-url-new-window-flag' is non-nil, load the document in a +new Conkeror window, otherwise use a random existing one. A +non-nil interactive prefix argument reverses the effect of +`browse-url-new-window-flag'. -If `browse-url-conkeror-new-window-is-buffer' then whenever a document would -otherwise be loaded in a new window, it is loaded in a new buffer in an existing -window instead. +If variable `browse-url-conkeror-new-window-is-buffer' is +non-nil, then whenever a document would otherwise be loaded in a +new window, load it in a new buffer in an existing window instead. -When called non-interatively, optional second argument NEW-WINDOW is used instead of -`browse-url-new-window-flag'" +When called non-interactively, use optional second argument +NEW-WINDOW instead of `browse-url-new-window-flag'." (interactive (browse-url-interactive-arg "URL: ")) (setq url (browse-url-encode-url url)) (let* ((process-environment (browse-url-process-environment))) @@ -1495,7 +1496,7 @@ used instead of `browse-url-new-window-flag'." (n browse-url-text-input-attempts)) (require 'term) (if (and (browse-url-maybe-new-window new-buffer) buf) - ;; Rename away the OLD buffer. This isn't very polite, but + ;; Rename away the OLD buffer. This isn't very polite, but ;; term insists on working in a buffer named *lynx* and would ;; choke on *lynx*<1> (progn (set-buffer buf) diff --git a/lisp/textmodes/css-mode.el b/lisp/textmodes/css-mode.el index e3578f9..3e7612a 100644 --- a/lisp/textmodes/css-mode.el +++ b/lisp/textmodes/css-mode.el @@ -364,7 +364,7 @@ (defun css-completion-at-point () "Complete current symbol at point. Currently supports completion of CSS properties, pseudo-elements, -pesudo-classes, and at-rules." +pseudo-classes, and at-rules." (or (css--complete-property) (css--complete-pseudo-element-or-class) (css--complete-at-rule))) commit 41278b775bd3ebc213ff8b9eda2f2c04a5354bba Author: Paul Eggert Date: Tue Mar 17 16:55:02 2015 -0700 Spacing and punctuation fixes diff --git a/doc/emacs/ack.texi b/doc/emacs/ack.texi index f97964b..151c3f1 100644 --- a/doc/emacs/ack.texi +++ b/doc/emacs/ack.texi @@ -204,7 +204,7 @@ for Korean Hanja. @item Andrew Choi and Yamamoto Mitsuharu wrote the Carbon support, used -prior to Emacs 23 for Mac OS. Yamamoto Mitsuharu continued to +prior to Emacs 23 for Mac OS@. Yamamoto Mitsuharu continued to contribute to Mac OS support in the newer Nextstep port; and also improved support for multi-monitor displays. diff --git a/doc/emacs/buffers.texi b/doc/emacs/buffers.texi index 88a122c..25b13d6 100644 --- a/doc/emacs/buffers.texi +++ b/doc/emacs/buffers.texi @@ -642,7 +642,7 @@ the directory names in reverse order, so that @file{/top/middle/file} becomes @samp{file\middle\top}, while @code{post-forward} puts them in forward order after the file name, as in @samp{file|top/middle}. If @code{uniquify-buffer-name-style} is set to @code{nil}, the buffer -names simply get @samp{<2>}, @samp{<3>}, etc. appended. +names simply get @samp{<2>}, @samp{<3>}, etc.@: appended. Which rule to follow for putting the directory names in the buffer name is not very important if you are going to @emph{look} at the diff --git a/doc/emacs/display.texi b/doc/emacs/display.texi index ae723b8..38acc20 100644 --- a/doc/emacs/display.texi +++ b/doc/emacs/display.texi @@ -138,7 +138,7 @@ instructs the scrolling commands not to fontify (@pxref{Font Lock}) any unfontified text they scroll over, instead to assume it has the default face. This can cause Emacs to scroll to somewhat wrong buffer positions when the faces in use are not all the same size, even with -single (i.e. without auto-repeat) scrolling operations. +single (i.e., without auto-repeat) scrolling operations. @vindex scroll-up @vindex scroll-down diff --git a/doc/emacs/frames.texi b/doc/emacs/frames.texi index b5b9dbd..f401c8f 100644 --- a/doc/emacs/frames.texi +++ b/doc/emacs/frames.texi @@ -955,7 +955,7 @@ bar width, change the @code{scroll-bar-width} frame parameter @cindex overscrolling If you're using Emacs on X (with GTK+ or Motif), you can customize the variable @code{scroll-bar-adjust-thumb-portion} to control -@dfn{overscrolling} of the scroll bar, i.e. dragging the thumb down even +@dfn{overscrolling} of the scroll bar, i.e., dragging the thumb down even when the end of the buffer is visible. If its value is non-@code{nil}, the scroll bar can be dragged downwards even if the end of the buffer is shown; if @code{nil}, the thumb will be at the diff --git a/doc/emacs/killing.texi b/doc/emacs/killing.texi index 3092d34..4b90bf4 100644 --- a/doc/emacs/killing.texi +++ b/doc/emacs/killing.texi @@ -848,7 +848,7 @@ shifting the original text to the right. The command @kbd{C-x @key{SPC}} (@code{rectangle-mark-mode}) toggles whether the region-rectangle or the standard region is highlighted (first activating the region if necessary). When this mode is enabled, -commands that resize the region (@kbd{C-f}, @kbd{C-n} etc.) do +commands that resize the region (@kbd{C-f}, @kbd{C-n} etc.)@: do so in a rectangular fashion, and killing and yanking operate on the rectangle. @xref{Killing}. The mode persists only as long as the region is active. diff --git a/doc/emacs/mule.texi b/doc/emacs/mule.texi index f8b06bd..a80f942 100644 --- a/doc/emacs/mule.texi +++ b/doc/emacs/mule.texi @@ -266,7 +266,7 @@ for more information about the language environment @var{lang-env}. Supported language environments include: @c @cindex entries below are split between portions of the list to -@c make them more accurate, i.e. land on the line that mentions the +@c make them more accurate, i.e., land on the line that mentions the @c language. However, makeinfo 4.x doesn't fill inside @quotation @c lines that follow a @cindex entry and whose text has no whitespace. @c To work around, we group the language environments together, so diff --git a/doc/emacs/trouble.texi b/doc/emacs/trouble.texi index 2faa5d9..22ec215 100644 --- a/doc/emacs/trouble.texi +++ b/doc/emacs/trouble.texi @@ -342,7 +342,7 @@ Here, @var{backtrace} is the name of a text file containing a copy of the backtrace, @var{bindir} is the name of the directory that contains the Emacs executable, and @var{emacs-binary} is the name of the Emacs executable file, normally @file{emacs} on GNU and Unix -systems and @file{emacs.exe} on MS-Windows and MS-DOS. Omit the +systems and @file{emacs.exe} on MS-Windows and MS-DOS@. Omit the @option{-p} option if your version of @command{addr2line} is too old to have it. @@ -1142,7 +1142,7 @@ making diffs of C code. This shows the name of the function that each change occurs in. If you are using the Emacs repository, make sure your copy is -up-to-date (e.g. with @code{git pull}). You can commit your changes +up-to-date (e.g., with @code{git pull}). You can commit your changes to a private branch and generate a patch from the master version by using @code{git format-patch master}. Or you can leave your changes uncommitted and use @code{git diff}. @@ -1173,7 +1173,7 @@ explanation in comments in the code. It will be more useful there. Please look at the change log entries of recent commits to see what sorts of information to put in, and to learn the style that we use. Note that, unlike some other projects, we do require change logs for -documentation, i.e. Texinfo files. +documentation, i.e., Texinfo files. @xref{Change Log}, @ifset WWW_GNU_ORG see @@ -1389,7 +1389,7 @@ user freedom and to defend the rights of all free software users. For general information, see the website @url{http://www.fsf.org/}. Generally speaking, for non-trivial contributions to GNU Emacs we -require that the copyright be assigned to the FSF. For the reasons +require that the copyright be assigned to the FSF@. For the reasons behind this, see @url{http://www.gnu.org/licenses/why-assign.html}. Copyright assignment is a simple process. Residents of some countries @@ -1408,7 +1408,7 @@ is not enough). Also, a disclaimer cannot be applied to future work, it has to be repeated each time you want to send something new. We can accept small changes (roughly, fewer than 15 lines) without -an assignment. This is a cumulative limit (e.g. three separate 5 line +an assignment. This is a cumulative limit (e.g., three separate 5 line patches) over all your contributions. @node Service diff --git a/doc/lispintro/emacs-lisp-intro.texi b/doc/lispintro/emacs-lisp-intro.texi index b6eff2d..c67623d 100644 --- a/doc/lispintro/emacs-lisp-intro.texi +++ b/doc/lispintro/emacs-lisp-intro.texi @@ -387,7 +387,7 @@ Truth and Falsehood in Emacs Lisp * Point and mark:: A review of various locations. * Template for save-excursion:: -A Few Buffer--Related Functions +A Few Buffer-Related Functions * Finding More:: How to find more information. * simplified-beginning-of-buffer:: Shows @code{goto-char}, @@ -4547,7 +4547,7 @@ and if so, prints an appropriate message. @end itemize @node Buffer Walk Through -@chapter A Few Buffer--Related Functions +@chapter A Few Buffer-Related Functions In this chapter we study in detail several of the functions used in GNU Emacs. This is called a ``walk-through''. These functions are used as @@ -12114,7 +12114,7 @@ Internet, see @uref{http://www.gnu.org/software/texinfo/manual/texinfo/} @end ifhtml @iftex -``Indicating Definitions, Commands, etc.'' in @cite{Texinfo, The GNU +``Indicating Definitions, Commands, etc.''@: in @cite{Texinfo, The GNU Documentation Format}. @end iftex @end itemize diff --git a/doc/lispref/commands.texi b/doc/lispref/commands.texi index 6fdc8e2..b81d0f8 100644 --- a/doc/lispref/commands.texi +++ b/doc/lispref/commands.texi @@ -132,7 +132,7 @@ byte compiler to warn if the command is called from Lisp. The output of @code{describe-function} will include similar information. The value of the property can be: a string, which the byte-compiler will use directly in its warning (it should end with a period, and not -start with a capital, e.g. ``use @dots{} instead.''); @code{t}; any +start with a capital, e.g., ``use @dots{} instead.''); @code{t}; any other symbol, which should be an alternative function to use in Lisp code. @@ -1043,8 +1043,8 @@ the current Emacs session. If a symbol has not yet been so used, @end defun @menu -* Keyboard Events:: Ordinary characters--keys with symbols on them. -* Function Keys:: Function keys--keys with names, not symbols. +* Keyboard Events:: Ordinary characters -- keys with symbols on them. +* Function Keys:: Function keys -- keys with names, not symbols. * Mouse Events:: Overview of mouse events. * Click Events:: Pushing and releasing a mouse button. * Drag Events:: Moving the mouse before releasing the button. diff --git a/doc/lispref/display.texi b/doc/lispref/display.texi index 5dd74d2..b73e70d 100644 --- a/doc/lispref/display.texi +++ b/doc/lispref/display.texi @@ -2154,7 +2154,7 @@ stipple patterns. Alternative foreground color, a string. This is like @code{:foreground} but the color is only used as a foreground when the background color is near to the foreground that would have been used. This is useful for -example when marking text (i.e. the region face). If the text has a foreground +example when marking text (i.e., the region face). If the text has a foreground that is visible with the region face, that foreground is used. If the foreground is near the region face background, @code{:distant-foreground} is used instead so the text is readable. diff --git a/doc/lispref/elisp.texi b/doc/lispref/elisp.texi index fc552be..fc8ba7b 100644 --- a/doc/lispref/elisp.texi +++ b/doc/lispref/elisp.texi @@ -753,8 +753,8 @@ Defining Commands Input Events -* Keyboard Events:: Ordinary characters--keys with symbols on them. -* Function Keys:: Function keys--keys with names, not symbols. +* Keyboard Events:: Ordinary characters -- keys with symbols on them. +* Function Keys:: Function keys -- keys with names, not symbols. * Mouse Events:: Overview of mouse events. * Click Events:: Pushing and releasing a mouse button. * Drag Events:: Moving the mouse before releasing the button. diff --git a/doc/lispref/frames.texi b/doc/lispref/frames.texi index 0b8106d..85695c6 100644 --- a/doc/lispref/frames.texi +++ b/doc/lispref/frames.texi @@ -360,7 +360,7 @@ coordinates might be negative. Position of the top-left corner and size of the work area (``usable'' space) in pixels as @samp{(@var{x} @var{y} @var{width} @var{height})}. This may be different from @samp{geometry} in that space occupied by -various window manager features (docks, taskbars, etc.) may be +various window manager features (docks, taskbars, etc.)@: may be excluded from the work area. Whether or not such features actually subtract from the work area depends on the platform and environment. Again, if the monitor is not the primary monitor, some of the @@ -1218,7 +1218,7 @@ These functions return the canonical height and width of a character in @var{frame}, measured in pixels. Together, these values establish the size of the default font on @var{frame}. The values depend on the choice of font for @var{frame}, see @ref{Font and Color Parameters}. -@end defun +@end defun The default font can be also set directly with the following function: diff --git a/doc/lispref/functions.texi b/doc/lispref/functions.texi index 40b8322..a853d2f 100644 --- a/doc/lispref/functions.texi +++ b/doc/lispref/functions.texi @@ -1222,7 +1222,7 @@ This macro is the handy way to add the advice @var{function} to the function stored in @var{place} (@pxref{Generalized Variables}). @var{where} determines how @var{function} is composed with the -existing function, e.g. whether @var{function} should be called before, or +existing function, e.g., whether @var{function} should be called before, or after the original function. @xref{Advice combinators}, for the list of available ways to compose the two functions. @@ -1310,7 +1310,7 @@ and its properties. @defun advice-eval-interactive-spec spec Evaluate the interactive @var{spec} just like an interactive call to a function with such a spec would, and then return the corresponding list of arguments -that was built. E.g. @code{(advice-eval-interactive-spec "r\nP")} will +that was built. E.g., @code{(advice-eval-interactive-spec "r\nP")} will return a list of three elements, containing the boundaries of the region and the current prefix argument. @end defun diff --git a/doc/lispref/internals.texi b/doc/lispref/internals.texi index 2627ab7..a5fff72 100644 --- a/doc/lispref/internals.texi +++ b/doc/lispref/internals.texi @@ -1624,7 +1624,7 @@ similar advice may apply to the unsigned counterparts (e.g., of @code{intptr_t}). @item -Prefer @code{int} for Emacs character codes, in the range 0 ..@: 0x3FFFFF. +Prefer @code{int} for Emacs character codes, in the range 0 ..@: 0x3FFFFF@. More generally, prefer @code{int} for integers known to be in @code{int} range, e.g., screen column counts. diff --git a/doc/lispref/loading.texi b/doc/lispref/loading.texi index cf2f000..0ae8fbd 100644 --- a/doc/lispref/loading.texi +++ b/doc/lispref/loading.texi @@ -95,7 +95,7 @@ suffix), unless it contains an explicit directory name. If the option @code{load-prefer-newer} is non-@code{nil}, then when searching suffixes, @code{load} selects whichever version of a file -(@samp{.elc}, @samp{.el}, etc.) has been modified most recently. +(@samp{.elc}, @samp{.el}, etc.)@: has been modified most recently. If @var{filename} is a relative file name, such as @file{foo} or @file{baz/foo.bar}, @code{load} searches for the file using the variable diff --git a/doc/lispref/minibuf.texi b/doc/lispref/minibuf.texi index 82039ba..4fec757 100644 --- a/doc/lispref/minibuf.texi +++ b/doc/lispref/minibuf.texi @@ -102,7 +102,7 @@ the minibuffer is in a separate frame. @xref{Minibuffers and Frames}. When Emacs is running in batch mode, any request to read from the minibuffer actually reads a line from the standard input descriptor that was supplied when Emacs was started. This supports only basic input: -none of the special minibuffer features (history, completion, etc.) +none of the special minibuffer features (history, completion, etc.)@: are available in batch mode. @node Text from Minibuffer diff --git a/doc/lispref/numbers.texi b/doc/lispref/numbers.texi index 1ee7050..8d1d3a7 100644 --- a/doc/lispref/numbers.texi +++ b/doc/lispref/numbers.texi @@ -261,7 +261,7 @@ If @var{x} is finite, then @var{s} is a floating-point number between 0.5 @math{x = s 2^e}. @end tex If @var{x} is zero or infinity, then @var{s} is the same as @var{x}. -If @var{x} is a NaN, then @var{s} is also a NaN. +If @var{x} is a NaN, then @var{s} is also a NaN@. If @var{x} is zero, then @var{e} is 0. @end defun diff --git a/doc/lispref/streams.texi b/doc/lispref/streams.texi index e52a543..dfad2d8 100644 --- a/doc/lispref/streams.texi +++ b/doc/lispref/streams.texi @@ -344,7 +344,7 @@ When reading or writing from the standard input/output streams of the Emacs process in batch mode, it is sometimes required to make sure any arbitrary binary data will be read/written verbatim, and/or that no translation of newlines to or from CR-LF pairs are performed. This -issue does not exist on Posix hosts, only on MS-Windows and MS-DOS. +issue does not exist on Posix hosts, only on MS-Windows and MS-DOS@. The following function allows to control the I/O mode of any standard stream of the Emacs process. diff --git a/doc/lispref/text.texi b/doc/lispref/text.texi index a7cfb22..da67ec2 100644 --- a/doc/lispref/text.texi +++ b/doc/lispref/text.texi @@ -811,7 +811,7 @@ Delete trailing whitespace in the region defined by @var{start} and This command deletes whitespace characters after the last non-whitespace character in each line in the region. -If this command acts on the entire buffer (i.e. if called +If this command acts on the entire buffer (i.e., if called interactively with the mark inactive, or called from Lisp with @var{end} @code{nil}), it also deletes all trailing lines at the end of the buffer if the variable @code{delete-trailing-lines} is non-@code{nil}. @@ -2720,7 +2720,7 @@ text properties are considered, since strings never have overlays. @defun get-pos-property position prop &optional object This function is like @code{get-char-property}, except that it pays attention to properties' stickiness and overlays' advancement settings -instead of the property of the character at (i.e. right after) +instead of the property of the character at (i.e., right after) @var{position}. @end defun diff --git a/doc/misc/auth.texi b/doc/misc/auth.texi index 8dbde4d..7a2fd9b 100644 --- a/doc/misc/auth.texi +++ b/doc/misc/auth.texi @@ -111,9 +111,9 @@ You can use spaces inside a password or other token by surrounding the token with either single or double quotes. You can use single quotes inside a password or other token by -surrounding it with double quotes, e.g. @code{"he'llo"}. Similarly you +surrounding it with double quotes, e.g., @code{"he'llo"}. Similarly you can use double quotes inside a password or other token by surrounding -it with single quotes, e.g. @code{'he"llo'}. You can't mix both (so a +it with single quotes, e.g., @code{'he"llo'}. You can't mix both (so a password or other token can't have both single and double quotes). All this is optional. You could just say (but we don't recommend it, diff --git a/doc/misc/calc.texi b/doc/misc/calc.texi index 30e39c4..62a81b8 100644 --- a/doc/misc/calc.texi +++ b/doc/misc/calc.texi @@ -36800,7 +36800,7 @@ desired function, or with @kbd{x} or @kbd{z} followed by a function name, or with @kbd{$} to take a formula from the top of the stack, or with @kbd{'} and a typed formula. In the last two cases, the formula may be a nameless function like @samp{<#1+#2>} or @samp{}, or it -may include @kbd{$}, @kbd{$$}, etc. (where @kbd{$} will correspond to the +may include @kbd{$}, @kbd{$$}, etc.@: (where @kbd{$} will correspond to the last argument of the created function), or otherwise you will be prompted for an argument list. The number of vectors popped from the stack by @kbd{V M} depends on the number of arguments of the function. diff --git a/doc/misc/cc-mode.texi b/doc/misc/cc-mode.texi index 1b79640..068706a 100644 --- a/doc/misc/cc-mode.texi +++ b/doc/misc/cc-mode.texi @@ -1038,7 +1038,7 @@ Movement}. They might be removed from a future release of @ccmode{}. Since there's a lot of normal text in comments and string literals, @ccmode{} provides features to edit these like in text mode. The goal is to do it seamlessly, i.e., you can use auto fill mode, sentence and -paragraph movement, paragraph filling, adaptive filling etc. wherever +paragraph movement, paragraph filling, adaptive filling etc.@: wherever there's a piece of normal text without having to think much about it. @ccmode{} keeps the indentation, fixes suitable comment line prefixes, and so on. @@ -7140,7 +7140,7 @@ of XEmacs since 19.16. Due to release schedule skew, it is likely that all of these Emacsen have old versions of @ccmode{} and so should be upgraded. Access to the @ccmode{} source code, as well as more detailed information on Emacsen -compatibility, etc. are all available on the web site: +compatibility, etc.@: are all available on the web site: @quotation @uref{http://cc-mode.sourceforge.net/} diff --git a/doc/misc/eieio.texi b/doc/misc/eieio.texi index 3f42862..f17fd31 100644 --- a/doc/misc/eieio.texi +++ b/doc/misc/eieio.texi @@ -178,7 +178,7 @@ error. @ref{Signals}. First off, please note that this manual cannot serve as a complete introduction to object oriented programming and generic functions in -LISP. Although EIEIO is not a complete implementation of the Common +LISP@. Although EIEIO is not a complete implementation of the Common Lisp Object System (CLOS) and also differs from it in several aspects, it follows the same basic concepts. Therefore, it is highly recommended to learn those from a textbook or tutorial first, diff --git a/doc/misc/erc.texi b/doc/misc/erc.texi index 2f4ffae..3a86e1b 100644 --- a/doc/misc/erc.texi +++ b/doc/misc/erc.texi @@ -716,8 +716,8 @@ stuff, to the current ERC buffer." (setq erc-autojoin-channels-alist '(("freenode.net" "#emacs" "#erc"))) ;; Rename server buffers to reflect the current network name instead -;; of SERVER:PORT. (e.g. "freenode" instead of "irc.freenode.net:6667"). This -;; is useful when using a bouncer like ZNC where you have multiple +;; of SERVER:PORT (e.g., "freenode" instead of "irc.freenode.net:6667"). +;; This is useful when using a bouncer like ZNC where you have multiple ;; connections to the same server. (setq erc-rename-buffers t) @@ -780,7 +780,7 @@ or if you have bugs to report, there are several places you can go. @item @uref{http://www.emacswiki.org/cgi-bin/wiki/ERC} is the -emacswiki.org page for ERC@. Anyone may add tips, hints, etc. to it. +emacswiki.org page for ERC@. Anyone may add tips, hints, etc.@: to it. @item You can ask questions about using ERC on the Emacs mailing list, diff --git a/doc/misc/eshell.texi b/doc/misc/eshell.texi index ca90573..6d57a78 100644 --- a/doc/misc/eshell.texi +++ b/doc/misc/eshell.texi @@ -649,7 +649,7 @@ Programs that need a terminal to display output properly are referred to in this manual as ``visual commands,'' because they are not simply line-oriented. You must tell Eshell which commands are visual, by adding them to @code{eshell-visual-commands}; for commands that are -visual for only certain @emph{sub}-commands -- e.g. @samp{git log} but +visual for only certain @emph{sub}-commands -- e.g., @samp{git log} but not @samp{git status} -- use @code{eshell-visual-subcommands}; and for commands that are visual only when passed certain options, use @code{eshell-visual-options}. diff --git a/doc/misc/eww.texi b/doc/misc/eww.texi index f60354d..c7f84b5 100644 --- a/doc/misc/eww.texi +++ b/doc/misc/eww.texi @@ -126,7 +126,7 @@ specified in @code{eww-download-directory} (Default: @file{~/Downloads/}). @cindex History EWW remembers the URLs you have visited to allow you to go back and forth between them. By pressing @kbd{l} (@code{eww-back-url}) you go -to the previous URL. You can go forward again with @kbd{r} +to the previous URL@. You can go forward again with @kbd{r} (@code{eww-forward-url}). If you want an overview of your browsing history press @kbd{H} (@code{eww-list-histories}) to open the history buffer @file{*eww history*}. The history is lost when EWW is quit. @@ -247,7 +247,7 @@ Sessions, , emacs, The GNU Emacs Manual}. @vindex eww-desktop-remove-duplicates EWW history may sensibly contain multiple entries for the same page -URI. At run-time, these entries may still have different associated +URI@. At run-time, these entries may still have different associated point positions or the actual Web page contents. The latter, however, tend to be overly large to preserve in the desktop file, so they get omitted, thus rendering the respective diff --git a/doc/misc/gnus.texi b/doc/misc/gnus.texi index d714656..ed4d1a5 100644 --- a/doc/misc/gnus.texi +++ b/doc/misc/gnus.texi @@ -11482,7 +11482,7 @@ who wrote the article, the date it was written and the subject of the article. That's well and nice, but there's also lots of information most people do not want to see---what systems the article has passed through before reaching you, the @code{Message-ID}, the -@code{References}, etc. ad nauseam---and you'll probably want to get rid +@code{References}, etc.@: ad nauseam---and you'll probably want to get rid of some of those lines. If you want to keep all those lines in the article buffer, you can set @code{gnus-show-all-headers} to @code{t}. @@ -25905,7 +25905,7 @@ Store custom flags and keywords The registry can store custom flags and keywords for a message. For instance, you can mark a message ``To-Do'' this way and the flag will persist whether the message is in the nnimap, nnml, nnmaildir, -etc. backends. +etc.@: backends. @item Store arbitrary data @@ -25988,7 +25988,7 @@ registry will be pruned back to less than @code{gnus-registry-max-entries}. This option controls exactly how much less: the target is calculated as the maximum number of entries minus the maximum number times this factor. The default is 0.1: -i.e. if your registry is limited to 50000 entries, pruning will try to +i.e., if your registry is limited to 50000 entries, pruning will try to cut back to 45000 entries. Entries with keys marked as precious will not be pruned. @end defvar diff --git a/doc/misc/htmlfontify.texi b/doc/misc/htmlfontify.texi index 630b5f7..6579cd6 100644 --- a/doc/misc/htmlfontify.texi +++ b/doc/misc/htmlfontify.texi @@ -839,7 +839,7 @@ See @ref{hfy-display-class} for details of valid values for @var{class}. (hfy-face-at P) @end lisp -Find face in effect at point P. If overlays are to be considered +Find face in effect at point P@. If overlays are to be considered (see @ref{hfy-optimisations}) then this may return a @code{defface} style list of face properties instead of a face symbol. @@ -1418,7 +1418,7 @@ Add @samp{
} tags around the fontified body. a page with different colors than the fontified code.) @item keep-overlays -Preserve overlay highlighting (c.f. @code{ediff} or @code{goo-font-lock}) +Preserve overlay highlighting (cf.@: @code{ediff} or @code{goo-font-lock}) as well as basic faces. Can result in extremely verbose highlighting if there are many overlays (as is the case with @code{goo-font-lock}). diff --git a/doc/misc/idlwave.texi b/doc/misc/idlwave.texi index 1858a51..7cf9673 100644 --- a/doc/misc/idlwave.texi +++ b/doc/misc/idlwave.texi @@ -1010,7 +1010,7 @@ Non-@code{nil} means use last match on line for @cindex Highlighting of syntax @cindex Font lock -Highlighting of keywords, comments, strings etc. can be accomplished +Highlighting of keywords, comments, strings etc.@: can be accomplished with @code{font-lock}. If you are using @code{global-font-lock-mode} (in Emacs), or have @code{font-lock} turned on in any other buffer in XEmacs, it should also automatically work in IDLWAVE buffers. If you'd @@ -3111,7 +3111,7 @@ window, but is useful for immediate stepping, etc. @kindex C-c C-d C-p Do you find yourself repeatedly typing, e.g., @code{print,n_elements(x)}, and similar statements to remind yourself of the -type/size/structure/value/etc. of variables and expressions in your code +type/size/structure/value/etc.@: of variables and expressions in your code or at the command line? IDLWAVE has a suite of special commands to automate these types of variable or expression examinations. They work by sending statements to the shell formatted to include the indicated diff --git a/doc/misc/ido.texi b/doc/misc/ido.texi index 25380c0..a80620f 100644 --- a/doc/misc/ido.texi +++ b/doc/misc/ido.texi @@ -305,7 +305,7 @@ the files in that directory, simply move the directory to the head of the list and hit @key{RET}. To go up to the parent directory, delete any partial file name already -specified (e.g. using @key{DEL}) and hit @key{DEL}. +specified (e.g., using @key{DEL}) and hit @key{DEL}. @c @deffn Command ido-delete-backward-updir diff --git a/doc/misc/newsticker.texi b/doc/misc/newsticker.texi index a9ebc20..aa1ad72 100644 --- a/doc/misc/newsticker.texi +++ b/doc/misc/newsticker.texi @@ -123,7 +123,7 @@ You may select any number of feeds from this list of (sample) news feeds. @vindex newsticker-url-list @item newsticker-url-list All your personal news feeds are defined here. Each feed is -identified by its name and an URL. You may set the start-time and the +identified by its name and an URL@. You may set the start-time and the retrieval interval for each feed as well as the retrieval command arguments in case that the default values do not fit a certain feed. diff --git a/doc/misc/org.texi b/doc/misc/org.texi index 2cb80ab..d2721f6 100644 --- a/doc/misc/org.texi +++ b/doc/misc/org.texi @@ -891,7 +891,7 @@ Recent Emacs distributions include a packaging system which lets you install Elisp libraries. You can install Org with @kbd{M-x package-install RET org}. @noindent @b{Important}: you need to do this in a session where no @code{.org} file has -been visited, i.e. where no Org built-in function have been loaded. +been visited, i.e., where no Org built-in function have been loaded. Otherwise autoload Org functions will mess up the installation. Then, to make sure your Org configuration is taken into account, initialize @@ -10444,7 +10444,7 @@ You can change the default state of this option by setting @item C-v Toggle visible-only export. Only export the text that is currently -visible, i.e. not hidden by outline visibility in the buffer. +visible, i.e., not hidden by outline visibility in the buffer. @end table @@ -12103,7 +12103,7 @@ Internet-style links for all other links. A link with no description and destined to a regular (un-itemized) outline heading is replaced with a cross-reference and section number of the heading. -A @samp{\ref@{label@}}-style reference to an image, table etc. is replaced +A @samp{\ref@{label@}}-style reference to an image, table etc.@: is replaced with a cross-reference and sequence number of the labeled entity. @xref{Labels and captions in ODT export}. @@ -13410,7 +13410,7 @@ from it (e.g., @code{beamer}). This is obviously the most powerful customization, since the changes happen at the parser level. Indeed, some export back-ends are built as extensions -of other ones (e.g. Markdown back-end an extension of HTML back-end). +of other ones (e.g., Markdown back-end an extension of HTML back-end). Extending a back-end means that if an element type is not transcoded by the new back-end, it will be handled by the original one. Hence you can extend diff --git a/doc/misc/pgg.texi b/doc/misc/pgg.texi index 4518de4..a46c0fb 100644 --- a/doc/misc/pgg.texi +++ b/doc/misc/pgg.texi @@ -82,7 +82,7 @@ communication. Even though Mailcrypt has similar feature, it does not deal with detached PGP messages, normally used in PGP/MIME infrastructure. This was the main reason why I wrote the new library. -Note that the PGG library is now obsolete, replaced by EasyPG. +Note that the PGG library is now obsolete, replaced by EasyPG@. @xref{Top,, EasyPG, epa, EasyPG Assistant User's Manual}. PGP/MIME is an application of MIME Object Security Services (RFC1848). diff --git a/doc/misc/reftex.texi b/doc/misc/reftex.texi index facfb43..1497b1f 100644 --- a/doc/misc/reftex.texi +++ b/doc/misc/reftex.texi @@ -608,7 +608,7 @@ Show calling point in another window. This is the point from where @item < Promote the current section. This will convert @code{\section} to -@code{\chapter}, @code{\subsection} to @code{\section} etc. If there is +@code{\chapter}, @code{\subsection} to @code{\section} etc. If there is an active region, all sections in the region will be promoted, including the one at point. To avoid mistakes, @RefTeX{} requires a fresh document scan before executing this command; if necessary, it will @@ -1567,7 +1567,7 @@ Here is the setup: @cindex @code{linguex}, LaTeX package @cindex LaTeX packages, @code{linguex} A more complex example is the @file{linguex.sty} package which defines -list macros @samp{\ex.}, @samp{\a.}, @samp{\b.} etc. for lists which are +list macros @samp{\ex.}, @samp{\a.}, @samp{\b.} etc.@: for lists which are terminated by @samp{\z.} or by an empty line. @example @@ -5906,7 +5906,7 @@ When no BibTeX database files are specified, citations can also use @noindent @b{Version 3.11} @itemize @bullet @item -Fixed bug which led to naked label in (e.g.@:) footnotes. +Fixed bug which led to naked label in (e.g.)@: footnotes. @item Added scroll-other-window functions to RefTeX-Select. @end itemize diff --git a/doc/misc/todo-mode.texi b/doc/misc/todo-mode.texi index 6f684de..f58965c 100644 --- a/doc/misc/todo-mode.texi +++ b/doc/misc/todo-mode.texi @@ -1421,7 +1421,7 @@ Advance point to the next button. Put point on the previous button. @end table -These commands are cyclic, e.g. when point is on the last button, +These commands are cyclic, e.g., when point is on the last button, pressing @kbd{n} moves it to the first button. Typing @kbd{q} exits Todo Categories mode, killing the buffer and returning @@ -1787,7 +1787,7 @@ current file: @item F h @itemx h Hide the item headers if visible, or show them if they are hidden. -With done items, only the done header (i.e. the done tag and date-time +With done items, only the done header (i.e., the done tag and date-time string inserted when the item was marked done) is hidden, the original date-time string is not. With filtered items, the category (or category-file) tag is not hidden. diff --git a/doc/misc/tramp.texi b/doc/misc/tramp.texi index 5d02d90..d9cb933 100644 --- a/doc/misc/tramp.texi +++ b/doc/misc/tramp.texi @@ -1001,7 +1001,7 @@ name. This special method uses the Android Debug Bridge for accessing Android devices. The Android Debug Bridge must be installed locally. Some GNU/Linux distributions offer it for installation, otherwise it -can be installed as part of the Android SDK. If the @command{adb} +can be installed as part of the Android SDK@. If the @command{adb} program is not found via the @env{PATH} environment variable, the variable @var{tramp-adb-program} must point to its absolute path. diff --git a/doc/misc/vhdl-mode.texi b/doc/misc/vhdl-mode.texi index 524a534..777bb10 100644 --- a/doc/misc/vhdl-mode.texi +++ b/doc/misc/vhdl-mode.texi @@ -159,7 +159,7 @@ the construct on that line. A @dfn{syntactic component} consists of a pair of information (in lisp parlance, a @emph{cons cell}), where the first part is a @dfn{syntactic symbol}, and the second part is a @dfn{relative buffer position}. Syntactic symbols describe elements of -VHDL code, e.g. @code{statement}, @code{comment}, @code{block-open}, +VHDL code, e.g., @code{statement}, @code{comment}, @code{block-open}, @code{block-close}, etc. @xref{Syntactic Symbols}, for a complete list of currently recognized syntactic symbols and their semantics. Also, the variable @code{vhdl-offsets-alist} contains the list of currently @@ -633,8 +633,8 @@ similar to what is allowed in @code{vhdl-offsets-alist}. When the file is visited, VHDL Mode will automatically institute these offsets using @code{vhdl-set-offset}. @xref{Customizing Indentation}. -Note that file style settings (i.e. @code{vhdl-file-style}) are applied -before file offset settings (i.e. @code{vhdl-file-offsets}). +Note that file style settings (i.e., @code{vhdl-file-style}) are applied +before file offset settings (i.e., @code{vhdl-file-offsets}). @node Advanced Customizations diff --git a/doc/misc/vip.texi b/doc/misc/vip.texi index 9a5255d..ebb1494 100644 --- a/doc/misc/vip.texi +++ b/doc/misc/vip.texi @@ -436,7 +436,7 @@ Jump to mark (and pop mark off the mark ring). @cindex region -Vi operators like @kbd{d}, @kbd{c} etc. are usually used in combination +Vi operators like @kbd{d}, @kbd{c} etc.@: are usually used in combination with motion commands. It is now possible to use current region as the argument to these operators. (A @dfn{region} is a part of buffer delimited by point and mark.) The key @kbd{r} is used for this purpose. diff --git a/doc/misc/viper.texi b/doc/misc/viper.texi index bea7f47..0ccc6ac 100644 --- a/doc/misc/viper.texi +++ b/doc/misc/viper.texi @@ -1224,7 +1224,7 @@ Facilities like this make Vi's @kbd{:ab} command obsolete. @cindex Ex style motion @cindex line editor motion -Viper can be set free from the line--limited movements in Vi, such as @kbd{l} +Viper can be set free from the line-limited movements in Vi, such as @kbd{l} refusing to move beyond the line, @key{ESC} moving one character back, etc. These derive from Ex, which is a line editor. If your Viper customization file contains diff --git a/doc/misc/woman.texi b/doc/misc/woman.texi index d199afc..a259249 100644 --- a/doc/misc/woman.texi +++ b/doc/misc/woman.texi @@ -1141,7 +1141,7 @@ headings. Default is @code{t}. [Heading emboldening is @emph{not} standard @code{man} behavior.] @item woman-ignore -A boolean value. If non-@code{nil} then unrecognized requests etc. are +A boolean value. If non-@code{nil} then unrecognized requests etc.@: are ignored. Default is @code{t}. This gives the standard @code{roff} behavior. If @code{nil} then they are left in the buffer, which may aid debugging. commit 7ec63a3afa52213b7b3cd3ecc0717c6e6504dc43 Author: Simen Heggestøyl Date: Tue Mar 17 23:11:55 2015 +0100 Update CSS property list * textmodes/css-mode.el (css-extract-keyword-list): Remove function in favor of manual extraction. (css-extract-parse-val-grammar): Remove function in favor of manual extraction. (css-extract-props-and-vals): Remove function in favor of manual extraction. (css-at-ids): Update list of CSS at-rule ids. (css-property-ids): Update list of CSS properties. diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 9733226..25571ba 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -13,6 +13,14 @@ (css-completion-at-point): New function providing completion for `css-mode'. (css-mode): Add support for completion. + (css-extract-keyword-list): Remove function in favor of manual + extraction. + (css-extract-parse-val-grammar): Remove function in favor of + manual extraction. + (css-extract-props-and-vals): Remove function in favor of manual + extraction. + (css-at-ids): Update list of CSS at-rule ids. + (css-property-ids): Update list of CSS properties. 2015-03-17 Bozhidar Batsov diff --git a/lisp/textmodes/css-mode.el b/lisp/textmodes/css-mode.el index 555122b..e3578f9 100644 --- a/lisp/textmodes/css-mode.el +++ b/lisp/textmodes/css-mode.el @@ -38,89 +38,6 @@ "Cascading Style Sheets (CSS) editing mode." :group 'languages) - -(defun css-extract-keyword-list (res) - (with-temp-buffer - (url-insert-file-contents "http://www.w3.org/TR/REC-CSS2/css2.txt") - (goto-char (point-max)) - (search-backward "Appendix H. Index") - (forward-line) - (delete-region (point-min) (point)) - (let ((result nil) - keys) - (dolist (re res) - (goto-char (point-min)) - (setq keys nil) - (while (re-search-forward (cdr re) nil t) - (push (match-string 1) keys)) - (push (cons (car re) (sort keys 'string-lessp)) result)) - (nreverse result)))) - -(defun css-extract-parse-val-grammar (string env) - (let ((start 0) - (elems ()) - name) - (while (string-match - (concat "\\(?:" - (concat "]+>]+>\\(?:" - "<\\([^&]+\\)>\\|'\\([^']+\\)'" - "\\)") - "\\|" "\\(\\[\\)" - "\\|" "\\(]\\)" - "\\|" "\\(||\\)" - "\\|" "\\(|\\)" - "\\|" "\\([*+?]\\)" - "\\|" "\\({[^}]+}\\)" - "\\|" "\\(\\w+\\(?:-\\w+\\)*\\)" - "\\)[ \t\n]*") - string start) - ;; (assert (eq start (match-beginning 0))) - (setq start (match-end 0)) - (cond - ;; Reference to a type of value. - ((setq name (match-string-no-properties 1 string)) - (push (intern name) elems)) - ;; Reference to another property's values. - ((setq name (match-string-no-properties 2 string)) - (setq elems (delete-dups (append (cdr (assoc name env)) elems)))) - ;; A literal - ((setq name (match-string-no-properties 9 string)) - (push name elems)) - ;; We just ignore the rest. I.e. we ignore the structure because - ;; it's too difficult to exploit anyway (it would allow us to only - ;; complete top/center/bottom after one of left/center/right and - ;; vice-versa). - (t nil))) - elems)) - - -(defun css-extract-props-and-vals () - (with-temp-buffer - (url-insert-file-contents "http://www.w3.org/TR/CSS21/propidx.html") - (goto-char (point-min)) - (let ((props ())) - (while (re-search-forward "#propdef-\\([^\"]+\\)\">'\\1'" nil t) - (let ((prop (match-string-no-properties 1))) - (save-excursion - (goto-char (match-end 0)) - (search-forward "") - (let ((vals-string (buffer-substring (point) - (progn - (re-search-forward "[ \t\n]+|[ \t\n]+inherit") - (match-beginning 0))))) - ;; - (push (cons prop (css-extract-parse-val-grammar vals-string props)) - props))))) - props))) - -;; Extraction was done with: -;; (css-extract-keyword-list -;; '((pseudo . "^ +\\* :\\([^ \n,]+\\)") -;; (at . "^ +\\* @\\([^ \n,]+\\)") -;; (descriptor . "^ +\\* '\\([^ '\n]+\\)' (descriptor)") -;; (media . "^ +\\* '\\([^ '\n]+\\)' media group") -;; (property . "^ +\\* '\\([^ '\n]+\\)',"))) - (defconst css-pseudo-class-ids '("active" "checked" "disabled" "empty" "enabled" "first" "first-child" "first-of-type" "focus" "hover" "indeterminate" "lang" @@ -134,7 +51,7 @@ "Identifiers for pseudo-elements.") (defconst css-at-ids - '("charset" "font-face" "import" "media" "page") + '("charset" "font-face" "import" "media" "namespace" "page") "Identifiers that appear in the form @foo.") (defconst css-descriptor-ids @@ -150,36 +67,103 @@ "Identifiers for types of media.") (defconst css-property-ids - '("azimuth" "background" "background-attachment" "background-color" - "background-image" "background-position" "background-repeat" "block" - "border" "border-bottom" "border-bottom-color" "border-bottom-style" - "border-bottom-width" "border-collapse" "border-color" "border-left" - "border-left-color" "border-left-style" "border-left-width" "border-right" + '(;; CSS 2.1 properties (http://www.w3.org/TR/CSS21/propidx.html). + ;; + ;; Properties duplicated by any of the CSS3 modules below have + ;; been removed. + "azimuth" "border-collapse" "border-spacing" "bottom" + "caption-side" "clear" "clip" "content" "counter-increment" + "counter-reset" "cue" "cue-after" "cue-before" "direction" "display" + "elevation" "empty-cells" "float" "height" "left" "line-height" + "list-style" "list-style-image" "list-style-position" + "list-style-type" "margin" "margin-bottom" "margin-left" + "margin-right" "margin-top" "max-height" "max-width" "min-height" + "min-width" "orphans" "overflow" "padding" "padding-bottom" + "padding-left" "padding-right" "padding-top" "page-break-after" + "page-break-before" "page-break-inside" "pause" "pause-after" + "pause-before" "pitch" "pitch-range" "play-during" "position" + "quotes" "richness" "right" "speak" "speak-header" "speak-numeral" + "speak-punctuation" "speech-rate" "stress" "table-layout" "top" + "unicode-bidi" "vertical-align" "visibility" "voice-family" "volume" + "widows" "width" "z-index" + + ;; CSS Animations + ;; (http://www.w3.org/TR/css3-animations/#property-index) + "animation" "animation-delay" "animation-direction" + "animation-duration" "animation-fill-mode" + "animation-iteration-count" "animation-name" + "animation-play-state" "animation-timing-function" + + ;; CSS Backgrounds and Borders Module Level 3 + ;; (http://www.w3.org/TR/css3-background/#property-index) + "background" "background-attachment" "background-clip" + "background-color" "background-image" "background-origin" + "background-position" "background-repeat" "background-size" + "border" "border-bottom" "border-bottom-color" + "border-bottom-left-radius" "border-bottom-right-radius" + "border-bottom-style" "border-bottom-width" "border-color" + "border-image" "border-image-outset" "border-image-repeat" + "border-image-slice" "border-image-source" "border-image-width" + "border-left" "border-left-color" "border-left-style" + "border-left-width" "border-radius" "border-right" "border-right-color" "border-right-style" "border-right-width" - "border-spacing" "border-style" "border-top" "border-top-color" - "border-top-style" "border-top-width" "border-width" "bottom" - "caption-side" "clear" "clip" "color" "compact" "content" - "counter-increment" "counter-reset" "cue" "cue-after" "cue-before" - "cursor" "dashed" "direction" "display" "dotted" "double" "elevation" - "empty-cells" "float" "font" "font-family" "font-size" "font-size-adjust" - "font-stretch" "font-style" "font-variant" "font-weight" "groove" "height" - "hidden" "inline" "inline-table" "inset" "left" "letter-spacing" - "line-height" "list-item" "list-style" "list-style-image" - "list-style-position" "list-style-type" "margin" "margin-bottom" - "margin-left" "margin-right" "margin-top" "marker-offset" "marks" - "max-height" "max-width" "min-height" "min-width" "orphans" "outline" - "outline-color" "outline-style" "outline-width" "outset" "overflow" - "padding" "padding-bottom" "padding-left" "padding-right" "padding-top" - "page" "page-break-after" "page-break-before" "page-break-inside" "pause" - "pause-after" "pause-before" "pitch" "pitch-range" "play-during" "position" - "quotes" "richness" "ridge" "right" "run-in" "size" "solid" "speak" - "speak-header" "speak-numeral" "speak-punctuation" "speech-rate" "stress" - "table" "table-caption" "table-cell" "table-column" "table-column-group" - "table-footer-group" "table-header-group" "table-layout" "table-row" - "table-row-group" "text-align" "text-decoration" "text-indent" - "text-shadow" "text-transform" "top" "unicode-bidi" "vertical-align" - "visibility" "voice-family" "volume" "white-space" "widows" "width" - "word-spacing" "z-index") + "border-style" "border-top" "border-top-color" + "border-top-left-radius" "border-top-right-radius" + "border-top-style" "border-top-width" "border-width" "box-shadow" + + ;; CSS Basic User Interface Module Level 3 (CSS3 UI) + ;; (http://www.w3.org/TR/css3-ui/#property-index) + "box-sizing" "caret-color" "cursor" "nav-down" "nav-left" + "nav-right" "nav-up" "outline" "outline-color" "outline-offset" + "outline-style" "outline-width" "resize" "text-overflow" + + ;; CSS Color Module Level 3 + ;; (http://www.w3.org/TR/css3-color/#property) + "color" "opacity" + + ;; CSS Flexible Box Layout Module Level 1 + ;; (http://www.w3.org/TR/css-flexbox-1/#property-index) + "align-content" "align-items" "align-self" "flex" "flex-basis" + "flex-direction" "flex-flow" "flex-grow" "flex-shrink" "flex-wrap" + "justify-content" "order" + + ;; CSS Fonts Module Level 3 + ;; (http://www.w3.org/TR/css3-fonts/#property-index) + "font" "font-family" "font-feature-settings" "font-kerning" + "font-language-override" "font-size" "font-size-adjust" + "font-stretch" "font-style" "font-synthesis" "font-variant" + "font-variant-alternates" "font-variant-caps" + "font-variant-east-asian" "font-variant-ligatures" + "font-variant-numeric" "font-variant-position" "font-weight" + + ;; CSS Text Decoration Module Level 3 + ;; (http://dev.w3.org/csswg/css-text-decor-3/#property-index) + "text-decoration" "text-decoration-color" "text-decoration-line" + "text-decoration-skip" "text-decoration-style" "text-emphasis" + "text-emphasis-color" "text-emphasis-position" "text-emphasis-style" + "text-shadow" "text-underline-position" + + ;; CSS Text Module Level 3 + ;; (http://www.w3.org/TR/css3-text/#property-index) + "hanging-punctuation" "hyphens" "letter-spacing" "line-break" + "overflow-wrap" "tab-size" "text-align" "text-align-last" + "text-indent" "text-justify" "text-transform" "white-space" + "word-break" "word-spacing" "word-wrap" + + ;; CSS Transforms Module Level 1 + ;; (http://www.w3.org/TR/css3-2d-transforms/#property-index) + "backface-visibility" "perspective" "perspective-origin" + "transform" "transform-origin" "transform-style" + + ;; CSS Transitions + ;; (http://www.w3.org/TR/css3-transitions/#property-index) + "transition" "transition-delay" "transition-duration" + "transition-property" "transition-timing-function" + + ;; Filter Effects Module Level 1 + ;; (http://www.w3.org/TR/filter-effects/#property-index) + "color-interpolation-filters" "filter" "flood-color" + "flood-opacity" "lighting-color") "Identifiers for properties.") (defcustom css-electric-keys '(?\} ?\;) ;; '() commit 62fde9ee0fe62c8285c61b01444e8e59d1654685 Author: Simen Heggestøyl Date: Tue Mar 17 22:58:13 2015 +0100 Add support for completion in `css-mode' * textmodes/css-mode.el (css--complete-property): New function for completing CSS properties. (css--complete-pseudo-element-or-class): New function for completing CSS pseudo-elements and pseudo-classes. (css--complete-at-rule): New function for completing CSS at-rules. (css-completion-at-point): New function providing completion for `css-mode'. (css-mode): Add support for completion. diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 898d9cb..9733226 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -5,6 +5,14 @@ (css-pseudo-ids): Remove. (css-pseudo-class-ids): New variable. (css-pseudo-element-ids): New variable. + (css--complete-property): New function for completing CSS + properties. + (css--complete-pseudo-element-or-class): New function for + completing CSS pseudo-elements and pseudo-classes. + (css--complete-at-rule): New function for completing CSS at-rules. + (css-completion-at-point): New function providing completion for + `css-mode'. + (css-mode): Add support for completion. 2015-03-17 Bozhidar Batsov diff --git a/lisp/textmodes/css-mode.el b/lisp/textmodes/css-mode.el index c889603..555122b 100644 --- a/lisp/textmodes/css-mode.el +++ b/lisp/textmodes/css-mode.el @@ -29,7 +29,7 @@ ;; - electric ; and } ;; - filling code with auto-fill-mode -;; - completion +;; - attribute value completion ;; - fix font-lock errors with multi-line selectors ;;; Code: @@ -346,6 +346,45 @@ (`(:before . ,(or "{" "(")) (if (smie-rule-hanging-p) (smie-rule-parent 0))))) +;;; Completion + +(defun css--complete-property () + "Complete property at point." + (save-excursion + (let ((pos (point))) + (skip-chars-backward "-[:alnum:]") + (let ((start (point))) + (skip-chars-backward " \t\r\n") + (when (memq (char-before) '(?\{ ?\;)) + (list start pos css-property-ids)))))) + +(defun css--complete-pseudo-element-or-class () + "Complete pseudo-element or pseudo-class at point." + (save-excursion + (let ((pos (point))) + (skip-chars-backward "-[:alnum:]") + (when (eq (char-before) ?\:) + (list (point) pos + (if (eq (char-before (- (point) 1)) ?\:) + css-pseudo-element-ids + css-pseudo-class-ids)))))) + +(defun css--complete-at-rule () + "Complete at-rule (statement beginning with `@') at point." + (save-excursion + (let ((pos (point))) + (skip-chars-backward "-[:alnum:]") + (when (eq (char-before) ?\@) + (list (point) pos css-at-ids))))) + +(defun css-completion-at-point () + "Complete current symbol at point. +Currently supports completion of CSS properties, pseudo-elements, +pesudo-classes, and at-rules." + (or (css--complete-property) + (css--complete-pseudo-element-or-class) + (css--complete-at-rule))) + ;;;###autoload (define-derived-mode css-mode fundamental-mode "CSS" "Major mode to edit Cascading Style Sheets." @@ -361,7 +400,9 @@ :forward-token #'css-smie--forward-token :backward-token #'css-smie--backward-token) (setq-local electric-indent-chars - (append css-electric-keys electric-indent-chars))) + (append css-electric-keys electric-indent-chars)) + (add-hook 'completion-at-point-functions + #'css-completion-at-point nil 'local)) (defvar comment-continue) commit 64db0c26faba21e7aedc0c5f57e04ed175b04f5b Author: Simen Heggestøyl Date: Tue Mar 17 22:33:36 2015 +0100 Discriminate between pseudo-classes and -elements * textmodes/css-mode.el (css--font-lock-keywords): Discriminate between pseudo-classes and pseudo-elements. (css-pseudo-ids): Remove. (css-pseudo-class-ids): New variable. (css-pseudo-element-ids): New variable. diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 57d988b..898d9cb 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,11 @@ +2015-03-17 Simen Heggestøyl + + * textmodes/css-mode.el (css--font-lock-keywords): Discriminate + between pseudo-classes and pseudo-elements. + (css-pseudo-ids): Remove. + (css-pseudo-class-ids): New variable. + (css-pseudo-element-ids): New variable. + 2015-03-17 Bozhidar Batsov * progmodes/ruby-mode.el (ruby-font-lock-keywords): Font-lock diff --git a/lisp/textmodes/css-mode.el b/lisp/textmodes/css-mode.el index 44dc4df..c889603 100644 --- a/lisp/textmodes/css-mode.el +++ b/lisp/textmodes/css-mode.el @@ -3,6 +3,7 @@ ;; Copyright (C) 2006-2015 Free Software Foundation, Inc. ;; Author: Stefan Monnier +;; Maintainer: Simen Heggestøyl ;; Keywords: hypermedia ;; This file is part of GNU Emacs. @@ -120,10 +121,17 @@ ;; (media . "^ +\\* '\\([^ '\n]+\\)' media group") ;; (property . "^ +\\* '\\([^ '\n]+\\)',"))) -(defconst css-pseudo-ids - '("active" "after" "before" "first" "first-child" "first-letter" "first-line" - "focus" "hover" "lang" "left" "link" "right" "visited") - "Identifiers for pseudo-elements and pseudo-classes.") +(defconst css-pseudo-class-ids + '("active" "checked" "disabled" "empty" "enabled" "first" + "first-child" "first-of-type" "focus" "hover" "indeterminate" "lang" + "last-child" "last-of-type" "left" "link" "nth-child" + "nth-last-child" "nth-last-of-type" "nth-of-type" "only-child" + "only-of-type" "right" "root" "target" "visited") + "Identifiers for pseudo-classes.") + +(defconst css-pseudo-element-ids + '("after" "before" "first-letter" "first-line") + "Identifiers for pseudo-elements.") (defconst css-at-ids '("charset" "font-face" "import" "media" "page") @@ -258,7 +266,11 @@ (concat "\\(?:" scss--hash-re "\\|[^@/:{} \t\n#]\\)" "[^:{}#]*\\(?:" scss--hash-re "[^:{}#]*\\)*")) - "\\(?::" (regexp-opt css-pseudo-ids t) + ;; Even though pseudo-elements should be prefixed by ::, a + ;; single colon is accepted for backward compatibility. + "\\(?:\\(:" (regexp-opt (append css-pseudo-class-ids + css-pseudo-element-ids) t) + "\\|\\::" (regexp-opt css-pseudo-element-ids t) "\\)" "\\(?:([^\)]+)\\)?" (if (not sassy) "[^:{}\n]*" commit 5b77d81840b2dff821abefb2adb1f7f2f495be62 Author: Bozhidar Batsov Date: Tue Mar 17 23:40:20 2015 +0200 Separate Kernel methods with required args from those without diff --git a/lisp/progmodes/ruby-mode.el b/lisp/progmodes/ruby-mode.el index 40204fa..921ca31 100644 --- a/lisp/progmodes/ruby-mode.el +++ b/lisp/progmodes/ruby-mode.el @@ -2069,25 +2069,14 @@ See `font-lock-syntax-table'.") ruby-font-lock-keyword-beg-re (regexp-opt '( ;; built-in methods on Kernel - "abort" - "at_exit" "autoload" "autoload?" - "binding" - "block_given?" - "callcc" - "caller" "catch" "eval" "exec" - "exit" - "exit!" - "fork" "format" - "global_variables" "lambda" "load" - "local_variables" "loop" "open" "p" @@ -2098,10 +2087,8 @@ See `font-lock-syntax-table'.") "puts" "require" "require_relative" - "sleep" "spawn" "sprintf" - "srand" "syscall" "system" "throw" @@ -2140,10 +2127,14 @@ See `font-lock-syntax-table'.") "at_exit" "binding" "block_given?" + "callcc" "caller" "exit" "exit!" "fail" + "fork" + "global_variables" + "local_variables" "private" "protected" "public" commit 771978259eb6b1caf0a37554c006e42d7ab802c6 Author: Bozhidar Batsov Date: Tue Mar 17 22:41:36 2015 +0200 Font-lock more Kernel methods as built-in diff --git a/lisp/ChangeLog b/lisp/ChangeLog index cf4eeae..57d988b 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2015-03-17 Bozhidar Batsov + + * progmodes/ruby-mode.el (ruby-font-lock-keywords): Font-lock + more Kernel methods. + 2015-03-17 Michael Albinus * tramp-sh.el (tramp-maybe-send-script): Avoid leading tabs in diff --git a/lisp/progmodes/ruby-mode.el b/lisp/progmodes/ruby-mode.el index 060bc84..40204fa 100644 --- a/lisp/progmodes/ruby-mode.el +++ b/lisp/progmodes/ruby-mode.el @@ -2069,16 +2069,25 @@ See `font-lock-syntax-table'.") ruby-font-lock-keyword-beg-re (regexp-opt '( ;; built-in methods on Kernel + "abort" "at_exit" "autoload" "autoload?" + "binding" + "block_given?" + "callcc" + "caller" "catch" "eval" "exec" + "exit" + "exit!" "fork" "format" + "global_variables" "lambda" "load" + "local_variables" "loop" "open" "p" @@ -2089,11 +2098,16 @@ See `font-lock-syntax-table'.") "puts" "require" "require_relative" + "sleep" "spawn" "sprintf" + "srand" "syscall" "system" + "throw" + "trace_var" "trap" + "untrace_var" "warn" ;; keyword-like private methods on Module "alias_method" commit 7cf5b3748cb1c8df5a0189bf6b5e95b550c16668 Author: Michael Albinus Date: Tue Mar 17 20:07:38 2015 +0100 Avoid leading tabs in shell scripts, sent by Tramp. Fixes: debbugs:20118 * tramp-sh.el (tramp-maybe-send-script): Avoid leading tabs in shell scripts. diff --git a/lisp/ChangeLog b/lisp/ChangeLog index b734aaa..cf4eeae 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2015-03-17 Michael Albinus + + * tramp-sh.el (tramp-maybe-send-script): Avoid leading tabs in + shell scripts. (Bug#20118) + 2015-03-17 Eli Zaretskii * mouse.el (mouse-appearance-menu): If w32-use-w32-font-dialog is diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el index b6c47bc..133d886 100644 --- a/lisp/net/tramp-sh.el +++ b/lisp/net/tramp-sh.el @@ -3725,6 +3725,10 @@ Only send the definition if it has not already been done." (tramp-get-connection-process vec) "scripts" nil))) (unless (member name scripts) (with-tramp-progress-reporter vec 5 (format "Sending script `%s'" name) + ;; In bash, leading TABs like in `tramp-vc-registered-read-file-names' + ;; could result in unwanted command expansion. Avoid this. + (setq script (tramp-compat-replace-regexp-in-string + (make-string 1 ?\t) (make-string 8 ? ) script)) ;; The script could contain a call of Perl. This is masked with `%s'. (when (and (string-match "%s" script) (not (tramp-get-remote-perl vec))) commit e70a1f9b42857fa1315302b9c140a6d40ea15f1d Author: Eli Zaretskii Date: Tue Mar 17 20:38:48 2015 +0200 lisp/mouse.el: Fix last change. diff --git a/lisp/mouse.el b/lisp/mouse.el index be9562c..c50913f 100644 --- a/lisp/mouse.el +++ b/lisp/mouse.el @@ -1801,6 +1801,8 @@ choose a font." (declare-function buffer-face-mode-invoke "face-remap" (face arg &optional interactive)) (declare-function font-face-attributes "font.c" (font &optional frame)) +(defvar w32-use-w32-font-dialog) +(defvar w32-fixed-font-alist) (defun mouse-appearance-menu (event) "Show a menu for changing the default face in the current buffer." commit 0fe787e21ccc1051fab5597b7f5d5b4c325d3258 Merge: 330cf1a 6f73c46 Author: Eli Zaretskii Date: Tue Mar 17 20:32:04 2015 +0200 Merge branch 'master' of git.savannah.gnu.org:/srv/git/emacs commit 6f73c465a8990560fedb1c9897c893056b4b04ef Author: Stefan Monnier Date: Tue Mar 17 14:30:42 2015 -0400 * cl-macs.el (cl--transform-lambda): Refine last change. Fixes: debbugs:20125 * test/automated/cl-lib-tests.el: Use lexical-binding. (cl-lib-arglist-performance): Refine test to the case where one of the fields has a non-nil default value. Use existing `mystruct' defstruct. (cl-lib-struct-accessors): Use `pcase' to be a bit more flexible in the accepted outputs. diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 9647822..b7062bb 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2015-03-17 Stefan Monnier + + * emacs-lisp/cl-macs.el (cl--transform-lambda): Refine last change + (bug#20125). + 2015-03-17 Michael Albinus * net/tramp-sh.el (tramp-ssh-controlmaster-options): Change test diff --git a/lisp/emacs-lisp/cl-macs.el b/lisp/emacs-lisp/cl-macs.el index 712a748..56fbcf0 100644 --- a/lisp/emacs-lisp/cl-macs.el +++ b/lisp/emacs-lisp/cl-macs.el @@ -257,11 +257,7 @@ FORM is of the form (ARGS . BODY)." (setq cl--bind-defs (cadr cl-defs)) ;; Remove "&cl-defs DEFS" from args. (setcdr cl-defs (cddr cl-defs)) - (setq args (delq '&cl-defs args)) - ;; Optimize away trivial &cl-defs. - (if (and (null (car cl--bind-defs)) - (cl-every (lambda (x) (null (cadr x))) (cdr cl--bind-defs))) - (setq cl--bind-defs nil)))) + (setq args (delq '&cl-defs args)))) (if (setq cl--bind-enquote (memq '&cl-quote args)) (setq args (delq '&cl-quote args))) (if (memq '&whole args) (error "&whole not currently implemented")) @@ -272,11 +268,19 @@ FORM is of the form (ARGS . BODY)." ;; Take away all the simple args whose parsing can be handled more ;; efficiently by a plain old `lambda' than the manual parsing generated ;; by `cl--do-arglist'. - (while (and args (symbolp (car args)) - (not (memq (car args) '(nil &rest &body &key &aux))) - (not (and (eq (car args) '&optional) - (or cl--bind-defs (consp (cadr args)))))) - (push (pop args) simple-args)) + (let ((optional nil)) + (while (and args (symbolp (car args)) + (not (memq (car args) '(nil &rest &body &key &aux))) + (or (not optional) + ;; Optional args whose default is nil are simple. + (null (nth 1 (assq (car args) (cdr cl--bind-defs))))) + (not (and (eq (car args) '&optional) (setq optional t) + (car cl--bind-defs)))) + (push (pop args) simple-args)) + (when optional + (if args (push '&optional args)) + ;; Don't keep a dummy trailing &optional without actual optional args. + (if (eq '&optional (car simple-args)) (pop simple-args)))) (or (eq cl--bind-block 'cl-none) (setq body (list `(cl-block ,cl--bind-block ,@body)))) (let* ((cl--bind-lets nil) (cl--bind-forms nil) @@ -292,7 +296,7 @@ FORM is of the form (ARGS . BODY)." ;; "manual" parsing. (let ((slen (length simple-args))) (when (memq '&optional simple-args) - (push '&optional args) (cl-decf slen)) + (cl-decf slen)) (setq header ;; Macro expansion can take place in the middle of ;; apparently harmless computation, so it should not diff --git a/test/ChangeLog b/test/ChangeLog index a7d1dfd..e150aba 100644 --- a/test/ChangeLog +++ b/test/ChangeLog @@ -1,7 +1,15 @@ +2015-03-17 Stefan Monnier + + * automated/cl-lib-tests.el: Use lexical-binding. + (cl-lib-arglist-performance): Refine test to the case where one of the + fields has a non-nil default value. Use existing `mystruct' defstruct. + (cl-lib-struct-accessors): Use `pcase' to be a bit more flexible in the + accepted outputs. + 2015-03-16 Ken Brown - * automated/tramp-tests.el (tramp--test-special-characters): Don't - test "\t" in file names on Cygwin. (Bug#20119) + * automated/tramp-tests.el (tramp--test-special-characters): + Don't test "\t" in file names on Cygwin. (Bug#20119) 2015-03-10 Jackson Ray Hamilton @@ -78,8 +86,8 @@ 2015-03-03 Daniel Colascione - * automated/generator-tests.el (cps-testcase): Use - `cps-inhibit-atomic-optimization' instead of + * automated/generator-tests.el (cps-testcase): + Use `cps-inhibit-atomic-optimization' instead of `cps-disable-atomic-optimization'. (cps-test-declarations-preserved): New test. @@ -184,8 +192,8 @@ 2015-02-07 Dmitry Gutov - * automated/vc-tests.el (vc-test--working-revision): Fix - `vc-working-revision' checks to be compared against nil, which is + * automated/vc-tests.el (vc-test--working-revision): + Fix `vc-working-revision' checks to be compared against nil, which is what is should return for unregistered files. 2015-02-06 Nicolas Petton diff --git a/test/automated/cl-lib-tests.el b/test/automated/cl-lib-tests.el index 2c188a4..ce0e591 100644 --- a/test/automated/cl-lib-tests.el +++ b/test/automated/cl-lib-tests.el @@ -1,4 +1,4 @@ -;;; cl-lib.el --- tests for emacs-lisp/cl-lib.el +;;; cl-lib.el --- tests for emacs-lisp/cl-lib.el -*- lexical-binding:t -*- ;; Copyright (C) 2013-2015 Free Software Foundation, Inc. @@ -204,7 +204,10 @@ :b :a :a 42) '(42 :a)))) -(cl-defstruct mystruct (abc :readonly t) def) +(cl-defstruct (mystruct + (:constructor cl-lib--con-1 (&aux (abc 1))) + (:constructor cl-lib--con-2 (&optional def))) + (abc 5 :readonly t) (def nil)) (ert-deftest cl-lib-struct-accessors () (let ((x (make-mystruct :abc 1 :def 2))) (should (eql (cl-struct-slot-value 'mystruct 'abc x) 1)) @@ -213,8 +216,17 @@ (should (eql (cl-struct-slot-value 'mystruct 'def x) -1)) (should (eql (cl-struct-slot-offset 'mystruct 'abc) 1)) (should-error (cl-struct-slot-offset 'mystruct 'marypoppins)) - (should (equal (cl-struct-slot-info 'mystruct) - '((cl-tag-slot) (abc :readonly t) (def)))))) + (should (pcase (cl-struct-slot-info 'mystruct) + (`((cl-tag-slot) (abc 5 :readonly t) + (def . ,(or `nil `(nil)))) + t))))) + +(ert-deftest cl-lib-arglist-performance () + ;; An `&aux' should not cause lambda's arglist to be turned into an &rest + ;; that's parsed by hand. + (should (equal () (help-function-arglist 'cl-lib--con-1))) + (should (pcase (help-function-arglist 'cl-lib--con-2) + (`(&optional ,_) t)))) (ert-deftest cl-the () (should (eql (cl-the integer 42) 42)) @@ -434,14 +446,4 @@ (should (cl-typep '* 'cl-lib-test-type)) (should-not (cl-typep 1 'cl-lib-test-type))) -(ert-deftest cl-lib-arglist-performance () - ;; An `&aux' should not cause lambda's arglist to be turned into an &rest - ;; that's parsed by hand. - (should (eq () (nth 1 (nth 1 (macroexpand - '(cl-function (lambda (&aux (x 1)) x))))))) - (cl-defstruct (cl-lib--s (:constructor cl-lib--s-make (&optional a))) a) - ;; Similarly the &cl-defs thingy shouldn't cause fallback to manual parsing - ;; of args if the default for optional args is nil. - (should (equal '(&optional a) (help-function-arglist 'cl-lib--s-make)))) - ;;; cl-lib.el ends here commit 330cf1a71787946b9fd4c74bad0e66c1bad7fa7f Author: Eli Zaretskii Date: Tue Mar 17 20:29:55 2015 +0200 Resurrect the lost optional fixed font menu on w32 lisp/mouse.el (mouse-appearance-menu): If w32-use-w32-font-dialog is nil, construct a menu of fixed fonts. This resurrects a feature lost in Emacs 23. lisp/w32-vars.el (w32-use-w32-font-dialog): Add a ':set' function to reset mouse-appearance-menu-map, so the font dialog is recomputed the next time the menu is requested. (w32-fixed-font-alist): Fix to use correct names of Courier fonts. diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 9647822..b29694b 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,14 @@ +2015-03-17 Eli Zaretskii + + * mouse.el (mouse-appearance-menu): If w32-use-w32-font-dialog is + nil, construct a menu of fixed fonts. This resurrects a feature + lost in Emacs 23. + + * w32-vars.el (w32-use-w32-font-dialog): Add a ':set' function to + reset mouse-appearance-menu-map, so the font dialog is recomputed + the next time the menu is requested. + (w32-fixed-font-alist): Fix to use correct names of Courier fonts. + 2015-03-17 Michael Albinus * net/tramp-sh.el (tramp-ssh-controlmaster-options): Change test diff --git a/lisp/mouse.el b/lisp/mouse.el index e78eca4..be9562c 100644 --- a/lisp/mouse.el +++ b/lisp/mouse.el @@ -1820,13 +1820,18 @@ choose a font." (define-key mouse-appearance-menu-map [text-scale-increase] '(menu-item "Increase Buffer Text Size" text-scale-increase)) ;; Font selector - (if (functionp 'x-select-font) + (if (and (functionp 'x-select-font) + (or (not (boundp 'w32-use-w32-font-dialog)) + w32-use-w32-font-dialog)) (define-key mouse-appearance-menu-map [x-select-font] '(menu-item "Change Buffer Font..." x-select-font)) ;; If the select-font is unavailable, construct a menu. (let ((font-submenu (make-sparse-keymap "Change Text Font")) - (font-alist (cdr (append x-fixed-font-alist - (list (generate-fontset-menu)))))) + (font-alist (cdr (append + (if (eq system-type 'windows-nt) + w32-fixed-font-alist + x-fixed-font-alist) + (list (generate-fontset-menu)))))) (dolist (family font-alist) (let* ((submenu-name (car family)) (submenu-map (make-sparse-keymap submenu-name))) diff --git a/lisp/w32-vars.el b/lisp/w32-vars.el index ae42ee7..f9212be 100644 --- a/lisp/w32-vars.el +++ b/lisp/w32-vars.el @@ -34,10 +34,17 @@ ;; Redefine the font selection to use the standard W32 dialog (defcustom w32-use-w32-font-dialog t - "Use the standard font dialog. + "If non-nil, use the standard Windows font dialog for font selection. If nil, pop up a menu of a fixed set of fonts including fontsets, like -X does. See `w32-fixed-font-alist' for the font menu definition." +X does. See `w32-fixed-font-alist' for the fonts to appear in the menu. + +Setting this variable directly does not have any effect; +use either \\[customize] or set `mouse-appearance-menu-map' to nil +after changing the value of this variable." :type 'boolean + :set (lambda (symbol value) + (set symbol value) + (setq mouse-appearance-menu-map nil)) :group 'w32) (defvar w32-list-proportional-fonts nil @@ -104,11 +111,11 @@ X does. See `w32-fixed-font-alist' for the font menu definition." "-*-Lucida Sans Typewriter-semibold-r-*-*-16-*-*-*-c-*-iso8859-1")) ("Courier" ("Courier 10x8" - "-*-Courier-*normal-r-*-*-*-97-*-*-c-80-iso8859-1") + "-*-Courier New-normal-r-*-*-*-97-*-*-c-80-iso8859-1") ("Courier 12x9" - "-*-Courier-*normal-r-*-*-*-120-*-*-c-90-iso8859-1") + "-*-Courier New-normal-r-*-*-*-120-*-*-c-90-iso8859-1") ("Courier 15x12" - "-*-Courier-*normal-r-*-*-*-150-*-*-c-120-iso8859-1") + "-*-Courier New-normal-r-*-*-*-150-*-*-c-120-iso8859-1") ;; For these, we specify the point height. ("") ("8" "-*-Courier New-normal-r-*-*-11-*-*-*-c-*-iso8859-1") commit 508049aae95c42a3e6fe989ff403bf7cb6f88433 Author: Michael Albinus Date: Tue Mar 17 10:18:10 2015 +0100 Change test for ControlPath in order to avoid DNS timeouts. Fixes: debbugs:20015 * net/tramp-sh.el (tramp-ssh-controlmaster-options): Change test for ControlPath in order to avoid DNS timeouts. diff --git a/lisp/ChangeLog b/lisp/ChangeLog index cbd1bce..9647822 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2015-03-17 Michael Albinus + + * net/tramp-sh.el (tramp-ssh-controlmaster-options): Change test + for ControlPath in order to avoid DNS timeouts. (Bug#20015) + 2015-03-16 Alan Mackenzie Edebug: Allow "S" to work during trace mode. Fixes debbugs #20074. diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el index 73ad8c7..b6c47bc 100644 --- a/lisp/net/tramp-sh.el +++ b/lisp/net/tramp-sh.el @@ -4565,7 +4565,7 @@ Gateway hops are already opened." ;; In case the host name is not used for the remote shell ;; command, the user could be misguided by applying a random - ;; hostname. + ;; host name. (let* ((v (car target-alist)) (method (tramp-file-name-method v)) (host (tramp-file-name-host v))) @@ -4611,9 +4611,13 @@ Gateway hops are already opened." (setq tramp-ssh-controlmaster-options "-o ControlMaster=auto"))) (unless (zerop (length tramp-ssh-controlmaster-options)) (with-temp-buffer + ;; When we use a non-existing host name, we could run + ;; into DNS timeouts. So we use "localhost" with an + ;; improper port, expecting nobody runs sshd on the + ;; telnet port. (tramp-call-process vec "ssh" nil t nil - "-o" "ControlPath=%C" "host.does.not.exist") + "-p" "23" "-o" "ControlPath=%C" "localhost") (goto-char (point-min)) (setq tramp-ssh-controlmaster-options (if (search-forward-regexp "unknown.+key" nil t) commit b0743354e5502395f9a64b534a5ff5579c64ed42 Author: Alan Mackenzie Date: Mon Mar 16 22:10:00 2015 +0000 Edebug: Allow "S" to work during trace mode. Fixes debbugs #20074. Also display the overlay arrow in go and go-nonstop modes. * emacs-lisp/edebug.el (edebug--display-1): Move the `input-pending' test to after trace mode's `sit-for'. (edebug--recursive-edit): Insert "(sit-for 0)" after "(edebug-overlay-arrow)". diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 41898be..cbd1bce 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,13 @@ +2015-03-16 Alan Mackenzie + + Edebug: Allow "S" to work during trace mode. Fixes debbugs #20074. + Also display the overlay arrow in go and go-nonstop modes. + + * emacs-lisp/edebug.el (edebug--display-1): Move the + `input-pending' test to after trace mode's `sit-for'. + (edebug--recursive-edit): Insert "(sit-for 0)" after + "(edebug-overlay-arrow)". + 2015-03-16 Stefan Monnier * emacs-lisp/cl-macs.el (cl--transform-lambda): Rework to avoid diff --git a/lisp/emacs-lisp/edebug.el b/lisp/emacs-lisp/edebug.el index 333f028..aa7cdf9 100644 --- a/lisp/emacs-lisp/edebug.el +++ b/lisp/emacs-lisp/edebug.el @@ -2446,15 +2446,6 @@ MSG is printed after `::::} '." edebug-function) )) - ;; Test if there is input, not including keyboard macros. - (if (input-pending-p) - (progn - (setq edebug-execution-mode 'step - edebug-stop t) - (edebug-stop) - ;; (discard-input) ; is this unfriendly?? - )) - ;; Make sure we bind those in the right buffer (bug#16410). (let ((overlay-arrow-position overlay-arrow-position) (overlay-arrow-string overlay-arrow-string)) @@ -2507,14 +2498,18 @@ MSG is printed after `::::} '." ((eq edebug-execution-mode 'Trace-fast) (sit-for 0))) ; Force update and continue. + (when (input-pending-p) + (setq edebug-stop t) + (setq edebug-execution-mode 'step) ; for `edebug-overlay-arrow' + (edebug-stop)) + + (edebug-overlay-arrow) + (unwind-protect (if (or edebug-stop (memq edebug-execution-mode '(step next)) (eq arg-mode 'error)) - (progn - ;; (setq edebug-execution-mode 'step) - ;; (edebug-overlay-arrow) ; This doesn't always show up. - (edebug--recursive-edit arg-mode))) ; <--- Recursive edit + (edebug--recursive-edit arg-mode)) ; <--- Recursive edit ;; Reset the edebug-window-data to whatever it is now. (let ((window (if (eq (window-buffer) edebug-buffer) @@ -2702,8 +2697,9 @@ MSG is printed after `::::} '." (if (buffer-name edebug-buffer) ; if it still exists (progn (set-buffer edebug-buffer) - (if (memq edebug-execution-mode '(go Go-nonstop)) - (edebug-overlay-arrow)) + (when (memq edebug-execution-mode '(go Go-nonstop)) + (edebug-overlay-arrow) + (sit-for 0)) (edebug-mode -1)) ;; gotta have a buffer to let its buffer local variables be set (get-buffer-create " bogus edebug buffer")) @@ -2721,7 +2717,7 @@ MSG is printed after `::::} '." (step . "=>") (next . "=>") (go . "<>") - (Go-nonstop . "..") ; not used + (Go-nonstop . "..") ) "Association list of arrows for each edebug mode.") commit a961dcedeb7ae84c0ca6e8e1b94d3dd881a26b98 Author: Ken Brown Date: Mon Mar 16 12:25:42 2015 -0400 Don't test "\t" in file names on Cygwin. Fixes: debbugs:20119 * test/automated/tramp-tests.el (tramp--test-special-characters): Don't test "\t" in file names on Cygwin. diff --git a/test/ChangeLog b/test/ChangeLog index 6a474e1..a7d1dfd 100644 --- a/test/ChangeLog +++ b/test/ChangeLog @@ -1,3 +1,8 @@ +2015-03-16 Ken Brown + + * automated/tramp-tests.el (tramp--test-special-characters): Don't + test "\t" in file names on Cygwin. (Bug#20119) + 2015-03-10 Jackson Ray Hamilton * indent/js-indent-init-dynamic.js: Fix spelling error. diff --git a/test/automated/tramp-tests.el b/test/automated/tramp-tests.el index 020f31f..9ba6743 100644 --- a/test/automated/tramp-tests.el +++ b/test/automated/tramp-tests.el @@ -1621,12 +1621,15 @@ This requires restrictions of file name syntax." (defun tramp--test-special-characters () "Perform the test in `tramp-test30-special-characters*'." - ;; Newlines, slashes and backslashes in file names are not supported. - ;; So we don't test. + ;; Newlines, slashes and backslashes in file names are not + ;; supported. So we don't test. And we don't test the tab + ;; character on Windows or Cygwin, because the backslash is + ;; interpreted as a path separator, preventing "\t" from being + ;; expanded to . (tramp--test-check-files (if (tramp--test-smb-or-windows-nt-p) "foo bar baz" - (if (tramp--test-adb-p) + (if (or (tramp--test-adb-p) (eq system-type 'cygwin)) " foo bar baz " " foo\tbar baz\t")) "$foo$bar$$baz$" commit 801eda8a2a00b3f28a69ffe51b05a649fffc5c58 Author: Stefan Monnier Date: Mon Mar 16 16:11:38 2015 -0400 * lisp/emacs-lisp/cl-macs.el (cl--transform-lambda): Optimize &aux. Rework to avoid cl--do-arglist in more cases; add comments to explain what's going on. (cl--do-&aux): New function extracted from cl--do-arglist. (cl--do-arglist): Use it. * lisp/emacs-lisp/cl-generic.el: Add Version: header, for ELPA purposes. diff --git a/lisp/ChangeLog b/lisp/ChangeLog index e9e910a..41898be 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,12 @@ 2015-03-16 Stefan Monnier + * emacs-lisp/cl-macs.el (cl--transform-lambda): Rework to avoid + cl--do-arglist in more cases; add comments to explain what's going on. + (cl--do-&aux): New function extracted from cl--do-arglist. + (cl--do-arglist): Use it. + + * emacs-lisp/cl-generic.el: Add Version: header, for ELPA purposes. + * obsolete/iswitchb.el (iswitchb-read-buffer): Add `predicate' arg. * isearchb.el (isearchb-iswitchb): Adjust accordingly. * ido.el (ido-read-buffer): Add `predicate' argument. diff --git a/lisp/emacs-lisp/cl-generic.el b/lisp/emacs-lisp/cl-generic.el index a8483ea..41c760e 100644 --- a/lisp/emacs-lisp/cl-generic.el +++ b/lisp/emacs-lisp/cl-generic.el @@ -3,6 +3,7 @@ ;; Copyright (C) 2015 Free Software Foundation, Inc. ;; Author: Stefan Monnier +;; Version: 1.0 ;; This file is part of GNU Emacs. diff --git a/lisp/emacs-lisp/cl-macs.el b/lisp/emacs-lisp/cl-macs.el index 36f263c..712a748 100644 --- a/lisp/emacs-lisp/cl-macs.el +++ b/lisp/emacs-lisp/cl-macs.el @@ -220,7 +220,20 @@ The name is made by appending a number to PREFIX, default \"G\"." (defconst cl--lambda-list-keywords '(&optional &rest &key &allow-other-keys &aux &whole &body &environment)) -(defvar cl--bind-block) (defvar cl--bind-defs) (defvar cl--bind-enquote) +;; Internal hacks used in formal arg lists: +;; - &cl-quote: Added to formal-arglists to mean that any default value +;; mentioned in the formal arglist should be considered as implicitly +;; quoted rather than evaluated. This is used in `cl-defsubst' when +;; performing compiler-macro-expansion, since at that time the +;; arguments hold expressions rather than values. +;; - &cl-defs (DEF . DEFS): Gives the default value to use for missing +;; optional arguments which don't have an explicit default value. +;; DEFS is an alist mapping vars to their default default value. +;; and DEF is the default default to use for all other vars. + +(defvar cl--bind-block) ;Name of surrounding block, only use for `signal' data. +(defvar cl--bind-defs) ;(DEF . DEFS) giving the "default default" for optargs. +(defvar cl--bind-enquote) ;Non-nil if &cl-quote was in the formal arglist! (defvar cl--bind-lets) (defvar cl--bind-forms) (defun cl--transform-lambda (form bind-block) @@ -229,19 +242,26 @@ BIND-BLOCK is the name of the symbol to which the function will be bound, and which will be used for the name of the `cl-block' surrounding the function's body. FORM is of the form (ARGS . BODY)." - ;; FIXME: (lambda (a &aux b) 1) expands to (lambda (a &rest --cl-rest--) ...) - ;; where the --cl-rest-- is clearly undesired. (let* ((args (car form)) (body (cdr form)) (orig-args args) (cl--bind-block bind-block) (cl--bind-defs nil) (cl--bind-enquote nil) - (cl--bind-lets nil) (cl--bind-forms nil) (parsed-body (macroexp-parse-body body)) (header (car parsed-body)) (simple-args nil)) (setq body (cdr parsed-body)) + ;; "(. X) to (&rest X)" conversion already done in cl--do-arglist, but we + ;; do it here as well, so as to be able to see if we can avoid + ;; cl--do-arglist. (setq args (if (listp args) (cl-copy-list args) (list '&rest args))) (let ((p (last args))) (if (cdr p) (setcdr p (list '&rest (cdr p))))) - (if (setq cl--bind-defs (cadr (memq '&cl-defs args))) - (setq args (delq '&cl-defs (delq cl--bind-defs args)) - cl--bind-defs (cadr cl--bind-defs))) + (let ((cl-defs (memq '&cl-defs args))) + (when cl-defs + (setq cl--bind-defs (cadr cl-defs)) + ;; Remove "&cl-defs DEFS" from args. + (setcdr cl-defs (cddr cl-defs)) + (setq args (delq '&cl-defs args)) + ;; Optimize away trivial &cl-defs. + (if (and (null (car cl--bind-defs)) + (cl-every (lambda (x) (null (cadr x))) (cdr cl--bind-defs))) + (setq cl--bind-defs nil)))) (if (setq cl--bind-enquote (memq '&cl-quote args)) (setq args (delq '&cl-quote args))) (if (memq '&whole args) (error "&whole not currently implemented")) @@ -249,6 +269,9 @@ FORM is of the form (ARGS . BODY)." (v (cadr p))) (if p (setq args (nconc (delq (car p) (delq v args)) `(&aux (,v macroexpand-all-environment)))))) + ;; Take away all the simple args whose parsing can be handled more + ;; efficiently by a plain old `lambda' than the manual parsing generated + ;; by `cl--do-arglist'. (while (and args (symbolp (car args)) (not (memq (car args) '(nil &rest &body &key &aux))) (not (and (eq (car args) '&optional) @@ -256,30 +279,50 @@ FORM is of the form (ARGS . BODY)." (push (pop args) simple-args)) (or (eq cl--bind-block 'cl-none) (setq body (list `(cl-block ,cl--bind-block ,@body)))) - (if (null args) - (cl-list* nil (nreverse simple-args) (nconc header body)) - (if (memq '&optional simple-args) (push '&optional args)) - (cl--do-arglist args nil (- (length simple-args) - (if (memq '&optional simple-args) 1 0))) - (setq cl--bind-lets (nreverse cl--bind-lets)) - (cl-list* nil - (nconc (nreverse simple-args) - (list '&rest (car (pop cl--bind-lets)))) - (nconc (save-match-data ;; Macro expansion can take place in the - ;; middle of apparently harmless computation, so it - ;; should not touch the match-data. - (require 'help-fns) - (cons (help-add-fundoc-usage - (if (stringp (car header)) (pop header)) - ;; Be careful with make-symbol and (back)quote, - ;; see bug#12884. - (let ((print-gensym nil) (print-quoted t)) - (format "%S" (cons 'fn (cl--make-usage-args - orig-args))))) - header)) - (list `(let* ,cl--bind-lets - ,@(nreverse cl--bind-forms) - ,@body))))))) + (let* ((cl--bind-lets nil) (cl--bind-forms nil) + (rest-args + (cond + ((null args) nil) + ((eq (car args) '&aux) + (cl--do-&aux args) + (setq cl--bind-lets (nreverse cl--bind-lets)) + nil) + (t ;; `simple-args' doesn't handle all the parsing that we need, + ;; so we pass the rest to cl--do-arglist which will do + ;; "manual" parsing. + (let ((slen (length simple-args))) + (when (memq '&optional simple-args) + (push '&optional args) (cl-decf slen)) + (setq header + ;; Macro expansion can take place in the middle of + ;; apparently harmless computation, so it should not + ;; touch the match-data. + (save-match-data + (require 'help-fns) + (cons (help-add-fundoc-usage + (if (stringp (car header)) (pop header)) + ;; Be careful with make-symbol and (back)quote, + ;; see bug#12884. + (let ((print-gensym nil) (print-quoted t)) + (format "%S" (cons 'fn (cl--make-usage-args + orig-args))))) + header))) + ;; FIXME: we'd want to choose an arg name for the &rest param + ;; and pass that as `expr' to cl--do-arglist, but that ends up + ;; generating code with a redundant let-binding, so we instead + ;; pass a dummy and then look in cl--bind-lets to find what var + ;; this was bound to. + (cl--do-arglist args :dummy slen) + (setq cl--bind-lets (nreverse cl--bind-lets)) + ;; (cl-assert (eq :dummy (nth 1 (car cl--bind-lets)))) + (list '&rest (car (pop cl--bind-lets)))))))) + `(nil + (,@(nreverse simple-args) ,@rest-args) + ,@header + ,(macroexp-let* cl--bind-lets + (macroexp-progn + `(,@(nreverse cl--bind-forms) + ,@body))))))) ;;;###autoload (defmacro cl-defun (name args &rest body) @@ -422,8 +465,7 @@ its argument list allows full Common Lisp conventions." (setcdr last nil) (nconc (cl--make-usage-args arglist) (cl--make-usage-var tail))) (setcdr last tail))) - ;; `orig-args' can contain &cl-defs (an internal - ;; CL thingy I don't understand), so remove it. + ;; `orig-args' can contain &cl-defs. (let ((x (memq '&cl-defs arglist))) (when x (setq arglist (delq (car x) (remq (cadr x) arglist))))) (let ((state nil)) @@ -450,6 +492,17 @@ its argument list allows full Common Lisp conventions." )))) arglist)))) +(defun cl--do-&aux (args) + (while (and (eq (car args) '&aux) (pop args)) + (while (and args (not (memq (car args) cl--lambda-list-keywords))) + (if (consp (car args)) + (if (and cl--bind-enquote (cl-cadar args)) + (cl--do-arglist (caar args) + `',(cadr (pop args))) + (cl--do-arglist (caar args) (cadr (pop args)))) + (cl--do-arglist (pop args) nil)))) + (if args (error "Malformed argument list ends with: %S" args))) + (defun cl--do-arglist (args expr &optional num) ; uses cl--bind-* (if (nlistp args) (if (or (memq args cl--lambda-list-keywords) (not (symbolp args))) @@ -459,8 +512,7 @@ its argument list allows full Common Lisp conventions." (let ((p (last args))) (if (cdr p) (setcdr p (list '&rest (cdr p))))) (let ((p (memq '&body args))) (if p (setcar p '&rest))) (if (memq '&environment args) (error "&environment used incorrectly")) - (let ((save-args args) - (restarg (memq '&rest args)) + (let ((restarg (memq '&rest args)) (safety (if (cl--compiling-file) cl--optimize-safety 3)) (keys nil) (laterarg nil) (exactarg nil) minarg) @@ -530,7 +582,12 @@ its argument list allows full Common Lisp conventions." (intern (format ":%s" name))))) (varg (if (consp (car arg)) (cl-cadar arg) (car arg))) (def (if (cdr arg) (cadr arg) - (or (car cl--bind-defs) (cadr (assq varg cl--bind-defs))))) + ;; The ordering between those two or clauses is + ;; irrelevant, since in practice only one of the two + ;; is ever non-nil (the car is only used for + ;; cl-deftype which doesn't use the cdr). + (or (car cl--bind-defs) + (cadr (assq varg cl--bind-defs))))) (look `(plist-member ,restarg ',karg))) (and def cl--bind-enquote (setq def `',def)) (if (cddr arg) @@ -567,15 +624,8 @@ its argument list allows full Common Lisp conventions." keys) (car ,var))))))) (push `(let ((,var ,restarg)) ,check) cl--bind-forms))) - (while (and (eq (car args) '&aux) (pop args)) - (while (and args (not (memq (car args) cl--lambda-list-keywords))) - (if (consp (car args)) - (if (and cl--bind-enquote (cl-cadar args)) - (cl--do-arglist (caar args) - `',(cadr (pop args))) - (cl--do-arglist (caar args) (cadr (pop args)))) - (cl--do-arglist (pop args) nil)))) - (if args (error "Malformed argument list %s" save-args))))) + (cl--do-&aux args) + nil))) (defun cl--arglist-args (args) (if (nlistp args) (list args) @@ -2608,7 +2658,7 @@ non-nil value, that slot cannot be set via `setf'. (make (cl-mapcar (function (lambda (s d) (if (memq s anames) s d))) slots defaults))) (push `(cl-defsubst ,name - (&cl-defs '(nil ,@descs) ,@args) + (&cl-defs (nil ,@descs) ,@args) ,@(if (cl--safe-expr-p `(progn ,@(mapcar #'cl-second descs))) '((declare (side-effect-free t)))) (,(or type #'vector) ,@make)) @@ -2716,8 +2766,8 @@ Of course, we really can't know that for sure, so it's just a heuristic." (t (inline-quote (or (cl-typep ,val ',head) (cl-typep ,val ',rest))))))))) - (`(member . ,args) - (inline-quote (and (memql ,val ',args) t))) + (`(eql ,v) (inline-quote (and (eql ,val ',v) t))) + (`(member . ,args) (inline-quote (and (memql ,val ',args) t))) (`(satisfies ,pred) (inline-quote (funcall #',pred ,val))) ((and (pred symbolp) type (guard (get type 'cl-deftype-handler))) (inline-quote @@ -2977,7 +3027,7 @@ The type name can then be used in `cl-typecase', `cl-check-type', etc." (declare (debug cl-defmacro) (doc-string 3) (indent 2)) `(cl-eval-when (compile load eval) (put ',name 'cl-deftype-handler - (cl-function (lambda (&cl-defs '('*) ,@arglist) ,@body))))) + (cl-function (lambda (&cl-defs ('*) ,@arglist) ,@body))))) (cl-deftype extended-char () `(and character (not base-char))) diff --git a/test/automated/cl-lib-tests.el b/test/automated/cl-lib-tests.el index 1c36e7d..2c188a4 100644 --- a/test/automated/cl-lib-tests.el +++ b/test/automated/cl-lib-tests.el @@ -427,4 +427,21 @@ (ert-deftest cl-flet-test () (should (equal (cl-flet ((f1 (x) x)) (let ((x #'f1)) (funcall x 5))) 5))) +(ert-deftest cl-lib-test-typep () + (cl-deftype cl-lib-test-type (&optional x) `(member ,x)) + ;; Make sure we correctly implement the rule that deftype's optional args + ;; default to `*' rather than to nil. + (should (cl-typep '* 'cl-lib-test-type)) + (should-not (cl-typep 1 'cl-lib-test-type))) + +(ert-deftest cl-lib-arglist-performance () + ;; An `&aux' should not cause lambda's arglist to be turned into an &rest + ;; that's parsed by hand. + (should (eq () (nth 1 (nth 1 (macroexpand + '(cl-function (lambda (&aux (x 1)) x))))))) + (cl-defstruct (cl-lib--s (:constructor cl-lib--s-make (&optional a))) a) + ;; Similarly the &cl-defs thingy shouldn't cause fallback to manual parsing + ;; of args if the default for optional args is nil. + (should (equal '(&optional a) (help-function-arglist 'cl-lib--s-make)))) + ;;; cl-lib.el ends here commit f925fc93bac41d7622d1af927e33b0e738ff55b0 Author: Stefan Monnier Date: Mon Mar 16 14:49:01 2015 -0400 Add `predicate' arg to `read-buffer' and use it for erc-iswitchb Fixes: debbugs:20116 * src/minibuf.c (Fread_buffer): Add `predicate' argument. * src/callint.c (Fcall_interactively): Adjust calls accordingly. * lisp/erc/erc.el (erc-switch-to-buffer): Rename from erc-iswitchb and rewrite using read-buffer. (erc--buffer-p): New function, extracted from erc-buffer-filter. (erc-buffer-filter): Use it. (erc-with-all-buffers-of-server): Silence compile warning if the return value is unused. (erc-is-valid-nick-p, erc-common-server-suffixes, erc-get-arglist) (erc-command-name, erc-popup-input-buffer): Use \` and \' to match beg/end of string. * lisp/obsolete/iswitchb.el (iswitchb-read-buffer): Add `predicate' arg. * lisp/isearchb.el (isearchb-iswitchb): Adjust accordingly. * lisp/ido.el (ido-read-buffer): Add `predicate' argument. * lisp/misearch.el (unload-function-defs-list): Declare before use. diff --git a/etc/NEWS b/etc/NEWS index 24ed079..cabd008 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -594,6 +594,8 @@ a typographically-correct documents. * Incompatible Lisp Changes in Emacs 25.1 +** read-buffer-function can now be called with a 4th argument (`predicate'). + ** completion-table-dynamic stays in the minibuffer. If you want the old behavior of calling the function in the buffer from which the minibuffer was entered, call it with the new argument @@ -631,6 +633,8 @@ word syntax, use `\sw' instead. * Lisp Changes in Emacs 25.1 +** `read-buffer' takes a new `predicate' argument. + ** Emacs Lisp now supports generators. ** New finalizer facility for running code when objects diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 1383fdb..e9e910a 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,10 @@ +2015-03-16 Stefan Monnier + + * obsolete/iswitchb.el (iswitchb-read-buffer): Add `predicate' arg. + * isearchb.el (isearchb-iswitchb): Adjust accordingly. + * ido.el (ido-read-buffer): Add `predicate' argument. + * misearch.el (unload-function-defs-list): Declare before use. + 2015-03-16 Vibhav Pant * net/browse-url.el (browse-url-browser-function): Add "Conkeror". diff --git a/lisp/emulation/viper-init.el b/lisp/emulation/viper-init.el index 75932a8..e575eee 100644 --- a/lisp/emulation/viper-init.el +++ b/lisp/emulation/viper-init.el @@ -463,7 +463,7 @@ color displays. By default, the delimiters are used only on TTYs." :type 'boolean :group 'viper) -(defcustom viper-read-buffer-function 'read-buffer +(defcustom viper-read-buffer-function #'read-buffer "Function to use for prompting the user for a buffer name." :type 'symbol :group 'viper) diff --git a/lisp/erc/ChangeLog b/lisp/erc/ChangeLog index 4f5fced..e75b8cc 100644 --- a/lisp/erc/ChangeLog +++ b/lisp/erc/ChangeLog @@ -1,3 +1,15 @@ +2015-03-16 Stefan Monnier + + * erc.el (erc-switch-to-buffer): Rename from erc-iswitchb and rewrite + using read-buffer (bug#20116). + (erc--buffer-p): New function, extracted from erc-buffer-filter. + (erc-buffer-filter): Use it. + (erc-with-all-buffers-of-server): Silence compile warning if the return + value is unused. + (erc-is-valid-nick-p, erc-common-server-suffixes, erc-get-arglist) + (erc-command-name, erc-popup-input-buffer): Use \` and \' to match + beg/end of string. + 2015-03-03 Kelvin White * erc.el: Add old version string back to file header for diff --git a/lisp/erc/erc.el b/lisp/erc/erc.el index a84f9f0..7e76a6d 100644 --- a/lisp/erc/erc.el +++ b/lisp/erc/erc.el @@ -1110,7 +1110,7 @@ which the local user typed." (define-key map "\C-a" 'erc-bol) (define-key map [home] 'erc-bol) (define-key map "\C-c\C-a" 'erc-bol) - (define-key map "\C-c\C-b" 'erc-iswitchb) + (define-key map "\C-c\C-b" 'erc-switch-to-buffer) (define-key map "\C-c\C-c" 'erc-toggle-interpret-controls) (define-key map "\C-c\C-d" 'erc-input-action) (define-key map "\C-c\C-e" 'erc-toggle-ctcp-autoresponse) @@ -1647,6 +1647,14 @@ If PROC is not supplied, all processes are searched." (throw 'buffer (current-buffer))))) proc)))) +(defun erc--buffer-p (buf predicate proc) + (with-current-buffer buf + (and (derived-mode-p 'erc-mode) + (or (not proc) + (eq proc erc-server-process)) + (funcall predicate) + buf))) + (defun erc-buffer-filter (predicate &optional proc) "Return a list of `erc-mode' buffers matching certain criteria. PREDICATE is a function executed with each buffer, if it returns t, that buffer @@ -1659,12 +1667,7 @@ server connection, or nil which means all open connections." nil (mapcar (lambda (buf) (when (buffer-live-p buf) - (with-current-buffer buf - (and (eq major-mode 'erc-mode) - (or (not proc) - (eq proc erc-server-process)) - (funcall predicate) - buf)))) + (erc--buffer-p buf predicate proc))) (buffer-list))))) (defun erc-buffer-list (&optional predicate proc) @@ -1695,42 +1698,32 @@ nil." ,pro)))) ;; Silence the byte-compiler by binding the result of mapcar to ;; a variable. + (ignore res) res))) -;; (iswitchb-mode) will autoload iswitchb.el -(defvar iswitchb-temp-buflist) -(declare-function iswitchb-read-buffer "iswitchb" - (prompt &optional default require-match start matches-set)) -(defvar iswitchb-make-buflist-hook) - -(defun erc-iswitchb (&optional arg) - "Use `iswitchb-read-buffer' to prompt for a ERC buffer to switch to. +(define-obsolete-function-alias 'erc-iswitchb 'erc-switch-to-buffer "25.1") +(defun erc-switch-to-buffer (&optional arg) + "Prompt for a ERC buffer to switch to. When invoked with prefix argument, use all erc buffers. Without prefix ARG, allow only buffers related to same session server. If `erc-track-mode' is in enabled, put the last element of -`erc-modified-channels-alist' in front of the buffer list. - -Due to some yet unresolved reason, global function `iswitchb-mode' -needs to be active for this function to work." +`erc-modified-channels-alist' in front of the buffer list." (interactive "P") - (let ((enabled (bound-and-true-p iswitchb-mode))) - (or enabled (iswitchb-mode 1)) - (unwind-protect - (let ((iswitchb-make-buflist-hook - (lambda () - (setq iswitchb-temp-buflist - (mapcar 'buffer-name - (erc-buffer-list - nil - (when arg erc-server-process))))))) - (switch-to-buffer - (iswitchb-read-buffer - "Switch-to: " - (if (boundp 'erc-modified-channels-alist) - (buffer-name (caar (last erc-modified-channels-alist))) - nil) - t))) - (or enabled (iswitchb-mode -1))))) + (switch-to-buffer + (read-buffer "Switch to ERC buffer: " + (when (boundp 'erc-modified-channels-alist) + (buffer-name (caar (last erc-modified-channels-alist)))) + t + ;; Only allow ERC buffers in the same session. + (let ((proc (unless arg erc-server-process))) + (lambda (bufname) + (let ((buf (get-buffer bufname))) + (when buf + (erc--buffer-p buf (lambda () t) proc) + (with-current-buffer buf + (and (derived-mode-p 'erc-mode) + (or (null proc) + (eq proc erc-server-process))))))))))) (defun erc-channel-list (proc) "Return a list of channel buffers. @@ -2189,7 +2182,7 @@ be invoked for the values of the other parameters." Arguments are the same as for `erc'." (interactive (erc-select-read-args)) (let ((erc-server-connect-function 'erc-open-tls-stream)) - (apply 'erc r))) + (apply #'erc r))) (defun erc-open-tls-stream (name buffer host port) "Open an TLS stream to an IRC server. @@ -2403,7 +2396,7 @@ If STRING is nil, the function does nothing." (defun erc-is-valid-nick-p (nick) "Check if NICK is a valid IRC nickname." - (string-match (concat "^" erc-valid-nick-regexp "$") nick)) + (string-match (concat "\\`" erc-valid-nick-regexp "\\'") nick)) (defun erc-display-line (string &optional buffer) "Display STRING in the ERC BUFFER. @@ -2602,9 +2595,9 @@ server within `erc-lurker-threshold-time'. See also erc-lurker-threshold-time)))) (defcustom erc-common-server-suffixes - '(("openprojects.net$" . "OPN") - ("freenode.net$" . "freenode") - ("oftc.net$" . "OFTC")) + '(("openprojects.net\\'" . "OPN") + ("freenode.net\\'" . "freenode") + ("oftc.net\\'" . "OFTC")) "Alist of common server name suffixes. This variable is used in mode-line display to save screen real estate. Set it to nil if you want to avoid changing @@ -2640,7 +2633,7 @@ ARGS, PARSED, and TYPE are used to format MSG sensibly. See also `erc-format-message' and `erc-display-line'." (let ((string (if (symbolp msg) - (apply 'erc-format-message msg args) + (apply #'erc-format-message msg args) msg))) (setq string (cond @@ -2689,7 +2682,7 @@ See also `erc-server-send'." (defun erc-get-arglist (fun) "Return the argument list of a function without the parens." (let ((arglist (format "%S" (erc-function-arglist fun)))) - (if (string-match "^(\\(.*\\))$" arglist) + (if (string-match "\\`(\\(.*\\))\\'" arglist) (match-string 1 arglist) arglist))) @@ -2705,7 +2698,7 @@ is not alive, nil otherwise." "For CMD being the function name of a ERC command, something like erc-cmd-FOO, this returns a string /FOO." (let ((command-name (symbol-name cmd))) - (if (string-match "^erc-cmd-\\(.*\\)$" command-name) + (if (string-match "\\`erc-cmd-\\(.*\\)\\'" command-name) (concat "/" (match-string 1 command-name)) command-name))) @@ -2796,7 +2789,7 @@ VALUE is computed by evaluating the rest of LINE in Lisp." (erc-display-line (concat "Available user variables:\n" (apply - 'concat + #'concat (mapcar (lambda (var) (let ((val (symbol-value var))) @@ -3775,7 +3768,7 @@ Unban all currently banned users in the current channel." t))) (erc-server-send (format "MODE %s b" chnl))))) - (t (let ((bans (mapcar 'cdr erc-channel-banlist))) + (t (let ((bans (mapcar #'cdr erc-channel-banlist))) (when bans ;; Glob the bans into groups of three, and carry out the unban. ;; eg. /mode #foo -bbb a*!*@* b*!*@* c*!*@* @@ -3930,7 +3923,7 @@ If `point' is at the beginning of a channel name, use that as default." (concat "Set topic of " (erc-default-target) ": ") (when erc-channel-topic (let ((ss (split-string erc-channel-topic "\C-o"))) - (cons (apply 'concat (if (cdr ss) (butlast ss) ss)) + (cons (apply #'concat (if (cdr ss) (butlast ss) ss)) 0)))))) (let ((topic-list (split-string topic "\C-o"))) ; strip off the topic setter (erc-cmd-TOPIC (concat (erc-default-target) " " (car topic-list))))) @@ -5052,7 +5045,7 @@ arg-modes is a list of triples of the form: (MODE-CHAR ON/OFF ARGUMENT)." (if (string-match "^\\s-*\\(\\S-+\\)\\(\\s-.*$\\|$\\)" mode-string) - (let ((chars (mapcar 'char-to-string (match-string 1 mode-string))) + (let ((chars (mapcar #'char-to-string (match-string 1 mode-string))) ;; arguments in channel modes (args-str (match-string 2 mode-string)) (args nil) @@ -5998,7 +5991,7 @@ Returns a list of the form (HIGH LOW), compatible with Emacs time format." (if (> minutes 0) `("%d minutes, %d seconds" ,minutes ,seconds) `("%d seconds" ,seconds)))) - output (apply 'format format-args)) + output (apply #'format format-args)) ;; Change all "1 units" to "1 unit". (while (string-match "\\([^0-9]\\|^\\)1 \\S-+\\(s\\)" output) (setq output (erc-replace-match-subexpression-in-string @@ -6246,7 +6239,7 @@ if `erc-away' is non-nil." (defun erc-format-channel-modes () "Return the current channel's modes." - (concat (apply 'concat + (concat (apply #'concat "+" erc-channel-modes) (cond ((and erc-channel-user-limit erc-channel-key) (if erc-show-channel-key-p @@ -6438,7 +6431,7 @@ All windows are opened in the current frame." "Mode: " (mapcar (lambda (e) (list (symbol-name e))) - (apropos-internal "-mode$" 'commandp)) + (apropos-internal "-mode\\'" 'commandp)) nil t)))) (pop-to-buffer (make-indirect-buffer (current-buffer) buffer-name)) (funcall mode) @@ -6634,7 +6627,7 @@ See also `format-spec'." (error "No format spec for message %s" msg)) (when (functionp entry) (setq entry (apply entry args))) - (format-spec entry (apply 'format-spec-make args)))) + (format-spec entry (apply #'format-spec-make args)))) ;;; Various hook functions diff --git a/lisp/ido.el b/lisp/ido.el index 563f406..60a59d6 100644 --- a/lisp/ido.el +++ b/lisp/ido.el @@ -1590,10 +1590,10 @@ enable the mode if ARG is omitted or nil." (when ido-everywhere (when (memq ido-mode '(both file)) (put 'ido-everywhere 'file (cons read-file-name-function nil)) - (setq read-file-name-function 'ido-read-file-name)) + (setq read-file-name-function #'ido-read-file-name)) (when (memq ido-mode '(both buffer)) (put 'ido-everywhere 'buffer (cons read-buffer-function nil)) - (setq read-buffer-function 'ido-read-buffer)))) + (setq read-buffer-function #'ido-read-buffer)))) (defvar ido-minor-mode-map-entry nil) @@ -4782,7 +4782,7 @@ Modified from `icomplete-completions'." (put 'dired-do-rename 'ido 'ignore) ;;;###autoload -(defun ido-read-buffer (prompt &optional default require-match) +(defun ido-read-buffer (prompt &optional default require-match predicate) "Ido replacement for the built-in `read-buffer'. Return the name of a buffer selected. PROMPT is the prompt to give to the user. DEFAULT if given is the default @@ -4796,7 +4796,7 @@ If REQUIRE-MATCH is non-nil, an existing buffer must be selected." (if (eq ido-exit 'fallback) (let ((read-buffer-function nil)) (run-hook-with-args 'ido-before-fallback-functions 'read-buffer) - (read-buffer prompt default require-match)) + (read-buffer prompt default require-match predicate)) buf))) ;;;###autoload diff --git a/lisp/isearchb.el b/lisp/isearchb.el index ffd4d62..5e7771c 100644 --- a/lisp/isearchb.el +++ b/lisp/isearchb.el @@ -75,7 +75,9 @@ ;; killing iswitchb.el and then trying to switch back is broken ;; make sure TAB isn't broken -(require 'iswitchb) +;;; Code: + +(require 'iswitchb) ;FIXME: Don't rely on iswitchb! (defgroup isearchb nil "Switch between buffers using a mechanism like isearch." @@ -118,7 +120,7 @@ Its purpose is to pass different call arguments to (interactive) (let* ((prompt "iswitch ") (iswitchb-method 'samewindow) - (buf (iswitchb-read-buffer prompt nil nil iswitchb-text t))) + (buf (iswitchb-read-buffer prompt nil nil nil iswitchb-text t))) (if (eq iswitchb-exit 'findfile) (call-interactively 'find-file) (when buf diff --git a/lisp/misearch.el b/lisp/misearch.el index dcc8195..6596911 100644 --- a/lisp/misearch.el +++ b/lisp/misearch.el @@ -234,7 +234,7 @@ set in `multi-isearch-buffers' or `multi-isearch-buffers-regexp'." (ido-ignore-item-temp-list bufs)) (while (not (string-equal (setq buf (read-buffer - (if (eq read-buffer-function 'ido-read-buffer) + (if (eq read-buffer-function #'ido-read-buffer) "Next buffer to search (C-j to end): " "Next buffer to search (RET to end): ") nil t)) @@ -377,6 +377,8 @@ whose file names match the specified wildcard." (goto-char (if isearch-forward (point-min) (point-max))) (isearch-forward-regexp nil t))) +(defvar unload-function-defs-list) + (defun multi-isearch-unload-function () "Remove autoloaded variables from `unload-function-defs-list'. Also prevent the feature from being reloaded via `isearch-mode-hook'." diff --git a/lisp/obsolete/iswitchb.el b/lisp/obsolete/iswitchb.el index 6b1e534..111de85 100644 --- a/lisp/obsolete/iswitchb.el +++ b/lisp/obsolete/iswitchb.el @@ -175,10 +175,10 @@ ;; iswitchb-read-buffer has been written to be a drop in replacement ;; for the normal buffer selection routine `read-buffer'. To use ;; iswitch for all buffer selections in Emacs, add: -;; (setq read-buffer-function 'iswitchb-read-buffer) +;; (setq read-buffer-function #'iswitchb-read-buffer) ;; (This variable was introduced in Emacs 20.3.) ;; XEmacs users can get the same behavior by doing: -;; (defalias 'read-buffer 'iswitchb-read-buffer) +;; (defalias 'read-buffer #'iswitchb-read-buffer) ;; since `read-buffer' is defined in lisp. ;; Using iswitchb for other completion tasks. @@ -586,7 +586,7 @@ in a separate window. )))) (defun iswitchb-read-buffer (prompt &optional default require-match - start matches-set) + _predicate start matches-set) "Replacement for the built-in `read-buffer'. Return the name of a buffer selected. PROMPT is the prompt to give to the user. diff --git a/lisp/replace.el b/lisp/replace.el index e0636e0..70b86dd 100644 --- a/lisp/replace.el +++ b/lisp/replace.el @@ -1369,7 +1369,7 @@ See also `multi-occur-in-matching-buffers'." (ido-ignore-item-temp-list bufs)) (while (not (string-equal (setq buf (read-buffer - (if (eq read-buffer-function 'ido-read-buffer) + (if (eq read-buffer-function #'ido-read-buffer) "Next buffer to search (C-j to end): " "Next buffer to search (RET to end): ") nil t)) diff --git a/src/ChangeLog b/src/ChangeLog index e328afc..fbf8fb4 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2015-03-16 Stefan Monnier + + * minibuf.c (Fread_buffer): Add `predicate' argument. + * callint.c (Fcall_interactively): Adjust calls accordingly. + 2015-03-15 Eli Zaretskii * xdisp.c (handle_invisible_prop): Fix up it->position even when diff --git a/src/callint.c b/src/callint.c index 0c6c030..cf50e0c 100644 --- a/src/callint.c +++ b/src/callint.c @@ -531,13 +531,13 @@ invoke it. If KEYS is omitted or nil, the return value of args[i] = Fcurrent_buffer (); if (EQ (selected_window, minibuf_window)) args[i] = Fother_buffer (args[i], Qnil, Qnil); - args[i] = Fread_buffer (callint_message, args[i], Qt); + args[i] = Fread_buffer (callint_message, args[i], Qt, Qnil); break; case 'B': /* Name of buffer, possibly nonexistent. */ args[i] = Fread_buffer (callint_message, Fother_buffer (Fcurrent_buffer (), Qnil, Qnil), - Qnil); + Qnil, Qnil); break; case 'c': /* Character. */ diff --git a/src/minibuf.c b/src/minibuf.c index e7c288b..c033169 100644 --- a/src/minibuf.c +++ b/src/minibuf.c @@ -1081,7 +1081,7 @@ A user option, or customizable variable, is one for which return Fintern (name, Qnil); } -DEFUN ("read-buffer", Fread_buffer, Sread_buffer, 1, 3, 0, +DEFUN ("read-buffer", Fread_buffer, Sread_buffer, 1, 4, 0, doc: /* Read the name of a buffer and return as a string. Prompt with PROMPT. Optional second arg DEF is value to return if user enters an empty line. @@ -1093,8 +1093,11 @@ The argument PROMPT should be a string ending with a colon and a space. If `read-buffer-completion-ignore-case' is non-nil, completion ignores case while reading the buffer name. If `read-buffer-function' is non-nil, this works by calling it as a -function, instead of the usual behavior. */) - (Lisp_Object prompt, Lisp_Object def, Lisp_Object require_match) +function, instead of the usual behavior. +Optional arg PREDICATE if non-nil is a function limiting the buffers that can +be considered. */) + (Lisp_Object prompt, Lisp_Object def, Lisp_Object require_match, + Lisp_Object predicate) { Lisp_Object result; char *s; @@ -1136,11 +1139,16 @@ function, instead of the usual behavior. */) } result = Fcompleting_read (prompt, intern ("internal-complete-buffer"), - Qnil, require_match, Qnil, + predicate, require_match, Qnil, Qbuffer_name_history, def, Qnil); } else - result = call3 (Vread_buffer_function, prompt, def, require_match); + result = (NILP (predicate) + /* Partial backward compatibility for older read_buffer_functions + which don't expect a `predicate' argument. */ + ? call3 (Vread_buffer_function, prompt, def, require_match) + : call4 (Vread_buffer_function, prompt, def, require_match, + predicate)); return unbind_to (count, result); } commit 43a847c02c3eb848cd0d55a4722bfe7f39b1112f Author: Vibhav Pant Date: Tue Mar 17 05:27:23 2015 +0530 Fixes: debbugs:19335 * net/browse-url.el (browse-url-browser-function): Add "Conkeror". (browse-url-conkeror-program, browse-url-conkeror-arguments) (browse-url-conkeror-new-window-is-buffer): New defcustoms. (browse-url-default-browser): Check for `browse-url-conkeror' and call `browse-url-conkeror-program'. (browse-url-conkeror): New command. (bug#19863) * etc/NEWS: Mention added support for Conkeror. diff --git a/etc/NEWS b/etc/NEWS index 491d0d3..24ed079 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -560,6 +560,10 @@ command line's password prompt. *** The new built-in command `clear' can scroll window contents out of sight. +** Browse-url + +*** browse-url now supports the Conkeror Web Browser. + +++ ** tar-mode: new `tar-new-entry' command, allowing for new members to be added to the archive. diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 3af4bb2..1383fdb 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,15 @@ 2015-03-16 Vibhav Pant + * net/browse-url.el (browse-url-browser-function): Add "Conkeror". + (browse-url-conkeror-program, browse-url-conkeror-arguments) + (browse-url-conkeror-new-window-is-buffer): New defcustoms. + (browse-url-default-browser): Check for `browse-url-conkeror' + and call `browse-url-conkeror-program'. + (browse-url-conkeror): New command. + (bug#19863) + +2015-03-16 Vibhav Pant + * eshell/esh-mode.el (eshell/clear): New function. 2015-03-16 Alan Mackenzie diff --git a/lisp/net/browse-url.el b/lisp/net/browse-url.el index 5e61c09..4b64d95 100644 --- a/lisp/net/browse-url.el +++ b/lisp/net/browse-url.el @@ -42,6 +42,7 @@ ;; browse-url-netscape Netscape 1.1b1 ;; browse-url-mosaic XMosaic/mMosaic <= 2.4 ;; browse-url-cci XMosaic 2.5 +;; browse-url-conkeror Conkeror Dont know ;; browse-url-w3 w3 0 ;; browse-url-w3-gnudoit w3 remotely ;; browse-url-text-* Any text browser 0 @@ -236,6 +237,7 @@ regexp should probably be \".\" to specify a default browser." (function-item :tag "Netscape" :value browse-url-netscape) (function-item :tag "Mosaic" :value browse-url-mosaic) (function-item :tag "Mosaic using CCI" :value browse-url-cci) + (function-item :tag "Conkeror" :value browse-url-conkeror) (function-item :tag "Text browser in an xterm window" :value browse-url-text-xterm) (function-item :tag "Text browser in an Emacs window" @@ -416,6 +418,13 @@ functionality is not available there." :type 'boolean :group 'browse-url) +(defcustom browse-url-conkeror-new-window-is-buffer nil + "Whether to open up new windows in a buffer or a new window. +If non-nill, then open the URL in a new buffer rather than a new window if +`browse-url-conkeror' is asked to open it in a new window" + :type 'boolean + :group 'browse-url) + (defcustom browse-url-galeon-new-window-is-tab nil "Whether to open up new windows in a tab or a new window. If non-nil, then open the URL in a new tab rather than a new window if @@ -462,6 +471,17 @@ commands reverses the effect of this variable. Requires Netscape version :type 'string :group 'browse-url) +(defcustom browse-url-conkeror-program "conkeror" + "The name by which to invoke Conkeror." + :type 'string + :version "25.1" + :group 'browse-url) + +(defcustom browse-url-conkeror-arguments nil + "A list of strings to pass to Conkeror as arguments." + :type '(repeat (string :tag "Argument")) + :group 'browse-url) + (defcustom browse-url-filename-alist `(("^/\\(ftp@\\|anonymous@\\)?\\([^:]+\\):/*" . "ftp://\\2/") ;; The above loses the username to avoid the browser prompting for @@ -936,6 +956,7 @@ used instead of `browse-url-new-window-flag'." ((executable-find browse-url-kde-program) 'browse-url-kde) ((executable-find browse-url-netscape-program) 'browse-url-netscape) ((executable-find browse-url-mosaic-program) 'browse-url-mosaic) + ((executable-find browse-url-conkeror-program) 'browse-url-conkeror) ((executable-find browse-url-xterm-program) 'browse-url-text-xterm) ((locate-library "w3") 'browse-url-w3) (t @@ -1359,6 +1380,41 @@ used instead of `browse-url-new-window-flag'." (process-send-string "browse-url" "disconnect\r\n") (delete-process "browse-url")) +;; --- Conkeror --- +;;;###autoload +(defun browse-url-conkeror (url &optional new-window) + "Ask the Conkeror WWW browser to load URL. +Default to the URL around or before point. The strings in the variable +`browse-url-conkeror-arguments' are also passed to Conkeror. + +When called interactively, if variable `browse-url-new-window-flag' +is non-nil, load the document in a new Conkeror window, otherwise use a random +existing one. A non-nil interactive prefix argument reverses the effect of +`browse-url-new-window-flag' + +If `browse-url-conkeror-new-window-is-buffer' then whenever a document would +otherwise be loaded in a new window, it is loaded in a new buffer in an existing +window instead. + +When called non-interatively, optional second argument NEW-WINDOW is used instead of +`browse-url-new-window-flag'" + (interactive (browse-url-interactive-arg "URL: ")) + (setq url (browse-url-encode-url url)) + (let* ((process-environment (browse-url-process-environment))) + (apply 'start-process (format "conkeror %s" url) + nil + browse-url-conkeror-program + (append + browse-url-conkeror-arguments + (list + "-e" + (format "load_url_in_new_%s('%s')" + (if (browse-url-maybe-new-window new-window) + (if browse-url-conkeror-new-window-is-buffer + "buffer" + "window") + "buffer") + url)))))) ;; --- W3 --- ;; External. commit ab4e4cc92c62051983f4ee5f1bf9c82440086451 Author: Vibhav Pant Date: Tue Mar 17 05:01:59 2015 +0530 Add 'clear' functionality to eshell. * eshell/esh-mode.el (eshell/clear): New function. * etc/NEWS: Mention new built-in command. diff --git a/etc/NEWS b/etc/NEWS index 75d55de..491d0d3 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -556,6 +556,10 @@ to avoid interfering with the kill ring. allow overriding the regular expression that recognizes the ldapsearch command line's password prompt. +** Eshell + +*** The new built-in command `clear' can scroll window contents out of sight. + +++ ** tar-mode: new `tar-new-entry' command, allowing for new members to be added to the archive. diff --git a/lisp/ChangeLog b/lisp/ChangeLog index c6fab7f..3af4bb2 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,7 @@ +2015-03-16 Vibhav Pant + + * eshell/esh-mode.el (eshell/clear): New function. + 2015-03-16 Alan Mackenzie Make Edebug work with Follow Mode. diff --git a/lisp/eshell/esh-mode.el b/lisp/eshell/esh-mode.el index da83ec6..15120cb 100644 --- a/lisp/eshell/esh-mode.el +++ b/lisp/eshell/esh-mode.el @@ -871,6 +871,13 @@ When run interactively, widen the buffer first." (goto-char (point-max)) (recenter -1)) +(defun eshell/clear () + "Scroll contents of eshell window out of sight, leaving a blank window." + (interactive) + (let ((number-newlines (count-lines (window-start) (point)))) + (insert (make-string number-newlines ?\n))) + (eshell-send-input)) + (defun eshell-get-old-input (&optional use-current-region) "Return the command input on the current line." (if use-current-region commit 3eb4d23a7cdee6f763b5be4947f70a1040c25424 Author: Alan Mackenzie Date: Mon Mar 16 14:48:09 2015 +0000 Make Edebug work with Follow Mode. * emacs-lisp/edebug.el (edebug--display-1): Remove call to edebug-adjust-window. (edebug--recursive-edit): Don't bind pre/post-command-hooks to nil over the recursive edit. (edebug-adjust-window): Remove. diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 747a1d6..c6fab7f 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,13 @@ +2015-03-16 Alan Mackenzie + + Make Edebug work with Follow Mode. + + * emacs-lisp/edebug.el (edebug--display-1): Remove call to + edebug-adjust-window. + (edebug--recursive-edit): Don't bind pre/post-command-hooks to nil + over the recursive edit. + (edebug-adjust-window): Remove. + 2015-03-15 Michael Albinus * net/tramp-adb.el: diff --git a/lisp/emacs-lisp/edebug.el b/lisp/emacs-lisp/edebug.el index 1091877..333f028 100644 --- a/lisp/emacs-lisp/edebug.el +++ b/lisp/emacs-lisp/edebug.el @@ -2446,9 +2446,6 @@ MSG is printed after `::::} '." edebug-function) )) - (setcdr edebug-window-data - (edebug-adjust-window (cdr edebug-window-data))) - ;; Test if there is input, not including keyboard macros. (if (input-pending-p) (progn @@ -2677,12 +2674,6 @@ MSG is printed after `::::} '." (defining-kbd-macro (if edebug-continue-kbd-macro defining-kbd-macro)) - ;; Disable command hooks. This is essential when - ;; a hook function is instrumented - to avoid infinite loop. - ;; This may be more than we need, however. - (pre-command-hook nil) - (post-command-hook nil) - ;; others?? ) @@ -2722,31 +2713,6 @@ MSG is printed after `::::} '." ;;; Display related functions -(defun edebug-adjust-window (old-start) - ;; If pos is not visible, adjust current window to fit following context. - ;; (message "window: %s old-start: %s window-start: %s pos: %s" - ;; (selected-window) old-start (window-start) (point)) (sit-for 5) - (if (not (pos-visible-in-window-p)) - (progn - ;; First try old-start - (if old-start - (set-window-start (selected-window) old-start)) - (if (not (pos-visible-in-window-p)) - (progn - ;; (message "resetting window start") (sit-for 2) - (set-window-start - (selected-window) - (save-excursion - (forward-line - (if (< (point) (window-start)) -1 ; one line before if in back - (- (/ (window-height) 2)) ; center the line moving forward - )) - (beginning-of-line) - (point))))))) - (window-start)) - - - (defconst edebug-arrow-alist '((Continue-fast . "=") (Trace-fast . "-")