commit 83fbe89537889219aebe1a36df73ca70e30948af (HEAD, refs/remotes/origin/master) Author: Bozhidar Batsov Date: Sun Jul 19 08:18:56 2015 +0300 Correct js-mode's lighter * lisp/progmodes/js.el (js-mode): Correct the lighter. diff --git a/lisp/progmodes/js.el b/lisp/progmodes/js.el index c49f25b..40a4a10 100644 --- a/lisp/progmodes/js.el +++ b/lisp/progmodes/js.el @@ -3497,7 +3497,7 @@ If one hasn't been set, or if it's stale, prompt for a new one." ;;; Main Function ;;;###autoload -(define-derived-mode js-mode prog-mode "Javascript" +(define-derived-mode js-mode prog-mode "JavaScript" "Major mode for editing JavaScript." :group 'js (setq-local indent-line-function 'js-indent-line) commit f7ba648def727053a2da7d71150a0ee991ec4f9e Author: Leo Liu Date: Sun Jul 19 12:39:37 2015 +0800 Fix a bug in cfengine3-mode * progmodes/cfengine.el (cfengine3-mode): Handle nil eldoc-documentation-function. diff --git a/lisp/progmodes/cfengine.el b/lisp/progmodes/cfengine.el index 27784a5..108ccb6 100644 --- a/lisp/progmodes/cfengine.el +++ b/lisp/progmodes/cfengine.el @@ -1390,6 +1390,10 @@ to the action header." (when buffer-file-name (shell-quote-argument buffer-file-name))))) + ;; For emacs < 25.1 where `eldoc-documentation-function' defaults to + ;; nil. + (or eldoc-documentation-function + (setq-local eldoc-documentation-function #'ignore)) (add-function :before-until (local 'eldoc-documentation-function) #'cfengine3-documentation-function) commit 82ed706469925bfe570e20c4daa750aeeaf4e63b Author: Julien Danjou Date: Sun Jul 19 00:11:02 2015 +0000 sieve-mode: support "body" test command * lisp/gnus/sieve-mode.el (sieve-font-lock-keywords): Add missing "body" test command. diff --git a/lisp/gnus/sieve-mode.el b/lisp/gnus/sieve-mode.el index c8d4754..ffa50e6 100644 --- a/lisp/gnus/sieve-mode.el +++ b/lisp/gnus/sieve-mode.el @@ -140,7 +140,8 @@ 'sieve-action-commands-face) ;; test commands (cons (regexp-opt '("address" "allof" "anyof" "exists" "false" - "true" "header" "not" "size" "envelope") + "true" "header" "not" "size" "envelope" + "body") 'words) 'sieve-test-commands-face) (cons "\\Sw+:\\sw+" commit 3d139d59fb0c3f4027109d4fac271a8aa52db5fc Author: Eli Zaretskii Date: Sat Jul 18 21:43:21 2015 +0300 Fix info-apropos when the default encoding is Latin-N * lisp/info.el (Info-find-node-2): Reset the buffer's encoding to 'undecided', so that it is set to the encoding of the Info file we are about to insert. Otherwise, 'info-apropos' will fail to find some index nodes in some UTF-8 encoded files, if the buffer's previous encoding is Latin-N or some such. diff --git a/lisp/info.el b/lisp/info.el index bcff7cc..48d9d19 100644 --- a/lisp/info.el +++ b/lisp/info.el @@ -1115,6 +1115,10 @@ is non-nil)." Info-current-file-completions nil buffer-file-name nil) (erase-buffer) + ;; Erase any memory of the previous coding-system, so that + ;; info-insert-file-contents sets the buffer's encoding to + ;; what the Info file specifies. + (set-buffer-file-coding-system 'undecided t) (info-insert-file-contents filename nil) (setq default-directory (file-name-directory filename)) (set-buffer-modified-p nil) commit 5d72d5d1f4d105556196d99f0ea3838dfedd2f10 Author: Ivan Andrus Date: Thu Jul 16 15:44:20 2015 -0600 * epg.el (epg--start): Check that gpgconf can be found before calling it. diff --git a/lisp/epg.el b/lisp/epg.el index 4ba9627..7e3cec7 100644 --- a/lisp/epg.el +++ b/lisp/epg.el @@ -605,16 +605,17 @@ callback data (if any)." ;; Start the Emacs Pinentry server if allow-emacs-pinentry is set ;; in ~/.gnupg/gpg-agent.conf. (when (and (fboundp 'pinentry-start) - (with-temp-buffer - (when (= (call-process epg-gpgconf-program nil t nil - "--list-options" "gpg-agent") - 0) - (goto-char (point-min)) - (re-search-forward "^allow-emacs-pinentry:.*:1$" nil t)))) + (executable-find epg-gpgconf-program) + (with-temp-buffer + (when (= (call-process epg-gpgconf-program nil t nil + "--list-options" "gpg-agent") + 0) + (goto-char (point-min)) + (re-search-forward "^allow-emacs-pinentry:.*:1$" nil t)))) (pinentry-start)) (setq process-environment - (cons (format "INSIDE_EMACS=%s,epg" emacs-version) - process-environment)) + (cons (format "INSIDE_EMACS=%s,epg" emacs-version) + process-environment)) ;; Record modified time of gpg-agent socket to restore the Emacs ;; frame on text terminal in `epg-wait-for-completion'. ;; See commit ea1a30223e14ff13e19d15ab8ac17d7aef5242f1 Author: Ivan Andrus Date: Thu Dec 11 22:18:20 2014 -0700 Expose more file types to OS X that Emacs understands. * Cocoa/Emacs.base/Contents/Info.plist: Add editor role for sty, dtx, json, and org files. Export UTIs for el, elc, and org files. diff --git a/nextstep/templates/Info.plist.in b/nextstep/templates/Info.plist.in index 8c9dc21..09e953c 100644 --- a/nextstep/templates/Info.plist.in +++ b/nextstep/templates/Info.plist.in @@ -452,6 +452,8 @@ along with GNU Emacs. If not, see . tex ltx ctx + dtx + sty latex texi @@ -465,6 +467,30 @@ along with GNU Emacs. If not, see . CFBundleTypeExtensions + org + + CFBundleTypeIconFile + document.icns + CFBundleTypeName + Org document + CFBundleTypeRole + Editor + + + CFBundleTypeExtensions + + json + + CFBundleTypeIconFile + document.icns + CFBundleTypeName + JSON document + CFBundleTypeRole + Editor + + + CFBundleTypeExtensions + * CFBundleTypeName @@ -478,6 +504,68 @@ along with GNU Emacs. If not, see . + + UTExportedTypeDeclarations + + + UTTypeConformsTo + + public.source-code + + UTTypeDescription + Emacs Lisp Source File + UTTypeIdentifier + org.gnu.emacs-lisp + UTTypeReferenceURL + https://www.gnu.org/software/emacs/manual/html_node/elisp/ + UTTypeTagSpecification + + public.filename-extension + + el + + + + + UTTypeConformsTo + + public.content + + UTTypeDescription + Emacs Lisp Object File + UTTypeIdentifier + org.gnu.emacs-lisp-object + UTTypeReferenceURL + https://www.gnu.org/software/emacs/manual/html_node/elisp/ + UTTypeTagSpecification + + public.filename-extension + + elc + + + + + UTTypeConformsTo + + public.plain-text + + UTTypeDescription + Org document + UTTypeIdentifier + org.orgmode.org + UTTypeReferenceURL + http://orgmode.org + UTTypeTagSpecification + + public.filename-extension + + org + + + + + NSServices commit a65e00b9f9b486debdbd9ec2fc584ce1967dba44 Author: Eli Zaretskii Date: Sat Jul 18 15:17:26 2015 +0300 Fix visual-order cursor movement when lines are truncated * src/xdisp.c (Fmove_point_visually): When lines are truncated, simulate display in a window of infinite width, to allow move_it_* functions reach positions outside of normal window dimensions. Remove code that tried to handle a subset of these situations by manual iteration of buffer text. (Bug#17777) diff --git a/src/xdisp.c b/src/xdisp.c index 16a7a64..2be057f 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -21291,6 +21291,14 @@ Value is the new character position of point. */) /* Setup the arena. */ SET_TEXT_POS (pt, PT, PT_BYTE); start_display (&it, w, pt); + /* When lines are truncated, we could be called with point + outside of the windows edges, in which case move_it_* + functions either prematurely stop at window's edge or jump to + the next screen line, whereas we rely below on our ability to + reach point, in order to start from its X coordinate. So we + need to disregard the window's horizontal extent in that case. */ + if (it.line_wrap == TRUNCATE) + it.last_visible_x = INFINITY; if (it.cmp_it.id < 0 && it.method == GET_FROM_STRING @@ -21382,6 +21390,8 @@ Value is the new character position of point. */) if (pt_x > 0) { start_display (&it, w, pt); + if (it.line_wrap == TRUNCATE) + it.last_visible_x = INFINITY; reseat_at_previous_visible_line_start (&it); it.current_x = it.current_y = it.hpos = 0; if (pt_vpos != 0) @@ -21494,27 +21504,6 @@ Value is the new character position of point. */) if (it.current_x != target_x) move_it_in_display_line_to (&it, ZV, target_x, MOVE_TO_POS | MOVE_TO_X); - /* When lines are truncated, the above loop will stop at the - window edge. But we want to get to the end of line, even if - it is beyond the window edge; automatic hscroll will then - scroll the window to show point as appropriate. */ - if (target_is_eol_p && it.line_wrap == TRUNCATE - && get_next_display_element (&it)) - { - struct text_pos new_pos = it.current.pos; - - while (!ITERATOR_AT_END_OF_LINE_P (&it)) - { - set_iterator_to_next (&it, false); - if (it.method == GET_FROM_BUFFER) - new_pos = it.current.pos; - if (!get_next_display_element (&it)) - break; - } - - it.current.pos = new_pos; - } - /* If we ended up in a display string that covers point, move to buffer position to the right in the visual order. */ if (dir > 0) commit 166ffcb6c7a012ed5f655d7bb0fad97319ad54fc Author: Eli Zaretskii Date: Sat Jul 18 13:23:22 2015 +0300 Fix following Info cross-references to anchors * lisp/info.el (Info-read-subfile): Add to the returned value the length of subfile preamble, after converting it to file's byte offset, as expected by the caller. Use bufferpos-to-filepos. (Info-find-node-2): If searching for a node with a 1000-character slop fails, try again with a 10000-character slop, to account for known bugs in Texinfo 5.0 and 5.1. (Bug#21055) * lisp/international/mule-util.el (bufferpos-to-filepos): New function. * etc/NEWS: Mention bufferpos-to-filepos. diff --git a/etc/NEWS b/etc/NEWS index e56d498..07bff64 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -911,7 +911,7 @@ be updated accordingly. * Lisp Changes in Emacs 25.1 -** New function `filepos-to-bufferpos'. +** New functions `filepos-to-bufferpos' and `bufferpos-to-filepos'. ** The default value of `load-read-function' is now `read'. diff --git a/lisp/info.el b/lisp/info.el index 413928b..bcff7cc 100644 --- a/lisp/info.el +++ b/lisp/info.el @@ -1217,6 +1217,18 @@ is non-nil)." (goto-char pos) (throw 'foo t))) + ;; If the Texinfo source had an @ifnottex block of text + ;; before the Top node, makeinfo 5.0 and 5.1 mistakenly + ;; omitted that block's size from the starting position + ;; of the 1st subfile, which makes GUESSPOS overshoot + ;; the correct position by the length of that text. So + ;; we try again with a larger slop. + (goto-char (max (point-min) (- guesspos 10000))) + (let ((pos (Info-find-node-in-buffer regexp strict-case))) + (when pos + (goto-char pos) + (throw 'foo t))) + (when (string-match "\\([^.]+\\)\\." nodename) (let (Info-point-loc) (Info-find-node-2 @@ -1553,10 +1565,13 @@ is non-nil)." (if (looking-at "\^_") (forward-char 1) (search-forward "\n\^_")) - ;; Don't add the length of the skipped summary segment to - ;; the value returned to `Info-find-node-2'. (Bug#14125) (if (numberp nodepos) - (- nodepos lastfilepos)))) + ;; Our caller ('Info-find-node-2') wants the (zero-based) byte + ;; offset corresponding to NODEPOS, from the beginning of the + ;; subfile. This is especially important if NODEPOS is for an + ;; anchor reference, because for those the position is all we + ;; have. + (+ (- nodepos lastfilepos) (bufferpos-to-filepos (point) 'exact))))) (defun Info-unescape-quotes (value) "Unescape double quotes and backslashes in VALUE." diff --git a/lisp/international/mule-util.el b/lisp/international/mule-util.el index 8dd83b4..f3aa70f 100644 --- a/lisp/international/mule-util.el +++ b/lisp/international/mule-util.el @@ -412,6 +412,79 @@ QUALITY can be: (decode-coding-region (point-min) (min (point-max) (+ pm byte)) coding-system t)))))))))))) +;;;###autoload +(defun bufferpos-to-filepos (position &optional quality coding-system) + "Try to return the file byte corresponding to a particular buffer POSITION. +Value is the file position given as a (0-based) byte count. +The function presumes the file is encoded with CODING-SYSTEM, which defaults +to `buffer-file-coding-system'. +QUALITY can be: + `approximate', in which case we may cut some corners to avoid + excessive work. + `exact', in which case we may end up re-(en/de)coding a large + part of the file/buffer. + nil, in which case we may return nil rather than an approximation." + (unless coding-system (setq coding-system buffer-file-coding-system)) + (let* ((eol (coding-system-eol-type coding-system)) + (lineno (if (= eol 1) (1- (line-number-at-pos position)) 0)) + (type (coding-system-type coding-system)) + (base (coding-system-base coding-system)) + byte) + (and (eq type 'utf-8) + ;; Any post-read/pre-write conversions mean it's not really UTF-8. + (not (null (coding-system-get coding-system :post-read-conversion))) + (setq type 'not-utf-8)) + (and (memq type '(charset raw-text undecided)) + ;; The following are all of type 'charset', but they are + ;; actually variable-width encodings. + (not (memq base '(chinese-gbk chinese-gb18030 euc-tw euc-jis-2004 + korean-iso-8bit chinese-iso-8bit + japanese-iso-8bit chinese-big5-hkscs + japanese-cp932 korean-cp949))) + (setq type 'single-byte)) + (pcase type + (`utf-8 + (setq byte (position-bytes position)) + (when (null byte) + (if (<= position 0) + (setq byte 1) + (setq byte (position-bytes (point-max))))) + (setq byte (1- byte)) + (+ byte + ;; Account for BOM, if any. + (if (coding-system-get coding-system :bom) 3 0) + ;; Account for CR in CRLF pairs. + lineno)) + (`single-byte + (+ position -1 lineno)) + ((and `utf-16 + ;; FIXME: For utf-16, we could use the same approach as used for + ;; dos EOLs (counting the number of non-BMP chars instead of the + ;; number of lines). + (guard (not (eq quality 'exact)))) + ;; In approximate mode, assume all characters are within the + ;; BMP, i.e. each one takes up 2 bytes. + (+ (* (1- position) 2) + ;; Account for BOM, if any. + (if (coding-system-get coding-system :bom) 2 0) + ;; Account for CR in CRLF pairs. + lineno)) + (_ + (pcase quality + (`approximate (+ (position-bytes position) -1 lineno)) + (`exact + ;; Rather than assume that the file exists and still holds the right + ;; data, we reconstruct its relevant portion. + (let ((buf (current-buffer))) + (with-temp-buffer + (set-buffer-multibyte nil) + (let ((tmp-buf (current-buffer))) + (with-current-buffer buf + (save-restriction + (widen) + (encode-coding-region (point-min) (min (point-max) position) + coding-system tmp-buf))) + (1- (point-max))))))))))) (provide 'mule-util) commit d3816bf8ad1fcfed2a32d23216a55850ee4325b5 Author: Eli Zaretskii Date: Sat Jul 18 13:02:06 2015 +0300 Fix scrolling backwards on TTY frames under scroll-conservatively * src/xdisp.c (move_it_vertically_backward): Fix off-by-one error in moving backwards on TTY frames. (Bug#21080) diff --git a/src/xdisp.c b/src/xdisp.c index 5bef44c..16a7a64 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -9428,7 +9428,7 @@ move_it_vertically_backward (struct it *it, int dy) treating terminal frames specially here. */ if (!FRAME_WINDOW_P (it->f)) - move_it_vertically (it, target_y - (it->current_y + line_height)); + move_it_vertically (it, target_y - it->current_y); else { do