------------------------------------------------------------ revno: 116871 committer: Daniel Colascione branch nick: trunk timestamp: Sun 2014-03-23 20:06:35 -0700 message: Improve performance of &key parsing diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2014-03-23 23:14:52 +0000 +++ lisp/ChangeLog 2014-03-24 03:06:35 +0000 @@ -1,3 +1,8 @@ +2014-03-24 Daniel Colascione + + * emacs-lisp/cl-macs.el (cl--do-arglist): Use `plist-member' + instead of cl-loop search function. + 2014-03-23 Lars Ingebrigtsen * calendar/parse-time.el (parse-time-iso8601-regexp) === modified file 'lisp/emacs-lisp/cl-macs.el' --- lisp/emacs-lisp/cl-macs.el 2014-03-23 06:02:36 +0000 +++ lisp/emacs-lisp/cl-macs.el 2014-03-24 03:06:35 +0000 @@ -503,8 +503,7 @@ (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))))) - (look `(cl-loop for cl--arg on ,restarg by #'cddr - when (eq (car cl--arg) ',karg) return cl--arg))) + (look `(plist-member ,restarg ',karg))) (and def cl--bind-enquote (setq def `',def)) (if (cddr arg) (let* ((temp (or (nth 2 arg) (make-symbol "--cl-var--"))) ------------------------------------------------------------ revno: 116870 committer: Katsumi Yamaoka branch nick: trunk timestamp: Mon 2014-03-24 01:56:03 +0000 message: lisp/gnus/mml.el: Require url when compiling diff: === modified file 'lisp/gnus/ChangeLog' --- lisp/gnus/ChangeLog 2014-03-24 00:42:10 +0000 +++ lisp/gnus/ChangeLog 2014-03-24 01:56:03 +0000 @@ -1,5 +1,7 @@ 2014-03-24 Katsumi Yamaoka + * mml.el: Require url when compiling. + * gnus-cloud.el (gnus-cloud-parse-version-1): Use plist-get rather than CL's getf. (gnus-activate-group, gnus-subscribe-group): Declare. === modified file 'lisp/gnus/mml.el' --- lisp/gnus/mml.el 2014-03-23 23:13:36 +0000 +++ lisp/gnus/mml.el 2014-03-24 01:56:03 +0000 @@ -28,6 +28,7 @@ (require 'mm-decode) (require 'mml-sec) (eval-when-compile (require 'cl)) +(eval-when-compile (require 'url)) (eval-when-compile (when (featurep 'xemacs) (require 'easy-mmode))) ; for `define-minor-mode' ------------------------------------------------------------ revno: 116869 committer: Katsumi Yamaoka branch nick: trunk timestamp: Mon 2014-03-24 00:42:10 +0000 message: lisp/gnus/ChangeLog: Fix last commit diff: === modified file 'lisp/gnus/ChangeLog' --- lisp/gnus/ChangeLog 2014-03-24 00:35:00 +0000 +++ lisp/gnus/ChangeLog 2014-03-24 00:42:10 +0000 @@ -4,7 +4,7 @@ Use plist-get rather than CL's getf. (gnus-activate-group, gnus-subscribe-group): Declare. - * gnus-sum.el (gnus-mime-buttonize-attachments-in-header: Declare. + * gnus-sum.el (gnus-mime-buttonize-attachments-in-header): Declare. 2014-03-23 Katsumi Yamaoka ------------------------------------------------------------ revno: 116868 committer: Katsumi Yamaoka branch nick: trunk timestamp: Mon 2014-03-24 00:35:00 +0000 message: Gnus: silence the byte compiler * gnus-cloud.el (gnus-cloud-parse-version-1): Use plist-get rather than CL's getf. (gnus-activate-group, gnus-subscribe-group): Declare. * gnus-sum.el (gnus-mime-buttonize-attachments-in-header: Declare. diff: === modified file 'lisp/gnus/ChangeLog' --- lisp/gnus/ChangeLog 2014-03-23 23:13:36 +0000 +++ lisp/gnus/ChangeLog 2014-03-24 00:35:00 +0000 @@ -1,3 +1,11 @@ +2014-03-24 Katsumi Yamaoka + + * gnus-cloud.el (gnus-cloud-parse-version-1): + Use plist-get rather than CL's getf. + (gnus-activate-group, gnus-subscribe-group): Declare. + + * gnus-sum.el (gnus-mime-buttonize-attachments-in-header: Declare. + 2014-03-23 Katsumi Yamaoka * gnus-sum.el (gnus-summary-toggle-header): Display header attachment === modified file 'lisp/gnus/gnus-cloud.el' --- lisp/gnus/gnus-cloud.el 2014-03-24 00:13:12 +0000 +++ lisp/gnus/gnus-cloud.el 2014-03-24 00:35:00 +0000 @@ -125,7 +125,7 @@ (let ((spec (ignore-errors (read (current-buffer)))) length) (when (and (consp spec) - (memq (getf spec :type) '(:file :data :deleta))) + (memq (plist-get spec :type) '(:file :data :deleta))) (setq length (plist-get spec :length)) (push (append spec (list @@ -229,6 +229,11 @@ (string< old timestamp)) timestamp))) +(declare-function gnus-activate-group "gnus-start" + (group &optional scan dont-check method dont-sub-check)) +(declare-function gnus-subscribe-group "gnus-start" + (group &optional previous method)) + (defun gnus-cloud-ensure-cloud-group () (let ((method (if (stringp gnus-cloud-method) (gnus-server-to-method gnus-cloud-method) === modified file 'lisp/gnus/gnus-sum.el' --- lisp/gnus/gnus-sum.el 2014-03-23 23:13:36 +0000 +++ lisp/gnus/gnus-sum.el 2014-03-24 00:35:00 +0000 @@ -9783,6 +9783,8 @@ (declare-function article-narrow-to-head "gnus-art" ()) (declare-function gnus-article-hidden-text-p "gnus-art" (type)) (declare-function gnus-delete-wash-type "gnus-art" (type)) +(declare-function gnus-mime-buttonize-attachments-in-header + "gnus-art" (&optional interactive)) (defun gnus-summary-toggle-header (&optional arg) "Show the headers if they are hidden, or hide them if they are shown. ------------------------------------------------------------ revno: 116867 committer: Katsumi Yamaoka branch nick: trunk timestamp: Mon 2014-03-24 00:13:12 +0000 message: (no message) diff: === added file 'lisp/gnus/gnus-cloud.el' --- lisp/gnus/gnus-cloud.el 1970-01-01 00:00:00 +0000 +++ lisp/gnus/gnus-cloud.el 2014-03-24 00:13:12 +0000 @@ -0,0 +1,327 @@ +;;; gnus-cloud.el --- storing and retrieving data via IMAP + +;; Copyright (C) 2014 Free Software Foundation, Inc. + +;; Author: Lars Magne Ingebrigtsen +;; Keywords: mail + +;; This file is part of GNU Emacs. + +;; GNU Emacs is free software: you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation, either version 3 of the License, or +;; (at your option) any later version. + +;; GNU Emacs is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with GNU Emacs. If not, see . + +;;; Commentary: + +;;; Code: + +(eval-when-compile (require 'cl)) +(require 'parse-time) +(require 'nnimap) + +(defgroup gnus-cloud nil + "Syncing Gnus data via IMAP." + :group 'gnus) + +(defcustom gnus-cloud-synced-files + '(;;"~/.authinfo" + "~/.authinfo.gpg" + "~/.gnus.el" + (:directory "~/News" :match ".*.SCORE\\'")) + "List of file regexps that should be kept up-to-date via the cloud." + :group 'gnus-cloud + :type '(repeat regexp)) + +(defvar gnus-cloud-group-name "*Emacs Cloud*") +(defvar gnus-cloud-covered-servers nil) + +(defvar gnus-cloud-version 1) +(defvar gnus-cloud-sequence 1) + +(defvar gnus-cloud-method nil + "The IMAP select method used to store the cloud data.") + +(defun gnus-cloud-make-chunk (elems) + (with-temp-buffer + (insert (format "Version %s\n" gnus-cloud-version)) + (insert (gnus-cloud-insert-data elems)) + (buffer-string))) + +(defun gnus-cloud-insert-data (elems) + (mm-with-unibyte-buffer + (dolist (elem elems) + (cond + ((eq (plist-get elem :type) :file) + (let (length data) + (mm-with-unibyte-buffer + (insert-file-contents-literally (plist-get elem :file-name)) + (setq length (buffer-size) + data (buffer-string))) + (insert (format "(:type :file :file-name %S :timestamp %S :length %d)\n" + (plist-get elem :file-name) + (plist-get elem :timestamp) + length)) + (insert data) + (insert "\n"))) + ((eq (plist-get elem :type) :data) + (insert (format "(:type :data :name %S :length %d)\n" + (plist-get elem :name) + (with-current-buffer (plist-get elem :buffer) + (buffer-size)))) + (insert-buffer-substring (plist-get elem :buffer)) + (insert "\n")) + ((eq (plist-get elem :type) :delete) + (insert (format "(:type :delete :file-name %S)\n" + (plist-get elem :file-name)))))) + (gnus-cloud-encode-data) + (buffer-string))) + +(defun gnus-cloud-encode-data () + (call-process-region (point-min) (point-max) "gzip" + t (current-buffer) nil + "-c") + (base64-encode-region (point-min) (point-max))) + +(defun gnus-cloud-decode-data () + (base64-decode-region (point-min) (point-max)) + (call-process-region (point-min) (point-max) "gunzip" + t (current-buffer) nil + "-c")) + +(defun gnus-cloud-parse-chunk () + (save-excursion + (goto-char (point-min)) + (unless (looking-at "Version \\([0-9]+\\)") + (error "Not a valid Cloud chunk in the current buffer")) + (forward-line 1) + (let ((version (string-to-number (match-string 1))) + (data (buffer-substring (point) (point-max)))) + (mm-with-unibyte-buffer + (insert data) + (cond + ((= version 1) + (gnus-cloud-decode-data) + (goto-char (point-min)) + (gnus-cloud-parse-version-1)) + (t + (error "Unsupported Cloud chunk version %s" version))))))) + +(defun gnus-cloud-parse-version-1 () + (let ((elems nil)) + (while (not (eobp)) + (while (and (not (eobp)) + (not (looking-at "(:type"))) + (forward-line 1)) + (unless (eobp) + (let ((spec (ignore-errors (read (current-buffer)))) + length) + (when (and (consp spec) + (memq (getf spec :type) '(:file :data :deleta))) + (setq length (plist-get spec :length)) + (push (append spec + (list + :contents (buffer-substring (1+ (point)) + (+ (point) 1 length)))) + elems) + (goto-char (+ (point) 1 length)))))) + (nreverse elems))) + +(defun gnus-cloud-update-data (elems) + (dolist (elem elems) + (let ((type (plist-get elem :type))) + (cond + ((eq type :data) + ) + ((eq type :delete) + (gnus-cloud-delete-file (plist-get elem :file-name)) + ) + ((eq type :file) + (gnus-cloud-update-file elem)) + (t + (message "Unknown type %s; ignoring" type)))))) + +(defun gnus-cloud-update-file (elem) + (let ((file-name (plist-get elem :file-name)) + (date (plist-get elem :timestamp)) + (contents (plist-get elem :contents))) + (unless (gnus-cloud-file-covered-p file-name) + (message "%s isn't covered by the cloud; ignoring" file-name)) + (when (or (not (file-exists-p file-name)) + (and (file-exists-p file-name) + (mm-with-unibyte-buffer + (insert-file-contents-literally file-name) + (not (equal (buffer-string) contents))))) + (gnus-cloud-replace-file file-name date contents)))) + +(defun gnus-cloud-replace-file (file-name date new-contents) + (mm-with-unibyte-buffer + (insert new-contents) + (when (file-exists-p file-name) + (rename-file file-name (car (find-backup-file-name file-name)))) + (write-region (point-min) (point-max) file-name) + (set-file-times file-name (parse-iso8601-time-string date)))) + +(defun gnus-cloud-delete-file (file-name) + (unless (gnus-cloud-file-covered-p file-name) + (message "%s isn't covered by the cloud; ignoring" file-name)) + (when (file-exists-p file-name) + (rename-file file-name (car (find-backup-file-name file-name))))) + +(defun gnus-cloud-file-covered-p (file-name) + (let ((matched nil)) + (dolist (elem gnus-cloud-synced-files) + (cond + ((stringp elem) + (when (equal elem file-name) + (setq matched t))) + ((consp elem) + (when (and (equal (directory-file-name (plist-get elem :directory)) + (directory-file-name (file-name-directory file-name))) + (string-match (plist-get elem :match) + (file-name-nondirectory file-name))) + (setq matched t))))) + matched)) + +(defun gnus-cloud-all-files () + (let ((files nil)) + (dolist (elem gnus-cloud-synced-files) + (cond + ((stringp elem) + (push elem files)) + ((consp elem) + (dolist (file (directory-files (plist-get elem :directory) + nil + (plist-get elem :match))) + (push (format "%s/%s" + (directory-file-name (plist-get elem :directory)) + file) + files))))) + (nreverse files))) + +(defvar gnus-cloud-file-timestamps nil) + +(defun gnus-cloud-files-to-upload (&optional full) + (let ((files nil) + timestamp) + (dolist (file (gnus-cloud-all-files)) + (if (file-exists-p file) + (when (setq timestamp (gnus-cloud-file-new-p file full)) + (push `(:type :file :file-name ,file :timestamp ,timestamp) files)) + (when (assoc file gnus-cloud-file-timestamps) + (push `(:type :delete :file-name ,file) files)))) + (nreverse files))) + +(defun gnus-cloud-file-new-p (file full) + (let ((timestamp (format-time-string + "%FT%T%z" (nth 5 (file-attributes file)))) + (old (cadr (assoc file gnus-cloud-file-timestamps)))) + (when (or full + (null old) + (string< old timestamp)) + timestamp))) + +(defun gnus-cloud-ensure-cloud-group () + (let ((method (if (stringp gnus-cloud-method) + (gnus-server-to-method gnus-cloud-method) + gnus-cloud-method))) + (unless (or (gnus-active gnus-cloud-group-name) + (gnus-activate-group gnus-cloud-group-name nil nil + gnus-cloud-method)) + (and (gnus-request-create-group gnus-cloud-group-name gnus-cloud-method) + (gnus-activate-group gnus-cloud-group-name nil nil gnus-cloud-method) + (gnus-subscribe-group gnus-cloud-group-name))))) + +(defun gnus-cloud-upload-data (&optional full) + (gnus-cloud-ensure-cloud-group) + (with-temp-buffer + (let ((elems (gnus-cloud-files-to-upload full))) + (insert (format "Subject: (sequence: %d type: %s)\n" + gnus-cloud-sequence + (if full :full :partial))) + (insert "From: nobody@invalid.com\n") + (insert "\n") + (insert (gnus-cloud-make-chunk elems)) + (when (gnus-request-accept-article gnus-cloud-group-name gnus-cloud-method + t t) + (setq gnus-cloud-sequence (1+ gnus-cloud-sequence)) + (gnus-cloud-add-timestamps elems))))) + +(defun gnus-cloud-add-timestamps (elems) + (dolist (elem elems) + (let* ((file-name (plist-get elem :file-name)) + (old (assoc file-name gnus-cloud-file-timestamps))) + (when old + (setq gnus-cloud-file-timestamps + (delq old gnus-cloud-file-timestamps))) + (push (list file-name (plist-get elem :timestamp)) + gnus-cloud-file-timestamps)))) + +(defun gnus-cloud-available-chunks () + (gnus-activate-group gnus-cloud-group-name nil nil gnus-cloud-method) + (let* ((group (gnus-group-full-name gnus-cloud-group-name gnus-cloud-method)) + (active (gnus-active group)) + headers head) + (when (gnus-retrieve-headers (gnus-uncompress-range active) group) + (with-current-buffer nntp-server-buffer + (goto-char (point-min)) + (while (and (not (eobp)) + (setq head (nnheader-parse-head))) + (push head headers)))) + (sort (nreverse headers) + (lambda (h1 h2) + (> (gnus-cloud-chunk-sequence (mail-header-subject h1)) + (gnus-cloud-chunk-sequence (mail-header-subject h2))))))) + +(defun gnus-cloud-chunk-sequence (string) + (if (string-match "sequence: \\([0-9]+\\)" string) + (string-to-number (match-string 1 string)) + 0)) + +(defun gnus-cloud-prune-old-chunks (headers) + (let ((headers (reverse headers)) + (found nil)) + (while (and headers + (not found)) + (when (string-match "type: :full" (mail-header-subject (car headers))) + (setq found t)) + (pop headers)) + ;; All the chunks that are older than the newest :full chunk can be + ;; deleted. + (when headers + (gnus-request-expire-articles + (mapcar (lambda (h) + (mail-header-number h)) + (nreverse headers)) + (gnus-group-full-name gnus-cloud-group-name gnus-cloud-method))))) + +(defun gnus-cloud-download-data () + (let ((articles nil) + chunks) + (dolist (header (gnus-cloud-available-chunks)) + (when (> (gnus-cloud-chunk-sequence (mail-header-subject header)) + gnus-cloud-sequence) + (push (mail-header-number header) articles))) + (when articles + (nnimap-request-articles (nreverse articles) gnus-cloud-group-name) + (with-current-buffer nntp-server-buffer + (goto-char (point-min)) + (while (re-search-forward "^Version " nil t) + (beginning-of-line) + (push (gnus-cloud-parse-chunk) chunks) + (forward-line 1)))))) + +(defun gnus-cloud-server-p (server) + (member server gnus-cloud-covered-servers)) + +(provide 'gnus-cloud) + +;;; gnus-cloud.el ends here ------------------------------------------------------------ revno: 116866 author: Gnus developers committer: Katsumi Yamaoka branch nick: trunk timestamp: Sun 2014-03-23 23:16:06 +0000 message: Merge from Gnus git master 2014-03-14 Katsumi Yamaoka * gnus.texi (Ma Gnus): Mention header attachment buttons. 2014-03-05 Lars Ingebrigtsen * emacs-mime.texi (MML Definition): Document recipient-filename. 2014-02-05 Katsumi Yamaoka * gnus.texi (MIME Commands): Mention gnus-mime-buttonize-attachments-in-header and gnus-mime-display-attachment-buttons-in-header. 2014-02-01 Lars Ingebrigtsen * message.texi (Forwarding): Mention `message-forward-included-headers'. 2014-01-31 Lars Ingebrigtsen * gnus.texi: w3 is no longer supported by Gnus. diff: === modified file 'doc/misc/ChangeLog' --- doc/misc/ChangeLog 2014-03-22 23:47:20 +0000 +++ doc/misc/ChangeLog 2014-03-23 23:16:06 +0000 @@ -1,3 +1,26 @@ +2014-03-23 Katsumi Yamaoka + + * gnus.texi (Ma Gnus): Mention header attachment buttons. + +2014-03-23 Lars Ingebrigtsen + + * emacs-mime.texi (MML Definition): Document recipient-filename. + +2014-03-23 Katsumi Yamaoka + + * gnus.texi (MIME Commands): Mention + gnus-mime-buttonize-attachments-in-header and + gnus-mime-display-attachment-buttons-in-header. + +2014-03-23 Lars Ingebrigtsen + + * message.texi (Forwarding): Mention + `message-forward-included-headers'. + +2014-03-23 Lars Ingebrigtsen + + * gnus.texi: w3 is no longer supported by Gnus. + 2014-03-22 Glenn Morris * efaq.texi (Informational files for Emacs): Do not mention etc/GNU. === modified file 'doc/misc/emacs-mime.texi' --- doc/misc/emacs-mime.texi 2014-01-24 03:57:53 +0000 +++ doc/misc/emacs-mime.texi 2014-03-23 23:16:06 +0000 @@ -405,7 +405,7 @@ @item mm-text-html-renderer @vindex mm-text-html-renderer This selects the function used to render @acronym{HTML}. The predefined -renderers are selected by the symbols @code{gnus-article-html}, @code{w3}, +renderers are selected by the symbols @code{gnus-article-html}, @code{w3m}@footnote{See @uref{http://emacs-w3m.namazu.org/} for more information about emacs-w3m}, @code{links}, @code{lynx}, @code{w3m-standalone} or @code{html2text}. If @code{nil} use an @@ -418,11 +418,11 @@ @samp{} tags. It is likely to be intended to verify whether you have read the mail. You can prevent your personal information from leaking by setting this option to @code{nil} (which is the default). -It is currently ignored by Emacs/w3. For emacs-w3m, you may use the -command @kbd{t} on the image anchor to show an image even if it is -@code{nil}.@footnote{The command @kbd{T} will load all images. If you -have set the option @code{w3m-key-binding} to @code{info}, use @kbd{i} -or @kbd{I} instead.} +For emacs-w3m, you may use the command @kbd{t} on the image anchor to +show an image even if it is @code{nil}.@footnote{The command @kbd{T} +will load all images. If you have set the option +@code{w3m-key-binding} to @code{info}, use @kbd{i} or @kbd{I} +instead.} @item mm-w3m-safe-url-regexp @vindex mm-w3m-safe-url-regexp @@ -648,6 +648,12 @@ Use the contents of the file in the body of the part (@code{Content-Disposition}). +@item recipient-filename +Use this as the file name in the generated @acronym{MIME} message for +the recipient. That is, even if the file is called @file{foo.txt} +locally, use this name instead in the @code{Content-Disposition} in +the sent message. + @item charset The contents of the body of the part are to be encoded in the character set specified (@code{Content-Type}). @xref{Charset Translation}. === modified file 'doc/misc/gnus-faq.texi' --- doc/misc/gnus-faq.texi 2014-01-06 05:25:46 +0000 +++ doc/misc/gnus-faq.texi 2014-03-23 23:16:06 +0000 @@ -723,7 +723,7 @@ the top of the article buffer? * FAQ 4-6:: I'd like Gnus NOT to render HTML-mails but show me the text part if it's available. How to do it? -* FAQ 4-7:: Can I use some other browser than w3 to render my +* FAQ 4-7:: Can I use some other browser than shr to render my HTML-mails? * FAQ 4-8:: Is there anything I can do to make poorly formatted mails more readable? @@ -868,12 +868,12 @@ @node FAQ 4-7 @subsubheading Question 4.7 -Can I use some other browser than w3 to render my HTML-mails? +Can I use some other browser than w3m to render my HTML-mails? @subsubheading Answer Only if you use Gnus 5.10 or younger. In this case you've got the -choice between w3, w3m, links, lynx and html2text, which +choice between shr, w3m, links, lynx and html2text, which one is used can be specified in the variable mm-text-html-renderer, so if you want links to render your mail say === modified file 'doc/misc/gnus.texi' --- doc/misc/gnus.texi 2014-03-12 20:52:34 +0000 +++ doc/misc/gnus.texi 2014-03-23 23:16:06 +0000 @@ -704,7 +704,6 @@ * Archiving Mail:: * Web Searches:: Creating groups from articles that match a string. * RSS:: Reading RDF site summary. -* Customizing W3:: Doing stuff to Emacs/W3 from Gnus. Other Sources @@ -9140,9 +9139,6 @@ @item gnus-w3m Use Gnus rendered based on w3m. -@item w3 -Use Emacs/W3. - @item w3m Use @uref{http://emacs-w3m.namazu.org/, emacs-w3m}. @@ -9805,6 +9801,19 @@ mostly useful if you wish to save (or perform other actions) on inlined parts. +@item W M h +@kindex W M h (Summary) +@findex gnus-mime-buttonize-attachments-in-header +@vindex gnus-mime-display-attachment-buttons-in-header +Display @acronym{MIME} part buttons in the end of the header of an +article (@code{gnus-mime-buttonize-attachments-in-header}). This +command toggles the display. Note that buttons to be added to the +header are only the ones that aren't inlined in the body. If you want +those buttons always to be displayed, set +@code{gnus-mime-display-attachment-buttons-in-header} to non-@code{nil}. +The default is @code{t}. To change the appearance of buttons, customize +@code{gnus-header-face-alist}. + @item K m @kindex K m (Summary) @findex gnus-summary-repair-multipart @@ -16841,12 +16850,8 @@ * Archiving Mail:: * Web Searches:: Creating groups from articles that match a string. * RSS:: Reading RDF site summary. -* Customizing W3:: Doing stuff to Emacs/W3 from Gnus. @end menu -All the web sources require Emacs/W3 and the url library or those -alternatives to work. - The main caveat with all these web sources is that they probably won't work for a very long time. Gleaning information from the @acronym{HTML} data is guesswork at best, and when the layout is altered, the Gnus back end @@ -16922,10 +16927,6 @@ community. Since @code{nnweb} washes the ads off all the articles, one might think that the providers might be somewhat miffed. We'll see. -You must have the @code{url} and @code{W3} package or those alternatives -(try @code{customize-group} on the @samp{mm-url} variable group) -installed to be able to use @code{nnweb}. - Virtual server variables: @table @code @@ -17123,38 +17124,6 @@ @end lisp -@node Customizing W3 -@subsection Customizing W3 -@cindex W3 -@cindex html -@cindex url -@cindex Netscape - -Gnus uses the url library to fetch web pages and Emacs/W3 (or those -alternatives) to display web pages. Emacs/W3 is documented in its own -manual, but there are some things that may be more relevant for Gnus -users. - -For instance, a common question is how to make Emacs/W3 follow links -using the @code{browse-url} functions (which will call some external web -browser like Netscape). Here's one way: - -@lisp -(eval-after-load "w3" - '(progn - (fset 'w3-fetch-orig (symbol-function 'w3-fetch)) - (defun w3-fetch (&optional url target) - (interactive (list (w3-read-url-with-default))) - (if (eq major-mode 'gnus-article-mode) - (browse-url url) - (w3-fetch-orig url target))))) -@end lisp - -Put that in your @file{.emacs} file, and hitting links in W3-rendered -@acronym{HTML} in the Gnus article buffers will use @code{browse-url} to -follow the link. - - @node Other Sources @section Other Sources @@ -26338,7 +26307,7 @@ whatever packages the Gnus XEmacs package requires. The current requirements are @samp{gnus}, @samp{mail-lib}, @samp{xemacs-base}, @samp{eterm}, @samp{sh-script}, @samp{net-utils}, @samp{os-utils}, -@samp{dired}, @samp{mh-e}, @samp{sieve}, @samp{ps-print}, @samp{W3}, +@samp{dired}, @samp{mh-e}, @samp{sieve}, @samp{ps-print}, @samp{pgg}, @samp{mailcrypt}, @samp{ecrypto}, and @samp{sasl}. @@ -28415,6 +28384,19 @@ @itemize @bullet +@item Changes in summary and article mode +@c ************************************** + +@itemize @bullet + +@item +By default, @acronym{MIME} part buttons for attachments (if any) will +appear in the end of the article header in addition to the bottom of the +article body, so you can easily find them without scrolling the article +again and again. @xref{MIME Commands}. + +@end itemize + @item Changes in Message mode and related Gnus features @c **************************************************** === modified file 'doc/misc/message.texi' --- doc/misc/message.texi 2014-03-12 20:52:34 +0000 +++ doc/misc/message.texi 2014-03-23 23:16:06 +0000 @@ -310,7 +310,13 @@ @table @code @item message-forward-ignored-headers @vindex message-forward-ignored-headers -All headers that match this regexp will be deleted when forwarding a message. +In non-@code{nil}, all headers that match this regexp will be deleted +when forwarding a message. + +@item message-forward-included-headers +@vindex message-forward-included-headers +In non-@code{nil}, only headers that match this regexp will be kept +when forwarding a message. @item message-make-forward-subject-function @vindex message-make-forward-subject-function ------------------------------------------------------------ revno: 116865 author: Gnus developers committer: Katsumi Yamaoka branch nick: trunk timestamp: Sun 2014-03-23 23:14:52 +0000 message: Merge from Gnus git master 2014-02-04 Lars Ingebrigtsen * calendar/parse-time.el (parse-time-iso8601-regexp) (parse-iso8601-time-string): Copied from `url-dav' so that we can use it more generally. 2014-02-01 Lars Ingebrigtsen * net/dns.el (network-interface-list): Define for XEmacs. 2014-01-31 Magnus Henoch * net/dns.el (dns-servers-up-to-date-p): New function to see whether the network interfaces changed. (dns-query): Use it to flush the data. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2014-03-23 18:13:35 +0000 +++ lisp/ChangeLog 2014-03-23 23:14:52 +0000 @@ -1,3 +1,19 @@ +2014-03-23 Lars Ingebrigtsen + + * calendar/parse-time.el (parse-time-iso8601-regexp) + (parse-iso8601-time-string): Copied from `url-dav' so that we can use + it more generally. + +2014-03-23 Lars Ingebrigtsen + + * net/dns.el (network-interface-list): Define for XEmacs. + +2014-03-23 Magnus Henoch + + * net/dns.el (dns-servers-up-to-date-p): New function to see whether + the network interfaces changed. + (dns-query): Use it to flush the data. + 2014-03-23 Juanma Barranquero * vc/vc.el (vc-rollback): Use set-buffer-modified-p. === modified file 'lisp/calendar/parse-time.el' --- lisp/calendar/parse-time.el 2014-01-01 07:43:34 +0000 +++ lisp/calendar/parse-time.el 2014-03-23 23:14:52 +0000 @@ -218,6 +218,68 @@ (rplaca (nthcdr (pop slots) time) new-val)))))))) time)) +(defconst parse-time-iso8601-regexp + (let* ((dash "-?") + (colon ":?") + (4digit "\\([0-9][0-9][0-9][0-9]\\)") + (2digit "\\([0-9][0-9]\\)") + (date-fullyear 4digit) + (date-month 2digit) + (date-mday 2digit) + (time-hour 2digit) + (time-minute 2digit) + (time-second 2digit) + (time-secfrac "\\(\\.[0-9]+\\)?") + (time-numoffset (concat "[-+]\\(" time-hour "\\):" time-minute)) + (time-offset (concat "Z" time-numoffset)) + (partial-time (concat time-hour colon time-minute colon time-second + time-secfrac)) + (full-date (concat date-fullyear dash date-month dash date-mday)) + (full-time (concat partial-time time-offset)) + (date-time (concat full-date "T" full-time))) + (list (concat "^" full-date) + (concat "T" partial-time) + (concat "Z" time-numoffset))) + "List of regular expressions matching ISO 8601 dates. +1st regular expression matches the date. +2nd regular expression matches the time. +3rd regular expression matches the (optional) timezone specification.") + +(defun parse-iso8601-time-string (date-string) + (let* ((date-re (nth 0 parse-time-iso8601-regexp)) + (time-re (nth 1 parse-time-iso8601-regexp)) + (tz-re (nth 2 parse-time-iso8601-regexp)) + re-start + time seconds minute hour fractional-seconds + day month year day-of-week dst tz) + ;; We need to populate 'time' with + ;; (SEC MIN HOUR DAY MON YEAR DOW DST TZ) + + ;; Nobody else handles iso8601 correctly, let's do it ourselves. + (when (string-match date-re date-string re-start) + (setq year (string-to-number (match-string 1 date-string)) + month (string-to-number (match-string 2 date-string)) + day (string-to-number (match-string 3 date-string)) + re-start (match-end 0)) + (when (string-match time-re date-string re-start) + (setq hour (string-to-number (match-string 1 date-string)) + minute (string-to-number (match-string 2 date-string)) + seconds (string-to-number (match-string 3 date-string)) + fractional-seconds (string-to-number (or + (match-string 4 date-string) + "0")) + re-start (match-end 0)) + (when (string-match tz-re date-string re-start) + (setq tz (match-string 1 date-string))) + (setq time (list seconds minute hour day month year day-of-week dst tz)))) + + ;; Fall back to having Gnus do fancy things for us. + (when (not time) + (setq time (parse-time-string date-string))) + + (and time + (apply 'encode-time time)))) + (provide 'parse-time) ;;; parse-time.el ends here === modified file 'lisp/mail/hashcash.el' --- lisp/mail/hashcash.el 2014-01-01 07:43:34 +0000 +++ lisp/mail/hashcash.el 2014-03-23 23:14:52 +0000 @@ -47,10 +47,6 @@ ;;; Code: -;; For Emacs <22.2 and XEmacs. -(eval-and-compile - (unless (fboundp 'declare-function) (defmacro declare-function (&rest r)))) - (eval-when-compile (require 'cl)) ; for case (defgroup hashcash nil === modified file 'lisp/net/dns.el' --- lisp/net/dns.el 2014-01-01 07:43:34 +0000 +++ lisp/net/dns.el 2014-03-23 23:14:52 +0000 @@ -31,6 +31,12 @@ "List of DNS servers to query. If nil, /etc/resolv.conf and nslookup will be consulted.") +(defvar dns-servers-valid-for-interfaces nil + "The return value of `network-interface-list' when `dns-servers' was set. +If the set of network interfaces and/or their IP addresses +change, then presumably the list of DNS servers needs to be +updated. Set this variable to t to disable the check.") + ;;; Internal code: (defvar dns-query-types @@ -297,6 +303,17 @@ (t string))) (goto-char point)))) +(declare-function network-interface-list "process.c") + +(defun dns-servers-up-to-date-p () + "Return false if we need to recheck the list of DNS servers." + (and dns-servers + (or (eq dns-servers-valid-for-interfaces t) + ;; `network-interface-list' was introduced in Emacs 22.1. + (not (fboundp 'network-interface-list)) + (equal dns-servers-valid-for-interfaces + (network-interface-list))))) + (defun dns-set-servers () "Set `dns-servers' to a list of DNS servers or nil if none are found. Parses \"/etc/resolv.conf\" or calls \"nslookup\"." @@ -314,7 +331,9 @@ (goto-char (point-min)) (re-search-forward "^Address:[ \t]*\\([0-9]+\\.[0-9]+\\.[0-9]+\\.[0-9]+\\)" nil t) - (setq dns-servers (list (match-string 1))))))) + (setq dns-servers (list (match-string 1)))))) + (when (fboundp 'network-interface-list) + (setq dns-servers-valid-for-interfaces (network-interface-list)))) (defun dns-read-txt (string) (if (> (length string) 1) @@ -378,7 +397,7 @@ If FULLP, return the entire record returned. If REVERSEP, look up an IP address." (setq type (or type 'A)) - (unless dns-servers + (unless (dns-servers-up-to-date-p) (dns-set-servers)) (when reversep ------------------------------------------------------------ revno: 116864 author: Gnus developers committer: Katsumi Yamaoka branch nick: trunk timestamp: Sun 2014-03-23 23:13:36 +0000 message: Merge from Gnus git master 2014-03-14 Katsumi Yamaoka * gnus-sum.el (gnus-summary-toggle-header): Display header attachment buttons when toggling the header off. 2014-03-07 Daiki Ueno * mml2015.el (mml2015-use): Don't check the availability of GnuPG commands here; instead, only check if epg-config.el is available. 2014-03-06 Lars Ingebrigtsen * mml.el (mml-expand-html-into-multipart-related): Allow sending HTML messages with embedded images. (mml-generate-mime): Don't bug out if you don't have libxml. 2014-03-06 Lars Ingebrigtsen * message.el (message-make-html-message-with-image-files): New command. 2014-03-05 Lars Ingebrigtsen * mml.el (mml-insert-mime-headers): Allow `recipient-filename'. 2014-02-23 David Engster * auth-source.el (auth-source-netrc-saver): Do not depend on `cl-lib' to stay compatible with older Emacsen, so replace `cl-loop' with `loop'. 2014-02-17 Katsumi Yamaoka * gnus-art.el (gnus-article-prepare, gnus-article-prepare-display): Display header attachment buttons by gnus-article-prepare-display rather than gnus-article-prepare so as to view in mml-preview as well. 2014-02-10 Katsumi Yamaoka * gnus-art.el (gnus-article-goto-part): Find a button in the body first. (gnus-mime-buttonize-attachments-in-header): Number hidden buttons. 2014-02-07 Katsumi Yamaoka * gnus-art.el (gnus-mime-buttonize-attachments-in-header): Display buttons that are hidden in unselected alternative part as well. (gnus-mime-display-alternative): Redraw attachment buttons in header. * gmm-utils.el (gmm-labels): Add edebug spec. 2014-02-07 Lars Ingebrigtsen * gnus-srvr.el (gnus-server-toggle-cloud-server): New command and keystroke. (gnus-server-toggle-cloud-server): Only allow clouding applicable types. 2014-02-05 Katsumi Yamaoka * gnus.el (gnus-copy-overlay, gnus-overlays-at): New functions. * gnus-art.el (gnus-mime-display-attachment-buttons-in-header): New user option. (gnus-mime-buttonize-attachments-in-header): New function. (gnus-article-prepare): Use it. (gnus-mime-inline-part): Suppress extra newline. (gnus-mm-display-part): Save excursion; remove useless deleting and adding of buttons. (gnus-insert-mime-button): Allow insertion in the middle of a line. * gnus-sum.el (gnus-summary-wash-mime-map, gnus-summary-article-menu): Add gnus-mime-buttonize-attachments-in-header. 2014-02-05 Lars Ingebrigtsen * nnimap.el (nnimap-request-articles): New command to download several articles at once. * gnus.el (gnus-variable-list): Save Cloud variables. 2014-02-01 Lars Ingebrigtsen * gnus-cloud.el: New file to provide the Emacs Cloud. * gravatar.el (gravatar-retrieve-synchronously): XEmacs also has `url-retrieve-synchronously', apparently. * gnus-notifications.el (gravatar-retrieve-synchronously): Declare for XEmacs. * nnrss.el (libxml-parse-html-region): Silence compilation error. 2014-02-01 Daniel Dehennin * gnus-mlspl.el (gnus-group-split-fancy): Use `gnus-parameters' in `gnus-group-split-fancy'. 2014-02-01 Lars Ingebrigtsen * message.el (message-remove-header): Doc fix. (message-forward-included-headers): New variable. (message-remove-ignored-headers): Use it. 2014-01-31 Dave Abrahams * gnus-sum.el (gnus-summary-open-group-with-article): New command. 2013-09-04 Rasmus Pank Roulund * gnus-fun.el (gnus-x-face-omit-files): Regexp to omit matched results from random face commands. (gnus-face-directory): Like `gnus-x-face-directory` for png files and Face. (gnus-face-omit-files): Like `gnus-x-face-omit-files` for Face. (gnus--random-face-with-type): Generic function returning a face-type as a string. (gnus--insert-random-face-with-type): Generic function inserting a face in a message buffer header. (gnus-random-x-face): Rewritten to use `gnus--random-face-with-type`. (gnus-insert-random-x-face-header): Rewritten to use `gnus--insert-random-face-with-type`. (gnus-random-face): Return random (png) Face as string. (nus-insert-random-face-header): Insert random (png) Face in a message buffer. 2014-01-31 Lars Ingebrigtsen * mm-url.el: Remove all usage of w3. * nnrss.el: Ditto. * mm-decode.el: Ditto. * mm-view.el: Ditto. * gnus-setup.el: Remove outdated file. diff: === modified file 'lisp/gnus/ChangeLog' --- lisp/gnus/ChangeLog 2014-03-07 17:21:35 +0000 +++ lisp/gnus/ChangeLog 2014-03-23 23:13:36 +0000 @@ -1,3 +1,139 @@ +2014-03-23 Katsumi Yamaoka + + * gnus-sum.el (gnus-summary-toggle-header): Display header attachment + buttons when toggling the header off. + +2014-03-23 Daiki Ueno + + * mml2015.el (mml2015-use): Don't check the availability of GnuPG + commands here; instead, only check if epg-config.el is available. + +2014-03-23 Lars Ingebrigtsen + + * mml.el (mml-expand-html-into-multipart-related): Allow sending HTML + messages with embedded images. + (mml-generate-mime): Don't bug out if you don't have libxml. + +2014-03-23 Lars Ingebrigtsen + + * message.el (message-make-html-message-with-image-files): New command. + +2014-03-23 Lars Ingebrigtsen + + * mml.el (mml-insert-mime-headers): Allow `recipient-filename'. + +2014-03-23 David Engster + + * auth-source.el (auth-source-netrc-saver): Do not depend on `cl-lib' + to stay compatible with older Emacsen, so replace `cl-loop' with + `loop'. + +2014-03-23 Katsumi Yamaoka + + * gnus-art.el (gnus-article-prepare, gnus-article-prepare-display): + Display header attachment buttons by gnus-article-prepare-display + rather than gnus-article-prepare so as to view in mml-preview as well. + +2014-03-23 Katsumi Yamaoka + + * gnus-art.el (gnus-article-goto-part): Find a button in the body first. + (gnus-mime-buttonize-attachments-in-header): Number hidden buttons. + +2014-03-23 Katsumi Yamaoka + + * gnus-art.el (gnus-mime-buttonize-attachments-in-header): Display + buttons that are hidden in unselected alternative part as well. + (gnus-mime-display-alternative): Redraw attachment buttons in header. + + * gmm-utils.el (gmm-labels): Add edebug spec. + +2014-03-23 Lars Ingebrigtsen + + * gnus-srvr.el (gnus-server-toggle-cloud-server): New command and + keystroke. + (gnus-server-toggle-cloud-server): Only allow clouding applicable + types. + +2014-03-23 Katsumi Yamaoka + + * gnus.el (gnus-copy-overlay, gnus-overlays-at): New functions. + + * gnus-art.el (gnus-mime-display-attachment-buttons-in-header): + New user option. + (gnus-mime-buttonize-attachments-in-header): New function. + (gnus-article-prepare): Use it. + (gnus-mime-inline-part): Suppress extra newline. + (gnus-mm-display-part): Save excursion; + remove useless deleting and adding of buttons. + (gnus-insert-mime-button): Allow insertion in the middle of a line. + + * gnus-sum.el (gnus-summary-wash-mime-map, gnus-summary-article-menu): + Add gnus-mime-buttonize-attachments-in-header. + +2014-03-23 Lars Ingebrigtsen + + * nnimap.el (nnimap-request-articles): New command to download several + articles at once. + + * gnus.el (gnus-variable-list): Save Cloud variables. + +2014-03-23 Lars Ingebrigtsen + + * gnus-cloud.el: New file to provide the Emacs Cloud. + + * gravatar.el (gravatar-retrieve-synchronously): XEmacs also has + `url-retrieve-synchronously', apparently. + + * gnus-notifications.el (gravatar-retrieve-synchronously): Declare for + XEmacs. + + * nnrss.el (libxml-parse-html-region): Silence compilation error. + +2014-03-23 Daniel Dehennin + + * gnus-mlspl.el (gnus-group-split-fancy): Use `gnus-parameters' in + `gnus-group-split-fancy'. + +2014-03-23 Lars Ingebrigtsen + + * message.el (message-remove-header): Doc fix. + (message-forward-included-headers): New variable. + (message-remove-ignored-headers): Use it. + +2014-03-23 Dave Abrahams + + * gnus-sum.el (gnus-summary-open-group-with-article): New command. + +2014-03-23 Rasmus Pank Roulund + + * gnus-fun.el (gnus-x-face-omit-files): Regexp to omit matched results + from random face commands. + (gnus-face-directory): Like `gnus-x-face-directory` for png files and + Face. + (gnus-face-omit-files): Like `gnus-x-face-omit-files` for Face. + (gnus--random-face-with-type): Generic function returning a face-type + as a string. + (gnus--insert-random-face-with-type): Generic function inserting a face + in a message buffer header. + (gnus-random-x-face): Rewritten to use `gnus--random-face-with-type`. + (gnus-insert-random-x-face-header): Rewritten to use + `gnus--insert-random-face-with-type`. + (gnus-random-face): Return random (png) Face as string. + (nus-insert-random-face-header): Insert random (png) Face in a message + buffer. + +2014-03-23 Lars Ingebrigtsen + + * mm-url.el: Remove all usage of w3. + + * nnrss.el: Ditto. + + * mm-decode.el: Ditto. + + * mm-view.el: Ditto. + + * gnus-setup.el: Remove outdated file. + 2014-03-07 Lars Ingebrigtsen * nnimap.el (nnimap-request-accept-article): Make respooling to nnimap === modified file 'lisp/gnus/auth-source.el' --- lisp/gnus/auth-source.el 2014-02-23 02:46:12 +0000 +++ lisp/gnus/auth-source.el 2014-03-23 23:13:36 +0000 @@ -1524,10 +1524,10 @@ (heads (if (stringp value) (list (list key value)) (mapcar (lambda (v) (list key v)) value)))) - (cl-loop + (loop for h in heads nconc - (cl-loop + (loop for tl in tails collect (append h tl)))))) === modified file 'lisp/gnus/gmm-utils.el' --- lisp/gnus/gmm-utils.el 2014-01-08 19:16:10 +0000 +++ lisp/gnus/gmm-utils.el 2014-03-23 23:13:36 +0000 @@ -441,6 +441,7 @@ `(,(progn (require 'cl) (if (fboundp 'cl-labels) 'cl-labels 'labels)) ,bindings ,@body)) (put 'gmm-labels 'lisp-indent-function 1) +(put 'gmm-labels 'edebug-form-spec '((&rest (sexp sexp &rest form)) &rest form)) (provide 'gmm-utils) === modified file 'lisp/gnus/gnus-art.el' --- lisp/gnus/gnus-art.el 2014-01-31 01:56:00 +0000 +++ lisp/gnus/gnus-art.el 2014-03-23 23:13:36 +0000 @@ -24,9 +24,6 @@ ;;; Code: -;; For Emacs <22.2 and XEmacs. -(eval-and-compile - (unless (fboundp 'declare-function) (defmacro declare-function (&rest r)))) (eval-when-compile (require 'cl)) (defvar tool-bar-map) @@ -4728,7 +4725,10 @@ gnus-article-image-alist nil) (gnus-run-hooks 'gnus-tmp-internal-hook) (when gnus-display-mime-function - (funcall gnus-display-mime-function)))) + (funcall gnus-display-mime-function)) + ;; Add attachment buttons to the header. + (when gnus-mime-display-attachment-buttons-in-header + (gnus-mime-buttonize-attachments-in-header)))) ;;; ;;; Gnus Sticky Article Mode @@ -5331,7 +5331,7 @@ (mm-read-coding-system "Charset: ")))) ((mm-handle-undisplayer handle) (mm-remove-part handle))) - (forward-line 2) + (forward-line 1) (mm-display-inline handle) (goto-char b))))) @@ -5656,33 +5656,32 @@ (if (mm-handle-displayed-p handle) ;; This will remove the part. (mm-display-part handle) - (save-restriction - (narrow-to-region (point) - (if (eobp) (point) (1+ (point)))) - (gnus-bind-safe-url-regexp (mm-display-part handle)) - ;; We narrow to the part itself and - ;; then call the treatment functions. - (goto-char (point-min)) - (forward-line 1) - (narrow-to-region (point) (point-max)) - (gnus-treat-article - nil id - (gnus-article-mime-total-parts) - (mm-handle-media-type handle))))) + (save-window-excursion + (save-restriction + (narrow-to-region (point) + (if (eobp) (point) (1+ (point)))) + (gnus-bind-safe-url-regexp (mm-display-part handle)) + ;; We narrow to the part itself and + ;; then call the treatment functions. + (goto-char (point-min)) + (forward-line 1) + (narrow-to-region (point) (point-max)) + (gnus-treat-article + nil id + (gnus-article-mime-total-parts) + (mm-handle-media-type handle)))))) (if (window-live-p window) - (select-window window))))) - (goto-char point) - (gnus-delete-line) - (gnus-insert-mime-button - handle id (list (mm-handle-displayed-p handle))) - (goto-char point)))) + (select-window window)))))))) (defun gnus-article-goto-part (n) "Go to MIME part N." (when gnus-break-pages (widen)) + (article-goto-body) (prog1 - (let ((start (text-property-any (point-min) (point-max) 'gnus-part n)) + (let ((start (or (text-property-any (point) (point-max) 'gnus-part n) + ;; There may be header buttons. + (text-property-any (point-min) (point) 'gnus-part n))) part handle end next handles) (when start (goto-char start) @@ -5736,8 +5735,6 @@ (concat "; " gnus-tmp-name)))) (unless (equal gnus-tmp-description "") (setq gnus-tmp-type-long (concat " --- " gnus-tmp-type-long))) - (unless (bolp) - (insert "\n")) (setq b (point)) (gnus-eval-format gnus-mime-button-line-format gnus-mime-button-line-format-alist @@ -5862,6 +5859,16 @@ :group 'gnus-article-mime :type 'boolean) +(defcustom gnus-mime-display-attachment-buttons-in-header t + "Add attachment buttons in the end of the header of an article. +Since MIME attachments tend to be put at the end of an article, we may +overlook them if there is a huge body. This option offers you a copy +of all non-inlinable MIME parts as buttons shown in front of an article. +If nil, don't show those extra buttons." + :version "24.5" + :group 'gnus-article + :type 'boolean) + (defun gnus-mime-display-part (handle) (cond ;; Maybe a broken MIME message. @@ -5884,14 +5891,6 @@ ((and (equal (car handle) "multipart/related") (not (or gnus-mime-display-multipart-as-mixed gnus-mime-display-multipart-related-as-mixed))) - ;;;!!!We should find the start part, but we just default - ;;;!!!to the first part. - ;;(gnus-mime-display-part (cadr handle)) - ;;;!!! Most multipart/related is an HTML message plus images. - ;;;!!! Unfortunately we are unable to let W3 display those - ;;;!!! included images, so we just display it as a mixed multipart. - ;;(gnus-mime-display-mixed (cdr handle)) - ;;;!!! No, w3 can display everything just fine. (gnus-mime-display-part (cadr handle))) ((equal (car handle) "multipart/signed") (gnus-add-wash-type 'signed) @@ -6110,7 +6109,10 @@ (goto-char (point-max)) (setcdr begend (point-marker))))) (when ibegend - (goto-char point)))) + (goto-char point))) + ;; Redraw attachment buttons in the header. + (when gnus-mime-display-attachment-buttons-in-header + (gnus-mime-buttonize-attachments-in-header))) (defconst gnus-article-wash-status-strings (let ((alist '((cite "c" "Possible hidden citation text" @@ -6216,6 +6218,104 @@ (when image (gnus-add-image 'shr image)))) +(defun gnus-mime-buttonize-attachments-in-header (&optional interactive) + "Show attachments as buttons in the end of the header of an article. +This function toggles the display when called interactively. Note that +buttons to be added to the header are only the ones that aren't inlined +in the body. Use `gnus-header-face-alist' to highlight buttons." + (interactive (list t)) + (gnus-with-article-buffer + (gmm-labels + ;; Function that returns a flattened version of + ;; `gnus-article-mime-handle-alist'. + ((flattened-alist + (&optional alist id all) + (if alist + (let ((i 1) newid flat) + (dolist (handle alist flat) + (setq newid (append id (list i)) + i (1+ i)) + (if (stringp (car handle)) + (setq flat (nconc flat (flattened-alist (cdr handle) + newid all))) + (delq (rassq handle all) all) + (setq flat (nconc flat (list (cons newid handle))))))) + (let ((flat (list nil))) + ;; Assume that elements of `gnus-article-mime-handle-alist' + ;; are in the decreasing order, but unnumbered subsidiaries + ;; in each element are in the increasing order. + (dolist (handle (reverse gnus-article-mime-handle-alist)) + (if (stringp (cadr handle)) + (setq flat (nconc flat (flattened-alist (cddr handle) + (list (car handle)) + flat))) + (delq (rassq (cdr handle) flat) flat) + (setq flat (nconc flat (list (cons (list (car handle)) + (cdr handle))))))) + (setq flat (cdr flat)) + (mapc (lambda (handle) + (if (cdar handle) + ;; This is a hidden (i.e. unnumbered) handle. + (progn + (setcar handle + (1+ (caar gnus-article-mime-handle-alist))) + (push handle gnus-article-mime-handle-alist)) + (setcar handle (caar handle)))) + flat) + flat)))) + (let ((case-fold-search t) buttons st) + (save-excursion + (save-restriction + (widen) + (article-narrow-to-head) + ;; Header buttons exist? + (while (and (not buttons) + (re-search-forward "^attachments?:[\n ]+" nil t)) + (when (get-char-property (match-end 0) + 'gnus-button-attachment-extra) + (setq buttons (match-beginning 0)))) + (widen) + (when buttons + ;; Delete header buttons. + (delete-region buttons (if (re-search-forward "^[^ ]" nil t) + (match-beginning 0) + (point-max)))) + (unless (and interactive buttons) + ;; Find buttons. + (setq buttons nil) + (dolist (handle (flattened-alist)) + (when (and (not (stringp (cadr handle))) + (or (equal (car (mm-handle-disposition + (cdr handle))) + "attachment") + (not (and (mm-inlinable-p (cdr handle)) + (mm-inlined-p (cdr handle)))))) + (push handle buttons))) + (when buttons + ;; Add header buttons. + (article-goto-body) + (forward-line -1) + (narrow-to-region (point) (point)) + (insert "Attachment" (if (cdr buttons) "s" "") ":") + (dolist (button (nreverse buttons)) + (setq st (point)) + (insert " ") + (gnus-insert-mime-button (cdr button) (car button)) + (skip-chars-backward "\t\n ") + (delete-region (point) (point-max)) + (when (> (current-column) (window-width)) + (goto-char st) + (insert "\n") + (end-of-line))) + (insert "\n") + (dolist (ovl (gnus-overlays-in (point-min) (point))) + (gnus-overlay-put ovl 'gnus-button-attachment-extra t) + (gnus-overlay-put ovl 'face nil)) + (let ((gnus-treatment-function-alist + '((gnus-treat-highlight-headers + gnus-article-highlight-headers)))) + (gnus-treat-article 'head)))))))))) + ;;; Article savers. (defun gnus-output-to-file (file-name) === modified file 'lisp/gnus/gnus-cache.el' --- lisp/gnus/gnus-cache.el 2014-01-01 07:43:34 +0000 +++ lisp/gnus/gnus-cache.el 2014-03-23 23:13:36 +0000 @@ -24,10 +24,6 @@ ;;; Code: -;; For Emacs <22.2 and XEmacs. -(eval-and-compile - (unless (fboundp 'declare-function) (defmacro declare-function (&rest r)))) - (eval-when-compile (require 'cl)) (require 'gnus) === modified file 'lisp/gnus/gnus-fun.el' --- lisp/gnus/gnus-fun.el 2014-01-01 07:43:34 +0000 +++ lisp/gnus/gnus-fun.el 2014-03-23 23:13:36 +0000 @@ -24,10 +24,6 @@ ;;; Code: -;; For Emacs <22.2 and XEmacs. -(eval-and-compile - (unless (fboundp 'declare-function) (defmacro declare-function (&rest r)))) - (eval-when-compile (require 'cl)) @@ -44,6 +40,24 @@ :group 'gnus-fun :type 'directory) +(defcustom gnus-x-face-omit-files nil + "Regexp to match faces in `gnus-x-face-directory' to be omitted." + :version "24.5" + :group 'gnus-fun + :type 'string) + +(defcustom gnus-face-directory (expand-file-name "faces" gnus-directory) + "*Directory where Face PNG files are stored." + :version "24.5" + :group 'gnus-fun + :type 'directory) + +(defcustom gnus-face-omit-files nil + "Regexp to match faces in `gnus-face-directory' to be omitted." + :version "24.5" + :group 'gnus-fun + :type 'string) + (defcustom gnus-convert-pbm-to-x-face-command "pbmtoxbm %s | compface" "Command for converting a PBM to an X-Face." :version "22.1" @@ -86,35 +100,57 @@ nil shell-command-switch command))) ;;;###autoload -(defun gnus-random-x-face () - "Return X-Face header data chosen randomly from `gnus-x-face-directory'." - (interactive) - (when (file-exists-p gnus-x-face-directory) - (let* ((files (directory-files gnus-x-face-directory t "\\.pbm$")) - (file (nth (random (length files)) files))) +(defun gnus--random-face-with-type (dir ext omit fun) + "Return file from DIR with extension EXT, omitting matches of OMIT, processed by FUN." + (when (file-exists-p dir) + (let* ((files + (remove nil (mapcar + (lambda (f) (unless (string-match (or omit "^$") f) f)) + (directory-files dir t ext)))) + (file (nth (random (length files)) files))) (when file - (gnus-shell-command-to-string - (format gnus-convert-pbm-to-x-face-command - (shell-quote-argument file))))))) + (funcall fun file))))) +;;;###autoload (autoload 'message-goto-eoh "message" nil t) - -;;;###autoload -(defun gnus-insert-random-x-face-header () - "Insert a random X-Face header from `gnus-x-face-directory'." - (interactive) - (let ((data (gnus-random-x-face))) +(autoload 'message-insert-header "message" nil t) + +(defun gnus--insert-random-face-with-type (fun type) + "Get a random face using FUN and insert it as a header TYPE. + +For instance, to insert an X-Face use `gnus-random-x-face' as FUN + and \"X-Face\" as TYPE." + (let ((data (funcall fun))) (save-excursion - (message-goto-eoh) (if data - (insert "X-Face: " data) + (progn (message-goto-eoh) + (insert type ": " data "\n")) (message - "No face returned by `gnus-random-x-face'. Does %s/*.pbm exist?" - gnus-x-face-directory))))) + "No face returned by the function %s." (symbol-name fun)))))) + + + +;;;###autoload +(defun gnus-random-x-face () + "Return X-Face header data chosen randomly from `gnus-x-face-directory'. + +Files matching `gnus-x-face-omit-files' are not considered." + (interactive) + (gnus--random-face-with-type gnus-x-face-directory "\\.pbm$" gnus-x-face-omit-files + (lambda (file) + (gnus-shell-command-to-string + (format gnus-convert-pbm-to-x-face-command + (shell-quote-argument file)))))) + +;;;###autoload +(defun gnus-insert-random-x-face-header () + "Insert a random X-Face header from `gnus-x-face-directory'." + (interactive) + (gnus--insert-random-face-with-type 'gnus-random-x-face 'X-Face)) ;;;###autoload (defun gnus-x-face-from-file (file) - "Insert an X-Face header based on an image file. + "Insert an X-Face header based on an image FILE. Depending on `gnus-convert-image-to-x-face-command' it may accept different input formats." @@ -126,7 +162,7 @@ ;;;###autoload (defun gnus-face-from-file (file) - "Return a Face header based on an image file. + "Return a Face header based on an image FILE. Depending on `gnus-convert-image-to-face-command' it may accept different input formats." @@ -191,6 +227,21 @@ (buffer-size))) (gnus-face-encode))) +;;;###autoload +(defun gnus-random-face () + "Return randomly chosen Face from `gnus-face-directory'. + +Files matching `gnus-face-omit-files' are not considered." + (interactive) + (gnus--random-face-with-type gnus-face-directory "\\.png$" + gnus-face-omit-files + 'gnus-convert-png-to-face)) + +;;;###autoload +(defun gnus-insert-random-face-header () + "Insert a randome Face header from `gnus-face-directory'." + (gnus--insert-random-face-with-type 'gnus-random-face 'Face)) + (defface gnus-x-face '((t (:foreground "black" :background "white"))) "Face to show X-Face. The colors from this face are used as the foreground and background === modified file 'lisp/gnus/gnus-group.el' --- lisp/gnus/gnus-group.el 2014-03-05 22:54:48 +0000 +++ lisp/gnus/gnus-group.el 2014-03-23 23:13:36 +0000 @@ -24,10 +24,6 @@ ;;; Code: -;; For Emacs <22.2 and XEmacs. -(eval-and-compile - (unless (fboundp 'declare-function) (defmacro declare-function (&rest r)))) - (eval-when-compile (require 'cl)) (defvar tool-bar-mode) === modified file 'lisp/gnus/gnus-html.el' --- lisp/gnus/gnus-html.el 2014-01-01 07:43:34 +0000 +++ lisp/gnus/gnus-html.el 2014-03-23 23:13:36 +0000 @@ -28,10 +28,6 @@ ;;; Code: -;; For Emacs <22.2 and XEmacs. -(eval-and-compile - (unless (fboundp 'declare-function) (defmacro declare-function (&rest r)))) - (eval-when-compile (require 'cl)) (require 'gnus-art) === modified file 'lisp/gnus/gnus-mlspl.el' --- lisp/gnus/gnus-mlspl.el 2014-01-01 07:43:34 +0000 +++ lisp/gnus/gnus-mlspl.el 2014-03-23 23:13:36 +0000 @@ -146,20 +146,27 @@ (any \"\\\\(foo@nowhere\\\\.gov\\\\|foo@localhost\\\\|foo-redist@home\\\\)\" - \"bugs-foo\" - \"rambling-foo\" \"mail.foo\")) \"mail.others\")" - (let* ((newsrc (cdr gnus-newsrc-alist)) - split) - (dolist (info newsrc) - (let ((group (gnus-info-group info)) - (params (gnus-info-params info))) - ;; For all GROUPs that match the specified GROUPS - (when (or (not groups) - (and (listp groups) - (memq group groups)) - (and (stringp groups) - (string-match groups group))) - (let ((split-spec (assoc 'split-spec params)) group-clean) - ;; Remove backend from group name - (setq group-clean (string-match ":" group)) + (let ((group-names (if (and (listp groups) + (not (null groups))) + groups + (delete-dups + (delq nil + (mapcar + (lambda (info) + (let ((group (gnus-info-group info))) + (if (or (not groups) + (and (stringp groups) + (string-match groups group))) + group))) + (append gnus-newsrc-alist gnus-parameters)))))) + split) + (dolist (group group-names) + (let ((params (gnus-group-find-parameter group))) + ;; Skip groups without param (or nonexistent) + (when (not (null params)) + (let ((split-spec (assoc 'split-spec params)) group-clean) + ;; Remove backend from group name + (setq group-clean (string-match ":" group)) (setq group-clean (if group-clean (substring group (1+ group-clean)) === modified file 'lisp/gnus/gnus-notifications.el' --- lisp/gnus/gnus-notifications.el 2014-01-01 07:43:34 +0000 +++ lisp/gnus/gnus-notifications.el 2014-03-23 23:13:36 +0000 @@ -102,6 +102,9 @@ ;; Don't return an id t)) +(declare-function gravatar-retrieve-synchronously "gravatar.el" + (mail-address)) + (defun gnus-notifications-get-photo (mail-address) "Get photo for mail address." (let ((google-photo (when (and gnus-notifications-use-google-contacts === modified file 'lisp/gnus/gnus-picon.el' --- lisp/gnus/gnus-picon.el 2014-01-01 07:43:34 +0000 +++ lisp/gnus/gnus-picon.el 2014-03-23 23:13:36 +0000 @@ -37,10 +37,6 @@ ;; ;;; Code: -;; For Emacs <22.2 and XEmacs. -(eval-and-compile - (unless (fboundp 'declare-function) (defmacro declare-function (&rest r)))) - (eval-when-compile (require 'cl)) (require 'gnus) === removed file 'lisp/gnus/gnus-setup.el' --- lisp/gnus/gnus-setup.el 2014-01-18 20:46:53 +0000 +++ lisp/gnus/gnus-setup.el 1970-01-01 00:00:00 +0000 @@ -1,191 +0,0 @@ -;;; gnus-setup.el --- Initialization & Setup for Gnus 5 - -;; Copyright (C) 1995-1996, 2000-2014 Free Software Foundation, Inc. - -;; Author: Steven L. Baur -;; Keywords: news - -;; This file is part of GNU Emacs. - -;; GNU Emacs is free software: you can redistribute it and/or modify -;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation, either version 3 of the License, or -;; (at your option) any later version. - -;; GNU Emacs is distributed in the hope that it will be useful, -;; but WITHOUT ANY WARRANTY; without even the implied warranty of -;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;; GNU General Public License for more details. - -;; You should have received a copy of the GNU General Public License -;; along with GNU Emacs. If not, see . - -;;; Commentary: -;; My head is starting to spin with all the different mail/news packages. -;; Stop The Madness! - -;; Given that Emacs Lisp byte codes may be diverging, it is probably best -;; not to byte compile this, and just arrange to have the .el loaded out -;; of .emacs. - -;;; Code: - -(eval-when-compile (require 'cl)) - -(defvar gnus-use-installed-gnus t - "*If non-nil use installed version of Gnus.") - -(defvar gnus-use-installed-mailcrypt (featurep 'xemacs) - "*If non-nil use installed version of mailcrypt.") - -(defvar gnus-emacs-lisp-directory (if (featurep 'xemacs) - "/usr/local/lib/xemacs/" - "/usr/local/share/emacs/") - "Directory where Emacs site lisp is located.") - -(defvar gnus-gnus-lisp-directory (concat gnus-emacs-lisp-directory - "gnus/lisp/") - "Directory where Gnus Emacs lisp is found.") - -(defvar gnus-mailcrypt-lisp-directory (concat gnus-emacs-lisp-directory - "site-lisp/mailcrypt/") - "Directory where Mailcrypt Emacs Lisp is found.") - -(defvar gnus-bbdb-lisp-directory (concat gnus-emacs-lisp-directory - "site-lisp/bbdb/") - "Directory where Big Brother Database is found.") - -(defvar gnus-use-mhe nil - "Set this if you want to use MH-E for mail reading.") -(defvar gnus-use-rmail nil - "Set this if you want to use RMAIL for mail reading.") -(defvar gnus-use-sendmail nil - "Set this if you want to use SENDMAIL for mail reading.") -(defvar gnus-use-vm nil - "Set this if you want to use the VM package for mail reading.") -(defvar gnus-use-sc nil - "Set this if you want to use Supercite.") -(defvar gnus-use-mailcrypt t - "Set this if you want to use Mailcrypt for dealing with PGP messages.") -(defvar gnus-use-bbdb nil - "Set this if you want to use the Big Brother DataBase.") - -(when (and (not gnus-use-installed-gnus) - (null (member gnus-gnus-lisp-directory load-path))) - (push gnus-gnus-lisp-directory load-path)) - -;;; We can't do this until we know where Gnus is. -(require 'message) - -;;; Mailcrypt by -;;; Jin Choi -;;; Patrick LoPresti - -(when gnus-use-mailcrypt - (when (and (not gnus-use-installed-mailcrypt) - (null (member gnus-mailcrypt-lisp-directory load-path))) - (setq load-path (cons gnus-mailcrypt-lisp-directory load-path))) - (autoload 'mc-install-write-mode "mailcrypt" nil t) - (autoload 'mc-install-read-mode "mailcrypt" nil t) -;;; (add-hook 'message-mode-hook 'mc-install-write-mode) -;;; (add-hook 'gnus-summary-mode-hook 'mc-install-read-mode) - (when gnus-use-mhe - (add-hook 'mh-folder-mode-hook 'mc-install-read-mode) - (add-hook 'mh-letter-mode-hook 'mc-install-write-mode))) - -;;; BBDB by -;;; Jamie Zawinski - -(when gnus-use-bbdb - ;; bbdb will never be installed with emacs. - (when (null (member gnus-bbdb-lisp-directory load-path)) - (setq load-path (cons gnus-bbdb-lisp-directory load-path))) - (autoload 'bbdb "bbdb-com" - "Insidious Big Brother Database" t) - (autoload 'bbdb-name "bbdb-com" - "Insidious Big Brother Database" t) - (autoload 'bbdb-company "bbdb-com" - "Insidious Big Brother Database" t) - (autoload 'bbdb-net "bbdb-com" - "Insidious Big Brother Database" t) - (autoload 'bbdb-notes "bbdb-com" - "Insidious Big Brother Database" t) - - (when gnus-use-vm - (autoload 'bbdb-insinuate-vm "bbdb-vm" - "Hook BBDB into VM" t)) - - (when gnus-use-rmail - (autoload 'bbdb-insinuate-rmail "bbdb-rmail" - "Hook BBDB into RMAIL" t) - (add-hook 'rmail-mode-hook 'bbdb-insinuate-rmail)) - - (when gnus-use-mhe - (autoload 'bbdb-insinuate-mh "bbdb-mh" - "Hook BBDB into MH-E" t) - (add-hook 'mh-folder-mode-hook 'bbdb-insinuate-mh)) - - (autoload 'bbdb-insinuate-gnus "bbdb-gnus" - "Hook BBDB into Gnus" t) - (add-hook 'gnus-startup-hook 'bbdb-insinuate-gnus) - - (when gnus-use-sendmail - (autoload 'bbdb-insinuate-sendmail "bbdb" - "Insidious Big Brother Database" t) - (add-hook 'mail-setup-hook 'bbdb-insinuate-sendmail) - (add-hook 'message-setup-hook 'bbdb-insinuate-sendmail))) - -(when gnus-use-sc - (add-hook 'mail-citation-hook 'sc-cite-original) - (setq message-cite-function 'sc-cite-original)) - -;;;### (autoloads (gnus gnus-slave gnus-no-server) "gnus" "lisp/gnus.el" (12473 2137)) -;;; Generated autoloads from lisp/gnus.el - -;; Don't redo this if autoloads already exist -(unless (fboundp 'gnus) - (autoload 'gnus-slave-no-server "gnus" "\ -Read network news as a slave without connecting to local server." t nil) - - (autoload 'gnus-no-server "gnus" "\ -Read network news. -If ARG is a positive number, Gnus will use that as the -startup level. If ARG is nil, Gnus will be started at level 2. -If ARG is non-nil and not a positive number, Gnus will -prompt the user for the name of an NNTP server to use. -As opposed to `gnus', this command will not connect to the local server." t nil) - - (autoload 'gnus-slave "gnus" "\ -Read news as a slave." t nil) - - (autoload 'gnus "gnus" "\ -Read network news. -If ARG is non-nil and a positive number, Gnus will use that as the -startup level. If ARG is non-nil and not a positive number, Gnus will -prompt the user for the name of an NNTP server to use." t nil) - -;;;*** - -;;; These have moved out of gnus.el into other files. -;;; FIX FIX FIX: should other things be in gnus-setup? or these not in it? - (autoload 'gnus-update-format "gnus-spec" "\ -Update the format specification near point." t nil) - - (autoload 'gnus-fetch-group "gnus-group" "\ -Start Gnus if necessary and enter GROUP. -Returns whether the fetching was successful or not." t nil) - - (defalias 'gnus-batch-kill 'gnus-batch-score) - - (autoload 'gnus-batch-score "gnus-kill" "\ -Run batched scoring. -Usage: emacs -batch -l gnus -f gnus-batch-score ... -Newsgroups is a list of strings in Bnews format. If you want to score -the comp hierarchy, you'd say \"comp.all\". If you would not like to -score the alt hierarchy, you'd say \"!alt.all\"." t nil)) - -(provide 'gnus-setup) - -(run-hooks 'gnus-setup-load-hook) - -;;; gnus-setup.el ends here === modified file 'lisp/gnus/gnus-spec.el' --- lisp/gnus/gnus-spec.el 2014-01-01 07:43:34 +0000 +++ lisp/gnus/gnus-spec.el 2014-03-23 23:13:36 +0000 @@ -24,9 +24,6 @@ ;;; Code: -;; For Emacs <22.2 and XEmacs. -(eval-and-compile - (unless (fboundp 'declare-function) (defmacro declare-function (&rest r)))) (eval-when-compile (require 'cl)) (defvar gnus-newsrc-file-version) === modified file 'lisp/gnus/gnus-srvr.el' --- lisp/gnus/gnus-srvr.el 2014-01-01 07:43:34 +0000 +++ lisp/gnus/gnus-srvr.el 2014-03-23 23:13:36 +0000 @@ -45,7 +45,7 @@ :group 'gnus-server :type 'hook) -(defcustom gnus-server-line-format " {%(%h:%w%)} %s%a\n" +(defcustom gnus-server-line-format " {%(%h:%w%)} %s%a%c\n" "Format of server lines. It works along the same lines as a normal formatting string, with some simple extensions. @@ -85,7 +85,8 @@ (?n gnus-tmp-name ?s) (?w gnus-tmp-where ?s) (?s gnus-tmp-status ?s) - (?a gnus-tmp-agent ?s))) + (?a gnus-tmp-agent ?s) + (?c gnus-tmp-cloud ?s))) (defvar gnus-server-mode-line-format-alist `((?S gnus-tmp-news-server ?s) @@ -127,6 +128,7 @@ ["Close" gnus-server-close-server t] ["Offline" gnus-server-offline-server t] ["Deny" gnus-server-deny-server t] + ["Toggle Cloud" gnus-server-toggle-cloud-server t] "---" ["Open All" gnus-server-open-all-servers t] ["Close All" gnus-server-close-all-servers t] @@ -172,6 +174,8 @@ "z" gnus-server-compact-server + "i" gnus-server-toggle-cloud-server + "\C-c\C-i" gnus-info-find-node "\C-c\C-b" gnus-bug)) @@ -185,6 +189,13 @@ (put 'gnus-server-agent-face 'face-alias 'gnus-server-agent) (put 'gnus-server-agent-face 'obsolete-face "22.1") +(defface gnus-server-cloud + '((((class color) (background light)) (:foreground "ForestGreen" :bold t)) + (((class color) (background dark)) (:foreground "PaleGreen" :bold t)) + (t (:bold t))) + "Face used for displaying AGENTIZED servers" + :group 'gnus-server-visual) + (defface gnus-server-opened '((((class color) (background light)) (:foreground "Green3" :bold t)) (((class color) (background dark)) (:foreground "Green1" :bold t)) @@ -228,6 +239,7 @@ (defvar gnus-server-font-lock-keywords '(("(\\(agent\\))" 1 'gnus-server-agent) + ("(\\(cloud\\))" 1 'gnus-server-cloud) ("(\\(opened\\))" 1 'gnus-server-opened) ("(\\(closed\\))" 1 'gnus-server-closed) ("(\\(offline\\))" 1 'gnus-server-offline) @@ -282,6 +294,9 @@ (gnus-tmp-agent (if (and gnus-agent (gnus-agent-method-p method)) " (agent)" + "")) + (gnus-tmp-cloud (if (gnus-cloud-server-p gnus-tmp-name) + " (cloud)" ""))) (beginning-of-line) (gnus-add-text-properties @@ -1084,6 +1099,27 @@ (let ((original (get-buffer gnus-original-article-buffer))) (and original (gnus-kill-buffer original)))))) +(defun gnus-server-toggle-cloud-server () + "Make the server under point be replicated in the Emacs Cloud." + (interactive) + (let ((server (gnus-server-server-name))) + (unless server + (error "No server on the current line")) + + (unless (gnus-method-option-p server 'cloud) + (error "The server under point doesn't support cloudiness")) + + (if (gnus-cloud-server-p server) + (setq gnus-cloud-covered-servers + (delete server gnus-cloud-covered-servers)) + (push server gnus-cloud-covered-servers)) + + (gnus-server-update-server server) + (gnus-message 1 (if (gnus-cloud-server-p server) + "Replication of %s in the cloud will start" + "Replication of %s in the cloud will stop") + server))) + (provide 'gnus-srvr) ;;; gnus-srvr.el ends here === modified file 'lisp/gnus/gnus-start.el' --- lisp/gnus/gnus-start.el 2014-01-01 07:43:34 +0000 +++ lisp/gnus/gnus-start.el 2014-03-23 23:13:36 +0000 @@ -30,6 +30,7 @@ (require 'gnus-spec) (require 'gnus-range) (require 'gnus-util) +(require 'gnus-cloud) (autoload 'message-make-date "message") (autoload 'gnus-agent-read-servers-validate "gnus-agent") (autoload 'gnus-agent-save-local "gnus-agent") === modified file 'lisp/gnus/gnus-sum.el' --- lisp/gnus/gnus-sum.el 2014-01-31 01:56:00 +0000 +++ lisp/gnus/gnus-sum.el 2014-03-23 23:13:36 +0000 @@ -24,9 +24,6 @@ ;;; Code: -;; For Emacs <22.2 and XEmacs. -(eval-and-compile - (unless (fboundp 'declare-function) (defmacro declare-function (&rest r)))) (eval-when-compile (require 'cl)) (eval-when-compile @@ -2188,6 +2185,7 @@ (gnus-define-keys (gnus-summary-wash-mime-map "M" gnus-summary-wash-map) "w" gnus-article-decode-mime-words "c" gnus-article-decode-charset + "h" gnus-mime-buttonize-attachments-in-header "v" gnus-mime-view-all-parts "b" gnus-article-view-part) @@ -2394,6 +2392,8 @@ ["QP" gnus-article-de-quoted-unreadable t] ["Base64" gnus-article-de-base64-unreadable t] ["View MIME buttons" gnus-summary-display-buttonized t] + ["View MIME buttons in header" + gnus-mime-buttonize-attachments-in-header t] ["View all" gnus-mime-view-all-parts t] ["Verify and Decrypt" gnus-summary-force-verify-and-decrypt t] ["Encrypt body" gnus-article-encrypt-body @@ -9085,6 +9085,41 @@ (gnus-summary-limit-include-thread id))) (gnus-summary-show-thread)) +(defun gnus-summary-open-group-with-article (message-id) + "Open a group containing the article with the given MESSAGE-ID." + (interactive "sMessage-ID: ") + (require 'nndoc) + (with-temp-buffer + ;; Prepare a dummy article + (erase-buffer) + (insert "From nobody Tue Sep 13 22:05:34 2011\n\n") + + ;; Prepare pretty modelines for summary and article buffers + (let ((gnus-summary-mode-line-format "Found %G") + (gnus-article-mode-line-format + ;; Group names just get in the way here, especially the + ;; abbreviated ones + (if (string-match "%[gG]" gnus-article-mode-line-format) + (concat (substring gnus-article-mode-line-format + 0 (match-beginning 0)) + (substring gnus-article-mode-line-format (match-end 0))) + gnus-article-mode-line-format))) + + ;; Build an ephemeral group containing the dummy article (hidden) + (gnus-group-read-ephemeral-group + message-id + `(nndoc ,message-id + (nndoc-address ,(current-buffer)) + (nndoc-article-type mbox)) + :activate + (cons (current-buffer) gnus-current-window-configuration) + (not :request-only) + '(-1) ; :select-articles + (not :parameters) + 0)) ; :number + ;; Fetch the desired article + (gnus-summary-refer-article message-id))) + (defun gnus-summary-refer-article (message-id) "Fetch an article specified by MESSAGE-ID." (interactive "sMessage-ID: ") @@ -9779,7 +9814,10 @@ (gnus-treat-hide-boring-headers nil)) (gnus-delete-wash-type 'headers) (gnus-treat-article 'head)) - (gnus-treat-article 'head)) + (gnus-treat-article 'head) + ;; Add attachment buttons to the header. + (when gnus-mime-display-attachment-buttons-in-header + (gnus-mime-buttonize-attachments-in-header))) (widen) (if window (set-window-start window (goto-char (point-min)))) === modified file 'lisp/gnus/gnus-util.el' --- lisp/gnus/gnus-util.el 2014-01-08 19:16:10 +0000 +++ lisp/gnus/gnus-util.el 2014-03-23 23:13:36 +0000 @@ -32,9 +32,6 @@ ;;; Code: -;; For Emacs <22.2 and XEmacs. -(eval-and-compile - (unless (fboundp 'declare-function) (defmacro declare-function (&rest r)))) (eval-when-compile (require 'cl)) === modified file 'lisp/gnus/gnus.el' --- lisp/gnus/gnus.el 2014-01-01 07:43:34 +0000 +++ lisp/gnus/gnus.el 2014-03-23 23:13:36 +0000 @@ -29,10 +29,6 @@ (eval '(run-hooks 'gnus-load-hook)) -;; For Emacs <22.2 and XEmacs. -(eval-and-compile - (unless (fboundp 'declare-function) (defmacro declare-function (&rest r)))) - (eval-when-compile (require 'cl)) (require 'wid-edit) (require 'mm-util) @@ -309,6 +305,7 @@ (unless (featurep 'gnus-xmas) (defalias 'gnus-make-overlay 'make-overlay) + (defalias 'gnus-copy-overlay 'copy-overlay) (defalias 'gnus-delete-overlay 'delete-overlay) (defalias 'gnus-overlay-get 'overlay-get) (defalias 'gnus-overlay-put 'overlay-put) @@ -316,6 +313,7 @@ (defalias 'gnus-overlay-buffer 'overlay-buffer) (defalias 'gnus-overlay-start 'overlay-start) (defalias 'gnus-overlay-end 'overlay-end) + (defalias 'gnus-overlays-at 'overlays-at) (defalias 'gnus-overlays-in 'overlays-in) (defalias 'gnus-extent-detached-p 'ignore) (defalias 'gnus-extent-start-open 'ignore) @@ -1614,7 +1612,7 @@ :type 'string) (defcustom gnus-valid-select-methods - '(("nntp" post address prompt-address physical-address) + '(("nntp" post address prompt-address physical-address cloud) ("nnspool" post address) ("nnvirtual" post-mail virtual prompt-address) ("nnmbox" mail respool address) @@ -1631,7 +1629,7 @@ ("nnrss" none global) ("nnagent" post-mail) ("nnimap" post-mail address prompt-address physical-address respool - server-marks) + server-marks cloud) ("nnmaildir" mail respool address server-marks) ("nnnil" none)) "*An alist of valid select methods. @@ -2703,7 +2701,10 @@ gnus-newsrc-last-checked-date gnus-newsrc-alist gnus-server-alist gnus-killed-list gnus-zombie-list - gnus-topic-topology gnus-topic-alist) + gnus-topic-topology gnus-topic-alist + gnus-cloud-sequence + gnus-cloud-covered-servers + gnus-cloud-file-timestamps) "Gnus variables saved in the quick startup file.") (defvar gnus-newsrc-alist nil === modified file 'lisp/gnus/gravatar.el' --- lisp/gnus/gravatar.el 2014-01-01 07:43:34 +0000 +++ lisp/gnus/gravatar.el 2014-03-23 23:13:36 +0000 @@ -138,9 +138,7 @@ "Retrieve MAIL-ADDRESS gravatar and returns it." (let ((url (gravatar-build-url mail-address))) (if (gravatar-cache-expired url) - (with-current-buffer (if (featurep 'xemacs) - (url-retrieve url) - (url-retrieve-synchronously url)) + (with-current-buffer (url-retrieve-synchronously url) (when gravatar-automatic-caching (url-store-in-cache (current-buffer))) (let ((data (gravatar-data->image))) === modified file 'lisp/gnus/mail-source.el' --- lisp/gnus/mail-source.el 2014-01-01 07:43:34 +0000 +++ lisp/gnus/mail-source.el 2014-03-23 23:13:36 +0000 @@ -24,10 +24,6 @@ ;;; Code: -;; For Emacs <22.2 and XEmacs. -(eval-and-compile - (unless (fboundp 'declare-function) (defmacro declare-function (&rest r)))) - (require 'format-spec) (eval-when-compile (require 'cl) === modified file 'lisp/gnus/mailcap.el' --- lisp/gnus/mailcap.el 2014-01-01 07:43:34 +0000 +++ lisp/gnus/mailcap.el 2014-03-23 23:13:36 +0000 @@ -216,10 +216,6 @@ (test . (fboundp 'vm-mode)) (type . "message/rfc822")) ("rfc-*822" - (viewer . w3-mode) - (test . (fboundp 'w3-mode)) - (type . "message/rfc822")) - ("rfc-*822" (viewer . view-mode) (type . "message/rfc822"))) ("image" @@ -253,10 +249,6 @@ ("needsx11"))) ("text" ("plain" - (viewer . w3-mode) - (test . (fboundp 'w3-mode)) - (type . "text/plain")) - ("plain" (viewer . view-mode) (test . (fboundp 'view-mode)) (type . "text/plain")) @@ -267,10 +259,6 @@ (viewer . enriched-decode) (test . (fboundp 'enriched-decode)) (type . "text/enriched")) - ("html" - (viewer . mm-w3-prepare-buffer) - (test . (fboundp 'w3-prepare-buffer)) - (type . "text/html")) ("dns" (viewer . dns-mode) (test . (fboundp 'dns-mode)) === modified file 'lisp/gnus/message.el' --- lisp/gnus/message.el 2014-02-09 04:37:38 +0000 +++ lisp/gnus/message.el 2014-03-23 23:13:36 +0000 @@ -28,9 +28,6 @@ ;;; Code: -;; For Emacs <22.2 and XEmacs. -(eval-and-compile - (unless (fboundp 'declare-function) (defmacro declare-function (&rest r)))) (eval-when-compile (require 'cl)) @@ -50,6 +47,7 @@ (require 'mml) (require 'rfc822) (require 'format-spec) +(require 'dired) (autoload 'mailclient-send-it "mailclient") ;; Emacs 22 or contrib/ @@ -606,7 +604,8 @@ regexp)) (defcustom message-forward-ignored-headers "^Content-Transfer-Encoding:\\|^X-Gnus" - "*All headers that match this regexp will be deleted when forwarding a message." + "*All headers that match this regexp will be deleted when forwarding a message. +This may also be a list of regexps." :version "21.1" :group 'message-forwarding :type '(repeat :value-to-internal (lambda (widget value) @@ -616,6 +615,19 @@ (widget-editable-list-match widget value))) regexp)) +(defcustom message-forward-included-headers nil + "If non-nil, delete non-matching headers when forwarding a message. +Only headers that match this regexp will be included. This +variable should be a regexp or a list of regexps." + :version "24.5" + :group 'message-forwarding + :type '(repeat :value-to-internal (lambda (widget value) + (custom-split-regexp-maybe value)) + :match (lambda (widget value) + (or (stringp value) + (widget-editable-list-match widget value))) + regexp)) + (defcustom message-ignored-cited-headers "." "*Delete these headers from the messages you yank." :group 'message-insertion @@ -2451,6 +2463,7 @@ "Remove HEADER in the narrowed buffer. If IS-REGEXP, HEADER is a regular expression. If FIRST, only remove the first instance of the header. +If REVERSE, remove headers that doesn't match HEADER. Return the number of headers removed." (goto-char (point-min)) (let ((regexp (if is-regexp header (concat "^" (regexp-quote header) ":"))) @@ -7374,17 +7387,25 @@ (message-remove-ignored-headers b e))) (defun message-remove-ignored-headers (b e) - (when message-forward-ignored-headers + (when (or message-forward-ignored-headers + message-forward-included-headers) (save-restriction (narrow-to-region b e) (goto-char b) (narrow-to-region (point) (or (search-forward "\n\n" nil t) (point))) - (let ((ignored (if (stringp message-forward-ignored-headers) - (list message-forward-ignored-headers) - message-forward-ignored-headers))) - (dolist (elem ignored) - (message-remove-header elem t)))))) + (when message-forward-ignored-headers + (let ((ignored (if (stringp message-forward-ignored-headers) + (list message-forward-ignored-headers) + message-forward-ignored-headers))) + (dolist (elem ignored) + (message-remove-header elem t)))) + (when message-forward-included-headers + (message-remove-header + (if (listp message-forward-included-headers) + (regexp-opt message-forward-included-headers) + message-forward-included-headers) + t nil t))))) (defun message-forward-make-body-mime (forward-buffer &optional beg end) (let ((b (point))) @@ -7432,8 +7453,7 @@ (goto-char (point-max)))) (setq e (point)) (insert "<#/mml>\n") - (when (and (not message-forward-decoded-p) - message-forward-ignored-headers) + (when (not message-forward-decoded-p) (message-remove-ignored-headers b e)))) (defun message-forward-make-body-digest-plain (forward-buffer) @@ -8421,6 +8441,17 @@ (message-fetch-field hdr) t)) ", ")))) +;;; multipart/related and HTML support. + +(defun message-make-html-message-with-image-files (files) + (interactive (list (dired-get-marked-files nil current-prefix-arg))) + (message-mail) + (message-goto-body) + (insert "<#part type=text/html>\n\n") + (dolist (file files) + (insert (format "\n\n" file))) + (message-goto-to)) + (when (featurep 'xemacs) (require 'messagexmas) (message-xmas-redefine)) === modified file 'lisp/gnus/mm-bodies.el' --- lisp/gnus/mm-bodies.el 2014-01-01 07:43:34 +0000 +++ lisp/gnus/mm-bodies.el 2014-03-23 23:13:36 +0000 @@ -23,10 +23,6 @@ ;;; Code: -;; For Emacs <22.2 and XEmacs. -(eval-and-compile - (unless (fboundp 'declare-function) (defmacro declare-function (&rest r)))) - (require 'mm-util) (require 'rfc2047) (require 'mm-encode) === modified file 'lisp/gnus/mm-decode.el' --- lisp/gnus/mm-decode.el 2014-01-01 07:43:34 +0000 +++ lisp/gnus/mm-decode.el 2014-03-23 23:13:36 +0000 @@ -23,10 +23,6 @@ ;;; Code: -;; For Emacs <22.2 and XEmacs. -(eval-and-compile - (unless (fboundp 'declare-function) (defmacro declare-function (&rest r)))) - (require 'mail-parse) (require 'mm-bodies) (eval-when-compile (require 'cl)) @@ -124,7 +120,6 @@ ((executable-find "w3m") 'gnus-w3m) ((executable-find "links") 'links) ((executable-find "lynx") 'lynx) - ((locate-library "w3") 'w3) ((locate-library "html2text") 'html2text) (t nil)) "Render of HTML contents. @@ -136,13 +131,11 @@ `w3m-standalone': use plain w3m; `links': use links; `lynx': use lynx; -`w3': use Emacs/W3; `html2text': use html2text; nil : use external viewer (default web browser)." :version "24.1" :type '(choice (const shr) (const gnus-w3m) - (const w3) (const w3m :tag "emacs-w3m") (const w3m-standalone :tag "standalone w3m" ) (const links) @@ -153,9 +146,9 @@ :group 'mime-display) (defcustom mm-inline-text-html-with-images nil - "If non-nil, Gnus will allow retrieving images in HTML contents with -the tags. It has no effect on Emacs/w3. See also the -documentation for the `mm-w3m-safe-url-regexp' variable." + "If non-nil, Gnus will allow retrieving images in HTML that has tags. +See also the documentation for the `mm-w3m-safe-url-regexp' +variable." :version "22.1" :type 'boolean :group 'mime-display) === modified file 'lisp/gnus/mm-extern.el' --- lisp/gnus/mm-extern.el 2014-01-01 07:43:34 +0000 +++ lisp/gnus/mm-extern.el 2014-03-23 23:13:36 +0000 @@ -24,10 +24,6 @@ ;;; Code: -;; For Emacs <22.2 and XEmacs. -(eval-and-compile - (unless (fboundp 'declare-function) (defmacro declare-function (&rest r)))) - (eval-when-compile (require 'cl)) (require 'mm-util) === modified file 'lisp/gnus/mm-url.el' --- lisp/gnus/mm-url.el 2014-01-01 07:43:34 +0000 +++ lisp/gnus/mm-url.el 2014-03-23 23:13:36 +0000 @@ -21,7 +21,7 @@ ;;; Commentary: -;; Some codes are stolen from w3 and url packages. Some are moved from +;; Some code is stolen from w3 and url packages. Some are moved from ;; nnweb. ;; TODO: Support POST, cookie. @@ -264,8 +264,6 @@ (require 'url-parse) (require 'url-vars)) (error nil)) - ;; w3-4.0pre0.46 or earlier version. - (require 'w3-vars) (require 'url))) ;;;###autoload === modified file 'lisp/gnus/mm-util.el' --- lisp/gnus/mm-util.el 2014-01-05 23:38:42 +0000 +++ lisp/gnus/mm-util.el 2014-03-23 23:13:36 +0000 @@ -23,10 +23,6 @@ ;;; Code: -;; For Emacs <22.2 and XEmacs. -(eval-and-compile - (unless (fboundp 'declare-function) (defmacro declare-function (&rest r)))) - (eval-when-compile (require 'cl)) (require 'mail-prsvr) === modified file 'lisp/gnus/mm-view.el' --- lisp/gnus/mm-view.el 2014-01-01 07:43:34 +0000 +++ lisp/gnus/mm-view.el 2014-03-23 23:13:36 +0000 @@ -22,9 +22,6 @@ ;;; Code: -;; For Emacs <22.2 and XEmacs. -(eval-and-compile - (unless (fboundp 'declare-function) (defmacro declare-function (&rest r)))) (eval-when-compile (require 'cl)) (require 'mail-parse) (require 'mailcap) @@ -51,7 +48,6 @@ (defvar mm-text-html-renderer-alist '((shr . mm-shr) - (w3 . mm-inline-text-html-render-with-w3) (w3m . mm-inline-text-html-render-with-w3m) (w3m-standalone . mm-inline-text-html-render-with-w3m-standalone) (gnus-w3m . gnus-article-html) @@ -130,91 +126,6 @@ (defalias 'mm-inline-image 'mm-inline-image-xemacs) (defalias 'mm-inline-image 'mm-inline-image-emacs))) -;; External. -(declare-function w3-do-setup "ext:w3" ()) -(declare-function w3-region "ext:w3-display" (st nd)) -(declare-function w3-prepare-buffer "ext:w3-display" (&rest args)) - -(defvar mm-w3-setup nil) -(defun mm-setup-w3 () - (unless mm-w3-setup - (require 'w3) - (w3-do-setup) - (require 'url) - (require 'w3-vars) - (require 'url-vars) - (setq mm-w3-setup t))) - -(defun mm-inline-text-html-render-with-w3 (handle) - (mm-setup-w3) - (let ((text (mm-get-part handle)) - (b (point)) - (url-standalone-mode t) - (url-gateway-unplugged t) - (w3-honor-stylesheets nil) - (url-current-object - (url-generic-parse-url (format "cid:%s" (mm-handle-id handle)))) - (width (window-width)) - (charset (mail-content-type-get - (mm-handle-type handle) 'charset))) - (save-excursion - (insert (if charset (mm-decode-string text charset) text)) - (save-restriction - (narrow-to-region b (point)) - (unless charset - (goto-char (point-min)) - (when (or (and (boundp 'w3-meta-content-type-charset-regexp) - (re-search-forward - w3-meta-content-type-charset-regexp nil t)) - (and (boundp 'w3-meta-charset-content-type-regexp) - (re-search-forward - w3-meta-charset-content-type-regexp nil t))) - (setq charset - (let ((bsubstr (buffer-substring-no-properties - (match-beginning 2) - (match-end 2)))) - (if (fboundp 'w3-coding-system-for-mime-charset) - (w3-coding-system-for-mime-charset bsubstr) - (mm-charset-to-coding-system bsubstr nil t)))) - (delete-region (point-min) (point-max)) - (insert (mm-decode-string text charset)))) - (save-window-excursion - (save-restriction - (let ((w3-strict-width width) - ;; Don't let w3 set the global version of - ;; this variable. - (fill-column fill-column)) - (if (or debug-on-error debug-on-quit) - (w3-region (point-min) (point-max)) - (condition-case () - (w3-region (point-min) (point-max)) - (error - (delete-region (point-min) (point-max)) - (let ((b (point)) - (charset (mail-content-type-get - (mm-handle-type handle) 'charset))) - (if (or (eq charset 'gnus-decoded) - (eq mail-parse-charset 'gnus-decoded)) - (save-restriction - (narrow-to-region (point) (point)) - (mm-insert-part handle) - (goto-char (point-max))) - (insert (mm-decode-string (mm-get-part handle) - charset)))) - (message - "Error while rendering html; showing as text/plain"))))))) - (mm-handle-set-undisplayer - handle - `(lambda () - (let ((inhibit-read-only t)) - ,@(if (functionp 'remove-specifier) - '((dolist (prop '(background background-pixmap foreground)) - (remove-specifier - (face-property 'default prop) - (current-buffer))))) - (delete-region ,(point-min-marker) - ,(point-max-marker))))))))) - (defvar mm-w3m-setup nil "Whether gnus-article-mode has been setup to use emacs-w3m.") @@ -499,13 +410,6 @@ (defun mm-inline-audio (handle) (message "Not implemented")) -(defun mm-w3-prepare-buffer () - (require 'w3) - (let ((url-standalone-mode t) - (url-gateway-unplugged t) - (w3-honor-stylesheets nil)) - (w3-prepare-buffer))) - (defun mm-view-message () (mm-enable-multibyte) (let (handles) === modified file 'lisp/gnus/mml-smime.el' --- lisp/gnus/mml-smime.el 2014-01-01 07:43:34 +0000 +++ lisp/gnus/mml-smime.el 2014-03-23 23:13:36 +0000 @@ -24,10 +24,6 @@ ;;; Code: -;; For Emacs <22.2 and XEmacs. -(eval-and-compile - (unless (fboundp 'declare-function) (defmacro declare-function (&rest r)))) - (eval-when-compile (require 'cl)) (require 'smime) === modified file 'lisp/gnus/mml.el' --- lisp/gnus/mml.el 2014-01-01 07:43:34 +0000 +++ lisp/gnus/mml.el 2014-03-23 23:13:36 +0000 @@ -22,10 +22,6 @@ ;;; Code: -;; For Emacs <22.2 and XEmacs. -(eval-and-compile - (unless (fboundp 'declare-function) (defmacro declare-function (&rest r)))) - (require 'mm-util) (require 'mm-bodies) (require 'mm-encode) @@ -463,6 +459,9 @@ (defvar mml-multipart-number 0) (defvar mml-inhibit-compute-boundary nil) +(declare-function libxml-parse-html-region "xml.c" + (start end &optional base-url)) + (defun mml-generate-mime (&optional multipart-type) "Generate a MIME message based on the current MML document. MULTIPART-TYPE defaults to \"mixed\", but can also @@ -472,19 +471,69 @@ (options message-options)) (if (not cont) nil + (when (and (consp (car cont)) + (= (length cont) 1) + (fboundp 'libxml-parse-html-region) + (equal (cdr (assq 'type (car cont))) "text/html")) + (setq cont (mml-expand-html-into-multipart-related (car cont)))) (prog1 (mm-with-multibyte-buffer (setq message-options options) - (if (and (consp (car cont)) - (= (length cont) 1)) - (mml-generate-mime-1 (car cont)) + (cond + ((and (consp (car cont)) + (= (length cont) 1)) + (mml-generate-mime-1 (car cont))) + ((eq (car cont) 'multipart) + (mml-generate-mime-1 cont)) + (t (mml-generate-mime-1 (nconc (list 'multipart (cons 'type (or multipart-type "mixed"))) - cont))) + cont)))) (setq options message-options) (buffer-string)) (setq message-options options))))) +(defun mml-expand-html-into-multipart-related (cont) + (let ((new-parts nil) + (cid 1)) + (mm-with-multibyte-buffer + (insert (cdr (assq 'contents cont))) + (goto-char (point-min)) + (with-syntax-table mml-syntax-table + (while (re-search-forward ""))))))) + cont)))) + (defun mml-generate-mime-1 (cont) (let ((mm-use-ultra-safe-encoding (or mm-use-ultra-safe-encoding (assq 'sign cont)))) === modified file 'lisp/gnus/mml1991.el' --- lisp/gnus/mml1991.el 2014-01-01 07:43:34 +0000 +++ lisp/gnus/mml1991.el 2014-03-23 23:13:36 +0000 @@ -26,9 +26,6 @@ ;;; Code: (eval-and-compile - ;; For Emacs <22.2 and XEmacs. - (unless (fboundp 'declare-function) (defmacro declare-function (&rest r))) - (if (locate-library "password-cache") (require 'password-cache) (require 'password))) === modified file 'lisp/gnus/mml2015.el' --- lisp/gnus/mml2015.el 2014-01-01 07:43:34 +0000 +++ lisp/gnus/mml2015.el 2014-03-23 23:13:36 +0000 @@ -28,9 +28,6 @@ ;;; Code: (eval-and-compile - ;; For Emacs <22.2 and XEmacs. - (unless (fboundp 'declare-function) (defmacro declare-function (&rest r))) - (if (locate-library "password-cache") (require 'password-cache) (require 'password))) @@ -51,12 +48,10 @@ ;; Then mml1991 would not need to require mml2015, and mml1991-use ;; could be removed. (defvar mml2015-use (or - (condition-case nil - (progn - (require 'epg-config) - (epg-check-configuration (epg-configuration)) - 'epg) - (error)) + (progn + (ignore-errors (require 'epg-config)) + (and (fboundp 'epg-check-configuration) + 'epg)) (progn (let ((abs-file (locate-library "pgg"))) ;; Don't load PGG if it is marked as obsolete === modified file 'lisp/gnus/nndraft.el' --- lisp/gnus/nndraft.el 2014-01-01 07:43:34 +0000 +++ lisp/gnus/nndraft.el 2014-03-23 23:13:36 +0000 @@ -24,10 +24,6 @@ ;;; Code: -;; For Emacs <22.2 and XEmacs. -(eval-and-compile - (unless (fboundp 'declare-function) (defmacro declare-function (&rest r)))) - (require 'nnheader) (require 'nnmail) (require 'gnus-start) === modified file 'lisp/gnus/nnfolder.el' --- lisp/gnus/nnfolder.el 2014-01-01 07:43:34 +0000 +++ lisp/gnus/nnfolder.el 2014-03-23 23:13:36 +0000 @@ -28,10 +28,6 @@ ;;; Code: -;; For Emacs <22.2 and XEmacs. -(eval-and-compile - (unless (fboundp 'declare-function) (defmacro declare-function (&rest r)))) - (require 'nnheader) (require 'message) (require 'nnmail) === modified file 'lisp/gnus/nnheader.el' --- lisp/gnus/nnheader.el 2014-01-01 07:43:34 +0000 +++ lisp/gnus/nnheader.el 2014-03-23 23:13:36 +0000 @@ -26,9 +26,6 @@ ;;; Code: -;; For Emacs <22.2 and XEmacs. -(eval-and-compile - (unless (fboundp 'declare-function) (defmacro declare-function (&rest r)))) (eval-when-compile (require 'cl)) (defvar nnmail-extra-headers) === modified file 'lisp/gnus/nnimap.el' --- lisp/gnus/nnimap.el 2014-03-07 17:21:35 +0000 +++ lisp/gnus/nnimap.el 2014-03-23 23:13:36 +0000 @@ -26,10 +26,6 @@ ;;; Code: -;; For Emacs <22.2 and XEmacs. -(eval-and-compile - (unless (fboundp 'declare-function) (defmacro declare-function (&rest r)))) - (eval-and-compile (require 'nnheader) ;; In Emacs 24, `open-protocol-stream' is an autoloaded alias for @@ -628,6 +624,26 @@ (nnheader-ms-strip-cr) (cons group article))))))) +(deffoo nnimap-request-articles (articles &optional group server) + (when group + (setq group (nnimap-decode-gnus-group group))) + (with-current-buffer nntp-server-buffer + (let ((result (nnimap-change-group group server))) + (when result + (erase-buffer) + (with-current-buffer (nnimap-buffer) + (erase-buffer) + (when (nnimap-command + (if (nnimap-ver4-p) + "UID FETCH %s BODY.PEEK[]" + "UID FETCH %s RFC822.PEEK") + (nnimap-article-ranges (gnus-compress-sequence articles))) + (let ((buffer (current-buffer))) + (with-current-buffer nntp-server-buffer + (nnheader-insert-buffer-substring buffer) + (nnheader-ms-strip-cr))) + t)))))) + (defun nnimap-get-whole-article (article &optional command) (let ((result (nnimap-command === modified file 'lisp/gnus/nnir.el' --- lisp/gnus/nnir.el 2014-03-07 16:58:25 +0000 +++ lisp/gnus/nnir.el 2014-03-23 23:13:36 +0000 @@ -171,10 +171,6 @@ ;;; Setup: -;; For Emacs <22.2 and XEmacs. -(eval-and-compile - (unless (fboundp 'declare-function) (defmacro declare-function (&rest r)))) - (require 'nnoo) (require 'gnus-group) (require 'message) === modified file 'lisp/gnus/nnmail.el' --- lisp/gnus/nnmail.el 2014-02-12 05:51:37 +0000 +++ lisp/gnus/nnmail.el 2014-03-23 23:13:36 +0000 @@ -24,10 +24,6 @@ ;;; Code: -;; For Emacs <22.2 and XEmacs. -(eval-and-compile - (unless (fboundp 'declare-function) (defmacro declare-function (&rest r)))) - (eval-when-compile (require 'cl)) (require 'gnus) ; for macro gnus-kill-buffer, at least === modified file 'lisp/gnus/nnmaildir.el' --- lisp/gnus/nnmaildir.el 2013-05-23 05:05:27 +0000 +++ lisp/gnus/nnmaildir.el 2014-03-23 23:13:36 +0000 @@ -59,10 +59,6 @@ ) ] -;; For Emacs <22.2 and XEmacs. -(eval-and-compile - (unless (fboundp 'declare-function) (defmacro declare-function (&rest r)))) - (require 'nnheader) (require 'gnus) (require 'gnus-util) === modified file 'lisp/gnus/nnrss.el' --- lisp/gnus/nnrss.el 2014-01-01 07:43:34 +0000 +++ lisp/gnus/nnrss.el 2014-03-23 23:13:36 +0000 @@ -24,10 +24,6 @@ ;;; Code: -;; For Emacs <22.2 and XEmacs. -(eval-and-compile - (unless (fboundp 'declare-function) (defmacro declare-function (&rest r)))) - (eval-when-compile (require 'cl)) (require 'gnus) @@ -398,8 +394,8 @@ nnrss-compatible-encoding-alist))))) (mm-coding-system-p 'utf-8))) -(declare-function w3-parse-buffer "ext:w3-parse" (&optional buff)) - +(declare-function libxml-parse-html-region "xml.c" + (start end &optional base-url)) (defun nnrss-fetch (url &optional local) "Fetch URL and put it in a the expected Lisp structure." (mm-with-unibyte-buffer @@ -426,22 +422,14 @@ (mm-enable-multibyte)))) (goto-char (point-min)) - ;; Because xml-parse-region can't deal with anything that isn't - ;; xml and w3-parse-buffer can't deal with some xml, we have to - ;; parse with xml-parse-region first and, if that fails, parse - ;; with w3-parse-buffer. Yuck. Eventually, someone should find out - ;; why w3-parse-buffer fails to parse some well-formed xml and - ;; fix it. - (condition-case err1 (setq xmlform (xml-parse-region (point-min) (point-max))) (error (condition-case err2 - (setq htmlform (caddar (w3-parse-buffer - (current-buffer)))) + (setq htmlform (libxml-parse-html-region (point-min) (point-max))) (error (message "\ -nnrss: %s: Not valid XML %s and w3-parse doesn't work %s" +nnrss: %s: Not valid XML %s and libxml-parse-html-region doesn't work %s" url err1 err2))))) (if htmlform htmlform @@ -599,7 +587,7 @@ (defun nnrss-no-cache (url) "") -(defun nnrss-insert-w3 (url) +(defun nnrss-insert (url) (mm-with-unibyte-current-buffer (condition-case err (mm-url-insert url) @@ -614,8 +602,6 @@ (mm-url-decode-entities-nbsp) (buffer-string)))) -(defalias 'nnrss-insert 'nnrss-insert-w3) - (defun nnrss-mime-encode-string (string) (mm-with-multibyte-buffer (insert string) @@ -880,8 +866,7 @@ (defun nnrss-extract-hrefs (data) "Recursively extract hrefs from a page's source. -DATA should be the output of `xml-parse-region' or -`w3-parse-buffer'." +DATA should be the output of `xml-parse-region'." (mapcar (lambda (ahref) (cdr (assoc 'href (cadr ahref)))) (nnrss-find-el 'a data))) === modified file 'lisp/gnus/nntp.el' --- lisp/gnus/nntp.el 2014-01-01 07:43:34 +0000 +++ lisp/gnus/nntp.el 2014-03-23 23:13:36 +0000 @@ -25,9 +25,7 @@ ;;; Code: -;; For Emacs <22.2 and XEmacs. (eval-and-compile - (unless (fboundp 'declare-function) (defmacro declare-function (&rest r))) ;; In Emacs 24, `open-protocol-stream' is an autoloaded alias for ;; `make-network-stream'. (unless (fboundp 'open-protocol-stream) === modified file 'lisp/gnus/nnweb.el' --- lisp/gnus/nnweb.el 2014-01-01 07:43:34 +0000 +++ lisp/gnus/nnweb.el 2014-03-23 23:13:36 +0000 @@ -22,8 +22,6 @@ ;;; Commentary: -;; Note: You need to have `w3' installed for some functions to work. - ;;; Code: (eval-when-compile (require 'cl)) @@ -38,7 +36,6 @@ (eval-and-compile (ignore-errors (require 'url))) -(autoload 'w3-parse-buffer "w3-parse") (nnoo-declare nnweb) @@ -527,7 +524,7 @@ url)) ;;; -;;; General web/w3 interface utility functions +;;; General web interface utility functions ;;; (defun nnweb-insert-html (parse) === modified file 'lisp/gnus/rfc1843.el' --- lisp/gnus/rfc1843.el 2014-01-01 07:43:34 +0000 +++ lisp/gnus/rfc1843.el 2014-03-23 23:13:36 +0000 @@ -31,10 +31,6 @@ ;;; Code: -;; For Emacs <22.2 and XEmacs. -(eval-and-compile - (unless (fboundp 'declare-function) (defmacro declare-function (&rest r)))) - (eval-when-compile (require 'cl)) (require 'mm-util) === modified file 'lisp/gnus/sieve-manage.el' --- lisp/gnus/sieve-manage.el 2014-01-01 07:43:34 +0000 +++ lisp/gnus/sieve-manage.el 2014-03-23 23:13:36 +0000 @@ -71,10 +71,6 @@ ;;; Code: -;; For Emacs <22.2 and XEmacs. -(eval-and-compile - (unless (fboundp 'declare-function) (defmacro declare-function (&rest r)))) - (if (locate-library "password-cache") (require 'password-cache) (require 'password)) === modified file 'lisp/gnus/smime.el' --- lisp/gnus/smime.el 2014-01-01 07:43:34 +0000 +++ lisp/gnus/smime.el 2014-03-23 23:13:36 +0000 @@ -118,9 +118,6 @@ ;;; Code: -;; For Emacs <22.2 and XEmacs. -(eval-and-compile - (unless (fboundp 'declare-function) (defmacro declare-function (&rest r)))) (require 'dig) (if (locate-library "password-cache") === modified file 'lisp/gnus/spam.el' --- lisp/gnus/spam.el 2014-01-31 01:56:00 +0000 +++ lisp/gnus/spam.el 2014-03-23 23:13:36 +0000 @@ -38,10 +38,6 @@ ;;{{{ compilation directives and autoloads/requires -;; For Emacs <22.2 and XEmacs. -(eval-and-compile - (unless (fboundp 'declare-function) (defmacro declare-function (&rest r)))) - (eval-when-compile (require 'cl)) (require 'message) ;for the message-fetch-field functions ------------------------------------------------------------ revno: 116863 [merge] committer: Daniel Colascione branch nick: trunk timestamp: Sun 2014-03-23 14:58:41 -0700 message: Clean up gc_sweep diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2014-03-23 18:11:18 +0000 +++ src/ChangeLog 2014-03-23 21:58:41 +0000 @@ -1,3 +1,16 @@ +2014-03-23 Daniel Colascione + + Split gc_sweep into discrete functions for legibility and better + stack traces. + + * alloc.c (sweep_strings,sweep_vectors): Add NO_INLINE + (sweep_vectors): Fix typo in comment. + (sweep_conses,sweep_floats,sweep_intervals) + (sweep_symbols,sweep_misc,sweep_buffers): New functions. + (gc_sweep): Call new functions, to which existing functionality is + moved. + * fns.c (sweep_weak_hash_tables): Add NO_INLINE. + 2014-03-23 Juanma Barranquero * w32fns.c (Fw32_shell_execute): Declare `result' only on Cygwin. === modified file 'src/alloc.c' --- src/alloc.c 2014-03-21 10:13:38 +0000 +++ src/alloc.c 2014-03-23 21:58:19 +0000 @@ -1817,6 +1817,7 @@ /* Sweep and compact strings. */ +NO_INLINE /* For better stack traces */ static void sweep_strings (void) { @@ -2933,6 +2934,7 @@ /* Reclaim space used by unmarked vectors. */ +NO_INLINE /* For better stack traces */ static void sweep_vectors (void) { @@ -2987,7 +2989,7 @@ if (vector == (struct Lisp_Vector *) block->data && !VECTOR_IN_BLOCK (next, block)) - /* This block should be freed because all of it's + /* This block should be freed because all of its space was coalesced into the only free vector. */ free_this_block = 1; else @@ -6340,8 +6342,335 @@ + +NO_INLINE /* For better stack traces */ +static void +sweep_conses (void) +{ + register struct cons_block *cblk; + struct cons_block **cprev = &cons_block; + register int lim = cons_block_index; + EMACS_INT num_free = 0, num_used = 0; + + cons_free_list = 0; + + for (cblk = cons_block; cblk; cblk = *cprev) + { + register int i = 0; + int this_free = 0; + int ilim = (lim + BITS_PER_INT - 1) / BITS_PER_INT; + + /* Scan the mark bits an int at a time. */ + for (i = 0; i < ilim; i++) + { + if (cblk->gcmarkbits[i] == -1) + { + /* Fast path - all cons cells for this int are marked. */ + cblk->gcmarkbits[i] = 0; + num_used += BITS_PER_INT; + } + else + { + /* Some cons cells for this int are not marked. + Find which ones, and free them. */ + int start, pos, stop; + + start = i * BITS_PER_INT; + stop = lim - start; + if (stop > BITS_PER_INT) + stop = BITS_PER_INT; + stop += start; + + for (pos = start; pos < stop; pos++) + { + if (!CONS_MARKED_P (&cblk->conses[pos])) + { + this_free++; + cblk->conses[pos].u.chain = cons_free_list; + cons_free_list = &cblk->conses[pos]; +#if GC_MARK_STACK + cons_free_list->car = Vdead; +#endif + } + else + { + num_used++; + CONS_UNMARK (&cblk->conses[pos]); + } + } + } + } + + lim = CONS_BLOCK_SIZE; + /* If this block contains only free conses and we have already + seen more than two blocks worth of free conses then deallocate + this block. */ + if (this_free == CONS_BLOCK_SIZE && num_free > CONS_BLOCK_SIZE) + { + *cprev = cblk->next; + /* Unhook from the free list. */ + cons_free_list = cblk->conses[0].u.chain; + lisp_align_free (cblk); + } + else + { + num_free += this_free; + cprev = &cblk->next; + } + } + total_conses = num_used; + total_free_conses = num_free; +} + +NO_INLINE /* For better stack traces */ +static void +sweep_floats (void) +{ + register struct float_block *fblk; + struct float_block **fprev = &float_block; + register int lim = float_block_index; + EMACS_INT num_free = 0, num_used = 0; + + float_free_list = 0; + + for (fblk = float_block; fblk; fblk = *fprev) + { + register int i; + int this_free = 0; + for (i = 0; i < lim; i++) + if (!FLOAT_MARKED_P (&fblk->floats[i])) + { + this_free++; + fblk->floats[i].u.chain = float_free_list; + float_free_list = &fblk->floats[i]; + } + else + { + num_used++; + FLOAT_UNMARK (&fblk->floats[i]); + } + lim = FLOAT_BLOCK_SIZE; + /* If this block contains only free floats and we have already + seen more than two blocks worth of free floats then deallocate + this block. */ + if (this_free == FLOAT_BLOCK_SIZE && num_free > FLOAT_BLOCK_SIZE) + { + *fprev = fblk->next; + /* Unhook from the free list. */ + float_free_list = fblk->floats[0].u.chain; + lisp_align_free (fblk); + } + else + { + num_free += this_free; + fprev = &fblk->next; + } + } + total_floats = num_used; + total_free_floats = num_free; +} + +NO_INLINE /* For better stack traces */ +static void +sweep_intervals (void) +{ + register struct interval_block *iblk; + struct interval_block **iprev = &interval_block; + register int lim = interval_block_index; + EMACS_INT num_free = 0, num_used = 0; + + interval_free_list = 0; + + for (iblk = interval_block; iblk; iblk = *iprev) + { + register int i; + int this_free = 0; + + for (i = 0; i < lim; i++) + { + if (!iblk->intervals[i].gcmarkbit) + { + set_interval_parent (&iblk->intervals[i], interval_free_list); + interval_free_list = &iblk->intervals[i]; + this_free++; + } + else + { + num_used++; + iblk->intervals[i].gcmarkbit = 0; + } + } + lim = INTERVAL_BLOCK_SIZE; + /* If this block contains only free intervals and we have already + seen more than two blocks worth of free intervals then + deallocate this block. */ + if (this_free == INTERVAL_BLOCK_SIZE && num_free > INTERVAL_BLOCK_SIZE) + { + *iprev = iblk->next; + /* Unhook from the free list. */ + interval_free_list = INTERVAL_PARENT (&iblk->intervals[0]); + lisp_free (iblk); + } + else + { + num_free += this_free; + iprev = &iblk->next; + } + } + total_intervals = num_used; + total_free_intervals = num_free; +} + +NO_INLINE /* For better stack traces */ +static void +sweep_symbols (void) +{ + register struct symbol_block *sblk; + struct symbol_block **sprev = &symbol_block; + register int lim = symbol_block_index; + EMACS_INT num_free = 0, num_used = 0; + + symbol_free_list = NULL; + + for (sblk = symbol_block; sblk; sblk = *sprev) + { + int this_free = 0; + union aligned_Lisp_Symbol *sym = sblk->symbols; + union aligned_Lisp_Symbol *end = sym + lim; + + for (; sym < end; ++sym) + { + /* Check if the symbol was created during loadup. In such a case + it might be pointed to by pure bytecode which we don't trace, + so we conservatively assume that it is live. */ + bool pure_p = PURE_POINTER_P (XSTRING (sym->s.name)); + + if (!sym->s.gcmarkbit && !pure_p) + { + if (sym->s.redirect == SYMBOL_LOCALIZED) + xfree (SYMBOL_BLV (&sym->s)); + sym->s.next = symbol_free_list; + symbol_free_list = &sym->s; +#if GC_MARK_STACK + symbol_free_list->function = Vdead; +#endif + ++this_free; + } + else + { + ++num_used; + if (!pure_p) + eassert (!STRING_MARKED_P (XSTRING (sym->s.name))); + sym->s.gcmarkbit = 0; + } + } + + lim = SYMBOL_BLOCK_SIZE; + /* If this block contains only free symbols and we have already + seen more than two blocks worth of free symbols then deallocate + this block. */ + if (this_free == SYMBOL_BLOCK_SIZE && num_free > SYMBOL_BLOCK_SIZE) + { + *sprev = sblk->next; + /* Unhook from the free list. */ + symbol_free_list = sblk->symbols[0].s.next; + lisp_free (sblk); + } + else + { + num_free += this_free; + sprev = &sblk->next; + } + } + total_symbols = num_used; + total_free_symbols = num_free; +} + +NO_INLINE /* For better stack traces */ +static void +sweep_misc (void) +{ + register struct marker_block *mblk; + struct marker_block **mprev = &marker_block; + register int lim = marker_block_index; + EMACS_INT num_free = 0, num_used = 0; + + /* Put all unmarked misc's on free list. For a marker, first + unchain it from the buffer it points into. */ + + marker_free_list = 0; + + for (mblk = marker_block; mblk; mblk = *mprev) + { + register int i; + int this_free = 0; + + for (i = 0; i < lim; i++) + { + if (!mblk->markers[i].m.u_any.gcmarkbit) + { + if (mblk->markers[i].m.u_any.type == Lisp_Misc_Marker) + unchain_marker (&mblk->markers[i].m.u_marker); + /* Set the type of the freed object to Lisp_Misc_Free. + We could leave the type alone, since nobody checks it, + but this might catch bugs faster. */ + mblk->markers[i].m.u_marker.type = Lisp_Misc_Free; + mblk->markers[i].m.u_free.chain = marker_free_list; + marker_free_list = &mblk->markers[i].m; + this_free++; + } + else + { + num_used++; + mblk->markers[i].m.u_any.gcmarkbit = 0; + } + } + lim = MARKER_BLOCK_SIZE; + /* If this block contains only free markers and we have already + seen more than two blocks worth of free markers then deallocate + this block. */ + if (this_free == MARKER_BLOCK_SIZE && num_free > MARKER_BLOCK_SIZE) + { + *mprev = mblk->next; + /* Unhook from the free list. */ + marker_free_list = mblk->markers[0].m.u_free.chain; + lisp_free (mblk); + } + else + { + num_free += this_free; + mprev = &mblk->next; + } + } + + total_markers = num_used; + total_free_markers = num_free; +} + +NO_INLINE /* For better stack traces */ +static void +sweep_buffers (void) +{ + register struct buffer *buffer, **bprev = &all_buffers; + + total_buffers = 0; + for (buffer = all_buffers; buffer; buffer = *bprev) + if (!VECTOR_MARKED_P (buffer)) + { + *bprev = buffer->next; + lisp_free (buffer); + } + else + { + VECTOR_UNMARK (buffer); + /* Do not use buffer_(set|get)_intervals here. */ + buffer->text->intervals = balance_intervals (buffer->text->intervals); + total_buffers++; + bprev = &buffer->next; + } +} + /* Sweep: find all structures not marked, and free them. */ - static void gc_sweep (void) { @@ -6351,326 +6680,16 @@ sweep_strings (); check_string_bytes (!noninteractive); - - /* Put all unmarked conses on free list. */ - { - register struct cons_block *cblk; - struct cons_block **cprev = &cons_block; - register int lim = cons_block_index; - EMACS_INT num_free = 0, num_used = 0; - - cons_free_list = 0; - - for (cblk = cons_block; cblk; cblk = *cprev) - { - register int i = 0; - int this_free = 0; - int ilim = (lim + BITS_PER_INT - 1) / BITS_PER_INT; - - /* Scan the mark bits an int at a time. */ - for (i = 0; i < ilim; i++) - { - if (cblk->gcmarkbits[i] == -1) - { - /* Fast path - all cons cells for this int are marked. */ - cblk->gcmarkbits[i] = 0; - num_used += BITS_PER_INT; - } - else - { - /* Some cons cells for this int are not marked. - Find which ones, and free them. */ - int start, pos, stop; - - start = i * BITS_PER_INT; - stop = lim - start; - if (stop > BITS_PER_INT) - stop = BITS_PER_INT; - stop += start; - - for (pos = start; pos < stop; pos++) - { - if (!CONS_MARKED_P (&cblk->conses[pos])) - { - this_free++; - cblk->conses[pos].u.chain = cons_free_list; - cons_free_list = &cblk->conses[pos]; -#if GC_MARK_STACK - cons_free_list->car = Vdead; -#endif - } - else - { - num_used++; - CONS_UNMARK (&cblk->conses[pos]); - } - } - } - } - - lim = CONS_BLOCK_SIZE; - /* If this block contains only free conses and we have already - seen more than two blocks worth of free conses then deallocate - this block. */ - if (this_free == CONS_BLOCK_SIZE && num_free > CONS_BLOCK_SIZE) - { - *cprev = cblk->next; - /* Unhook from the free list. */ - cons_free_list = cblk->conses[0].u.chain; - lisp_align_free (cblk); - } - else - { - num_free += this_free; - cprev = &cblk->next; - } - } - total_conses = num_used; - total_free_conses = num_free; - } - - /* Put all unmarked floats on free list. */ - { - register struct float_block *fblk; - struct float_block **fprev = &float_block; - register int lim = float_block_index; - EMACS_INT num_free = 0, num_used = 0; - - float_free_list = 0; - - for (fblk = float_block; fblk; fblk = *fprev) - { - register int i; - int this_free = 0; - for (i = 0; i < lim; i++) - if (!FLOAT_MARKED_P (&fblk->floats[i])) - { - this_free++; - fblk->floats[i].u.chain = float_free_list; - float_free_list = &fblk->floats[i]; - } - else - { - num_used++; - FLOAT_UNMARK (&fblk->floats[i]); - } - lim = FLOAT_BLOCK_SIZE; - /* If this block contains only free floats and we have already - seen more than two blocks worth of free floats then deallocate - this block. */ - if (this_free == FLOAT_BLOCK_SIZE && num_free > FLOAT_BLOCK_SIZE) - { - *fprev = fblk->next; - /* Unhook from the free list. */ - float_free_list = fblk->floats[0].u.chain; - lisp_align_free (fblk); - } - else - { - num_free += this_free; - fprev = &fblk->next; - } - } - total_floats = num_used; - total_free_floats = num_free; - } - - /* Put all unmarked intervals on free list. */ - { - register struct interval_block *iblk; - struct interval_block **iprev = &interval_block; - register int lim = interval_block_index; - EMACS_INT num_free = 0, num_used = 0; - - interval_free_list = 0; - - for (iblk = interval_block; iblk; iblk = *iprev) - { - register int i; - int this_free = 0; - - for (i = 0; i < lim; i++) - { - if (!iblk->intervals[i].gcmarkbit) - { - set_interval_parent (&iblk->intervals[i], interval_free_list); - interval_free_list = &iblk->intervals[i]; - this_free++; - } - else - { - num_used++; - iblk->intervals[i].gcmarkbit = 0; - } - } - lim = INTERVAL_BLOCK_SIZE; - /* If this block contains only free intervals and we have already - seen more than two blocks worth of free intervals then - deallocate this block. */ - if (this_free == INTERVAL_BLOCK_SIZE && num_free > INTERVAL_BLOCK_SIZE) - { - *iprev = iblk->next; - /* Unhook from the free list. */ - interval_free_list = INTERVAL_PARENT (&iblk->intervals[0]); - lisp_free (iblk); - } - else - { - num_free += this_free; - iprev = &iblk->next; - } - } - total_intervals = num_used; - total_free_intervals = num_free; - } - - /* Put all unmarked symbols on free list. */ - { - register struct symbol_block *sblk; - struct symbol_block **sprev = &symbol_block; - register int lim = symbol_block_index; - EMACS_INT num_free = 0, num_used = 0; - - symbol_free_list = NULL; - - for (sblk = symbol_block; sblk; sblk = *sprev) - { - int this_free = 0; - union aligned_Lisp_Symbol *sym = sblk->symbols; - union aligned_Lisp_Symbol *end = sym + lim; - - for (; sym < end; ++sym) - { - /* Check if the symbol was created during loadup. In such a case - it might be pointed to by pure bytecode which we don't trace, - so we conservatively assume that it is live. */ - bool pure_p = PURE_POINTER_P (XSTRING (sym->s.name)); - - if (!sym->s.gcmarkbit && !pure_p) - { - if (sym->s.redirect == SYMBOL_LOCALIZED) - xfree (SYMBOL_BLV (&sym->s)); - sym->s.next = symbol_free_list; - symbol_free_list = &sym->s; -#if GC_MARK_STACK - symbol_free_list->function = Vdead; -#endif - ++this_free; - } - else - { - ++num_used; - if (!pure_p) - eassert (!STRING_MARKED_P (XSTRING (sym->s.name))); - sym->s.gcmarkbit = 0; - } - } - - lim = SYMBOL_BLOCK_SIZE; - /* If this block contains only free symbols and we have already - seen more than two blocks worth of free symbols then deallocate - this block. */ - if (this_free == SYMBOL_BLOCK_SIZE && num_free > SYMBOL_BLOCK_SIZE) - { - *sprev = sblk->next; - /* Unhook from the free list. */ - symbol_free_list = sblk->symbols[0].s.next; - lisp_free (sblk); - } - else - { - num_free += this_free; - sprev = &sblk->next; - } - } - total_symbols = num_used; - total_free_symbols = num_free; - } - - /* Put all unmarked misc's on free list. - For a marker, first unchain it from the buffer it points into. */ - { - register struct marker_block *mblk; - struct marker_block **mprev = &marker_block; - register int lim = marker_block_index; - EMACS_INT num_free = 0, num_used = 0; - - marker_free_list = 0; - - for (mblk = marker_block; mblk; mblk = *mprev) - { - register int i; - int this_free = 0; - - for (i = 0; i < lim; i++) - { - if (!mblk->markers[i].m.u_any.gcmarkbit) - { - if (mblk->markers[i].m.u_any.type == Lisp_Misc_Marker) - unchain_marker (&mblk->markers[i].m.u_marker); - /* Set the type of the freed object to Lisp_Misc_Free. - We could leave the type alone, since nobody checks it, - but this might catch bugs faster. */ - mblk->markers[i].m.u_marker.type = Lisp_Misc_Free; - mblk->markers[i].m.u_free.chain = marker_free_list; - marker_free_list = &mblk->markers[i].m; - this_free++; - } - else - { - num_used++; - mblk->markers[i].m.u_any.gcmarkbit = 0; - } - } - lim = MARKER_BLOCK_SIZE; - /* If this block contains only free markers and we have already - seen more than two blocks worth of free markers then deallocate - this block. */ - if (this_free == MARKER_BLOCK_SIZE && num_free > MARKER_BLOCK_SIZE) - { - *mprev = mblk->next; - /* Unhook from the free list. */ - marker_free_list = mblk->markers[0].m.u_free.chain; - lisp_free (mblk); - } - else - { - num_free += this_free; - mprev = &mblk->next; - } - } - - total_markers = num_used; - total_free_markers = num_free; - } - - /* Free all unmarked buffers */ - { - register struct buffer *buffer, **bprev = &all_buffers; - - total_buffers = 0; - for (buffer = all_buffers; buffer; buffer = *bprev) - if (!VECTOR_MARKED_P (buffer)) - { - *bprev = buffer->next; - lisp_free (buffer); - } - else - { - VECTOR_UNMARK (buffer); - /* Do not use buffer_(set|get)_intervals here. */ - buffer->text->intervals = balance_intervals (buffer->text->intervals); - total_buffers++; - bprev = &buffer->next; - } - } - + sweep_conses (); + sweep_floats (); + sweep_intervals (); + sweep_symbols (); + sweep_misc (); + sweep_buffers (); sweep_vectors (); check_string_bytes (!noninteractive); } - - /* Debugging aids. */ === modified file 'src/fns.c' --- src/fns.c 2014-03-19 21:14:32 +0000 +++ src/fns.c 2014-03-23 21:58:19 +0000 @@ -4032,6 +4032,7 @@ current garbage collection. Remove weak tables that don't survive from Vweak_hash_tables. Called from gc_sweep. */ +NO_INLINE /* For better stack traces */ void sweep_weak_hash_tables (void) { ------------------------------------------------------------ revno: 116862 committer: Juanma Barranquero branch nick: trunk timestamp: Sun 2014-03-23 19:13:35 +0100 message: lisp/vc/vc.el (vc-rollback): Use set-buffer-modified-p. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2014-03-23 17:56:34 +0000 +++ lisp/ChangeLog 2014-03-23 18:13:35 +0000 @@ -1,3 +1,7 @@ +2014-03-23 Juanma Barranquero + + * vc/vc.el (vc-rollback): Use set-buffer-modified-p. + 2014-03-23 Daniel Colascione Change subword-mode to use `find-word-boundary-function-table' and === modified file 'lisp/vc/vc.el' --- lisp/vc/vc.el 2014-01-01 07:43:34 +0000 +++ lisp/vc/vc.el 2014-03-23 18:13:35 +0000 @@ -2450,7 +2450,7 @@ (error "Please revert all modified workfiles before rollback"))) ;; Accumulate changes associated with the fileset (vc-setup-buffer "*vc-diff*") - (not-modified) + (set-buffer-modified-p nil) (message "Finding changes...") (let* ((tip (vc-working-revision (car files))) ;; FIXME: `previous-revision' should take the fileset. ------------------------------------------------------------ revno: 116861 committer: Juanma Barranquero branch nick: trunk timestamp: Sun 2014-03-23 19:11:18 +0100 message: src/w32fns.c (Fw32_shell_execute): Declare `result' only on Cygwin. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2014-03-23 11:44:21 +0000 +++ src/ChangeLog 2014-03-23 18:11:18 +0000 @@ -1,3 +1,7 @@ +2014-03-23 Juanma Barranquero + + * w32fns.c (Fw32_shell_execute): Declare `result' only on Cygwin. + 2014-03-23 Daniel Colascione * xfns.c (create_frame_xic): Pass XNStatusAttributes to XCreateIC === modified file 'src/w32fns.c' --- src/w32fns.c 2014-03-21 19:04:57 +0000 +++ src/w32fns.c 2014-03-23 18:11:18 +0000 @@ -6913,8 +6913,9 @@ char *errstr; Lisp_Object current_dir = BVAR (current_buffer, directory);; wchar_t *doc_w = NULL, *params_w = NULL, *ops_w = NULL; +#ifdef CYGWIN intptr_t result; -#ifndef CYGWIN +#else int use_unicode = w32_unicode_filenames; char *doc_a = NULL, *params_a = NULL, *ops_a = NULL; Lisp_Object absdoc, handler; ------------------------------------------------------------ revno: 116860 committer: Glenn Morris branch nick: trunk timestamp: Sun 2014-03-23 10:56:34 -0700 message: Fix up recent merge ChangeLog duplication Perhaps the merge was done without using bzrmerge.el diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2014-03-23 07:36:26 +0000 +++ lisp/ChangeLog 2014-03-23 17:56:34 +0000 @@ -26,18 +26,6 @@ (Bug#3647) --- unfortunately, only for freshly-compiled code. Please make bootstrap. -2014-03-23 Richard Stallman - - * battery.el (battery-linux-sysfs): Search for each field - from the beginning of the buffer. - -2014-03-23 Daniel Colascione - - * emacs-lisp/cl-macs.el (cl--do-arglist): Use a little `cl-loop' - list to look for keyword arguments instead of `memq', fixing - (Bug#3647) --- unfortunately, only for freshly-compiled code. - Please make bootstrap. - 2014-03-22 Glenn Morris * dired.el (dired-read-regexp): Make obsolete. === modified file 'test/ChangeLog' --- test/ChangeLog 2014-03-23 07:36:26 +0000 +++ test/ChangeLog 2014-03-23 17:56:34 +0000 @@ -1,17 +1,15 @@ -2014-03-23 Daniel Colascione - - * automated/subword-tests.el (subword-tests2): More subword tests. - -2014-03-23 Daniel Colascione - - * automated/cl-lib.el (cl-lib-keyword-names-versus-values): New - test: correct parsing of keyword arguments. - 2014-03-23 Dmitry Gutov * automated/package-test.el (package-test-describe-package): Fix test failure in non-graphical mode. +2014-03-23 Daniel Colascione + + * automated/subword-tests.el (subword-tests2): More subword tests. + + * automated/cl-lib.el (cl-lib-keyword-names-versus-values): New + test: correct parsing of keyword arguments. + 2014-03-22 Dmitry Gutov * automated/package-test.el (package-test-describe-package): @@ -30,11 +28,6 @@ * automated/data/package/archive-contents: Add info about the new package. -2014-03-23 Daniel Colascione - - * automated/cl-lib.el (cl-lib-keyword-names-versus-values): New - test: correct parsing of keyword arguments. - 2014-03-07 Michael Albinus * automated/tramp-tests.el (tramp-copy-size-limit): Declare. ------------------------------------------------------------ revno: 116859 [merge] committer: Daniel Colascione branch nick: trunk timestamp: Sun 2014-03-23 04:45:17 -0700 message: Further improve XIM init diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2014-03-23 10:56:30 +0000 +++ src/ChangeLog 2014-03-23 11:44:21 +0000 @@ -2,7 +2,12 @@ * xfns.c (create_frame_xic): Pass XNStatusAttributes to XCreateIC only if xic_style calls for it. This change allows Emacs to work - with ibus. Also, don't leak resources if create_frame_xic fails. + with ibus. Also, don't leak resources if create_frame_xic fails, + and stop caching xic_style across different displays. + (supported_xim_styles): Make const. + (best_xim_style): Remove first parameter: it's always just + supported_xim_styles. Change to look at supported_xim_styles + directly. 2014-03-23 Daniel Colascione === modified file 'src/xfns.c' --- src/xfns.c 2014-03-23 10:56:30 +0000 +++ src/xfns.c 2014-03-23 11:44:21 +0000 @@ -1641,12 +1641,12 @@ #ifdef HAVE_X_I18N static XFontSet xic_create_xfontset (struct frame *); -static XIMStyle best_xim_style (XIMStyles *, XIMStyles *); +static XIMStyle best_xim_style (XIMStyles *); /* Supported XIM styles, ordered by preference. */ -static XIMStyle supported_xim_styles[] = +static const XIMStyle supported_xim_styles[] = { XIMPreeditPosition | XIMStatusArea, XIMPreeditPosition | XIMStatusNothing, @@ -1941,14 +1941,16 @@ input method XIM. */ static XIMStyle -best_xim_style (XIMStyles *user, XIMStyles *xim) +best_xim_style (XIMStyles *xim) { int i, j; + int nr_supported = + sizeof (supported_xim_styles) / sizeof (supported_xim_styles[0]); - for (i = 0; i < user->count_styles; ++i) + for (i = 0; i < nr_supported; ++i) for (j = 0; j < xim->count_styles; ++j) - if (user->supported_styles[i] == xim->supported_styles[j]) - return user->supported_styles[i]; + if (supported_xim_styles[i] == xim->supported_styles[j]) + return supported_xim_styles[i]; /* Return the default style. */ return XIMPreeditNothing | XIMStatusNothing; @@ -1956,8 +1958,6 @@ /* Create XIC for frame F. */ -static XIMStyle xic_style; - void create_frame_xic (struct frame *f) { @@ -1968,30 +1968,31 @@ XVaNestedList preedit_attr = NULL; XRectangle s_area; XPoint spot; - XIMStyles supported_list; + XIMStyle xic_style; if (FRAME_XIC (f)) - return; + goto out; + + xim = FRAME_X_XIM (f); + if (!xim) + goto out; + + /* Determine XIC style. */ + xic_style = best_xim_style (FRAME_X_XIM_STYLES (f)); /* Create X fontset. */ - xfs = xic_create_xfontset (f); - FRAME_XIC_FONTSET (f) = xfs; - - xim = FRAME_X_XIM (f); - if (xim) + if (xic_style & (XIMPreeditPosition | XIMStatusArea)) + { + xfs = xic_create_xfontset (f); + if (!xfs) + goto out; + + FRAME_XIC_FONTSET (f) = xfs; + } + + if (xic_style & XIMPreeditPosition) { spot.x = 0; spot.y = 1; - - /* Determine XIC style. */ - if (xic_style == 0) - { - supported_list.count_styles = (sizeof supported_xim_styles - / sizeof supported_xim_styles[0]); - supported_list.supported_styles = supported_xim_styles; - xic_style = best_xim_style (&supported_list, - FRAME_X_XIM_STYLES (f)); - } - preedit_attr = XVaCreateNestedList (0, XNFontSet, xfs, XNForeground, @@ -2006,50 +2007,62 @@ if (!preedit_attr) goto out; - - if (xic_style & XIMStatusArea) - { - s_area.x = 0; s_area.y = 0; s_area.width = 1; s_area.height = 1; - status_attr = XVaCreateNestedList (0, - XNArea, - &s_area, - XNFontSet, - xfs, - XNForeground, - FRAME_FOREGROUND_PIXEL (f), - XNBackground, - FRAME_BACKGROUND_PIXEL (f), - NULL); - - if (!status_attr) - goto out; - - xic = XCreateIC (xim, - XNInputStyle, xic_style, - XNClientWindow, FRAME_X_WINDOW (f), - XNFocusWindow, FRAME_X_WINDOW (f), - XNStatusAttributes, status_attr, - XNPreeditAttributes, preedit_attr, - NULL); - } - else - { - xic = XCreateIC (xim, - XNInputStyle, xic_style, - XNClientWindow, FRAME_X_WINDOW (f), - XNFocusWindow, FRAME_X_WINDOW (f), - XNPreeditAttributes, preedit_attr, - NULL); - } - - if (!xic) + } + + if (xic_style & XIMStatusArea) + { + s_area.x = 0; s_area.y = 0; s_area.width = 1; s_area.height = 1; + status_attr = XVaCreateNestedList (0, + XNArea, + &s_area, + XNFontSet, + xfs, + XNForeground, + FRAME_FOREGROUND_PIXEL (f), + XNBackground, + FRAME_BACKGROUND_PIXEL (f), + NULL); + + if (!status_attr) goto out; - - FRAME_XIC (f) = xic; - FRAME_XIC_STYLE (f) = xic_style; - xfs = NULL; /* Don't free below. */ } + if (preedit_attr && status_attr) + xic = XCreateIC (xim, + XNInputStyle, xic_style, + XNClientWindow, FRAME_X_WINDOW (f), + XNFocusWindow, FRAME_X_WINDOW (f), + XNStatusAttributes, status_attr, + XNPreeditAttributes, preedit_attr, + NULL); + else if (preedit_attr) + xic = XCreateIC (xim, + XNInputStyle, xic_style, + XNClientWindow, FRAME_X_WINDOW (f), + XNFocusWindow, FRAME_X_WINDOW (f), + XNPreeditAttributes, preedit_attr, + NULL); + else if (status_attr) + xic = XCreateIC (xim, + XNInputStyle, xic_style, + XNClientWindow, FRAME_X_WINDOW (f), + XNFocusWindow, FRAME_X_WINDOW (f), + XNStatusAttributes, status_attr, + NULL); + else + xic = XCreateIC (xim, + XNInputStyle, xic_style, + XNClientWindow, FRAME_X_WINDOW (f), + XNFocusWindow, FRAME_X_WINDOW (f), + NULL); + + if (!xic) + goto out; + + FRAME_XIC (f) = xic; + FRAME_XIC_STYLE (f) = xic_style; + xfs = NULL; /* Don't free below. */ + out: if (xfs) ------------------------------------------------------------ revno: 116858 [merge] committer: Daniel Colascione branch nick: trunk timestamp: Sun 2014-03-23 03:57:25 -0700 message: Make Emacs work with ibus diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2014-03-23 08:29:43 +0000 +++ src/ChangeLog 2014-03-23 10:56:30 +0000 @@ -1,5 +1,11 @@ 2014-03-23 Daniel Colascione + * xfns.c (create_frame_xic): Pass XNStatusAttributes to XCreateIC + only if xic_style calls for it. This change allows Emacs to work + with ibus. Also, don't leak resources if create_frame_xic fails. + +2014-03-23 Daniel Colascione + * term.c (init_tty): Rearrange condition for clarity; print appropriate diagnostic. === modified file 'src/xfns.c' --- src/xfns.c 2014-03-11 06:50:01 +0000 +++ src/xfns.c 2014-03-23 10:56:30 +0000 @@ -1964,27 +1964,27 @@ XIM xim; XIC xic = NULL; XFontSet xfs = NULL; + XVaNestedList status_attr = NULL; + XVaNestedList preedit_attr = NULL; + XRectangle s_area; + XPoint spot; + XIMStyles supported_list; if (FRAME_XIC (f)) return; /* Create X fontset. */ xfs = xic_create_xfontset (f); + FRAME_XIC_FONTSET (f) = xfs; + xim = FRAME_X_XIM (f); if (xim) { - XRectangle s_area; - XPoint spot; - XVaNestedList preedit_attr; - XVaNestedList status_attr; - - s_area.x = 0; s_area.y = 0; s_area.width = 1; s_area.height = 1; spot.x = 0; spot.y = 1; /* Determine XIC style. */ if (xic_style == 0) { - XIMStyles supported_list; supported_list.count_styles = (sizeof supported_xim_styles / sizeof supported_xim_styles[0]); supported_list.supported_styles = supported_xim_styles; @@ -2003,31 +2003,63 @@ : NULL), &spot, NULL); - status_attr = XVaCreateNestedList (0, - XNArea, - &s_area, - XNFontSet, - xfs, - XNForeground, - FRAME_FOREGROUND_PIXEL (f), - XNBackground, - FRAME_BACKGROUND_PIXEL (f), - NULL); - - xic = XCreateIC (xim, - XNInputStyle, xic_style, - XNClientWindow, FRAME_X_WINDOW (f), - XNFocusWindow, FRAME_X_WINDOW (f), - XNStatusAttributes, status_attr, - XNPreeditAttributes, preedit_attr, - NULL); - XFree (preedit_attr); - XFree (status_attr); + + if (!preedit_attr) + goto out; + + if (xic_style & XIMStatusArea) + { + s_area.x = 0; s_area.y = 0; s_area.width = 1; s_area.height = 1; + status_attr = XVaCreateNestedList (0, + XNArea, + &s_area, + XNFontSet, + xfs, + XNForeground, + FRAME_FOREGROUND_PIXEL (f), + XNBackground, + FRAME_BACKGROUND_PIXEL (f), + NULL); + + if (!status_attr) + goto out; + + xic = XCreateIC (xim, + XNInputStyle, xic_style, + XNClientWindow, FRAME_X_WINDOW (f), + XNFocusWindow, FRAME_X_WINDOW (f), + XNStatusAttributes, status_attr, + XNPreeditAttributes, preedit_attr, + NULL); + } + else + { + xic = XCreateIC (xim, + XNInputStyle, xic_style, + XNClientWindow, FRAME_X_WINDOW (f), + XNFocusWindow, FRAME_X_WINDOW (f), + XNPreeditAttributes, preedit_attr, + NULL); + } + + if (!xic) + goto out; + + FRAME_XIC (f) = xic; + FRAME_XIC_STYLE (f) = xic_style; + xfs = NULL; /* Don't free below. */ } - FRAME_XIC (f) = xic; - FRAME_XIC_STYLE (f) = xic_style; - FRAME_XIC_FONTSET (f) = xfs; + out: + + if (xfs) + free_frame_xic (f); + + if (preedit_attr) + XFree (preedit_attr); + + if (status_attr) + XFree (status_attr); } ------------------------------------------------------------ revno: 116857 committer: Glenn Morris branch nick: trunk timestamp: Sun 2014-03-23 06:24:01 -0400 message: Auto-commit of loaddefs files. diff: === modified file 'lisp/dired.el' --- lisp/dired.el 2014-03-22 23:56:19 +0000 +++ lisp/dired.el 2014-03-23 10:24:01 +0000 @@ -3867,7 +3867,7 @@ ;;; Start of automatically extracted autoloads. -;;;### (autoloads nil "dired-aux" "dired-aux.el" "bd357e0a0e74eb553e90e0b6d19cf611") +;;;### (autoloads nil "dired-aux" "dired-aux.el" "edcfeacd242f6163e847594870855b9e") ;;; Generated autoloads from dired-aux.el (autoload 'dired-diff "dired-aux" "\ @@ -4370,7 +4370,7 @@ ;;;*** -;;;### (autoloads nil "dired-x" "dired-x.el" "291bc6e869bf72c900604c45d40f45ed") +;;;### (autoloads nil "dired-x" "dired-x.el" "994b5d9fc38059ab641ec271c728e56f") ;;; Generated autoloads from dired-x.el (autoload 'dired-jump "dired-x" "\ ------------------------------------------------------------ revno: 116856 committer: Daniel Colascione branch nick: debug timestamp: Sun 2014-03-23 02:17:29 -0700 message: Notice when gfilenotify depends on glib diff: === modified file 'ChangeLog' --- ChangeLog 2014-03-22 22:52:47 +0000 +++ ChangeLog 2014-03-23 09:17:29 +0000 @@ -1,3 +1,8 @@ +2014-03-23 Daniel Colascione + + * configure.ac: (Bug#17069) Include GFILENOTIFY objects in glib + check. + 2014-03-22 Glenn Morris * make-dist: Do not distribute lib-src/testfile. === modified file 'configure.ac' --- configure.ac 2014-03-21 10:12:53 +0000 +++ configure.ac 2014-03-23 09:17:29 +0000 @@ -3834,6 +3834,10 @@ dnl Check this late. It depends on what other libraries (lrsvg, Gtk+ etc) dnl Emacs uses. XGSELOBJ= +OLDCFLAGS="$CFLAGS" +OLDLIBS="$LIBS" +CFLAGS="$CFLAGS $GFILENOTIFY_CFLAGS" +LIBS="$LIBS $GFILENOTIFY_LIBS" AC_MSG_CHECKING([whether GLib is linked in]) AC_LINK_IFELSE([AC_LANG_PROGRAM( [[#include @@ -3848,6 +3852,8 @@ XGSELOBJ=xgselect.o fi fi +CFLAGS="$OLDCFLAGS" +LIBS="$OLDLIBS" AC_SUBST(XGSELOBJ) dnl Adapted from Haible's version. ------------------------------------------------------------ revno: 116855 committer: Daniel Colascione branch nick: trunk timestamp: Sun 2014-03-23 01:29:43 -0700 message: Improve init_tty readability diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2014-03-23 05:15:48 +0000 +++ src/ChangeLog 2014-03-23 08:29:43 +0000 @@ -1,5 +1,10 @@ 2014-03-23 Daniel Colascione + * term.c (init_tty): Rearrange condition for clarity; print + appropriate diagnostic. + +2014-03-23 Daniel Colascione + * process.c (DATAGRAM_CONN_P): Don't underflow datagram_address array. (ASAN caught.) === modified file 'src/term.c' --- src/term.c 2014-03-20 14:09:37 +0000 +++ src/term.c 2014-03-23 08:29:43 +0000 @@ -4031,12 +4031,15 @@ open a frame on the same terminal. */ int flags = O_RDWR | O_NOCTTY | (ctty ? 0 : O_IGNORE_CTTY); int fd = emacs_open (name, flags, 0); - tty->input = tty->output = fd < 0 || ! isatty (fd) ? 0 : fdopen (fd, "w+"); + tty->input = tty->output = + ((fd < 0 || ! isatty (fd)) + ? NULL + : fdopen (fd, "w+")); if (! tty->input) { char const *diagnostic - = tty->input ? "Not a tty device: %s" : "Could not open file: %s"; + = (fd < 0) ? "Could not open file: %s" : "Not a tty device: %s"; emacs_close (fd); maybe_fatal (must_succeed, terminal, diagnostic, diagnostic, name); } ------------------------------------------------------------ revno: 116854 committer: Daniel Colascione branch nick: trunk timestamp: Sun 2014-03-23 00:36:26 -0700 message: Merge capitalized-words-mode and subword-mode diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2014-03-23 06:02:36 +0000 +++ lisp/ChangeLog 2014-03-23 07:36:26 +0000 @@ -1,5 +1,26 @@ 2014-03-23 Daniel Colascione + Change subword-mode to use `find-word-boundary-function-table' and + replace `capitalized-words-mode'. Also, convert to lexical + binding. + + * progmodes/cap-words.el: Delete now-obsolete file. + * progmodes/subword.el: Reimplement using + `find-word-boundary-function-table'. + (subword-mode-map): Hollow out. + (capitalized-words-mode): Define as obsolete alias for + `subword-mode'. + (subword-mode,superword-mode): Tweak documentation to reflect new + implementation; call `subword-setup-buffer'. + (subword-forward,subword-capitalize): Add underscore to indicate + unused variable. + (subword-find-word-boundary-function-table): New constant. + (subword-empty-char-table): New constant. + (subword-setup-buffer): New function. + (subword-find-word-boundary): New function. + +2014-03-23 Daniel Colascione + * emacs-lisp/cl-macs.el (cl--do-arglist): Use a little `cl-loop' list to look for keyword arguments instead of `memq', fixing (Bug#3647) --- unfortunately, only for freshly-compiled code. === removed file 'lisp/progmodes/cap-words.el' --- lisp/progmodes/cap-words.el 2014-01-01 07:43:34 +0000 +++ lisp/progmodes/cap-words.el 1970-01-01 00:00:00 +0000 @@ -1,98 +0,0 @@ -;;; cap-words.el --- minor mode for motion in CapitalizedWordIdentifiers - -;; Copyright (C) 2002-2014 Free Software Foundation, Inc. - -;; Author: Dave Love -;; Keywords: languages - -;; This file is part of GNU Emacs. - -;; GNU Emacs is free software: you can redistribute it and/or modify -;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation, either version 3 of the License, or -;; (at your option) any later version. - -;; GNU Emacs is distributed in the hope that it will be useful, -;; but WITHOUT ANY WARRANTY; without even the implied warranty of -;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;; GNU General Public License for more details. - -;; You should have received a copy of the GNU General Public License -;; along with GNU Emacs. If not, see . - -;;; Commentary: - -;; Provides Capitalized Words minor mode for word movement in -;; identifiers CapitalizedLikeThis. - -;; Note that the same effect could be obtained by frobbing the -;; category of upper case characters to produce word boundaries, but -;; the necessary processing isn't done for ASCII characters. - -;; Fixme: This doesn't work properly for mouse double clicks. - -;;; Code: - -(defun capitalized-find-word-boundary (pos limit) - "Function for use in `find-word-boundary-function-table'. -Looks for word boundaries before capitals." - (save-excursion - (goto-char pos) - (let (case-fold-search) - (if (<= pos limit) - ;; Fixme: Are these regexps the best? - (or (and (re-search-forward "\\=.\\w*[[:upper:]]" - limit t) - (progn (backward-char) - t)) - (re-search-forward "\\>" limit t)) - (or (re-search-backward "[[:upper:]]\\w*\\=" limit t) - (re-search-backward "\\<" limit t)))) - (point))) - - -(defconst capitalized-find-word-boundary-function-table - (let ((tab (make-char-table nil))) - (set-char-table-range tab t #'capitalized-find-word-boundary) - tab) - "Assigned to `find-word-boundary-function-table' in Capitalized Words mode.") - -;;;###autoload -(define-minor-mode capitalized-words-mode - "Toggle Capitalized Words mode. -With a prefix argument ARG, enable Capitalized Words mode if ARG -is positive, and disable it otherwise. If called from Lisp, -enable the mode if ARG is omitted or nil. - -Capitalized Words mode is a buffer-local minor mode. When -enabled, a word boundary occurs immediately before an uppercase -letter in a symbol. This is in addition to all the normal -boundaries given by the syntax and category tables. There is no -restriction to ASCII. - -E.g. the beginning of words in the following identifier are as marked: - - capitalizedWorDD - ^ ^ ^^ - -Note that these word boundaries only apply for word motion and -marking commands such as \\[forward-word]. This mode does not affect word -boundaries found by regexp matching (`\\>', `\\w' &c). - -This style of identifiers is common in environments like Java ones, -where underscores aren't trendy enough. Capitalization rules are -sometimes part of the language, e.g. Haskell, which may thus encourage -such a style. It is appropriate to add `capitalized-words-mode' to -the mode hook for programming language modes in which you encounter -variables like this, e.g. `java-mode-hook'. It's unlikely to cause -trouble if such identifiers aren't used. - -See also `glasses-mode' and `studlify-word'. -Obsoletes `c-forward-into-nomenclature'." - nil " Caps" nil :group 'programming - (set (make-local-variable 'find-word-boundary-function-table) - capitalized-find-word-boundary-function-table)) - -(provide 'cap-words) - -;;; cap-words.el ends here === modified file 'lisp/progmodes/subword.el' --- lisp/progmodes/subword.el 2014-01-05 05:49:44 +0000 +++ lisp/progmodes/subword.el 2014-03-23 07:36:26 +0000 @@ -1,4 +1,4 @@ -;;; subword.el --- Handling capitalized subwords in a nomenclature +;;; subword.el --- Handling capitalized subwords in a nomenclature -*- lexical-binding: t -*- ;; Copyright (C) 2004-2014 Free Software Foundation, Inc. @@ -21,13 +21,10 @@ ;;; Commentary: -;; This package was cc-submode.el before it was recognized being -;; useful in general and not tied to C and c-mode at all. - -;; This package provides `subword' oriented commands and a minor mode -;; (`subword-mode') that substitutes the common word handling -;; functions with them. It also provides the `superword-mode' minor -;; mode that treats symbols as words, the opposite of `subword-mode'. +;; This package provides the `subword' minor mode, which merges the +;; old remap-based subword.el (derived from cc-mode code) and +;; cap-words.el, which takes advantage of core Emacs +;; word-motion-customization functionality. ;; In spite of GNU Coding Standards, it is popular to name a symbol by ;; mixing uppercase and lowercase letters, e.g. "GtkWidget", @@ -47,25 +44,6 @@ ;; words. You also get a mode to treat symbols as words instead, ;; called `superword-mode' (the opposite of `subword-mode'). -;; In the minor mode, all common key bindings for word oriented -;; commands are overridden by the subword oriented commands: - -;; Key Word oriented command Subword oriented command (also superword) -;; ============================================================ -;; M-f `forward-word' `subword-forward' -;; M-b `backward-word' `subword-backward' -;; M-@ `mark-word' `subword-mark' -;; M-d `kill-word' `subword-kill' -;; M-DEL `backward-kill-word' `subword-backward-kill' -;; M-t `transpose-words' `subword-transpose' -;; M-c `capitalize-word' `subword-capitalize' -;; M-u `upcase-word' `subword-upcase' -;; M-l `downcase-word' `subword-downcase' -;; -;; Note: If you have changed the key bindings for the word oriented -;; commands in your .emacs or a similar place, the keys you've changed -;; to are also used for the corresponding subword oriented commands. - ;; To make the mode turn on automatically, put the following code in ;; your .emacs: ;; @@ -102,27 +80,25 @@ "Regexp used by `subword-backward-internal'.") (defvar subword-mode-map - (let ((map (make-sparse-keymap))) - (dolist (cmd '(forward-word backward-word mark-word kill-word - backward-kill-word transpose-words - capitalize-word upcase-word downcase-word - left-word right-word)) - (let ((othercmd (let ((name (symbol-name cmd))) - (string-match "\\([[:alpha:]-]+\\)-word[s]?" name) - (intern (concat "subword-" (match-string 1 name)))))) - (define-key map (vector 'remap cmd) othercmd))) - map) + ;; We originally remapped motion keys here, but now use Emacs core + ;; hooks. Leave this keymap around so that user additions to it + ;; keep working. + (make-sparse-keymap) "Keymap used in `subword-mode' minor mode.") ;;;###autoload +(define-obsolete-function-alias + 'capitalized-words-mode 'subword-mode "24.5") + +;;;###autoload (define-minor-mode subword-mode "Toggle subword movement and editing (Subword mode). With a prefix argument ARG, enable Subword mode if ARG is positive, and disable it otherwise. If called from Lisp, enable the mode if ARG is omitted or nil. -Subword mode is a buffer-local minor mode. Enabling it remaps -word-based editing commands to subword-based commands that handle +Subword mode is a buffer-local minor mode. Enabling it changes +the definition of a word so that word-based commands stop inside symbols with mixed uppercase and lowercase letters, e.g. \"GtkWidget\", \"EmacsFrameClass\", \"NSGraphicsContext\". @@ -136,13 +112,13 @@ EmacsFrameClass => \"Emacs\", \"Frame\" and \"Class\" NSGraphicsContext => \"NS\", \"Graphics\" and \"Context\" -The subword oriented commands activated in this minor mode recognize -subwords in a nomenclature to move between subwords and to edit them -as words. +This mode changes the definition of a word so that word commands +treat nomenclature boundaries as word bounaries. \\{subword-mode-map}" :lighter " ," - (when subword-mode (superword-mode -1))) + (when subword-mode (superword-mode -1)) + (subword-setup-buffer)) (define-obsolete-function-alias 'c-subword-mode 'subword-mode "23.2") @@ -151,6 +127,13 @@ (lambda () (subword-mode 1)) :group 'convenience) +;; N.B. These commands aren't used unless explicitly invoked; they're +;; here for compatibility. Today, subword-mode leaves motion commands +;; alone and uses `find-word-boundary-function-table' to change how +;; `forward-word' and other low-level commands detect word bounaries. +;; This way, all word-related activities, not just the images we +;; imagine here, get subword treatment. + (defun subword-forward (&optional arg) "Do the same as `forward-word' but on subwords. See the command `subword-mode' for a description of subwords. @@ -159,10 +142,10 @@ (unless arg (setq arg 1)) (cond ((< 0 arg) - (dotimes (i arg (point)) + (dotimes (_i arg (point)) (funcall subword-forward-function))) ((> 0 arg) - (dotimes (i (- arg) (point)) + (dotimes (_i (- arg) (point)) (funcall subword-backward-function))) (t (point)))) @@ -262,7 +245,7 @@ (start (point)) (advance (>= arg 0))) - (dotimes (i count) + (dotimes (_i count) (if advance (progn (re-search-forward "[[:alpha:]]") @@ -290,17 +273,15 @@ positive, and disable it otherwise. If called from Lisp, enable the mode if ARG is omitted or nil. -Superword mode is a buffer-local minor mode. Enabling it remaps -word-based editing commands to superword-based commands that -treat symbols as words, e.g. \"this_is_a_symbol\". - -The superword oriented commands activated in this minor mode -recognize symbols as superwords to move between superwords and to -edit them as words. +Superword mode is a buffer-local minor mode. Enabling it changes +the definition of words such that symbols characters are treated +as parts of words: e.g., in `superword-mode', +\"this_is_a_symbol\" counts as one word. \\{superword-mode-map}" :lighter " ²" - (when superword-mode (subword-mode -1))) + (when superword-mode (subword-mode -1)) + (subword-setup-buffer)) ;;;###autoload (define-global-minor-mode global-superword-mode superword-mode @@ -347,9 +328,43 @@ (1+ (match-beginning 0))))) (backward-word 1)))) +(defconst subword-find-word-boundary-function-table + (let ((tab (make-char-table nil))) + (set-char-table-range tab t #'subword-find-word-boundary) + tab) + "Assigned to `find-word-boundary-function-table' in +`subword-mode' and `superword-mode'; defers to +`subword-find-word-bounary'.") + +(defconst subword-empty-char-table + (make-char-table nil) + "Assigned to `find-word-boundary-function-table' while we're +searching subwords in order to avoid unwanted reentrancy.") + +(defun subword-setup-buffer () + (set (make-local-variable 'find-word-boundary-function-table) + (if (or subword-mode superword-mode) + subword-find-word-boundary-function-table + subword-empty-char-table))) + +(defun subword-find-word-boundary (pos limit) + "Catch-all handler in `subword-find-word-boundary-function-table'." + (let ((find-word-boundary-function-table subword-empty-char-table)) + (save-match-data + (save-excursion + (save-restriction + (if (< pos limit) + (progn + (narrow-to-region (point-min) limit) + (funcall subword-forward-function)) + (narrow-to-region limit (point-max)) + (funcall subword-backward-function)) + (point)))))) + (provide 'subword) (provide 'superword) +(provide 'cap-words) ; Obsolete alias ;;; subword.el ends here === modified file 'test/ChangeLog' --- test/ChangeLog 2014-03-23 06:02:36 +0000 +++ test/ChangeLog 2014-03-23 07:36:26 +0000 @@ -1,5 +1,9 @@ 2014-03-23 Daniel Colascione + * automated/subword-tests.el (subword-tests2): More subword tests. + +2014-03-23 Daniel Colascione + * automated/cl-lib.el (cl-lib-keyword-names-versus-values): New test: correct parsing of keyword arguments. === modified file 'test/automated/subword-tests.el' --- test/automated/subword-tests.el 2014-01-01 07:43:34 +0000 +++ test/automated/subword-tests.el 2014-03-23 07:36:26 +0000 @@ -46,5 +46,36 @@ (insert "^")) (should (equal (buffer-string) str))))) +(ert-deftest subword-tests2 () + "Test that motion in subword-mode stops at the right places." + + (let* ((line "fooBarBAZ quXD g_TESTThingAbc word BLAH test") + (fwrd "* * * * * * * * * * * * *") + (bkwd "* * * * * * * * * * * * *")) + + (with-temp-buffer + (subword-mode 1) + (insert line) + + ;; Test forward motion. + + (goto-char (point-min)) + (let ((stops (make-string (length fwrd) ?\ ))) + (while (progn + (aset stops (1- (point)) ?\*) + (not (eobp))) + (forward-word)) + (should (equal stops fwrd))) + + ;; Test backward motion. + + (goto-char (point-max)) + (let ((stops (make-string (length bkwd) ?\ ))) + (while (progn + (aset stops (1- (point)) ?\*) + (not (bobp))) + (backward-word)) + (should (equal stops bkwd)))))) + (provide 'subword-tests) ;;; subword-tests.el ends here ------------------------------------------------------------ revno: 116853 [merge] committer: Daniel Colascione branch nick: trunk timestamp: Sat 2014-03-22 23:02:36 -0700 message: Merge from emacs-24; up to r116836 diff: === modified file 'etc/PROBLEMS' --- etc/PROBLEMS 2014-03-22 22:52:47 +0000 +++ etc/PROBLEMS 2014-03-23 06:02:36 +0000 @@ -29,8 +29,7 @@ - in your ~/.Xdefaults file - client-side X resource file, such as ~/Emacs or - /usr/X11R6/lib/app-defaults/Emacs or - /usr/X11R6/lib/X11/app-defaults/Emacs + /usr/share/X11/app-defaults/Emacs One of these files might have bad or malformed specification of a fontset that Emacs should use. To fix the problem, you need to find @@ -108,6 +107,7 @@ * Crash bugs ** Emacs crashes when running in a terminal, if compiled with GCC 4.5.0 + This version of GCC is buggy: see http://debbugs.gnu.org/6031 @@ -154,10 +154,12 @@ untar it :-). ** Emacs can crash when displaying PNG images with transparency. + This is due to a bug introduced in ImageMagick 6.8.2-3. The bug should be fixed in ImageMagick 6.8.3-10. See . ** Crashes when displaying GIF images in Emacs built with version + libungif-4.1.0 are resolved by using version libungif-4.1.0b1. Configure checks for the correct version, but this problem could occur if a binary built against a shared libungif is run on a system with an @@ -207,6 +209,7 @@ it with the Lucid toolkit instead of GTK. ** Emacs crashes when you try to view a file with complex characters. + For example, the etc/HELLO file (as shown by C-h h). The message "symbol lookup error: /usr/bin/emacs: undefined symbol: OTF_open" is shown in the terminal from which you launched Emacs. @@ -600,22 +603,20 @@ *** Some of the fonts called for in your fontset may not exist on your X server. -Each X11 font covers just a fraction of the characters that Emacs +Each X font covers just a fraction of the characters that Emacs supports. To display the whole range of Emacs characters requires many different fonts, collected into a fontset. You can remedy the problem by installing additional fonts. The intlfonts distribution includes a full spectrum of fonts that can display all the characters Emacs supports. The etl-unicode collection -of fonts (available from and -) includes +of fonts (available from ) includes fonts that can display many Unicode characters; they can also be used by ps-print and ps-mule to print Unicode characters. -** Under X11, some characters appear improperly aligned in their lines. +** Under X, some characters appear improperly aligned in their lines. -You may have bad X11 fonts; try installing the intlfonts distribution -or the etl-unicode collection (see above). +You may have bad fonts. ** Under X, an unexpected monospace font is used as the default font. @@ -799,7 +800,7 @@ *** You "lose characters" after typing Compose Character key. This is because the Compose Character key is defined as the keysym -Multi_key, and Emacs (seeing that) does the proper X11 +Multi_key, and Emacs (seeing that) does the proper X character-composition processing. If you don't want your Compose key to do that, you can redefine it with xmodmap. @@ -900,7 +901,7 @@ This happens sometimes when using Metacity. Resizing Emacs or ALT-Tab:bing makes the system unresponsive to the mouse or the keyboard. Killing Emacs -or shifting out from X11 and back again usually cures it (i.e. Ctrl-Alt-F1 +or shifting out from X and back again usually cures it (i.e. Ctrl-Alt-F1 and then Alt-F7). A bug for it is here: https://bugs.launchpad.net/ubuntu/+source/metacity/+bug/231034. Note that a permanent fix seems to be to disable "assistive technologies". @@ -1030,7 +1031,7 @@ ** General X problems -*** Redisplay using X11 is much slower than previous Emacs versions. +*** Redisplay using X is much slower than previous Emacs versions. We've noticed that certain X servers draw the text much slower when scroll bars are on the left. We don't know why this happens. If this @@ -1249,6 +1250,7 @@ * Runtime problems on character terminals ** The meta key does not work on xterm. + Typing M-x rings the terminal bell, and inserts a string like ";120~". For recent xterm versions (>= 216), Emacs uses xterm's modifyOtherKeys feature to generate strings for key combinations that are not @@ -2145,7 +2147,7 @@ Many cheap inkjet, and even some cheap laser printers, do not print plain text anymore, they will only print through graphical -printer drivers. A workaround on MS-Windows is to use Windows' basic +printer drivers. A workaround on MS-Windows is to use Windows's basic built in editor to print (this is possibly the only useful purpose it has): @@ -2215,7 +2217,7 @@ un-checking the boxes "auto-copy X selection" and "auto-paste to X selection". -Of this does not work, please inform bug-gnu-emacs@gnu.org. Then +If this does not work, please inform bug-gnu-emacs@gnu.org. Then please call support for your X-server and see if you can get a fix. If you do, please send it to bug-gnu-emacs@gnu.org so we can list it here. @@ -2282,8 +2284,7 @@ First ensure that the necessary 32-bit system libraries and include files are installed. Then use: - env CC="gcc -m32" ./configure --build=i386-linux-gnu \ - --x-libraries=/usr/X11R6/lib + env CC="gcc -m32" ./configure --build=i386-linux-gnu --x-libraries=/usr/lib (using the location of the 32-bit X libraries on your system). @@ -2506,8 +2507,8 @@ *** temacs prints "Pure Lisp storage exhausted". -This means that the Lisp code loaded from the .elc and .el files -during temacs -l loadup inc dump took up more space than was allocated. +This means that the Lisp code loaded from the .elc and .el files during +`temacs --batch --load loadup dump' took up more space than was allocated. This could be caused by 1) adding code to the preloaded Lisp files === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2014-03-23 05:50:24 +0000 +++ lisp/ChangeLog 2014-03-23 06:02:36 +0000 @@ -5,6 +5,18 @@ (Bug#3647) --- unfortunately, only for freshly-compiled code. Please make bootstrap. +2014-03-23 Richard Stallman + + * battery.el (battery-linux-sysfs): Search for each field + from the beginning of the buffer. + +2014-03-23 Daniel Colascione + + * emacs-lisp/cl-macs.el (cl--do-arglist): Use a little `cl-loop' + list to look for keyword arguments instead of `memq', fixing + (Bug#3647) --- unfortunately, only for freshly-compiled code. + Please make bootstrap. + 2014-03-22 Glenn Morris * dired.el (dired-read-regexp): Make obsolete. === modified file 'test/ChangeLog' --- test/ChangeLog 2014-03-23 05:50:24 +0000 +++ test/ChangeLog 2014-03-23 06:02:36 +0000 @@ -3,6 +3,34 @@ * automated/cl-lib.el (cl-lib-keyword-names-versus-values): New test: correct parsing of keyword arguments. +2014-03-23 Dmitry Gutov + + * automated/package-test.el (package-test-describe-package): + Fix test failure in non-graphical mode. + +2014-03-22 Dmitry Gutov + + * automated/package-test.el (package-test-describe-package): + Check for the "Keywords: " line. + + * automated/data/package/archive-contents: Include the :keywords + field in `simple-single' data form. + +2014-03-21 Dmitry Gutov + + * automated/package-test.el + (package-test-install-two-dependencies): New test (bug#16826). + + * automated/data/package/simple-two-depend-1.1.el: New file. + + * automated/data/package/archive-contents: + Add info about the new package. + +2014-03-23 Daniel Colascione + + * automated/cl-lib.el (cl-lib-keyword-names-versus-values): New + test: correct parsing of keyword arguments. + 2014-03-07 Michael Albinus * automated/tramp-tests.el (tramp-copy-size-limit): Declare. === modified file 'test/automated/package-test.el' --- test/automated/package-test.el 2014-03-22 08:43:30 +0000 +++ test/automated/package-test.el 2014-03-23 03:26:13 +0000 @@ -326,7 +326,7 @@ (should (search-forward "Summary: A single-file package with no dependencies" nil t)) (should (search-forward "Homepage: http://doodles.au" nil t)) - (should (search-forward "Keywords: frobnicate")) + (should (re-search-forward "Keywords: \\[?frobnicate\\]?" nil t)) ;; No description, though. Because at this point we don't know ;; what archive the package originated from, and we don't have ;; its readme file saved. ------------------------------------------------------------ revno: 116852 committer: Daniel Colascione branch nick: trunk timestamp: Sat 2014-03-22 22:50:24 -0700 message: Fix cl-defun keyword arg parsing. Please bootstrap. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2014-03-22 23:56:19 +0000 +++ lisp/ChangeLog 2014-03-23 05:50:24 +0000 @@ -1,3 +1,10 @@ +2014-03-23 Daniel Colascione + + * emacs-lisp/cl-macs.el (cl--do-arglist): Use a little `cl-loop' + list to look for keyword arguments instead of `memq', fixing + (Bug#3647) --- unfortunately, only for freshly-compiled code. + Please make bootstrap. + 2014-03-22 Glenn Morris * dired.el (dired-read-regexp): Make obsolete. === modified file 'lisp/emacs-lisp/cl-macs.el' --- lisp/emacs-lisp/cl-macs.el 2014-02-21 17:45:26 +0000 +++ lisp/emacs-lisp/cl-macs.el 2014-03-23 05:50:24 +0000 @@ -503,7 +503,8 @@ (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))))) - (look `(memq ',karg ,restarg))) + (look `(cl-loop for cl--arg on ,restarg by #'cddr + when (eq (car cl--arg) ',karg) return cl--arg))) (and def cl--bind-enquote (setq def `',def)) (if (cddr arg) (let* ((temp (or (nth 2 arg) (make-symbol "--cl-var--"))) === modified file 'test/ChangeLog' --- test/ChangeLog 2014-03-07 14:11:37 +0000 +++ test/ChangeLog 2014-03-23 05:50:24 +0000 @@ -1,3 +1,8 @@ +2014-03-23 Daniel Colascione + + * automated/cl-lib.el (cl-lib-keyword-names-versus-values): New + test: correct parsing of keyword arguments. + 2014-03-07 Michael Albinus * automated/tramp-tests.el (tramp-copy-size-limit): Declare. === modified file 'test/automated/cl-lib.el' --- test/automated/cl-lib.el 2014-01-01 07:43:34 +0000 +++ test/automated/cl-lib.el 2014-03-23 05:50:24 +0000 @@ -195,4 +195,10 @@ (should (eql (cl-mismatch "Aa" "aA") 0)) (should (eql (cl-mismatch '(a b c) '(a b d)) 2))) +(ert-deftest cl-lib-keyword-names-versus-values () + (should (equal + (funcall (cl-function (lambda (&key a b) (list a b))) + :b :a :a 42) + '(42 :a)))) + ;;; cl-lib.el ends here ------------------------------------------------------------ revno: 116851 committer: Daniel Colascione branch nick: debug timestamp: Sat 2014-03-22 22:15:48 -0700 message: Don't underflow datagram_address array diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2014-03-22 23:47:20 +0000 +++ src/ChangeLog 2014-03-23 05:15:48 +0000 @@ -1,3 +1,8 @@ +2014-03-23 Daniel Colascione + + * process.c (DATAGRAM_CONN_P): Don't underflow datagram_address + array. (ASAN caught.) + 2014-03-22 Glenn Morris * callproc.c (init_callproc): In etc, look for NEWS rather than GNU. === modified file 'src/process.c' --- src/process.c 2014-03-22 03:04:24 +0000 +++ src/process.c 2014-03-23 05:15:48 +0000 @@ -353,7 +353,10 @@ int len; } datagram_address[FD_SETSIZE]; #define DATAGRAM_CHAN_P(chan) (datagram_address[chan].sa != 0) -#define DATAGRAM_CONN_P(proc) (PROCESSP (proc) && datagram_address[XPROCESS (proc)->infd].sa != 0) +#define DATAGRAM_CONN_P(proc) \ + (PROCESSP (proc) && \ + XPROCESS (proc)->infd >= 0 && \ + datagram_address[XPROCESS (proc)->infd].sa != 0) #else #define DATAGRAM_CHAN_P(chan) (0) #define DATAGRAM_CONN_P(proc) (0) ------------------------------------------------------------ revno: 116850 committer: Glenn Morris branch nick: trunk timestamp: Sat 2014-03-22 16:58:15 -0700 message: * efaq.texi: Remove cindex that no longer applies after previous change diff: === modified file 'doc/misc/efaq.texi' --- doc/misc/efaq.texi 2014-03-22 23:47:20 +0000 +++ doc/misc/efaq.texi 2014-03-22 23:58:15 +0000 @@ -861,7 +861,6 @@ @cindex Files included with Emacs @cindex @file{COPYING}, description of file @cindex @file{DISTRIB}, description of file -@cindex @file{GNU}, description of file @cindex @file{MACHINES}, description of file @cindex @file{NEWS}, description of file ------------------------------------------------------------ revno: 116849 committer: Glenn Morris branch nick: trunk timestamp: Sat 2014-03-22 16:56:19 -0700 message: Make dired-read-regexp obsolete It's not worth having such a trivial wrapper for read-regexp. * lisp/dired.el (dired-read-regexp): Make obsolete. (dired-mark-files-regexp, dired-mark-files-containing-regexp) (dired-flag-files-regexp): * lisp/dired-aux.el (dired-mark-read-regexp): * lisp/dired-x.el (dired-mark-unmarked-files): Use read-regexp directly. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2014-03-22 23:47:20 +0000 +++ lisp/ChangeLog 2014-03-22 23:56:19 +0000 @@ -1,5 +1,11 @@ 2014-03-22 Glenn Morris + * dired.el (dired-read-regexp): Make obsolete. + (dired-mark-files-regexp, dired-mark-files-containing-regexp) + (dired-flag-files-regexp): + * dired-aux.el (dired-mark-read-regexp): + * dired-x.el (dired-mark-unmarked-files): Use read-regexp directly. + * startup.el (fancy-startup-text): * help.el (describe-gnu-project): Visit online info about GNU project. === modified file 'lisp/dired-aux.el' --- lisp/dired-aux.el 2014-02-10 01:34:22 +0000 +++ lisp/dired-aux.el 2014-03-22 23:56:19 +0000 @@ -1,7 +1,7 @@ ;;; dired-aux.el --- less commonly used parts of dired -;; Copyright (C) 1985-1986, 1992, 1994, 1998, 2000-2014 Free Software -;; Foundation, Inc. +;; Copyright (C) 1985-1986, 1992, 1994, 1998, 2000-2014 +;; Free Software Foundation, Inc. ;; Author: Sebastian Kremer . ;; Maintainer: emacs-devel@gnu.org @@ -1921,8 +1921,9 @@ (arg (if whole-name nil current-prefix-arg)) (regexp - (dired-read-regexp - (concat (if whole-name "Abs. " "") operation " from (regexp): "))) + (read-regexp + (concat (if whole-name "Abs. " "") operation " from (regexp): ") + nil 'dired-regexp-history)) (newname (read-string (concat (if whole-name "Abs. " "") operation " " regexp " to: ")))) === modified file 'lisp/dired-x.el' --- lisp/dired-x.el 2014-01-12 10:29:59 +0000 +++ lisp/dired-x.el 2014-03-22 23:56:19 +0000 @@ -1,7 +1,6 @@ ;;; dired-x.el --- extra Dired functionality -*- lexical-binding:t -*- -;; Copyright (C) 1993-1994, 1997, 2001-2014 Free Software Foundation, -;; Inc. +;; Copyright (C) 1993-1994, 1997, 2001-2014 Free Software Foundation, Inc. ;; Author: Sebastian Kremer ;; Lawrence R. Dodd @@ -556,8 +555,9 @@ With prefix argument, unflag all those files. Optional fourth argument LOCALP is as in `dired-get-filename'." (interactive - (list (dired-read-regexp - "Mark unmarked files matching regexp (default all): ") + (list (read-regexp + "Mark unmarked files matching regexp (default all): " + nil 'dired-regexp-history) nil current-prefix-arg nil)) (let ((dired-marker-char (if unflag-p ?\s dired-marker-char))) (dired-mark-if === modified file 'lisp/dired.el' --- lisp/dired.el 2014-03-18 13:22:01 +0000 +++ lisp/dired.el 2014-03-22 23:56:19 +0000 @@ -1,7 +1,7 @@ ;;; dired.el --- directory-browsing commands -*- lexical-binding: t -*- -;; Copyright (C) 1985-1986, 1992-1997, 2000-2014 Free Software -;; Foundation, Inc. +;; Copyright (C) 1985-1986, 1992-1997, 2000-2014 +;; Free Software Foundation, Inc. ;; Author: Sebastian Kremer ;; Maintainer: emacs-devel@gnu.org @@ -3286,6 +3286,7 @@ (defun dired-read-regexp (prompt &optional default history) "Read a regexp using `read-regexp'." + (declare (obsolete read-regexp "24.5")) (read-regexp prompt default (or history 'dired-regexp-history))) (defun dired-mark-files-regexp (regexp &optional marker-char) @@ -3296,8 +3297,9 @@ REGEXP is an Emacs regexp, not a shell wildcard. Thus, use `\\.o$' for object files--just `.o' will mark more than you might think." (interactive - (list (dired-read-regexp (concat (if current-prefix-arg "Unmark" "Mark") - " files (regexp): ")) + (list (read-regexp (concat (if current-prefix-arg "Unmark" "Mark") + " files (regexp): ") + nil 'dired-regexp-history) (if current-prefix-arg ?\040))) (let ((dired-marker-char (or marker-char dired-marker-char))) (dired-mark-if @@ -3312,8 +3314,9 @@ A prefix argument means to unmark them instead. `.' and `..' are never marked." (interactive - (list (dired-read-regexp (concat (if current-prefix-arg "Unmark" "Mark") - " files containing (regexp): ")) + (list (read-regexp (concat (if current-prefix-arg "Unmark" "Mark") + " files containing (regexp): ") + nil 'dired-regexp-history) (if current-prefix-arg ?\040))) (let ((dired-marker-char (or marker-char dired-marker-char))) (dired-mark-if @@ -3343,7 +3346,8 @@ The match is against the non-directory part of the filename. Use `^' and `$' to anchor matches. Exclude subdirs by hiding them. `.' and `..' are never flagged." - (interactive (list (dired-read-regexp "Flag for deletion (regexp): "))) + (interactive (list (read-regexp "Flag for deletion (regexp): " + nil 'dired-regexp-history))) (dired-mark-files-regexp regexp dired-del-marker)) (defun dired-mark-symlinks (unflag-p) ------------------------------------------------------------ revno: 116848 committer: Glenn Morris branch nick: trunk timestamp: Sat 2014-03-22 16:47:20 -0700 message: Make some files in etc obsolete These are old copies of online information that is not Emacs-specific. * etc/CENSORSHIP, etc/GNU, etc/LINUX-GNU, etc/THE-GNU-PROJECT, etc/WHY-FREE: Replace contents with pointers to www.gnu.org or emacs.info, mark obsolete. * src/callproc.c (init_callproc): In etc, look for NEWS rather than GNU. * lisp/startup.el (fancy-startup-text): * lisp/help.el (describe-gnu-project): Visit online info about GNU project. * doc/emacs/help.texi (Help Files): Update C-h g description. * doc/misc/efaq.texi (Informational files for Emacs): Do not mention etc/GNU. * admin/notes/copyright: Remove references to these files. * etc/MACHINES, etc/NEWS.19: Replace references to these files. diff: === modified file 'admin/notes/copyright' --- admin/notes/copyright 2014-01-01 07:43:34 +0000 +++ admin/notes/copyright 2014-03-22 23:47:20 +0000 @@ -161,13 +161,6 @@ etc/FTP, ORDERS - trivial (at time of writing), no license needed -etc/GNU, INTERVIEW, LINUX-GNU, MOTIVATION, SERVICE, THE-GNU-PROJECT, -WHY-FREE - rms: "These are statements of opinion or testimony. Their licenses - should permit verbatim copying only. Please don't change the - licenses that they have. They are distributed with Emacs but they - are not part of Emacs." - etc/HELLO standard notices. Just a note that although the file itself is not really copyrightable, in the wider context of it being part of === modified file 'doc/emacs/ChangeLog' --- doc/emacs/ChangeLog 2014-03-16 02:42:15 +0000 +++ doc/emacs/ChangeLog 2014-03-22 23:47:20 +0000 @@ -1,3 +1,7 @@ +2014-03-22 Glenn Morris + + * help.texi (Help Files): Update C-h g description. + 2014-03-16 Dmitry Gutov * programs.texi (Matching): Update the missed spot. (Bug#17008) === modified file 'doc/emacs/help.texi' --- doc/emacs/help.texi 2014-02-12 01:20:34 +0000 +++ doc/emacs/help.texi 2014-03-22 23:47:20 +0000 @@ -605,7 +605,8 @@ @item C-h C-f Display the Emacs frequently-answered-questions list (@code{view-emacs-FAQ}). @item C-h g -Display information about the GNU Project (@code{describe-gnu-project}). +Visit a @uref{http://www.gnu.org} page with information about the GNU +Project (@code{describe-gnu-project}). @item C-h C-m Display information about ordering printed copies of Emacs manuals (@code{view-order-manuals}). === modified file 'doc/misc/ChangeLog' --- doc/misc/ChangeLog 2014-03-21 07:00:21 +0000 +++ doc/misc/ChangeLog 2014-03-22 23:47:20 +0000 @@ -1,3 +1,7 @@ +2014-03-22 Glenn Morris + + * efaq.texi (Informational files for Emacs): Do not mention etc/GNU. + 2014-03-21 Glenn Morris * ede.texi (ede-linux): === modified file 'doc/misc/efaq.texi' --- doc/misc/efaq.texi 2014-03-12 20:52:34 +0000 +++ doc/misc/efaq.texi 2014-03-22 23:47:20 +0000 @@ -883,9 +883,6 @@ @item DISTRIB Emacs Availability Information -@item GNU -The GNU Manifesto - @item MACHINES Status of Emacs on Various Machines and Systems === modified file 'etc/CENSORSHIP' --- etc/CENSORSHIP 2010-01-04 05:35:18 +0000 +++ etc/CENSORSHIP 2014-03-22 23:47:20 +0000 @@ -1,87 +1,8 @@ - Censoring my Software - Richard Stallman - [From Datamation, 1 March 1996] - - -Last summer, a few clever legislators proposed a bill to "prohibit -pornography" on the Internet. Last fall, right-wing Christians made -this cause their own. Last week, President Clinton signed the bill, -and we lost the freedom of the press for the public library of the -future. This week, I'm censoring GNU Emacs. - -No, GNU Emacs does not contain pornography. It is a software package, -an award-winning extensible and programmable text editor. But the law -that was passed applies to far more than pornography. It prohibits -"indecent" speech, which can include anything from famous poems, to -masterpieces hanging in the Louvre, to advice about safe sex...to -software. - -Naturally, there was a lot of opposition to this bill. Not only from -people who use the Internet, and people who appreciate erotica, but -from everyone who cares about freedom of the press. - -But every time we tried to tell the public what was at stake, the -forces of censorship responded with a lie: they told the public that -the issue was simply pornography. By embedding this lie as a -presupposition in their statements about the issue, they succeeded in -misinforming the public. So here I am, censoring my software. - -You see, Emacs contains a version of the famous "doctor program", -a.k.a. Eliza, originally developed by Professor Weizenbaum at MIT. -This is the program that imitates a Rogerian psychotherapist. The -user talks to the program, and the program responds--by playing back -the user's own statements, and by recognizing a long list of -particular words. - -The Emacs doctor program was set up to recognize many common curse -words, and respond with an appropriately cute message such as, "Would -you please watch your tongue?" or "Let's not be vulgar." In order to -do this, it had to have a list of curse words. That means the source -code for the program was indecent. - -Because of the censorship law, I had to remove this feature. (I -replaced it with a message announcing that the program has been -censored for your protection.) The new version of the doctor doesn't -recognize the indecent words. If you curse at it, it curses right -back to you--for lack of knowing better. - -Now that people are facing the threat of two years in prison for -indecent network postings, it would be helpful if they could access -precise rules via the Internet for how to avoid imprisonment. -However, this is impossible. The rules would have to mention the -forbidden words, so posting them on the Internet would be against the -rules. - -Of course, I'm making an assumption about just what "indecent" means. -I have to do this, because nobody knows for sure. The most obvious -possible meaning is the meaning it has for television, so I'm using -that as a tentative assumption. However, there is a good chance that -our courts will reject that interpretation of the law as -unconstitutional. - -We can hope that the courts will recognize the Internet as a medium of -publication like books and magazines. If they do, they will entirely -reject any law prohibiting "indecent" publications on the Internet. - -What really worries me is that the courts might take a muddled -in-between escape route--by choosing another interpretation of -"indecent", one that permits the doctor program or a statement of the -decency rules, but prohibits some of the books that children can -browse through in the public library and the bookstore. Over the -years, as the Internet replaces the public library and the bookstore, -some of our freedom of the press will be lost. - -Just a few weeks ago, another country imposed censorship on the -Internet. That was China. We don't think well of China in this -country--its government doesn't respect basic freedoms. But how well -does our government respect them? And do you care enough to preserve -them here? - -If you care, stay in touch with the Voters Telecommunications Watch. -Look in their Web site http://www.vtw.org/ for background information -and political action recommendations. Censorship won in February, but -we can beat it in November. - -Copyright 1996 Richard Stallman -Verbatim copying and distribution is permitted in any medium -provided this notice is preserved. +Censoring my Software + +Note added March 2014: + +This file is obsolete and will be removed in future. +Please update any references to use + + === modified file 'etc/ChangeLog' --- etc/ChangeLog 2014-03-14 17:03:30 +0000 +++ etc/ChangeLog 2014-03-22 23:47:20 +0000 @@ -1,3 +1,8 @@ +2014-03-22 Glenn Morris + + * CENSORSHIP, GNU, LINUX-GNU, THE-GNU-PROJECT, WHY-FREE: Replace + contents with pointers to www.gnu.org or emacs.info, mark obsolete. + 2014-03-14 Rüdiger Sonderfeld * tutorials/TUTORIAL.de: Adapt to recent changes in TUTORIAL. === modified file 'etc/GNU' --- etc/GNU 2014-01-01 07:43:34 +0000 +++ etc/GNU 2014-03-22 23:47:20 +0000 @@ -1,544 +1,8 @@ -Copyright (C) 1985, 1993, 2001-2014 Free Software Foundation, Inc. - - Permission is granted to anyone to make or distribute verbatim copies -of this document, in any medium, provided that the copyright notice and -permission notice are preserved, and that the distributor grants the -recipient permission for further redistribution as permitted by this -notice. - - Modified versions may not be made. - The GNU Manifesto -***************** - - The GNU Manifesto which appears below was written by Richard - Stallman at the beginning of the GNU project, to ask for - participation and support. For the first few years, it was - updated in minor ways to account for developments, but now it - seems best to leave it unchanged as most people have seen it. - - Since that time, we have learned about certain common - misunderstandings that different wording could help avoid. - Footnotes added in 1993 help clarify these points. - - For up-to-date information about the available GNU software, - please see www.gnu.org. For software tasks to work on, see - http://savannah.gnu.org/projects/tasklist. For other ways - to contribute, see http://www.gnu.org/help. - -What's GNU? Gnu's Not Unix! -============================ - - GNU, which stands for Gnu's Not Unix, is the name for the complete -Unix-compatible software system which I am writing so that I can give it -away free to everyone who can use it.(1) Several other volunteers are -helping me. Contributions of time, money, programs and equipment are -greatly needed. - - So far we have an Emacs text editor with Lisp for writing editor -commands, a source level debugger, a yacc-compatible parser generator, -a linker, and around 35 utilities. A shell (command interpreter) is -nearly completed. A new portable optimizing C compiler has compiled -itself and may be released this year. An initial kernel exists but -many more features are needed to emulate Unix. When the kernel and -compiler are finished, it will be possible to distribute a GNU system -suitable for program development. We will use TeX as our text -formatter, but an nroff is being worked on. We will use the free, -portable X window system as well. After this we will add a portable -Common Lisp, an Empire game, a spreadsheet, and hundreds of other -things, plus on-line documentation. We hope to supply, eventually, -everything useful that normally comes with a Unix system, and more. - - GNU will be able to run Unix programs, but will not be identical to -Unix. We will make all improvements that are convenient, based on our -experience with other operating systems. In particular, we plan to -have longer file names, file version numbers, a crashproof file system, -file name completion perhaps, terminal-independent display support, and -perhaps eventually a Lisp-based window system through which several -Lisp programs and ordinary Unix programs can share a screen. Both C -and Lisp will be available as system programming languages. We will -try to support UUCP, MIT Chaosnet, and Internet protocols for -communication. - - GNU is aimed initially at machines in the 68000/16000 class with -virtual memory, because they are the easiest machines to make it run -on. The extra effort to make it run on smaller machines will be left -to someone who wants to use it on them. - - To avoid horrible confusion, please pronounce the `G' in the word -`GNU' when it is the name of this project. - -Why I Must Write GNU -==================== - - I consider that the golden rule requires that if I like a program I -must share it with other people who like it. Software sellers want to -divide the users and conquer them, making each user agree not to share -with others. I refuse to break solidarity with other users in this -way. I cannot in good conscience sign a nondisclosure agreement or a -software license agreement. For years I worked within the Artificial -Intelligence Lab to resist such tendencies and other inhospitalities, -but eventually they had gone too far: I could not remain in an -institution where such things are done for me against my will. - - So that I can continue to use computers without dishonor, I have -decided to put together a sufficient body of free software so that I -will be able to get along without any software that is not free. I -have resigned from the AI lab to deny MIT any legal excuse to prevent -me from giving GNU away. - -Why GNU Will Be Compatible with Unix -==================================== - - Unix is not my ideal system, but it is not too bad. The essential -features of Unix seem to be good ones, and I think I can fill in what -Unix lacks without spoiling them. And a system compatible with Unix -would be convenient for many other people to adopt. - -How GNU Will Be Available -========================= - - GNU is not in the public domain. Everyone will be permitted to -modify and redistribute GNU, but no distributor will be allowed to -restrict its further redistribution. That is to say, proprietary -modifications will not be allowed. I want to make sure that all -versions of GNU remain free. - -Why Many Other Programmers Want to Help -======================================= - - I have found many other programmers who are excited about GNU and -want to help. - - Many programmers are unhappy about the commercialization of system -software. It may enable them to make more money, but it requires them -to feel in conflict with other programmers in general rather than feel -as comrades. The fundamental act of friendship among programmers is the -sharing of programs; marketing arrangements now typically used -essentially forbid programmers to treat others as friends. The -purchaser of software must choose between friendship and obeying the -law. Naturally, many decide that friendship is more important. But -those who believe in law often do not feel at ease with either choice. -They become cynical and think that programming is just a way of making -money. - - By working on and using GNU rather than proprietary programs, we can -be hospitable to everyone and obey the law. In addition, GNU serves as -an example to inspire and a banner to rally others to join us in -sharing. This can give us a feeling of harmony which is impossible if -we use software that is not free. For about half the programmers I -talk to, this is an important happiness that money cannot replace. - -How You Can Contribute -====================== - - I am asking computer manufacturers for donations of machines and -money. I'm asking individuals for donations of programs and work. - - One consequence you can expect if you donate machines is that GNU -will run on them at an early date. The machines should be complete, -ready to use systems, approved for use in a residential area, and not -in need of sophisticated cooling or power. - - I have found very many programmers eager to contribute part-time -work for GNU. For most projects, such part-time distributed work would -be very hard to coordinate; the independently-written parts would not -work together. But for the particular task of replacing Unix, this -problem is absent. A complete Unix system contains hundreds of utility -programs, each of which is documented separately. Most interface -specifications are fixed by Unix compatibility. If each contributor -can write a compatible replacement for a single Unix utility, and make -it work properly in place of the original on a Unix system, then these -utilities will work right when put together. Even allowing for Murphy -to create a few unexpected problems, assembling these components will -be a feasible task. (The kernel will require closer communication and -will be worked on by a small, tight group.) - - If I get donations of money, I may be able to hire a few people full -or part time. The salary won't be high by programmers' standards, but -I'm looking for people for whom building community spirit is as -important as making money. I view this as a way of enabling dedicated -people to devote their full energies to working on GNU by sparing them -the need to make a living in another way. - -Why All Computer Users Will Benefit -=================================== - - Once GNU is written, everyone will be able to obtain good system -software free, just like air.(2) - - This means much more than just saving everyone the price of a Unix -license. It means that much wasteful duplication of system programming -effort will be avoided. This effort can go instead into advancing the -state of the art. - - Complete system sources will be available to everyone. As a result, -a user who needs changes in the system will always be free to make them -himself, or hire any available programmer or company to make them for -him. Users will no longer be at the mercy of one programmer or company -which owns the sources and is in sole position to make changes. - - Schools will be able to provide a much more educational environment -by encouraging all students to study and improve the system code. -Harvard's computer lab used to have the policy that no program could be -installed on the system if its sources were not on public display, and -upheld it by actually refusing to install certain programs. I was very -much inspired by this. - - Finally, the overhead of considering who owns the system software -and what one is or is not entitled to do with it will be lifted. - - Arrangements to make people pay for using a program, including -licensing of copies, always incur a tremendous cost to society through -the cumbersome mechanisms necessary to figure out how much (that is, -which programs) a person must pay for. And only a police state can -force everyone to obey them. Consider a space station where air must -be manufactured at great cost: charging each breather per liter of air -may be fair, but wearing the metered gas mask all day and all night is -intolerable even if everyone can afford to pay the air bill. And the -TV cameras everywhere to see if you ever take the mask off are -outrageous. It's better to support the air plant with a head tax and -chuck the masks. - - Copying all or parts of a program is as natural to a programmer as -breathing, and as productive. It ought to be as free. - -Some Easily Rebutted Objections to GNU's Goals -============================================== - - "Nobody will use it if it is free, because that means they can't - rely on any support." - - "You have to charge for the program to pay for providing the - support." - - If people would rather pay for GNU plus service than get GNU free -without service, a company to provide just service to people who have -obtained GNU free ought to be profitable.(3) - - We must distinguish between support in the form of real programming -work and mere handholding. The former is something one cannot rely on -from a software vendor. If your problem is not shared by enough -people, the vendor will tell you to get lost. - - If your business needs to be able to rely on support, the only way -is to have all the necessary sources and tools. Then you can hire any -available person to fix your problem; you are not at the mercy of any -individual. With Unix, the price of sources puts this out of -consideration for most businesses. With GNU this will be easy. It is -still possible for there to be no available competent person, but this -problem cannot be blamed on distribution arrangements. GNU does not -eliminate all the world's problems, only some of them. - - Meanwhile, the users who know nothing about computers need -handholding: doing things for them which they could easily do -themselves but don't know how. - - Such services could be provided by companies that sell just -hand-holding and repair service. If it is true that users would rather -spend money and get a product with service, they will also be willing -to buy the service having got the product free. The service companies -will compete in quality and price; users will not be tied to any -particular one. Meanwhile, those of us who don't need the service -should be able to use the program without paying for the service. - - "You cannot reach many people without advertising, and you must - charge for the program to support that." - - "It's no use advertising a program people can get free." - - There are various forms of free or very cheap publicity that can be -used to inform numbers of computer users about something like GNU. But -it may be true that one can reach more microcomputer users with -advertising. If this is really so, a business which advertises the -service of copying and mailing GNU for a fee ought to be successful -enough to pay for its advertising and more. This way, only the users -who benefit from the advertising pay for it. - - On the other hand, if many people get GNU from their friends, and -such companies don't succeed, this will show that advertising was not -really necessary to spread GNU. Why is it that free market advocates -don't want to let the free market decide this?(4) - - "My company needs a proprietary operating system to get a - competitive edge." - - GNU will remove operating system software from the realm of -competition. You will not be able to get an edge in this area, but -neither will your competitors be able to get an edge over you. You and -they will compete in other areas, while benefiting mutually in this -one. If your business is selling an operating system, you will not -like GNU, but that's tough on you. If your business is something else, -GNU can save you from being pushed into the expensive business of -selling operating systems. - - I would like to see GNU development supported by gifts from many -manufacturers and users, reducing the cost to each.(5) - - "Don't programmers deserve a reward for their creativity?" - - If anything deserves a reward, it is social contribution. -Creativity can be a social contribution, but only in so far as society -is free to use the results. If programmers deserve to be rewarded for -creating innovative programs, by the same token they deserve to be -punished if they restrict the use of these programs. - - "Shouldn't a programmer be able to ask for a reward for his - creativity?" - - There is nothing wrong with wanting pay for work, or seeking to -maximize one's income, as long as one does not use means that are -destructive. But the means customary in the field of software today -are based on destruction. - - Extracting money from users of a program by restricting their use of -it is destructive because the restrictions reduce the amount and the -ways that the program can be used. This reduces the amount of wealth -that humanity derives from the program. When there is a deliberate -choice to restrict, the harmful consequences are deliberate destruction. - - The reason a good citizen does not use such destructive means to -become wealthier is that, if everyone did so, we would all become -poorer from the mutual destructiveness. This is Kantian ethics; or, -the Golden Rule. Since I do not like the consequences that result if -everyone hoards information, I am required to consider it wrong for one -to do so. Specifically, the desire to be rewarded for one's creativity -does not justify depriving the world in general of all or part of that -creativity. - - "Won't programmers starve?" - - I could answer that nobody is forced to be a programmer. Most of us -cannot manage to get any money for standing on the street and making -faces. But we are not, as a result, condemned to spend our lives -standing on the street making faces, and starving. We do something -else. - - But that is the wrong answer because it accepts the questioner's -implicit assumption: that without ownership of software, programmers -cannot possibly be paid a cent. Supposedly it is all or nothing. - - The real reason programmers will not starve is that it will still be -possible for them to get paid for programming; just not paid as much as -now. - - Restricting copying is not the only basis for business in software. -It is the most common basis because it brings in the most money. If it -were prohibited, or rejected by the customer, software business would -move to other bases of organization which are now used less often. -There are always numerous ways to organize any kind of business. - - Probably programming will not be as lucrative on the new basis as it -is now. But that is not an argument against the change. It is not -considered an injustice that sales clerks make the salaries that they -now do. If programmers made the same, that would not be an injustice -either. (In practice they would still make considerably more than -that.) - - "Don't people have a right to control how their creativity is - used?" - - "Control over the use of one's ideas" really constitutes control over -other people's lives; and it is usually used to make their lives more -difficult. - - People who have studied the issue of intellectual property rights(6) -carefully (such as lawyers) say that there is no intrinsic right to -intellectual property. The kinds of supposed intellectual property -rights that the government recognizes were created by specific acts of -legislation for specific purposes. - - For example, the patent system was established to encourage -inventors to disclose the details of their inventions. Its purpose was -to help society rather than to help inventors. At the time, the life -span of 17 years for a patent was short compared with the rate of -advance of the state of the art. Since patents are an issue only among -manufacturers, for whom the cost and effort of a license agreement are -small compared with setting up production, the patents often do not do -much harm. They do not obstruct most individuals who use patented -products. - - The idea of copyright did not exist in ancient times, when authors -frequently copied other authors at length in works of non-fiction. This -practice was useful, and is the only way many authors' works have -survived even in part. The copyright system was created expressly for -the purpose of encouraging authorship. In the domain for which it was -invented--books, which could be copied economically only on a printing -press--it did little harm, and did not obstruct most of the individuals -who read the books. - - All intellectual property rights are just licenses granted by society -because it was thought, rightly or wrongly, that society as a whole -would benefit by granting them. But in any particular situation, we -have to ask: are we really better off granting such license? What kind -of act are we licensing a person to do? - - The case of programs today is very different from that of books a -hundred years ago. The fact that the easiest way to copy a program is -from one neighbor to another, the fact that a program has both source -code and object code which are distinct, and the fact that a program is -used rather than read and enjoyed, combine to create a situation in -which a person who enforces a copyright is harming society as a whole -both materially and spiritually; in which a person should not do so -regardless of whether the law enables him to. - - "Competition makes things get done better." - - The paradigm of competition is a race: by rewarding the winner, we -encourage everyone to run faster. When capitalism really works this -way, it does a good job; but its defenders are wrong in assuming it -always works this way. If the runners forget why the reward is offered -and become intent on winning, no matter how, they may find other -strategies--such as, attacking other runners. If the runners get into -a fist fight, they will all finish late. - - Proprietary and secret software is the moral equivalent of runners -in a fist fight. Sad to say, the only referee we've got does not seem -to object to fights; he just regulates them ("For every ten yards you -run, you can fire one shot"). He really ought to break them up, and -penalize runners for even trying to fight. - - "Won't everyone stop programming without a monetary incentive?" - - Actually, many people will program with absolutely no monetary -incentive. Programming has an irresistible fascination for some -people, usually the people who are best at it. There is no shortage of -professional musicians who keep at it even though they have no hope of -making a living that way. - - But really this question, though commonly asked, is not appropriate -to the situation. Pay for programmers will not disappear, only become -less. So the right question is, will anyone program with a reduced -monetary incentive? My experience shows that they will. - - For more than ten years, many of the world's best programmers worked -at the Artificial Intelligence Lab for far less money than they could -have had anywhere else. They got many kinds of non-monetary rewards: -fame and appreciation, for example. And creativity is also fun, a -reward in itself. - - Then most of them left when offered a chance to do the same -interesting work for a lot of money. - - What the facts show is that people will program for reasons other -than riches; but if given a chance to make a lot of money as well, they -will come to expect and demand it. Low-paying organizations do poorly -in competition with high-paying ones, but they do not have to do badly -if the high-paying ones are banned. - - "We need the programmers desperately. If they demand that we stop - helping our neighbors, we have to obey." - - You're never so desperate that you have to obey this sort of demand. -Remember: millions for defense, but not a cent for tribute! - - "Programmers need to make a living somehow." - - In the short run, this is true. However, there are plenty of ways -that programmers could make a living without selling the right to use a -program. This way is customary now because it brings programmers and -businessmen the most money, not because it is the only way to make a -living. It is easy to find other ways if you want to find them. Here -are a number of examples. - - A manufacturer introducing a new computer will pay for the porting of -operating systems onto the new hardware. - - The sale of teaching, hand-holding and maintenance services could -also employ programmers. - - People with new ideas could distribute programs as freeware(7), asking -for donations from satisfied users, or selling hand-holding services. -I have met people who are already working this way successfully. - - Users with related needs can form users' groups, and pay dues. A -group would contract with programming companies to write programs that -the group's members would like to use. - - All sorts of development can be funded with a Software Tax: - - Suppose everyone who buys a computer has to pay x percent of the - price as a software tax. The government gives this to an agency - like the NSF to spend on software development. - - But if the computer buyer makes a donation to software development - himself, he can take a credit against the tax. He can donate to - the project of his own choosing--often, chosen because he hopes to - use the results when it is done. He can take a credit for any - amount of donation up to the total tax he had to pay. - - The total tax rate could be decided by a vote of the payers of the - tax, weighted according to the amount they will be taxed on. - - The consequences: - - * The computer-using community supports software development. - - * This community decides what level of support is needed. - - * Users who care which projects their share is spent on can - choose this for themselves. - - In the long run, making programs free is a step toward the -post-scarcity world, where nobody will have to work very hard just to -make a living. People will be free to devote themselves to activities -that are fun, such as programming, after spending the necessary ten -hours a week on required tasks such as legislation, family counseling, -robot repair and asteroid prospecting. There will be no need to be -able to make a living from programming. - - We have already greatly reduced the amount of work that the whole -society must do for its actual productivity, but only a little of this -has translated itself into leisure for workers because much -nonproductive activity is required to accompany productive activity. -The main causes of this are bureaucracy and isometric struggles against -competition. Free software will greatly reduce these drains in the -area of software production. We must do this, in order for technical -gains in productivity to translate into less work for us. - - ---------- Footnotes ---------- - - (1) The wording here was careless. The intention was that nobody -would have to pay for *permission* to use the GNU system. But the -words don't make this clear, and people often interpret them as saying -that copies of GNU should always be distributed at little or no charge. -That was never the intent; later on, the manifesto mentions the -possibility of companies providing the service of distribution for a -profit. Subsequently I have learned to distinguish carefully between -"free" in the sense of freedom and "free" in the sense of price. Free -software is software that users have the freedom to distribute and -change. Some users may obtain copies at no charge, while others pay to -obtain copies--and if the funds help support improving the software, so -much the better. The important thing is that everyone who has a copy -has the freedom to cooperate with others in using it. - - (2) This is another place I failed to distinguish carefully between -the two different meanings of "free". The statement as it stands is -not false--you can get copies of GNU software at no charge, from your -friends or over the net. But it does suggest the wrong idea. - - (3) Several such companies now exist. - - (4) The Free Software Foundation raised most of its funds for 10 -years from a distribution service, although it is a charity rather -than a company. - - (5) A group of computer companies pooled funds around 1991 to -support maintenance of the GNU C Compiler. - - (6) In the 80s I had not yet realized how confusing it was to speak -of "the issue" of "intellectual property". That term is obviously -biased; more subtle is the fact that it lumps together various -disparate laws which raise very different issues. Nowadays I urge -people to reject the term "intellectual property" entirely, lest it -lead others to suppose that those laws form one coherent issue. The way to be -clear is to discuss patents, copyrights, and trademarks separately. -See http://www.gnu.org/philosophy/not-ipr.xhtml for more explanation -of how this term spreads confusion and bias. - - (7) Subsequently we have learned to distinguish between "free -software" and "freeware". The term "freeware" means software you are -free to redistribute, but usually you are not free to study and change -the source code, so most of it is not free software. See -http://www.gnu.org/philosophy/words-to-avoid.html for more -explanation. + +Note added March 2014: + +This file is obsolete and will be removed in future. +Please update any references to use + info node `(emacs)Manifesto' +instead. === modified file 'etc/LINUX-GNU' --- etc/LINUX-GNU 2003-02-04 14:56:31 +0000 +++ etc/LINUX-GNU 2014-03-22 23:47:20 +0000 @@ -1,147 +1,8 @@ - Linux and the GNU system - -The GNU project started in 1984 with the goal of developing a complete -free Unix-like operating system: GNU. "Free" refers to freedom, not -price; it means you are free to run, copy, distribute, study, change, -and improve the software. - -A Unix-like system consists of many different programs. We found some -components already available as free software--for example, X Windows -and TeX. We obtained other components by helping to convince their -developers to make them free--for example, the Berkeley network -utilities. This left many missing components that we had to write in -order to produce GNU--for example, GNU Emacs, the GNU C compiler, the -GNU C library, Bash, and Ghostscript. The GNU system consists of all -these components together. - -The GNU project is not just about developing and distributing some -useful free software. The heart of the GNU project is an idea: that -software should be free, that software users should have freedom to -participate in a community. To run your computer, you need an -operating system; if it is not free, your freedom has been denied. To -have freedom, you need a free operating system. We therefore set out -to write one. - -In the long run, though, we cannot expect to keep the free operating -system free unless the users are aware of the freedom it gives them, -and value that freedom. People who do not appreciate their freedom -will not keep it long. If we want to make freedom last, we need to -spread awareness of the freedoms they have in free software. - -The GNU project's method is that free software and the idea of users' -freedom support each other. We develop GNU software, and as people -encounter GNU programs or the GNU system and start to use them, they -also think about the GNU idea. The software shows that the idea can -work in practice. Some of these people come to agree with the idea, -and then they are more likely to write additional free software. -Thus, the software embodies the idea, spreads the idea, and grows from -the idea. - -Early on in the development of GNU, various parts of it became popular -even though users needed proprietary systems to run them on. Porting -the system to many systems and maintaining them required a lot of -work. After that work, most GNU software is easily configured for a -variety of different platforms. - -By 1991, we had found or written all of the essential major components -of the system except the kernel, which we were writing. (This kernel -consists of the Mach microkernel plus the GNU HURD. The first test -release was made in 1996. Now, in 2002, it is running well, and -Hurd-based GNU systems are starting to be used.) - -That was the situation when Linux came into being. Linux is a kernel, -like the kernel of Unix; it was written by Linus Torvalds, who -released it under the GNU General Public License. He did not write -this kernel for GNU, but it fit into the gap in GNU. The combination -of GNU and Linux included all the major essential components of a -Unix-compatible operating system. Other people, with some work made -the combination into a usable system. The principal use of Linux, the -kernel, is as part of this combination. - -The popularity of the GNU/Linux combination is success, in the sense -of popularity, for GNU. Ironically, the popularity of GNU/Linux -undermines our method of communicating the ideas of GNU to people who -use GNU. - -When GNU programs were only usable individually on top of another -operating system, installing and using them meant knowing and -appreciating these programs, and thus being aware of GNU, which led -people to think about the philosophical base of GNU. Now users can -install a unified operating system which is basically GNU, but they -usually think these are "Linux systems". At first impression, a -"Linux system" sounds like something completely distinct from the "GNU -system," and that is what most users think. - -This leads many users to identify themselves as a separate community -of "Linux users", distinct from the GNU user community. They use more -than just some GNU programs, they use almost all of the GNU system, -but they don't think of themselves as GNU users. Often they never -hear about the GNU idea; if they do, they may not think it relates to -them. - -Most introductions to the "Linux system" acknowledge that GNU software -components play a role in it, but they don't say that the system as a -whole is a modified version of the GNU system that the GNU project has -been developing and compiling since Linus Torvalds was in junior high -school. They don't say that the main reason this free operating -exists is that the GNU Project worked persistently to achieve its goal -of freedom. - -As a result, most users don't know these things. They believe that -the "Linux system" was developed by Linus Torvalds "just for fun", and -that their freedom is a matter of good fortune rather than the -dedicated pursuit of freedom. This creates a danger that they will -leave the survival of free software to fortune as well. - -Since human beings tend to correct their first impressions less than -called for by additional information they learn later, these users -will tend to continue to underestimate their connection to GNU even if -they do learn the facts. - -When we began trying to support the GNU/Linux system, we found this -widespread misinformation led to a practical problem--it hampered -cooperation on software maintenance. Normally when users change a GNU -program to make it work better on a particular system, they send the -change to the maintainer of that program; then they work with the -maintainer, explaining the change, arguing for it, and sometimes -rewriting it for the sake of the overall coherence and maintainability -of the package, to get the patch installed. But people who thought of -themselves as "Linux users" showed a tendency to release a forked -"Linux-only" version of the GNU program and consider the job done. In -some cases we had to redo their work in order to make GNU programs run -as released in GNU/Linux systems. - -How should the GNU project encourage its users to cooperate? How -should we spread the idea that freedom for computer users is -important? - -We must continue to talk about the freedom to share and change -software--and to teach other users to value these freedoms. If we -value having a free operating system, it makes sense to think about -preserving those freedoms for the long term. If we value having a -variety of free software, it makes sense to think about encouraging -others to write free software, instead of proprietary software. - -However, it is not enough just to talk about freedom; we must also -make sure people know the reasons it is worth listening to what we -say. - -Long explanations such as our philosophical articles are one way of -informing the public, but you may not want to spend so much time on -the matter. The most effective way you can help with a small amount -of work is simply by using the terms "Linux-based GNU system" or -"GNU/Linux system", instead of "Linux system," when you write about or -mention such a system. Seeing these terms will show many people the -reason to pay attention to our philosophical articles. - -The system as a whole is more GNU than Linux; the name "GNU/Linux" is -fair. When you are choosing the name of a distribution or a user -group, a name with "GNU/Linux" will reflect both roots of the combined -system, and will bring users into connection with both--including the -spirit of freedom and community that is the basis and purpose of GNU. - - -Copyright 1996, 2002 Richard Stallman -Verbatim copying and redistribution is permitted -without royalty as long as this notice is preserved. - +Linux and the GNU system + +Note added March 2014: + +This file is obsolete and will be removed in future. +Please update any references to use + + === modified file 'etc/MACHINES' --- etc/MACHINES 2014-02-21 08:08:08 +0000 +++ etc/MACHINES 2014-03-22 23:47:20 +0000 @@ -39,8 +39,8 @@ The GNU project wants users of GNU/Linux systems to be aware of how these systems relate to the GNU project, because that will help spread the GNU idea that software should be free--and thus encourage - people to write more free software. See the file LINUX-GNU in this - directory for more explanation. + people to write more free software. For more information, see + . *** 64-bit GNU/Linux === modified file 'etc/NEWS.19' --- etc/NEWS.19 2014-01-01 07:43:34 +0000 +++ etc/NEWS.19 2014-03-22 23:47:20 +0000 @@ -614,7 +614,7 @@ It is generally recommended to use `system-configuration' rather than `system-type'. -See the file LINUX-GNU in this directory for more about this. +See for more about this. ** The functions shell-command and dired-call-process now run file name handlers for default-directory, if it has them. === modified file 'etc/THE-GNU-PROJECT' --- etc/THE-GNU-PROJECT 2011-11-20 07:30:16 +0000 +++ etc/THE-GNU-PROJECT 2014-03-22 23:47:20 +0000 @@ -1,903 +1,8 @@ - The GNU Project - - by Richard Stallman - - originally published in the book "Open Sources" - - The first software-sharing community - - When I started working at the MIT Artificial Intelligence Lab in 1971, - I became part of a software-sharing community that had existed for many - years. Sharing of software was not limited to our particular community; - it is as old as computers, just as sharing of recipes is as old as - cooking. But we did it more than most. - - The AI Lab used a timesharing operating system called ITS (the - Incompatible Timesharing System) that the lab's staff hackers (1) had - designed and written in assembler language for the Digital PDP-10, one - of the large computers of the era. As a member of this community, an AI - lab staff system hacker, my job was to improve this system. - - We did not call our software "free software", because that term did not - yet exist; but that is what it was. Whenever people from another - university or a company wanted to port and use a program, we gladly let - them. If you saw someone using an unfamiliar and interesting program, - you could always ask to see the source code, so that you could read it, - change it, or cannibalize parts of it to make a new program. - - (1) The use of "hacker" to mean "security breaker" is a confusion on - the part of the mass media. We hackers refuse to recognize that - meaning, and continue using the word to mean, "Someone who loves to - program and enjoys being clever about it." - - The collapse of the community - - The situation changed drastically in the early 1980s when Digital - discontinued the PDP-10 series. Its architecture, elegant and powerful - in the 60s, could not extend naturally to the larger address spaces - that were becoming feasible in the 80s. This meant that nearly all of - the programs composing ITS were obsolete. - - The AI lab hacker community had already collapsed, not long before. In - 1981, the spin-off company Symbolics had hired away nearly all of the - hackers from the AI lab, and the depopulated community was unable to - maintain itself. (The book Hackers, by Steve Levy, describes these - events, as well as giving a clear picture of this community in its - prime.) When the AI lab bought a new PDP-10 in 1982, its administrators - decided to use Digital's non-free timesharing system instead of ITS. - - The modern computers of the era, such as the VAX or the 68020, had - their own operating systems, but none of them were free software: you - had to sign a nondisclosure agreement even to get an executable copy. - - This meant that the first step in using a computer was to promise not - to help your neighbor. A cooperating community was forbidden. The rule - made by the owners of proprietary software was, "If you share with your - neighbor, you are a pirate. If you want any changes, beg us to make - them." - - The idea that the proprietary-software social system--the system that - says you are not allowed to share or change software--is antisocial, - that it is unethical, that it is simply wrong, may come as a surprise - to some readers. But what else could we say about a system based on - dividing the public and keeping users helpless? Readers who find the - idea surprising may have taken proprietary-software social system as - given, or judged it on the terms suggested by proprietary software - businesses. Software publishers have worked long and hard to convince - people that there is only one way to look at the issue. - - When software publishers talk about "enforcing" their "rights" or - "stopping piracy", what they actually *say* is secondary. The real - message of these statements is in the unstated assumptions they take - for granted; the public is supposed to accept them uncritically. So - let's examine them. - - One assumption is that software companies have an unquestionable - natural right to own software and thus have power over all its users. - (If this were a natural right, then no matter how much harm it does to - the public, we could not object.) Interestingly, the US Constitution - and legal tradition reject this view; copyright is not a natural right, - but an artificial government-imposed monopoly that limits the users' - natural right to copy. - - Another unstated assumption is that the only important thing about - software is what jobs it allows you to do--that we computer users - should not care what kind of society we are allowed to have. - - A third assumption is that we would have no usable software (or would - never have a program to do this or that particular job) if we did not - offer a company power over the users of the program. This assumption - may have seemed plausible, before the free software movement - demonstrated that we can make plenty of useful software without putting - chains on it. - - If we decline to accept these assumptions, and judge these issues based - on ordinary common-sense morality while placing the users first, we - arrive at very different conclusions. Computer users should be free to - modify programs to fit their needs, and free to share software, because - helping other people is the basis of society. - - There is no room here for an extensive statement of the reasoning - behind this conclusion, so I refer the reader to the web page, - http://www.gnu.org/philosophy/why-free.html. - - A stark moral choice. - - With my community gone, to continue as before was impossible. Instead, - I faced a stark moral choice. - - The easy choice was to join the proprietary software world, signing - nondisclosure agreements and promising not to help my fellow hacker. - Most likely I would also be developing software that was released under - nondisclosure agreements, thus adding to the pressure on other people - to betray their fellows too. - - I could have made money this way, and perhaps amused myself writing - code. But I knew that at the end of my career, I would look back on - years of building walls to divide people, and feel I had spent my life - making the world a worse place. - - I had already experienced being on the receiving end of a nondisclosure - agreement, when someone refused to give me and the MIT AI lab the - source code for the control program for our printer. (The lack of - certain features in this program made use of the printer extremely - frustrating.) So I could not tell myself that nondisclosure agreements - were innocent. I was very angry when he refused to share with us; I - could not turn around and do the same thing to everyone else. - - Another choice, straightforward but unpleasant, was to leave the - computer field. That way my skills would not be misused, but they would - still be wasted. I would not be culpable for dividing and restricting - computer users, but it would happen nonetheless. - - So I looked for a way that a programmer could do something for the - good. I asked myself, was there a program or programs that I could - write, so as to make a community possible once again? - - The answer was clear: what was needed first was an operating system. - That is the crucial software for starting to use a computer. With an - operating system, you can do many things; without one, you cannot run - the computer at all. With a free operating system, we could again have - a community of cooperating hackers--and invite anyone to join. And - anyone would be able to use a computer without starting out by - conspiring to deprive his or her friends. - - As an operating system developer, I had the right skills for this job. - So even though I could not take success for granted, I realized that I - was elected to do the job. I chose to make the system compatible with - Unix so that it would be portable, and so that Unix users could easily - switch to it. The name GNU was chosen following a hacker tradition, as - a recursive acronym for "GNU's Not Unix." - - An operating system does not mean just a kernel, barely enough to run - other programs. In the 1970s, every operating system worthy of the name - included command processors, assemblers, compilers, interpreters, - debuggers, text editors, mailers, and much more. ITS had them, Multics - had them, VMS had them, and Unix had them. The GNU operating system - would include them too. - - Later I heard these words, attributed to Hillel (1): - - If I am not for myself, who will be for me? - If I am only for myself, what am I? - If not now, when? - - The decision to start the GNU project was based on a similar spirit. - - (1) As an Atheist, I don't follow any religious leaders, but I - sometimes find I admire something one of them has said. - - Free as in freedom - - The term "free software" is sometimes misunderstood--it has nothing to - do with price. It is about freedom. Here, therefore, is the definition - of free software: a program is free software, for you, a particular - user, if: - * You have the freedom to run the program, for any purpose. - * You have the freedom to modify the program to suit your needs. (To - make this freedom effective in practice, you must have access to - the source code, since making changes in a program without having - the source code is exceedingly difficult.) - * You have the freedom to redistribute copies, either gratis or for a - fee. - * You have the freedom to distribute modified versions of the - program, so that the community can benefit from your improvements. - - Since "free" refers to freedom, not to price, there is no contradiction - between selling copies and free software. In fact, the freedom to sell - copies is crucial: collections of free software sold on CD-ROMs are - important for the community, and selling them is an important way to - raise funds for free software development. Therefore, a program which - people are not free to include on these collections is not free - software. - - Because of the ambiguity of "free", people have long looked for - alternatives, but no one has found a suitable alternative. The English - Language has more words and nuances than any other, but it lacks a - simple, unambiguous, word that means "free", as in - freedom--"unfettered" being the word that comes closest in meaning. - Such alternatives as "liberated", "freedom", and "open" have either the - wrong meaning or some other disadvantage. - - GNU software and the GNU system - - Developing a whole system is a very large project. To bring it into - reach, I decided to adapt and use existing pieces of free software - wherever that was possible. For example, I decided at the very - beginning to use TeX as the principal text formatter; a few years - later, I decided to use the X Window System rather than writing another - window system for GNU. - - Because of this decision, the GNU system is not the same as the - collection of all GNU software. The GNU system includes programs that - are not GNU software, programs that were developed by other people and - projects for their own purposes, but which we can use because they are - free software. - - Commencing the project - - In January 1984 I quit my job at MIT and began writing GNU software. - Leaving MIT was necessary so that MIT would not be able to interfere - with distributing GNU as free software. If I had remained on the staff, - MIT could have claimed to own the work, and could have imposed their - own distribution terms, or even turned the work into a proprietary - software package. I had no intention of doing a large amount of work - only to see it become useless for its intended purpose: creating a new - software-sharing community. - - However, Professor Winston, then the head of the MIT AI Lab, kindly - invited me to keep using the lab's facilities. - - The first steps - - Shortly before beginning the GNU project, I heard about the Free - University Compiler Kit, also known as VUCK. (The Dutch word for "free" - is written with a V.) This was a compiler designed to handle multiple - languages, including C and Pascal, and to support multiple target - machines. I wrote to its author asking if GNU could use it. - - He responded derisively, stating that the university was free but the - compiler was not. I therefore decided that my first program for the GNU - project would be a multi-language, multi-platform compiler. - - Hoping to avoid the need to write the whole compiler myself, I obtained - the source code for the Pastel compiler, which was a multi-platform - compiler developed at Lawrence Livermore Lab. It supported, and was - written in, an extended version of Pascal, designed to be a - system-programming language. I added a C front end, and began porting - it to the Motorola 68000 computer. But I had to give that up when I - discovered that the compiler needed many megabytes of stack space, and - the available 68000 Unix system would only allow 64k. - - I then realized that the Pastel compiler functioned by parsing the - entire input file into a syntax tree, converting the whole syntax tree - into a chain of "instructions", and then generating the whole output - file, without ever freeing any storage. At this point, I concluded I - would have to write a new compiler from scratch. That new compiler is - now known as GCC; none of the Pastel compiler is used in it, but I - managed to adapt and use the C front end that I had written. But that - was some years later; first, I worked on GNU Emacs. - - GNU Emacs - - I began work on GNU Emacs in September 1984, and in early 1985 it was - beginning to be usable. This enabled me to begin using Unix systems to - do editing; having no interest in learning to use vi or ed, I had done - my editing on other kinds of machines until then. - - At this point, people began wanting to use GNU Emacs, which raised the - question of how to distribute it. Of course, I put it on the anonymous - ftp server on the MIT computer that I used. (This computer, - prep.ai.mit.edu, thus became the principal GNU ftp distribution site; - when it was decommissioned a few years later, we transferred the name - to our new ftp server.) But at that time, many of the interested people - were not on the Internet and could not get a copy by ftp. So the - question was, what would I say to them? - - I could have said, "Find a friend who is on the net and who will make a - copy for you." Or I could have done what I did with the original PDP-10 - Emacs: tell them, "Mail me a tape and a SASE, and I will mail it back - with Emacs on it." But I had no job, and I was looking for ways to make - money from free software. So I announced that I would mail a tape to - whoever wanted one, for a fee of $150. In this way, I started a free - software distribution business, the precursor of the companies that - today distribute entire Linux-based GNU systems. - - Is a program free for every user? - - If a program is free software when it leaves the hands of its author, - this does not necessarily mean it will be free software for everyone - who has a copy of it. For example, public domain software (software - that is not copyrighted) is free software; but anyone can make a - proprietary modified version of it. Likewise, many free programs are - copyrighted but distributed under simple permissive licenses which - allow proprietary modified versions. - - The paradigmatic example of this problem is the X Window System. - Developed at MIT, and released as free software with a permissive - license, it was soon adopted by various computer companies. They added - X to their proprietary Unix systems, in binary form only, and covered - by the same nondisclosure agreement. These copies of X were no more - free software than Unix was. - - The developers of the X Window System did not consider this a - problem--they expected and intended this to happen. Their goal was not - freedom, just "success", defined as "having many users." They did not - care whether these users had freedom, only that they should be - numerous. - - This led to a paradoxical situation where two different ways of - counting the amount of freedom gave different answers to the question, - "Is this program free?" If you judged based on the freedom provided by - the distribution terms of the MIT release, you would say that X was - free software. But if you measured the freedom of the average user of - X, you would have to say it was proprietary software. Most X users were - running the proprietary versions that came with Unix systems, not the - free version. - - Copyleft and the GNU GPL - - The goal of GNU was to give users freedom, not just to be popular. So - we needed to use distribution terms that would prevent GNU software - from being turned into proprietary software. The method we use is - called "copyleft".(1) - - Copyleft uses copyright law, but flips it over to serve the opposite of - its usual purpose: instead of a means of privatizing software, it - becomes a means of keeping software free. - - The central idea of copyleft is that we give everyone permission to run - the program, copy the program, modify the program, and distribute - modified versions--but not permission to add restrictions of their own. - Thus, the crucial freedoms that define "free software" are guaranteed - to everyone who has a copy; they become inalienable rights. - - For an effective copyleft, modified versions must also be free. This - ensures that work based on ours becomes available to our community if - it is published. When programmers who have jobs as programmers - volunteer to improve GNU software, it is copyleft that prevents their - employers from saying, "You can't share those changes, because we are - going to use them to make our proprietary version of the program." - - The requirement that changes must be free is essential if we want to - ensure freedom for every user of the program. The companies that - privatized the X Window System usually made some changes to port it to - their systems and hardware. These changes were small compared with the - great extent of X, but they were not trivial. If making changes were an - excuse to deny the users freedom, it would be easy for anyone to take - advantage of the excuse. - - A related issue concerns combining a free program with non-free code. - Such a combination would inevitably be non-free; whichever freedoms are - lacking for the non-free part would be lacking for the whole as well. - To permit such combinations would open a hole big enough to sink a - ship. Therefore, a crucial requirement for copyleft is to plug this - hole: anything added to or combined with a copylefted program must be - such that the larger combined version is also free and copylefted. - - The specific implementation of copyleft that we use for most GNU - software is the GNU General Public License, or GNU GPL for short. We - have other kinds of copyleft that are used in specific circumstances. - GNU manuals are copylefted also, but use a much simpler kind of - copyleft, because the complexity of the GNU GPL is not necessary for - manuals.(2) - - (1) In 1984 or 1985, Don Hopkins (a very imaginative fellow) mailed me - a letter. On the envelope he had written several amusing sayings, - including this one: "Copyleft--all rights reversed." I used the word - "copyleft" to name the distribution concept I was developing at the - time. - - (2) We now use the GNU Free Documentation License for documentation. - - The Free Software Foundation - - As interest in using Emacs was growing, other people became involved in - the GNU project, and we decided that it was time to seek funding once - again. So in 1985 we created the Free Software Foundation, a tax-exempt - charity for free software development. The FSF also took over the Emacs - tape distribution business; later it extended this by adding other free - software (both GNU and non-GNU) to the tape, and by selling free - manuals as well. - - The FSF accepts donations, but most of its income has always come from - sales--of copies of free software, and of other related services. Today - it sells CD-ROMs of source code, CD-ROMs with binaries, nicely printed - manuals (all with freedom to redistribute and modify), and Deluxe - Distributions (where we build the whole collection of software for your - choice of platform). - - Free Software Foundation employees have written and maintained a number - of GNU software packages. Two notable ones are the C library and the - shell. The GNU C library is what every program running on a GNU/Linux - system uses to communicate with Linux. It was developed by a member of - the Free Software Foundation staff, Roland McGrath. The shell used on - most GNU/Linux systems is BASH, the Bourne Again Shell(1), which was - developed by FSF employee Brian Fox. - - We funded development of these programs because the GNU project was not - just about tools or a development environment. Our goal was a complete - operating system, and these programs were needed for that goal. - - (1) "Bourne again Shell" is a joke on the name ``Bourne Shell'', which - was the usual shell on Unix. - - Free software support - - The free software philosophy rejects a specific widespread business - practice, but it is not against business. When businesses respect the - users' freedom, we wish them success. - - Selling copies of Emacs demonstrates one kind of free software - business. When the FSF took over that business, I needed another way to - make a living. I found it in selling services relating to the free - software I had developed. This included teaching, for subjects such as - how to program GNU Emacs and how to customize GCC, and software - development, mostly porting GCC to new platforms. - - Today each of these kinds of free software business is practiced by a - number of corporations. Some distribute free software collections on - CD-ROM; others sell support at levels ranging from answering user - questions, to fixing bugs, to adding major new features. We are even - beginning to see free software companies based on launching new free - software products. - - Watch out, though--a number of companies that associate themselves with - the term "open source" actually base their business on non-free - software that works with free software. These are not free software - companies, they are proprietary software companies whose products tempt - users away from freedom. They call these "value added", which reflects - the values they would like us to adopt: convenience above freedom. If - we value freedom more, we should call them "freedom subtracted" - products. - - Technical goals - - The principal goal of GNU was to be free software. Even if GNU had no - technical advantage over Unix, it would have a social advantage, - allowing users to cooperate, and an ethical advantage, respecting the - user's freedom. - - But it was natural to apply the known standards of good practice to the - work--for example, dynamically allocating data structures to avoid - arbitrary fixed size limits, and handling all the possible 8-bit codes - wherever that made sense. - - In addition, we rejected the Unix focus on small memory size, by - deciding not to support 16-bit machines (it was clear that 32-bit - machines would be the norm by the time the GNU system was finished), - and to make no effort to reduce memory usage unless it exceeded a - megabyte. In programs for which handling very large files was not - crucial, we encouraged programmers to read an entire input file into - core, then scan its contents without having to worry about I/O. - - These decisions enabled many GNU programs to surpass their Unix - counterparts in reliability and speed. - - Donated computers - - As the GNU project's reputation grew, people began offering to donate - machines running UNIX to the project. These were very useful, because - the easiest way to develop components of GNU was to do it on a UNIX - system, and replace the components of that system one by one. But they - raised an ethical issue: whether it was right for us to have a copy of - UNIX at all. - - UNIX was (and is) proprietary software, and the GNU project's - philosophy said that we should not use proprietary software. But, - applying the same reasoning that leads to the conclusion that violence - in self defense is justified, I concluded that it was legitimate to use - a proprietary package when that was crucial for developing a free - replacement that would help others stop using the proprietary package. - - But, even if this was a justifiable evil, it was still an evil. Today - we no longer have any copies of Unix, because we have replaced them - with free operating systems. If we could not replace a machine's - operating system with a free one, we replaced the machine instead. - - The GNU Task List - - As the GNU project proceeded, and increasing numbers of system - components were found or developed, eventually it became useful to make - a list of the remaining gaps. We used it to recruit developers to write - the missing pieces. This list became known as the GNU task list. In - addition to missing Unix components, we listed added various other - useful software and documentation projects that, we thought, a truly - complete system ought to have. - - Today, hardly any Unix components are left in the GNU task list--those - jobs have been done, aside from a few inessential ones. But the list is - full of projects that some might call "applications". Any program that - appeals to more than a narrow class of users would be a useful thing to - add to an operating system. - - Even games are included in the task list--and have been since the - beginning. Unix included games, so naturally GNU should too. But - compatibility was not an issue for games, so we did not follow the list - of games that Unix had. Instead, we listed a spectrum of different - kinds of games that users might like. - - The GNU Library GPL - - The GNU C library uses a special kind of copyleft called the GNU - Library General Public License(1), which gives permission to link - proprietary software with the library. Why make this exception? - - It is not a matter of principle; there is no principle that says - proprietary software products are entitled to include our code. (Why - contribute to a project predicated on refusing to share with us?) Using - the LGPL for the C library, or for any library, is a matter of - strategy. - - The C library does a generic job; every proprietary system or compiler - comes with a C library. Therefore, to make our C library available only - to free software would not have given free software any advantage--it - would only have discouraged use of our library. - - One system is an exception to this: on the GNU system (and this - includes GNU/Linux), the GNU C library is the only C library. So the - distribution terms of the GNU C library determine whether it is - possible to compile a proprietary program for the GNU system. There is - no ethical reason to allow proprietary applications on the GNU system, - but strategically it seems that disallowing them would do more to - discourage use of the GNU system than to encourage development of free - applications. - - That is why using the Library GPL is a good strategy for the C library. - For other libraries, the strategic decision needs to be considered on a - case-by-case basis. When a library does a special job that can help - write certain kinds of programs, then releasing it under the GPL, - limiting it to free programs only, is a way of helping other free - software developers, giving them an advantage against proprietary - software. - - Consider GNU Readline, a library that was developed to provide - command-line editing for BASH. Readline is released under the ordinary - GNU GPL, not the Library GPL. This probably does reduce the amount - Readline is used, but that is no loss for us. Meanwhile, at least one - useful application has been made free software specifically so it could - use Readline, and that is a real gain for the community. - - Proprietary software developers have the advantages money provides; - free software developers need to make advantages for each other. I hope - some day we will have a large collection of GPL-covered libraries that - have no parallel available to proprietary software, providing useful - modules to serve as building blocks in new free software, and adding up - to a major advantage for further free software development. - - (1) This license is now called the GNU Lesser General Public License, - to avoid giving the idea that all libraries ought to use it. - See http://www.gnu.org/philosophy/why-not-lgpl.html. - - Scratching an itch? - - Eric Raymond says that "Every good work of software starts by - scratching a developer's personal itch." Maybe that happens sometimes, - but many essential pieces of GNU software were developed in order to - have a complete free operating system. They come from a vision and a - plan, not from impulse. - - For example, we developed the GNU C library because a Unix-like system - needs a C library, the Bourne-Again Shell (bash) because a Unix-like - system needs a shell, and GNU tar because a Unix-like system needs a - tar program. The same is true for my own programs--the GNU C compiler, - GNU Emacs, GDB and GNU Make. - - Some GNU programs were developed to cope with specific threats to our - freedom. Thus, we developed gzip to replace the Compress program, which - had been lost to the community because of the LZW patents. We found - people to develop LessTif, and more recently started GNOME and Harmony, - to address the problems caused by certain proprietary libraries (see - below). We are developing the GNU Privacy Guard to replace popular - non-free encryption software, because users should not have to choose - between privacy and freedom. - - Of course, the people writing these programs became interested in the - work, and many features were added to them by various people for the - sake of their own needs and interests. But that is not why the programs - exist. - - Unexpected developments - - At the beginning of the GNU project, I imagined that we would develop - the whole GNU system, then release it as a whole. That is not how it - happened. - - Since each component of the GNU system was implemented on a Unix - system, each component could run on Unix systems, long before a - complete GNU system existed. Some of these programs became popular, and - users began extending them and porting them---to the various - incompatible versions of Unix, and sometimes to other systems as well. - - The process made these programs much more powerful, and attracted both - funds and contributors to the GNU project. But it probably also delayed - completion of a minimal working system by several years, as GNU - developers' time was put into maintaining these ports and adding - features to the existing components, rather than moving on to write one - missing component after another. - - The GNU Hurd - - By 1990, the GNU system was almost complete; the only major missing - component was the kernel. We had decided to implement our kernel as a - collection of server processes running on top of Mach. Mach is a - microkernel developed at Carnegie Mellon University and then at the - University of Utah; the GNU HURD is a collection of servers (or ``herd - of gnus'') that run on top of Mach, and do the various jobs of the Unix - kernel. The start of development was delayed as we waited for Mach to - be released as free software, as had been promised. - - One reason for choosing this design was to avoid what seemed to be the - hardest part of the job: debugging a kernel program without a - source-level debugger to do it with. This part of the job had been done - already, in Mach, and we expected to debug the HURD servers as user - programs, with GDB. But it took a long time to make that possible, and - the multi-threaded servers that send messages to each other have turned - out to be very hard to debug. Making the HURD work solidly has - stretched on for many years. - - Alix - - The GNU kernel was not originally supposed to be called the HURD. Its - original name was Alix--named after the woman who was my sweetheart at - the time. She, a Unix system administrator, had pointed out how her - name would fit a common naming pattern for Unix system versions; as a - joke, she told her friends, "Someone should name a kernel after me." I - said nothing, but decided to surprise her with a kernel named Alix. - - It did not stay that way. Michael Bushnell (now Thomas), the main - developer of the kernel, preferred the name HURD, and redefined Alix to - refer to a certain part of the kernel--the part that would trap system - calls and handle them by sending messages to HURD servers. - - Ultimately, Alix and I broke up, and she changed her name; - independently, the HURD design was changed so that the C library would - send messages directly to servers, and this made the Alix component - disappear from the design. - - But before these things happened, a friend of hers came across the name - Alix in the HURD source code, and mentioned the name to her. So the - name did its job. - - Linux and GNU/Linux - - The GNU Hurd is not ready for production use. Fortunately, another - kernel is available. In 1991, Linus Torvalds developed a - Unix-compatible kernel and called it Linux. Around 1992, combining - Linux with the not-quite-complete GNU system resulted in a complete - free operating system. (Combining them was a substantial job in itself, - of course.) It is due to Linux that we can actually run a version of - the GNU system today. - - We call this system version GNU/Linux, to express its composition as a - combination of the GNU system with Linux as the kernel. - - Challenges in our future - - We have proved our ability to develop a broad spectrum of free - software. This does not mean we are invincible and unstoppable. Several - challenges make the future of free software uncertain; meeting them - will require steadfast effort and endurance, sometimes lasting for - years. It will require the kind of determination that people display - when they value their freedom and will not let anyone take it away. - - The following four sections discuss these challenges. - - Secret hardware - - Hardware manufacturers increasingly tend to keep hardware - specifications secret. This makes it difficult to write free drivers so - that Linux and XFree86 can support new hardware. We have complete free - systems today, but we will not have them tomorrow if we cannot support - tomorrow's computers. - - There are two ways to cope with this problem. Programmers can do - reverse engineering to figure out how to support the hardware. The rest - of us can choose the hardware that is supported by free software; as - our numbers increase, secrecy of specifications will become a - self-defeating policy. - - Reverse engineering is a big job; will we have programmers with - sufficient determination to undertake it? Yes--if we have built up a - strong feeling that free software is a matter of principle, and - non-free drivers are intolerable. And will large numbers of us spend - extra money, or even a little extra time, so we can use free drivers? - Yes, if the determination to have freedom is widespread. - - Non-free libraries - - A non-free library that runs on free operating systems acts as a trap - for free software developers. The library's attractive features are the - bait; if you use the library, you fall into the trap, because your - program cannot usefully be part of a free operating system. (Strictly - speaking, we could include your program, but it won't run with the - library missing.) Even worse, if a program that uses the proprietary - library becomes popular, it can lure other unsuspecting programmers - into the trap. - - The first instance of this problem was the Motif toolkit, back in the - 80s. Although there were as yet no free operating systems, it was clear - what problem Motif would cause for them later on. The GNU Project - responded in two ways: by asking individual free software projects to - support the free X toolkit widgets as well as Motif, and by asking for - someone to write a free replacement for Motif. The job took many years; - LessTif, developed by the Hungry Programmers, became powerful enough to - support most Motif applications only in 1997. - - Between 1996 and 1998, another non-free GUI toolkit library, called Qt, - was used in a substantial collection of free software, the desktop KDE. - - Free GNU/Linux systems were unable to use KDE, because we could not use - the library. However, some commercial distributors of GNU/Linux systems - who were not strict about sticking with free software added KDE to - their systems--producing a system with more capabilities, but less - freedom. The KDE group was actively encouraging more programmers to use - Qt, and millions of new "Linux users" had never been exposed to the - idea that there was a problem in this. The situation appeared grim. - - The free software community responded to the problem in two ways: GNOME - and Harmony. - - GNOME, the GNU Network Object Model Environment, is GNU's desktop - project. Started in 1997 by Miguel de Icaza, and developed with the - support of Red Hat Software, GNOME set out to provide similar desktop - facilities, but using free software exclusively. It has technical - advantages as well, such as supporting a variety of languages, not just - C++. But its main purpose was freedom: not to require the use of any - non-free software. - - Harmony is a compatible replacement library, designed to make it - possible to run KDE software without using Qt. - - In November 1998, the developers of Qt announced a change of license - which, when carried out, should make Qt free software. There is no way - to be sure, but I think that this was partly due to the community's - firm response to the problem that Qt posed when it was non-free. (The - new license is inconvenient and inequitable, so it remains desirable to - avoid using Qt.) - - [Subsequent note: in September 2000, Qt was rereleased under the GNU - GPL, which essentially solved this problem.] - - How will we respond to the next tempting non-free library? Will the - whole community understand the need to stay out of the trap? Or will - many of us give up freedom for convenience, and produce a major - problem? Our future depends on our philosophy. - - Software patents - - The worst threat we face comes from software patents, which can put - algorithms and features off limits to free software for up to twenty - years. The LZW compression algorithm patents were applied for in 1983, - and we still cannot release free software to produce proper compressed - GIFs. In 1998, a free program to produce MP3 compressed audio was - removed from distribution under threat of a patent suit. - - There are ways to cope with patents: we can search for evidence that a - patent is invalid, and we can look for alternative ways to do a job. - But each of these methods works only sometimes; when both fail, a - patent may force all free software to lack some feature that users - want. What will we do when this happens? - - Those of us who value free software for freedom's sake will stay with - free software anyway. We will manage to get work done without the - patented features. But those who value free software because they - expect it to be technically superior are likely to call it a failure - when a patent holds it back. Thus, while it is useful to talk about the - practical effectiveness of the "cathedral" model of development (1), - and the reliability and power of some free software, we must not stop - there. We must talk about freedom and principle. - - (1) It would have been clearer to write `of the "bazaar" model', since - that was the alternative that was new and initially controversial. - - Free documentation - - The biggest deficiency in our free operating systems is not in the - software--it is the lack of good free manuals that we can include in - our systems. Documentation is an essential part of any software - package; when an important free software package does not come with a - good free manual, that is a major gap. We have many such gaps today. - - Free documentation, like free software, is a matter of freedom, not - price. The criterion for a free manual is pretty much the same as for - free software: it is a matter of giving all users certain freedoms. - Redistribution (including commercial sale) must be permitted, on-line - and on paper, so that the manual can accompany every copy of the - program. - - Permission for modification is crucial too. As a general rule, I don't - believe that it is essential for people to have permission to modify - all sorts of articles and books. For example, I don't think you or I - are obliged to give permission to modify articles like this one, which - describe our actions and our views. - - But there is a particular reason why the freedom to modify is crucial - for documentation for free software. When people exercise their right - to modify the software, and add or change its features, if they are - conscientious they will change the manual too--so they can provide - accurate and usable documentation with the modified program. A manual - which does not allow programmers to be conscientious and finish the - job, does not fill our community's needs. - - Some kinds of limits on how modifications are done pose no problem. For - example, requirements to preserve the original author's copyright - notice, the distribution terms, or the list of authors, are ok. It is - also no problem to require modified versions to include notice that - they were modified, even to have entire sections that may not be - deleted or changed, as long as these sections deal with nontechnical - topics. These kinds of restrictions are not a problem because they - don't stop the conscientious programmer from adapting the manual to fit - the modified program. In other words, they don't block the free - software community from making full use of the manual. - - However, it must be possible to modify all the *technical* content of - the manual, and then distribute the result in all the usual media, - through all the usual channels; otherwise, the restrictions do obstruct - the community, the manual is not free, and we need another manual. - - Will free software developers have the awareness and determination to - produce a full spectrum of free manuals? Once again, our future depends - on philosophy. - - We must talk about freedom - - Estimates today are that there are ten million users of GNU/Linux - systems such as Debian GNU/Linux and Red Hat Linux. Free software has - developed such practical advantages that users are flocking to it for - purely practical reasons. - - The good consequences of this are evident: more interest in developing - free software, more customers for free software businesses, and more - ability to encourage companies to develop commercial free software - instead of proprietary software products. - - But interest in the software is growing faster than awareness of the - philosophy it is based on, and this leads to trouble. Our ability to - meet the challenges and threats described above depends on the will to - stand firm for freedom. To make sure our community has this will, we - need to spread the idea to the new users as they come into the - community. - - But we are failing to do so: the efforts to attract new users into our - community are far outstripping the efforts to teach them the civics of - our community. We need to do both, and we need to keep the two efforts - in balance. - - "Open Source" - - Teaching new users about freedom became more difficult in 1998, when a - part of the community decided to stop using the term "free software" - and say "open source software" instead. - - Some who favored this term aimed to avoid the confusion of "free" with - "gratis"--a valid goal. Others, however, aimed to set aside the spirit - of principle that had motivated the free software movement and the GNU - project, and to appeal instead to executives and business users, many - of whom hold an ideology that places profit above freedom, above - community, above principle. Thus, the rhetoric of "open source" focuses - on the potential to make high quality, powerful software, but shuns the - ideas of freedom, community, and principle. - - The "Linux" magazines are a clear example of this--they are filled with - advertisements for proprietary software that works with GNU/Linux. When - the next Motif or Qt appears, will these magazines warn programmers to - stay away from it, or will they run ads for it? - - The support of business can contribute to the community in many ways; - all else being equal, it is useful. But winning their support by - speaking even less about freedom and principle can be disastrous; it - makes the previous imbalance between outreach and civics education even - worse. - - "Free software" and "open source" describe the same category of - software, more or less, but say different things about the software, - and about values. The GNU Project continues to use the term "free - software", to express the idea that freedom, not just technology, is - important. - - Try! - - Yoda's philosophy ("There is no `try'") sounds neat, but it doesn't - work for me. I have done most of my work while anxious about whether I - could do the job, and unsure that it would be enough to achieve the - goal if I did. But I tried anyway, because there was no one but me - between the enemy and my city. Surprising myself, I have sometimes - succeeded. - - Sometimes I failed; some of my cities have fallen. Then I found another - threatened city, and got ready for another battle. Over time, I've - learned to look for threats and put myself between them and my city, - calling on other hackers to come and join me. - - Nowadays, often I'm not the only one. It is a relief and a joy when I - see a regiment of hackers digging in to hold the line, and I realize, - this city may survive--for now. But the dangers are greater each year, - and now Microsoft has explicitly targeted our community. We can't take - the future of freedom for granted. Don't take it for granted! If you - want to keep your freedom, you must be prepared to defend it. - - Copyright (C) 1998 Richard Stallman - - Verbatim copying and distribution of this entire article is permitted - in any medium, provided this notice is preserved. +The GNU Project + +Note added March 2014: + +This file is obsolete and will be removed in future. +Please update any references to use + + === modified file 'etc/WHY-FREE' --- etc/WHY-FREE 2003-02-04 14:56:31 +0000 +++ etc/WHY-FREE 2014-03-22 23:47:20 +0000 @@ -1,244 +1,8 @@ - Why Software Should Not Have Owners - - by Richard Stallman - -Digital information technology contributes to the world by making it -easier to copy and modify information. Computers promise to make this -easier for all of us. - -Not everyone wants it to be easier. The system of copyright gives -software programs "owners", most of whom aim to withhold software's -potential benefit from the rest of the public. They would like to be -the only ones who can copy and modify the software that we use. - -The copyright system grew up with printing--a technology for mass -production copying. Copyright fit in well with this technology -because it restricted only the mass producers of copies. It did not -take freedom away from readers of books. An ordinary reader, who did -not own a printing press, could copy books only with pen and ink, and -few readers were sued for that. - -Digital technology is more flexible than the printing press: when -information has digital form, you can easily copy it to share it with -others. This very flexibility makes a bad fit with a system like -copyright. That's the reason for the increasingly nasty and draconian -measures now used to enforce software copyright. Consider these four -practices of the Software Publishers Association (SPA): - -* Massive propaganda saying it is wrong to disobey the owners -to help your friend. - -* Solicitation for stool pigeons to inform on their coworkers and -colleagues. - -* Raids (with police help) on offices and schools, in which people are -told they must prove they are innocent of illegal copying. - -* Prosecution (by the US government, at the SPA's request) of people -such as MIT's David LaMacchia, not for copying software (he is not -accused of copying any), but merely for leaving copying facilities -unguarded and failing to censor their use. - -All four practices resemble those used in the former Soviet Union, -where every copying machine had a guard to prevent forbidden copying, -and where individuals had to copy information secretly and pass it -from hand to hand as "samizdat". There is of course a difference: the -motive for information control in the Soviet Union was political; in -the US the motive is profit. But it is the actions that affect us, -not the motive. Any attempt to block the sharing of information, no -matter why, leads to the same methods and the same harshness. - -Owners make several kinds of arguments for giving them the power -to control how we use information: - -* Name calling. - -Owners use smear words such as "piracy" and "theft", as well as expert -terminology such as "intellectual property" and "damage", to suggest a -certain line of thinking to the public--a simplistic analogy between -programs and physical objects. - -Our ideas and intuitions about property for material objects are about -whether it is right to *take an object away* from someone else. They -don't directly apply to *making a copy* of something. But the owners -ask us to apply them anyway. - -* Exaggeration. - -Owners say that they suffer "harm" or "economic loss" when users copy -programs themselves. But the copying has no direct effect on the -owner, and it harms no one. The owner can lose only if the person who -made the copy would otherwise have paid for one from the owner. - -A little thought shows that most such people would not have bought -copies. Yet the owners compute their "losses" as if each and every -one would have bought a copy. That is exaggeration--to put it kindly. - -* The law. - -Owners often describe the current state of the law, and the harsh -penalties they can threaten us with. Implicit in this approach is the -suggestion that today's law reflects an unquestionable view of -morality--yet at the same time, we are urged to regard these penalties -as facts of nature that can't be blamed on anyone. - -This line of persuasion isn't designed to stand up to critical -thinking; it's intended to reinforce a habitual mental pathway. - -It's elemental that laws don't decide right and wrong. Every American -should know that, forty years ago, it was against the law in many -states for a black person to sit in the front of a bus; but only -racists would say sitting there was wrong. - -* Natural rights. - -Authors often claim a special connection with programs they have -written, and go on to assert that, as a result, their desires and -interests concerning the program simply outweigh those of anyone -else--or even those of the whole rest of the world. (Typically -companies, not authors, hold the copyrights on software, but we are -expected to ignore this discrepancy.) - -To those who propose this as an ethical axiom--the author is more -important than you--I can only say that I, a notable software author -myself, call it bunk. - -But people in general are only likely to feel any sympathy with the -natural rights claims for two reasons. - -One reason is an overstretched analogy with material objects. When I -cook spaghetti, I do object if someone else takes it and stops me from -eating it. In this case, that person and I have the same material -interests at stake, and it's a zero-sum game. The smallest -distinction between us is enough to tip the ethical balance. - -But whether you run or change a program I wrote affects you directly -and me only indirectly. Whether you give a copy to your friend -affects you and your friend much more than it affects me. I shouldn't -have the power to tell you not to do these things. No one should. - -The second reason is that people have been told that natural rights -for authors is the accepted and unquestioned tradition of our society. - -As a matter of history, the opposite is true. The idea of natural -rights of authors was proposed and decisively rejected when the US -Constitution was drawn up. That's why the Constitution only *permits* -a system of copyright and does not *require* one; that's why it says -that copyright must be temporary. It also states that the purpose of -copyright is to promote progress--not to reward authors. Copyright -does reward authors somewhat, and publishers more, but that is -intended as a means of modifying their behavior. - -The real established tradition of our society is that copyright cuts -into the natural rights of the public--and that this can only be -justified for the public's sake. - -* Economics. - -The final argument made for having owners of software is that this -leads to production of more software. - -Unlike the others, this argument at least takes a legitimate approach -to the subject. It is based on a valid goal--satisfying the users of -software. And it is empirically clear that people will produce more of -something if they are well paid for doing so. - -But the economic argument has a flaw: it is based on the assumption -that the difference is only a matter of how much money we have to pay. -It assumes that "production of software" is what we want, whether the -software has owners or not. - -People readily accept this assumption because it accords with our -experiences with material objects. Consider a sandwich, for instance. -You might well be able to get an equivalent sandwich either free or -for a price. If so, the amount you pay is the only difference. -Whether or not you have to buy it, the sandwich has the same taste, -the same nutritional value, and in either case you can only eat it -once. Whether you get the sandwich from an owner or not cannot -directly affect anything but the amount of money you have afterwards. - -This is true for any kind of material object--whether or not it has an -owner does not directly affect what it *is*, or what you can do with -it if you acquire it. - -But if a program has an owner, this very much affects what it is, and -what you can do with a copy if you buy one. The difference is not -just a matter of money. The system of owners of software encourages -software owners to produce something--but not what society really -needs. And it causes intangible ethical pollution that affects us -all. - -What does society need? It needs information that is truly available -to its citizens--for example, programs that people can read, fix, -adapt, and improve, not just operate. But what software owners -typically deliver is a black box that we can't study or change. - -Society also needs freedom. When a program has an owner, the users -lose freedom to control part of their own lives. - -And above all society needs to encourage the spirit of voluntary -cooperation in its citizens. When software owners tell us that -helping our neighbors in a natural way is "piracy", they pollute our -society's civic spirit. - -This is why we say that free software is a matter of freedom, not -price. - -The economic argument for owners is erroneous, but the economic issue -is real. Some people write useful software for the pleasure of -writing it or for admiration and love; but if we want more software -than those people write, we need to raise funds. - -For ten years now, free software developers have tried various methods -of finding funds, with some success. There's no need to make anyone -rich; the median US family income, around $35k, proves to be enough -incentive for many jobs that are less satisfying than programming. - -For years, until a fellowship made it unnecessary, I made a living -from custom enhancements of the free software I had written. Each -enhancement was added to the standard released version and thus -eventually became available to the general public. Clients paid me so -that I would work on the enhancements they wanted, rather than on the -features I would otherwise have considered highest priority. - -The Free Software Foundation, a tax-exempt charity for free software -development, raises funds by selling CD-ROMs, tapes and manuals (all -of which users are free to copy and change), as well as from -donations. It now has a staff of five programmers, plus three -employees who handle mail orders. - -Some free software developers make money by selling support services. -Cygnus Support, with around 50 employees, estimates that about 15 per -cent of its staff activity is free software development--a respectable -percentage for a software company. - -Companies including Intel, Motorola, Texas Instruments and Analog -Devices have combined to fund the continued development of the free -GNU compiler for the language C. Meanwhile, the GNU compiler for the -Ada language is being funded by the US Air Force, which believes this -is the most cost-effective way to get a high quality compiler. - -All these examples are small; the free software movement is still -small, and still young. But the example of listener-supported radio -in this country shows it's possible to support a large activity -without forcing each user to pay. - -As a computer user today, you may find yourself using a proprietary -program. If your friend asks to make a copy, it would be wrong to -refuse. Cooperation is more important than copyright. But -underground, closet cooperation does not make for a good society. A -person should aspire to live an upright life openly with pride, and -this means saying "No" to proprietary software. - -You deserve to be able to cooperate openly and freely with other -people who use software. You deserve to be able to learn how the -software works, and to teach your students with it. You deserve to be -able to hire your favorite programmer to fix it when it breaks. - -You deserve free software. - - -Copyright 1994 Richard Stallman -Verbatim copying and redistribution is permitted -without royalty as long as this notice is preserved; -alteration is not permitted. +Why Software Should Not Have Owners + +Note added March 2014: + +This file is obsolete and will be removed in future. +Please update any references to use + + === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2014-03-22 22:36:29 +0000 +++ lisp/ChangeLog 2014-03-22 23:47:20 +0000 @@ -1,5 +1,8 @@ 2014-03-22 Glenn Morris + * startup.el (fancy-startup-text): + * help.el (describe-gnu-project): Visit online info about GNU project. + * help-fns.el (help-fns--interactive-only): New function. (help-fns-describe-function-functions): Add the above function. * simple.el (beginning-of-buffer, end-of-buffer, insert-buffer) === modified file 'lisp/help.el' --- lisp/help.el 2014-03-22 08:13:46 +0000 +++ lisp/help.el 2014-03-22 23:47:20 +0000 @@ -1,7 +1,6 @@ ;;; help.el --- help commands for Emacs -;; Copyright (C) 1985-1986, 1993-1994, 1998-2014 Free Software -;; Foundation, Inc. +;; Copyright (C) 1985-1986, 1993-1994, 1998-2014 Free Software Foundation, Inc. ;; Maintainer: emacs-devel@gnu.org ;; Keywords: help, internal @@ -293,10 +292,11 @@ (interactive) (view-help-file "COPYING")) +;; Maybe this command should just be removed. (defun describe-gnu-project () - "Display info on the GNU project." + "Browse online information on the GNU project." (interactive) - (view-help-file "THE-GNU-PROJECT")) + (browse-url "http://www.gnu.org/gnu/thegnuproject.html")) (define-obsolete-function-alias 'describe-project 'describe-gnu-project "22.2") === modified file 'lisp/startup.el' --- lisp/startup.el 2014-03-18 00:42:37 +0000 +++ lisp/startup.el 2014-03-22 23:47:20 +0000 @@ -1400,8 +1400,9 @@ `("GNU/Linux" ,(lambda (_button) (browse-url "http://www.gnu.org/gnu/linux-and-gnu.html")) "Browse http://www.gnu.org/gnu/linux-and-gnu.html") - `("GNU" ,(lambda (_button) (describe-gnu-project)) - "Display info on the GNU project"))) + `("GNU" ,(lambda (_button) + (browse-url "http://www.gnu.org/gnu/thegnuproject.html")) + "Browse http://www.gnu.org/gnu/thegnuproject.html"))) " operating system.\n\n" :face variable-pitch :link ("Emacs Tutorial" ,(lambda (_button) (help-with-tutorial))) === modified file 'src/ChangeLog' --- src/ChangeLog 2014-03-22 03:04:53 +0000 +++ src/ChangeLog 2014-03-22 23:47:20 +0000 @@ -1,8 +1,11 @@ +2014-03-22 Glenn Morris + + * callproc.c (init_callproc): In etc, look for NEWS rather than GNU. + 2014-03-22 Daniel Colascione * process.c (conv_sockaddr_to_lisp): When extracting the string - names of AF_LOCAL sockets, stop before reading uninitialized - memory. + names of AF_LOCAL sockets, stop before reading uninitialized memory. 2014-03-21 YAMAMOTO Mitsuharu === modified file 'src/callproc.c' --- src/callproc.c 2014-01-30 17:22:30 +0000 +++ src/callproc.c 2014-03-22 23:47:20 +0000 @@ -1617,13 +1617,13 @@ srcdir = Fexpand_file_name (build_string ("../src/"), lispdir); - tem = Fexpand_file_name (build_string ("GNU"), Vdata_directory); + tem = Fexpand_file_name (build_string ("NEWS"), Vdata_directory); tem1 = Ffile_exists_p (tem); if (!NILP (Fequal (srcdir, Vinvocation_directory)) || NILP (tem1)) { Lisp_Object newdir; newdir = Fexpand_file_name (build_string ("../etc/"), lispdir); - tem = Fexpand_file_name (build_string ("GNU"), newdir); + tem = Fexpand_file_name (build_string ("NEWS"), newdir); tem1 = Ffile_exists_p (tem); if (!NILP (tem1)) Vdata_directory = newdir; ------------------------------------------------------------ revno: 116847 committer: Glenn Morris branch nick: trunk timestamp: Sat 2014-03-22 16:08:41 -0700 message: Reduce duplication in lib-src etags/ctags rules * lib-src/Makefile.in (etags_deps, etags_args): New, to reduce duplication. (etags${EXEEXT}, ctags${EXEEXT}): Use etags_deps, etags_args. diff: === modified file 'lib-src/ChangeLog' --- lib-src/ChangeLog 2014-03-22 23:06:29 +0000 +++ lib-src/ChangeLog 2014-03-22 23:08:41 +0000 @@ -1,5 +1,8 @@ 2014-03-22 Glenn Morris + * Makefile.in (etags_deps, etags_args): New, to reduce duplication. + (etags${EXEEXT}, ctags${EXEEXT}): Use etags_deps, etags_args. + * Makefile.in (etags${EXEEXT}, ebrowse${EXEEXT}, ctags${EXEEXT}) (profile${EXEEXT}, make-docfile${EXEEXT}, movemail${EXEEXT}) (emacsclient${EXEEXT}, emacsclientw${EXEEXT}, hexl${EXEEXT}) === modified file 'lib-src/Makefile.in' --- lib-src/Makefile.in 2014-03-22 23:06:29 +0000 +++ lib-src/Makefile.in 2014-03-22 23:08:41 +0000 @@ -309,23 +309,26 @@ regex.o: $(srcdir)/../src/regex.c $(srcdir)/../src/regex.h $(config_h) ${CC} -c ${CPP_CFLAGS} ${srcdir}/../src/regex.c -etags${EXEEXT}: ${srcdir}/etags.c regex.o $(NTLIB) $(config_h) - $(CC) ${ALL_CFLAGS} -DEMACS_NAME="\"GNU Emacs\"" \ - -DVERSION="\"${version}\"" ${srcdir}/etags.c \ - regex.o $(LOADLIBES) $(NTLIB) -o $@ + +etags_deps = ${srcdir}/etags.c regex.o $(NTLIB) $(config_h) +etags_args = -DEMACS_NAME="\"GNU Emacs\"" -DVERSION="\"${version}\"" \ + ${srcdir}/etags.c regex.o $(LOADLIBES) $(NTLIB) -o $@ + +etags${EXEEXT}: ${etags_deps} + $(CC) ${ALL_CFLAGS} ${etags_args} + +## FIXME? +## Can't we use a symlink ctags -> etags, and make etags check for argv[0]? +## Or a wrapper script that calls etags --ctags? +ctags${EXEEXT}: ${etags_deps} + $(CC) ${ALL_CFLAGS} -DCTAGS ${etags_args} + ebrowse${EXEEXT}: ${srcdir}/ebrowse.c ${srcdir}/../lib/min-max.h $(NTLIB) \ $(config_h) $(CC) ${ALL_CFLAGS} -DVERSION="\"${version}\"" \ ${srcdir}/ebrowse.c $(LOADLIBES) $(NTLIB) -o $@ -## We depend on etags to assure that parallel makes do not write two -## etags.o files on top of each other. -ctags${EXEEXT}: etags${EXEEXT} - $(CC) ${ALL_CFLAGS} -DCTAGS -DEMACS_NAME="\"GNU Emacs\"" \ - -DVERSION="\"${version}\"" ${srcdir}/etags.c \ - regex.o $(LOADLIBES) $(NTLIB) -o $@ - profile${EXEEXT}: ${srcdir}/profile.c $(NTLIB) $(config_h) $(CC) ${ALL_CFLAGS} ${srcdir}/profile.c \ $(LOADLIBES) $(NTLIB) $(LIB_CLOCK_GETTIME) -o $@ ------------------------------------------------------------ revno: 116846 committer: Glenn Morris branch nick: trunk timestamp: Sat 2014-03-22 16:06:29 -0700 message: Use $@ more in lib-src/Makefile.in * lib-src/Makefile.in (etags${EXEEXT}, ebrowse${EXEEXT}, ctags${EXEEXT}) (profile${EXEEXT}, make-docfile${EXEEXT}, movemail${EXEEXT}) (emacsclient${EXEEXT}, emacsclientw${EXEEXT}, hexl${EXEEXT}) (update-game-score${EXEEXT}, emacsclient.res): Use $@. diff: === modified file 'lib-src/ChangeLog' --- lib-src/ChangeLog 2014-03-22 23:02:13 +0000 +++ lib-src/ChangeLog 2014-03-22 23:06:29 +0000 @@ -1,5 +1,10 @@ 2014-03-22 Glenn Morris + * Makefile.in (etags${EXEEXT}, ebrowse${EXEEXT}, ctags${EXEEXT}) + (profile${EXEEXT}, make-docfile${EXEEXT}, movemail${EXEEXT}) + (emacsclient${EXEEXT}, emacsclientw${EXEEXT}, hexl${EXEEXT}) + (update-game-score${EXEEXT}, emacsclient.res): Use $@. + * Makefile.in (../lib/libgnu.a): Explicitly pass MFLAGS. * Makefile.in (DONT_INSTALL): Remove test-distrib. === modified file 'lib-src/Makefile.in' --- lib-src/Makefile.in 2014-03-22 23:02:13 +0000 +++ lib-src/Makefile.in 2014-03-22 23:06:29 +0000 @@ -312,31 +312,31 @@ etags${EXEEXT}: ${srcdir}/etags.c regex.o $(NTLIB) $(config_h) $(CC) ${ALL_CFLAGS} -DEMACS_NAME="\"GNU Emacs\"" \ -DVERSION="\"${version}\"" ${srcdir}/etags.c \ - regex.o $(LOADLIBES) $(NTLIB) -o etags${EXEEXT} + regex.o $(LOADLIBES) $(NTLIB) -o $@ ebrowse${EXEEXT}: ${srcdir}/ebrowse.c ${srcdir}/../lib/min-max.h $(NTLIB) \ $(config_h) $(CC) ${ALL_CFLAGS} -DVERSION="\"${version}\"" \ - ${srcdir}/ebrowse.c $(LOADLIBES) $(NTLIB) -o ebrowse${EXEEXT} + ${srcdir}/ebrowse.c $(LOADLIBES) $(NTLIB) -o $@ ## We depend on etags to assure that parallel makes do not write two ## etags.o files on top of each other. ctags${EXEEXT}: etags${EXEEXT} $(CC) ${ALL_CFLAGS} -DCTAGS -DEMACS_NAME="\"GNU Emacs\"" \ -DVERSION="\"${version}\"" ${srcdir}/etags.c \ - regex.o $(LOADLIBES) $(NTLIB) -o ctags${EXEEXT} + regex.o $(LOADLIBES) $(NTLIB) -o $@ profile${EXEEXT}: ${srcdir}/profile.c $(NTLIB) $(config_h) $(CC) ${ALL_CFLAGS} ${srcdir}/profile.c \ - $(LOADLIBES) $(NTLIB) $(LIB_CLOCK_GETTIME) -o profile${EXEEXT} + $(LOADLIBES) $(NTLIB) $(LIB_CLOCK_GETTIME) -o $@ make-docfile${EXEEXT}: ${srcdir}/make-docfile.c $(NTLIB) $(config_h) $(CC) ${ALL_CFLAGS} ${srcdir}/make-docfile.c $(LOADLIBES) $(NTLIB) \ - -o make-docfile${EXEEXT} + -o $@ movemail${EXEEXT}: ${srcdir}/movemail.c pop.o $(NTLIB) $(config_h) $(CC) ${ALL_CFLAGS} ${MOVE_FLAGS} ${srcdir}/movemail.c pop.o \ - $(LOADLIBES) $(NTLIB) $(LIBS_MOVE) -o movemail${EXEEXT} + $(LOADLIBES) $(NTLIB) $(LIBS_MOVE) -o $@ pop.o: ${srcdir}/pop.c ${srcdir}/pop.h ${srcdir}/../lib/min-max.h $(config_h) $(CC) -c ${CPP_CFLAGS} ${MOVE_FLAGS} ${srcdir}/pop.c @@ -344,12 +344,12 @@ emacsclient${EXEEXT}: ${srcdir}/emacsclient.c $(NTLIB) $(config_h) $(CC) ${ALL_CFLAGS} ${srcdir}/emacsclient.c \ -DVERSION="\"${version}\"" $(NTLIB) $(LOADLIBES) $(LIB_FDATASYNC) \ - $(LIB_WSOCK32) $(LIBS_ECLIENT) -o emacsclient${EXEEXT} + $(LIB_WSOCK32) $(LIBS_ECLIENT) -o $@ emacsclientw${EXEEXT}: ${srcdir}/emacsclient.c $(NTLIB) $(CLIENTRES) $(config_h) $(CC) ${ALL_CFLAGS} $(CLIENTRES) -mwindows ${srcdir}/emacsclient.c \ -DVERSION="\"${version}\"" $(LOADLIBES) $(LIB_FDATASYNC) \ - $(LIB_WSOCK32) $(LIBS_ECLIENT) -o emacsclientw${EXEEXT} + $(LIB_WSOCK32) $(LIBS_ECLIENT) -o $@ NTINC = ${srcdir}/../nt/inc NTDEPS = $(NTINC)/ms-w32.h $(NTINC)/sys/stat.h $(NTINC)/inttypes.h \ @@ -362,15 +362,15 @@ $(CC) -c ${CPP_CFLAGS} ${srcdir}/ntlib.c hexl${EXEEXT}: ${srcdir}/hexl.c $(NTLIB) $(config_h) - $(CC) ${ALL_CFLAGS} ${srcdir}/hexl.c $(LOADLIBES) -o hexl${EXEEXT} + $(CC) ${ALL_CFLAGS} ${srcdir}/hexl.c $(LOADLIBES) -o $@ update-game-score${EXEEXT}: ${srcdir}/update-game-score.c $(NTLIB) $(config_h) $(CC) ${ALL_CFLAGS} -DHAVE_SHARED_GAME_DIR="\"$(gamedir)\"" \ ${srcdir}/update-game-score.c $(LOADLIBES) $(NTLIB) \ - -o update-game-score${EXEEXT} + -o $@ emacsclient.res: $(NTINC)/../emacsclient.rc - $(WINDRES) -O coff --include-dir=$(NTINC)/.. -o emacsclient.res \ + $(WINDRES) -O coff --include-dir=$(NTINC)/.. -o $@ \ $(NTINC)/../emacsclient.rc ## Makefile ends here. ------------------------------------------------------------ revno: 116845 committer: Glenn Morris branch nick: trunk timestamp: Sat 2014-03-22 16:02:13 -0700 message: * lib-src/Makefile.in (../lib/libgnu.a): Explicitly pass MFLAGS. diff: === modified file 'lib-src/ChangeLog' --- lib-src/ChangeLog 2014-03-22 22:52:47 +0000 +++ lib-src/ChangeLog 2014-03-22 23:02:13 +0000 @@ -1,5 +1,7 @@ 2014-03-22 Glenn Morris + * Makefile.in (../lib/libgnu.a): Explicitly pass MFLAGS. + * Makefile.in (DONT_INSTALL): Remove test-distrib. (test-distrib${EXEEXT}): Remove rule. === modified file 'lib-src/Makefile.in' --- lib-src/Makefile.in 2014-03-22 22:52:47 +0000 +++ lib-src/Makefile.in 2014-03-22 23:02:13 +0000 @@ -304,7 +304,7 @@ etags *.[ch] ../lib/libgnu.a: $(config_h) - cd ../lib && $(MAKE) libgnu.a + cd ../lib && $(MAKE) $(MFLAGS) libgnu.a regex.o: $(srcdir)/../src/regex.c $(srcdir)/../src/regex.h $(config_h) ${CC} -c ${CPP_CFLAGS} ${srcdir}/../src/regex.c ------------------------------------------------------------ revno: 116844 committer: Glenn Morris branch nick: trunk timestamp: Sat 2014-03-22 15:52:47 -0700 message: Remove lib-src/test-distrib.c and related The class of problems that this was designed to detect, namely .elc files getting corrupted by being passed around by email via uuencode or somesuch, has not been a relevant concern for many years. * lib-src/test-distrib.c, lib-src/testfile: Remove. * lib-src/Makefile.in (DONT_INSTALL): Remove test-distrib. (test-distrib${EXEEXT}): Remove rule. * make-dist: Do not distribute lib-src/testfile. * admin/quick-install-emacs (AVOID): Remove testfile and test-distrib. * INSTALL, etc/PROBLEMS, admin/notes/unicode: Remove references to test-distrib and testfile. diff: === modified file 'ChangeLog' --- ChangeLog 2014-03-21 10:12:53 +0000 +++ ChangeLog 2014-03-22 22:52:47 +0000 @@ -1,3 +1,7 @@ +2014-03-22 Glenn Morris + + * make-dist: Do not distribute lib-src/testfile. + 2014-03-21 Eli Zaretskii * configure.ac: Bump version to 24.4.50. === modified file 'INSTALL' --- INSTALL 2014-01-23 02:09:31 +0000 +++ INSTALL 2014-03-22 22:52:47 +0000 @@ -726,8 +726,8 @@ are used by Emacs; they do need to be copied. - The programs `etags', `ctags', and `emacsclient' are intended to be run by users; they are handled below. -- The programs `make-docfile' and `test-distrib' were - used in building Emacs, and are not needed any more. +- The program `make-docfile' was used in building Emacs, and is + not needed any more. 2) Copy the files in `./info' to the place specified in `./lisp/site-init.el' or `./lisp/info.el'. Note that if the === modified file 'admin/ChangeLog' --- admin/ChangeLog 2014-03-21 06:39:13 +0000 +++ admin/ChangeLog 2014-03-22 22:52:47 +0000 @@ -1,3 +1,7 @@ +2014-03-22 Glenn Morris + + * quick-install-emacs (AVOID): Remove testfile and test-distrib. + 2014-03-21 Glenn Morris * update_autogen: Auto-detect VCS in use. === modified file 'admin/notes/unicode' --- admin/notes/unicode 2014-01-01 07:43:34 +0000 +++ admin/notes/unicode 2014-03-22 22:52:47 +0000 @@ -181,13 +181,6 @@ admin/charsets/mapfiles/cns2ucsdkw.txt - * no-conversion - - This file purposely contains arbitrary bytes interspersed within text, - to test whether the Emacs distribution is corrupted. - - lib-src/testfile - * iso-2022-7bit This file switches between CJK charsets, which is not encoded in UTF-8. === modified file 'admin/quick-install-emacs' --- admin/quick-install-emacs 2014-01-01 07:43:34 +0000 +++ admin/quick-install-emacs 2014-03-22 22:52:47 +0000 @@ -30,7 +30,7 @@ PUBLIC_LIBSRC_BINARIES='emacsclient etags ctags ebrowse' PUBLIC_LIBSRC_SCRIPTS='grep-changelog' -AVOID="CVS -DIC README COPYING ChangeLog ~ [.]orig$ [.]rej$ Makefile$ Makefile.in$ makefile$ makefile.w32-in$ stamp-subdir [.]cvsignore [.]arch-ids [{]arch[}] [.][cho]$ make-docfile testfile test-distrib" +AVOID="CVS -DIC README COPYING ChangeLog ~ [.]orig$ [.]rej$ Makefile$ Makefile.in$ makefile$ makefile.w32-in$ stamp-subdir [.]cvsignore [.]arch-ids [{]arch[}] [.][cho]$ make-docfile" # Prune old binaries lying around in the source tree PRUNE=no === modified file 'etc/PROBLEMS' --- etc/PROBLEMS 2014-02-21 16:47:04 +0000 +++ etc/PROBLEMS 2014-03-22 22:52:47 +0000 @@ -2504,22 +2504,6 @@ (The -R option disables address space randomization.) -*** test-distrib says that the distribution has been clobbered. -*** or, temacs prints "Command key out of range 0-127". -*** or, temacs runs and dumps emacs, but emacs totally fails to work. -*** or, temacs gets errors dumping emacs. - -This can be because the .elc files have been garbled. Do not be -fooled by the fact that most of a .elc file is text: these are -binary files and can contain all 256 byte values. - -If you have a copy of Emacs whose .elc files have been damaged in this -way, you should be able to fix it by using: - - make bootstrap - -to regenerate all the .elc files. - *** temacs prints "Pure Lisp storage exhausted". This means that the Lisp code loaded from the .elc and .el files === modified file 'lib-src/ChangeLog' --- lib-src/ChangeLog 2014-03-10 00:09:30 +0000 +++ lib-src/ChangeLog 2014-03-22 22:52:47 +0000 @@ -1,3 +1,10 @@ +2014-03-22 Glenn Morris + + * Makefile.in (DONT_INSTALL): Remove test-distrib. + (test-distrib${EXEEXT}): Remove rule. + + * test-distrib.c, testfile: Remove. + 2014-03-10 Juanma Barranquero * emacsclient.c (main): #ifdef out previous change on Windows. === modified file 'lib-src/Makefile.in' --- lib-src/Makefile.in 2014-01-05 02:56:08 +0000 +++ lib-src/Makefile.in 2014-03-22 22:52:47 +0000 @@ -128,7 +128,7 @@ UTILITIES = profile${EXEEXT} movemail${EXEEXT} hexl${EXEEXT} \ update-game-score${EXEEXT} -DONT_INSTALL= test-distrib${EXEEXT} make-docfile${EXEEXT} +DONT_INSTALL= make-docfile${EXEEXT} # Like UTILITIES, but they're not system-dependent, and should not be # deleted by the distclean target. @@ -303,14 +303,6 @@ TAGS: etags${EXEEXT} etags *.[ch] -## This verifies that the non-ASCII characters in the file \`testfile\' -## have not been clobbered by whatever means were used to copy and -## distribute Emacs. If they were clobbered, all the .elc files were -## clobbered too. -test-distrib${EXEEXT}: ${srcdir}/test-distrib.c - $(CC) ${ALL_CFLAGS} -o test-distrib${EXEEXT} ${srcdir}/test-distrib.c - ./test-distrib ${srcdir}/testfile - ../lib/libgnu.a: $(config_h) cd ../lib && $(MAKE) libgnu.a === removed file 'lib-src/test-distrib.c' --- lib-src/test-distrib.c 2014-01-01 07:43:34 +0000 +++ lib-src/test-distrib.c 1970-01-01 00:00:00 +0000 @@ -1,88 +0,0 @@ -/* test-distrib.c --- testing distribution of nonprinting chars - -Copyright (C) 1987, 1993-1995, 1999, 2001-2014 Free Software Foundation, -Inc. - -This file is part of GNU Emacs. - -GNU Emacs is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 3 of the License, or -(at your option) any later version. - -GNU Emacs is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GNU Emacs. If not, see . */ - - -#include -#include -#include -#include - -/* Break string in two parts to avoid buggy C compilers that ignore characters - after nulls in strings. */ - -static char string1[] = "Testing distribution of nonprinting chars:\n\ -Should be 0177: \177 Should be 0377: \377 Should be 0212: \212.\n\ -Should be 0000: "; - -static char string2[] = ".\n\ -This file is read by the `test-distribution' program.\n\ -If you change it, you will make that program fail.\n"; - -/* Like `read' but keeps trying until it gets SIZE bytes or reaches eof. */ -static int -cool_read (int fd, char *buf, size_t size) -{ - ssize_t num; - ssize_t sofar = 0; - - while (1) - { - if ((num = read (fd, buf + sofar, size - sofar)) == 0) - return sofar; - else if (num < 0) - return num; - sofar += num; - } -} - -int -main (int argc, char **argv) -{ - int fd; - char buf[300]; - - if (argc != 2) - { - fprintf (stderr, "Usage: %s testfile\n", argv[0]); - exit (EXIT_FAILURE); - } - fd = open (argv[1], O_RDONLY); - if (fd < 0) - { - perror (argv[1]); - exit (EXIT_FAILURE); - } - if (cool_read (fd, buf, sizeof string1) != sizeof string1 || - strcmp (buf, string1) || - cool_read (fd, buf, sizeof string2) != sizeof string2 - 1 || - strncmp (buf, string2, sizeof string2 - 1)) - { - fprintf (stderr, "Data in file `%s' has been damaged.\n\ -Most likely this means that many nonprinting characters\n\ -have been corrupted in the files of Emacs, and it will not work.\n", - argv[1]); - exit (EXIT_FAILURE); - } - close (fd); - return EXIT_SUCCESS; -} - - -/* test-distrib.c ends here */ === removed file 'lib-src/testfile' Binary files lib-src/testfile 1999-10-01 12:43:57 +0000 and lib-src/testfile 1970-01-01 00:00:00 +0000 differ === modified file 'make-dist' --- make-dist 2014-01-01 07:43:34 +0000 +++ make-dist 2014-03-22 22:52:47 +0000 @@ -383,7 +383,7 @@ echo "Making links to \`lib-src'" (cd lib-src ln [a-zA-Z]*.[ch] ../${tempdir}/lib-src - ln ChangeLog Makefile.in README testfile ../${tempdir}/lib-src + ln ChangeLog Makefile.in README ../${tempdir}/lib-src ln grep-changelog rcs2log ../${tempdir}/lib-src ln makefile.w32-in ../${tempdir}/lib-src) ------------------------------------------------------------ revno: 116843 committer: Glenn Morris branch nick: trunk timestamp: Sat 2014-03-22 15:36:29 -0700 message: Include interactive-only information in describe-function output * lisp/help-fns.el (help-fns--interactive-only): New function. (help-fns-describe-function-functions): Add the above function. * lisp/simple.el (beginning-of-buffer, end-of-buffer, insert-buffer) (next-line, previous-line): Remove hand-written interactive-only information from doc strings, it is auto-generated now. * lisp/bookmark.el (bookmark-write): * lisp/epa-mail.el (epa-mail-decrypt, epa-mail-verify, epa-mail-sign) (epa-mail-import-keys): Mark interactive-only, and remove hand-written interactive-only information from doc strings. * lisp/epa.el (epa-decrypt-armor-in-region, epa-verify-region) (epa-verify-cleartext-in-region, epa-sign-region, epa-encrypt-region): * lisp/files.el (not-modified): * lisp/simple.el (mark-whole-buffer): Mark interactive-only. * doc/lispref/commands.texi (Defining Commands): Mention that interactive-only also affects describe-function. * etc/NEWS: Mention this. diff: === modified file 'doc/lispref/ChangeLog' --- doc/lispref/ChangeLog 2014-03-22 22:12:52 +0000 +++ doc/lispref/ChangeLog 2014-03-22 22:36:29 +0000 @@ -1,5 +1,8 @@ 2014-03-22 Glenn Morris + * commands.texi (Defining Commands): + Mention that interactive-only also affects describe-function. + * functions.texi (Declare Form): Add interactive-only. * commands.texi (Defining Commands) Mention declare. === modified file 'doc/lispref/commands.texi' --- doc/lispref/commands.texi 2014-03-22 22:12:52 +0000 +++ doc/lispref/commands.texi 2014-03-22 22:36:29 +0000 @@ -128,12 +128,13 @@ never directly from Lisp. In that case, give the function a non-@code{nil} @code{interactive-only} property, either directly or via @code{declare} (@pxref{Declare Form}). This causes the -byte compiler to warn if the command is called from Lisp. 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 other symbol, which should be an alternative function to use in -Lisp code. +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 +other symbol, which should be an alternative function to use in Lisp +code. @menu * Using Interactive:: General rules for @code{interactive}. === modified file 'etc/NEWS' --- etc/NEWS 2014-03-22 22:12:52 +0000 +++ etc/NEWS 2014-03-22 22:36:29 +0000 @@ -54,6 +54,7 @@ +++ ** You can specify a function's interactive-only property via `declare'. +However you specify it, the property affects `describe-function' output. * Changes in Emacs 24.5 on Non-Free Operating Systems === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2014-03-22 22:12:52 +0000 +++ lisp/ChangeLog 2014-03-22 22:36:29 +0000 @@ -1,5 +1,19 @@ 2014-03-22 Glenn Morris + * help-fns.el (help-fns--interactive-only): New function. + (help-fns-describe-function-functions): Add the above function. + * simple.el (beginning-of-buffer, end-of-buffer, insert-buffer) + (next-line, previous-line): Remove hand-written interactive-only + information from doc strings, it is auto-generated now. + * bookmark.el (bookmark-write): + * epa-mail.el (epa-mail-decrypt, epa-mail-verify, epa-mail-sign) + (epa-mail-import-keys): Mark interactive-only, + and remove hand-written interactive-only information from doc strings. + * epa.el (epa-decrypt-armor-in-region, epa-verify-region) + (epa-verify-cleartext-in-region, epa-sign-region, epa-encrypt-region): + * files.el (not-modified): + * simple.el (mark-whole-buffer): Mark interactive-only. + * emacs-lisp/byte-run.el (defun-declarations-alist): Add interactive-only. Doc tweak. (macro-declarations-alist): Doc tweak. === modified file 'lisp/bookmark.el' --- lisp/bookmark.el 2014-01-01 07:43:34 +0000 +++ lisp/bookmark.el 2014-03-22 22:36:29 +0000 @@ -1298,8 +1298,8 @@ ;;;###autoload (defun bookmark-write () - "Write bookmarks to a file (reading the file name with the minibuffer). -Don't use this in Lisp programs; use `bookmark-save' instead." + "Write bookmarks to a file (reading the file name with the minibuffer)." + (declare (interactive-only bookmark-save)) (interactive) (bookmark-maybe-load-default-file) (bookmark-save t)) === modified file 'lisp/epa-mail.el' --- lisp/epa-mail.el 2014-01-01 07:43:34 +0000 +++ lisp/epa-mail.el 2014-03-22 22:36:29 +0000 @@ -70,27 +70,24 @@ ;;;###autoload (defun epa-mail-decrypt () "Decrypt OpenPGP armors in the current buffer. -The buffer is expected to contain a mail message. - -Don't use this command in Lisp programs!" +The buffer is expected to contain a mail message." + (declare (interactive-only t)) (interactive) (epa-decrypt-armor-in-region (point-min) (point-max))) ;;;###autoload (defun epa-mail-verify () "Verify OpenPGP cleartext signed messages in the current buffer. -The buffer is expected to contain a mail message. - -Don't use this command in Lisp programs!" +The buffer is expected to contain a mail message." + (declare (interactive-only t)) (interactive) (epa-verify-cleartext-in-region (point-min) (point-max))) ;;;###autoload (defun epa-mail-sign (start end signers mode) "Sign the current buffer. -The buffer is expected to contain a mail message. - -Don't use this command in Lisp programs!" +The buffer is expected to contain a mail message." + (declare (interactive-only t)) (interactive (save-excursion (goto-char (point-min)) @@ -234,9 +231,8 @@ ;;;###autoload (defun epa-mail-import-keys () "Import keys in the OpenPGP armor format in the current buffer. -The buffer is expected to contain a mail message. - -Don't use this command in Lisp programs!" +The buffer is expected to contain a mail message." + (declare (interactive-only t)) (interactive) (epa-import-armor-in-region (point-min) (point-max))) === modified file 'lisp/epa.el' --- lisp/epa.el 2014-02-06 04:05:43 +0000 +++ lisp/epa.el 2014-03-22 22:36:29 +0000 @@ -834,6 +834,7 @@ Don't use this command in Lisp programs! See the reason described in the `epa-decrypt-region' documentation." + (declare (interactive-only t)) (interactive "r") (save-excursion (save-restriction @@ -873,6 +874,7 @@ (decode-coding-string (epg-verify-string context (buffer-substring start end)) 'utf-8))" + (declare (interactive-only t)) (interactive "r") (let ((context (epg-make-context epa-protocol)) plain) @@ -914,6 +916,7 @@ Don't use this command in Lisp programs! See the reason described in the `epa-verify-region' documentation." + (declare (interactive-only t)) (interactive "r") (save-excursion (save-restriction @@ -956,6 +959,7 @@ (epg-sign-string context (encode-coding-string (buffer-substring start end) 'utf-8)))" + (declare (interactive-only t)) (interactive (let ((verbose current-prefix-arg)) (setq epa-last-coding-system-specified @@ -1037,6 +1041,7 @@ context (encode-coding-string (buffer-substring start end) 'utf-8) nil))" + (declare (interactive-only t)) (interactive (let ((verbose current-prefix-arg) (context (epg-make-context epa-protocol)) @@ -1205,6 +1210,7 @@ ;; If a prefix-arg is specified, the signature is marked as non exportable. ;; Don't use this command in Lisp programs!" +;; (declare (interactive-only t)) ;; (interactive ;; (let ((keys (epa--marked-keys))) ;; (unless keys === modified file 'lisp/files.el' --- lisp/files.el 2014-03-22 22:12:52 +0000 +++ lisp/files.el 2014-03-22 22:36:29 +0000 @@ -4999,6 +4999,7 @@ It is not a good idea to use this function in Lisp programs, because it prints a message in the minibuffer. Instead, use `set-buffer-modified-p'." + (declare (interactive-only set-buffer-modified-p)) (interactive "P") (message (if arg "Modification-flag set" "Modification-flag cleared")) === modified file 'lisp/help-fns.el' --- lisp/help-fns.el 2014-03-14 00:32:41 +0000 +++ lisp/help-fns.el 2014-03-22 22:36:29 +0000 @@ -1,7 +1,7 @@ ;;; help-fns.el --- Complex help functions -*- lexical-binding: t -*- -;; Copyright (C) 1985-1986, 1993-1994, 1998-2014 Free Software -;; Foundation, Inc. +;; Copyright (C) 1985-1986, 1993-1994, 1998-2014 +;; Free Software Foundation, Inc. ;; Maintainer: emacs-devel@gnu.org ;; Keywords: help, internal @@ -430,6 +430,28 @@ (setq load-hist (cdr load-hist))) found)) +(defun help-fns--interactive-only (function) + "Insert some help blurb if FUNCTION should only be used interactively." + ;; Ignore lambda constructs, keyboard macros, etc. + (and (symbolp function) + (not (eq (car-safe (symbol-function function)) 'macro)) + (let* ((interactive-only + (or (get function 'interactive-only) + (if (boundp 'byte-compile-interactive-only-functions) + (memq function + byte-compile-interactive-only-functions))))) + (when interactive-only + (insert "\nThis function is for interactive use only" + ;; Cf byte-compile-form. + (cond ((stringp interactive-only) + (format ";\nin Lisp code %s" interactive-only)) + ((and (symbolp 'interactive-only) + (not (eq interactive-only t))) + (format ";\nin Lisp code use `%s' instead." + interactive-only)) + (t ".")) + "\n"))))) + ;;;###autoload (defun describe-function-1 (function) (let* ((advised (and (symbolp function) @@ -554,6 +576,7 @@ ;; Add defaults to `help-fns-describe-function-functions'. (add-hook 'help-fns-describe-function-functions #'help-fns--obsolete) +(add-hook 'help-fns-describe-function-functions #'help-fns--interactive-only) (add-hook 'help-fns-describe-function-functions #'help-fns--parent-mode) (add-hook 'help-fns-describe-function-functions #'help-fns--compiler-macro) === modified file 'lisp/simple.el' --- lisp/simple.el 2014-03-22 22:12:52 +0000 +++ lisp/simple.el 2014-03-22 22:36:29 +0000 @@ -870,10 +870,7 @@ accessible part of the buffer. If Transient Mark mode is disabled, leave mark at previous -position, unless a \\[universal-argument] prefix is supplied. - -Don't use this command in Lisp programs! -\(goto-char (point-min)) is faster." +position, unless a \\[universal-argument] prefix is supplied." (declare (interactive-only "use `(goto-char (point-min))' instead.")) (interactive "^P") (or (consp arg) @@ -897,10 +894,7 @@ accessible part of the buffer. If Transient Mark mode is disabled, leave mark at previous -position, unless a \\[universal-argument] prefix is supplied. - -Don't use this command in Lisp programs! -\(goto-char (point-max)) is faster." +position, unless a \\[universal-argument] prefix is supplied." (declare (interactive-only "use `(goto-char (point-max))' instead.")) (interactive "^P") (or (consp arg) (region-active-p) (push-mark)) @@ -1016,6 +1010,7 @@ You probably should not use this function in Lisp programs; it is usually a mistake for a Lisp function to use any subroutine that uses or sets the mark." + (declare (interactive-only t)) (interactive) (push-mark (point)) (push-mark (point-max) nil t) @@ -4240,10 +4235,7 @@ (defun insert-buffer (buffer) "Insert after point the contents of BUFFER. Puts mark after the inserted text. -BUFFER may be a buffer or a buffer name. - -This function is meant for the user to run interactively. -Don't call it from programs: use `insert-buffer-substring' instead!" +BUFFER may be a buffer or a buffer name." (declare (interactive-only insert-buffer-substring)) (interactive (list @@ -4841,11 +4833,7 @@ The goal column is stored in the variable `goal-column', which is nil when there is no goal column. Note that setting `goal-column' overrides `line-move-visual' and causes this command to move by buffer -lines rather than by display lines. - -If you are thinking of using this in a Lisp program, consider -using `forward-line' instead. It is usually easier to use -and more reliable (no dependence on goal column, etc.)." +lines rather than by display lines." (declare (interactive-only forward-line)) (interactive "^p\np") (or arg (setq arg 1)) @@ -4888,11 +4876,7 @@ The goal column is stored in the variable `goal-column', which is nil when there is no goal column. Note that setting `goal-column' overrides `line-move-visual' and causes this command to move by buffer -lines rather than by display lines. - -If you are thinking of using this in a Lisp program, consider using -`forward-line' with a negative argument instead. It is usually easier -to use and more reliable (no dependence on goal column, etc.)." +lines rather than by display lines." (declare (interactive-only "use `forward-line' with negative argument instead.")) (interactive "^p\np") ------------------------------------------------------------ revno: 116842 committer: Glenn Morris branch nick: trunk timestamp: Sat 2014-03-22 15:12:52 -0700 message: Allow `declare' to set the interactive-only property * lisp/emacs-lisp/byte-run.el (defun-declarations-alist): Add interactive-only. Doc tweak. (macro-declarations-alist): Doc tweak. * lisp/subr.el (declare): Doc tweak (add xref to manual). * lisp/comint.el (comint-run): * lisp/files.el (insert-file-literally, insert-file): * lisp/replace.el (replace-string, replace-regexp): * lisp/simple.el (beginning-of-buffer, end-of-buffer, delete-backward-char) (delete-forward-char, goto-line, insert-buffer, next-line) (previous-line): Set interactive-only via declare. * doc/lispref/functions.texi (Declare Form): Add interactive-only. * doc/lispref/commands.texi (Defining Commands) Mention declare. * etc/NEWS: Mention this. diff: === modified file 'doc/lispref/ChangeLog' --- doc/lispref/ChangeLog 2014-03-22 21:44:04 +0000 +++ doc/lispref/ChangeLog 2014-03-22 22:12:52 +0000 @@ -1,5 +1,8 @@ 2014-03-22 Glenn Morris + * functions.texi (Declare Form): Add interactive-only. + * commands.texi (Defining Commands) Mention declare. + * commands.texi (Defining Commands): List interactive-only values. 2014-03-22 Eli Zaretskii === modified file 'doc/lispref/commands.texi' --- doc/lispref/commands.texi 2014-03-22 21:41:31 +0000 +++ doc/lispref/commands.texi 2014-03-22 22:12:52 +0000 @@ -122,10 +122,12 @@ value for this property takes precedence over any @code{interactive} form in the function body itself. This feature is seldom used. +@anchor{The interactive-only property} @cindex @code{interactive-only} property Sometimes, a function is only intended to be called interactively, never directly from Lisp. In that case, give the function a -non-@code{nil} @code{interactive-only} property. This causes the +non-@code{nil} @code{interactive-only} property, either directly +or via @code{declare} (@pxref{Declare Form}). This causes the byte compiler to warn if the command is called from Lisp. 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, === modified file 'doc/lispref/functions.texi' --- doc/lispref/functions.texi 2014-03-22 21:44:04 +0000 +++ doc/lispref/functions.texi 2014-03-22 22:12:52 +0000 @@ -1742,6 +1742,10 @@ This is typically used for macros, though it works for functions too. @xref{Indenting Macros}. +@item (interactive-only @var{value}) +Set the function's @code{interactive-only} property to @var{value}. +@xref{The interactive-only property}. + @item (obsolete @var{current-name} @var{when}) Mark the function or macro as obsolete, similar to a call to @code{make-obsolete} (@pxref{Obsolete Functions}). @var{current-name} === modified file 'etc/NEWS' --- etc/NEWS 2014-03-21 23:10:32 +0000 +++ etc/NEWS 2014-03-22 22:12:52 +0000 @@ -42,6 +42,7 @@ --- ** The Rmail commands d, C-d and u now handle repeat counts to delete or undelete multiple messages. + * New Modes and Packages in Emacs 24.5 @@ -51,6 +52,9 @@ * Lisp Changes in Emacs 24.5 ++++ +** You can specify a function's interactive-only property via `declare'. + * Changes in Emacs 24.5 on Non-Free Operating Systems === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2014-03-22 21:44:04 +0000 +++ lisp/ChangeLog 2014-03-22 22:12:52 +0000 @@ -1,3 +1,16 @@ +2014-03-22 Glenn Morris + + * emacs-lisp/byte-run.el (defun-declarations-alist): + Add interactive-only. Doc tweak. + (macro-declarations-alist): Doc tweak. + * subr.el (declare): Doc tweak (add xref to manual). + * comint.el (comint-run): + * files.el (insert-file-literally, insert-file): + * replace.el (replace-string, replace-regexp): + * simple.el (beginning-of-buffer, end-of-buffer, delete-backward-char) + (delete-forward-char, goto-line, insert-buffer, next-line) + (previous-line): Set interactive-only via declare. + 2014-03-22 Dmitry Gutov * emacs-lisp/package.el (package-desc): Use the contents of the === modified file 'lisp/comint.el' --- lisp/comint.el 2014-03-01 02:31:05 +0000 +++ lisp/comint.el 2014-03-22 22:12:52 +0000 @@ -746,11 +746,11 @@ The file name is used to make a symbol name, such as `comint-sh-hook', and any hooks on this symbol are run in the buffer. See `make-comint' and `comint-exec'." + (declare (interactive-only make-comint)) (interactive "sRun program: ") (let ((name (file-name-nondirectory program))) (switch-to-buffer (make-comint name program)) (run-hooks (intern-soft (concat "comint-" name "-hook"))))) -(put 'comint-run 'interactive-only 'make-comint) (defun comint-exec (buffer name command startfile switches) "Start up a process named NAME in buffer BUFFER for Comint modes. === modified file 'lisp/emacs-lisp/byte-run.el' --- lisp/emacs-lisp/byte-run.el 2014-02-10 01:34:22 +0000 +++ lisp/emacs-lisp/byte-run.el 2014-03-22 22:12:52 +0000 @@ -69,6 +69,7 @@ ;; handle declarations in macro definitions and this is the first file ;; loaded by loadup.el that uses declarations in macros. +;; Add any new entries to info node `(elisp)Declare Form'. (defvar defun-declarations-alist (list ;; We can only use backquotes inside the lambdas and not for those @@ -81,6 +82,10 @@ #'(lambda (f _args new-name when) (list 'make-obsolete (list 'quote f) (list 'quote new-name) (list 'quote when)))) + (list 'interactive-only + #'(lambda (f _args instead) + (list 'put (list 'quote f) ''interactive-only + (list 'quote instead)))) (list 'compiler-macro #'(lambda (f args compiler-function) `(eval-and-compile @@ -101,7 +106,9 @@ a function. For each (PROP . VALUES) in a function's declaration, the FUN corresponding to PROP is called with the function name, the function's arglist, and the VALUES and should return the code to use -to set this property.") +to set this property. + +This is used by `declare'.") (defvar macro-declarations-alist (cons @@ -115,7 +122,9 @@ 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 to PROP is called with the macro name, the macro's arglist, and the VALUES -and should return the code to use to set this property.") +and should return the code to use to set this property. + +This is used by `declare'.") (put 'defmacro 'doc-string-elt 3) (put 'defmacro 'lisp-indent-function 2) === modified file 'lisp/files.el' --- lisp/files.el 2014-03-16 09:26:58 +0000 +++ lisp/files.el 2014-03-22 22:12:52 +0000 @@ -2089,9 +2089,9 @@ This function is meant for the user to run interactively. Don't call it from programs! Use `insert-file-contents-literally' instead. \(Its calling sequence is different; see its documentation)." + (declare (interactive-only insert-file-contents-literally)) (interactive "*fInsert file literally: ") (insert-file-1 filename #'insert-file-contents-literally)) -(put 'insert-file-literally 'interactive-only 'insert-file-contents-literally) (defvar find-file-literally nil "Non-nil if this buffer was made by `find-file-literally' or equivalent. @@ -5018,9 +5018,9 @@ This function is meant for the user to run interactively. Don't call it from programs! Use `insert-file-contents' instead. \(Its calling sequence is different; see its documentation)." + (declare (interactive-only insert-file-contents)) (interactive "*fInsert file: ") (insert-file-1 filename #'insert-file-contents)) -(put 'insert-file 'interactive-only 'insert-file-contents) (defun append-to-file (start end filename) "Append the contents of the region to the end of file FILENAME. === modified file 'lisp/replace.el' --- lisp/replace.el 2014-02-14 19:08:53 +0000 +++ lisp/replace.el 2014-03-22 22:12:52 +0000 @@ -523,6 +523,8 @@ which will run faster and will not set the mark or print anything. \(You may need a more complex loop if FROM-STRING can match the null string and TO-STRING is also null.)" + (declare (interactive-only + "use `search-forward' and `replace-match' instead.")) (interactive (let ((common (query-replace-read-args @@ -540,8 +542,6 @@ (region-end)) (nth 3 common)))) (perform-replace from-string to-string nil nil delimited nil nil start end backward)) -(put 'replace-string 'interactive-only - "use `search-forward' and `replace-match' instead.") (defun replace-regexp (regexp to-string &optional delimited start end backward) "Replace things after point matching REGEXP with TO-STRING. @@ -597,6 +597,8 @@ (while (re-search-forward REGEXP nil t) (replace-match TO-STRING nil nil)) which will run faster and will not set the mark or print anything." + (declare (interactive-only + "use `re-search-forward' and `replace-match' instead.")) (interactive (let ((common (query-replace-read-args @@ -614,8 +616,6 @@ (region-end)) (nth 3 common)))) (perform-replace regexp to-string nil t delimited nil nil start end backward)) -(put 'replace-regexp 'interactive-only - "use `re-search-forward' and `replace-match' instead.") (defvar regexp-history nil === modified file 'lisp/simple.el' --- lisp/simple.el 2014-03-19 19:12:50 +0000 +++ lisp/simple.el 2014-03-22 22:12:52 +0000 @@ -874,6 +874,7 @@ Don't use this command in Lisp programs! \(goto-char (point-min)) is faster." + (declare (interactive-only "use `(goto-char (point-min))' instead.")) (interactive "^P") (or (consp arg) (region-active-p) @@ -888,8 +889,6 @@ (/ (+ 10 (* size (prefix-numeric-value arg))) 10))) (point-min)))) (if (and arg (not (consp arg))) (forward-line 1))) -(put 'beginning-of-buffer 'interactive-only - "use `(goto-char (point-min))' instead.") (defun end-of-buffer (&optional arg) "Move point to the end of the buffer. @@ -902,6 +901,7 @@ Don't use this command in Lisp programs! \(goto-char (point-max)) is faster." + (declare (interactive-only "use `(goto-char (point-max))' instead.")) (interactive "^P") (or (consp arg) (region-active-p) (push-mark)) (let ((size (- (point-max) (point-min)))) @@ -922,7 +922,6 @@ ;; then scroll specially to put it near, but not at, the bottom. (overlay-recenter (point)) (recenter -3)))) -(put 'end-of-buffer 'interactive-only "use `(goto-char (point-max))' instead.") (defcustom delete-active-region t "Whether single-char deletion commands delete an active region. @@ -963,6 +962,7 @@ In Overwrite mode, single character backward deletion may replace tabs with spaces so as to back over columns, unless point is at the end of the line." + (declare (interactive-only delete-char)) (interactive "p\nP") (unless (integerp n) (signal 'wrong-type-argument (list 'integerp n))) @@ -985,7 +985,6 @@ (insert-char ?\s (- ocol (current-column)) nil)))) ;; Otherwise, do simple deletion. (t (delete-char (- n) killflag)))) -(put 'delete-backward-char 'interactive-only 'delete-char) (defun delete-forward-char (n &optional killflag) "Delete the following N characters (previous if N is negative). @@ -996,6 +995,7 @@ Optional second arg KILLFLAG non-nil means to kill (save in kill ring) instead of delete. Interactively, N is the prefix arg, and KILLFLAG is set if N was explicitly specified." + (declare (interactive-only delete-char)) (interactive "p\nP") (unless (integerp n) (signal 'wrong-type-argument (list 'integerp n))) @@ -1009,7 +1009,6 @@ ;; Otherwise, do simple deletion. (t (delete-char n killflag)))) -(put 'delete-forward-char 'interactive-only 'delete-char) (defun mark-whole-buffer () "Put point at beginning and mark at end of buffer. @@ -1045,6 +1044,7 @@ (forward-line (1- N)) If at all possible, an even better solution is to use char counts rather than line counts." + (declare (interactive-only forward-line)) (interactive (if (and current-prefix-arg (not (consp current-prefix-arg))) (list (prefix-numeric-value current-prefix-arg)) @@ -1084,7 +1084,6 @@ (if (eq selective-display t) (re-search-forward "[\n\C-m]" nil 'end (1- line)) (forward-line (1- line))))) -(put 'goto-line 'interactive-only 'forward-line) (defun count-words-region (start end &optional arg) "Count the number of words in the region. @@ -4245,6 +4244,7 @@ This function is meant for the user to run interactively. Don't call it from programs: use `insert-buffer-substring' instead!" + (declare (interactive-only insert-buffer-substring)) (interactive (list (progn @@ -4259,7 +4259,6 @@ (insert-buffer-substring (get-buffer buffer)) (point))) nil) -(put 'insert-buffer 'interactive-only 'insert-buffer-substring) (defun append-to-buffer (buffer start end) "Append to specified buffer the text of the region. @@ -4847,6 +4846,7 @@ If you are thinking of using this in a Lisp program, consider using `forward-line' instead. It is usually easier to use and more reliable (no dependence on goal column, etc.)." + (declare (interactive-only forward-line)) (interactive "^p\np") (or arg (setq arg 1)) (if (and next-line-add-newlines (= arg 1)) @@ -4863,7 +4863,6 @@ (signal (car err) (cdr err)))) (line-move arg nil nil try-vscroll))) nil) -(put 'next-line 'interactive-only 'forward-line) (defun previous-line (&optional arg try-vscroll) "Move cursor vertically up ARG lines. @@ -4894,6 +4893,8 @@ If you are thinking of using this in a Lisp program, consider using `forward-line' with a negative argument instead. It is usually easier to use and more reliable (no dependence on goal column, etc.)." + (declare (interactive-only + "use `forward-line' with negative argument instead.")) (interactive "^p\np") (or arg (setq arg 1)) (if (called-interactively-p 'interactive) @@ -4903,8 +4904,6 @@ (signal (car err) (cdr err)))) (line-move (- arg) nil nil try-vscroll)) nil) -(put 'previous-line 'interactive-only - "use `forward-line' with negative argument instead.") (defcustom track-eol nil "Non-nil means vertical motion starting at end of line keeps to ends of lines. === modified file 'lisp/subr.el' --- lisp/subr.el 2014-03-21 23:16:26 +0000 +++ lisp/subr.el 2014-03-22 22:12:52 +0000 @@ -265,7 +265,9 @@ during the evaluation of the `defun' or `defmacro' form. The possible values of SPECS are specified by -`defun-declarations-alist' and `macro-declarations-alist'." +`defun-declarations-alist' and `macro-declarations-alist'. + +For more information, see info node `(elisp)Declare Form'." ;; FIXME: edebug spec should pay attention to defun-declarations-alist. nil) ------------------------------------------------------------ revno: 116841 [merge] committer: Glenn Morris branch nick: trunk timestamp: Sat 2014-03-22 14:44:04 -0700 message: Merge from emacs-24; up to r116832 diff: === modified file 'doc/lispref/ChangeLog' --- doc/lispref/ChangeLog 2014-03-21 19:04:57 +0000 +++ doc/lispref/ChangeLog 2014-03-22 21:44:04 +0000 @@ -1,3 +1,20 @@ +2014-03-22 Glenn Morris + + * commands.texi (Defining Commands): List interactive-only values. + +2014-03-22 Eli Zaretskii + + * functions.texi (Core Advising Primitives): Fix cross-reference + in last change. + +2014-03-22 Stefan Monnier + + * functions.texi (Advising Functions): Explain a bit more how + arguments work. + (Advice combinators): New node. + (Core Advising Primitives): Use it. Expand description of "depth". + (Advising Named Functions): Document limitation of advices on macros. + 2014-03-21 Martin Rudalics * frames.texi (Size and Position): In `frame-resize-pixelwise' === modified file 'doc/lispref/commands.texi' --- doc/lispref/commands.texi 2014-03-21 07:06:55 +0000 +++ doc/lispref/commands.texi 2014-03-22 21:41:31 +0000 @@ -126,7 +126,12 @@ Sometimes, a function is only intended to be called interactively, never directly from Lisp. In that case, give the function a non-@code{nil} @code{interactive-only} property. This causes the -byte compiler to warn if the command is called from Lisp. +byte compiler to warn if the command is called from Lisp. 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 other symbol, which should be an alternative function to use in +Lisp code. @menu * Using Interactive:: General rules for @code{interactive}. === modified file 'doc/lispref/functions.texi' --- doc/lispref/functions.texi 2014-03-18 11:29:33 +0000 +++ doc/lispref/functions.texi 2014-03-22 21:44:04 +0000 @@ -1170,9 +1170,10 @@ (add-function :before (process-filter @var{proc}) #'my-tracing-function) @end example -This will cause the process's output to be passed first to -@code{my-tracing-function} and then to the original process filter. -When you're done with it, you can revert to the untraced behavior with: +This will cause the process's output to be passed to @code{my-tracing-function} +before being passed to the original process filter. @code{my-tracing-function} +receives the same arguments as the original function. When you're done with +it, you can revert to the untraced behavior with: @example (remove-function (process-filter @var{proc}) #'my-tracing-function) @@ -1191,20 +1192,24 @@ (advice-add 'display-buffer :around #'his-tracing-function) @end example -and when you're tired of seeing this output, you can revert to the untraced +Here, @code{his-tracing-function} is called instead of the original function +and receives the original function (additionally to that function's arguments) +as argument, so it can call it if and when it needs to. +When you're tired of seeing this output, you can revert to the untraced behavior with: @example (advice-remove 'display-buffer #'his-tracing-function) @end example -The arguments @code{:before} and @code{:above} used in the above examples +The arguments @code{:before} and @code{:around} used in the above examples specify how the two functions are composed, since there are many different ways to do it. The added function is also called an @emph{advice}. @menu * Core Advising Primitives:: Primitives to Manipulate Advices * Advising Named Functions:: Advising Named Functions +* Advice combinators:: Ways to compose advices * Porting old advices:: Adapting code using the old defadvice @end menu @@ -1225,104 +1230,9 @@ received as argument, use @code{advice-eval-interactive-spec}. @var{where} determines how @var{function} is composed with the -existing function. It can be one of the following: - -@table @code -@item :before -Call @var{function} before the old function. Both functions receive the -same arguments, and the return value of the composition is the return value of -the old function. More specifically, the composition of the two functions -behaves like: -@example -(lambda (&rest r) (apply @var{function} r) (apply @var{oldfun} r)) -@end example -This is similar to @code{(add-hook @var{hook} @var{function})}, except that it -applies to single-function hooks rather than normal hooks. - -@item :after -Call @var{function} after the old function. Both functions receive the -same arguments, and the return value of the composition is the return value of -the old function. More specifically, the composition of the two functions -behaves like: -@example -(lambda (&rest r) (prog1 (apply @var{oldfun} r) (apply @var{function} r))) -@end example -This is similar to @code{(add-hook @var{hook} @var{function} nil 'append)}, -except that it applies to single-function hooks rather than normal hooks. - -@item :override -This completely replaces the old function with the new one. The old function -can of course be recovered if you later call @code{remove-function}. - -@item :around -Call @var{function} instead of the old function, but provide the old function -as an extra argument to @var{function}. This is the most flexible composition. -For example, it lets you call the old function with different arguments, or -within a let-binding, or you can sometimes delegate the work to the old -function and sometimes override it completely. More specifically, the -composition of the two functions behaves like: -@example -(lambda (&rest r) (apply @var{function} @var{oldfun} r)) -@end example - -@item :before-while -Call @var{function} before the old function and don't call the old -function if @var{function} returns @code{nil}. Both functions receive the -same arguments, and the return value of the composition is the return value of -the old function. More specifically, the composition of the two functions -behaves like: -@example -(lambda (&rest r) (and (apply @var{function} r) (apply @var{oldfun} r))) -@end example -This is reminiscent of @code{(add-hook @var{hook} @var{function})}, when -@var{hook} is run via @code{run-hook-with-args-until-failure}. - -@item :before-until -Call @var{function} before the old function and only call the old function if -@var{function} returns @code{nil}. More specifically, the composition of the -two functions behaves like: -@example -(lambda (&rest r) (or (apply @var{function} r) (apply @var{oldfun} r))) -@end example -This is reminiscent of @code{(add-hook @var{hook} @var{function})}, when -@var{hook} is run via @code{run-hook-with-args-until-success}. - -@item :after-while -Call @var{function} after the old function and only if the old function -returned non-@code{nil}. Both functions receive the same arguments, and the -return value of the composition is the return value of @var{function}. -More specifically, the composition of the two functions behaves like: -@example -(lambda (&rest r) (and (apply @var{oldfun} r) (apply @var{function} r))) -@end example -This is reminiscent of @code{(add-hook @var{hook} @var{function} nil 'append)}, -when @var{hook} is run via @code{run-hook-with-args-until-failure}. - -@item :after-until -Call @var{function} after the old function and only if the old function -returned @code{nil}. More specifically, the composition of the two functions -behaves like: -@example -(lambda (&rest r) (or (apply @var{oldfun} r) (apply @var{function} r))) -@end example -This is reminiscent of @code{(add-hook @var{hook} @var{function} nil 'append)}, -when @var{hook} is run via @code{run-hook-with-args-until-success}. - -@item :filter-args -Call @var{function} first and use the result (which should be a list) as the -new arguments to pass to the old function. More specifically, the composition -of the two functions behaves like: -@example -(lambda (&rest r) (apply @var{oldfun} (funcall @var{function} r))) -@end example - -@item :filter-return -Call the old function first and pass the result to @var{function}. -More specifically, the composition of the two functions behaves like: -@example -(lambda (&rest r) (funcall @var{function} (apply @var{oldfun} r))) -@end example -@end table +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. When modifying a variable (whose name will usually end with @code{-function}), you can choose whether @var{function} is used globally or only in the current @@ -1343,11 +1253,22 @@ anonymous function. @item depth -This specifies where to place the advice, in case several advices are present. +This specifies how to order the advices, in case several advices are present. By default, the depth is 0. A depth of 100 indicates that this advice should be kept as deep as possible, whereas a depth of -100 indicates that it should stay as the outermost advice. When two advices specify the same depth, the most recently added advice will be outermost. + +For a @code{:before} advice, being outermost means that this advice will be run +first, before any other advice, whereas being innermost means that it will run +right before the original function, with no other advice run between itself and +the original function. Similarly, for an @code{:after} advice innermost means +that it will run right after the original function, with no other advice run in +between, whereas outermost means that it will be run very last after all +other advices. An innermost @code{:override} advice will only override the +original function and other advices will apply to it, whereas an outermost +@code{:override} advice will override not only the original function but all +other advices applied to it as well. @end table @end defmac @@ -1419,8 +1340,10 @@ functions in Emacs. (There are currently a few exceptions to this convention, but we aim to correct them.) - Macros can also be advised, in much the same way as functions. -However, special forms (@pxref{Special Forms}) cannot be advised. + Special forms (@pxref{Special Forms}) cannot be advised, however macros can +be advised, in much the same way as functions. Of course, this will not affect +code that has already been macro-expanded, so you need to make sure the advice +is installed before the macro is expanded. It is possible to advise a primitive (@pxref{What Is a Function}), but one should typically @emph{not} do so, for two reasons. Firstly, @@ -1453,6 +1376,119 @@ and its properties. @end defun +@node Advice combinators +@subsection Ways to compose advices + +Here are the different possible values for the @var{where} argument of +@code{add-function} and @code{advice-add}, specifying how the advice +@var{function} and the original function should be composed. + +@table @code +@item :before +Call @var{function} before the old function. Both functions receive the +same arguments, and the return value of the composition is the return value of +the old function. More specifically, the composition of the two functions +behaves like: +@example +(lambda (&rest r) (apply @var{function} r) (apply @var{oldfun} r)) +@end example +@code{(add-function :before @var{funvar} @var{function})} is comparable for +single-function hooks to @code{(add-hook '@var{hookvar} @var{function})} for +normal hooks. + +@item :after +Call @var{function} after the old function. Both functions receive the +same arguments, and the return value of the composition is the return value of +the old function. More specifically, the composition of the two functions +behaves like: +@example +(lambda (&rest r) (prog1 (apply @var{oldfun} r) (apply @var{function} r))) +@end example +@code{(add-function :after @var{funvar} @var{function})} is comparable for +single-function hooks to @code{(add-hook '@var{hookvar} @var{function} +'append)} for normal hooks. + +@item :override +This completely replaces the old function with the new one. The old function +can of course be recovered if you later call @code{remove-function}. + +@item :around +Call @var{function} instead of the old function, but provide the old function +as an extra argument to @var{function}. This is the most flexible composition. +For example, it lets you call the old function with different arguments, or +many times, or within a let-binding, or you can sometimes delegate the work to +the old function and sometimes override it completely. More specifically, the +composition of the two functions behaves like: +@example +(lambda (&rest r) (apply @var{function} @var{oldfun} r)) +@end example + +@item :before-while +Call @var{function} before the old function and don't call the old +function if @var{function} returns @code{nil}. Both functions receive the +same arguments, and the return value of the composition is the return value of +the old function. More specifically, the composition of the two functions +behaves like: +@example +(lambda (&rest r) (and (apply @var{function} r) (apply @var{oldfun} r))) +@end example +@code{(add-function :before-while @var{funvar} @var{function})} is comparable +for single-function hooks to @code{(add-hook '@var{hookvar} @var{function})} +when @var{hookvar} is run via @code{run-hook-with-args-until-failure}. + +@item :before-until +Call @var{function} before the old function and only call the old function if +@var{function} returns @code{nil}. More specifically, the composition of the +two functions behaves like: +@example +(lambda (&rest r) (or (apply @var{function} r) (apply @var{oldfun} r))) +@end example +@code{(add-function :before-until @var{funvar} @var{function})} is comparable +for single-function hooks to @code{(add-hook '@var{hookvar} @var{function})} +when @var{hookvar} is run via @code{run-hook-with-args-until-success}. + +@item :after-while +Call @var{function} after the old function and only if the old function +returned non-@code{nil}. Both functions receive the same arguments, and the +return value of the composition is the return value of @var{function}. +More specifically, the composition of the two functions behaves like: +@example +(lambda (&rest r) (and (apply @var{oldfun} r) (apply @var{function} r))) +@end example +@code{(add-function :after-while @var{funvar} @var{function})} is comparable +for single-function hooks to @code{(add-hook '@var{hookvar} @var{function} +'append)} when @var{hookvar} is run via +@code{run-hook-with-args-until-failure}. + +@item :after-until +Call @var{function} after the old function and only if the old function +returned @code{nil}. More specifically, the composition of the two functions +behaves like: +@example +(lambda (&rest r) (or (apply @var{oldfun} r) (apply @var{function} r))) +@end example +@code{(add-function :after-until @var{funvar} @var{function})} is comparable +for single-function hooks to @code{(add-hook '@var{hookvar} @var{function} +'append)} when @var{hookvar} is run via +@code{run-hook-with-args-until-success}. + +@item :filter-args +Call @var{function} first and use the result (which should be a list) as the +new arguments to pass to the old function. More specifically, the composition +of the two functions behaves like: +@example +(lambda (&rest r) (apply @var{oldfun} (funcall @var{function} r))) +@end example + +@item :filter-return +Call the old function first and pass the result to @var{function}. +More specifically, the composition of the two functions behaves like: +@example +(lambda (&rest r) (funcall @var{function} (apply @var{oldfun} r))) +@end example +@end table + + @node Porting old advices @subsection Adapting code using the old defadvice === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2014-03-22 08:13:46 +0000 +++ lisp/ChangeLog 2014-03-22 21:44:04 +0000 @@ -1,3 +1,13 @@ +2014-03-22 Dmitry Gutov + + * emacs-lisp/package.el (package-desc): Use the contents of the + quoted form, not its cdr. (Bug#16873) + +2014-03-22 Juanma Barranquero + + * w32-common-fns.el (x-selection-owner-p): Add empty docstring for the + benefit of doc.c; change parameter profile to match the X function. + 2014-03-22 Leo Liu * help.el (temp-buffer-setup-hook): Remove help-mode-setup. === modified file 'lisp/emacs-lisp/package.el' --- lisp/emacs-lisp/package.el 2014-03-21 06:06:52 +0000 +++ lisp/emacs-lisp/package.el 2014-03-22 08:43:30 +0000 @@ -334,7 +334,7 @@ (when value (push (cons (car rest-plist) (if (eq (car-safe value) 'quote) - (cdr value) + (cadr value) value)) alist)))) (setq rest-plist (cddr rest-plist))) === modified file 'lisp/w32-common-fns.el' --- lisp/w32-common-fns.el 2014-02-10 17:05:52 +0000 +++ lisp/w32-common-fns.el 2014-03-22 00:24:00 +0000 @@ -84,9 +84,10 @@ (get 'x-selections (or type 'PRIMARY))) ;; x-selection-owner-p is used in simple.el -(defun x-selection-owner-p (&optional type) - (and (memq type '(nil PRIMARY SECONDARY)) - (get 'x-selections (or type 'PRIMARY)))) +(defun x-selection-owner-p (&optional selection _terminal) + "" ; placeholder for doc.c + (and (memq selection '(nil PRIMARY SECONDARY)) + (get 'x-selections (or selection 'PRIMARY)))) ;; The "Windows" keys on newer keyboards bring up the Start menu ;; whether you want it or not - make Emacs ignore these keystrokes === modified file 'test/automated/data/package/archive-contents' --- test/automated/data/package/archive-contents 2014-03-21 06:06:52 +0000 +++ test/automated/data/package/archive-contents 2014-03-22 08:43:30 +0000 @@ -2,7 +2,8 @@ (simple-single . [(1 3) nil "A single-file package with no dependencies" single - ((:url . "http://doodles.au"))]) + ((:url . "http://doodles.au") + (:keywords quote ("frobnicate")))]) (simple-depend . [(1 0) ((simple-single (1 3))) "A single-file package with a dependency." single]) === modified file 'test/automated/package-test.el' --- test/automated/package-test.el 2014-03-21 06:06:52 +0000 +++ test/automated/package-test.el 2014-03-22 08:43:30 +0000 @@ -326,6 +326,7 @@ (should (search-forward "Summary: A single-file package with no dependencies" nil t)) (should (search-forward "Homepage: http://doodles.au" nil t)) + (should (search-forward "Keywords: frobnicate")) ;; No description, though. Because at this point we don't know ;; what archive the package originated from, and we don't have ;; its readme file saved. ------------------------------------------------------------ revno: 116840 committer: Glenn Morris branch nick: trunk timestamp: Sat 2014-03-22 06:18:10 -0400 message: Auto-commit of loaddefs files. diff: === modified file 'lisp/mail/rmail.el' --- lisp/mail/rmail.el 2014-03-21 23:09:02 +0000 +++ lisp/mail/rmail.el 2014-03-22 10:18:10 +0000 @@ -4791,7 +4791,7 @@ ;;;*** -;;;### (autoloads nil "rmailsum" "rmailsum.el" "9baf491e4facec07debcb6aa55a11b54") +;;;### (autoloads nil "rmailsum" "rmailsum.el" "cfbb230f38a9358564c242f595ba2527") ;;; Generated autoloads from rmailsum.el (autoload 'rmail-summary "rmailsum" "\ ------------------------------------------------------------ revno: 116839 fixes bug: http://debbugs.gnu.org/16038 committer: Leo Liu branch nick: trunk timestamp: Sat 2014-03-22 16:13:46 +0800 message: * help.el (temp-buffer-setup-hook): Remove help-mode-setup. (temp-buffer-show-hook): Remove help-mode-finish. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2014-03-21 23:20:31 +0000 +++ lisp/ChangeLog 2014-03-22 08:13:46 +0000 @@ -1,3 +1,8 @@ +2014-03-22 Leo Liu + + * help.el (temp-buffer-setup-hook): Remove help-mode-setup. + (temp-buffer-show-hook): Remove help-mode-finish. (Bug#16038) + 2014-03-21 Richard Stallman * battery.el (battery-linux-sysfs): Search for each field === modified file 'lisp/help.el' --- lisp/help.el 2014-03-16 09:26:58 +0000 +++ lisp/help.el 2014-03-22 08:13:46 +0000 @@ -33,10 +33,6 @@ ;; or run interpreted, but not when the compiled code is loaded. (eval-when-compile (require 'help-macro)) -;; This makes `with-output-to-temp-buffer' buffers use `help-mode'. -(add-hook 'temp-buffer-setup-hook 'help-mode-setup) -(add-hook 'temp-buffer-show-hook 'help-mode-finish) - ;; `help-window-point-marker' is a marker you can move to a valid ;; position of the buffer shown in the help window in order to override ;; the standard positioning mechanism (`point-min') chosen by ------------------------------------------------------------ revno: 116838 [merge] committer: Daniel Colascione branch nick: trunk timestamp: Fri 2014-03-21 20:04:53 -0700 message: Do not read uninitialized memory in conv_sockaddr_to_lisp diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2014-03-21 19:04:57 +0000 +++ src/ChangeLog 2014-03-22 03:04:53 +0000 @@ -1,3 +1,9 @@ +2014-03-22 Daniel Colascione + + * process.c (conv_sockaddr_to_lisp): When extracting the string + names of AF_LOCAL sockets, stop before reading uninitialized + memory. + 2014-03-21 YAMAMOTO Mitsuharu Fix regression introduced by patch for Bug#10500. === modified file 'src/process.c' --- src/process.c 2014-02-22 21:08:22 +0000 +++ src/process.c 2014-03-22 03:04:24 +0000 @@ -2010,10 +2010,22 @@ case AF_LOCAL: { struct sockaddr_un *sockun = (struct sockaddr_un *) sa; - for (i = 0; i < sizeof (sockun->sun_path); i++) - if (sockun->sun_path[i] == 0) - break; - return make_unibyte_string (sockun->sun_path, i); + ptrdiff_t name_length = len - offsetof (struct sockaddr_un, sun_path); + /* If the first byte is NUL, the name is a Linux abstract + socket name, and the name can contain embedded NULs. If + it's not, we have a NUL-terminated string. Be careful not + to walk past the end of the object looking for the name + terminator, however. */ + if (name_length > 0 && sockun->sun_path[0] != '\0') + { + const char* terminator = + memchr (sockun->sun_path, '\0', name_length); + + if (terminator) + name_length = terminator - (const char*) sockun->sun_path; + } + + return make_unibyte_string (sockun->sun_path, name_length); } #endif default: ------------------------------------------------------------ revno: 116837 author: Richard Stallman committer: Richard Stallman branch nick: trunk timestamp: Fri 2014-03-21 19:20:31 -0400 message: Fix bugs that screwed M-x battery on Yeeloong * lisp/battery.el (battery-linux-sysfs): Search for each field from the beginning of the buffer. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2014-03-21 23:16:26 +0000 +++ lisp/ChangeLog 2014-03-21 23:20:31 +0000 @@ -1,5 +1,8 @@ 2014-03-21 Richard Stallman + * battery.el (battery-linux-sysfs): Search for each field + from the beginning of the buffer. + * subr.el (set-transient-map): Clear out function and value of the temporary symbol when we're done with it. === modified file 'lisp/battery.el' --- lisp/battery.el 2014-01-01 07:43:34 +0000 +++ lisp/battery.el 2014-03-21 23:20:31 +0000 @@ -458,12 +458,15 @@ (and (re-search-forward "POWER_SUPPLY_STATUS=\\(.*\\)$" nil t) (member charging-state '("Unknown" "Full" nil)) (setq charging-state (match-string 1))) + (goto-char (point-min)) (when (re-search-forward "POWER_SUPPLY_\\(CURRENT\\|POWER\\)_NOW=\\([0-9]*\\)$" nil t) (setq rate (float (string-to-number (match-string 2))))) + (goto-char (point-min)) (when (re-search-forward "POWER_SUPPLY_TEMP=\\([0-9]*\\)$" nil t) (setq temperature (match-string 1))) + (goto-char (point-min)) (let (full-string now-string) ;; Sysfs may list either charge (mAh) or energy (mWh). ;; Keep track of both, and choose which to report later. @@ -477,7 +480,8 @@ (string-to-number full-string)) charge-now (+ charge-now (string-to-number now-string)))) - ((and (re-search-forward + ((and (progn (goto-char (point-min)) t) + (re-search-forward "POWER_SUPPLY_ENERGY_FULL=\\([0-9]*\\)$" nil t) (setq full-string (match-string 1)) (re-search-forward ------------------------------------------------------------ revno: 116836 author: Richard Stallman committer: Richard Stallman branch nick: trunk timestamp: Fri 2014-03-21 19:16:26 -0400 message: Avoid GC crashes. * lisp/subr.el (set-transient-map): Clear out function and value of the temporary symbol when we're done with it. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2014-03-21 23:09:02 +0000 +++ lisp/ChangeLog 2014-03-21 23:16:26 +0000 @@ -1,5 +1,8 @@ 2014-03-21 Richard Stallman + * subr.el (set-transient-map): Clear out function and value + of the temporary symbol when we're done with it. + * mail/rmailsum.el (rmail-summary-delete-forward): Optimize case of reaching end and handling count. (rmail-summary-mark-deleted): Optimize when N is current msg. === modified file 'lisp/subr.el' --- lisp/subr.el 2014-03-01 03:54:47 +0000 +++ lisp/subr.el 2014-03-21 23:16:26 +0000 @@ -4312,7 +4312,10 @@ (t (funcall keep-pred))) (internal-pop-keymap map 'overriding-terminal-local-map) (remove-hook 'pre-command-hook clearfun) - (when on-exit (funcall on-exit)))))) + (when on-exit (funcall on-exit)) +;; Comment out the fset if you want to debug the GC bug. + (fset clearfun nil) + (set clearfun nil))))) (add-hook 'pre-command-hook clearfun) (internal-push-keymap map 'overriding-terminal-local-map))) ------------------------------------------------------------ revno: 116835 committer: Richard Stallman branch nick: trunk timestamp: Fri 2014-03-21 19:10:32 -0400 message: *** empty log message *** diff: === modified file 'etc/NEWS' --- etc/NEWS 2014-03-21 23:10:16 +0000 +++ etc/NEWS 2014-03-21 23:10:32 +0000 @@ -39,6 +39,7 @@ * Changes in Specialized Modes and Packages in Emacs 24.5 +--- ** The Rmail commands d, C-d and u now handle repeat counts to delete or undelete multiple messages. ------------------------------------------------------------ revno: 116834 committer: Richard Stallman branch nick: trunk timestamp: Fri 2014-03-21 19:10:16 -0400 message: *** empty log message *** diff: === modified file 'etc/NEWS' --- etc/NEWS 2014-03-21 19:04:57 +0000 +++ etc/NEWS 2014-03-21 23:10:16 +0000 @@ -39,6 +39,8 @@ * Changes in Specialized Modes and Packages in Emacs 24.5 +** The Rmail commands d, C-d and u now handle repeat counts +to delete or undelete multiple messages. * New Modes and Packages in Emacs 24.5 ------------------------------------------------------------ revno: 116833 author: Richard Stallman committer: Richard Stallman branch nick: trunk timestamp: Fri 2014-03-21 19:09:02 -0400 message: Make Rmail delete and undelete commands handle repeat count. * lisp/mail/rmail.el (rmail-delete-message): Update summary. (rmail-undelete-previous-message): Handle repeat count arg. (rmail-delete-backward, rmail-delete-forward): Likewise. * lisp/mail/rmailsum.el (rmail-summary-delete-forward): Optimize case of reaching end and handling count. (rmail-summary-mark-deleted): Optimize when N is current msg. Don't create new summary line. (rmail-summary-undelete): Pass arg to rmail-undelete-previous-message. (rmail-summary-undelete-many): Rewrite for speed. (rmail-summary-msg-number): New function. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2014-03-21 21:27:25 +0000 +++ lisp/ChangeLog 2014-03-21 23:09:02 +0000 @@ -1,3 +1,17 @@ +2014-03-21 Richard Stallman + + * mail/rmailsum.el (rmail-summary-delete-forward): + Optimize case of reaching end and handling count. + (rmail-summary-mark-deleted): Optimize when N is current msg. + Don't create new summary line. + (rmail-summary-undelete): Pass arg to rmail-undelete-previous-message. + (rmail-summary-undelete-many): Rewrite for speed. + (rmail-summary-msg-number): New function. + + * mail/rmail.el (rmail-delete-message): Update summary. + (rmail-undelete-previous-message): Handle repeat count arg. + (rmail-delete-backward, rmail-delete-forward): Likewise. + 2014-03-21 Daniel Colascione * mail/emacsbug.el (report-emacs-bug): Include memory usage === modified file 'lisp/mail/rmail.el' --- lisp/mail/rmail.el 2014-02-13 18:23:36 +0000 +++ lisp/mail/rmail.el 2014-03-21 23:09:02 +0000 @@ -3449,47 +3449,64 @@ "Delete this message and stay on it." (interactive) (rmail-set-attribute rmail-deleted-attr-index t) - (run-hooks 'rmail-delete-message-hook)) - -(defun rmail-undelete-previous-message () - "Back up to deleted message, select it, and undelete it." - (interactive) - (set-buffer rmail-buffer) - (let ((msg rmail-current-message)) - (while (and (> msg 0) - (not (rmail-message-deleted-p msg))) - (setq msg (1- msg))) - (if (= msg 0) - (error "No previous deleted message") - (if (/= msg rmail-current-message) - (rmail-show-message msg)) - (rmail-set-attribute rmail-deleted-attr-index nil) - (if (rmail-summary-exists) - (with-current-buffer rmail-summary-buffer - (rmail-summary-mark-undeleted msg))) - (rmail-maybe-display-summary)))) - -(defun rmail-delete-forward (&optional backward) - "Delete this message and move to next nondeleted one. -Deleted messages stay in the file until the \\[rmail-expunge] command is given. -With prefix argument, delete and move backward. - -Returns t if a new message is displayed after the delete, or nil otherwise." - (interactive "P") - (rmail-set-attribute rmail-deleted-attr-index t) (run-hooks 'rmail-delete-message-hook) (let ((del-msg rmail-current-message)) (if (rmail-summary-exists) (rmail-select-summary - (rmail-summary-mark-deleted del-msg))) - (prog1 (rmail-next-undeleted-message (if backward -1 1)) - (rmail-maybe-display-summary)))) - -(defun rmail-delete-backward () + (rmail-summary-mark-deleted del-msg))))) + +(defun rmail-undelete-previous-message (count) + "Back up to deleted message, select it, and undelete it." + (interactive "p") + (set-buffer rmail-buffer) + (let (value) + (dotimes (i count) + (let ((msg rmail-current-message)) + (while (and (> msg 0) + (not (rmail-message-deleted-p msg))) + (setq msg (1- msg))) + (if (= msg 0) + (error "No previous deleted message") + (if (/= msg rmail-current-message) + (rmail-show-message msg)) + (rmail-set-attribute rmail-deleted-attr-index nil) + (if (rmail-summary-exists) + (with-current-buffer rmail-summary-buffer + (rmail-summary-mark-undeleted msg)))))) + (rmail-maybe-display-summary))) + +(defun rmail-delete-forward (&optional count) + "Delete this message and move to next nondeleted one. +Deleted messages stay in the file until the \\[rmail-expunge] command is given. +A prefix argument is a repeat count; +negative argument means move backwards instead of forwards. + +Returns t if a new message is displayed after the delete, or nil otherwise." + (interactive "p") + (let (value backward) + (if (< count 0) + (setq count (- count) backward t)) + (dotimes (i count) + (rmail-set-attribute rmail-deleted-attr-index t) + (run-hooks 'rmail-delete-message-hook) + (let ((del-msg rmail-current-message)) + (if (rmail-summary-exists) + (rmail-select-summary + (rmail-summary-mark-deleted del-msg))) + (setq value (rmail-next-undeleted-message (if backward -1 1))))) + (rmail-maybe-display-summary) + value)) + +(defun rmail-delete-backward (count) "Delete this message and move to previous nondeleted one. -Deleted messages stay in the file until the \\[rmail-expunge] command is given." - (interactive) - (rmail-delete-forward t)) +Deleted messages stay in the file until the \\[rmail-expunge] command is given. +A prefix argument is a repeat count; +negative argument means move forwards instead of backwards. + +Returns t if a new message is displayed after the delete, or nil otherwise." + + (interactive "p") + (rmail-delete-forward (- count))) ;; Expunging. === modified file 'lisp/mail/rmailsum.el' --- lisp/mail/rmailsum.el 2014-02-10 01:34:22 +0000 +++ lisp/mail/rmailsum.el 2014-03-21 23:09:02 +0000 @@ -914,7 +914,10 @@ (unless (numberp count) (setq count 1)) (let (end del-msg (backward (< count 0))) - (while (/= count 0) + (while (and (/= count 0) + ;; Don't waste time if we are at the beginning + ;; and trying to go backward. + (not (and backward (bobp)))) (rmail-summary-goto-msg) (with-current-buffer rmail-buffer (rmail-delete-message) @@ -924,11 +927,13 @@ (save-excursion (beginning-of-line) (looking-at " *[0-9]+D"))) (forward-line (if backward -1 1))) + (setq count + (if (> count 0) (1- count) (1+ count))) ;; It looks ugly to move to the empty line at end of buffer. + ;; And don't waste time after hitting the end. (and (eobp) (not backward) - (forward-line -1)) - (setq count - (if (> count 0) (1- count) (1+ count)))))) + (progn (setq count 0) + (forward-line -1)))))) (defun rmail-summary-delete-backward (&optional count) "Delete this message and move to previous nondeleted one. @@ -939,8 +944,9 @@ (rmail-summary-delete-forward (- count))) (defun rmail-summary-mark-deleted (&optional n undel) - ;; Since third arg is t, this only alters the summary, not the Rmail buf. - (and n (rmail-summary-goto-msg n t t)) + (and n (not (eq n (rmail-summary-msg-number))) + ;; Since third arg is t, this only alters summary, not the Rmail buf. + (rmail-summary-goto-msg n t t)) (or (eobp) (not (overlay-get rmail-summary-overlay 'face)) (let ((buffer-read-only nil)) @@ -951,9 +957,9 @@ (progn (delete-char 1) (insert " "))) (delete-char 1) (insert "D")) - ;; Register a new summary line. + ;; Discard cached new summary line. (with-current-buffer rmail-buffer - (aset rmail-summary-vector (1- n) (rmail-create-summary-line n))))) + (aset rmail-summary-vector (1- n) nil)))) (beginning-of-line)) (defun rmail-summary-update-line (n) @@ -1002,7 +1008,7 @@ (set-buffer rmail-buffer) (rmail-pop-to-buffer rmail-buffer)) (and (rmail-message-deleted-p rmail-current-message) - (rmail-undelete-previous-message)) + (rmail-undelete-previous-message 1)) (if rmail-enable-mime (rmail-pop-to-buffer rmail-buffer)) (rmail-pop-to-buffer rmail-summary-buffer)) @@ -1011,26 +1017,35 @@ (defun rmail-summary-undelete-many (&optional n) "Undelete all deleted msgs, optional prefix arg N means undelete N prev msgs." (interactive "P") - (with-current-buffer rmail-buffer - (let* ((init-msg (if n rmail-current-message rmail-total-messages)) - (rmail-current-message init-msg) - (n (or n rmail-total-messages)) - (msgs-undeled 0)) - (while (and (> rmail-current-message 0) - (< msgs-undeled n)) - (if (rmail-message-deleted-p rmail-current-message) - (progn (rmail-set-attribute rmail-deleted-attr-index nil) - (setq msgs-undeled (1+ msgs-undeled)))) - (setq rmail-current-message (1- rmail-current-message))) - (set-buffer rmail-summary-buffer) - (setq rmail-current-message init-msg msgs-undeled 0) - (while (and (> rmail-current-message 0) - (< msgs-undeled n)) - (if (rmail-summary-deleted-p rmail-current-message) - (progn (rmail-summary-mark-undeleted rmail-current-message) - (setq msgs-undeled (1+ msgs-undeled)))) - (setq rmail-current-message (1- rmail-current-message)))) - (rmail-summary-goto-msg))) + (if n + (while (and (> n 0) (not (eobp))) + (rmail-summary-goto-msg) + (let (del-msg) + (when (rmail-summary-deleted-p) + (with-current-buffer rmail-buffer + (rmail-undelete-previous-message 1) + (setq del-msg rmail-current-message)) + (rmail-summary-mark-undeleted del-msg))) + (while (and (not (eobp)) + (save-excursion (beginning-of-line) + (looking-at " *[0-9]+ "))) + (forward-line 1)) + (setq n (1- n))) + (rmail-summary-goto-msg 1) + (dotimes (i rmail-total-messages) + (rmail-summary-goto-msg) + (let (del-msg) + (when (rmail-summary-deleted-p) + (with-current-buffer rmail-buffer + (rmail-undelete-previous-message 1) + (setq del-msg rmail-current-message)) + (rmail-summary-mark-undeleted del-msg))) + (if (not (eobp)) + (forward-line 1)))) + + ;; It looks ugly to move to the empty line at end of buffer. + (and (eobp) + (forward-line -1))) ;; Rmail Summary mode is suitable only for specially formatted data. (put 'rmail-summary-mode 'mode-class 'special) @@ -1188,6 +1203,13 @@ (goto-char (posn-point (event-end event))) (rmail-summary-goto-msg)) +(defun rmail-summary-msg-number () + (save-excursion + (beginning-of-line) + (string-to-number + (buffer-substring (point) + (min (point-max) (+ 6 (point))))))) + (defun rmail-summary-goto-msg (&optional n nowarn skip-rmail) "Go to message N in the summary buffer and the Rmail buffer. If N is nil, use the message corresponding to point in the summary ------------------------------------------------------------ revno: 116832 [merge] committer: Daniel Colascione branch nick: trunk timestamp: Fri 2014-03-21 14:27:25 -0700 message: Add memory information to bug reports diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2014-03-21 19:04:57 +0000 +++ lisp/ChangeLog 2014-03-21 21:27:25 +0000 @@ -1,3 +1,8 @@ +2014-03-21 Daniel Colascione + + * mail/emacsbug.el (report-emacs-bug): Include memory usage + information in bug reports. + 2014-03-21 Michael Albinus * net/tramp.el (tramp-methods): Add docstring for `tramp-login-env' === modified file 'lisp/mail/emacsbug.el' --- lisp/mail/emacsbug.el 2014-02-10 01:34:22 +0000 +++ lisp/mail/emacsbug.el 2014-03-21 21:26:19 +0000 @@ -322,6 +322,10 @@ shadows))) (insert (format "\nFeatures:\n%s\n" features)) (fill-region (line-beginning-position 0) (point)) + + (insert (format "\nMemory information:\n")) + (pp (garbage-collect) (current-buffer)) + ;; This is so the user has to type something in order to send easily. (use-local-map (nconc (make-sparse-keymap) (current-local-map))) (define-key (current-local-map) "\C-c\C-i" 'info-emacs-bug) ------------------------------------------------------------ revno: 116831 [merge] committer: Glenn Morris branch nick: trunk timestamp: Fri 2014-03-21 12:04:57 -0700 message: Merge from emacs-24; up to r116824 diff: === modified file 'doc/lispref/ChangeLog' --- doc/lispref/ChangeLog 2014-03-20 17:58:01 +0000 +++ doc/lispref/ChangeLog 2014-03-21 19:04:57 +0000 @@ -1,3 +1,15 @@ +2014-03-21 Martin Rudalics + + * frames.texi (Size and Position): In `frame-resize-pixelwise' + description drop remark about frame maximization. + * windows.texi (Display Action Functions): Add description for + `display-buffer-no-window' and explain use of `allow-no-window' + alist entries. + +2014-03-21 Glenn Morris + + * commands.texi (Defining Commands): Copyedit re `interactive-only'. + 2014-03-20 Paul Eggert * internals.texi (C Integer Types): Prefer 'false' and 'true' === modified file 'doc/lispref/commands.texi' --- doc/lispref/commands.texi 2014-03-18 01:19:03 +0000 +++ doc/lispref/commands.texi 2014-03-21 07:06:55 +0000 @@ -123,11 +123,10 @@ form in the function body itself. This feature is seldom used. @cindex @code{interactive-only} property - Sometimes, a named command is only intended to be called -interactively, never directly from Lisp. In that case, give it a -non-@code{nil} @code{interactive-only} property. In that case, the -byte compiler will print a warning message if the command is called -from Lisp. + Sometimes, a function is only intended to be called interactively, +never directly from Lisp. In that case, give the function a +non-@code{nil} @code{interactive-only} property. This causes the +byte compiler to warn if the command is called from Lisp. @menu * Using Interactive:: General rules for @code{interactive}. === modified file 'doc/lispref/frames.texi' --- doc/lispref/frames.texi 2014-03-18 01:19:03 +0000 +++ doc/lispref/frames.texi 2014-03-21 09:23:22 +0000 @@ -1163,10 +1163,7 @@ always done character-wise. Calling @code{set-frame-size} (see below) with arguments that do not specify the frame size as an integer multiple of its character size may be, however, either ignored or cause a -rounding (GTK+, Windows) or get accepted (Lucid, Motif). This also -means that with some toolkits and a display whose size is not an -integral multiple of your default font, you may have to set this to -non-@code{nil} in order to fully maximize a frame. +rounding (GTK+, Windows) or get accepted (Lucid, Motif). @end defopt @defun set-frame-size frame width height pixelwise === modified file 'doc/lispref/windows.texi' --- doc/lispref/windows.texi 2014-03-18 01:19:03 +0000 +++ doc/lispref/windows.texi 2014-03-21 09:23:22 +0000 @@ -2280,6 +2280,15 @@ windows are dedicated to another buffer (@pxref{Dedicated Windows}). @end defun +@defun display-buffer-no-window buffer alist +If @var{alist} has a non-@code{nil} @code{allow-no-window} entry, then +this function does not display @code{buffer}. This allows to override +the default action and avoid displaying the buffer. It is assumed that +when the caller specifies a non-@code{nil} @code{allow-no-window} value +it can handle a @code{nil} value returned from @code{display-buffer} in +this case. +@end defun + To illustrate the use of action functions, consider the following example. === modified file 'doc/misc/ChangeLog' --- doc/misc/ChangeLog 2014-03-18 21:14:36 +0000 +++ doc/misc/ChangeLog 2014-03-21 07:00:21 +0000 @@ -1,3 +1,8 @@ +2014-03-21 Glenn Morris + + * ede.texi (ede-linux): + * vip.texi (New Bindings): Tiny copyedits. + 2014-03-18 Stefan Monnier * vip.texi (Other Vi Commands): Adjust doc of C-j. === modified file 'doc/misc/ede.texi' --- doc/misc/ede.texi 2014-03-18 21:12:42 +0000 +++ doc/misc/ede.texi 2014-03-21 07:00:21 +0000 @@ -917,7 +917,7 @@ Through the variables @code{project-linux-build-directory-default} and @code{project-linux-architecture-default}, you can set the build -directory and its architecture, resp. The default is to assume that +directory and its architecture, respectively. The default is to assume that the build happens in the source directory and to auto-detect the architecture; if the auto-detection fails, you will be asked. === modified file 'doc/misc/vip.texi' --- doc/misc/vip.texi 2014-03-20 17:14:45 +0000 +++ doc/misc/vip.texi 2014-03-21 07:00:21 +0000 @@ -569,7 +569,7 @@ @kindex 1300 @kbd{X} (@code{vip-ctl-x-equivalent}) These keys will exit from vi mode and return to emacs mode temporarily. If you type @kbd{C} (@kbd{X}), Emacs will be in emacs mode and will believe -that you have typed @kbd{C-c} (@kbd{C-x}, resp.) in emacs mode. Moreover, +that you have typed @kbd{C-c} (@kbd{C-x}) in emacs mode. Moreover, if the following character you type is an upper-case letter, then Emacs will believe that you have typed the corresponding control character. You will be in vi mode again after the command is executed. For example, === modified file 'etc/NEWS' --- etc/NEWS 2014-03-21 17:04:50 +0000 +++ etc/NEWS 2014-03-21 19:04:57 +0000 @@ -240,6 +240,7 @@ *** New hooks `focus-in-hook', `focus-out-hook'. These are normal hooks run when an Emacs frame gains or loses input focus. ++++ *** Emacs can now change frame sizes in units of pixels, rather than text rows or columns. When maximizing a frame or making it fullscreen, remaining extra pixels are no longer given to the minibuffer, the rightmost @@ -248,6 +249,7 @@ is non-nil, all frame size changes happen pixelwise and set the corresponding size hints for the window manager. ++++ *** Emacs can now change window sizes in units of pixels. Mouse-dragging a mode line or window divider now changes the size of adjacent windows pixelwise. If the new option `window-resize-pixelwise' @@ -261,6 +263,7 @@ count partially visible lines or columns if called with a nil PIXELWISE argument. ++++ *** Emacs can now draw dividers between adjacent windows. To put dividers between side-by-side/vertically stacked windows customize the frame parameters `right-divider-width' and `bottom-divider-width' to @@ -271,25 +274,30 @@ two are useful to provide a 3D effect, or to better distinguish dividers from surrounding display objects. ++++ *** New functions are provided to return the pixel sizes of window components, namely `window-scroll-bar-width', `window-mode-line-height' `window-header-line-height', `window-right-divider-width' and `window-bottom-divider-width'. ++++ *** The new function `window-text-pixel-size' returns the size of the text of a window's buffer in pixels. This allows functions like `fit-frame-to-buffer' and `fit-window-to-buffer' to accurately fit a window to its buffer as it will be displayed. ++++ *** `fit-window-to-buffer' can now resize windows in both dimensions. This behavior is controlled by the new option `fit-window-to-buffer-horizontally'. The new option `fit-frame-to-buffer' allows to fit the window's frame to its buffer. ++++ *** `fit-frame-to-buffer' now fits frames in both dimensions. The new options `fit-frame-to-buffer-margins' and `fit-frame-to-buffer-sizes' control the size of the frame and its position on screen. +--- *** Temp Buffer Resize Mode can now adjust height and width of windows and frames. `temp-buffer-resize-mode' is now able to adjust the height and the width of a window displaying a temporary buffer. The new option @@ -328,9 +336,11 @@ `display-buffer' choose or make a window at the bottom of the selected frame. ++++ *** New display action function `display-buffer-no-window' to not display the buffer in a window. ++++ *** New display action alist entry `allow-no-window' to indicate the caller of `display-buffer' is ready to handle the case of not displaying the buffer in a window. === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2014-03-21 17:04:50 +0000 +++ lisp/ChangeLog 2014-03-21 19:04:57 +0000 @@ -1,3 +1,51 @@ +2014-03-21 Michael Albinus + + * net/tramp.el (tramp-methods): Add docstring for `tramp-login-env' + and `tramp-copy-env'. + + * net/tramp-sh.el (tramp-methods) : Add `tramp-login-env'. + (tramp-maybe-open-connection): Handle `tramp-login-env'. + +2014-03-21 Glenn Morris + + * electric.el (electric-indent-post-self-insert-function): Add doc. + +2014-03-21 Dmitry Gutov + + * emacs-lisp/package.el (package-compute-transaction): + Use `version-list-<=' to compare the requirement version against + the version of package already to be installed. Update the error + message. (Bug#16826) + + * progmodes/ruby-mode.el (ruby-smie-rules): + Add indentation rule for ` @ '. (Bug#17050) + +2014-03-21 Juanma Barranquero + + * align.el (align-regexp): Remove superfluous backslash. + + * ffap.el (ffap-ftp-default-user, ffap-url-regexp) + (ffap-pass-wildcards-to-dired, dired-at-point-require-prefix) + (ffap-rfc-path, ffap-ftp-sans-slash-regexp, ffap-menu-regexp): + Fix docstring typos. + (ffap-next): Use C-u in docstring. + (ffap-machine-p, ffap-list-env, ffap-alist, ffap-alist) + (ffap-string-at-point-mode-alist, ffap-menu, ffap-menu-ask): + Remove superfluous backslashes. + (ffap-string-at-point): Reflow docstring. + + * server.el (server-host): Reflow docstring. + (server-unload-function): Fix docstring typo. + (server-eval-at): Remove superfluous backslash. + + * skeleton.el (skeleton-insert): Remove superfluous backslash. + (skeleton-insert): Doc fix. + (skeleton-insert): Reflow docstring. + + * term/tty-colors.el (tty-color-alist, tty-modify-color-alist) + (tty-color-approximate, tty-color-by-index, tty-color-values) + (tty-color-desc): Remove superfluous backslashes. + 2014-03-21 Glenn Morris * cus-start.el (history-length): Bump :version. === modified file 'lisp/align.el' --- lisp/align.el 2014-02-10 01:34:22 +0000 +++ lisp/align.el 2014-03-21 01:12:57 +0000 @@ -937,7 +937,7 @@ See `align-rules-list' for more information about these options. The non-interactive form of the previous example would look something like: - \(align-regexp (point-min) (point-max) \"\\\\(\\\\s-*\\\\)(\") + (align-regexp (point-min) (point-max) \"\\\\(\\\\s-*\\\\)(\") This function is a nothing more than a small wrapper that helps you construct a rule to pass to `align-region', which does the real work." === modified file 'lisp/electric.el' --- lisp/electric.el 2014-03-20 17:14:45 +0000 +++ lisp/electric.el 2014-03-21 07:19:21 +0000 @@ -228,6 +228,10 @@ mode set `electric-indent-inhibit', but this can be used as a workaround.") (defun electric-indent-post-self-insert-function () + "Function that `electric-indent-mode' adds to `post-self-insert-hook'. +This indents if the hook `electric-indent-functions' returns non-nil, +or if a member of `electric-indent-chars' was typed; but not in a string +or comment." ;; FIXME: This reindents the current line, but what we really want instead is ;; to reindent the whole affected text. That's the current line for simple ;; cases, but not all cases. We do take care of the newline case in an @@ -286,7 +290,8 @@ (let ((electric-indent-mode nil)) (newline arg 'interactive))) -;;;###autoload(define-key global-map "\C-j" 'electric-newline-and-maybe-indent) +;;;###autoload +(define-key global-map "\C-j" 'electric-newline-and-maybe-indent) ;;;###autoload (defun electric-newline-and-maybe-indent () "Insert a newline. === modified file 'lisp/emacs-lisp/package.el' --- lisp/emacs-lisp/package.el 2014-03-19 16:14:26 +0000 +++ lisp/emacs-lisp/package.el 2014-03-21 06:06:52 +0000 @@ -923,10 +923,10 @@ (setq already pkg))) (cond (already - (if (version-list-< next-version (package-desc-version already)) + (if (version-list-<= next-version (package-desc-version already)) ;; Move to front, so it gets installed early enough (bug#14082). (setq packages (cons already (delq already packages))) - (error "Need package `%s-%s', but only %s is available" + (error "Need package `%s-%s', but only %s is being installed" next-pkg (package-version-join next-version) (package-version-join (package-desc-version already))))) === modified file 'lisp/ffap.el' --- lisp/ffap.el 2014-02-10 01:34:22 +0000 +++ lisp/ffap.el 2014-03-21 01:12:57 +0000 @@ -164,9 +164,9 @@ :version "24.3") (defcustom ffap-ftp-default-user "anonymous" - "User name in ftp file names generated by `ffap-host-to-path'. + "User name in FTP file names generated by `ffap-host-to-path'. Note this name may be omitted if it equals the default -\(either `efs-default-user' or `ange-ftp-default-user'\)." +\(either `efs-default-user' or `ange-ftp-default-user')." :type 'string :group 'ffap) @@ -185,7 +185,7 @@ "\\|" "\\(ftp\\|https?\\|telnet\\|gopher\\|www\\|wais\\)://" ; needs host "\\)") - "Regexp matching the beginning of a URI, for FFAP. + "Regexp matching the beginning of a URI, for ffap. If the value is nil, disable URL-matching features in ffap.") (defcustom ffap-foo-at-bar-prefix "mailto" @@ -228,7 +228,7 @@ :group 'ffap) (defcustom ffap-pass-wildcards-to-dired nil - "If non-nil, pass filenames matching `ffap-dired-wildcards' to dired." + "If non-nil, pass filenames matching `ffap-dired-wildcards' to Dired." :type 'boolean :group 'ffap) @@ -291,8 +291,8 @@ (defcustom dired-at-point-require-prefix nil "If non-nil, reverse the prefix argument to `dired-at-point'. -This is nil so neophytes notice FFAP. Experts may prefer to -disable FFAP most of the time." +This is nil so neophytes notice ffap. Experts may prefer to +disable ffap most of the time." :type 'boolean :group 'ffap :version "20.3") @@ -343,7 +343,7 @@ "Search buffer for next file or URL, and run ffap. Optional argument BACK says to search backwards. Optional argument WRAP says to try wrapping around if necessary. -Interactively: use a single prefix to search backwards, +Interactively: use a single prefix \\[universal-argument] to search backwards, double prefix to wrap forward, triple to wrap backwards. Actual search is done by the function `ffap-next-guess'." (interactive @@ -413,7 +413,7 @@ Depending on the domain (none, known, or unknown), follow the strategy named by the variable `ffap-machine-p-local', `ffap-machine-p-known', or `ffap-machine-p-unknown'. Pinging uses `open-network-stream'. -Optional SERVICE specifies the port used \(default \"discard\"\). +Optional SERVICE specifies the port used (default \"discard\"). Optional QUIET flag suppresses the \"Pinging...\" message. Optional STRATEGY overrides the three variables above. Returned values: @@ -642,7 +642,7 @@ (defun ffap-list-env (env &optional empty) "Return a list of strings parsed from environment variable ENV. -Optional EMPTY is the default list if \(getenv ENV\) is undefined, and +Optional EMPTY is the default list if (getenv ENV) is undefined, and also is substituted for the first empty-string component, if there is one. Uses `path-separator' to separate the path into substrings." ;; We cannot use parse-colon-path (files.el), since it kills @@ -787,12 +787,12 @@ . ffap-rfc) ; "100% RFC2100 compliant" (dired-mode . ffap-dired) ; maybe in a subdirectory ) - "Alist of \(KEY . FUNCTION\) pairs parsed by `ffap-file-at-point'. + "Alist of (KEY . FUNCTION) pairs parsed by `ffap-file-at-point'. If string NAME at point (maybe \"\") is not a file or URL, these pairs specify actions to try creating such a string. A pair matches if either KEY is a symbol, and it equals `major-mode', or KEY is a string, it should match NAME as a regexp. -On a match, \(FUNCTION NAME\) is called and should return a file, an +On a match, (FUNCTION NAME) is called and should return a file, an URL, or nil. If nil, search the alist for further matches.") (put 'ffap-alist 'risky-local-variable t) @@ -980,7 +980,7 @@ (defcustom ffap-rfc-path (concat (ffap-host-to-filename "ftp.rfc-editor.org") "/in-notes/rfc%s.txt") "A `format' string making a filename for RFC documents. -This can be an ange-ftp or tramp remote filename to download, or +This can be an ange-ftp or Tramp remote filename to download, or a local filename if you have full set of RFCs locally. See also `ffap-rfc-directories'." :type 'string @@ -1018,8 +1018,8 @@ ;; Mathematica paths: allow backquotes (math-mode ",-:$+<>@-Z_[:lower:]~`" "<" "@>;.,!?`:") ) - "Alist of \(MODE CHARS BEG END\), where MODE is a symbol, -possibly a major-mode name, or one of the symbol + "Alist of (MODE CHARS BEG END), where MODE is a symbol, +possibly a major-mode name, or one of the symbols `file', `url', `machine', and `nocolon'. Function `ffap-string-at-point' uses the data fields as follows: 1. find a maximal string of CHARS around point, @@ -1032,8 +1032,8 @@ (defun ffap-string-at-point (&optional mode) "Return a string of characters from around point. -MODE (defaults to value of `major-mode') is a symbol used to look up string -syntax parameters in `ffap-string-at-point-mode-alist'. +MODE (defaults to value of `major-mode') is a symbol used to look up +string syntax parameters in `ffap-string-at-point-mode-alist'. If MODE is not found, we use `file' instead of MODE. If the region is active, return a string from the region. Sets the variable `ffap-string-at-point' and the variable @@ -1143,7 +1143,7 @@ ;; Icky regexp avoids: default: 123: foo::bar cs:pub ;; It does match on: mic@cs: cs:/pub mathcs.emory.edu: (point at end) "\\`\\([^:@]+@[^:@]+:\\|[^@.:]+\\.[^@:]+:\\|[^:]+:[~/]\\)\\([^:]\\|\\'\\)") - "Strings matching this are coerced to ftp file names by ffap. + "Strings matching this are coerced to FTP file names by ffap. That is, ffap just prepends \"/\". Set to nil to disable.") (defun ffap-file-at-point () @@ -1445,7 +1445,7 @@ (defcustom ffap-menu-regexp nil "If non-nil, regexp overriding `ffap-next-regexp' in `ffap-menu'. Make this more restrictive for faster menu building. -For example, try \":/\" for URL (and some ftp) references." +For example, try \":/\" for URL (and some FTP) references." :type '(choice (const nil) regexp) :group 'ffap) @@ -1465,7 +1465,7 @@ "Put up a menu of files and URLs mentioned in this buffer. Then set mark, jump to choice, and try to fetch it. The menu is cached in `ffap-menu-alist', and rebuilt by `ffap-menu-rescan'. -The optional RESCAN argument \(a prefix, interactively\) forces +The optional RESCAN argument (a prefix, interactively) forces a rebuild. Searches with `ffap-menu-regexp'." (interactive "P") ;; (require 'imenu) -- no longer used, but roughly emulated @@ -1498,7 +1498,7 @@ (defun ffap-menu-ask (title alist cont) "Prompt from a menu of choices, and then apply some action. -Arguments are TITLE, ALIST, and CONT \(a continuation function\). +Arguments are TITLE, ALIST, and CONT (a continuation function). This uses either a menu or the minibuffer depending on invocation. The TITLE string is used as either the prompt or menu title. Each ALIST entry looks like (STRING . DATA) and defines one choice. === modified file 'lisp/net/tramp-sh.el' --- lisp/net/tramp-sh.el 2014-03-17 09:28:47 +0000 +++ lisp/net/tramp-sh.el 2014-03-21 13:02:25 +0000 @@ -227,6 +227,8 @@ '("sudo" (tramp-login-program "sudo") (tramp-login-args (("-u" "%u") ("-s") ("-H") ("-p" "Password:"))) + ;; Local $SHELL could be a nasty one, like zsh or fish. Let's override it. + (tramp-login-env (("SHELL") ("/bin/sh"))) (tramp-remote-shell "/bin/sh") (tramp-remote-shell-args ("-c")) (tramp-connection-timeout 10))) @@ -4492,6 +4494,9 @@ (login-args (tramp-get-method-parameter l-method 'tramp-login-args)) + (login-env + (tramp-get-method-parameter + l-method 'tramp-login-env)) (async-args (tramp-get-method-parameter l-method 'tramp-async-args)) @@ -4549,6 +4554,24 @@ tramp-current-user (or g-user l-user) tramp-current-host (or g-host l-host)) + ;; Add login environment. + (when login-env + (setq + login-env + (mapcar + (lambda (x) + (setq x (mapcar (lambda (y) (format-spec y spec)) x)) + (unless (member "" x) (mapconcat 'identity x " "))) + login-env)) + (while login-env + (setq command + (format + "%s=%s %s" + (pop login-env) + (tramp-shell-quote-argument (pop login-env)) + command))) + (setq command (concat "env " command))) + ;; Replace `login-args' place holders. (setq l-host (or l-host "") === modified file 'lisp/net/tramp.el' --- lisp/net/tramp.el 2014-03-17 09:28:47 +0000 +++ lisp/net/tramp.el 2014-03-21 13:02:25 +0000 @@ -230,6 +230,9 @@ `tramp-make-tramp-temp-file'. \"%k\" indicates the keep-date parameter of a program, if exists. \"%c\" adds additional `tramp-ssh-controlmaster-options' options for the first hop. + * `tramp-login-env' + A list of environment variables and their values, which will + be set when calling `tramp-login-program'. * `tramp-async-args' When an asynchronous process is started, we know already that the connection works. Therefore, we can pass additional @@ -242,6 +245,9 @@ * `tramp-copy-args' This specifies the list of parameters to pass to the above mentioned program, the hints for `tramp-login-args' also apply here. + * `tramp-copy-env' + A list of environment variables and their values, which will + be set when calling `tramp-copy-program'. * `tramp-copy-keep-date' This specifies whether the copying program when the preserves the timestamp of the original file. === modified file 'lisp/nxml/nxml-enc.el' --- lisp/nxml/nxml-enc.el 2014-01-01 07:43:34 +0000 +++ lisp/nxml/nxml-enc.el 2014-03-21 06:56:55 +0000 @@ -3,7 +3,7 @@ ;; Copyright (C) 2003, 2007-2014 Free Software Foundation, Inc. ;; Author: James Clark -;; Keywords: XML +;; Keywords: wp, hypermedia, languages, XML ;; This file is part of GNU Emacs. === modified file 'lisp/nxml/nxml-glyph.el' --- lisp/nxml/nxml-glyph.el 2014-01-01 07:43:34 +0000 +++ lisp/nxml/nxml-glyph.el 2014-03-21 06:56:55 +0000 @@ -3,7 +3,7 @@ ;; Copyright (C) 2003, 2007-2014 Free Software Foundation, Inc. ;; Author: James Clark -;; Keywords: XML +;; Keywords: wp, hypermedia, languages, XML ;; This file is part of GNU Emacs. === modified file 'lisp/nxml/nxml-maint.el' --- lisp/nxml/nxml-maint.el 2014-01-01 07:43:34 +0000 +++ lisp/nxml/nxml-maint.el 2014-03-21 06:56:55 +0000 @@ -3,7 +3,7 @@ ;; Copyright (C) 2003, 2007-2014 Free Software Foundation, Inc. ;; Author: James Clark -;; Keywords: XML +;; Keywords: wp, hypermedia, languages, XML ;; This file is part of GNU Emacs. === modified file 'lisp/nxml/nxml-mode.el' --- lisp/nxml/nxml-mode.el 2014-01-25 19:15:42 +0000 +++ lisp/nxml/nxml-mode.el 2014-03-21 06:56:55 +0000 @@ -3,7 +3,7 @@ ;; Copyright (C) 2003-2004, 2007-2014 Free Software Foundation, Inc. ;; Author: James Clark -;; Keywords: XML +;; Keywords: wp, hypermedia, languages, XML ;; This file is part of GNU Emacs. === modified file 'lisp/nxml/nxml-ns.el' --- lisp/nxml/nxml-ns.el 2014-01-01 07:43:34 +0000 +++ lisp/nxml/nxml-ns.el 2014-03-21 06:56:55 +0000 @@ -3,7 +3,7 @@ ;; Copyright (C) 2003, 2007-2014 Free Software Foundation, Inc. ;; Author: James Clark -;; Keywords: XML +;; Keywords: wp, hypermedia, languages, XML ;; This file is part of GNU Emacs. === modified file 'lisp/nxml/nxml-outln.el' --- lisp/nxml/nxml-outln.el 2014-01-01 07:43:34 +0000 +++ lisp/nxml/nxml-outln.el 2014-03-21 06:56:55 +0000 @@ -3,7 +3,7 @@ ;; Copyright (C) 2004, 2007-2014 Free Software Foundation, Inc. ;; Author: James Clark -;; Keywords: XML +;; Keywords: wp, hypermedia, languages, XML ;; This file is part of GNU Emacs. === modified file 'lisp/nxml/nxml-parse.el' --- lisp/nxml/nxml-parse.el 2014-01-01 07:43:34 +0000 +++ lisp/nxml/nxml-parse.el 2014-03-21 06:56:55 +0000 @@ -3,7 +3,7 @@ ;; Copyright (C) 2003, 2007-2014 Free Software Foundation, Inc. ;; Author: James Clark -;; Keywords: XML +;; Keywords: wp, hypermedia, languages, XML ;; This file is part of GNU Emacs. === modified file 'lisp/nxml/nxml-rap.el' --- lisp/nxml/nxml-rap.el 2014-01-01 07:43:34 +0000 +++ lisp/nxml/nxml-rap.el 2014-03-21 06:56:55 +0000 @@ -3,7 +3,7 @@ ;; Copyright (C) 2003-2004, 2007-2014 Free Software Foundation, Inc. ;; Author: James Clark -;; Keywords: XML +;; Keywords: wp, hypermedia, languages, XML ;; This file is part of GNU Emacs. === modified file 'lisp/nxml/nxml-uchnm.el' --- lisp/nxml/nxml-uchnm.el 2014-01-01 07:43:34 +0000 +++ lisp/nxml/nxml-uchnm.el 2014-03-21 06:56:55 +0000 @@ -3,7 +3,7 @@ ;; Copyright (C) 2003, 2007-2014 Free Software Foundation, Inc. ;; Author: James Clark -;; Keywords: XML +;; Keywords: wp, hypermedia, languages, XML ;; This file is part of GNU Emacs. === modified file 'lisp/nxml/nxml-util.el' --- lisp/nxml/nxml-util.el 2014-01-01 07:43:34 +0000 +++ lisp/nxml/nxml-util.el 2014-03-21 06:56:55 +0000 @@ -3,7 +3,7 @@ ;; Copyright (C) 2003, 2007-2014 Free Software Foundation, Inc. ;; Author: James Clark -;; Keywords: XML +;; Keywords: wp, hypermedia, languages, XML ;; This file is part of GNU Emacs. === modified file 'lisp/nxml/rng-cmpct.el' --- lisp/nxml/rng-cmpct.el 2014-01-01 07:43:34 +0000 +++ lisp/nxml/rng-cmpct.el 2014-03-21 06:56:55 +0000 @@ -3,7 +3,7 @@ ;; Copyright (C) 2003, 2007-2014 Free Software Foundation, Inc. ;; Author: James Clark -;; Keywords: XML, RelaxNG +;; Keywords: wp, hypermedia, languages, XML, RelaxNG ;; This file is part of GNU Emacs. === modified file 'lisp/nxml/rng-dt.el' --- lisp/nxml/rng-dt.el 2014-01-01 07:43:34 +0000 +++ lisp/nxml/rng-dt.el 2014-03-21 06:56:55 +0000 @@ -3,7 +3,7 @@ ;; Copyright (C) 2003, 2007-2014 Free Software Foundation, Inc. ;; Author: James Clark -;; Keywords: XML, RelaxNG +;; Keywords: wp, hypermedia, languages, XML, RelaxNG ;; This file is part of GNU Emacs. === modified file 'lisp/nxml/rng-loc.el' --- lisp/nxml/rng-loc.el 2014-01-01 07:43:34 +0000 +++ lisp/nxml/rng-loc.el 2014-03-21 06:56:55 +0000 @@ -3,7 +3,7 @@ ;; Copyright (C) 2003, 2007-2014 Free Software Foundation, Inc. ;; Author: James Clark -;; Keywords: XML, RelaxNG +;; Keywords: wp, hypermedia, languages, XML, RelaxNG ;; This file is part of GNU Emacs. === modified file 'lisp/nxml/rng-maint.el' --- lisp/nxml/rng-maint.el 2014-01-01 07:43:34 +0000 +++ lisp/nxml/rng-maint.el 2014-03-21 06:56:55 +0000 @@ -3,7 +3,7 @@ ;; Copyright (C) 2003, 2007-2014 Free Software Foundation, Inc. ;; Author: James Clark -;; Keywords: XML, RelaxNG +;; Keywords: wp, hypermedia, languages, XML, RelaxNG ;; This file is part of GNU Emacs. === modified file 'lisp/nxml/rng-match.el' --- lisp/nxml/rng-match.el 2014-01-01 07:43:34 +0000 +++ lisp/nxml/rng-match.el 2014-03-21 06:56:55 +0000 @@ -3,7 +3,7 @@ ;; Copyright (C) 2003, 2007-2014 Free Software Foundation, Inc. ;; Author: James Clark -;; Keywords: XML, RelaxNG +;; Keywords: wp, hypermedia, languages, XML, RelaxNG ;; This file is part of GNU Emacs. === modified file 'lisp/nxml/rng-nxml.el' --- lisp/nxml/rng-nxml.el 2014-01-01 07:43:34 +0000 +++ lisp/nxml/rng-nxml.el 2014-03-21 06:56:55 +0000 @@ -3,7 +3,7 @@ ;; Copyright (C) 2003, 2007-2014 Free Software Foundation, Inc. ;; Author: James Clark -;; Keywords: XML, RelaxNG +;; Keywords: wp, hypermedia, languages, XML, RelaxNG ;; This file is part of GNU Emacs. === modified file 'lisp/nxml/rng-parse.el' --- lisp/nxml/rng-parse.el 2014-01-01 07:43:34 +0000 +++ lisp/nxml/rng-parse.el 2014-03-21 06:56:55 +0000 @@ -3,7 +3,7 @@ ;; Copyright (C) 2003, 2007-2014 Free Software Foundation, Inc. ;; Author: James Clark -;; Keywords: XML, RelaxNG +;; Keywords: wp, hypermedia, languages, XML, RelaxNG ;; This file is part of GNU Emacs. === modified file 'lisp/nxml/rng-pttrn.el' --- lisp/nxml/rng-pttrn.el 2014-01-01 07:43:34 +0000 +++ lisp/nxml/rng-pttrn.el 2014-03-21 06:56:55 +0000 @@ -3,7 +3,7 @@ ;; Copyright (C) 2003, 2007-2014 Free Software Foundation, Inc. ;; Author: James Clark -;; Keywords: XML, RelaxNG +;; Keywords: wp, hypermedia, languages, XML, RelaxNG ;; This file is part of GNU Emacs. === modified file 'lisp/nxml/rng-uri.el' --- lisp/nxml/rng-uri.el 2014-01-01 07:43:34 +0000 +++ lisp/nxml/rng-uri.el 2014-03-21 06:56:55 +0000 @@ -3,7 +3,7 @@ ;; Copyright (C) 2003, 2007-2014 Free Software Foundation, Inc. ;; Author: James Clark -;; Keywords: XML +;; Keywords: wp, hypermedia, languages, XML ;; This file is part of GNU Emacs. === modified file 'lisp/nxml/rng-util.el' --- lisp/nxml/rng-util.el 2014-01-01 07:43:34 +0000 +++ lisp/nxml/rng-util.el 2014-03-21 06:56:55 +0000 @@ -3,7 +3,7 @@ ;; Copyright (C) 2003, 2007-2014 Free Software Foundation, Inc. ;; Author: James Clark -;; Keywords: XML, RelaxNG +;; Keywords: wp, hypermedia, languages, XML, RelaxNG ;; This file is part of GNU Emacs. === modified file 'lisp/nxml/rng-valid.el' --- lisp/nxml/rng-valid.el 2014-01-01 07:43:34 +0000 +++ lisp/nxml/rng-valid.el 2014-03-21 06:56:55 +0000 @@ -3,7 +3,7 @@ ;; Copyright (C) 2003, 2007-2014 Free Software Foundation, Inc. ;; Author: James Clark -;; Keywords: XML, RelaxNG +;; Keywords: wp, hypermedia, languages, XML, RelaxNG ;; This file is part of GNU Emacs. === modified file 'lisp/nxml/rng-xsd.el' --- lisp/nxml/rng-xsd.el 2014-01-01 07:43:34 +0000 +++ lisp/nxml/rng-xsd.el 2014-03-21 06:56:55 +0000 @@ -3,7 +3,7 @@ ;; Copyright (C) 2003, 2007-2014 Free Software Foundation, Inc. ;; Author: James Clark -;; Keywords: XML, RelaxNG +;; Keywords: wp, hypermedia, languages, XML, RelaxNG ;; This file is part of GNU Emacs. === modified file 'lisp/nxml/xmltok.el' --- lisp/nxml/xmltok.el 2014-01-01 07:43:34 +0000 +++ lisp/nxml/xmltok.el 2014-03-21 06:56:55 +0000 @@ -3,7 +3,7 @@ ;; Copyright (C) 2003, 2007-2014 Free Software Foundation, Inc. ;; Author: James Clark -;; Keywords: XML +;; Keywords: wp, hypermedia, languages, XML ;; This file is part of GNU Emacs. === modified file 'lisp/nxml/xsd-regexp.el' --- lisp/nxml/xsd-regexp.el 2014-01-01 07:43:34 +0000 +++ lisp/nxml/xsd-regexp.el 2014-03-21 06:56:55 +0000 @@ -3,7 +3,7 @@ ;; Copyright (C) 2003, 2007-2014 Free Software Foundation, Inc. ;; Author: James Clark -;; Keywords: XML, regexp +;; Keywords: wp, hypermedia, languages, XML, regexp ;; This file is part of GNU Emacs. === modified file 'lisp/progmodes/ruby-mode.el' --- lisp/progmodes/ruby-mode.el 2014-03-13 13:37:27 +0000 +++ lisp/progmodes/ruby-mode.el 2014-03-21 04:26:39 +0000 @@ -650,6 +650,10 @@ ;; because we want to reject hanging tokens at bol, too. (unless (or (eolp) (forward-comment 1)) (cons 'column (current-column))))) + (`(:before . " @ ") + (save-excursion + (skip-chars-forward " \t") + (cons 'column (current-column)))) (`(:before . "do") (ruby-smie--indent-to-stmt)) (`(:before . ".") (if (smie-rule-sibling-p) === modified file 'lisp/server.el' --- lisp/server.el 2014-02-10 01:34:22 +0000 +++ lisp/server.el 2014-03-21 01:12:57 +0000 @@ -104,10 +104,10 @@ "The name or IP address to use as host address of the server process. If set, the server accepts remote connections; otherwise it is local. -DO NOT give this a non-nil value unless you know what you are -doing! On unsecured networks, accepting remote connections is -very dangerous, because server-client communication (including -session authentication) is not encrypted." +DO NOT give this a non-nil value unless you know what you are doing! +On unsecured networks, accepting remote connections is very dangerous, +because server-client communication (including session authentication) +is not encrypted." :group 'server :type '(choice (string :tag "Name or IP address") @@ -1634,7 +1634,7 @@ (define-key ctl-x-map "#" 'server-edit) (defun server-unload-function () - "Unload the server library." + "Unload the Server library." (server-mode -1) (substitute-key-definition 'server-edit nil ctl-x-map) (save-current-buffer @@ -1648,7 +1648,7 @@ "Contact the Emacs server named SERVER and evaluate FORM there. Returns the result of the evaluation, or signals an error if it cannot contact the specified server. For example: - \(server-eval-at \"server\" '(emacs-pid)) + (server-eval-at \"server\" '(emacs-pid)) returns the process ID of the Emacs instance running \"server\"." (let* ((server-dir (if server-use-tcp server-auth-dir server-socket-dir)) (server-file (expand-file-name server server-dir)) === modified file 'lisp/skeleton.el' --- lisp/skeleton.el 2014-03-20 18:13:16 +0000 +++ lisp/skeleton.el 2014-03-21 19:04:57 +0000 @@ -180,7 +180,7 @@ With optional second argument REGIONS, wrap first interesting point \(`_') in skeleton around next REGIONS words, if REGIONS is positive. If REGIONS is negative, wrap REGIONS preceding interregions into first -REGIONS interesting positions \(successive `_'s) in skeleton. +REGIONS interesting positions (successive `_'s) in skeleton. An interregion is the stretch of text between two contiguous marked points. If you marked A B C [] (where [] is the cursor) in @@ -205,21 +205,21 @@ @ add position to `skeleton-positions' & do next ELEMENT if previous moved point | do next ELEMENT if previous didn't move point - -num delete num preceding characters (see `skeleton-untabify') + -NUM delete NUM preceding characters (see `skeleton-untabify') resume: skipped, continue here if quit is signaled nil skipped After termination, point will be positioned at the last occurrence of - or at the first occurrence of _ or at the end of the inserted text. -Further elements can be defined via `skeleton-further-elements'. ELEMENT may -itself be a SKELETON with an INTERACTOR. The user is prompted repeatedly for -different inputs. The SKELETON is processed as often as the user enters a -non-empty string. \\[keyboard-quit] terminates skeleton insertion, but -continues after `resume:' and positions at `_' if any. If INTERACTOR in such -a subskeleton is a prompt-string which contains a \".. %s ..\" it is -formatted with `skeleton-subprompt'. Such an INTERACTOR may also be a list of -strings with the subskeleton being repeated once for each string. +Further elements can be defined via `skeleton-further-elements'. +ELEMENT may itself be a SKELETON with an INTERACTOR. The user is prompted +repeatedly for different inputs. The SKELETON is processed as often as +the user enters a non-empty string. \\[keyboard-quit] terminates skeleton insertion, but +continues after `resume:' and positions at `_' if any. If INTERACTOR in +such a subskeleton is a prompt-string which contains a \".. %s ..\" it is +formatted with `skeleton-subprompt'. Such an INTERACTOR may also be a list +of strings with the subskeleton being repeated once for each string. Quoted Lisp expressions are evaluated for their side-effects. Other Lisp expressions are evaluated and the value treated as above. === modified file 'lisp/term/tty-colors.el' --- lisp/term/tty-colors.el 2014-02-10 01:34:22 +0000 +++ lisp/term/tty-colors.el 2014-03-21 01:12:57 +0000 @@ -771,7 +771,7 @@ "Return an alist of colors supported by FRAME's terminal. FRAME defaults to the selected frame. Each element of the returned alist is of the form: - \(NAME INDEX R G B\) + (NAME INDEX R G B) where NAME is the name of the color, a string; INDEX is the index of this color to be sent to the terminal driver when the color should be displayed; it is typically a small integer; @@ -785,10 +785,10 @@ (defun tty-modify-color-alist (elt &optional frame) "Put the association ELT into the alist of terminal colors for FRAME. -ELT should be of the form \(NAME INDEX R G B\) (see `tty-color-alist' +ELT should be of the form (NAME INDEX R G B) (see `tty-color-alist' for details). If the association for NAME already exists in the color alist, it is -modified to specify \(INDEX R G B\) as its cdr. Otherwise, ELT is +modified to specify (INDEX R G B) as its cdr. Otherwise, ELT is appended to the end of the color alist. If FRAME is unspecified or nil, it defaults to the selected frame. Value is the modified color alist for FRAME." @@ -856,7 +856,7 @@ (defun tty-color-approximate (rgb &optional frame) "Find the color in `tty-color-alist' that best approximates RGB. -Value is a list of the form \(NAME INDEX R G B\). +Value is a list of the form (NAME INDEX R G B). The argument RGB should be an rgb value, that is, a list of three integers in the 0..65535 range. FRAME defaults to the selected frame." @@ -981,7 +981,7 @@ "Given a numeric index of a tty color, return its description. FRAME, if unspecified or nil, defaults to the selected frame. -Value is a list of the form \(NAME INDEX R G B\)." +Value is a list of the form (NAME INDEX R G B)." (and idx (let ((colors (tty-color-alist frame)) desc found) @@ -997,14 +997,14 @@ If COLOR is not directly supported by the display, return the RGB values for a supported color that is its best approximation. -The value is a list of integer RGB values--\(RED GREEN BLUE\). +The value is a list of integer RGB values--(RED GREEN BLUE). These values range from 0 to 65535; white is (65535 65535 65535). If FRAME is omitted or nil, use the selected frame." (cddr (tty-color-desc color frame))) (defun tty-color-desc (color &optional frame) "Return the description of the color COLOR for a character terminal. -Value is a list of the form \(NAME INDEX R G B\). The returned NAME or +Value is a list of the form (NAME INDEX R G B). The returned NAME or RGB value may not be the same as the argument COLOR, because the latter might need to be approximated if it is not supported directly." (and (stringp color) === modified file 'src/ChangeLog' --- src/ChangeLog 2014-03-21 17:04:50 +0000 +++ src/ChangeLog 2014-03-21 19:04:57 +0000 @@ -1,3 +1,15 @@ +2014-03-21 YAMAMOTO Mitsuharu + + Fix regression introduced by patch for Bug#10500. + * xterm.c (x_draw_image_relief): Respect Vtool_bar_button_margin. + * w32term.c (x_draw_image_relief): Likewise. + +2014-03-21 Martin Rudalics + + * w32fns.c (w32_wnd_proc): For WM_WINDOWPOSCHANGING don't + constrain frame size in SW_SHOWMAXIMIZED case so we can truly + maximize a frame for odd default fonts. + 2014-03-21 Glenn Morris * minibuf.c (history-length): Increase default from 30 to 100. === modified file 'src/w32fns.c' --- src/w32fns.c 2014-03-21 08:51:02 +0000 +++ src/w32fns.c 2014-03-21 19:04:57 +0000 @@ -3805,7 +3805,8 @@ wp.length = sizeof (WINDOWPLACEMENT); GetWindowPlacement (hwnd, &wp); - if (wp.showCmd != SW_SHOWMINIMIZED && (lppos->flags & SWP_NOSIZE) == 0) + if (wp.showCmd != SW_SHOWMAXIMIZED && wp.showCmd != SW_SHOWMINIMIZED + && (lppos->flags & SWP_NOSIZE) == 0) { RECT rect; int wdiff; === modified file 'src/w32term.c' --- src/w32term.c 2014-03-14 10:38:46 +0000 +++ src/w32term.c 2014-03-21 10:14:10 +0000 @@ -1892,6 +1892,7 @@ x_draw_image_relief (struct glyph_string *s) { int x1, y1, thick, raised_p, top_p, bot_p, left_p, right_p; + int extra_x, extra_y; RECT r; int x = s->x; int y = s->ybase - image_ascent (s->img, s->face, &s->slice); @@ -1925,16 +1926,31 @@ x1 = x + s->slice.width - 1; y1 = y + s->slice.height - 1; + + extra_x = extra_y = 0; + if (s->face->id == TOOL_BAR_FACE_ID) + { + if (CONSP (Vtool_bar_button_margin) + && INTEGERP (XCAR (Vtool_bar_button_margin)) + && INTEGERP (XCDR (Vtool_bar_button_margin))) + { + extra_x = XINT (XCAR (Vtool_bar_button_margin)); + extra_y = XINT (XCDR (Vtool_bar_button_margin)); + } + else if (INTEGERP (Vtool_bar_button_margin)) + extra_x = extra_y = XINT (Vtool_bar_button_margin); + } + top_p = bot_p = left_p = right_p = 0; if (s->slice.x == 0) - x -= thick, left_p = 1; + x -= thick + extra_x, left_p = 1; if (s->slice.y == 0) - y -= thick, top_p = 1; + y -= thick + extra_y, top_p = 1; if (s->slice.x + s->slice.width == s->img->width) - x1 += thick, right_p = 1; + x1 += thick + extra_x, right_p = 1; if (s->slice.y + s->slice.height == s->img->height) - y1 += thick, bot_p = 1; + y1 += thick + extra_y, bot_p = 1; x_setup_relief_colors (s); get_glyph_string_clip_rect (s, &r); @@ -5651,21 +5667,11 @@ if (!frame_resize_pixelwise) { /* If we don't resize frames pixelwise, round sizes to multiples - of character sizes. Otherwise, Windows may clip our frame - rectangle at a character size boundary and we risk losing our - mode line. Bug#16923 might be a consequence of this. - - So far, this is a Windows specific problem; other toolkits may - prefer to not resize the frame if the delta is not large enough - (GTK) or resize the frame pixelwise as requested (Lucid, - Motif). Windows just doesn't call us back (probably because of - the size hint settings which it apparently interprets strictly) - neither when the user tries to mouse-drag a frame border by, - nor when calling `set-frame-size' with a delta of less than the - canonical character size. If w32_enable_frame_resize_hack is - enabled (which it now is by default) we'd then below resize the - frame's root window in preparation of a WM_SIZE message to come - which, however, is not going to happen. */ + of character sizes here. Otherwise, when enforcing size hints + while processing WM_WINDOWPOSCHANGING in w32_wnd_proc, we might + clip our frame rectangle to a multiple of the frame's character + size and subsequently lose our mode line or scroll bar. + Bug#16923 could be one possible consequence of this. */ int unit_width = FRAME_COLUMN_WIDTH (f); int unit_height = FRAME_LINE_HEIGHT (f); @@ -5695,9 +5701,7 @@ } /* If w32_enable_frame_resize_hack is non-nil, immediately apply the - new pixel sizes to the frame and its subwindows. This approach is - fragile because Windows might not honor the resize request issued - by my_set_window_pos with a WM_SIZE message (see previous comment). + new pixel sizes to the frame and its subwindows. Jason Rumney earlier refused to call change_frame_size right here with the following argument: === modified file 'src/xterm.c' --- src/xterm.c 2014-03-21 12:10:23 +0000 +++ src/xterm.c 2014-03-21 19:04:57 +0000 @@ -2162,6 +2162,7 @@ x_draw_image_relief (struct glyph_string *s) { int x1, y1, thick, raised_p, top_p, bot_p, left_p, right_p; + int extra_x, extra_y; XRectangle r; int x = s->x; int y = s->ybase - image_ascent (s->img, s->face, &s->slice); @@ -2194,16 +2195,31 @@ x1 = x + s->slice.width - 1; y1 = y + s->slice.height - 1; + + extra_x = extra_y = 0; + if (s->face->id == TOOL_BAR_FACE_ID) + { + if (CONSP (Vtool_bar_button_margin) + && INTEGERP (XCAR (Vtool_bar_button_margin)) + && INTEGERP (XCDR (Vtool_bar_button_margin))) + { + extra_x = XINT (XCAR (Vtool_bar_button_margin)); + extra_y = XINT (XCDR (Vtool_bar_button_margin)); + } + else if (INTEGERP (Vtool_bar_button_margin)) + extra_x = extra_y = XINT (Vtool_bar_button_margin); + } + top_p = bot_p = left_p = right_p = 0; if (s->slice.x == 0) - x -= thick, left_p = 1; + x -= thick + extra_x, left_p = 1; if (s->slice.y == 0) - y -= thick, top_p = 1; + y -= thick + extra_y, top_p = 1; if (s->slice.x + s->slice.width == s->img->width) - x1 += thick, right_p = 1; + x1 += thick + extra_x, right_p = 1; if (s->slice.y + s->slice.height == s->img->height) - y1 += thick, bot_p = 1; + y1 += thick + extra_y, bot_p = 1; x_setup_relief_colors (s); get_glyph_string_clip_rect (s, &r); === modified file 'test/automated/data/package/archive-contents' --- test/automated/data/package/archive-contents 2013-10-01 01:38:37 +0000 +++ test/automated/data/package/archive-contents 2014-03-21 06:06:52 +0000 @@ -6,6 +6,10 @@ (simple-depend . [(1 0) ((simple-single (1 3))) "A single-file package with a dependency." single]) + (simple-two-depend . + [(1 1) + ((simple-depend (1 0)) (simple-single (1 3))) + "A single-file package with two dependencies." single]) (multi-file . [(0 2 3) nil "Example of a multi-file tar package" tar === added file 'test/automated/data/package/simple-two-depend-1.1.el' --- test/automated/data/package/simple-two-depend-1.1.el 1970-01-01 00:00:00 +0000 +++ test/automated/data/package/simple-two-depend-1.1.el 2014-03-21 06:06:52 +0000 @@ -0,0 +1,17 @@ +;;; simple-two-depend.el --- A single-file package with two dependencies. + +;; Author: J. R. Hacker +;; Version: 1.1 +;; Keywords: frobnicate +;; Package-Requires: ((simple-depend "1.0") (simple-single "1.3")) + +;;; Commentary: + +;; Depends on two another packages. + +;;; Code: + +(defvar simple-two-depend "Value" + "Some trivial code") + +;;; simple-two-depend.el ends here === modified file 'test/automated/package-test.el' --- test/automated/package-test.el 2014-01-01 07:43:34 +0000 +++ test/automated/package-test.el 2014-03-21 06:06:52 +0000 @@ -203,12 +203,22 @@ (should (package-installed-p 'simple-single)) (should (package-installed-p 'simple-depend)))) +(ert-deftest package-test-install-two-dependencies () + "Install a package which includes a dependency." + (with-package-test () + (package-initialize) + (package-refresh-contents) + (package-install 'simple-two-depend) + (should (package-installed-p 'simple-single)) + (should (package-installed-p 'simple-depend)) + (should (package-installed-p 'simple-two-depend)))) + (ert-deftest package-test-refresh-contents () "Parse an \"archive-contents\" file." (with-package-test () (package-initialize) (package-refresh-contents) - (should (eq 3 (length package-archive-contents))))) + (should (eq 4 (length package-archive-contents))))) (ert-deftest package-test-install-single-from-archive () "Install a single package from a package archive." === modified file 'test/indent/ruby.rb' --- test/indent/ruby.rb 2014-03-01 22:04:59 +0000 +++ test/indent/ruby.rb 2014-03-21 04:26:39 +0000 @@ -379,3 +379,20 @@ 'd' => %w(e f) } } + +# Bug#17050 + +return render json: { + errors: { base: [message] }, + copying: copying + }, + status: 400 + +top test( + some, + top, + test) + +foo bar, { + tee: qux + } ------------------------------------------------------------ revno: 116830 committer: Glenn Morris branch nick: trunk timestamp: Fri 2014-03-21 13:04:50 -0400 message: Increase default history-length from 30 to 100 Ref: http://lists.gnu.org/archive/html/emacs-devel/2014-01/msg02008.html * lisp/cus-start.el (history-length): Bump :version. * src/minibuf.c (history-length): Increase default from 30 to 100. diff: === modified file 'etc/NEWS' --- etc/NEWS 2014-03-21 06:36:08 +0000 +++ etc/NEWS 2014-03-21 17:04:50 +0000 @@ -30,6 +30,9 @@ * Changes in Emacs 24.5 +--- +** The default value of `history-length' has increased to 100. + * Editing Changes in Emacs 24.5 === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2014-03-21 07:22:41 +0000 +++ lisp/ChangeLog 2014-03-21 17:04:50 +0000 @@ -1,5 +1,7 @@ 2014-03-21 Glenn Morris + * cus-start.el (history-length): Bump :version. + * Makefile.in ($(MH_E_DIR)/mh-loaddefs.el) ($(TRAMP_DIR)/tramp-loaddefs.el, $(CAL_DIR)/cal-loaddefs.el) ($(CAL_DIR)/diary-loaddefs.el, $(CAL_DIR)/hol-loaddefs.el): === modified file 'lisp/cus-start.el' --- lisp/cus-start.el 2014-01-01 07:43:34 +0000 +++ lisp/cus-start.el 2014-03-21 17:04:50 +0000 @@ -317,7 +317,7 @@ (enable-recursive-minibuffers minibuffer boolean) (history-length minibuffer (choice (const :tag "Infinite" t) integer) - "22.1") + "24.5") ; 30 -> 100 (history-delete-duplicates minibuffer boolean "22.1") (read-buffer-completion-ignore-case minibuffer boolean "23.1") === modified file 'src/ChangeLog' --- src/ChangeLog 2014-03-21 12:09:57 +0000 +++ src/ChangeLog 2014-03-21 17:04:50 +0000 @@ -1,3 +1,7 @@ +2014-03-21 Glenn Morris + + * minibuf.c (history-length): Increase default from 30 to 100. + 2014-03-21 Daniel Colascione * xterm.c (x_bitmap_icon): Stop reading the icon bitmap from disk === modified file 'src/minibuf.c' --- src/minibuf.c 2014-02-08 04:23:25 +0000 +++ src/minibuf.c 2014-03-21 17:04:50 +0000 @@ -1967,7 +1967,7 @@ This variable only affects history lists that don't specify their own maximum lengths. Setting the `history-length' property of a history variable overrides this default. */); - XSETFASTINT (Vhistory_length, 30); + XSETFASTINT (Vhistory_length, 100); DEFVAR_BOOL ("history-delete-duplicates", history_delete_duplicates, doc: /* Non-nil means to delete duplicates in history. ------------------------------------------------------------ revno: 116829 committer: Daniel Colascione branch nick: trunk timestamp: Fri 2014-03-21 05:10:23 -0700 message: Code for previous change diff: === modified file 'src/xterm.c' --- src/xterm.c 2014-03-20 14:09:37 +0000 +++ src/xterm.c 2014-03-21 12:10:23 +0000 @@ -7337,9 +7337,13 @@ #ifdef USE_GTK - if (xg_set_icon (f, xg_default_icon_file) - || xg_set_icon_from_xpm_data (f, gnu_xpm_bits)) - return 0; + if (FRAME_DISPLAY_INFO (f)->icon_bitmap_id == -2 + || xg_set_icon (f, xg_default_icon_file) + || xg_set_icon_from_xpm_data (f, gnu_xpm_bits)) + { + FRAME_DISPLAY_INFO (f)->icon_bitmap_id = -2; + return 0; + } #elif defined (HAVE_XPM) && defined (HAVE_X_WINDOWS) ------------------------------------------------------------ revno: 116828 committer: Daniel Colascione branch nick: trunk timestamp: Fri 2014-03-21 05:09:57 -0700 message: Frame icon optimization diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2014-03-21 10:13:38 +0000 +++ src/ChangeLog 2014-03-21 12:09:57 +0000 @@ -1,5 +1,8 @@ 2014-03-21 Daniel Colascione + * xterm.c (x_bitmap_icon): Stop reading the icon bitmap from disk + every time we switch to minibuffer. + * alloc.c (lisp_align_malloc, allocate_string_data) (allocate_vectorlike): Allow mmap allocation of lisp objects. (pointers_fit_in_lispobj_p,mmap_lisp_allowed_p): New functions. ------------------------------------------------------------ revno: 116827 committer: Daniel Colascione branch nick: trunk timestamp: Fri 2014-03-21 03:38:41 -0700 message: Move might_dump assignment earlier in initialization diff: === modified file 'src/emacs.c' --- src/emacs.c 2014-03-21 07:26:47 +0000 +++ src/emacs.c 2014-03-21 10:38:41 +0000 @@ -734,6 +734,10 @@ xputenv ("G_SLICE=always-malloc"); #endif +#ifndef CANNOT_DUMP + might_dump = !initialized; +#endif + #ifdef GNU_LINUX if (!initialized) { @@ -1634,10 +1638,6 @@ #endif #endif -#ifndef CANNOT_DUMP - might_dump = !initialized; -#endif - initialized = 1; #ifdef LOCALTIME_CACHE ------------------------------------------------------------ revno: 116826 [merge] committer: Daniel Colascione branch nick: trunk timestamp: Fri 2014-03-21 03:25:10 -0700 message: Allow lisp allocation via mmap in dumped emacs diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2014-03-21 08:51:02 +0000 +++ src/ChangeLog 2014-03-21 10:13:38 +0000 @@ -1,3 +1,9 @@ +2014-03-21 Daniel Colascione + + * alloc.c (lisp_align_malloc, allocate_string_data) + (allocate_vectorlike): Allow mmap allocation of lisp objects. + (pointers_fit_in_lispobj_p,mmap_lisp_allowed_p): New functions. + 2014-03-21 Eli Zaretskii * w32fns.c (Fw32_shell_execute) [!CYGWIN]: Use ShellExecuteEx, to === modified file 'src/alloc.c' --- src/alloc.c 2014-03-20 14:09:37 +0000 +++ src/alloc.c 2014-03-21 10:13:38 +0000 @@ -403,6 +403,23 @@ XFLOAT (f)->u.data = n; } +static bool +pointers_fit_in_lispobj_p (void) +{ + return (UINTPTR_MAX <= VAL_MAX) || USE_LSB_TAG; +} + +static bool +mmap_lisp_allowed_p (void) +{ + /* If we can't store all memory addresses in our lisp objects, it's + risky to let the heap use mmap and give us addresses from all + over our address space. We also can't use mmap for lisp objects + if we might dump: unexec doesn't preserve the contents of mmaped + regions. */ + return pointers_fit_in_lispobj_p () && !might_dump; +} + /************************************************************************ Malloc @@ -1073,10 +1090,8 @@ intptr_t aligned; /* int gets warning casting to 64-bit pointer. */ #ifdef DOUG_LEA_MALLOC - /* Prevent mmap'ing the chunk. Lisp data may not be mmap'ed - because mapped region contents are not preserved in - a dumped Emacs. */ - mallopt (M_MMAP_MAX, 0); + if (!mmap_lisp_allowed_p ()) + mallopt (M_MMAP_MAX, 0); #endif #ifdef USE_ALIGNED_ALLOC @@ -1097,8 +1112,8 @@ ((void **) abase)[-1] = base; #ifdef DOUG_LEA_MALLOC - /* Back to a reasonable maximum of mmap'ed areas. */ - mallopt (M_MMAP_MAX, MMAP_MAX_AREAS); + if (!mmap_lisp_allowed_p ()) + mallopt (M_MMAP_MAX, MMAP_MAX_AREAS); #endif #if ! USE_LSB_TAG @@ -1733,23 +1748,15 @@ size_t size = offsetof (struct sblock, data) + needed; #ifdef DOUG_LEA_MALLOC - /* Prevent mmap'ing the chunk. Lisp data may not be mmap'ed - because mapped region contents are not preserved in - a dumped Emacs. - - In case you think of allowing it in a dumped Emacs at the - cost of not being able to re-dump, there's another reason: - mmap'ed data typically have an address towards the top of the - address space, which won't fit into an EMACS_INT (at least on - 32-bit systems with the current tagging scheme). --fx */ - mallopt (M_MMAP_MAX, 0); + if (!mmap_lisp_allowed_p ()) + mallopt (M_MMAP_MAX, 0); #endif b = lisp_malloc (size + GC_STRING_EXTRA, MEM_TYPE_NON_LISP); #ifdef DOUG_LEA_MALLOC - /* Back to a reasonable maximum of mmap'ed areas. */ - mallopt (M_MMAP_MAX, MMAP_MAX_AREAS); + if (!mmap_lisp_allowed_p ()) + mallopt (M_MMAP_MAX, MMAP_MAX_AREAS); #endif b->next_free = b->data; @@ -3050,10 +3057,8 @@ size_t nbytes = header_size + len * word_size; #ifdef DOUG_LEA_MALLOC - /* Prevent mmap'ing the chunk. Lisp data may not be mmap'ed - because mapped region contents are not preserved in - a dumped Emacs. */ - mallopt (M_MMAP_MAX, 0); + if (!mmap_lisp_allowed_p ()) + mallopt (M_MMAP_MAX, 0); #endif if (nbytes <= VBLOCK_BYTES_MAX) @@ -3070,8 +3075,8 @@ } #ifdef DOUG_LEA_MALLOC - /* Back to a reasonable maximum of mmap'ed areas. */ - mallopt (M_MMAP_MAX, MMAP_MAX_AREAS); + if (!mmap_lisp_allowed_p ()) + mallopt (M_MMAP_MAX, MMAP_MAX_AREAS); #endif consing_since_gc += nbytes; ------------------------------------------------------------ revno: 116825 committer: Eli Zaretskii branch nick: trunk timestamp: Fri 2014-03-21 12:12:53 +0200 message: Bump trunk version to 24.4.50. modified files: ChangeLog README configure.ac doc/emacs/emacsver.texi doc/man/emacs.1 msdos/sed2v2.inp nt/config.nt nt/emacs.rc nt/emacsclient.rc nt/makefile.w32-in diff: === modified file 'ChangeLog' --- ChangeLog 2014-03-21 06:49:38 +0000 +++ ChangeLog 2014-03-21 10:12:53 +0000 @@ -1,3 +1,7 @@ +2014-03-21 Eli Zaretskii + + * configure.ac: Bump version to 24.4.50. + 2014-03-21 Glenn Morris * Makefile.in (all): Depend on `info'. (Bug#16626) === modified file 'README' --- README 2014-01-12 01:35:51 +0000 +++ README 2014-03-21 10:12:53 +0000 @@ -2,7 +2,7 @@ See the end of the file for license conditions. -This directory tree holds version 24.3.50 of GNU Emacs, the extensible, +This directory tree holds version 24.4.50 of GNU Emacs, the extensible, customizable, self-documenting real-time display editor. The file INSTALL in this directory says how to build and install GNU === modified file 'configure.ac' --- configure.ac 2014-03-05 20:35:38 +0000 +++ configure.ac 2014-03-21 10:12:53 +0000 @@ -22,7 +22,7 @@ dnl along with GNU Emacs. If not, see . AC_PREREQ(2.65) -AC_INIT(emacs, 24.3.50) +AC_INIT(emacs, 24.4.50) dnl We get MINGW64 with MSYS2 if test "x$MSYSTEM" = "xMINGW32" -o "x$MSYSTEM" = "xMINGW64" === modified file 'doc/emacs/emacsver.texi' --- doc/emacs/emacsver.texi 2013-03-05 03:59:35 +0000 +++ doc/emacs/emacsver.texi 2014-03-21 10:12:53 +0000 @@ -1,4 +1,4 @@ @c It would be nicer to generate this using configure and @version@. @c However, that would mean emacsver.texi would always be newer @c then the info files in release tarfiles. -@set EMACSVER 24.3.50 +@set EMACSVER 24.4.50 === modified file 'doc/man/emacs.1' --- doc/man/emacs.1 2014-01-12 01:35:51 +0000 +++ doc/man/emacs.1 2014-03-21 10:12:53 +0000 @@ -1,5 +1,5 @@ .\" See section COPYING for copyright and redistribution information. -.TH EMACS 1 "2007 April 13" "GNU Emacs 24.3.50" +.TH EMACS 1 "2007 April 13" "GNU Emacs 24.4.50" . . .SH NAME === modified file 'msdos/sed2v2.inp' --- msdos/sed2v2.inp 2014-01-01 08:31:29 +0000 +++ msdos/sed2v2.inp 2014-03-21 10:12:53 +0000 @@ -70,7 +70,7 @@ /^#undef PACKAGE_TARNAME/s/^.*$/#define PACKAGE_TARNAME ""/ /^#undef PACKAGE_VERSION/s/^.*$/#define PACKAGE_VERSION ""/ /^#undef PENDING_OUTPUT_COUNT/s/^.*$/#define PENDING_OUTPUT_COUNT(FILE) ((FILE)->_ptr - (FILE)->_base)/ -/^#undef VERSION/s/^.*$/#define VERSION "24.3.50"/ +/^#undef VERSION/s/^.*$/#define VERSION "24.4.50"/ /^#undef SYSTEM_TYPE/s/^.*$/#define SYSTEM_TYPE "ms-dos"/ /^#undef HAVE_DECL_GETENV/s/^.*$/#define HAVE_DECL_GETENV 1/ /^#undef SYS_SIGLIST_DECLARED/s/^.*$/#define SYS_SIGLIST_DECLARED 1/ === modified file 'nt/config.nt' --- nt/config.nt 2014-01-01 08:31:29 +0000 +++ nt/config.nt 2014-03-21 10:12:53 +0000 @@ -1576,7 +1576,7 @@ #undef USG_SUBTTY_WORKS /* Version number of package */ -#define VERSION "24.3.50" +#define VERSION "24.4.50" /* Define to 1 if unsetenv returns void instead of int. */ #undef VOID_UNSETENV === modified file 'nt/emacs.rc' --- nt/emacs.rc 2014-01-01 08:31:29 +0000 +++ nt/emacs.rc 2014-03-21 10:12:53 +0000 @@ -11,8 +11,8 @@ #endif VS_VERSION_INFO VERSIONINFO - FILEVERSION 24,3,50,0 - PRODUCTVERSION 24,3,50,0 + FILEVERSION 24,4,50,0 + PRODUCTVERSION 24,4,50,0 FILEFLAGSMASK 0x3FL #ifdef EMACSDEBUG FILEFLAGS 0x1L @@ -29,12 +29,12 @@ BEGIN VALUE "CompanyName", "Free Software Foundation\0" VALUE "FileDescription", "GNU Emacs: The extensible self-documenting text editor\0" - VALUE "FileVersion", "24, 3, 50, 0\0" + VALUE "FileVersion", "24, 4, 50, 0\0" VALUE "InternalName", "Emacs\0" VALUE "LegalCopyright", "Copyright (C) 2001-2014\0" VALUE "OriginalFilename", "emacs.exe" VALUE "ProductName", "Emacs\0" - VALUE "ProductVersion", "24, 3, 50, 0\0" + VALUE "ProductVersion", "24, 4, 50, 0\0" VALUE "OLESelfRegister", "\0" END END === modified file 'nt/emacsclient.rc' --- nt/emacsclient.rc 2014-01-01 08:31:29 +0000 +++ nt/emacsclient.rc 2014-03-21 10:12:53 +0000 @@ -5,8 +5,8 @@ #endif VS_VERSION_INFO VERSIONINFO - FILEVERSION 24,3,50,0 - PRODUCTVERSION 24,3,50,0 + FILEVERSION 24,4,50,0 + PRODUCTVERSION 24,4,50,0 FILEFLAGSMASK 0x3FL #ifdef EMACSDEBUG FILEFLAGS 0x1L @@ -23,12 +23,12 @@ BEGIN VALUE "CompanyName", "Free Software Foundation\0" VALUE "FileDescription", "GNU EmacsClient: Client for the extensible self-documenting text editor\0" - VALUE "FileVersion", "24, 3, 50, 0\0" + VALUE "FileVersion", "24, 4, 50, 0\0" VALUE "InternalName", "EmacsClient\0" VALUE "LegalCopyright", "Copyright (C) 2001-2014\0" VALUE "OriginalFilename", "emacsclientw.exe" VALUE "ProductName", "EmacsClient\0" - VALUE "ProductVersion", "24, 3, 50, 0\0" + VALUE "ProductVersion", "24, 4, 50, 0\0" VALUE "OLESelfRegister", "\0" END END === modified file 'nt/makefile.w32-in' --- nt/makefile.w32-in 2014-01-01 07:43:34 +0000 +++ nt/makefile.w32-in 2014-03-21 10:12:53 +0000 @@ -22,7 +22,7 @@ # FIXME: This file uses DOS EOLs. Convert to Unix after 22.1 is out # (and remove or replace this comment). -VERSION = 24.3.50 +VERSION = 24.4.50 TMP_DIST_DIR = emacs-$(VERSION) ------------------------------------------------------------ revno: 116824 committer: Eli Zaretskii branch nick: trunk timestamp: Fri 2014-03-21 10:51:02 +0200 message: Extend and improve w32-shell-execute on MS-Windows. src/w32fns.c (Fw32_shell_execute) [!CYGWIN]: Use ShellExecuteEx, to support more "verbs". diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2014-03-21 07:26:47 +0000 +++ src/ChangeLog 2014-03-21 08:51:02 +0000 @@ -1,3 +1,8 @@ +2014-03-21 Eli Zaretskii + + * w32fns.c (Fw32_shell_execute) [!CYGWIN]: Use ShellExecuteEx, to + support more "verbs". + 2014-03-21 Daniel Colascione Always prohibit dumping a dumped Emacs. === modified file 'src/w32fns.c' --- src/w32fns.c 2014-03-19 17:43:18 +0000 +++ src/w32fns.c 2014-03-21 08:51:02 +0000 @@ -6868,24 +6868,33 @@ specified DOCUMENT. \"find\" - initiate search starting from DOCUMENT, which must specify a directory. + \"delete\" - move DOCUMENT, a file or a directory, to Recycle Bin. + \"copy\" - copy DOCUMENT, which must be a file or a directory, into + the clipboard. + \"cut\" - move DOCUMENT, a file or a directory, into the clipboard. + \"paste\" - paste the file whose name is in the clipboard into DOCUMENT, + which must be a directory. + \"pastelink\" + - create a shortcut in DOCUMENT (which must be a directory) + the file or directory whose name is in the clipboard. \"runas\" - run DOCUMENT, which must be an excutable file, with elevated privileges (a.k.a. \"as Administrator\"). \"properties\" - - open the the property sheet dialog for DOCUMENT; works - for *.lnk desktop shortcuts, and little or nothing else. + - open the the property sheet dialog for DOCUMENT. nil - invoke the default OPERATION, or \"open\" if default is not defined or unavailable. DOCUMENT is typically the name of a document file or a URL, but can also be an executable program to run, or a directory to open in the -Windows Explorer. If it is a file, it must be a local one; this -function does not support remote file names. +Windows Explorer. If it is a file or a directory, it must be a local +one; this function does not support remote file names. If DOCUMENT is an executable program, the optional third arg PARAMETERS -can be a string containing command line parameters that will be passed -to the program. Some values of OPERATION also require parameters (e.g., -\"printto\" requires the printer address). Otherwise, PARAMETERS should -be nil or unspecified. +can be a string containing command line parameters, separated by blanks, +that will be passed to the program. Some values of OPERATION also require +parameters (e.g., \"printto\" requires the printer address). Otherwise, +PARAMETERS should be nil or unspecified. Note that double quote characters +in PARAMETERS must each be enclosed in 2 additional quotes, as in \"\"\". Optional fourth argument SHOW-FLAG can be used to control how the application will be displayed when it is invoked. If SHOW-FLAG is nil @@ -6908,6 +6917,7 @@ int use_unicode = w32_unicode_filenames; char *doc_a = NULL, *params_a = NULL, *ops_a = NULL; Lisp_Object absdoc, handler; + BOOL success; struct gcpro gcpro1; #endif @@ -6935,7 +6945,48 @@ GUI_SDATA (current_dir), (INTEGERP (show_flag) ? XINT (show_flag) : SW_SHOWDEFAULT)); + + if (result > 32) + return Qt; + + switch (result) + { + case SE_ERR_ACCESSDENIED: + errstr = w32_strerror (ERROR_ACCESS_DENIED); + break; + case SE_ERR_ASSOCINCOMPLETE: + case SE_ERR_NOASSOC: + errstr = w32_strerror (ERROR_NO_ASSOCIATION); + break; + case SE_ERR_DDEBUSY: + case SE_ERR_DDEFAIL: + errstr = w32_strerror (ERROR_DDE_FAIL); + break; + case SE_ERR_DDETIMEOUT: + errstr = w32_strerror (ERROR_TIMEOUT); + break; + case SE_ERR_DLLNOTFOUND: + errstr = w32_strerror (ERROR_DLL_NOT_FOUND); + break; + case SE_ERR_FNF: + errstr = w32_strerror (ERROR_FILE_NOT_FOUND); + break; + case SE_ERR_OOM: + errstr = w32_strerror (ERROR_NOT_ENOUGH_MEMORY); + break; + case SE_ERR_PNF: + errstr = w32_strerror (ERROR_PATH_NOT_FOUND); + break; + case SE_ERR_SHARE: + errstr = w32_strerror (ERROR_SHARING_VIOLATION); + break; + default: + errstr = w32_strerror (0); + break; + } + #else /* !CYGWIN */ + current_dir = ENCODE_FILE (current_dir); /* We have a situation here. If DOCUMENT is a relative file name, but its name includes leading directories, i.e. it lives not in @@ -6965,6 +7016,7 @@ if (use_unicode) { wchar_t document_w[MAX_PATH], current_dir_w[MAX_PATH]; + SHELLEXECUTEINFOW shexinfo_w; /* Encode filename, current directory and parameters, and convert operation to UTF-16. */ @@ -6998,14 +7050,28 @@ *d++ = *s++; *d = 0; } - result = (intptr_t) ShellExecuteW (NULL, ops_w, doc_w, params_w, - current_dir_w, - (INTEGERP (show_flag) - ? XINT (show_flag) : SW_SHOWDEFAULT)); + + /* Using ShellExecuteEx and setting the SEE_MASK_INVOKEIDLIST + flag succeeds with more OPERATIONs (a.k.a. "verbs"), as it is + able to invoke verbs from shortcut menu extensions, not just + static verbs listed in the Registry. */ + memset (&shexinfo_w, 0, sizeof (shexinfo_w)); + shexinfo_w.cbSize = sizeof (shexinfo_w); + shexinfo_w.fMask = + SEE_MASK_INVOKEIDLIST | SEE_MASK_FLAG_DDEWAIT | SEE_MASK_FLAG_NO_UI; + shexinfo_w.hwnd = NULL; + shexinfo_w.lpVerb = ops_w; + shexinfo_w.lpFile = doc_w; + shexinfo_w.lpParameters = params_w; + shexinfo_w.lpDirectory = current_dir_w; + shexinfo_w.nShow = + (INTEGERP (show_flag) ? XINT (show_flag) : SW_SHOWDEFAULT); + success = ShellExecuteExW (&shexinfo_w); } else { char document_a[MAX_PATH], current_dir_a[MAX_PATH]; + SHELLEXECUTEINFOA shexinfo_a; filename_to_ansi (SSDATA (current_dir), current_dir_a); filename_to_ansi (SSDATA (document), document_a); @@ -7020,51 +7086,27 @@ /* Assume OPERATION is pure ASCII. */ ops_a = SSDATA (operation); } - result = (intptr_t) ShellExecuteA (NULL, ops_a, doc_a, params_a, - current_dir_a, - (INTEGERP (show_flag) - ? XINT (show_flag) : SW_SHOWDEFAULT)); + memset (&shexinfo_a, 0, sizeof (shexinfo_a)); + shexinfo_a.cbSize = sizeof (shexinfo_a); + shexinfo_a.fMask = + SEE_MASK_INVOKEIDLIST | SEE_MASK_FLAG_DDEWAIT | SEE_MASK_FLAG_NO_UI; + shexinfo_a.hwnd = NULL; + shexinfo_a.lpVerb = ops_a; + shexinfo_a.lpFile = doc_a; + shexinfo_a.lpParameters = params_a; + shexinfo_a.lpDirectory = current_dir_a; + shexinfo_a.nShow = + (INTEGERP (show_flag) ? XINT (show_flag) : SW_SHOWDEFAULT); + success = ShellExecuteExA (&shexinfo_a); } + + if (success) + return Qt; + + errstr = w32_strerror (0); + #endif /* !CYGWIN */ - if (result > 32) - return Qt; - - switch (result) - { - case SE_ERR_ACCESSDENIED: - errstr = w32_strerror (ERROR_ACCESS_DENIED); - break; - case SE_ERR_ASSOCINCOMPLETE: - case SE_ERR_NOASSOC: - errstr = w32_strerror (ERROR_NO_ASSOCIATION); - break; - case SE_ERR_DDEBUSY: - case SE_ERR_DDEFAIL: - errstr = w32_strerror (ERROR_DDE_FAIL); - break; - case SE_ERR_DDETIMEOUT: - errstr = w32_strerror (ERROR_TIMEOUT); - break; - case SE_ERR_DLLNOTFOUND: - errstr = w32_strerror (ERROR_DLL_NOT_FOUND); - break; - case SE_ERR_FNF: - errstr = w32_strerror (ERROR_FILE_NOT_FOUND); - break; - case SE_ERR_OOM: - errstr = w32_strerror (ERROR_NOT_ENOUGH_MEMORY); - break; - case SE_ERR_PNF: - errstr = w32_strerror (ERROR_PATH_NOT_FOUND); - break; - case SE_ERR_SHARE: - errstr = w32_strerror (ERROR_SHARING_VIOLATION); - break; - default: - errstr = w32_strerror (0); - break; - } /* The error string might be encoded in the locale's encoding. */ if (!NILP (Vlocale_coding_system)) { ------------------------------------------------------------ revno: 116823 [merge] committer: Daniel Colascione branch nick: trunk timestamp: Fri 2014-03-21 00:27:26 -0700 message: Do not allow a dumped Emacs to be dumped diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2014-03-20 17:42:05 +0000 +++ src/ChangeLog 2014-03-21 07:26:47 +0000 @@ -1,3 +1,12 @@ +2014-03-21 Daniel Colascione + + Always prohibit dumping a dumped Emacs. + + * emacs.c (might_dump): New variable. + (Fdump_emacs): Always prohibit dumping of dumped Emacs. + * lisp.h (might_dump): Declare. + * unexcw.c (unexec): Remove now-redundant multiple-dump detection code. + 2014-03-20 Paul Eggert * doc.c (store_function_docstring): Fix pointer signedness mismatch. === modified file 'src/emacs.c' --- src/emacs.c 2014-02-17 21:20:44 +0000 +++ src/emacs.c 2014-03-21 07:26:47 +0000 @@ -121,6 +121,9 @@ on subsequent starts. */ bool initialized; +/* Set to true if this instance of Emacs might dump. */ +bool might_dump; + #ifdef DARWIN_OS extern void unexec_init_emacs_zone (void); #endif @@ -1631,6 +1634,10 @@ #endif #endif +#ifndef CANNOT_DUMP + might_dump = !initialized; +#endif + initialized = 1; #ifdef LOCALTIME_CACHE @@ -2082,6 +2089,9 @@ if (! noninteractive) error ("Dumping Emacs works only in batch mode"); + if (!might_dump) + error ("Emacs can be dumped only once"); + #ifdef GNU_LINUX /* Warn if the gap between BSS end and heap start is larger than this. */ === modified file 'src/lisp.h' --- src/lisp.h 2014-02-28 21:45:34 +0000 +++ src/lisp.h 2014-03-21 07:26:47 +0000 @@ -800,6 +800,7 @@ /* Defined in emacs.c. */ extern bool initialized; +extern bool might_dump; /* Defined in eval.c. */ extern Lisp_Object Qautoload; === modified file 'src/unexcw.c' --- src/unexcw.c 2014-01-01 07:43:34 +0000 +++ src/unexcw.c 2014-03-21 07:26:47 +0000 @@ -286,13 +286,6 @@ int ret; int ret2; - if (bss_sbrk_did_unexec) - { - /* can only dump once */ - printf ("You can only dump Emacs once on this platform.\n"); - return; - } - report_sheap_usage (1); infile = add_exe_suffix_if_necessary (infile, infile_buffer); ------------------------------------------------------------ revno: 116822 committer: Glenn Morris branch nick: trunk timestamp: Fri 2014-03-21 00:22:41 -0700 message: Don't set make-backup-files in lisp/Makefile loaddefs rules * lisp/Makefile.in ($(MH_E_DIR)/mh-loaddefs.el) ($(TRAMP_DIR)/tramp-loaddefs.el, $(CAL_DIR)/cal-loaddefs.el) ($(CAL_DIR)/diary-loaddefs.el, $(CAL_DIR)/hol-loaddefs.el): Don't set `make-backup-files'. It doesn't really matter either way, so we might as well not bother. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2014-03-21 07:14:08 +0000 +++ lisp/ChangeLog 2014-03-21 07:22:41 +0000 @@ -1,5 +1,10 @@ 2014-03-21 Glenn Morris + * Makefile.in ($(MH_E_DIR)/mh-loaddefs.el) + ($(TRAMP_DIR)/tramp-loaddefs.el, $(CAL_DIR)/cal-loaddefs.el) + ($(CAL_DIR)/diary-loaddefs.el, $(CAL_DIR)/hol-loaddefs.el): + Don't set `make-backup-files'. + * info.el (info--prettify-description): New function, to give info-finder descriptions consistent case, punctuation. (Info-finder-find-node): Use it. Sort packages. === modified file 'lisp/Makefile.in' --- lisp/Makefile.in 2014-03-14 17:54:12 +0000 +++ lisp/Makefile.in 2014-03-21 07:22:41 +0000 @@ -416,7 +416,6 @@ $(emacs) -l autoload \ --eval "(setq generate-autoload-cookie \";;;###mh-autoload\")" \ --eval "(setq generated-autoload-file (expand-file-name (unmsys--file-name \"$@\")))" \ - --eval "(setq make-backup-files nil)" \ -f batch-update-autoloads $(MH_E_DIR) # Update TRAMP internal autoloads. Maybe we could move tramp*.el into @@ -434,7 +433,6 @@ $(emacs) -l autoload \ --eval "(setq generate-autoload-cookie \";;;###tramp-autoload\")" \ --eval "(setq generated-autoload-file (expand-file-name (unmsys--file-name \"$@\")))" \ - --eval "(setq make-backup-files nil)" \ -f batch-update-autoloads $(TRAMP_DIR) CAL_DIR = $(lisp)/calendar @@ -456,21 +454,18 @@ $(emacs) -l autoload \ --eval "(setq generate-autoload-cookie \";;;###cal-autoload\")" \ --eval "(setq generated-autoload-file (expand-file-name (unmsys--file-name \"$@\")))" \ - --eval "(setq make-backup-files nil)" \ -f batch-update-autoloads $(CAL_DIR) $(CAL_DIR)/diary-loaddefs.el: $(CAL_SRC) $(emacs) -l autoload \ --eval "(setq generate-autoload-cookie \";;;###diary-autoload\")" \ --eval "(setq generated-autoload-file (expand-file-name (unmsys--file-name \"$@\")))" \ - --eval "(setq make-backup-files nil)" \ -f batch-update-autoloads $(CAL_DIR) $(CAL_DIR)/hol-loaddefs.el: $(CAL_SRC) $(emacs) -l autoload \ --eval "(setq generate-autoload-cookie \";;;###holiday-autoload\")" \ --eval "(setq generated-autoload-file (expand-file-name (unmsys--file-name \"$@\")))" \ - --eval "(setq make-backup-files nil)" \ -f batch-update-autoloads $(CAL_DIR) .PHONY: bootstrap-clean distclean maintainer-clean ------------------------------------------------------------ revno: 116821 committer: Glenn Morris branch nick: trunk timestamp: Fri 2014-03-21 00:14:08 -0700 message: Cosmetic tweaks for the output of `info-finder' * lisp/info.el (info--prettify-description): New function, to give info-finder descriptions consistent case, punctuation. (Info-finder-find-node): Use it. Sort packages. Refer to "description" rather than "commentary". diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2014-03-21 00:03:08 +0000 +++ lisp/ChangeLog 2014-03-21 07:14:08 +0000 @@ -1,3 +1,10 @@ +2014-03-21 Glenn Morris + + * info.el (info--prettify-description): New function, + to give info-finder descriptions consistent case, punctuation. + (Info-finder-find-node): Use it. Sort packages. + Refer to "description" rather than "commentary". + 2014-03-21 Juanma Barranquero * frameset.el (frameset--print-register): New function. === modified file 'lisp/info.el' --- lisp/info.el 2014-03-14 20:51:22 +0000 +++ lisp/info.el 2014-03-21 07:14:08 +0000 @@ -3633,6 +3633,18 @@ (defvar finder-keywords-hash) (defvar package--builtins) ; finder requires package +(defun info--prettify-description (desc) + (if (stringp desc) + (with-temp-buffer + (insert desc) + (if (equal ?. (char-before)) + (delete-char -1)) + (goto-char (point-min)) + (or (let (case-fold-search) (looking-at-p "\\.\\|[[:upper:]]")) + (capitalize-word 1)) + (buffer-string)) + desc)) + (defun Info-finder-find-node (_filename nodename &optional _no-going-back) "Finder-specific implementation of `Info-find-node-2'." (require 'finder) @@ -3651,7 +3663,7 @@ (insert (format "* %s %s.\n" (concat (symbol-name keyword) ": " "Keyword " (symbol-name keyword) ".") - (cdr assoc)))))) + (info--prettify-description (cdr assoc))))))) ((equal nodename "Keyword unknown") ;; Display unknown keywords (insert (format "\n\^_\nFile: %s, Node: %s, Up: Top\n\n" @@ -3679,7 +3691,7 @@ (when (vectorp desc) (insert (format "* %-16s %s.\n" (concat (symbol-name (car package)) "::") - (aref desc 2))))))) + (info--prettify-description (aref desc 2)))))))) ((string-match "\\`Keyword " nodename) (setq nodename (substring nodename (match-end 0))) ;; Display packages that match the keyword @@ -3700,27 +3712,31 @@ (push (copy-tree (gethash keyword finder-keywords-hash)) hits)) (setq hits (delete-dups (apply 'append hits)) ;; Not a meaningful package. - hits (delete 'emacs hits)) + hits (delete 'emacs hits) + hits (sort hits (lambda (a b) (string< (symbol-name a) + (symbol-name b))))) (dolist (package hits) (setq desc (cdr-safe (assq package package--builtins))) (when (vectorp desc) (insert (format "* %-16s %s.\n" (concat (symbol-name package) "::") - (aref desc 2))))))) + (info--prettify-description (aref desc 2)))))))) (t ;; Display commentary section (insert (format "\n\^_\nFile: %s, Node: %s, Up: Top\n\n" Info-finder-file nodename)) - (insert "Finder Commentary\n") - (insert "*****************\n\n") + (insert "Package Description\n") + (insert "*******************\n\n") (insert - "Commentary section of the package `" nodename "':\n\n") - ;; FIXME this assumes that a file named package.el exists, + "Description of the package `" nodename "':\n\n") + ;; This assumes that a file named package.el exists, ;; which is not always true. E.g. for the nxml package, ;; there is no "nxml.el" (it's nxml-mode.el). - (let ((str (lm-commentary (find-library-name nodename)))) + ;; But package.el makes the same assumption. + ;; I think nxml is the only exception - maybe it should be just be renamed. + (let ((str (ignore-errors (lm-commentary (find-library-name nodename))))) (if (null str) - (insert "Can't find any Commentary section\n\n") + (insert "Can't find package description.\n\n") (insert (with-temp-buffer (insert str) ------------------------------------------------------------ revno: 116820 fixes bug: http://debbugs.gnu.org/16626 committer: Glenn Morris branch nick: trunk timestamp: Thu 2014-03-20 23:49:38 -0700 message: * Makefile.in (all): Depend on `info'. diff: === modified file 'ChangeLog' --- ChangeLog 2014-03-07 18:57:11 +0000 +++ ChangeLog 2014-03-21 06:49:38 +0000 @@ -1,3 +1,7 @@ +2014-03-21 Glenn Morris + + * Makefile.in (all): Depend on `info'. (Bug#16626) + 2014-03-07 Paul Eggert Merge from gnulib, incorporating: === modified file 'Makefile.in' --- Makefile.in 2014-02-14 08:05:18 +0000 +++ Makefile.in 2014-03-21 06:49:38 +0000 @@ -288,7 +288,7 @@ COPYDIR = ${srcdir}/etc ${srcdir}/lisp COPYDESTS = "$(DESTDIR)${etcdir}" "$(DESTDIR)${lispdir}" -all: ${SUBDIR} +all: ${SUBDIR} info .PHONY: all ${SUBDIR} blessmail epaths-force epaths-force-w32 FRC ------------------------------------------------------------ revno: 116819 committer: Glenn Morris branch nick: trunk timestamp: Thu 2014-03-20 23:39:13 -0700 message: * admin/update_autogen: Auto-detect VCS in use. (vcs): New variable. (status, commit, main): Handle git. diff: === modified file 'admin/ChangeLog' --- admin/ChangeLog 2014-03-07 18:57:11 +0000 +++ admin/ChangeLog 2014-03-21 06:39:13 +0000 @@ -1,3 +1,9 @@ +2014-03-21 Glenn Morris + + * update_autogen: Auto-detect VCS in use. + (vcs): New variable. + (status, commit, main): Handle git. + 2014-03-07 Paul Eggert Fix oversight preventing lib/sys/types.h from being generated. === modified file 'admin/update_autogen' --- admin/update_autogen 2014-01-13 21:17:18 +0000 +++ admin/update_autogen 2014-03-21 06:39:13 +0000 @@ -47,6 +47,14 @@ cd ../ [ -d admin ] || die "Could not locate admin directory" +if [ -d .bzr ]; then + vcs=bzr +elif [ -d .git ]; then + vcs=git +else + die "Cannot determine vcs" +fi + usage () { @@ -143,7 +151,10 @@ ## Run status on inputs, list modified files on stdout. status () { - bzr status -S "$@" >| $tempfile || die "bzr status error for $@" + local statflag="-S" + [ "$vcs" = "git" ] && statflag="-s" + + $vcs status $statflag "$@" >| $tempfile || die "$vcs status error for $@" local stat file modified @@ -217,8 +228,11 @@ echo "Committing..." - ## bzr status output is always relative to top-level, not PWD. - bzr commit -m "Auto-commit of $type files." "$@" || return $? + $vcs commit -m "Auto-commit of $type files." "$@" || return $? + + [ "$vcs" = "git" ] && { + $vcs push || return $? + } echo "Committed files: $@" } # function commit @@ -257,7 +271,7 @@ *-xtra.texi|*efaq-w32.texi) continue ;; esac - dircat=`sed -n -e 's/@value{emacsname}/Emacs/' -e 's/^@dircategory //p' $file` + dircat=$(sed -n -e 's/@value{emacsname}/Emacs/' -e 's/^@dircategory //p' $file) ## TODO warn about unknown topics (check-info in top-level ## Makefile does this). @@ -291,7 +305,8 @@ modified=$(status $basegen) || die - cd $oldpwd + ## bzr status output is always relative to top-level, not PWD. + [ "$vcs" = "bzr" ] && cd $oldpwd commit "generated" $modified || die "commit error" @@ -364,7 +379,8 @@ modified=$(status $genfiles ${ldefs_out#lisp/}) || die -cd ../ +## bzr status output is always relative to top-level, not PWD. +[ "$vcs" = "bzr" ] && cd ../ commit "loaddefs" $modified || die "commit error" ------------------------------------------------------------ revno: 116818 committer: Glenn Morris branch nick: trunk timestamp: Thu 2014-03-20 23:36:08 -0700 message: * etc/NEWS: Add top-level headings for next release Not sure if it will be "24.5", but does not matter at the moment. diff: === modified file 'etc/NEWS' --- etc/NEWS 2014-03-18 21:17:05 +0000 +++ etc/NEWS 2014-03-21 06:36:08 +0000 @@ -22,6 +22,33 @@ otherwise leave it unmarked. +* Installation Changes in Emacs 24.5 + + +* Startup Changes in Emacs 24.5 + + +* Changes in Emacs 24.5 + + +* Editing Changes in Emacs 24.5 + + +* Changes in Specialized Modes and Packages in Emacs 24.5 + + +* New Modes and Packages in Emacs 24.5 + + +* Incompatible Lisp Changes in Emacs 24.5 + + +* Lisp Changes in Emacs 24.5 + + +* Changes in Emacs 24.5 on Non-Free Operating Systems + + * Installation Changes in Emacs 24.4 --- ------------------------------------------------------------ revno: 116817 committer: Juanma Barranquero branch nick: trunk timestamp: Fri 2014-03-21 01:03:08 +0100 message: lisp/frameset.el: Make list-registers a bit more informative. (frameset--print-register): New function. (frameset-to-register): Use it. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2014-03-20 18:22:17 +0000 +++ lisp/ChangeLog 2014-03-21 00:03:08 +0000 @@ -1,3 +1,8 @@ +2014-03-21 Juanma Barranquero + + * frameset.el (frameset--print-register): New function. + (frameset-to-register): Use it. + 2014-03-20 Juanma Barranquero * progmodes/hideif.el (hif-string-to-number): New function. === modified file 'lisp/frameset.el' --- lisp/frameset.el 2014-03-12 18:36:26 +0000 +++ lisp/frameset.el 2014-03-21 00:03:08 +0000 @@ -1272,6 +1272,17 @@ (with-current-buffer buffer (goto-char (aref data 2))))))) ;;;###autoload +(defun frameset--print-register (data) + "Print basic info about frameset stored in DATA. +Called from `list-registers' and `view-register'. Internal use only." + (let* ((fs (aref data 0)) + (ns (length (frameset-states fs)))) + (princ (format "a frameset (%d frame%s, saved on %s)." + ns + (if (= 1 ns) "" "s") + (format-time-string "%c" (frameset-timestamp fs)))))) + +;;;###autoload (defun frameset-to-register (register) "Store the current frameset in register REGISTER. Use \\[jump-to-register] to restore the frameset. @@ -1288,7 +1299,7 @@ ;; in the current buffer, so record that separately. (frameset-frame-id nil) (point-marker)) - :print-func (lambda (_data) (princ "a frameset.")) + :print-func #'frameset--print-register :jump-func #'frameset--jump-to-register))) (provide 'frameset) ------------------------------------------------------------ revno: 116816 committer: Juanma Barranquero branch nick: trunk timestamp: Thu 2014-03-20 19:22:17 +0100 message: lisp/progmodes/hideif.el (hif-tokenize): Understand non-decimal floats. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2014-03-20 18:16:47 +0000 +++ lisp/ChangeLog 2014-03-20 18:22:17 +0000 @@ -1,5 +1,8 @@ 2014-03-20 Juanma Barranquero + * progmodes/hideif.el (hif-string-to-number): New function. + (hif-tokenize): Use it to understand non-decimal floats. + * emacs-lisp/cl-extra.el (cl--map-overlays): Remove obsolete code. * skeleton.el (skeleton-autowrap): Mark as obsolete. Doc fix. === modified file 'lisp/progmodes/hideif.el' --- lisp/progmodes/hideif.el 2014-03-14 00:22:33 +0000 +++ lisp/progmodes/hideif.el 2014-03-20 18:22:17 +0000 @@ -407,6 +407,14 @@ (defconst hif-string-literal-regexp "\\(\"\\(?:[^\"\\]\\|\\\\.\\)*\"\\)") +(defun hif-string-to-number (string &optional base) + "Like `string-to-number', but it understands non-decimal floats." + (if (or (not base) (= base 10)) + (string-to-number string base) + (let* ((parts (split-string string "\\." t "[ \t]+")) + (frac (cadr parts)) + (quot (expt (* base 1.0) (length frac)))) + (/ (string-to-number (concat (car parts) frac) base) quot)))) (defun hif-tokenize (start end) "Separate string between START and END into a list of tokens." @@ -433,15 +441,12 @@ ;; TODO: ;; 1. postfix 'l', 'll', 'ul' and 'ull' ;; 2. floating number formats - ;; 3. hexadecimal/octal floats - ;; 4. 098 is interpreted as octal conversion error - ;; FIXME: string-to-number does not convert hex floats + ;; 3. 098 is interpreted as octal conversion error (if (string-match "0x\\([0-9a-fA-F]+\\.?[0-9a-fA-F]*\\)" token) - (string-to-number (match-string 1 token) 16)) ;; hex - ;; FIXME: string-to-number does not convert octal floats + (hif-string-to-number (match-string 1 token) 16)) ;; hex (if (string-match "\\`0[0-9]+\\(\\.[0-9]+\\)?\\'" token) - (string-to-number token 8)) ;; octal + (hif-string-to-number token 8)) ;; octal (if (string-match "\\`[1-9][0-9]*\\(\\.[0-9]+\\)?\\'" token) (string-to-number token)) ;; decimal ------------------------------------------------------------ revno: 116815 committer: Juanma Barranquero branch nick: trunk timestamp: Thu 2014-03-20 19:16:47 +0100 message: lisp/emacs-lisp/cl-extra.el (cl--map-overlays): Remove obsolete code. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2014-03-20 18:13:16 +0000 +++ lisp/ChangeLog 2014-03-20 18:16:47 +0000 @@ -1,5 +1,7 @@ 2014-03-20 Juanma Barranquero + * emacs-lisp/cl-extra.el (cl--map-overlays): Remove obsolete code. + * skeleton.el (skeleton-autowrap): Mark as obsolete. Doc fix. 2014-03-20 Stefan Monnier === modified file 'lisp/emacs-lisp/cl-extra.el' --- lisp/emacs-lisp/cl-extra.el 2014-01-01 07:43:34 +0000 +++ lisp/emacs-lisp/cl-extra.el 2014-03-20 18:16:47 +0000 @@ -269,43 +269,20 @@ ;;;###autoload (defun cl--map-overlays (cl-func &optional cl-buffer cl-start cl-end cl-arg) (or cl-buffer (setq cl-buffer (current-buffer))) - (if (fboundp 'overlay-lists) - - ;; This is the preferred algorithm, though overlay-lists is undocumented. - (let (cl-ovl) - (with-current-buffer cl-buffer - (setq cl-ovl (overlay-lists)) - (if cl-start (setq cl-start (copy-marker cl-start))) - (if cl-end (setq cl-end (copy-marker cl-end)))) - (setq cl-ovl (nconc (car cl-ovl) (cdr cl-ovl))) - (while (and cl-ovl - (or (not (overlay-start (car cl-ovl))) - (and cl-end (>= (overlay-start (car cl-ovl)) cl-end)) - (and cl-start (<= (overlay-end (car cl-ovl)) cl-start)) - (not (funcall cl-func (car cl-ovl) cl-arg)))) - (setq cl-ovl (cdr cl-ovl))) - (if cl-start (set-marker cl-start nil)) - (if cl-end (set-marker cl-end nil))) - - ;; This alternate algorithm fails to find zero-length overlays. - (let ((cl-mark (with-current-buffer cl-buffer - (copy-marker (or cl-start (point-min))))) - (cl-mark2 (and cl-end (with-current-buffer cl-buffer - (copy-marker cl-end)))) - cl-pos cl-ovl) - (while (save-excursion - (and (setq cl-pos (marker-position cl-mark)) - (< cl-pos (or cl-mark2 (point-max))) - (progn - (set-buffer cl-buffer) - (setq cl-ovl (overlays-at cl-pos)) - (set-marker cl-mark (next-overlay-change cl-pos))))) - (while (and cl-ovl - (or (/= (overlay-start (car cl-ovl)) cl-pos) - (not (and (funcall cl-func (car cl-ovl) cl-arg) - (set-marker cl-mark nil))))) - (setq cl-ovl (cdr cl-ovl)))) - (set-marker cl-mark nil) (if cl-mark2 (set-marker cl-mark2 nil))))) + (let (cl-ovl) + (with-current-buffer cl-buffer + (setq cl-ovl (overlay-lists)) + (if cl-start (setq cl-start (copy-marker cl-start))) + (if cl-end (setq cl-end (copy-marker cl-end)))) + (setq cl-ovl (nconc (car cl-ovl) (cdr cl-ovl))) + (while (and cl-ovl + (or (not (overlay-start (car cl-ovl))) + (and cl-end (>= (overlay-start (car cl-ovl)) cl-end)) + (and cl-start (<= (overlay-end (car cl-ovl)) cl-start)) + (not (funcall cl-func (car cl-ovl) cl-arg)))) + (setq cl-ovl (cdr cl-ovl))) + (if cl-start (set-marker cl-start nil)) + (if cl-end (set-marker cl-end nil)))) ;;; Support for `setf'. ;;;###autoload ------------------------------------------------------------ revno: 116814 committer: Juanma Barranquero branch nick: trunk timestamp: Thu 2014-03-20 19:13:16 +0100 message: lisp/skeleton.el (skeleton-autowrap): Mark as obsolete. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2014-03-20 17:14:45 +0000 +++ lisp/ChangeLog 2014-03-20 18:13:16 +0000 @@ -1,3 +1,7 @@ +2014-03-20 Juanma Barranquero + + * skeleton.el (skeleton-autowrap): Mark as obsolete. Doc fix. + 2014-03-20 Stefan Monnier * electric.el (electric-newline-and-maybe-indent): New command. === modified file 'lisp/skeleton.el' --- lisp/skeleton.el 2014-02-10 01:34:22 +0000 +++ lisp/skeleton.el 2014-03-20 18:13:16 +0000 @@ -55,11 +55,8 @@ When the region is visible (due to `transient-mark-mode' or marking a region with the mouse) and this is non-nil and the function was called without an explicit ARG, then the ARG defaults to -1, i.e. wrapping around the visible -region. - -We will probably delete this variable in a future Emacs version -unless we get a substantial number of complaints about the auto-wrap -feature.") +region.") +(make-obsolete-variable 'skeleton-autowrap nil "24.5") (defvar skeleton-end-newline t "If non-nil, make sure that the skeleton inserted ends with a newline. ------------------------------------------------------------ revno: 116813 committer: Paul Eggert branch nick: trunk timestamp: Thu 2014-03-20 10:58:01 -0700 message: * internals.texi (C Integer Types): Prefer 'false' and 'true' to '0' and '1' for booleans. diff: === modified file 'doc/lispref/ChangeLog' --- doc/lispref/ChangeLog 2014-03-19 21:21:01 +0000 +++ doc/lispref/ChangeLog 2014-03-20 17:58:01 +0000 @@ -1,3 +1,8 @@ +2014-03-20 Paul Eggert + + * internals.texi (C Integer Types): Prefer 'false' and 'true' + to '0' and '1' for booleans. + 2014-03-19 Paul Eggert * numbers.texi: Improve and clarify a bit, and fix some minor bugs. === modified file 'doc/lispref/internals.texi' --- doc/lispref/internals.texi 2014-03-18 01:19:03 +0000 +++ doc/lispref/internals.texi 2014-03-20 17:58:01 +0000 @@ -1620,10 +1620,10 @@ int} so that their values are 0 and 1. @item -In C, Emacs commonly uses @code{bool}, 1, and 0 for boolean values. -Using @code{bool} for booleans can make programs easier to read and a -bit faster than using @code{int}. Although it is also OK to use -@code{int}, this older style is gradually being phased out. When +Prefer @code{bool}, @code{false} and @code{true} for booleans. +Using @code{bool} can make programs easier to read and a bit faster than +using @code{int}. Although it is also OK to use @code{int}, @code{0} +and @code{1}, this older style is gradually being phased out. When using @code{bool}, respect the limitations of the replacement implementation of @code{bool}, as documented in the source file @file{lib/stdbool.in.h}, so that Emacs remains portable to pre-C99 ------------------------------------------------------------ revno: 116812 committer: Paul Eggert branch nick: trunk timestamp: Thu 2014-03-20 10:42:05 -0700 message: * doc.c (store_function_docstring): Fix pointer signedness mismatch. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2014-03-20 16:00:17 +0000 +++ src/ChangeLog 2014-03-20 17:42:05 +0000 @@ -1,3 +1,7 @@ +2014-03-20 Paul Eggert + + * doc.c (store_function_docstring): Fix pointer signedness mismatch. + 2014-03-20 Stefan Monnier * doc.c (store_function_docstring): Warn when we don't know where to === modified file 'src/doc.c' --- src/doc.c 2014-03-20 16:00:17 +0000 +++ src/doc.c 2014-03-20 17:42:05 +0000 @@ -537,7 +537,7 @@ ASET (fun, COMPILED_DOC_STRING, make_number (offset)); else message ("No docstring slot for %s", - SYMBOLP (obj) ? SDATA (SYMBOL_NAME (obj)) : ""); + SYMBOLP (obj) ? SSDATA (SYMBOL_NAME (obj)) : ""); } } ------------------------------------------------------------ revno: 116811 fixes bug: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=16770 committer: Stefan Monnier branch nick: trunk timestamp: Thu 2014-03-20 13:14:45 -0400 message: * lisp/electric.el (electric-newline-and-maybe-indent): New command. Bind it globally to C-j. (electric-indent-mode): Don't mess with the global map any more. Don't drop the post-self-insert-hook is some buffer is still using it. * lisp/bindings.el (global-map): Remove C-j binding. diff: === modified file 'admin/FOR-RELEASE' --- admin/FOR-RELEASE 2014-01-10 19:40:32 +0000 +++ admin/FOR-RELEASE 2014-03-20 17:14:45 +0000 @@ -162,110 +162,110 @@ ** Check the manual. -abbrevs.texi cyd -ack.texi rgm -anti.texi cyd -arevert-xtra.texi cyd -basic.texi cyd -buffers.texi cyd -building.texi cyd -calendar.texi rgm -cal-xtra.texi rgm -cmdargs.texi cyd -commands.texi cyd -custom.texi cyd -dired.texi cyd -dired-xtra.texi rgm -display.texi cyd -emacs.texi rgm -emacs-xtra.texi rgm -emerge-xtra.texi rgm -entering.texi cyd -files.texi cyd -fixit.texi cyd -fortran-xtra.texi rgm -frames.texi cyd -glossary.texi rgm -help.texi cyd -indent.texi cyd -killing.texi cyd -kmacro.texi cyd -macos.texi rgm (can't actually test any of it though) -maintaining.texi cyd -mark.texi cyd -mini.texi rgm -misc.texi cyd -modes.texi cyd -msdog.texi rgm (can't actually test any of it though) -msdog-xtra.texi rgm (can't actually test any of it though) -mule.texi rgm (not 100% sure about "Fontsets") -m-x.texi cyd -package.texi cyd -picture-xtra.texi rgm -programs.texi cyd -regs.texi cyd -rmail.texi rgm -screen.texi cyd -search.texi cyd -sending.texi cyd -text.texi cyd -trouble.texi cyd -vc-xtra.texi cyd -vc1-xtra.texi cyd -windows.texi cyd -xresources.texi cyd +abbrevs.texi +ack.texi +anti.texi +arevert-xtra.texi +basic.texi +buffers.texi +building.texi +calendar.texi +cal-xtra.texi +cmdargs.texi +commands.texi +custom.texi +dired.texi +dired-xtra.texi +display.texi +emacs.texi +emacs-xtra.texi +emerge-xtra.texi +entering.texi +files.texi +fixit.texi +fortran-xtra.texi +frames.texi +glossary.texi +help.texi +indent.texi +killing.texi +kmacro.texi +macos.texi +maintaining.texi +mark.texi +mini.texi +misc.texi +modes.texi +msdog.texi +msdog-xtra.texi +mule.texi +m-x.texi +package.texi +picture-xtra.texi +programs.texi +regs.texi +rmail.texi +screen.texi +search.texi +sending.texi +text.texi +trouble.texi +vc-xtra.texi +vc1-xtra.texi +windows.texi +xresources.texi ** Check the Lisp manual. -abbrevs.texi rgm -anti.texi rgm -back.texi rgm -backups.texi cyd -buffers.texi cyd -commands.texi cyd -compile.texi cyd -control.texi cyd -customize.texi cyd -debugging.texi cyd -display.texi cyd -edebug.texi rgm +abbrevs.texi +anti.texi +back.texi +backups.texi +buffers.texi +commands.texi +compile.texi +control.texi +customize.texi +debugging.texi +display.texi +edebug.texi elisp.texi -errors.texi rgm -eval.texi cyd -files.texi cyd -frames.texi cyd -functions.texi cyd -hash.texi cyd -help.texi cyd -hooks.texi rgm +errors.texi +eval.texi +files.texi +frames.texi +functions.texi +hash.texi +help.texi +hooks.texi index.texi -internals.texi rgm cyd -intro.texi cyd -keymaps.texi cyd -lists.texi cyd -loading.texi cyd -macros.texi cyd -maps.texi rgm -markers.texi rgm -minibuf.texi rgm -modes.texi cyd -nonascii.texi cyd -numbers.texi cyd -objects.texi cyd -os.texi cyd -package.texi rgm -positions.texi cyd -processes.texi rgm -searching.texi rgm -sequences.texi cyd -streams.texi cyd -strings.texi cyd -symbols.texi cyd -syntax.texi cyd -text.texi cyd -tips.texi rgm -variables.texi cyd -windows.texi rgm (skimmed) +internals.texi +intro.texi +keymaps.texi +lists.texi +loading.texi +macros.texi +maps.texi +markers.texi +minibuf.texi +modes.texi +nonascii.texi +numbers.texi Paul Eggert (24.4) +objects.texi +os.texi +package.texi +positions.texi +processes.texi +searching.texi +sequences.texi +streams.texi +strings.texi +symbols.texi +syntax.texi +text.texi +tips.texi +variables.texi +windows.texi Local variables: === modified file 'doc/misc/vip.texi' --- doc/misc/vip.texi 2014-03-18 21:14:36 +0000 +++ doc/misc/vip.texi 2014-03-20 17:14:45 +0000 @@ -1568,7 +1568,7 @@ @kindex 011 TAB (@code{indent-for-tab-command}) Indent line for current major mode (@code{indent-for-tab-command}). @item C-j -@kindex 012 @kbd{C-j} (@code{electric-indent-just-newline'} or @code{newline-and-indent}) +@kindex 012 @kbd{C-j} (@code{electric-newline-and-maybe-indent}) Insert a newline, and maybe indent according to mode. @item C-k @kindex 013 @kbd{C-k} (@code{kill-line}) === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2014-03-20 16:00:17 +0000 +++ lisp/ChangeLog 2014-03-20 17:14:45 +0000 @@ -1,5 +1,12 @@ 2014-03-20 Stefan Monnier + * electric.el (electric-newline-and-maybe-indent): New command. + Bind it globally to C-j. + (electric-indent-mode): Don't mess with the global map any more. + Don't drop the post-self-insert-hook is some buffer is still using it + (bug#16770). + * bindings.el (global-map): Remove C-j binding. + * emacs-lisp/nadvice.el (advice--make-docstring): Try harder to find the docstring of functions advised before dumping (bug#16993). === modified file 'lisp/bindings.el' --- lisp/bindings.el 2014-03-04 03:14:11 +0000 +++ lisp/bindings.el 2014-03-20 17:14:45 +0000 @@ -795,7 +795,6 @@ ;; suspend only the relevant terminal. (substitute-key-definition 'suspend-emacs 'suspend-frame global-map) -(define-key global-map "\C-j" 'newline-and-indent) (define-key global-map "\C-m" 'newline) (define-key global-map "\C-o" 'open-line) (define-key esc-map "\C-o" 'split-line) === modified file 'lisp/electric.el' --- lisp/electric.el 2014-03-12 06:48:20 +0000 +++ lisp/electric.el 2014-03-20 17:14:45 +0000 @@ -286,6 +286,20 @@ (let ((electric-indent-mode nil)) (newline arg 'interactive))) +;;;###autoload(define-key global-map "\C-j" 'electric-newline-and-maybe-indent) +;;;###autoload +(defun electric-newline-and-maybe-indent () + "Insert a newline. +If `electric-indent-mode' is enabled, that's that, but if it +is *disabled* then additionally indent according to major mode. +Indentation is done using the value of `indent-line-function'. +In programming language modes, this is the same as TAB. +In some text modes, where TAB inserts a tab, this command indents to the +column specified by the function `current-left-margin'." + (interactive "*") + (if electric-indent-mode + (electric-indent-just-newline nil) + (newline-and-indent))) ;;;###autoload (define-minor-mode electric-indent-mode @@ -303,14 +317,12 @@ :initialize 'custom-initialize-delay :init-value t (if (not electric-indent-mode) - (progn - (when (eq (lookup-key global-map [?\C-j]) - 'electric-indent-just-newline) - (define-key global-map [?\C-j] 'newline-and-indent)) + (unless (catch 'found + (dolist (buf (buffer-list)) + (with-current-buffer buf + (if electric-indent-mode (throw 'found t))))) (remove-hook 'post-self-insert-hook #'electric-indent-post-self-insert-function)) - (when (eq (lookup-key global-map [?\C-j]) 'newline-and-indent) - (define-key global-map [?\C-j] 'electric-indent-just-newline)) (add-hook 'post-self-insert-hook #'electric-indent-post-self-insert-function) (electric--sort-post-self-insertion-hook))) ------------------------------------------------------------ revno: 116810 fixes bug: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=16993 committer: Stefan Monnier branch nick: trunk timestamp: Thu 2014-03-20 12:00:17 -0400 message: * lisp/emacs-lisp/nadvice.el (advice--make-docstring): Try harder to find the docstring of functions advised before dumping. * src/doc.c (store_function_docstring): Warn when we don't know where to put a docstring. (Fsubstitute_command_keys): Don't advertise the fact that text-properties are dropped, since we think it's a bug that we'll fix in 24.5. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2014-03-20 01:20:15 +0000 +++ lisp/ChangeLog 2014-03-20 16:00:17 +0000 @@ -1,3 +1,8 @@ +2014-03-20 Stefan Monnier + + * emacs-lisp/nadvice.el (advice--make-docstring): Try harder to find + the docstring of functions advised before dumping (bug#16993). + 2014-03-19 Stefan-W. Hahn (tiny change) * ps-print.el (ps-generate-postscript-with-faces): === modified file 'lisp/emacs-lisp/nadvice.el' --- lisp/emacs-lisp/nadvice.el 2014-03-17 18:30:53 +0000 +++ lisp/emacs-lisp/nadvice.el 2014-03-20 16:00:17 +0000 @@ -74,12 +74,19 @@ (defun advice--make-docstring (function) "Build the raw docstring for FUNCTION, presumably advised." - (let ((flist (indirect-function function)) - (docstring nil)) + (let* ((flist (indirect-function function)) + (docfun nil) + (docstring nil)) (if (eq 'macro (car-safe flist)) (setq flist (cdr flist))) (while (advice--p flist) (let ((bytecode (aref flist 1)) + (doc (aref flist 4)) (where nil)) + ;; Hack attack! For advices installed before calling + ;; Snarf-documentation, the integer offset into the DOC file will not + ;; be installed in the "core unadvised function" but in the advice + ;; object instead! So here we try to undo the damage. + (if (integerp doc) (setq docfun flist)) (dolist (elem advice--where-alist) (if (eq bytecode (cadr elem)) (setq where (car elem)))) (setq docstring @@ -101,8 +108,9 @@ "\n"))) (setq flist (advice--cdr flist))) (if docstring (setq docstring (concat docstring "\n"))) - (let* ((origdoc (unless (eq function flist) ;Avoid inf-loops. - (documentation flist t))) + (unless docfun (setq docfun flist)) + (let* ((origdoc (unless (eq function docfun) ;Avoid inf-loops. + (documentation docfun t))) (usage (help-split-fundoc origdoc function))) (setq usage (if (null usage) (let ((arglist (help-function-arglist flist))) === modified file 'src/ChangeLog' --- src/ChangeLog 2014-03-20 14:09:37 +0000 +++ src/ChangeLog 2014-03-20 16:00:17 +0000 @@ -1,5 +1,11 @@ 2014-03-20 Stefan Monnier + * doc.c (store_function_docstring): Warn when we don't know where to + put a docstring. + (Fsubstitute_command_keys): Don't advertise the fact that + text-properties are dropped, since we think it's a bug that we'll fix + in 24.5. + * frame.h (SET_FRAME_VISIBLE): Keep frame_garbaged up to date. * xterm.c (handle_one_xevent) : Don't garbage the frame. * frame.c (frame_garbaged): Make "docstring" more precise. === modified file 'src/doc.c' --- src/doc.c 2014-02-28 02:00:17 +0000 +++ src/doc.c 2014-03-20 16:00:17 +0000 @@ -535,6 +535,9 @@ docstring, since we've found a docstring for it. */ if ((ASIZE (fun) & PSEUDOVECTOR_SIZE_MASK) > COMPILED_DOC_STRING) ASET (fun, COMPILED_DOC_STRING, make_number (offset)); + else + message ("No docstring slot for %s", + SYMBOLP (obj) ? SDATA (SYMBOL_NAME (obj)) : ""); } } @@ -707,7 +710,7 @@ thus, \\=\\=\\=\\= puts \\=\\= into the output, and \\=\\=\\=\\[ puts \\=\\[ into the output. Return the original STRING if no substitutions are made. -Otherwise, return a new string, without any text properties. */) +Otherwise, return a new string. */) (Lisp_Object string) { char *buf; ------------------------------------------------------------ revno: 116809 committer: Stefan Monnier branch nick: trunk timestamp: Thu 2014-03-20 10:09:37 -0400 message: * src/frame.h (SET_FRAME_VISIBLE): Keep frame_garbaged up to date. * src/xterm.c (handle_one_xevent) : Don't garbage the frame. * src/frame.c (frame_garbaged): Make "docstring" more precise. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2014-03-20 01:21:52 +0000 +++ src/ChangeLog 2014-03-20 14:09:37 +0000 @@ -1,3 +1,9 @@ +2014-03-20 Stefan Monnier + + * frame.h (SET_FRAME_VISIBLE): Keep frame_garbaged up to date. + * xterm.c (handle_one_xevent) : Don't garbage the frame. + * frame.c (frame_garbaged): Make "docstring" more precise. + 2014-03-20 Glenn Morris * charset.c (init_charset): When we cannot find the charsets directory, @@ -74,8 +80,8 @@ we eventually back up the iterator to the wrap point. This avoids delusional behavior of move_it_to, whereby it proceeds to the next display line, but sets current_x to zero for all the glyphs that - without word-wrap would fit on the previous display line. One - result was that visual-order cursor movement behaved erratically + without word-wrap would fit on the previous display line. + One result was that visual-order cursor movement behaved erratically under word-wrap. (Fmove_point_visually): Add code to find the x coordinate of the last character before wrap point, under word-wrap on a TTY. @@ -107,8 +113,8 @@ SSDATA (Vx_resource_name), which may be changed from Lisp. (xim_close_display): For XUnregisterIMInstantiateCallback, always eassert return value and pass exactly the same values - as were used for XRegisterIMInstantiateCallback. Otherwise - XUnregisterIMInstantiateCallback will always fail. See Xlib + as were used for XRegisterIMInstantiateCallback. + Otherwise XUnregisterIMInstantiateCallback will always fail. See Xlib sources to check why if you are interested. 2014-03-05 Martin Rudalics === modified file 'src/alloc.c' --- src/alloc.c 2014-02-28 21:45:34 +0000 +++ src/alloc.c 2014-03-20 14:09:37 +0000 @@ -1138,8 +1138,8 @@ } abase = ABLOCK_ABASE (free_ablock); - ABLOCKS_BUSY (abase) = - (struct ablocks *) (2 + (intptr_t) ABLOCKS_BUSY (abase)); + ABLOCKS_BUSY (abase) + = (struct ablocks *) (2 + (intptr_t) ABLOCKS_BUSY (abase)); val = free_ablock; free_ablock = free_ablock->x.next_free; === modified file 'src/frame.c' --- src/frame.c 2014-03-12 07:28:23 +0000 +++ src/frame.c 2014-03-20 14:09:37 +0000 @@ -125,8 +125,7 @@ static struct frame *last_nonminibuf_frame; -/* Nonzero means there is at least one garbaged frame. */ - +/* False means there are no visible garbaged frames. */ bool frame_garbaged; #ifdef HAVE_WINDOW_SYSTEM @@ -621,7 +620,7 @@ FRAME_MENU_BAR_LINES (f) = NILP (Vmenu_bar_mode) ? 0 : 1; FRAME_MENU_BAR_HEIGHT (f) = FRAME_MENU_BAR_LINES (f) * FRAME_LINE_HEIGHT (f); - /* Set the top frame to the newly created frame. */ + /* Set the top frame to the newly created frame. */ if (FRAMEP (FRAME_TTY (f)->top_frame) && FRAME_LIVE_P (XFRAME (FRAME_TTY (f)->top_frame))) SET_FRAME_VISIBLE (XFRAME (FRAME_TTY (f)->top_frame), 2); /* obscured */ === modified file 'src/frame.h' --- src/frame.h 2014-01-01 07:43:34 +0000 +++ src/frame.h 2014-03-20 14:09:37 +0000 @@ -439,7 +439,7 @@ /* The baud rate that was used to calculate costs for this frame. */ int cost_calculation_baud_rate; - /* frame opacity + /* Frame opacity alpha[0]: alpha transparency of the active frame alpha[1]: alpha transparency of inactive frames Negative values mean not to change alpha. */ @@ -453,7 +453,7 @@ /* Additional space to put between text lines on this frame. */ int extra_line_spacing; - /* All display backends seem to need these two pixel values. */ + /* All display backends seem to need these two pixel values. */ unsigned long background_pixel; unsigned long foreground_pixel; }; @@ -946,6 +946,9 @@ } \ } while (false) +/* False means there are no visible garbaged frames. */ +extern bool frame_garbaged; + /* Set visibility of frame F. We call redisplay_other_windows to make sure the frame gets redisplayed if some changes were applied to it while it wasn't visible (and hence @@ -955,8 +958,13 @@ SET_FRAME_VISIBLE (struct frame *f, int v) { eassert (0 <= v && v <= 2); - if (v == 1 && f->visible != 1) - redisplay_other_windows (); + if (v) + { + if (v == 1 && f->visible != 1) + redisplay_other_windows (); + if (FRAME_GARBAGED_P (f)) + frame_garbaged = true; + } f->visible = v; } @@ -972,9 +980,6 @@ extern Lisp_Object Qterminal; extern Lisp_Object Qnoelisp; -/* True means there is at least one garbaged frame. */ -extern bool frame_garbaged; - extern void set_menu_bar_lines (struct frame *, Lisp_Object, Lisp_Object); extern struct frame *decode_window_system_frame (Lisp_Object); extern struct frame *decode_live_frame (Lisp_Object); === modified file 'src/term.c' --- src/term.c 2014-02-28 21:45:34 +0000 +++ src/term.c 2014-03-20 14:09:37 +0000 @@ -3054,7 +3054,7 @@ int i; if (!saved) - return; /* already freed */ + return; /* Already freed! */ for (i = 0; i < saved->nrows; ++i) { @@ -3170,7 +3170,7 @@ int statecount, x, y, i; bool leave, onepane; int result IF_LINT (= 0); - int title_faces[4]; /* face to display the menu title */ + int title_faces[4]; /* Face to display the menu title. */ int faces[4], buffers_num_deleted = 0; struct frame *sf = SELECTED_FRAME (); struct tty_display_info *tty = FRAME_TTY (sf); @@ -3332,7 +3332,7 @@ have been opened. That does not include an open and active submenu. */ if (i != statecount - 2 - || state[i].menu->submenu[dy] != state[i+1].menu) + || state[i].menu->submenu[dy] != state[i + 1].menu) while (i != statecount - 1) { statecount--; @@ -3383,7 +3383,7 @@ screen_update (sf, state[0].screen_behind); while (statecount--) free_saved_screen (state[statecount].screen_behind); - tty_show_cursor (tty); /* turn cursor back on */ + tty_show_cursor (tty); /* Turn cursor back on. */ fflush (tty->output); /* Clean up any mouse events that are waiting inside Emacs event queue. @@ -3474,7 +3474,7 @@ break; i += 4; } - i -= 4; /* went one too far */ + i -= 4; /* Went one too far! */ } return i; } @@ -3519,7 +3519,7 @@ if (i < last_i) *x = XINT (AREF (items, i + 4 + 3)); else - *x = 0; /* wrap around to the first item */ + *x = 0; /* Wrap around to the first item. */ } else if (prev_x < 0) { @@ -3647,7 +3647,7 @@ if (!NILP (descrip)) { - /* if alloca is fast, use that to make the space, + /* If alloca is fast, use that to make the space, to reduce gc needs. */ item_data = (char *) alloca (maxwidth + SBYTES (descrip) + 1); memcpy (item_data, SSDATA (item_name), SBYTES (item_name)); @@ -3694,7 +3694,7 @@ uly = dispheight - height; } - if (FRAME_HAS_MINIBUF_P (f) && uly+height > dispheight - 2) + if (FRAME_HAS_MINIBUF_P (f) && uly + height > dispheight - 2) { /* Move the menu away of the echo area, to avoid overwriting the menu with help echo messages or vice versa. */ @@ -3723,8 +3723,8 @@ /* If position was not given by a mouse click, adjust so upper left corner of the menu as a whole ends up at given coordinates. This is what x-popup-menu says in its documentation. */ - x += width/2; - y += 1.5*height/(maxlines+2); + x += width / 2; + y += 1.5 * height / (maxlines + 2); } #endif === modified file 'src/xdisp.c' --- src/xdisp.c 2014-03-09 11:36:51 +0000 +++ src/xdisp.c 2014-03-20 14:09:37 +0000 @@ -27253,7 +27253,7 @@ if (/* If window is in the process of being destroyed, don't bother to do anything. */ w->current_matrix != NULL - /* Don't update mouse highlight if hidden */ + /* Don't update mouse highlight if hidden. */ && (draw != DRAW_MOUSE_FACE || !hlinfo->mouse_face_hidden) /* Recognize when we are called to operate on rows that don't exist anymore. This can happen when a window is split. */ === modified file 'src/xterm.c' --- src/xterm.c 2014-03-11 06:50:01 +0000 +++ src/xterm.c 2014-03-20 14:09:37 +0000 @@ -5667,7 +5667,7 @@ /* This is the filter function invoked by the GTK event loop. It is invoked before the XEvent is translated to a GdkEvent, - so we have a chance to act on the event before GTK. */ + so we have a chance to act on the event before GTK. */ static GdkFilterReturn event_handler_gdk (GdkXEvent *gxev, GdkEvent *ev, gpointer data) { @@ -5696,9 +5696,9 @@ if (! dpyinfo) current_finish = X_EVENT_NORMAL; else - current_count += - handle_one_xevent (dpyinfo, xev, ¤t_finish, - current_hold_quit); + current_count + += handle_one_xevent (dpyinfo, xev, ¤t_finish, + current_hold_quit); } else current_finish = x_dispatch_event (xev, xev->xany.display); @@ -6142,14 +6142,6 @@ if (f) { bool iconified = FRAME_ICONIFIED_P (f); - /* wait_reading_process_output will notice this and update - the frame's display structures. - If we where iconified, we should not set garbaged, - because that stops redrawing on Expose events. This looks - bad if we are called from a recursive event loop - (x_dispatch_event), for example when a dialog is up. */ - if (!iconified) - SET_FRAME_GARBAGED (f); /* Check if fullscreen was specified before we where mapped the first time, i.e. from the command line. */ @@ -6700,7 +6692,7 @@ #ifdef USE_GTK /* GTK creates windows but doesn't map them. - Only get real positions when mapped. */ + Only get real positions when mapped. */ if (FRAME_GTK_OUTER_WIDGET (f) && gtk_widget_get_mapped (FRAME_GTK_OUTER_WIDGET (f))) #endif ------------------------------------------------------------ revno: 116808 committer: Glenn Morris branch nick: trunk timestamp: Wed 2014-03-19 21:21:52 -0400 message: * src/charset.c (init_charset): When we cannot find the charsets directory, mention if EMACSDATA is set. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2014-03-19 21:14:32 +0000 +++ src/ChangeLog 2014-03-20 01:21:52 +0000 @@ -1,3 +1,8 @@ +2014-03-20 Glenn Morris + + * charset.c (init_charset): When we cannot find the charsets directory, + mention if EMACSDATA is set. + 2014-03-19 Paul Eggert * fns.c (Frandom): Fix rare bug where the result isn't random. === modified file 'src/charset.c' --- src/charset.c 2014-01-01 07:43:34 +0000 +++ src/charset.c 2014-03-20 01:21:52 +0000 @@ -2305,9 +2305,11 @@ obscure problem (eg bug#6401), so better abort. */ fprintf (stderr, "Error: charsets directory not found:\n\ %s\n\ -Emacs will not function correctly without the character map files.\n\ +Emacs will not function correctly without the character map files.\n%s\ Please check your installation!\n", - SDATA (tempdir)); + SDATA (tempdir), + egetenv("EMACSDATA") ? "The EMACSDATA environment \ +variable is set, maybe it has the wrong value?\n" : ""); exit (1); } ------------------------------------------------------------ revno: 116807 committer: Glenn Morris branch nick: trunk timestamp: Wed 2014-03-19 21:20:15 -0400 message: Mark tiny change diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2014-03-19 19:12:50 +0000 +++ lisp/ChangeLog 2014-03-20 01:20:15 +0000 @@ -1,4 +1,4 @@ -2014-03-19 Stefan-W. Hahn +2014-03-19 Stefan-W. Hahn (tiny change) * ps-print.el (ps-generate-postscript-with-faces): Explicitly deactivate the mark (bug#16866). ------------------------------------------------------------ revno: 116806 author: Paul Eggert committer: Paul Eggert branch nick: trunk timestamp: Wed 2014-03-19 14:21:01 -0700 message: * numbers.texi: Improve and clarify a bit, and fix some minor bugs. Remove now-obsolete hypothetical note about negative division, as the C standard has changed. diff: === modified file 'doc/lispref/ChangeLog' --- doc/lispref/ChangeLog 2014-03-19 21:09:08 +0000 +++ doc/lispref/ChangeLog 2014-03-19 21:21:01 +0000 @@ -1,5 +1,9 @@ 2014-03-19 Paul Eggert + * numbers.texi: Improve and clarify a bit, and fix some minor bugs. + Remove now-obsolete hypothetical note about negative division, + as the C standard has changed. + Fix porting inconsistency about rounding to even. * numbers.texi (Numeric Conversions, Rounding Operations): Document that 'round' and 'fround' round to even. === modified file 'doc/lispref/numbers.texi' --- doc/lispref/numbers.texi 2014-03-19 21:09:08 +0000 +++ doc/lispref/numbers.texi 2014-03-19 21:21:01 +0000 @@ -116,8 +116,8 @@ @minus{}1 is represented as 30 ones. (This is called @dfn{two's complement} notation.) - The negative integer, @minus{}5, is creating by subtracting 4 from -@minus{}1. In binary, the decimal integer 4 is 100. Consequently, + Subtracting 4 from @minus{}1 returns the negative integer @minus{}5. +In binary, the decimal integer 4 is 100. Consequently, @minus{}5 looks like this: @example @@ -190,8 +190,8 @@ @end defvar In Emacs Lisp, text characters are represented by integers. Any -integer between zero and the value of @code{max-char}, inclusive, is -considered to be valid as a character. @xref{String Basics}. +integer between zero and the value of @code{(max-char)}, inclusive, is +considered to be valid as a character. @xref{Character Codes}. @node Float Basics @section Floating-Point Basics @@ -252,7 +252,7 @@ where @var{s} and @var{e} are respectively the significand and exponent of the floating-point number @var{x}. -If @var{x} is finite, @var{s} is a floating-point number between 0.5 +If @var{x} is finite, then @var{s} is a floating-point number between 0.5 (inclusive) and 1.0 (exclusive), @var{e} is an integer, and @ifnottex @var{x} = @var{s} * 2**@var{e}. @@ -260,9 +260,9 @@ @tex @math{x = s 2^e}. @end tex -If @var{x} is zero or infinity, @var{s} is the same as @var{x}. -If @var{x} is a NaN, @var{s} is also a NaN. -If @var{x} is zero, @var{e} is 0. +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 zero, then @var{e} is 0. @end defun @defun ldexp sig &optional exp @@ -275,9 +275,9 @@ and returns the result. @var{x1} and @var{x2} must be floating point. @end defun -@defun logb number -This function returns the binary exponent of @var{number}. More -precisely, the value is the logarithm of |@var{number}| base 2, rounded +@defun logb x +This function returns the binary exponent of @var{x}. More +precisely, the value is the logarithm base 2 of @math{|x|}, rounded down to an integer. @example @@ -367,7 +367,7 @@ @example (defvar fuzz-factor 1.0e-6) (defun approx-equal (x y) - (or (and (= x 0) (= y 0)) + (or (= x y) (< (/ (abs (- x y)) (max (abs x) (abs y))) fuzz-factor))) @@ -648,10 +648,6 @@ If all the arguments are integers, the result is an integer, obtained by rounding the quotient towards zero after each division. -(Hypothetically, some machines may have different rounding behavior -for negative arguments, because @code{/} is implemented using the C -division operator, which permits machine-dependent rounding; but this -does not happen in practice.) @example @group @@ -706,8 +702,7 @@ @end example @noindent -always equals @var{dividend}. If @var{divisor} is zero, Emacs signals -an @code{arith-error} error. +always equals @var{dividend} if @var{divisor} is nonzero. @example (% 9 4) @@ -769,7 +764,8 @@ @noindent always equals @var{dividend}, subject to rounding error if either -argument is floating point. For @code{floor}, see @ref{Numeric +argument is floating point and to an @code{arith-error} if @var{dividend} is an +integer and @var{divisor} is 0. For @code{floor}, see @ref{Numeric Conversions}. @end defun @@ -1194,8 +1190,8 @@ @end defun @defun sqrt arg -This returns the square root of @var{arg}. If @var{arg} is negative, -@code{sqrt} returns a NaN. +This returns the square root of @var{arg}. If @var{arg} is finite +and less than zero, @code{sqrt} returns a NaN. @end defun In addition, Emacs defines the following common mathematical @@ -1244,8 +1240,8 @@ @code{most-negative-fixnum} and @code{most-positive-fixnum} (@pxref{Integer Basics}). -If @var{limit} is @code{t}, it means to choose a new seed based on the -current time of day and on Emacs's process @acronym{ID} number. +If @var{limit} is @code{t}, it means to choose a new seed as if Emacs +were restarting. If @var{limit} is a string, it means to choose a new seed based on the string's contents. ------------------------------------------------------------ revno: 116805 author: Paul Eggert committer: Paul Eggert branch nick: trunk timestamp: Wed 2014-03-19 14:14:32 -0700 message: * fns.c (Frandom): Fix rare bug where the result isn't random. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2014-03-19 21:09:08 +0000 +++ src/ChangeLog 2014-03-19 21:14:32 +0000 @@ -1,5 +1,7 @@ 2014-03-19 Paul Eggert + * fns.c (Frandom): Fix rare bug where the result isn't random. + Fix porting inconsistency about rounding to even. * floatfns.c (emacs_rint) [!HAVE_RINT]: Round to even. This way, the unusual !HAVE_RINT case acts like the usual === modified file 'src/fns.c' --- src/fns.c 2014-02-10 06:04:39 +0000 +++ src/fns.c 2014-03-19 21:14:32 +0000 @@ -79,8 +79,17 @@ seed_random (SSDATA (limit), SBYTES (limit)); val = get_random (); - if (NATNUMP (limit) && XFASTINT (limit) != 0) - val %= XFASTINT (limit); + if (INTEGERP (limit) && 0 < XINT (limit)) + while (true) + { + /* Return the remainder, except reject the rare case where + get_random returns a number so close to INTMASK that the + remainder isn't random. */ + EMACS_INT remainder = val % XINT (limit); + if (val - remainder <= INTMASK - XINT (limit) + 1) + return make_number (remainder); + val = get_random (); + } return make_number (val); } ------------------------------------------------------------ revno: 116804 committer: Paul Eggert branch nick: trunk timestamp: Wed 2014-03-19 14:09:08 -0700 message: Fix porting inconsistency about rounding to even. * doc/lispref/numbers.texi (Numeric Conversions, Rounding Operations): Document that 'round' and 'fround' round to even. * src/floatfns.c (emacs_rint) [!HAVE_RINT]: Round to even. This way, the unusual !HAVE_RINT case acts like the usual HAVE_RINT case, and we can fix the documentation accordingly. diff: === modified file 'doc/lispref/ChangeLog' --- doc/lispref/ChangeLog 2014-03-18 23:31:17 +0000 +++ doc/lispref/ChangeLog 2014-03-19 21:09:08 +0000 @@ -1,3 +1,9 @@ +2014-03-19 Paul Eggert + + Fix porting inconsistency about rounding to even. + * numbers.texi (Numeric Conversions, Rounding Operations): + Document that 'round' and 'fround' round to even. + 2014-03-18 Juanma Barranquero * customize.texi (Variable Definitions): Recommend avoiding === modified file 'doc/lispref/numbers.texi' --- doc/lispref/numbers.texi 2014-03-18 04:03:59 +0000 +++ doc/lispref/numbers.texi 2014-03-19 21:09:08 +0000 @@ -534,8 +534,7 @@ @defun round number &optional divisor This returns @var{number}, converted to an integer by rounding towards the nearest integer. Rounding a value equidistant between two integers -may choose the integer closer to zero, or it may prefer an even integer, -depending on your machine. +returns the even integer. @example (round 1.2) @@ -803,6 +802,7 @@ @defun fround float This function rounds @var{float} to the nearest integral value, and returns that value as a floating-point number. +Rounding a value equidistant between two integers returns the even integer. @end defun @node Bitwise Operations === modified file 'src/ChangeLog' --- src/ChangeLog 2014-03-19 17:43:18 +0000 +++ src/ChangeLog 2014-03-19 21:09:08 +0000 @@ -1,3 +1,10 @@ +2014-03-19 Paul Eggert + + Fix porting inconsistency about rounding to even. + * floatfns.c (emacs_rint) [!HAVE_RINT]: Round to even. + This way, the unusual !HAVE_RINT case acts like the usual + HAVE_RINT case, and we can fix the documentation accordingly. + 2014-03-19 Eli Zaretskii * w32fns.c (reset_modifiers): Zero out keystate[] before using it. === modified file 'src/floatfns.c' --- src/floatfns.c 2014-01-01 07:43:34 +0000 +++ src/floatfns.c 2014-03-19 21:09:08 +0000 @@ -428,7 +428,9 @@ static double emacs_rint (double d) { - return floor (d + 0.5); + double d1 = d + 0.5; + double r = floor (d1); + return r - (r == d1 && fmod (r, 2) != 0); } #endif ------------------------------------------------------------ revno: 116803 fixes bug: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=16866 author: Stefan-W. Hahn committer: Stefan Monnier branch nick: trunk timestamp: Wed 2014-03-19 15:12:50 -0400 message: * lisp/ps-print.el (ps-generate-postscript-with-faces): Explicitly deactivate the mark. * lisp/simple.el (deactivate-mark): Update region highlight. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2014-03-19 16:14:26 +0000 +++ lisp/ChangeLog 2014-03-19 19:12:50 +0000 @@ -1,3 +1,9 @@ +2014-03-19 Stefan-W. Hahn + + * ps-print.el (ps-generate-postscript-with-faces): + Explicitly deactivate the mark (bug#16866). + * simple.el (deactivate-mark): Update region highlight. + 2014-03-19 Juanma Barranquero * emacs-lisp/package.el (describe-package-1): === modified file 'lisp/ps-print.el' --- lisp/ps-print.el 2014-01-16 06:24:06 +0000 +++ lisp/ps-print.el 2014-03-19 19:12:50 +0000 @@ -6429,6 +6429,7 @@ (save-restriction (narrow-to-region from to) (ps-print-ensure-fontified from to) + (deactivate-mark) ;bug#16866. (ps-generate-postscript-with-faces1 from to))) (defun ps-generate-postscript (from to) === modified file 'lisp/simple.el' --- lisp/simple.el 2014-03-18 20:49:24 +0000 +++ lisp/simple.el 2014-03-19 19:12:50 +0000 @@ -4386,7 +4386,8 @@ (if (eq (car-safe transient-mark-mode) 'only) (setq transient-mark-mode (cdr transient-mark-mode))) (setq mark-active nil) - (run-hooks 'deactivate-mark-hook)))) + (run-hooks 'deactivate-mark-hook)) + (redisplay--update-region-highlight (selected-window)))) (defun activate-mark (&optional no-tmm) "Activate the mark. ------------------------------------------------------------ revno: 116802 committer: Eli Zaretskii branch nick: trunk timestamp: Wed 2014-03-19 19:43:18 +0200 message: Fix minor memory-related problems on MS-Windows revealed by Dr. Memory. src/w32fns.c (reset_modifiers): Zero out keystate[] before using it. (w32_wnd_proc): Initialize the dwHoverTime member of TRACKMOUSEEVENT structure. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2014-03-17 21:29:56 +0000 +++ src/ChangeLog 2014-03-19 17:43:18 +0000 @@ -1,3 +1,9 @@ +2014-03-19 Eli Zaretskii + + * w32fns.c (reset_modifiers): Zero out keystate[] before using it. + (w32_wnd_proc): Initialize the dwHoverTime member of + TRACKMOUSEEVENT structure. + 2014-03-17 Teodor Zlatanov * gnutls.c (Fgnutls_boot): Fix case of :verify-error = t. === modified file 'src/w32fns.c' --- src/w32fns.c 2014-02-06 15:27:46 +0000 +++ src/w32fns.c 2014-03-19 17:43:18 +0000 @@ -2099,6 +2099,7 @@ #define CURRENT_STATE(key) ((GetAsyncKeyState (key) & 0x8000) >> 8) + memset (keystate, 0, sizeof (keystate)); GetKeyboardState (keystate); keystate[VK_SHIFT] = CURRENT_STATE (VK_SHIFT); keystate[VK_CONTROL] = CURRENT_STATE (VK_CONTROL); @@ -3444,6 +3445,7 @@ tme.cbSize = sizeof (tme); tme.dwFlags = TME_LEAVE; tme.hwndTrack = hwnd; + tme.dwHoverTime = HOVER_DEFAULT; track_mouse_event_fn (&tme); track_mouse_window = hwnd; ------------------------------------------------------------ revno: 116801 fixes bug: http://debbugs.gnu.org/16733 committer: Juanma Barranquero branch nick: trunk timestamp: Wed 2014-03-19 17:14:26 +0100 message: lisp/emacs-lisp/package.el (describe-package-1): Decode commentary (bug#16733). diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2014-03-18 23:31:17 +0000 +++ lisp/ChangeLog 2014-03-19 16:14:26 +0000 @@ -1,3 +1,8 @@ +2014-03-19 Juanma Barranquero + + * emacs-lisp/package.el (describe-package-1): + Decode commentary (bug#16733). + 2014-03-18 Juanma Barranquero * custom.el (defcustom): Doc fix: recommend avoiding destructive === modified file 'lisp/emacs-lisp/package.el' --- lisp/emacs-lisp/package.el 2014-03-14 20:55:40 +0000 +++ lisp/emacs-lisp/package.el 2014-03-19 16:14:26 +0000 @@ -1531,7 +1531,8 @@ (setq readme-string (buffer-string)) t)) (error nil)) - (insert readme-string)) + (let ((coding (detect-coding-string readme-string t))) + (insert (decode-coding-string readme-string coding t)))) ((file-readable-p readme) (insert-file-contents readme) (goto-char (point-max)))))))) ------------------------------------------------------------ revno: 116800 fixes bug: http://debbugs.gnu.org/17038 committer: Juanma Barranquero branch nick: trunk timestamp: Wed 2014-03-19 03:24:51 +0100 message: lisp/iimage.el: Remove obsolete URL from Commentary (bug#17038). diff: === modified file 'lisp/iimage.el' --- lisp/iimage.el 2014-01-01 07:43:34 +0000 +++ lisp/iimage.el 2014-03-19 02:24:51 +0000 @@ -25,7 +25,6 @@ ;; Iimage is a minor mode that displays images, when image-filename ;; exists in the buffer. -;; http://www.netlaputa.ne.jp/~kose/Emacs/iimage.html ;; ;; ** Display images in *Info* buffer. ;; ------------------------------------------------------------ revno: 116799 fixes bug: http://debbugs.gnu.org/16755 committer: Juanma Barranquero branch nick: trunk timestamp: Wed 2014-03-19 00:31:17 +0100 message: Recommend not modifying :set's value arg in defcustom (bug#16755). * doc/lispref/customize.texi (Variable Definitions): * lisp/custom.el (defcustom): Recommend avoiding destructive modification of the value argument of :set. diff: === modified file 'doc/lispref/ChangeLog' --- doc/lispref/ChangeLog 2014-03-18 21:14:36 +0000 +++ doc/lispref/ChangeLog 2014-03-18 23:31:17 +0000 @@ -1,3 +1,8 @@ +2014-03-18 Juanma Barranquero + + * customize.texi (Variable Definitions): Recommend avoiding + destructive modification of the value argument of :set (bug#16755). + 2014-03-18 Stefan Monnier * modes.texi (Auto-Indentation): Mention electric-indent variables. === modified file 'doc/lispref/customize.texi' --- doc/lispref/customize.texi 2014-03-18 01:19:03 +0000 +++ doc/lispref/customize.texi 2014-03-18 23:31:17 +0000 @@ -353,8 +353,9 @@ @var{setfunction} should take two arguments, a symbol (the option name) and the new value, and should do whatever is necessary to update the value properly for this option (which may not mean simply setting -the option as a Lisp variable). The default for @var{setfunction} is -@code{set-default}. +the option as a Lisp variable); preferably, though, it should not +modify its value argument destructively. The default for +@var{setfunction} is @code{set-default}. If you specify this keyword, the variable's documentation string should describe how to do the same job in hand-written Lisp code. === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2014-03-18 20:49:24 +0000 +++ lisp/ChangeLog 2014-03-18 23:31:17 +0000 @@ -1,3 +1,8 @@ +2014-03-18 Juanma Barranquero + + * custom.el (defcustom): Doc fix: recommend avoiding destructive + modification of the value argument of :set (bug#16755). + 2014-03-18 Stefan Monnier * simple.el (newline-and-indent): Do autofill (bug#17031). === modified file 'lisp/custom.el' --- lisp/custom.el 2014-02-10 01:34:22 +0000 +++ lisp/custom.el 2014-03-18 23:31:17 +0000 @@ -232,9 +232,10 @@ given in the `defcustom' call. The default is `custom-initialize-reset'. :set VALUE should be a function to set the value of the symbol - when using the Customize user interface. - It takes two arguments, the symbol to set and the value to - give it. The default choice of function is `set-default'. + when using the Customize user interface. It takes two arguments, + the symbol to set and the value to give it. The function should + not modify its value argument destructively. The default choice + of function is `set-default'. :get VALUE should be a function to extract the value of symbol. The function takes one argument, a symbol, and should return the current value for that symbol. The default choice of function ------------------------------------------------------------ revno: 116798 committer: David Engster branch nick: trunk timestamp: Tue 2014-03-18 22:17:05 +0100 message: Add NEWS markup for CEDET. diff: === modified file 'etc/NEWS' --- etc/NEWS 2014-03-18 21:14:36 +0000 +++ etc/NEWS 2014-03-18 21:17:05 +0000 @@ -510,14 +510,17 @@ *** EDE ++++ **** The cpp-root project now supports executing a compile command. It can be set through the new :compile-command slot or the buffer-local variable `compile-command'. ++++ **** Better selection of include directories for the 'linux' project. Include directories now support out-of-tree build directories and target architecture auto-detection. +--- *** Semantic **** Improved detection of used namespaces in current scope in C++. ------------------------------------------------------------ revno: 116797 committer: Stefan Monnier branch nick: trunk timestamp: Tue 2014-03-18 17:14:36 -0400 message: * doc/lispref/modes.texi (Auto-Indentation): Mention electric-indent variables. * doc/misc/cc-mode.texi (Indentation Commands): Remove C-j, since it's not defined by CC-mode but globally. (FAQ): Tweak text about RET and auto-indentation. * doc/misc/vip.texi (Other Vi Commands): Adjust doc of C-j. diff: === modified file 'doc/emacs/basic.texi' --- doc/emacs/basic.texi 2014-03-03 05:12:12 +0000 +++ doc/emacs/basic.texi 2014-03-18 21:14:36 +0000 @@ -42,7 +42,7 @@ @kindex RET @kindex C-j @cindex newline -@findex electric-indent-just-newline +@c @findex electric-indent-just-newline To end a line and start a new one, type @key{RET} (@code{newline}). (The @key{RET} key may be labeled @key{Return} or @key{Enter} on your keyboard, but we refer to it as @key{RET} in this manual.) This === modified file 'doc/lispref/ChangeLog' --- doc/lispref/ChangeLog 2014-03-18 11:29:33 +0000 +++ doc/lispref/ChangeLog 2014-03-18 21:14:36 +0000 @@ -1,3 +1,7 @@ +2014-03-18 Stefan Monnier + + * modes.texi (Auto-Indentation): Mention electric-indent variables. + 2014-03-18 Juanma Barranquero * functions.texi (Advising Named Functions): Fix reference. === modified file 'doc/lispref/modes.texi' --- doc/lispref/modes.texi 2014-03-05 07:41:48 +0000 +++ doc/lispref/modes.texi 2014-03-18 21:14:36 +0000 @@ -3303,18 +3303,28 @@ @section Automatic Indentation of code For programming languages, an important feature of a major mode is to -provide automatic indentation. This is controlled in Emacs by -@code{indent-line-function} (@pxref{Mode-Specific Indent}). -Writing a good indentation function can be difficult and to a large -extent it is still a black art. - -Many major mode authors will start by writing a simple indentation -function that works for simple cases, for example by comparing with the -indentation of the previous text line. For most programming languages -that are not really line-based, this tends to scale very poorly: -improving such a function to let it handle more diverse situations tends -to become more and more difficult, resulting in the end with a large, -complex, unmaintainable indentation function which nobody dares to touch. +provide automatic indentation. There are two parts: one is to decide what +is the right indentation of a line, and the other is to decide when to +reindent a line. By default, Emacs reindents a line whenever you +type a character in @code{electric-indent-chars}, which by default only +includes Newline. Major modes can add chars to @code{electric-indent-chars} +according to the syntax of the language. + +Deciding what is the right indentation is controlled in Emacs by +@code{indent-line-function} (@pxref{Mode-Specific Indent}). For some modes, +the @emph{right} indentation cannot be known reliably, typically because +indentation is significant so several indentations are valid but with different +meanings. In that case, the mode should set @code{electric-indent-inhibit} to +make sure the line is not constantly re-indented against the user's wishes. + +Writing a good indentation function can be difficult and to a large extent it +is still a black art. Many major mode authors will start by writing a simple +indentation function that works for simple cases, for example by comparing with +the indentation of the previous text line. For most programming languages that +are not really line-based, this tends to scale very poorly: improving +such a function to let it handle more diverse situations tends to become more +and more difficult, resulting in the end with a large, complex, unmaintainable +indentation function which nobody dares to touch. A good indentation function will usually need to actually parse the text, according to the syntax of the language. Luckily, it is not @@ -3332,7 +3342,7 @@ purpose of indentation it has the advantage of not needing to guess a ``safe'' starting point, and it generally enjoys the property that only a minimum of text will be analyzed to decide the indentation -of a line, so indentation will tend to be unaffected by syntax errors in +of a line, so indentation will tend to be less affected by syntax errors in some earlier unrelated piece of code. Parsing forward on the other hand is usually easier and has the advantage of making it possible to reindent efficiently a whole region at a time, with a single parse. === modified file 'doc/lispref/text.texi' --- doc/lispref/text.texi 2014-03-18 01:19:03 +0000 +++ doc/lispref/text.texi 2014-03-18 21:14:36 +0000 @@ -3946,7 +3946,7 @@ intervals with the same properties, and we kill the text of one interval and yank it back. The same interval-coalescence feature that rescues the other case causes trouble in this one: after yanking, we have just -one interval. One again, editing does not preserve the distinction +one interval. Once again, editing does not preserve the distinction between one interval and two. Insertion of text at the border between intervals also raises === modified file 'doc/misc/ChangeLog' --- doc/misc/ChangeLog 2014-03-18 21:12:42 +0000 +++ doc/misc/ChangeLog 2014-03-18 21:14:36 +0000 @@ -1,10 +1,18 @@ +2014-03-18 Stefan Monnier + + * vip.texi (Other Vi Commands): Adjust doc of C-j. + + * cc-mode.texi (Indentation Commands): Remove C-j, since it's not + defined by CC-mode but globally. + (FAQ): Tweak text about RET and auto-indentation. + 2014-03-18 David Engster * ede.texi (Project Local Variables): Remove reference to `ede-java-root' and the example using it. (Android projects, ede-java-root): Remove nodes since they are only in CEDET upstream (Bug#17030). All nodes updated. - (ede-cpp-root): Document the :compile-command slot. + (ede-cpp-root): Document the :compile-command slot. (ede-linux): Document new variables `project-linux-build-directory-default' and `project-linux-architecture-default'. @@ -11205,7 +11213,7 @@ 1998-03-01 Kim-Minh Kaplan - * gnus.texi (Easy Picons): Removed references to + * gnus.texi (Easy Picons): Remove references to `gnus-group-display-picons'. (Hard Picons): Ditto. === modified file 'doc/misc/cc-mode.texi' --- doc/misc/cc-mode.texi 2014-02-27 11:59:35 +0000 +++ doc/misc/cc-mode.texi 2014-03-18 21:14:36 +0000 @@ -751,13 +751,6 @@ @end itemize @table @asis -@c FIXME: This should be `electric-indent-just-newline' since GNU Emacs 24.4. -@item @kbd{C-j} (@code{newline-and-indent}) -@kindex C-j -@findex newline-and-indent -Inserts a newline and indents the new blank line, ready to start -typing. This is a standard (X)Emacs command. - @item @kbd{C-M-q} (@code{c-indent-exp}) @kindex C-M-q @findex c-indent-exp @@ -7054,19 +7047,20 @@ @item @kindex RET @kindex C-j -@emph{Why doesn't the @kbd{RET} key indent the new line?} -@c FIXME: `electric-indent-mode' is enabled by default in GNU Emacs 24.4. - -Emacs's convention is that @kbd{RET} just adds a newline, and that -@kbd{C-j} adds a newline and indents it. You can make @kbd{RET} do this -too by adding this to your @code{c-initialization-hook}: +@emph{Why does/doesn't the @kbd{RET} key indent the new line?} + +Emacs's convention used to be that @kbd{RET} just adds a newline, and that +@kbd{C-j} adds a newline and indents it. In Emacs-24.4, this convention was +reversed. + +If you use an older Emacs and you want @kbd{RET} do this +too, add this to your @code{c-initialization-hook}: @example (define-key c-mode-base-map "\C-m" 'c-context-line-break) @end example -@xref{Getting Started}. This is a very common question. If you want -this to be the default behavior, don't lobby us, lobby RMS@! @t{:-)} +@xref{Getting Started}. This was a very common question. @item @emph{How do I stop my code jumping all over the place when I type?} === modified file 'doc/misc/vip.texi' --- doc/misc/vip.texi 2014-02-27 11:59:35 +0000 +++ doc/misc/vip.texi 2014-03-18 21:14:36 +0000 @@ -1568,9 +1568,8 @@ @kindex 011 TAB (@code{indent-for-tab-command}) Indent line for current major mode (@code{indent-for-tab-command}). @item C-j -@c FIXME: This should be `electric-indent-just-newline' since GNU Emacs 24.4. -@kindex 012 @kbd{C-j} (@code{newline-and-indent}) -Insert a newline, then indent according to mode (@code{newline-and-indent}). +@kindex 012 @kbd{C-j} (@code{electric-indent-just-newline'} or @code{newline-and-indent}) +Insert a newline, and maybe indent according to mode. @item C-k @kindex 013 @kbd{C-k} (@code{kill-line}) Kill the rest of the current line; before a newline, kill the newline. === modified file 'etc/NEWS' --- etc/NEWS 2014-03-15 03:07:06 +0000 +++ etc/NEWS 2014-03-18 21:14:36 +0000 @@ -355,6 +355,7 @@ ** Indentation changes ++++ *** `electric-indent-mode' is now enabled by default. E.g., typing RET reindents the current line and indents the new line. `C-j' inserts a newline but does not indent. ------------------------------------------------------------ revno: 116796 committer: David Engster branch nick: trunk timestamp: Tue 2014-03-18 22:12:42 +0100 message: Document new EDE features. * ede.texi (ede-cpp-root): Document the :compile-command slot. (ede-linux): Document new variables `project-linux-build-directory-default' and `project-linux-architecture-default'. diff: === modified file 'doc/misc/ChangeLog' --- doc/misc/ChangeLog 2014-03-18 07:13:51 +0000 +++ doc/misc/ChangeLog 2014-03-18 21:12:42 +0000 @@ -4,6 +4,10 @@ `ede-java-root' and the example using it. (Android projects, ede-java-root): Remove nodes since they are only in CEDET upstream (Bug#17030). All nodes updated. + (ede-cpp-root): Document the :compile-command slot. + (ede-linux): Document new variables + `project-linux-build-directory-default' and + `project-linux-architecture-default'. 2014-03-12 Glenn Morris === modified file 'doc/misc/ede.texi' --- doc/misc/ede.texi 2014-03-18 07:13:51 +0000 +++ doc/misc/ede.texi 2014-03-18 21:12:42 +0000 @@ -792,6 +792,7 @@ (ede-cpp-root-project "NAME" :file "FILENAME" :include-path '( "/include" "../include" "/c/include" ) :system-include-path '( "/usr/include/c++/3.2.2/" ) + :compile-command "make compile" :spp-table '( ("MOOSE" . "") ("CONST" . "const") ) ) @end example @@ -809,6 +810,9 @@ names to include directories where system header files can be found. These will be applied to files in this project only. +With @code{:compile-command} you can provide a command which should be +run when calling @code{ede-compile-project}. + The @code{:spp-table} provides a list of project specific #define style macros that are unique to this project, passed in to the compiler on the command line, or are in special headers. @@ -911,6 +915,12 @@ It pre-populates the C Preprocessor symbol map for reasonable parsing, and has an optimized include file identification function. +Through the variables @code{project-linux-build-directory-default} and +@code{project-linux-architecture-default}, you can set the build +directory and its architecture, resp. The default is to assume that +the build happens in the source directory and to auto-detect the +architecture; if the auto-detection fails, you will be asked. + @node ede-generic-project, Custom Locate, ede-linux, Simple projects @subsection ede-generic-project ------------------------------------------------------------ revno: 116795 fixes bug: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=17031 committer: Stefan Monnier branch nick: trunk timestamp: Tue 2014-03-18 16:49:24 -0400 message: * lisp/simple.el (newline-and-indent): Do autofill. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2014-03-18 12:07:01 +0000 +++ lisp/ChangeLog 2014-03-18 20:49:24 +0000 @@ -1,3 +1,7 @@ +2014-03-18 Stefan Monnier + + * simple.el (newline-and-indent): Do autofill (bug#17031). + 2014-03-18 Dmitry Gutov * newcomment.el (comment-normalize-vars): Only add escaping check === modified file 'lisp/simple.el' --- lisp/simple.el 2014-03-14 18:01:39 +0000 +++ lisp/simple.el 2014-03-18 20:49:24 +0000 @@ -611,7 +611,7 @@ column specified by the function `current-left-margin'." (interactive "*") (delete-horizontal-space t) - (newline 1 t) + (newline nil t) (indent-according-to-mode)) (defun reindent-then-newline-and-indent () ------------------------------------------------------------ revno: 116794 committer: Richard Stallman branch nick: trunk timestamp: Tue 2014-03-18 09:22:01 -0400 message: Delete hunk mistakenly included in previous change. diff: === modified file 'lisp/dired.el' --- lisp/dired.el 2014-03-18 12:07:01 +0000 +++ lisp/dired.el 2014-03-18 13:22:01 +0000 @@ -3673,9 +3673,6 @@ set the minor mode accordingly, others appear literally in the mode line. With optional second arg NO-REVERT, don't refresh the listing afterwards." (dired-sort-R-check switches) - (unless (string-match "\\(\\`\\| \\)-\\([b-zA-Z]*\\)a" - switches) - (debug "No -a in Dired switches")) (setq dired-actual-switches switches) (dired-sort-set-mode-line) (or no-revert (revert-buffer))) ------------------------------------------------------------ revno: 116793 author: Richard Stallman committer: Richard Stallman branch nick: trunk timestamp: Tue 2014-03-18 08:07:01 -0400 message: Ensure dired-display-file displays it in other window. * dired.el (dired-display-file): Force use of other window. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2014-03-18 06:06:33 +0000 +++ lisp/ChangeLog 2014-03-18 12:07:01 +0000 @@ -7,6 +7,10 @@ (http://lists.gnu.org/archive/html/emacs-devel/2014-03/msg00488.html) (comment-start-skip): Update the docstring. +2014-03-18 Richard Stallman + + * dired.el (dired-display-file): Force use of other window. + 2014-03-18 Daniel Colascione * startup.el (tty-handle-args): Remove debug message from 2007. @@ -1600,6 +1604,7 @@ * net/shr.el (shr-tag-img): Prefer the title over the alt text (bug#16537). +>>>>>>> MERGE-SOURCE 2014-01-24 Juanma Barranquero * net/eww.el (eww-download-callback): === modified file 'lisp/dired.el' --- lisp/dired.el 2014-03-16 09:26:58 +0000 +++ lisp/dired.el 2014-03-18 12:07:01 +0000 @@ -2136,7 +2136,8 @@ (defun dired-display-file () "In Dired, display this file or directory in another window." (interactive) - (display-buffer (find-file-noselect (dired-get-file-for-visit)))) + (display-buffer (find-file-noselect (dired-get-file-for-visit)) + t)) ;;; Functions for extracting and manipulating file names in Dired buffers. @@ -3639,6 +3640,7 @@ ;; Remove a switch of the form -XtY for some X and Y. (setq dired-actual-switches (replace-match "" t t dired-actual-switches 3)))) + ;; Now, if we weren't sorting by date before, add the -t switch. ;; Some simple-minded ls implementations (eg ftp servers) only ;; allow a single option string, so try not to add " -t" if possible. @@ -3671,6 +3673,9 @@ set the minor mode accordingly, others appear literally in the mode line. With optional second arg NO-REVERT, don't refresh the listing afterwards." (dired-sort-R-check switches) + (unless (string-match "\\(\\`\\| \\)-\\([b-zA-Z]*\\)a" + switches) + (debug "No -a in Dired switches")) (setq dired-actual-switches switches) (dired-sort-set-mode-line) (or no-revert (revert-buffer))) ------------------------------------------------------------ revno: 116792 committer: Juanma Barranquero branch nick: trunk timestamp: Tue 2014-03-18 12:29:33 +0100 message: doc/lispref/functions.texi (Advising Named Functions): Fix reference. diff: === modified file 'doc/lispref/ChangeLog' --- doc/lispref/ChangeLog 2014-03-18 04:03:59 +0000 +++ doc/lispref/ChangeLog 2014-03-18 11:29:33 +0000 @@ -1,3 +1,7 @@ +2014-03-18 Juanma Barranquero + + * functions.texi (Advising Named Functions): Fix reference. + 2014-03-18 Paul Eggert Improve documentation for integer and floating-point basics. === modified file 'doc/lispref/functions.texi' --- doc/lispref/functions.texi 2014-03-18 01:51:12 +0000 +++ doc/lispref/functions.texi 2014-03-18 11:29:33 +0000 @@ -1433,7 +1433,7 @@ @defun advice-add symbol where function &optional props Add the advice @var{function} to the named function @var{symbol}. @var{where} and @var{props} have the same meaning as for @code{add-function} -(@pxref{Advising Primitives}). +(@pxref{Core Advising Primitives}). @end defun @defun advice-remove symbol function ------------------------------------------------------------ revno: 116791 committer: David Engster branch nick: trunk timestamp: Tue 2014-03-18 08:13:51 +0100 message: ede.texi: Remove documentation for features only in CEDET upstream. * ede.texi (Project Local Variables): Remove reference to `ede-java-root' and the example using it. (Android projects, ede-java-root): Remove nodes since they are only in CEDET upstream (Bug#17030). All nodes updated. diff: === modified file 'doc/misc/ChangeLog' --- doc/misc/ChangeLog 2014-03-12 20:57:34 +0000 +++ doc/misc/ChangeLog 2014-03-18 07:13:51 +0000 @@ -1,3 +1,10 @@ +2014-03-18 David Engster + + * ede.texi (Project Local Variables): Remove reference to + `ede-java-root' and the example using it. + (Android projects, ede-java-root): Remove nodes since they are + only in CEDET upstream (Bug#17030). All nodes updated. + 2014-03-12 Glenn Morris * eww.texi (History and Acknowledgments): === modified file 'doc/misc/ede.texi' --- doc/misc/ede.texi 2014-03-03 17:15:42 +0000 +++ doc/misc/ede.texi 2014-03-18 07:13:51 +0000 @@ -598,17 +598,6 @@ (compile-command . "make -f MyCustomMakefile all"))) @end example -The same is true when you use project-local variables with -@ref{ede-java-root}. For example: - -@example -(ede-java-root-project "SOMENAME" - :file "/dir/to/some/file" - :local-variables - '((grep-command . "grep -nHi -e ") - (compile-command . "ant"))) -@end example - @node EDE Project Features, , Project Local Variables, Modifying your project @section EDE Project Features @@ -724,12 +713,10 @@ @menu * Make and Automake projects:: Project types of @samp{ede-project} * Automake direct projects:: Project interface on hand-written automake files. -* Android projects:: Projects for Android development -* Arduino projects:: Projects for Arduino sketches * Simple projects:: Projects @ede{} doesn't manage. @end menu -@node Make and Automake projects +@node Make and Automake projects, Automake direct projects, Miscellaneous commands, Miscellaneous commands @section Make and Automake projects A project of @samp{ede-project} type creates a file called @@ -741,7 +728,7 @@ routines will also import and maintain a configure.am script and a host of other files required by Automake. -@node Automake direct projects +@node Automake direct projects, Simple projects, Make and Automake projects, Miscellaneous commands @section Automake direct projects The project type that reads @file{Makefile.am} directly is derived @@ -751,39 +738,7 @@ not generate them automatically, or create new ones. As such, it is useful as a browsing tool, or as maintenance in managing file lists. -@node Android projects -@section Android projects - -An Android project of type @samp{ede-android-project} will detect and -support development of Android apps. Android projects use an -@file{AndroidManifest.xml} file. Always load your Manifest first in a -running Emacs to make sure the project is identified correctly. - -Android projects can be created with @code{ede-new} but depend on a -correctly configured Android SDK via @cedet{} support. - -@defun cedet-android-sdk-root -@anchor{cedet-android-sdk-root} -The root to the Android @var{SDK}. -@end defun - -Android projects support different configurations including compile, -and install, which will upload a program to your Android device. It -also supports several debugging tools via @file{android.el}. - -@node Arduino projects -@section Arduino projects - -An arduino project of type @samp{ede-arduino-project} will read your -@file{~/.arduino/preferences.txt} file, and identify your sketches. -You will still need the Arduino IDE to set up your preferences and -locate your arduino. After quitting the IDE, Emacs will be able to -find your sketches, compile them, and upload them to your arduino. - -If you have the @file{arduino} command on your path, @ede{} will be -able to find your SDK and compile your programs. - -@node Simple projects +@node Simple projects, , Automake direct projects, Miscellaneous commands @section Simple Projects There is a wide array of simple projects. In this case a simple @@ -795,14 +750,13 @@ @menu * ede-cpp-root:: This project marks the root of a C/C++ code project. -* ede-java-root:: This project marks the root of a Java project. * ede-emacs:: A project for working with Emacs. * ede-linux:: A project for working with Linux kernels. * ede-generic-project:: A project type for wrapping build systems with EDE. * Custom Locate:: Customizing how to locate files in a simple project @end menu -@node ede-cpp-root, ede-java-root, Simple projects, Simple projects +@node ede-cpp-root, ede-emacs, Simple projects, Simple projects @subsection ede-cpp-root The @code{ede-cpp-root} project type allows you to create a single @@ -939,90 +893,7 @@ @xref{ede-cpp-root-project}, for details about the class that defines the @code{ede-cpp-root} project type. -@node ede-java-root, ede-emacs, ede-cpp-root, Simple projects -@subsection ede-java-root - -Much like the project type @ref{ede-cpp-root}, the java variant is -can be setup in your @file{.emacs} file and just marks a directory as -the root of a java source tree. - -The @code{ede-java-root} project class knows a few things about Java -projects. In particular, you can use it to control your classpath at -both the system level, and for your project. If it is insufficient, -you can subclass @code{ede-java-root-project} and add your own tweaks -in just a few lines. See @ref{ede-cpp-root} for an example using the -C++ variant. - -In the most basic case, add this to your @file{.emacs} file, modifying -appropriate bits as needed. - -@example -(ede-java-root-project "SOMENAME" :file "/dir/to/some/file" :srcroot '("src")) -@end example - -Replace @var{SOMENAME} with whatever name you want, and the filename -to an actual file at the root of your project. It might be a -Makefile, a README file. Whatever. It doesn't matter. It's just a -key to hang the rest of @ede{} off of. - -Replace the value of :srcroot with a list of directories under the -project root which contains Java sources. For example, if you have: - -@example -~/myprojects/P1/ -~/myprojects/P1/src/ -~/myprojects/P1/src/com/ericsoft/MyCode.java -~/myprojects/P1/doc/ -@end example - -Then @file{src} represents the directory under which all your Java -code is. It is important that @file{src} is one step above the -directory that is the base of your package name, such as -@file{com/ericsoft} in the example above so that new files can be -discovered via fully qualified name. You can have multiple such -directories in one project, and each will be accessible. - -You can specify your classpath like this: - -@example -(ede-java-root-project "NAME" :file "FILENAME" - :srcroot '("src") - :classpath '("/absolute/path.jar") - :localclasspath '( "/relative/path.jar" )) -@end example - -In this example, @code{:classpath} specifies absolute paths somewhere -on your system, and the explicit jar or source root directories -@semantic{} will search when performing completions. - -The @code{:localclasspath} is like @code{:classpath}, but it will -contain path names relative to the root of your project. - -If you want to override the file-finding tool with your own -function you can do this: - -@example -(ede-java-root-project "NAME" :file "FILENAME" :locate-fcn 'MYFCN) -@end example - -Where @var{MYFCN} is a symbol for a function. The locate function can -be used in place of @code{ede-expand-filename} so you can quickly -customize your custom target to use specialized local routines instead -of the default @ede{} routines. The function symbol must take two -arguments: - -@table @var -@item NAME -The name of the file to find. -@item DIR -The directory root for this java-root project. -@end table - -If you would like to create your Java projects dynamically, instead of -putting them all in your @file{.emacs}, you can do that too. See -@ref{ede-cpp-root} for details that can be applied to this project type. - -@node ede-emacs, ede-linux, ede-java-root, Simple projects +@node ede-emacs, ede-linux, ede-cpp-root, Simple projects @subsection ede-emacs The @code{ede-emacs} project automatically identifies an Emacs source @@ -4395,7 +4266,7 @@ @end table @end table -@node GNU Free Documentation License, , Extending EDE, Top +@node GNU Free Documentation License, , Extending EDE, Top @appendix GNU Free Documentation License @include doclicense.texi ------------------------------------------------------------ revno: 116790 fixes bug: http://debbugs.gnu.org/16971 committer: Dmitry Gutov branch nick: trunk timestamp: Tue 2014-03-18 08:06:33 +0200 message: Further tweaks for comment-start-skip behavior * lisp/newcomment.el (comment-normalize-vars): Only add escaping check to `comment-start-skip' if not `comment-use-syntax'. (comment-beginning): Use `narrow-to-region' instead of moving back one character. (http://lists.gnu.org/archive/html/emacs-devel/2014-03/msg00488.html) (comment-start-skip): Update the docstring. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2014-03-18 01:51:12 +0000 +++ lisp/ChangeLog 2014-03-18 06:06:33 +0000 @@ -1,3 +1,12 @@ +2014-03-18 Dmitry Gutov + + * newcomment.el (comment-normalize-vars): Only add escaping check + to `comment-start-skip' if not `comment-use-syntax'. (Bug#16971) + (comment-beginning): Use `narrow-to-region' instead of moving back + one character. + (http://lists.gnu.org/archive/html/emacs-devel/2014-03/msg00488.html) + (comment-start-skip): Update the docstring. + 2014-03-18 Daniel Colascione * startup.el (tty-handle-args): Remove debug message from 2007. === modified file 'lisp/newcomment.el' --- lisp/newcomment.el 2014-03-17 06:48:09 +0000 +++ lisp/newcomment.el 2014-03-18 06:06:33 +0000 @@ -120,8 +120,9 @@ ;;;###autoload (defvar comment-start-skip nil "Regexp to match the start of a comment plus everything up to its body. -If there are any \\(...\\) pairs, the comment delimiter text is held to begin -at the place matched by the close of the first pair.") +If there are any \\(...\\) pairs and `comment-use-syntax' is nil, +the comment delimiter text is held to begin at the place matched +by the close of the first pair.") ;;;###autoload (put 'comment-start-skip 'safe-local-variable 'stringp) @@ -378,7 +379,10 @@ ;; In case comment-start has changed since last time. (string-match comment-start-skip comment-start)) (set (make-local-variable 'comment-start-skip) - (concat "\\(\\(^\\|[^\\\n]\\)\\(\\\\\\\\\\)*\\)\\(\\s<+\\|" + (concat (unless (eq comment-use-syntax t) + ;; `syntax-ppss' will detect escaping. + "\\(\\(^\\|[^\\\n]\\)\\(\\\\\\\\\\)*\\)") + "\\(\\s<+\\|" (regexp-quote (comment-string-strip comment-start t t)) ;; Let's not allow any \s- but only [ \t] since \n ;; might be both a comment-end marker and \s-. @@ -523,12 +527,11 @@ (when (nth 4 state) (goto-char (nth 8 state)) (prog1 (point) - (when (or (looking-at comment-start-skip) - ;; Some older modes use regexps that check the - ;; char before the comment for quoting. (Bug#16971) - (save-excursion - (forward-char -1) - (looking-at comment-start-skip))) + (when (save-restriction + ;; `comment-start-skip' sometimes checks that the + ;; comment char is not escaped. (Bug#16971) + (narrow-to-region (point) (point-max)) + (looking-at comment-start-skip)) (goto-char (match-end 0)))))) ;; Can't rely on the syntax table, let's guess based on font-lock. (unless (eq (get-text-property (point) 'face) 'font-lock-string-face) ------------------------------------------------------------ revno: 116789 committer: Paul Eggert branch nick: trunk timestamp: Mon 2014-03-17 21:03:59 -0700 message: Improve documentation for integer and floating-point basics. * numbers.texi (Numbers, Integer Basics, Float Basics): Document the basics a bit more precisely. Say more clearly that Emacs floating-point numbers are IEEE doubles on all current platforms. Give more details about frexp. Say more clearly that '1.' is an integer. (Predicates on Numbers): Fix wholenump typo. * objects.texi (Integer Type): Adjust to match numbers.texi. diff: === modified file 'doc/lispref/ChangeLog' --- doc/lispref/ChangeLog 2014-03-18 03:22:59 +0000 +++ doc/lispref/ChangeLog 2014-03-18 04:03:59 +0000 @@ -1,3 +1,14 @@ +2014-03-18 Paul Eggert + + Improve documentation for integer and floating-point basics. + * numbers.texi (Numbers, Integer Basics, Float Basics): + Document the basics a bit more precisely. Say more clearly + that Emacs floating-point numbers are IEEE doubles on all + current platforms. Give more details about frexp. + Say more clearly that '1.' is an integer. + (Predicates on Numbers): Fix wholenump typo. + * objects.texi (Integer Type): Adjust to match numbers.texi. + 2014-03-18 Stefan Monnier * functions.texi (Advising Functions): Try and improve the text. === modified file 'doc/lispref/numbers.texi' --- doc/lispref/numbers.texi 2014-03-18 01:19:03 +0000 +++ doc/lispref/numbers.texi 2014-03-18 04:03:59 +0000 @@ -9,13 +9,14 @@ @cindex numbers GNU Emacs supports two numeric data types: @dfn{integers} and -@dfn{floating point numbers}. Integers are whole numbers such as -@minus{}3, 0, 7, 13, and 511. Their values are exact. Floating-point -numbers are numbers with fractional parts, such as @minus{}4.5, 0.0, or -2.71828. They can also be expressed in exponential notation: 1.5e2 -equals 150; in this example, @samp{e2} stands for ten to the second -power, and that is multiplied by 1.5. Floating point values are not -exact; they have a fixed, limited amount of precision. +@dfn{floating-point numbers}. Integers are whole numbers such as +@minus{}3, 0, 7, 13, and 511. Floating-point numbers are numbers with +fractional parts, such as @minus{}4.5, 0.0, and 2.71828. They can +also be expressed in exponential notation: @samp{1.5e2} is the same as +@samp{150.0}; here, @samp{e2} stands for ten to the second power, and +that is multiplied by 1.5. Integer computations are exact, though +they may overflow. Floating-point computations often involve rounding +errors, as the numbers have a fixed amount of precision. @menu * Integer Basics:: Representation and range of integers. @@ -34,7 +35,7 @@ @section Integer Basics The range of values for an integer depends on the machine. The -minimum range is @minus{}536870912 to 536870911 (30 bits; i.e., +minimum range is @minus{}536,870,912 to 536,870,911 (30 bits; i.e., @ifnottex @minus{}2**29 @end ifnottex @@ -61,7 +62,8 @@ 1. ; @r{The integer 1.} +1 ; @r{Also the integer 1.} -1 ; @r{The integer @minus{}1.} - 1073741825 ; @r{The floating point number 1073741825.0.} + 9000000000000000000 + ; @r{The floating-point number 9e18.} 0 ; @r{The integer 0.} -0 ; @r{The integer 0.} @end example @@ -148,15 +150,43 @@ @cindex largest Lisp integer @cindex maximum Lisp integer @defvar most-positive-fixnum -The value of this variable is the largest integer that Emacs Lisp -can handle. +The value of this variable is the largest integer that Emacs Lisp can +handle. Typical values are +@ifnottex +2**29 @minus{} 1 +@end ifnottex +@tex +@math{2^{29}-1} +@end tex +on 32-bit and +@ifnottex +2**61 @minus{} 1 +@end ifnottex +@tex +@math{2^{61}-1} +@end tex +on 64-bit platforms. @end defvar @cindex smallest Lisp integer @cindex minimum Lisp integer @defvar most-negative-fixnum The value of this variable is the smallest integer that Emacs Lisp can -handle. It is negative. +handle. It is negative. Typical values are +@ifnottex +@minus{}2**29 +@end ifnottex +@tex +@math{-2^{29}} +@end tex +on 32-bit and +@ifnottex +@minus{}2**61 +@end ifnottex +@tex +@math{-2^{61}} +@end tex +on 64-bit platforms. @end defvar In Emacs Lisp, text characters are represented by integers. Any @@ -168,22 +198,25 @@ @cindex @acronym{IEEE} floating point Floating-point numbers are useful for representing numbers that are -not integral. The precise range of floating-point numbers is -machine-specific; it is the same as the range of the C data type -@code{double} on the machine you are using. Emacs uses the -@acronym{IEEE} floating-point standard, which is supported by all -modern computers. +not integral. The range of floating-point numbers is +the same as the range of the C data type @code{double} on the machine +you are using. On all computers currently supported by Emacs, this is +double-precision @acronym{IEEE} floating point. The read syntax for floating-point numbers requires either a decimal -point (with at least one digit following), an exponent, or both. For -example, @samp{1500.0}, @samp{15e2}, @samp{15.0e2}, @samp{1.5e3}, and -@samp{.15e4} are five ways of writing a floating-point number whose -value is 1500. They are all equivalent. You can also use a minus -sign to write negative floating-point numbers, as in @samp{-1.0}. +point, an exponent, or both. Optional signs (@samp{+} or @samp{-}) +precede the number and its exponent. For example, @samp{1500.0}, +@samp{+15e2}, @samp{15.0e+2}, @samp{+1500000e-3}, and @samp{.15e4} are +five ways of writing a floating-point number whose value is 1500. +They are all equivalent. Like Common Lisp, Emacs Lisp requires at +least one digit after any decimal point in a floating-point number; +@samp{1500.} is an integer, not a floating-point number. - Emacs Lisp treats @code{-0.0} as numerically equal to ordinary zero (with -respect to @code{equal} and @code{=}), even though the two are -distinguishable in the @acronym{IEEE} floating-point standard. + Emacs Lisp treats @code{-0.0} as numerically equal to ordinary zero +with respect to @code{equal} and @code{=}. This follows the +@acronym{IEEE} floating-point standard, which says @code{-0.0} and +@code{0.0} are numerically equal even though other operations can +distinguish them. @cindex positive infinity @cindex negative infinity @@ -193,58 +226,53 @@ infinity and negative infinity as floating-point values. It also provides for a class of values called NaN or ``not-a-number''; numerical functions return such values in cases where there is no -correct answer. For example, @code{(/ 0.0 0.0)} returns a NaN@. (NaN -values can also carry a sign, but for practical purposes there's no -significant difference between different NaN values in Emacs Lisp.) - -When a function is documented to return a NaN, it returns an -implementation-defined value when Emacs is running on one of the -now-rare platforms that do not use @acronym{IEEE} floating point. For -example, @code{(log -1.0)} typically returns a NaN, but on -non-@acronym{IEEE} platforms it returns an implementation-defined -value. - -Here are the read syntaxes for these special floating-point values: +correct answer. For example, @code{(/ 0.0 0.0)} returns a NaN@. +Although NaN values carry a sign, for practical purposes there is no other +significant difference between different NaN values in Emacs Lisp. + +Here are read syntaxes for these special floating-point values: @table @asis -@item positive infinity -@samp{1.0e+INF} -@item negative infinity -@samp{-1.0e+INF} -@item Not-a-number -@samp{0.0e+NaN} or @samp{-0.0e+NaN}. +@item infinity +@samp{1.0e+INF} and @samp{-1.0e+INF} +@item not-a-number +@samp{0.0e+NaN} and @samp{-0.0e+NaN} @end table -@defun isnan number -This predicate tests whether its argument is NaN, and returns @code{t} -if so, @code{nil} otherwise. The argument must be a number. -@end defun - - The following functions are specialized for handling floating point + The following functions are specialized for handling floating-point numbers: +@defun isnan x +This predicate returns @code{t} if its floating-point argument is a NaN, +@code{nil} otherwise. +@end defun + @defun frexp x -This function returns a cons cell @code{(@var{sig} . @var{exp})}, -where @var{sig} and @var{exp} are respectively the significand and -exponent of the floating point number @var{x}: - -@smallexample -@var{x} = @var{sig} * 2^@var{exp} -@end smallexample - -@var{sig} is a floating point number between 0.5 (inclusive) and 1.0 -(exclusive). If @var{x} is zero, the return value is @code{(0 . 0)}. +This function returns a cons cell @code{(@var{s} . @var{e})}, +where @var{s} and @var{e} are respectively the significand and +exponent of the floating-point number @var{x}. + +If @var{x} is finite, @var{s} is a floating-point number between 0.5 +(inclusive) and 1.0 (exclusive), @var{e} is an integer, and +@ifnottex +@var{x} = @var{s} * 2**@var{e}. +@end ifnottex +@tex +@math{x = s 2^e}. +@end tex +If @var{x} is zero or infinity, @var{s} is the same as @var{x}. +If @var{x} is a NaN, @var{s} is also a NaN. +If @var{x} is zero, @var{e} is 0. @end defun @defun ldexp sig &optional exp -This function returns a floating point number corresponding to the +This function returns a floating-point number corresponding to the significand @var{sig} and exponent @var{exp}. @end defun @defun copysign x1 x2 This function copies the sign of @var{x2} to the value of @var{x1}, -and returns the result. @var{x1} and @var{x2} must be floating point -numbers. +and returns the result. @var{x1} and @var{x2} must be floating point. @end defun @defun logb number @@ -293,8 +321,8 @@ returns @code{t} if so, @code{nil} otherwise. 0 is considered non-negative. -@findex wholenump number -This is a synonym for @code{natnump}. +@findex wholenump +@code{wholenump} is a synonym for @code{natnump}. @end defun @defun zerop number @@ -532,8 +560,8 @@ floating-point arguments, and returns a floating-point number if any argument is floating point. - It is important to note that in Emacs Lisp, arithmetic functions -do not check for overflow. Thus @code{(1+ 536870911)} may evaluate to + Emacs Lisp arithmetic functions do not check for integer overflow. +Thus @code{(1+ 536870911)} may evaluate to @minus{}536870912, depending on your hardware. @defun 1+ number-or-marker === modified file 'doc/lispref/objects.texi' --- doc/lispref/objects.texi 2014-03-18 01:19:03 +0000 +++ doc/lispref/objects.texi 2014-03-18 04:03:59 +0000 @@ -161,8 +161,8 @@ @node Integer Type @subsection Integer Type - The range of values for integers in Emacs Lisp is @minus{}536870912 to -536870911 (30 bits; i.e., + The range of values for an integer depends on the machine. The +minimum range is @minus{}536,870,912 to 536,870,911 (30 bits; i.e., @ifnottex @minus{}2**29 @end ifnottex @@ -176,9 +176,9 @@ @tex @math{2^{29}-1}) @end tex -on typical 32-bit machines. (Some machines provide a wider range.) -Emacs Lisp arithmetic functions do not check for overflow. Thus -@code{(1+ 536870911)} is @minus{}536870912 if Emacs integers are 30 bits. +but many machines provide a wider range. +Emacs Lisp arithmetic functions do not check for integer overflow. Thus +@code{(1+ 536870911)} is @minus{}536,870,912 if Emacs integers are 30 bits. The read syntax for integers is a sequence of (base ten) digits with an optional sign at the beginning and an optional period at the end. The @@ -215,8 +215,8 @@ The printed representation for floating-point numbers requires either a decimal point (with at least one digit following), an exponent, or -both. For example, @samp{1500.0}, @samp{15e2}, @samp{15.0e2}, -@samp{1.5e3}, and @samp{.15e4} are five ways of writing a floating-point +both. For example, @samp{1500.0}, @samp{+15e2}, @samp{15.0e+2}, +@samp{+1500000e-3}, and @samp{.15e4} are five ways of writing a floating-point number whose value is 1500. They are all equivalent. @xref{Numbers}, for more information. ------------------------------------------------------------ revno: 116788 committer: Juanma Barranquero branch nick: trunk timestamp: Tue 2014-03-18 04:22:59 +0100 message: doc/lispref/ChangeLog: Trivial fixes. diff: === modified file 'doc/lispref/ChangeLog' --- doc/lispref/ChangeLog 2014-03-18 01:51:12 +0000 +++ doc/lispref/ChangeLog 2014-03-18 03:22:59 +0000 @@ -1,4 +1,4 @@ -2014-03-18 Stefan +2014-03-18 Stefan Monnier * functions.texi (Advising Functions): Try and improve the text. Add example use of advice-add (bug#16959). @@ -173,8 +173,8 @@ 2014-02-22 Stefan Monnier - * functions.texi (Declare Form): Document gv-expander, gv-setter, and - compiler-macro (bug#16829, bug#15093). + * functions.texi (Declare Form): Document gv-expander, gv-setter, + and compiler-macro (bug#16829, bug#15093). 2014-02-21 Juanma Barranquero @@ -738,7 +738,8 @@ 2013-09-21 Xue Fuqiao - * nonascii.texi (Coding System Basics): Add information about carriage-return. + * nonascii.texi (Coding System Basics): Add information about + carriage-return. 2013-09-14 Eli Zaretskii @@ -887,7 +888,8 @@ 2013-07-31 Xue Fuqiao * nonascii.texi (Non-ASCII Characters): Update menu. - (Disabling Multibyte): Move here from doc/emacs/mule.texi. Fix cross-references. + (Disabling Multibyte): Move here from doc/emacs/mule.texi. + Fix cross-references. * elisp.texi (Top): Update menu. ------------------------------------------------------------ revno: 116787 fixes bug: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=16959 committer: Stefan Monnier branch nick: trunk timestamp: Mon 2014-03-17 21:51:12 -0400 message: * doc/lispref/functions.texi (Advising Functions): Try and improve the text. Add example use of advice-add. (Core Advising Primitives): Rename. Explain handling of interactive specs, including advice-eval-interactive-spec. (Advising Named Functions): Try and better explain the difference with add-function. (Porting old advices): New node. diff: === modified file 'doc/lispref/ChangeLog' --- doc/lispref/ChangeLog 2014-03-18 01:19:03 +0000 +++ doc/lispref/ChangeLog 2014-03-18 01:51:12 +0000 @@ -1,3 +1,13 @@ +2014-03-18 Stefan + + * functions.texi (Advising Functions): Try and improve the text. + Add example use of advice-add (bug#16959). + (Core Advising Primitives): Rename. Explain handling of interactive + specs, including advice-eval-interactive-spec. + (Advising Named Functions): Try and better explain the difference with + add-function. + (Porting old advices): New node. + 2014-03-18 Paul Eggert Style fixes for floating-point doc. @@ -16,8 +26,7 @@ * display.texi (Temporary Displays): Rewrite descriptions of `with-output-to-temp-buffer' and `with-temp-buffer-window'. - * help.texi (Help Functions): Rewrite description of - `with-help-window'. + * help.texi (Help Functions): Rewrite description of `with-help-window'. 2014-03-15 Dmitry Gutov @@ -34,12 +43,10 @@ 2014-03-09 Martin Rudalics - * elisp.texi (Top): Rename section "Width" to "Size of Displayed - Text". + * elisp.texi (Top): Rename section "Width" to "Size of Displayed Text". * text.texi (Primitive Indent): * strings.texi (String Basics): - * sequences.texi (Sequence Functions): Update references - accordingly. + * sequences.texi (Sequence Functions): Update references accordingly. * display.texi (Size of Displayed Text): Rename section from "Width". Add description for `window-text-pixel-size'. (Window Dividers): Reword description of window dividers. @@ -64,12 +71,12 @@ 2014-03-06 Martin Rudalics * frames.texi (Size and Position): Rewrite entries for - `fit-frame-to-buffer' and `fit-frame-to-buffer-margins'. Add - description for `fit-frame-to-buffer-sizes'. + `fit-frame-to-buffer' and `fit-frame-to-buffer-margins'. + Add description for `fit-frame-to-buffer-sizes'. * windows.texi (Resizing Windows): Add descriptions for pixelwise resizing. Add entries for `window-resize-pixelwise' - and `fit-window-to-buffer-horizontally'. Rewrite - `fit-window-to-buffer' entry. + and `fit-window-to-buffer-horizontally'. + Rewrite `fit-window-to-buffer' entry. 2014-03-06 Xue Fuqiao @@ -93,8 +100,7 @@ `window-min-height' and `window-min-width'. Remove description of `window-size-fixed-p' moving part of it to that of `window-size-fixed'. - (Resizing Windows): Mention dividers when talking about minimum - sizes. + (Resizing Windows): Mention dividers when talking about minimum sizes. 2014-03-05 Glenn Morris @@ -349,8 +355,7 @@ 2013-12-28 Chong Yidong - * modes.texi (Auto Major Mode): Document interpreter-mode-alist - change. + * modes.texi (Auto Major Mode): Document interpreter-mode-alist change. * buffers.texi (Modification Time): Document visited-file-modtime change. @@ -387,8 +392,7 @@ * display.texi (Font Selection): Tweak example. - * commands.texi (Event Input Misc): Document new arg to - input-pending-p. + * commands.texi (Event Input Misc): Document new arg to input-pending-p. * nonascii.texi (Specifying Coding Systems): Don't refer to emacs-mule-dos. @@ -633,7 +637,8 @@ * display.texi (Showing Images): Add an index for image-size. Use @code instead of @var for a normal variable. (Multi-Frame Images): Improve indexing. - (Button Buffer Commands): Use @code instead of @var for a normal variable. + (Button Buffer Commands): Use @code instead of @var for a normal + variable. (Abstract Display): Explain the meaning of Ewoc. 2013-10-27 Xue Fuqiao === modified file 'doc/lispref/functions.texi' --- doc/lispref/functions.texi 2014-02-28 10:31:26 +0000 +++ doc/lispref/functions.texi 2014-03-18 01:51:12 +0000 @@ -11,23 +11,23 @@ define them. @menu -* What Is a Function:: Lisp functions vs. primitives; terminology. -* Lambda Expressions:: How functions are expressed as Lisp objects. -* Function Names:: A symbol can serve as the name of a function. -* Defining Functions:: Lisp expressions for defining functions. -* Calling Functions:: How to use an existing function. -* Mapping Functions:: Applying a function to each element of a list, etc. -* Anonymous Functions:: Lambda expressions are functions with no names. -* Function Cells:: Accessing or setting the function definition +* What Is a Function:: Lisp functions vs. primitives; terminology. +* Lambda Expressions:: How functions are expressed as Lisp objects. +* Function Names:: A symbol can serve as the name of a function. +* Defining Functions:: Lisp expressions for defining functions. +* Calling Functions:: How to use an existing function. +* Mapping Functions:: Applying a function to each element of a list, etc. +* Anonymous Functions:: Lambda expressions are functions with no names. +* Function Cells:: Accessing or setting the function definition of a symbol. -* Closures:: Functions that enclose a lexical environment. -* Advising Functions:: Adding to the definition of a function. -* Obsolete Functions:: Declaring functions obsolete. -* Inline Functions:: Functions that the compiler will expand inline. -* Declare Form:: Adding additional information about a function. -* Declaring Functions:: Telling the compiler that a function is defined. -* Function Safety:: Determining whether a function is safe to call. -* Related Topics:: Cross-references to specific Lisp primitives +* Closures:: Functions that enclose a lexical environment. +* Advising Functions:: Adding to the definition of a function. +* Obsolete Functions:: Declaring functions obsolete. +* Inline Functions:: Functions that the compiler will expand inline. +* Declare Form:: Adding additional information about a function. +* Declaring Functions:: Telling the compiler that a function is defined. +* Function Safety:: Determining whether a function is safe to call. +* Related Topics:: Cross-references to specific Lisp primitives that have a special bearing on how functions work. @end menu @@ -208,10 +208,10 @@ the components of a lambda expression and what they do. @menu -* Lambda Components:: The parts of a lambda expression. -* Simple Lambda:: A simple example. -* Argument List:: Details and special features of argument lists. -* Function Documentation:: How to put documentation in a function. +* Lambda Components:: The parts of a lambda expression. +* Simple Lambda:: A simple example. +* Argument List:: Details and special features of argument lists. +* Function Documentation:: How to put documentation in a function. @end menu @node Lambda Components @@ -1142,19 +1142,32 @@ @cindex advising functions @cindex piece of advice -Any variable or object field which holds a function can be modified with the -appropriate setter function, such as @code{set-process-filter}, @code{fset}, or -@code{setq}, but those can be too blunt, completely throwing away the +When you need to modify a function defined in another library, or when you need +to modify a hook like @code{@var{foo}-function}, a process filter, or basically +any variable or object field which holds a function value, you can use the +appropriate setter function, such as @code{fset} or @code{defun} for named +functions, @code{setq} for hook variables, or @code{set-process-filter} for +process filters, but those are often too blunt, completely throwing away the previous value. -In order to modify such hooks in a more controlled way, Emacs provides the -macros @code{add-function} and @code{remove-function}, which let you modify the -existing function value by composing it with another function. - -For example, in order to trace the calls to a process filter, you can use: + The @dfn{advice} feature lets you add to the existing definition of +a function, by @dfn{advising the function}. This is a cleaner method +than redefining the whole function. + +Emacs's advice system provides two sets of primitives for that: the core set, +for function values held in variables and object fields (with the corresponding +primitives being @code{add-function} and @code{remove-function}) and another +set layered on top of it for named functions (with the main primitives being +@code{advice-add} and @code{advice-remove}). + +For example, in order to trace the calls to the process filter of a process +@var{proc}, you could use: @example -(add-function :before (process-filter proc) #'my-tracing-function) +(defun my-tracing-function (proc string) + (message "Proc %S received %S" proc string)) + +(add-function :before (process-filter @var{proc}) #'my-tracing-function) @end example This will cause the process's output to be passed first to @@ -1162,33 +1175,55 @@ When you're done with it, you can revert to the untraced behavior with: @example -(remove-function (process-filter proc) #'my-tracing-function) -@end example - -The argument @code{:before} specifies how the two functions are composed, since -there are many different ways to do it. The added function is also called an -@emph{advice}. - -The function cell of a symbol can be manipulated similarly, but since it can -contain other things than a plain function, you have to use @code{advice-add} -and @code{advice-remove} instead, which -@c use @code{add-function} and @code{remove-function} internally, but -know how to handle cases such as when the function cell holds a macro rather -than function, or when the function is autoloaded so the advice's activation -needs to be postponed. +(remove-function (process-filter @var{proc}) #'my-tracing-function) +@end example + +Similarly, if you want to trace the execution of the function named +@code{display-buffer}, you could use: + +@example +(defun his-tracing-function (orig-fun &rest args) + (message "display-buffer called with args %S" args) + (let ((res (apply orig-fun args))) + (message "display-buffer returned %S" res) + res)) + +(advice-add 'display-buffer :around #'his-tracing-function) +@end example + +and when you're tired of seeing this output, you can revert to the untraced +behavior with: + +@example +(advice-remove 'display-buffer #'his-tracing-function) +@end example + +The arguments @code{:before} and @code{:above} used in the above examples +specify how the two functions are composed, since there are many different +ways to do it. The added function is also called an @emph{advice}. @menu -* Advising Primitives:: Primitives to Manipulate Advices -* Advising Named Functions:: Advising Named Functions +* Core Advising Primitives:: Primitives to Manipulate Advices +* Advising Named Functions:: Advising Named Functions +* Porting old advices:: Adapting code using the old defadvice @end menu -@node Advising Primitives -@subsection Primitives to manipulate advice +@node Core Advising Primitives +@subsection Primitives to manipulate advices @defmac add-function where place function &optional props This macro is the handy way to add the advice @var{function} to the function stored in @var{place} (@pxref{Generalized Variables}). +If @var{function} is not interactive, then the combined function will inherit +the interactive spec, if any, of the original function. Else, the combined +function will be interactive and will use the interactive spec of +@var{function}. One exception: if the interactive spec of @var{function} +is a function (rather than an expression or a string), then the interactive +spec of the combined function will be a call to that function with as sole +argument the interactive spec of the original function. To interpret the spec +received as argument, use @code{advice-eval-interactive-spec}. + @var{where} determines how @var{function} is composed with the existing function. It can be one of the following: @@ -1340,21 +1375,39 @@ and its properties. @end defun +@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 +return a list of three elements, containing the boundaries of the region and +the current prefix argument. +@end defun + @node Advising Named Functions @subsection Advising Named Functions A common use of advice is for named functions and macros. -Since @code{add-function} does not know how to deal with macros and -autoloaded functions, Emacs provides a separate set of functions to -manipulate pieces of advice applied to named functions. - - Advice can be useful for altering the behavior of an existing -function without having to redefine the whole function. However, it -can be a source of bugs, since existing callers to the function may -assume the old behavior, and work incorrectly when the behavior is -changed by advice. Advice can also cause confusion in debugging, if -the person doing the debugging does not notice or remember that the -function has been modified by advice. +You could just use @code{add-function} as in: + +@example +(add-function :around (symbol-function '@var{fun}) #'his-tracing-function) +@end example + + But you should use @code{advice-add} and @code{advice-remove} for that +instead. This separate set of functions to manipulate pieces of advice applied +to named functions, offers the following extra features compared to +@code{add-function}: they know how to deal with macros and autoloaded +functions, they let @code{describe-function} preserve the original docstring as +well as document the added advice, and they let you add and remove advices +before a function is even defined. + + @code{advice-add} can be useful for altering the behavior of existing calls +to an existing function without having to redefine the whole function. +However, it can be a source of bugs, since existing callers to the function may +assume the old behavior, and work incorrectly when the behavior is changed by +advice. Advice can also cause confusion in debugging, if the person doing the +debugging does not notice or remember that the function has been modified +by advice. For these reasons, advice should be reserved for the cases where you cannot modify a function's behavior in any other way. If it is @@ -1400,6 +1453,88 @@ and its properties. @end defun +@node Porting old advices +@subsection Adapting code using the old defadvice + +A lot of code uses the old @code{defadvice} mechanism, which is largely made +obsolete by the new @code{advice-add}, whose implementation and semantics is +significantly simpler. + +An old advice such as: + +@example +(defadvice previous-line (before next-line-at-end + (&optional arg try-vscroll)) + "Insert an empty line when moving up from the top line." + (if (and next-line-add-newlines (= arg 1) + (save-excursion (beginning-of-line) (bobp))) + (progn + (beginning-of-line) + (newline)))) +@end example + +could be translated in the new advice mechanism into a plain function: + +@example +(defun previous-line--next-line-at-end (&optional arg try-vscroll) + "Insert an empty line when moving up from the top line." + (if (and next-line-add-newlines (= arg 1) + (save-excursion (beginning-of-line) (bobp))) + (progn + (beginning-of-line) + (newline)))) +@end example + +Obviously, this does not actually modify @code{previous-line}. For that the +old advice needed: +@example +(ad-activate 'previous-line) +@end example +whereas the new advice mechanism needs: +@example +(advice-add 'previous-line :before #'previous-line--next-line-at-end) +@end example + +Note that @code{ad-activate} had a global effect: it activated all pieces of +advice enabled for that specified function. If you wanted to only activate or +deactivate a particular advice, you needed to @emph{enable} or @emph{disable} +that advice with @code{ad-enable-advice} and @code{ad-disable-advice}. +The new mechanism does away with this distinction. + +An around advice such as: + +@example +(defadvice foo (around foo-around) + "Ignore case in `foo'." + (let ((case-fold-search t)) + ad-do-it)) +(ad-activate 'foo) +@end example + +could translate into: + +@example +(defun foo--foo-around (orig-fun &rest args) + "Ignore case in `foo'." + (let ((case-fold-search t)) + (apply orig-fun args))) +(advice-add 'foo :around #'foo--foo-around) +@end example + +Regarding the advice's @emph{class}, note that the new @code{:before} is not +quite equivalent to the old @code{before}, because in the old advice you could +modify the function's arguments (e.g., with @code{ad-set-arg}), and that would +affect the argument values seen by the original function, whereas in the new +@code{:before}, modifying an argument via @code{setq} in the advice has no +effect on the arguments seen by the original function. +When porting a @code{before} advice which relied on this behavior, you'll need +to turn it into a new @code{:around} or @code{:filter-args} advice instead. + +Similarly an old @code{after} advice could modify the returned value by +changing @code{ad-return-value}, whereas a new @code{:after} advice cannot, so +when porting such an old @code{after} advice, you'll need to turn it into a new +@code{:around} or @code{:filter-return} advice instead. + @node Obsolete Functions @section Declaring Functions Obsolete @cindex obsolete functions === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2014-03-18 01:13:00 +0000 +++ lisp/ChangeLog 2014-03-18 01:51:12 +0000 @@ -27,8 +27,8 @@ * newcomment.el (comment-beginning): If `comment-start-skip' doesn't match, move back one char and try again. (Bug#16971) - * emacs-lisp/lisp-mode.el (lisp-mode-variables): Set - `comment-use-syntax' to t to avoid the unnecessary runtime check. + * emacs-lisp/lisp-mode.el (lisp-mode-variables): + Set `comment-use-syntax' to t to avoid the unnecessary runtime check. Set `comment-start-skip' to a simpler value that doesn't try to check if the semicolon is escaped (this is handled by `syntax-ppss' now). (Bug#16971) ------------------------------------------------------------ revno: 116786 committer: Paul Eggert branch nick: trunk timestamp: Mon 2014-03-17 18:19:03 -0700 message: Style fixes for floating-point doc. * commands.texi, customize.texi, display.texi, elisp.texi, files.texi: * frames.texi, hash.texi, internals.texi, keymaps.texi, lists.texi: * minibuf.texi, nonascii.texi, numbers.texi, objects.texi, os.texi: * processes.texi, streams.texi, strings.texi, text.texi: * variables.texi, windows.texi: Hyphenate "floating-point" iff it precedes a noun. Reword to avoid nouns and hyphenation when that's easy. Prefer "integer" to "integer number" and "is floating point" to "is a floating point number". Prefer "@minus{}" to "-" when it's a minus. diff: === modified file 'doc/lispref/ChangeLog' --- doc/lispref/ChangeLog 2014-03-16 09:26:58 +0000 +++ doc/lispref/ChangeLog 2014-03-18 01:19:03 +0000 @@ -1,3 +1,17 @@ +2014-03-18 Paul Eggert + + Style fixes for floating-point doc. + * commands.texi, customize.texi, display.texi, elisp.texi, files.texi: + * frames.texi, hash.texi, internals.texi, keymaps.texi, lists.texi: + * minibuf.texi, nonascii.texi, numbers.texi, objects.texi, os.texi: + * processes.texi, streams.texi, strings.texi, text.texi: + * variables.texi, windows.texi: + Hyphenate "floating-point" iff it precedes a noun. + Reword to avoid nouns and hyphenation when that's easy. + Prefer "integer" to "integer number" and "is floating point" + to "is a floating point number". + Prefer "@minus{}" to "-" when it's a minus. + 2014-03-16 Martin Rudalics * display.texi (Temporary Displays): Rewrite descriptions of === modified file 'doc/lispref/commands.texi' --- doc/lispref/commands.texi 2014-02-28 01:49:25 +0000 +++ doc/lispref/commands.texi 2014-03-18 01:19:03 +0000 @@ -2471,7 +2471,7 @@ If @var{seconds} is non-@code{nil}, it should be a number specifying the maximum time to wait for input, in seconds. If no input arrives within that time, @code{read-event} stops waiting and returns -@code{nil}. A floating-point value for @var{seconds} means to wait +@code{nil}. A floating point @var{seconds} means to wait for a fractional number of seconds. Some systems support only a whole number of seconds; on these systems, @var{seconds} is rounded down. If @var{seconds} is @code{nil}, @code{read-event} waits as long as @@ -2915,8 +2915,8 @@ @code{sit-for} waited the full time with no input arriving (@pxref{Event Input Misc}). Otherwise, the value is @code{nil}. -The argument @var{seconds} need not be an integer. If it is a floating -point number, @code{sit-for} waits for a fractional number of seconds. +The argument @var{seconds} need not be an integer. If it is floating +point, @code{sit-for} waits for a fractional number of seconds. Some systems support only a whole number of seconds; on these systems, @var{seconds} is rounded down. @@ -2942,8 +2942,8 @@ the display. It pays no attention to available input. It returns @code{nil}. -The argument @var{seconds} need not be an integer. If it is a floating -point number, @code{sleep-for} waits for a fractional number of seconds. +The argument @var{seconds} need not be an integer. If it is floating +point, @code{sleep-for} waits for a fractional number of seconds. Some systems support only a whole number of seconds; on these systems, @var{seconds} is rounded down. === modified file 'doc/lispref/customize.texi' --- doc/lispref/customize.texi 2014-01-05 23:36:13 +0000 +++ doc/lispref/customize.texi 2014-03-18 01:19:03 +0000 @@ -571,7 +571,7 @@ The value must be a number (floating point or integer). @item float -The value must be a floating point number. +The value must be floating point. @item string The value must be a string. The customization buffer shows the string === modified file 'doc/lispref/display.texi' --- doc/lispref/display.texi 2014-03-16 09:26:58 +0000 +++ doc/lispref/display.texi 2014-03-18 01:19:03 +0000 @@ -554,8 +554,7 @@ @defopt echo-keystrokes This variable determines how much time should elapse before command -characters echo. Its value must be an integer or floating point number, -which specifies the +characters echo. Its value must be a number, and specifies the number of seconds to wait before echoing. If the user types a prefix key (such as @kbd{C-x}) and then delays this many seconds before continuing, the prefix key is echoed in the echo area. (Once echoing @@ -1508,7 +1507,7 @@ @table @code @item priority @kindex priority @r{(overlay property)} -This property's value (which should be a non-negative integer number) +This property's value (which should be a non-negative integer) determines the priority of the overlay. No priority, or @code{nil}, means zero. @@ -1949,14 +1948,14 @@ lines in a frame, using the @code{line-spacing} frame parameter (@pxref{Layout Parameters}). However, if the default value of @code{line-spacing} is non-@code{nil}, it overrides the -frame's @code{line-spacing} parameter. An integer value specifies the -number of pixels put below lines. A floating point number specifies +frame's @code{line-spacing} parameter. An integer specifies the +number of pixels put below lines. A floating-point number specifies the spacing relative to the frame's default line height. @vindex line-spacing You can specify the line spacing for all lines in a buffer via the -buffer-local @code{line-spacing} variable. An integer value specifies -the number of pixels put below lines. A floating point number +buffer-local @code{line-spacing} variable. An integer specifies +the number of pixels put below lines. A floating-point number specifies the spacing relative to the default frame line height. This overrides line spacings specified for the frame. @@ -2070,11 +2069,11 @@ The height of the font. In the simplest case, this is an integer in units of 1/10 point. -The value can also be a floating point number or a function, which +The value can also be floating point or a function, which specifies the height relative to an @dfn{underlying face} -(@pxref{Displaying Faces}). If the value is a floating point number, -that specifies the amount by which to scale the height of the -underlying face. If the value is a function, that function is called +(@pxref{Displaying Faces}). A floating-point value +specifies the amount by which to scale the height of the +underlying face. A function value is called with one argument, the height of the underlying face, and returns the height of the new face. If the function is passed an integer argument, it must return an integer. @@ -3320,7 +3319,7 @@ @item :size The font size---either a non-negative integer that specifies the pixel -size, or a floating point number that specifies the point size. +size, or a floating-point number that specifies the point size. @item :adstyle Additional typographic style information for the font, such as @@ -4104,7 +4103,7 @@ @table @code @item :width @var{width} -If @var{width} is an integer or floating point number, it specifies +If @var{width} is a number, it specifies that the space width should be @var{width} times the normal character width. @var{width} can also be a @dfn{pixel width} specification (@pxref{Pixel Specification}). @@ -4128,7 +4127,7 @@ @table @code @item :height @var{height} Specifies the height of the space. -If @var{height} is an integer or floating point number, it specifies +If @var{height} is a number, it specifies that the space height should be @var{height} times the normal character height. The @var{height} may also be a @dfn{pixel height} specification (@pxref{Pixel Specification}). @@ -4251,7 +4250,7 @@ (a partial area) of the image to display. The elements @var{y} and @var{x} specify the top left corner of the slice, within the image; @var{width} and @var{height} specify the width and height of the -slice. Integer values are numbers of pixels. A floating point number +slice. Integers are numbers of pixels. A floating-point number in the range 0.0--1.0 stands for that fraction of the width or height of the entire image. @@ -5072,7 +5071,7 @@ Otherwise, @var{slice} is a list @code{(@var{x} @var{y} @var{width} @var{height})} which specifies the @var{x} and @var{y} positions and @var{width} and @var{height} of the image area to insert. Integer -values are in units of pixels. A floating point number in the range +values are in units of pixels. A floating-point number in the range 0.0--1.0 stands for that fraction of the width or height of the entire image. @@ -5143,8 +5142,8 @@ larger than this limit. If the value is an integer, it directly specifies the maximum -image height and width, measured in pixels. If it is a floating -point number, it specifies the maximum image height and width +image height and width, measured in pixels. If it is floating +point, it specifies the maximum image height and width as a ratio to the frame height and width. If the value is non-numeric, there is no explicit limit on the size of images. === modified file 'doc/lispref/elisp.texi' --- doc/lispref/elisp.texi 2014-03-09 11:36:51 +0000 +++ doc/lispref/elisp.texi 2014-03-18 01:19:03 +0000 @@ -296,7 +296,7 @@ Programming Types * Integer Type:: Numbers without fractional parts. -* Floating Point Type:: Numbers with fractional parts and with a large range. +* Floating-Point Type:: Numbers with fractional parts and with a large range. * Character Type:: The representation of letters, numbers and control characters. * Symbol Type:: A multi-use object that refers to a function, @@ -361,7 +361,7 @@ * Comparison of Numbers:: Equality and inequality predicates. * Numeric Conversions:: Converting float to integer and vice versa. * Arithmetic Operations:: How to add, subtract, multiply and divide. -* Rounding Operations:: Explicitly rounding floating point numbers. +* Rounding Operations:: Explicitly rounding floating-point numbers. * Bitwise Operations:: Logical and, or, not, shifting. * Math Functions:: Trig, exponential and logarithmic functions. * Random Numbers:: Obtaining random integers, predictable or not. === modified file 'doc/lispref/files.texi' --- doc/lispref/files.texi 2014-01-24 03:51:52 +0000 +++ doc/lispref/files.texi 2014-03-18 01:19:03 +0000 @@ -1162,8 +1162,7 @@ @item The file's @acronym{UID}, normally as a string. However, if it does -not correspond to a named user, the value is an integer or a floating -point number. +not correspond to a named user, the value is a number. @item The file's @acronym{GID}, likewise. @@ -1187,8 +1186,8 @@ for the file, beyond the file's contents. @item -The size of the file in bytes. If the size is too large to fit in a -Lisp integer, this is a floating point number. +The size of the file in bytes. This is floating point if the size is +too large to fit in a Lisp integer. @item The file's modes, as a string of ten letters or dashes, @@ -1679,7 +1678,7 @@ @defun file-modes-symbolic-to-number modes &optional base-modes This function converts a symbolic file mode specification in -@var{modes} into the equivalent integer value. If the symbolic +@var{modes} into the equivalent integer. If the symbolic specification is based on an existing file, that file's mode bits are taken from the optional argument @var{base-modes}; if that argument is omitted or @code{nil}, it defaults to 0, i.e., no access rights at === modified file 'doc/lispref/frames.texi' --- doc/lispref/frames.texi 2014-03-14 10:38:46 +0000 +++ doc/lispref/frames.texi 2014-03-18 01:19:03 +0000 @@ -998,7 +998,7 @@ @cindex gamma correction If this is a number, Emacs performs ``gamma correction'' which adjusts the brightness of all colors. The value should be the screen gamma of -your display, a floating point number. +your display. Usual PC monitors have a screen gamma of 2.2, so color values in Emacs, and in X windows generally, are calibrated to display properly === modified file 'doc/lispref/hash.texi' --- doc/lispref/hash.texi 2014-01-20 20:05:04 +0000 +++ doc/lispref/hash.texi 2014-03-18 01:19:03 +0000 @@ -73,7 +73,7 @@ @item eql Keys which are numbers are ``the same'' if they are @code{equal}, that is, if they are equal in value and either both are integers or both -are floating point numbers; otherwise, two distinct objects are never +are floating point; otherwise, two distinct objects are never ``the same''. @item eq @@ -134,7 +134,7 @@ If @var{rehash-size} is an integer, it should be positive, and the hash table grows by adding that much to the nominal size. If -@var{rehash-size} is a floating point number, it had better be greater +@var{rehash-size} is floating point, it had better be greater than 1, and the hash table grows by multiplying the old size by that number. @@ -143,7 +143,7 @@ @item :rehash-threshold @var{threshold} This specifies the criterion for when the hash table is ``full'' (so it should be made larger). The value, @var{threshold}, should be a -positive floating point number, no greater than 1. The hash table is +positive floating-point number, no greater than 1. The hash table is ``full'' whenever the actual number of entries exceeds this fraction of the nominal size. The default for @var{threshold} is 0.8. @end table @@ -266,7 +266,7 @@ The function @var{hash-fn} should accept one argument, a key, and return an integer that is the ``hash code'' of that key. For good results, the -function should use the whole range of integer values for hash codes, +function should use the whole range of integers for hash codes, including negative integers. The specified functions are stored in the property list of @var{name} === modified file 'doc/lispref/internals.texi' --- doc/lispref/internals.texi 2014-03-06 12:39:47 +0000 +++ doc/lispref/internals.texi 2014-03-18 01:19:03 +0000 @@ -517,8 +517,8 @@ @defvar gc-elapsed This variable contains the total number of seconds of elapsed time -during garbage collection so far in this Emacs session, as a floating -point number. +during garbage collection so far in this Emacs session, as a +floating-point number. @end defvar @node Memory Usage @@ -917,7 +917,7 @@ vectorlike or miscellaneous object. Each of these data types has the corresponding tag value. All tags are enumerated by @code{enum Lisp_Type} and placed into a 3-bit bitfield of the @code{Lisp_Object}. The rest of the -bits is the value itself. Integer values are immediate, i.e., directly +bits is the value itself. Integers are immediate, i.e., directly represented by those @dfn{value bits}, and all other objects are represented by the C pointers to a corresponding object allocated from the heap. Width of the @code{Lisp_Object} is platform- and configuration-dependent: usually @@ -945,7 +945,7 @@ Symbol, the unique-named entity commonly used as an identifier. @item struct Lisp_Float -Floating point value. +Floating-point value. @item union Lisp_Misc Miscellaneous kinds of objects which don't fit into any of the above. @@ -1606,7 +1606,7 @@ @item Prefer the Emacs-defined type @code{printmax_t} for representing -values that might be any signed integer value that can be printed, +values that might be any signed integer that can be printed, using a @code{printf}-family function. @item === modified file 'doc/lispref/keymaps.texi' --- doc/lispref/keymaps.texi 2014-02-08 03:46:53 +0000 +++ doc/lispref/keymaps.texi 2014-03-18 01:19:03 +0000 @@ -2760,7 +2760,7 @@ @defvar tool-bar-border This variable specifies the height of the border drawn below the tool -bar area. An integer value specifies height as a number of pixels. +bar area. An integer specifies height as a number of pixels. If the value is one of @code{internal-border-width} (the default) or @code{border-width}, the tool bar border height corresponds to the corresponding frame parameter. === modified file 'doc/lispref/lists.texi' --- doc/lispref/lists.texi 2014-01-01 07:43:34 +0000 +++ doc/lispref/lists.texi 2014-03-18 01:19:03 +0000 @@ -646,8 +646,8 @@ numerically equal to @var{from}, @code{number-sequence} signals an error, since those arguments specify an infinite sequence. -All arguments can be integers or floating point numbers. However, -floating point arguments can be tricky, because floating point +All arguments are numbers. +Floating-point arguments can be tricky, because floating-point arithmetic is inexact. For instance, depending on the machine, it may quite well happen that @code{(number-sequence 0.4 0.6 0.2)} returns the one element list @code{(0.4)}, whereas @@ -1405,7 +1405,7 @@ @defun memql object list The function @code{memql} tests to see whether @var{object} is a member of @var{list}, comparing members with @var{object} using @code{eql}, -so floating point elements are compared by value. +so floating-point elements are compared by value. If @var{object} is a member, @code{memql} returns a list starting with its first occurrence in @var{list}. Otherwise, it returns @code{nil}. === modified file 'doc/lispref/minibuf.texi' --- doc/lispref/minibuf.texi 2014-02-27 08:01:22 +0000 +++ doc/lispref/minibuf.texi 2014-03-18 01:19:03 +0000 @@ -1967,7 +1967,7 @@ Like @code{y-or-n-p}, except that if the user fails to answer within @var{seconds} seconds, this function stops waiting and returns @var{default}. It works by setting up a timer; see @ref{Timers}. -The argument @var{seconds} may be an integer or a floating point number. +The argument @var{seconds} should be a number. @end defun @defun yes-or-no-p prompt === modified file 'doc/lispref/nonascii.texi' --- doc/lispref/nonascii.texi 2014-01-01 23:13:59 +0000 +++ doc/lispref/nonascii.texi 2014-03-18 01:19:03 +0000 @@ -50,7 +50,7 @@ @code{#x110000..#x3FFFFF}, which it uses for representing characters that are not unified with Unicode and @dfn{raw 8-bit bytes} that cannot be interpreted as characters. Thus, a character codepoint in -Emacs is a 22-bit integer number. +Emacs is a 22-bit integer. @cindex internal representation of characters @cindex characters, representation in buffers and strings @@ -259,7 +259,7 @@ @defun multibyte-char-to-unibyte char This converts the multibyte character @var{char} to a unibyte character, and returns that character. If @var{char} is neither -@acronym{ASCII} nor eight-bit, the function returns -1. +@acronym{ASCII} nor eight-bit, the function returns @minus{}1. @end defun @defun unibyte-char-to-multibyte char @@ -451,7 +451,7 @@ @item canonical-combining-class Corresponds to the @code{Canonical_Combining_Class} Unicode property. -The value is an integer number. For unassigned codepoints, the value +The value is an integer. For unassigned codepoints, the value is zero. @cindex bidirectional class of characters @@ -479,13 +479,13 @@ @item decimal-digit-value Corresponds to the Unicode @code{Numeric_Value} property for characters whose @code{Numeric_Type} is @samp{Decimal}. The value is -an integer number. For unassigned codepoints, the value is +an integer. For unassigned codepoints, the value is @code{nil}, which means @acronym{NaN}, or ``not-a-number''. @item digit-value Corresponds to the Unicode @code{Numeric_Value} property for characters whose @code{Numeric_Type} is @samp{Digit}. The value is an -integer number. Examples of such characters include compatibility +integer. Examples of such characters include compatibility subscript and superscript digits, for which the value is the corresponding number. For unassigned codepoints, the value is @code{nil}, which means @acronym{NaN}. @@ -493,7 +493,7 @@ @item numeric-value Corresponds to the Unicode @code{Numeric_Value} property for characters whose @code{Numeric_Type} is @samp{Numeric}. The value of -this property is an integer or a floating-point number. Examples of +this property is a number. Examples of characters that have this property include fractions, subscripts, superscripts, Roman numerals, currency numerators, and encircled numbers. For example, the value of this property for the character === modified file 'doc/lispref/numbers.texi' --- doc/lispref/numbers.texi 2014-01-02 19:17:48 +0000 +++ doc/lispref/numbers.texi 2014-03-18 01:19:03 +0000 @@ -10,7 +10,7 @@ GNU Emacs supports two numeric data types: @dfn{integers} and @dfn{floating point numbers}. Integers are whole numbers such as -@minus{}3, 0, 7, 13, and 511. Their values are exact. Floating point +@minus{}3, 0, 7, 13, and 511. Their values are exact. Floating-point numbers are numbers with fractional parts, such as @minus{}4.5, 0.0, or 2.71828. They can also be expressed in exponential notation: 1.5e2 equals 150; in this example, @samp{e2} stands for ten to the second @@ -24,7 +24,7 @@ * Comparison of Numbers:: Equality and inequality predicates. * Numeric Conversions:: Converting float to integer and vice versa. * Arithmetic Operations:: How to add, subtract, multiply and divide. -* Rounding Operations:: Explicitly rounding floating point numbers. +* Rounding Operations:: Explicitly rounding floating-point numbers. * Bitwise Operations:: Logical and, or, not, shifting. * Math Functions:: Trig, exponential and logarithmic functions. * Random Numbers:: Obtaining random integers, predictable or not. @@ -36,7 +36,7 @@ The range of values for an integer depends on the machine. The minimum range is @minus{}536870912 to 536870911 (30 bits; i.e., @ifnottex --2**29 +@minus{}2**29 @end ifnottex @tex @math{-2^{29}} @@ -122,7 +122,7 @@ 1111...111011 (30 bits total) @end example - In this implementation, the largest 30-bit binary integer value is + In this implementation, the largest 30-bit binary integer is 536,870,911 in decimal. In binary, it looks like this: @example @@ -145,15 +145,15 @@ give these arguments the name @var{number-or-marker}. When the argument value is a marker, its position value is used and its buffer is ignored. -@cindex largest Lisp integer number -@cindex maximum Lisp integer number +@cindex largest Lisp integer +@cindex maximum Lisp integer @defvar most-positive-fixnum The value of this variable is the largest integer that Emacs Lisp can handle. @end defvar -@cindex smallest Lisp integer number -@cindex minimum Lisp integer number +@cindex smallest Lisp integer +@cindex minimum Lisp integer @defvar most-negative-fixnum The value of this variable is the smallest integer that Emacs Lisp can handle. It is negative. @@ -164,33 +164,33 @@ considered to be valid as a character. @xref{String Basics}. @node Float Basics -@section Floating Point Basics +@section Floating-Point Basics @cindex @acronym{IEEE} floating point - Floating point numbers are useful for representing numbers that are -not integral. The precise range of floating point numbers is + Floating-point numbers are useful for representing numbers that are +not integral. The precise range of floating-point numbers is machine-specific; it is the same as the range of the C data type @code{double} on the machine you are using. Emacs uses the -@acronym{IEEE} floating point standard, which is supported by all +@acronym{IEEE} floating-point standard, which is supported by all modern computers. - The read syntax for floating point numbers requires either a decimal + The read syntax for floating-point numbers requires either a decimal point (with at least one digit following), an exponent, or both. For example, @samp{1500.0}, @samp{15e2}, @samp{15.0e2}, @samp{1.5e3}, and -@samp{.15e4} are five ways of writing a floating point number whose +@samp{.15e4} are five ways of writing a floating-point number whose value is 1500. They are all equivalent. You can also use a minus -sign to write negative floating point numbers, as in @samp{-1.0}. +sign to write negative floating-point numbers, as in @samp{-1.0}. - Emacs Lisp treats @code{-0.0} as equal to ordinary zero (with + Emacs Lisp treats @code{-0.0} as numerically equal to ordinary zero (with respect to @code{equal} and @code{=}), even though the two are -distinguishable in the @acronym{IEEE} floating point standard. +distinguishable in the @acronym{IEEE} floating-point standard. @cindex positive infinity @cindex negative infinity @cindex infinity @cindex NaN - The @acronym{IEEE} floating point standard supports positive -infinity and negative infinity as floating point values. It also + The @acronym{IEEE} floating-point standard supports positive +infinity and negative infinity as floating-point values. It also provides for a class of values called NaN or ``not-a-number''; numerical functions return such values in cases where there is no correct answer. For example, @code{(/ 0.0 0.0)} returns a NaN@. (NaN @@ -204,7 +204,7 @@ non-@acronym{IEEE} platforms it returns an implementation-defined value. -Here are the read syntaxes for these special floating point values: +Here are the read syntaxes for these special floating-point values: @table @asis @item positive infinity @@ -272,8 +272,8 @@ @code{number-or-marker-p}, in @ref{Predicates on Markers}. @defun floatp object -This predicate tests whether its argument is a floating point -number and returns @code{t} if so, @code{nil} otherwise. +This predicate tests whether its argument is floating point +and returns @code{t} if so, @code{nil} otherwise. @end defun @defun integerp object @@ -310,13 +310,13 @@ @cindex comparing numbers To test numbers for numerical equality, you should normally use -@code{=}, not @code{eq}. There can be many distinct floating point -number objects with the same numeric value. If you use @code{eq} to +@code{=}, not @code{eq}. There can be many distinct floating-point +objects with the same numeric value. If you use @code{eq} to compare them, then you test whether two values are the same @emph{object}. By contrast, @code{=} compares only the numeric values of the objects. - In Emacs Lisp, each integer value is a unique Lisp object. + In Emacs Lisp, each integer is a unique Lisp object. Therefore, @code{eq} is equivalent to @code{=} where integers are concerned. It is sometimes convenient to use @code{eq} for comparing an unknown value with an integer, because @code{eq} does not report an @@ -328,12 +328,12 @@ Sometimes it is useful to compare numbers with @code{equal}, which treats two numbers as equal if they have the same data type (both integers, or both floating point) and the same value. By contrast, -@code{=} can treat an integer and a floating point number as equal. +@code{=} can treat an integer and a floating-point number as equal. @xref{Equality Predicates}. - There is another wrinkle: because floating point arithmetic is not -exact, it is often a bad idea to check for equality of two floating -point values. Usually it is better to test for approximate equality. + There is another wrinkle: because floating-point arithmetic is not +exact, it is often a bad idea to check for equality of floating-point +values. Usually it is better to test for approximate equality. Here's a function to do this: @example @@ -351,7 +351,7 @@ @code{=} because Common Lisp implements multi-word integers, and two distinct integer objects can have the same numeric value. Emacs Lisp can have just one integer object for any given value because it has a -limited range of integer values. +limited range of integers. @end quotation @defun = number-or-marker &rest number-or-markers @@ -397,7 +397,7 @@ @defun max number-or-marker &rest numbers-or-markers This function returns the largest of its arguments. -If any of the arguments is floating-point, the value is returned +If any of the arguments is floating point, the value is returned as floating point, even if it was given as an integer. @example @@ -412,7 +412,7 @@ @defun min number-or-marker &rest numbers-or-markers This function returns the smallest of its arguments. -If any of the arguments is floating-point, the value is returned +If any of the arguments is floating point, the value is returned as floating point, even if it was given as an integer. @example @@ -435,20 +435,20 @@ @defun float number This returns @var{number} converted to floating point. -If @var{number} is already a floating point number, @code{float} returns +If @var{number} is already floating point, @code{float} returns it unchanged. @end defun - There are four functions to convert floating point numbers to + There are four functions to convert floating-point numbers to integers; they differ in how they round. All accept an argument @var{number} and an optional argument @var{divisor}. Both arguments -may be integers or floating point numbers. @var{divisor} may also be +may be integers or floating-point numbers. @var{divisor} may also be @code{nil}. If @var{divisor} is @code{nil} or omitted, these functions convert @var{number} to an integer, or return it unchanged if it already is an integer. If @var{divisor} is non-@code{nil}, they divide @var{number} by @var{divisor} and convert the result to an integer. If @var{divisor} is zero (whether integer or -floating-point), Emacs signals an @code{arith-error} error. +floating point), Emacs signals an @code{arith-error} error. @defun truncate number &optional divisor This returns @var{number}, converted to an integer by rounding towards @@ -529,8 +529,8 @@ (addition, subtraction, multiplication, and division), as well as remainder and modulus functions, and functions to add or subtract 1. Except for @code{%}, each of these functions accepts both integer and -floating point arguments, and returns a floating point number if any -argument is a floating point number. +floating-point arguments, and returns a floating-point number if any +argument is floating point. It is important to note that in Emacs Lisp, arithmetic functions do not check for overflow. Thus @code{(1+ 536870911)} may evaluate to @@ -659,9 +659,9 @@ @cindex @code{arith-error} in division If you divide an integer by the integer 0, Emacs signals an -@code{arith-error} error (@pxref{Errors}). If you divide a floating -point number by 0, or divide by the floating point number 0.0, the -result is either positive or negative infinity (@pxref{Float Basics}). +@code{arith-error} error (@pxref{Errors}). Floating-point division of +a nonzero number by zero yields either positive or negative infinity +(@pxref{Float Basics}). @end defun @defun % dividend divisor @@ -701,7 +701,7 @@ by @var{divisor}, but with the same sign as @var{divisor}. The arguments must be numbers or markers. -Unlike @code{%}, @code{mod} permits floating point arguments; it +Unlike @code{%}, @code{mod} permits floating-point arguments; it rounds the quotient downward (towards minus infinity) to an integer, and uses that quotient to compute the remainder. @@ -751,30 +751,30 @@ @cindex rounding without conversion The functions @code{ffloor}, @code{fceiling}, @code{fround}, and -@code{ftruncate} take a floating point argument and return a floating -point result whose value is a nearby integer. @code{ffloor} returns the +@code{ftruncate} take a floating-point argument and return a floating-point +result whose value is a nearby integer. @code{ffloor} returns the nearest integer below; @code{fceiling}, the nearest integer above; @code{ftruncate}, the nearest integer in the direction towards zero; @code{fround}, the nearest integer. @defun ffloor float This function rounds @var{float} to the next lower integral value, and -returns that value as a floating point number. +returns that value as a floating-point number. @end defun @defun fceiling float This function rounds @var{float} to the next higher integral value, and -returns that value as a floating point number. +returns that value as a floating-point number. @end defun @defun ftruncate float This function rounds @var{float} towards zero to an integral value, and -returns that value as a floating point number. +returns that value as a floating-point number. @end defun @defun fround float This function rounds @var{float} to the nearest integral value, -and returns that value as a floating point number. +and returns that value as a floating-point number. @end defun @node Bitwise Operations @@ -1083,7 +1083,7 @@ @cindex mathematical functions @cindex floating-point functions - These mathematical functions allow integers as well as floating point + These mathematical functions allow integers as well as floating-point numbers as arguments. @defun sin arg === modified file 'doc/lispref/objects.texi' --- doc/lispref/objects.texi 2014-01-01 07:43:34 +0000 +++ doc/lispref/objects.texi 2014-03-18 01:19:03 +0000 @@ -136,7 +136,7 @@ @menu * Integer Type:: Numbers without fractional parts. -* Floating Point Type:: Numbers with fractional parts and with a large range. +* Floating-Point Type:: Numbers with fractional parts and with a large range. * Character Type:: The representation of letters, numbers and control characters. * Symbol Type:: A multi-use object that refers to a function, @@ -164,7 +164,7 @@ The range of values for integers in Emacs Lisp is @minus{}536870912 to 536870911 (30 bits; i.e., @ifnottex --2**29 +@minus{}2**29 @end ifnottex @tex @math{-2^{29}} @@ -187,7 +187,7 @@ @example @group --1 ; @r{The integer -1.} +-1 ; @r{The integer @minus{}1.} 1 ; @r{The integer 1.} 1. ; @r{Also the integer 1.} +1 ; @r{Also the integer 1.} @@ -197,26 +197,26 @@ @noindent As a special exception, if a sequence of digits specifies an integer too large or too small to be a valid integer object, the Lisp reader -reads it as a floating-point number (@pxref{Floating Point Type}). +reads it as a floating-point number (@pxref{Floating-Point Type}). For instance, if Emacs integers are 30 bits, @code{536870912} is read as the floating-point number @code{536870912.0}. @xref{Numbers}, for more information. -@node Floating Point Type -@subsection Floating Point Type +@node Floating-Point Type +@subsection Floating-Point Type - Floating point numbers are the computer equivalent of scientific -notation; you can think of a floating point number as a fraction + Floating-point numbers are the computer equivalent of scientific +notation; you can think of a floating-point number as a fraction together with a power of ten. The precise number of significant figures and the range of possible exponents is machine-specific; Emacs uses the C data type @code{double} to store the value, and internally this records a power of 2 rather than a power of 10. - The printed representation for floating point numbers requires either + The printed representation for floating-point numbers requires either a decimal point (with at least one digit following), an exponent, or both. For example, @samp{1500.0}, @samp{15e2}, @samp{15.0e2}, -@samp{1.5e3}, and @samp{.15e4} are five ways of writing a floating point +@samp{1.5e3}, and @samp{.15e4} are five ways of writing a floating-point number whose value is 1500. They are all equivalent. @xref{Numbers}, for more information. === modified file 'doc/lispref/os.texi' --- doc/lispref/os.texi 2014-02-25 08:41:47 +0000 +++ doc/lispref/os.texi 2014-03-18 01:19:03 +0000 @@ -1043,7 +1043,7 @@ By default, the values are integers that are 100 times the system load averages, but if @var{use-float} is non-@code{nil}, then they are -returned as floating point numbers without multiplying by 100. +returned as floating-point numbers without multiplying by 100. If it is impossible to obtain the load average, this function signals an error. On some platforms, access to load averages requires @@ -1149,24 +1149,24 @@ @cindex UID @defun user-real-uid This function returns the real @acronym{UID} of the user. -The value may be a floating point number, in the (unlikely) event that +The value may be floating point, in the (unlikely) event that the UID is too large to fit in a Lisp integer. @end defun @defun user-uid This function returns the effective @acronym{UID} of the user. -The value may be a floating point number. +The value may be floating point. @end defun @cindex GID @defun group-gid This function returns the effective @acronym{GID} of the Emacs process. -The value may be a floating point number. +The value may be floating point. @end defun @defun group-real-gid This function returns the real @acronym{GID} of the Emacs process. -The value may be a floating point number. +The value may be floating point. @end defun @defun system-users @@ -1196,7 +1196,7 @@ integers, @code{(@var{sec-high} @var{sec-low} @var{microsec})}, or of two integers, @code{(@var{sec-high} @var{sec-low})}. The integers @var{sec-high} and @var{sec-low} give the high and low bits of an -integer number of seconds. This integer number, +integer number of seconds. This integer, @ifnottex @var{high} * 2**16 + @var{low}, @end ifnottex @@ -1518,9 +1518,9 @@ @end defun @defun seconds-to-time seconds -This function converts @var{seconds}, a floating point number of -seconds since the epoch, to a time value and returns that. To perform -the inverse conversion, use @code{float-time} (@pxref{Time of Day}). +This function converts @var{seconds}, the number of seconds since the +epoch, to a time value and returns that. To convert back, use +@code{float-time} (@pxref{Time of Day}). @end defun @defun format-seconds format-string seconds @@ -1805,9 +1805,8 @@ @deffn Command run-with-idle-timer secs repeat function &rest args Set up a timer which runs the next time Emacs is idle for @var{secs} -seconds. The value of @var{secs} may be an integer or a floating -point number; a value of the type returned by @code{current-idle-time} -is also allowed. +seconds. The value of @var{secs} may be a number or a value of the type +returned by @code{current-idle-time}. If @var{repeat} is @code{nil}, the timer runs just once, the first time Emacs remains idle for a long enough time. More often @var{repeat} is @@ -2155,7 +2154,7 @@ . @var{symbol})}, where @var{code} is the numeric keysym code (not including the ``vendor specific'' bit, @ifnottex --2**28), +@minus{}2**28), @end ifnottex @tex $-2^{28}$), @@ -2165,7 +2164,7 @@ For example @code{(168 . mute-acute)} defines a system-specific key (used by HP X servers) whose numeric code is @ifnottex --2**28 +@minus{}2**28 @end ifnottex @tex $-2^{28}$ @@ -2329,10 +2328,10 @@ @item :timeout @var{timeout} The timeout time in milliseconds since the display of the notification -at which the notification should automatically close. If -1, the +at which the notification should automatically close. If @minus{}1, the notification's expiration time is dependent on the notification server's settings, and may vary for the type of notification. If 0, -the notification never expires. Default value is -1. +the notification never expires. Default value is @minus{}1. @item :urgency @var{urgency} The urgency level. It can be @code{low}, @code{normal}, or @code{critical}. === modified file 'doc/lispref/processes.texi' --- doc/lispref/processes.texi 2014-02-22 21:08:22 +0000 +++ doc/lispref/processes.texi 2014-03-18 01:19:03 +0000 @@ -1484,7 +1484,7 @@ subprocess output. The argument @var{millisec} is obsolete (and should not be used), -because @var{seconds} can be a floating point number to specify +because @var{seconds} can be floating point to specify waiting a fractional number of seconds. If @var{seconds} is 0, the function accepts whatever output is pending but does not wait. @@ -1684,7 +1684,7 @@ attribute @var{key}s that this function can return are listed below. Not all platforms support all of these attributes; if an attribute is not supported, its association will not appear in the returned alist. -Values that are numbers can be either integer or floating-point, +Values that are numbers can be either integer or floating point, depending on the magnitude of the value. @table @code === modified file 'doc/lispref/streams.texi' --- doc/lispref/streams.texi 2014-01-01 07:43:34 +0000 +++ doc/lispref/streams.texi 2014-03-18 01:19:03 +0000 @@ -824,7 +824,7 @@ @end defvar @defvar float-output-format -This variable specifies how to print floating point numbers. The +This variable specifies how to print floating-point numbers. The default is @code{nil}, meaning use the shortest output that represents the number without losing information. === modified file 'doc/lispref/strings.texi' --- doc/lispref/strings.texi 2014-03-09 11:36:51 +0000 +++ doc/lispref/strings.texi 2014-03-18 01:19:03 +0000 @@ -593,9 +593,8 @@ @cindex integer to string @cindex integer to decimal This function returns a string consisting of the printed base-ten -representation of @var{number}, which may be an integer or a floating -point number. The returned value starts with a minus sign if the argument is -negative. +representation of @var{number}. The returned value starts with a +minus sign if the argument is negative. @example (number-to-string 256) @@ -619,12 +618,12 @@ This function returns the numeric value of the characters in @var{string}. If @var{base} is non-@code{nil}, it must be an integer between 2 and 16 (inclusive), and integers are converted in that base. -If @var{base} is @code{nil}, then base ten is used. Floating point +If @var{base} is @code{nil}, then base ten is used. Floating-point conversion only works in base ten; we have not implemented other -radices for floating point numbers, because that would be much more +radices for floating-point numbers, because that would be much more work and does not seem useful. If @var{string} looks like an integer but its value is too large to fit into a Lisp integer, -@code{string-to-number} returns a floating point result. +@code{string-to-number} returns a floating-point result. The parsing skips spaces and tabs at the beginning of @var{string}, then reads as much of @var{string} as it can interpret as a number in @@ -787,15 +786,15 @@ Replace the specification with the character which is the value given. @item %e -Replace the specification with the exponential notation for a floating -point number. +Replace the specification with the exponential notation for a +floating-point number. @item %f -Replace the specification with the decimal-point notation for a floating -point number. +Replace the specification with the decimal-point notation for a +floating-point number. @item %g -Replace the specification with notation for a floating point number, +Replace the specification with notation for a floating-point number, using either exponential notation or decimal-point notation, whichever is shorter. === modified file 'doc/lispref/text.texi' --- doc/lispref/text.texi 2014-03-09 11:36:51 +0000 +++ doc/lispref/text.texi 2014-03-18 01:19:03 +0000 @@ -3269,7 +3269,7 @@ position. You can place the cursor on any desired character of these strings by giving that character a non-@code{nil} @code{cursor} text property. In addition, if the value of the @code{cursor} property is -an integer number, it specifies the number of buffer's character +an integer, it specifies the number of buffer's character positions, starting with the position where the overlay or the @code{display} property begins, for which the cursor should be displayed on that character. Specifically, if the value of the @@ -3283,7 +3283,7 @@ In other words, the string character with the @code{cursor} property of any non-@code{nil} value is the character where to display the cursor. The value of the property says for which buffer positions to -display the cursor there. If the value is an integer number @var{n}, +display the cursor there. If the value is an integer @var{n}, the cursor is displayed there when point is anywhere between the beginning of the overlay or @code{display} property and @var{n} positions after that. If the value is anything else and === modified file 'doc/lispref/variables.texi' --- doc/lispref/variables.texi 2014-01-05 23:36:13 +0000 +++ doc/lispref/variables.texi 2014-03-18 01:19:03 +0000 @@ -828,7 +828,7 @@ @example @group -(defvar x -99) ; @r{@code{x} receives an initial value of -99.} +(defvar x -99) ; @r{@code{x} receives an initial value of @minus{}99.} (defun getx () x) ; @r{@code{x} is used ``free'' in this function.} @@ -838,7 +838,7 @@ @result{} 1 ;; @r{After the @code{let} form finishes, @code{x} reverts to its} -;; @r{previous value, which is -99.} +;; @r{previous value, which is @minus{}99.} (getx) @result{} -99 @@ -852,14 +852,14 @@ within a @code{let} form in which @code{x} is (dynamically) bound, it retrieves the local value (i.e., 1). But when we call @code{getx} outside the @code{let} form, it retrieves the global value (i.e., --99). +@minus{}99). Here is another example, which illustrates setting a dynamically bound variable using @code{setq}: @example @group -(defvar x -99) ; @r{@code{x} receives an initial value of -99.} +(defvar x -99) ; @r{@code{x} receives an initial value of @minus{}99.} (defun addx () (setq x (1+ x))) ; @r{Add 1 to @code{x} and return its new value.} @@ -870,7 +870,7 @@ @result{} 3 ; @r{The two @code{addx} calls add to @code{x} twice.} ;; @r{After the @code{let} form finishes, @code{x} reverts to its} -;; @r{previous value, which is -99.} +;; @r{previous value, which is @minus{}99.} (addx) @result{} -98 @@ -1976,7 +1976,7 @@ This variable holds a list of all variables of type @code{DEFVAR_BOOL}. @end defvar - Variables of type @code{DEFVAR_INT} can only take on integer values. + Variables of type @code{DEFVAR_INT} can take on only integer values. Attempting to assign them any other value will result in an error: @example === modified file 'doc/lispref/windows.texi' --- doc/lispref/windows.texi 2014-03-09 11:36:51 +0000 +++ doc/lispref/windows.texi 2014-03-18 01:19:03 +0000 @@ -2208,7 +2208,7 @@ @item A number specifies the desired height of the new window. An integer -number specifies the number of lines of the window. A floating point +specifies the number of lines of the window. A floating-point number gives the fraction of the window's height with respect to the height of the frame's root window. @@ -2229,7 +2229,7 @@ @item A number specifies the desired width of the new window. An integer -number specifies the number of columns of the window. A floating point +specifies the number of columns of the window. A floating-point number gives the fraction of the window's width with respect to the width of the frame's root window. ------------------------------------------------------------ revno: 116785 committer: Juanma Barranquero branch nick: trunk timestamp: Tue 2014-03-18 02:13:00 +0100 message: lisp/ChangeLog: Move up misplaced entry. lisp/org/ChangeLog: Fix typo. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2014-03-18 00:42:37 +0000 +++ lisp/ChangeLog 2014-03-18 01:13:00 +0000 @@ -1,4 +1,8 @@ -2014-03-17 Stefan +2014-03-18 Daniel Colascione + + * startup.el (tty-handle-args): Remove debug message from 2007. + +2014-03-17 Stefan Monnier * emacs-lisp/nadvice.el (advice--interactive-form): New function. (advice--make-interactive-form): Use it to avoid (auto)loading function. @@ -67,10 +71,6 @@ (rst-uncomment-region, rst-font-lock-find-unindented-line-match) (rst-font-lock-handle-adornment-matcher): Mark unused arguments. -2014-03-18 Daniel Colascione - - * startup.el (tty-handle-args): Remove debug message from 2007. - 2014-03-15 Juanma Barranquero * term/ns-win.el (x-command-line-resources): Rename from ns-... version, @@ -163,8 +163,8 @@ 2014-03-13 Dmitry Gutov - * progmodes/ruby-mode.el (ruby-font-lock-keywords): Fontify - multiple adjacent negation chars. (Bug#17004) + * progmodes/ruby-mode.el (ruby-font-lock-keywords): + Fontify multiple adjacent negation chars. (Bug#17004) 2014-03-13 Tom Willemse (tiny change) === modified file 'lisp/org/ChangeLog' --- lisp/org/ChangeLog 2014-02-25 18:10:52 +0000 +++ lisp/org/ChangeLog 2014-03-18 01:13:00 +0000 @@ -8620,7 +8620,7 @@ (org-agenda-run-series): Remove any old agenda markers in the buffer that is going to take the new block agenda. (org-prepare-agenda): Reset markers before erasing the buffer anc - running `org-agenda-mode', because after that hte local variable + running `org-agenda-mode', because after that the local variable `org-agenda-markers' will have gone away. (org-agenda-Quit): (org-finalize-agenda): Install the marker resetter into the ------------------------------------------------------------ revno: 116784 committer: Daniel Colascione branch nick: trunk timestamp: Mon 2014-03-17 17:42:37 -0700 message: Remove old debug print diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2014-03-17 18:30:53 +0000 +++ lisp/ChangeLog 2014-03-18 00:42:37 +0000 @@ -67,6 +67,10 @@ (rst-uncomment-region, rst-font-lock-find-unindented-line-match) (rst-font-lock-handle-adornment-matcher): Mark unused arguments. +2014-03-18 Daniel Colascione + + * startup.el (tty-handle-args): Remove debug message from 2007. + 2014-03-15 Juanma Barranquero * term/ns-win.el (x-command-line-resources): Rename from ns-... version, === modified file 'lisp/startup.el' --- lisp/startup.el 2014-02-26 19:45:18 +0000 +++ lisp/startup.el 2014-03-18 00:42:37 +0000 @@ -736,7 +736,6 @@ (defun tty-handle-args (args) "Handle the X-like command-line arguments \"-fg\", \"-bg\", \"-name\", etc." (let (rest) - (message "%S" args) (while (and args (not (equal (car args) "--"))) (let* ((argi (pop args)) ------------------------------------------------------------ revno: 116783 committer: Ted Zlatanov branch nick: quickfixes timestamp: Mon 2014-03-17 17:29:56 -0400 message: gnutls.c (Fgnutls_boot): Fix case of :verify-error = t. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2014-03-16 16:31:50 +0000 +++ src/ChangeLog 2014-03-17 21:29:56 +0000 @@ -1,3 +1,7 @@ +2014-03-17 Teodor Zlatanov + + * gnutls.c (Fgnutls_boot): Fix case of :verify-error = t. + 2014-03-16 Eli Zaretskii * search.c (find_newline): Speed up the function when using the === modified file 'src/gnutls.c' --- src/gnutls.c 2014-01-01 07:43:34 +0000 +++ src/gnutls.c 2014-03-17 21:29:56 +0000 @@ -786,6 +786,7 @@ { int ret = GNUTLS_E_SUCCESS; int max_log_level = 0; + bool verify_error_all = 0; gnutls_session_t state; gnutls_certificate_credentials_t x509_cred = NULL; @@ -825,8 +826,14 @@ verify_error = Fplist_get (proplist, QCgnutls_bootprop_verify_error); prime_bits = Fplist_get (proplist, QCgnutls_bootprop_min_prime_bits); - if (NILP (Flistp (verify_error))) - error ("gnutls-boot: invalid :verify_error parameter (not a list)"); + if (EQ (verify_error, Qt)) + { + verify_error_all = 1; + } + else if (NILP (Flistp (verify_error))) + { + error ("gnutls-boot: invalid :verify_error parameter (not a list)"); + } if (!STRINGP (hostname)) error ("gnutls-boot: invalid :hostname parameter (not a string)"); @@ -1071,7 +1078,8 @@ if (peer_verification != 0) { - if (!NILP (Fmember (QCgnutls_bootprop_trustfiles, verify_error))) + if (verify_error_all + || !NILP (Fmember (QCgnutls_bootprop_trustfiles, verify_error))) { emacs_gnutls_deinit (proc); error ("Certificate validation failed %s, verification code %d", @@ -1120,7 +1128,8 @@ if (!fn_gnutls_x509_crt_check_hostname (gnutls_verify_cert, c_hostname)) { - if (!NILP (Fmember (QCgnutls_bootprop_hostname, verify_error))) + if (verify_error_all + || !NILP (Fmember (QCgnutls_bootprop_hostname, verify_error))) { fn_gnutls_x509_crt_deinit (gnutls_verify_cert); emacs_gnutls_deinit (proc); ------------------------------------------------------------ revno: 116782 committer: Stefan Monnier branch nick: trunk timestamp: Mon 2014-03-17 14:30:53 -0400 message: * lisp/emacs-lisp/nadvice.el (advice--interactive-form): New function. (advice--make-interactive-form): Use it to avoid (auto)loading function. (advice--make-1, advice-add, advice-remove): Remove braindead :advice-pending hack. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2014-03-17 16:04:32 +0000 +++ lisp/ChangeLog 2014-03-17 18:30:53 +0000 @@ -1,3 +1,10 @@ +2014-03-17 Stefan + + * emacs-lisp/nadvice.el (advice--interactive-form): New function. + (advice--make-interactive-form): Use it to avoid (auto)loading function. + (advice--make-1, advice-add, advice-remove): + Remove braindead :advice-pending hack. + 2014-03-17 Glenn Morris * calendar/calendar.el (calendar-generate-month): Apply weekend === modified file 'lisp/emacs-lisp/nadvice.el' --- lisp/emacs-lisp/nadvice.el 2014-03-11 01:22:24 +0000 +++ lisp/emacs-lisp/nadvice.el 2014-03-17 18:30:53 +0000 @@ -123,30 +123,34 @@ ;; ((functionp spec) (funcall spec)) (t (eval spec)))) +(defun advice--interactive-form (function) + ;; Like `interactive-form' but tries to avoid autoloading functions. + (when (commandp function) + (if (not (and (symbolp function) (autoloadp (symbol-function function)))) + (interactive-form function) + `(interactive (advice-eval-interactive-spec + (cadr (interactive-form ',function))))))) + (defun advice--make-interactive-form (function main) ;; TODO: make it so that interactive spec can be a constant which ;; dynamically checks the advice--car/cdr to do its job. ;; For that, advice-eval-interactive-spec needs to be more faithful. - (let ((fspec (cadr (interactive-form function)))) + (let* ((iff (advice--interactive-form function)) + (ifm (advice--interactive-form main)) + (fspec (cadr iff))) (when (eq 'function (car-safe fspec)) ;; Macroexpanded lambda? (setq fspec (nth 1 fspec))) (if (functionp fspec) - `(funcall ',fspec - ',(cadr (interactive-form main))) - (cadr (or (interactive-form function) - (interactive-form main)))))) + `(funcall ',fspec ',(cadr ifm)) + (cadr (or iff ifm))))) -(defsubst advice--make-1 (byte-code stack-depth function main props) +(defun advice--make-1 (byte-code stack-depth function main props) "Build a function value that adds FUNCTION to MAIN." (let ((adv-sig (gethash main advertised-signature-table)) (advice (apply #'make-byte-code 128 byte-code (vector #'apply function main props) stack-depth nil (and (or (commandp function) (commandp main)) - ;; If we're adding the advice on advice--pending, don't - ;; build an interactive-form, which won't be used anyway - ;; and would risk autoloading `main' (or `function'). - (not (eq main :advice--pending)) (list (advice--make-interactive-form function main)))))) (when adv-sig (puthash advice adv-sig advertised-signature-table)) @@ -387,14 +391,11 @@ ;; Reasons to delay installation of the advice: ;; - If the function is not yet defined, installing ;; the advice would affect `fboundp'ness. - ;; - If it's an autoloaded command, - ;; advice--make-interactive-form would end up - ;; loading the command eagerly. + ;; - the symbol-function slot of an autoloaded + ;; function is not itself a function value. ;; - `autoload' does nothing if the function is ;; not an autoload or undefined. ((or (not nf) (autoloadp nf)) - (unless (get symbol 'advice--pending) - (put symbol 'advice--pending :advice--pending)) (get symbol 'advice--pending)) (t (symbol-function symbol))) function props) @@ -418,9 +419,6 @@ (t (symbol-function symbol))) function) (unless (advice--p (advice--symbol-function symbol)) - ;; Not advised any more. - (when (eq (get symbol 'advice--pending) :advice--pending) - (put symbol 'advice--pending nil)) (remove-function (get symbol 'defalias-fset-function) #'advice--defalias-fset) (let ((asr (get symbol 'advice--saved-rewrite))) ------------------------------------------------------------ revno: 116781 fixes bug: http://debbugs.gnu.org/17028 committer: Glenn Morris branch nick: trunk timestamp: Mon 2014-03-17 09:04:32 -0700 message: * lisp/calendar/calendar.el (calendar-generate-month): Apply weekend face to the right days; fixes 2013-08-06 change. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2014-03-17 09:28:47 +0000 +++ lisp/ChangeLog 2014-03-17 16:04:32 +0000 @@ -1,3 +1,8 @@ +2014-03-17 Glenn Morris + + * calendar/calendar.el (calendar-generate-month): Apply weekend + face to the right days; fixes 2013-08-06 change. (Bug#17028) + 2014-03-17 Michael Albinus * net/tramp.el (tramp-action-out-of-band): Read pending output. === modified file 'lisp/calendar/calendar.el' --- lisp/calendar/calendar.el 2014-01-01 07:43:34 +0000 +++ lisp/calendar/calendar.el 2014-03-17 16:04:32 +0000 @@ -1546,7 +1546,8 @@ (last (calendar-last-day-of-month month year)) (trunc (min calendar-intermonth-spacing (1- calendar-left-margin))) - (day 1)) + (day 1) + j) (goto-char (point-min)) (calendar-move-to-column indent) (insert @@ -1556,11 +1557,11 @@ (calendar-insert-at-column indent calendar-intermonth-header trunc) ;; Use the first N characters of each day to head the columns. (dotimes (i 7) + (setq j (mod (+ calendar-week-start-day i) 7)) (insert (truncate-string-to-width - (propertize (calendar-day-name (mod (+ calendar-week-start-day i) 7) - 'header t) - 'font-lock-face (if (memq i '(0 6)) + (propertize (calendar-day-name j 'header t) + 'font-lock-face (if (memq j '(0 6)) 'calendar-weekend-header 'calendar-weekday-header)) calendar-day-header-width nil ?\s) ------------------------------------------------------------ revno: 116780 committer: Michael Albinus branch nick: trunk timestamp: Mon 2014-03-17 10:28:47 +0100 message: * net/tramp.el (tramp-action-out-of-band): Read pending output. (tramp-call-process): Trace also DESTINATION. * net/tramp-sh.el (tramp-do-copy-or-rename-file-out-of-band): Quote file names when they are local. Remove superfluous trace. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2014-03-17 06:48:09 +0000 +++ lisp/ChangeLog 2014-03-17 09:28:47 +0000 @@ -1,3 +1,11 @@ +2014-03-17 Michael Albinus + + * net/tramp.el (tramp-action-out-of-band): Read pending output. + (tramp-call-process): Trace also DESTINATION. + + * net/tramp-sh.el (tramp-do-copy-or-rename-file-out-of-band): + Quote file names when they are local. Remove superfluous trace. + 2014-03-17 Dmitry Gutov * newcomment.el (comment-beginning): If `comment-start-skip' === modified file 'lisp/net/tramp-sh.el' --- lisp/net/tramp-sh.el 2014-03-10 13:36:39 +0000 +++ lisp/net/tramp-sh.el 2014-03-17 09:28:47 +0000 @@ -2246,7 +2246,9 @@ (aset v 3 localname) ;; Check which ones of source and target are Tramp files. - (setq source (if t1 (tramp-make-copy-program-file-name v) filename) + (setq source (if t1 + (tramp-make-copy-program-file-name v) + (shell-quote-argument filename)) target (funcall (if (and (file-directory-p filename) (string-equal @@ -2254,7 +2256,9 @@ (file-name-nondirectory newname))) 'file-name-directory 'identity) - (if t2 (tramp-make-copy-program-file-name v) newname))) + (if t2 + (tramp-make-copy-program-file-name v) + (shell-quote-argument newname)))) ;; Check for host and port number. We cannot use ;; `tramp-file-name-port', because this returns also @@ -2376,7 +2380,6 @@ (buffer-substring (point-min) (point-at-eol)))))) ;; Reset the transfer process properties. - (tramp-message orig-vec 6 "\n%s" (buffer-string)) (tramp-set-connection-property v "process-name" nil) (tramp-set-connection-property v "process-buffer" nil))) === modified file 'lisp/net/tramp.el' --- lisp/net/tramp.el 2014-03-06 13:23:04 +0000 +++ lisp/net/tramp.el 2014-03-17 09:28:47 +0000 @@ -3468,6 +3468,8 @@ (defun tramp-action-out-of-band (proc vec) "Check, whether an out-of-band copy has finished." + ;; There might be pending output for the exit status. + (tramp-accept-process-output proc 0.1) (cond ((and (memq (process-status proc) '(stop exit)) (zerop (process-exit-status proc))) (tramp-message vec 3 "Process has finished.") @@ -4092,7 +4094,7 @@ Furthermore, traces are written with verbosity of 6." (tramp-message (vector tramp-current-method tramp-current-user tramp-current-host nil nil) - 6 "`%s %s' %s" program (mapconcat 'identity args " ") infile) + 6 "`%s %s' %s %s" program (mapconcat 'identity args " ") infile destination) (if (executable-find program) (apply 'call-process program infile destination display args) 1)) @@ -4229,7 +4231,7 @@ ;; This function should produce a string which is grokked by a Unix ;; shell, even if the Emacs is running on Windows. Since this is the ;; kludges section, we bind `system-type' in such a way that -;; `shell-quote-arguments' behaves as if on Unix. +;; `shell-quote-argument' behaves as if on Unix. ;; ;; Thanks to Mario DeWeerd for the hint that it is sufficient for this ;; function to work with Bourne-like shells. ------------------------------------------------------------ revno: 116779 fixes bug: http://debbugs.gnu.org/16971 committer: Dmitry Gutov branch nick: trunk timestamp: Mon 2014-03-17 08:48:09 +0200 message: Restore compatibility with legacy comment-start-skip values * lisp/newcomment.el (comment-beginning): If `comment-start-skip' doesn't match, move back one char and try again. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2014-03-17 06:22:58 +0000 +++ lisp/ChangeLog 2014-03-17 06:48:09 +0000 @@ -1,5 +1,8 @@ 2014-03-17 Dmitry Gutov + * newcomment.el (comment-beginning): If `comment-start-skip' + doesn't match, move back one char and try again. (Bug#16971) + * emacs-lisp/lisp-mode.el (lisp-mode-variables): Set `comment-use-syntax' to t to avoid the unnecessary runtime check. Set `comment-start-skip' to a simpler value that doesn't try to === modified file 'lisp/newcomment.el' --- lisp/newcomment.el 2014-01-01 07:43:34 +0000 +++ lisp/newcomment.el 2014-03-17 06:48:09 +0000 @@ -523,7 +523,12 @@ (when (nth 4 state) (goto-char (nth 8 state)) (prog1 (point) - (when (looking-at comment-start-skip) + (when (or (looking-at comment-start-skip) + ;; Some older modes use regexps that check the + ;; char before the comment for quoting. (Bug#16971) + (save-excursion + (forward-char -1) + (looking-at comment-start-skip))) (goto-char (match-end 0)))))) ;; Can't rely on the syntax table, let's guess based on font-lock. (unless (eq (get-text-property (point) 'face) 'font-lock-string-face) ------------------------------------------------------------ Use --include-merged or -n0 to see merged revisions.