[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] xwidget_mvp d6b6316 1/4: Merge remote-tracking branch 'ori
From: |
Joakim Verona |
Subject: |
[Emacs-diffs] xwidget_mvp d6b6316 1/4: Merge remote-tracking branch 'origin/master' into xwidget_mvp |
Date: |
Tue, 28 Apr 2015 16:41:11 +0000 |
branch: xwidget_mvp
commit d6b63164cd1680c05f7a4d6b4adfa9c15fa4699c
Merge: e6e0e2d 79fa7d7
Author: Joakim Verona <address@hidden>
Commit: Joakim Verona <address@hidden>
Merge remote-tracking branch 'origin/master' into xwidget_mvp
---
etc/NEWS | 4 +-
lisp/calendar/todo-mode.el | 11 ++-
lisp/cus-edit.el | 2 +-
lisp/cus-start.el | 7 ++-
lisp/emacs-lisp/elint.el | 2 +-
lisp/emacs-lisp/lisp-mnt.el | 4 +-
lisp/emacs-lisp/lisp-mode.el | 7 +-
lisp/emulation/viper-cmd.el | 4 +-
lisp/emulation/viper-ex.el | 27 +++++---
lisp/files.el | 2 +-
lisp/help-fns.el | 2 +-
lisp/info-look.el | 3 +-
lisp/info.el | 10 ++-
lisp/loadup.el | 6 ++
lisp/mail/emacsbug.el | 2 +-
lisp/mail/footnote.el | 2 +-
lisp/mail/rmail.el | 6 +-
lisp/man.el | 3 +-
lisp/org/org-clock.el | 3 +-
lisp/org/org-mouse.el | 4 +-
lisp/org/org.el | 5 +-
lisp/progmodes/ada-mode.el | 2 +-
lisp/progmodes/cc-mode.el | 128 ++++++++++++++++++++--------------
lisp/progmodes/ruby-mode.el | 3 +-
lisp/progmodes/sh-script.el | 2 +-
lisp/startup.el | 7 ++-
lisp/textmodes/bibtex.el | 2 +-
lisp/textmodes/reftex-ref.el | 3 +-
lisp/textmodes/reftex.el | 2 +-
lisp/textmodes/tex-mode.el | 4 +-
lisp/vc/log-view.el | 3 +-
src/callproc.c | 4 +-
src/process.c | 69 +++++++++---------
test/automated/message-mode-tests.el | 10 ++-
34 files changed, 210 insertions(+), 145 deletions(-)
diff --git a/etc/NEWS b/etc/NEWS
index 9dd0e15..804b819 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -233,7 +233,9 @@ Unicode standards.
* Changes in Specialized Modes and Packages in Emacs 25.1
** In xterms, killing text now also sets the CLIPBOARD/PRIMARY selection
-in the surrounding GUI (using the OSC-52 escape sequence).
+in the surrounding GUI (using the OSC-52 escape sequence). This only works
+if your xterm supports it and enables the `allowWindowOps' options (disabled
+by default at least in Debian, for security reasons).
** xterm-mouse-mode now supports mouse-tracking (if your xterm supports it).
diff --git a/lisp/calendar/todo-mode.el b/lisp/calendar/todo-mode.el
index dcc960f..bb9316c 100644
--- a/lisp/calendar/todo-mode.el
+++ b/lisp/calendar/todo-mode.el
@@ -2606,7 +2606,8 @@ meaning to raise or lower the item's priority by one."
;; separator.
(when (looking-back (concat "^"
(regexp-quote todo-category-done)
- "\n"))
+ "\n")
+ (line-beginning-position 0))
(todo-backward-item))))
(todo-insert-with-overlays item)
;; If item was marked, restore the mark.
@@ -4231,7 +4232,8 @@ the values of FILTER and FILE-LIST."
(if (and (eobp)
(looking-back
(concat (regexp-quote todo-done-string)
- "\n")))
+ "\n")
+ (line-beginning-position 0)))
(delete-region (point) (progn
(forward-line -2)
(point))))))
@@ -4648,7 +4650,7 @@ name in `todo-directory'. See also the documentation
string of
;; If the item ends with a non-comment parenthesis not
;; followed by a period, we lose (but we inherit that
;; problem from the legacy code).
- (when (looking-back "(\\(.*\\)) ")
+ (when (looking-back "(\\(.*\\)) " (line-beginning-position))
(setq comment (match-string 1))
(replace-match "")
(insert "[" todo-comment-string ": " comment "]"))
@@ -5342,7 +5344,8 @@ of each other."
(looking-at todo-done-string-start)
(looking-back (concat "^"
(regexp-quote todo-category-done)
- "\n")))
+ "\n")
+ (line-beginning-position 0)))
(setq num 1
done t))
(setq prefix (concat (propertize
diff --git a/lisp/cus-edit.el b/lisp/cus-edit.el
index 9cc2fa8..cd894f4 100644
--- a/lisp/cus-edit.el
+++ b/lisp/cus-edit.el
@@ -3115,7 +3115,7 @@ face attributes (as specified by a `default' defface
entry)."
widget
(widget-get widget :default-face-attributes)))
entry)
- (unless (looking-back "^ *")
+ (unless (looking-back "^ *" (line-beginning-position))
(insert ?\n))
(insert-char ?\s (widget-get widget :extra-offset))
(if (or alist defaults show-all)
diff --git a/lisp/cus-start.el b/lisp/cus-start.el
index 29ef371..071aaa6 100644
--- a/lisp/cus-start.el
+++ b/lisp/cus-start.el
@@ -169,7 +169,12 @@ Leaving \"Default\" unchecked is equivalent with
specifying a default of
(shell-file-name execute file)
(exec-path execute
(repeat (choice (const :tag "default directory" nil)
- (directory :format "%v"))))
+ (directory :format "%v")))
+ nil
+ :standard
+ (mapcar 'directory-file-name
+ (append (parse-colon-path (getenv "PATH"))
+ (list exec-directory))))
(exec-suffixes execute (repeat string))
;; charset.c
(charset-map-path installation
diff --git a/lisp/emacs-lisp/elint.el b/lisp/emacs-lisp/elint.el
index 1364670..317e5a6 100644
--- a/lisp/emacs-lisp/elint.el
+++ b/lisp/emacs-lisp/elint.el
@@ -374,7 +374,7 @@ Returns the forms."
(let ((elint-current-pos (point)))
;; non-list check could be here too. errors may be out of seq.
;; quoted check cannot be elsewhere, since quotes skipped.
- (if (looking-back "'")
+ (if (looking-back "'" (1- (point)))
;; Eg cust-print.el uses ' as a comment syntax.
(elint-warning "Skipping quoted form `'%.20s...'"
(read (current-buffer)))
diff --git a/lisp/emacs-lisp/lisp-mnt.el b/lisp/emacs-lisp/lisp-mnt.el
index fec172d..104c23c 100644
--- a/lisp/emacs-lisp/lisp-mnt.el
+++ b/lisp/emacs-lisp/lisp-mnt.el
@@ -437,9 +437,9 @@ This can be found in an RCS or SCCS header."
((re-search-forward
(concat
"@(#)"
- (if buffer-file-name
+ (if buffer-file-name
(regexp-quote (file-name-nondirectory buffer-file-name))
- "[^\t\n]*")
+ "[^\t\n]+")
"\t\\([012345679.]*\\)")
header-max t)
(match-string-no-properties 1)))))))
diff --git a/lisp/emacs-lisp/lisp-mode.el b/lisp/emacs-lisp/lisp-mode.el
index 26a21d5..108d5cc 100644
--- a/lisp/emacs-lisp/lisp-mode.el
+++ b/lisp/emacs-lisp/lisp-mode.el
@@ -855,9 +855,10 @@ is the buffer position of the start of the containing
expression."
;; Handle prefix characters and whitespace
;; following an open paren. (Bug#1012)
(backward-prefix-chars)
- (while (and (not (looking-back "^[ \t]*\\|([ \t]+"))
- (or (not containing-sexp)
- (< (1+ containing-sexp) (point))))
+ (while (not (or (looking-back "^[ \t]*\\|([ \t]+"
+
(line-beginning-position))
+ (and containing-sexp
+ (>= (1+ containing-sexp)
(point)))))
(forward-sexp -1)
(backward-prefix-chars))
(setq calculate-lisp-indent-last-sexp (point)))
diff --git a/lisp/emulation/viper-cmd.el b/lisp/emulation/viper-cmd.el
index bd03a87..5c91df9 100644
--- a/lisp/emulation/viper-cmd.el
+++ b/lisp/emulation/viper-cmd.el
@@ -4533,7 +4533,7 @@ One can use `` and '' to temporarily jump 1 step back."
(interactive)
(if viper-cted
(let ((p (point)) (c (current-column)) bol (indent t))
- (if (looking-back "[0^]")
+ (if (looking-back "[0^]" (1- (point)))
(progn
(if (eq ?^ (preceding-char))
(setq viper-preserve-indent t))
@@ -4545,7 +4545,7 @@ One can use `` and '' to temporarily jump 1 step back."
(delete-region (point) p)
(if indent
(indent-to (- c viper-shift-width)))
- (if (or (bolp) (looking-back "[^ \t]"))
+ (if (or (bolp) (looking-back "[^ \t]" (1- (point))))
(setq viper-cted nil)))))
;; do smart indent
diff --git a/lisp/emulation/viper-ex.el b/lisp/emulation/viper-ex.el
index 212f053..e6bcf8f 100644
--- a/lisp/emulation/viper-ex.el
+++ b/lisp/emulation/viper-ex.el
@@ -455,7 +455,8 @@ reversed."
(while (and (not (eolp)) cont)
;;(re-search-forward "[^/]*/")
(re-search-forward "[^/]*\\(/\\|\n\\)")
- (if (not (looking-back "[^\\\\]\\(\\\\\\\\\\)*\\\\/"))
+ (if (not (looking-back "[^\\\\]\\(\\\\\\\\\\)*\\\\/"
+ (line-beginning-position 0)))
(setq cont nil))))
(backward-char 1)
(setq ex-token (buffer-substring (point) (mark t)))
@@ -468,7 +469,8 @@ reversed."
(while (and (not (eolp)) cont)
;;(re-search-forward "[^\\?]*\\?")
(re-search-forward "[^\\?]*\\(\\?\\|\n\\)")
- (if (not (looking-back "[^\\\\]\\(\\\\\\\\\\)*\\\\\\?"))
+ (if (not (looking-back "[^\\\\]\\(\\\\\\\\\\)*\\\\\\?"
+ (line-beginning-position 0)))
(setq cont nil))
(backward-char 1)
(if (not (looking-at "\n")) (forward-char 1))))
@@ -563,14 +565,18 @@ reversed."
save-pos (point)))
(if (or (= dist 0)
- (looking-back "\\([ \t]*['`][ \t]*[a-z]*\\)")
+ (looking-back "\\([ \t]*['`][ \t]*[a-z]*\\)"
+ (line-beginning-position))
(looking-back
- "^[ \t]*[a-zA-Z!=>&~][ \t]*[/?]*[ \t]+[a-zA-Z!=>&~]+"))
+ "^[ \t]*[a-zA-Z!=>&~][ \t]*[/?]*[ \t]+[a-zA-Z!=>&~]+"
+ (line-beginning-position)))
;; Preceding characters are not the ones allowed in an Ex command
;; or we have typed past command name.
;; Note: we didn't do parsing, so there can be surprises.
- (if (or (looking-back "[a-zA-Z!=>&~][ \t]*[/?]*[ \t]*")
- (looking-back "\\([ \t]*['`][ \t]*[a-z]*\\)")
+ (if (or (looking-back "[a-zA-Z!=>&~][ \t]*[/?]*[ \t]*"
+ (line-beginning-position))
+ (looking-back "\\([ \t]*['`][ \t]*[a-z]*\\)"
+ (line-beginning-position))
(looking-at "[^ \t\n\C-m]"))
nil
(with-output-to-temp-buffer "*Completions*"
@@ -747,7 +753,8 @@ reversed."
(error "Missing closing delimiter for global regexp")
(goto-char (point-max))))
(if (not (looking-back
- (format "[^\\\\]\\(\\\\\\\\\\)*\\\\%c" c)))
+ (format "[^\\\\]\\(\\\\\\\\\\)*\\\\%c" c)
+ (line-beginning-position 0)))
(setq cont nil)
;; we are at an escaped delimiter: unescape it and continue
(delete-char -2)
@@ -963,7 +970,7 @@ reversed."
(while (re-search-forward "%\\|#" nil t)
(let ((data (match-data))
(char (buffer-substring (match-beginning 0) (match-end 0))))
- (if (looking-back (concat "\\\\" char))
+ (if (looking-back "\\\\." (- (point) 2))
(replace-match char)
(store-match-data data)
(if (string= char "%")
@@ -989,7 +996,7 @@ reversed."
(get-buffer-create viper-ex-work-buf-name))
(skip-chars-forward " \t")
(if (looking-at "!")
- (if (and (not (looking-back "[ \t]"))
+ (if (and (not (looking-back "[ \t]" (1- (point))))
;; read doesn't have a corresponding :r! form, so ! is
;; immediately interpreted as a shell command.
(not (string= ex-token "read")))
@@ -1066,7 +1073,7 @@ reversed."
(cond ((ex-cmd-accepts-multiple-files-p ex-token) (exit-minibuffer))
;; apparently the argument to an Ex command is
;; supposed to be a shell command
- ((looking-back "^[ \t]*!.*")
+ ((looking-back "^[ \t]*!.*" (line-beginning-position))
(setq ex-cmdfile t)
(insert " "))
(t
diff --git a/lisp/files.el b/lisp/files.el
index 0b011f4..152f155 100644
--- a/lisp/files.el
+++ b/lisp/files.el
@@ -3375,7 +3375,7 @@ local variables, but directory-local variables may still
be applied."
(error "Local variables entry is missing the prefix"))
(end-of-line)
;; Discard the suffix.
- (if (looking-back suffix)
+ (if (looking-back suffix (line-beginning-position))
(delete-region (match-beginning 0) (point))
(error "Local variables entry is missing the suffix"))
(forward-line 1))
diff --git a/lisp/help-fns.el b/lisp/help-fns.el
index 7ecd271..53f4b38 100644
--- a/lisp/help-fns.el
+++ b/lisp/help-fns.el
@@ -329,7 +329,7 @@ suitable file is found, return nil."
(with-current-buffer standard-output
(fill-region-as-paragraph pt2 (point))
- (unless (looking-back "\n\n")
+ (unless (looking-back "\n\n" (- (point) 2))
(terpri))))))
(defun help-fns--compiler-macro (function)
diff --git a/lisp/info-look.el b/lisp/info-look.el
index 9cf185e..8a86dc8 100644
--- a/lisp/info-look.el
+++ b/lisp/info-look.el
@@ -634,7 +634,8 @@ Return nil if there is nothing appropriate in the buffer
near point."
(setq end (point))
(> end beg))
(and (looking-at "[ \t\n]")
- (looking-back (concat "[" significant-chars "]"))
+ (looking-back (concat "[" significant-chars "]")
+ (1- (point)))
(setq end (point))
(skip-chars-backward significant-chars)
(setq beg (point))
diff --git a/lisp/info.el b/lisp/info.el
index 0159661..057bd77 100644
--- a/lisp/info.el
+++ b/lisp/info.el
@@ -2577,7 +2577,9 @@ new buffer."
(save-excursion
;; Move point to the beginning of reference if point is on reference
(or (looking-at "\\*note[ \n\t]+")
- (and (looking-back "\\*note[ \n\t]+")
+ (and (looking-back "\\*note[ \n\t]+"
+ (save-excursion (skip-chars-backward " \n\t")
+ (line-beginning-position)))
(goto-char (match-beginning 0)))
(if (and (save-excursion
(goto-char (+ (point) 5)) ; skip a possible *note
@@ -4738,9 +4740,11 @@ first line or header line, and for breadcrumb links.")
;; an end of sentence
(skip-syntax-backward " ("))
(setq other-tag
- (cond ((save-match-data (looking-back "\\<see"))
+ (cond ((save-match-data (looking-back "\\<see"
+ (- (point) 3)))
"")
- ((save-match-data (looking-back "\\<in"))
+ ((save-match-data (looking-back "\\<in"
+ (- (point) 2)))
"")
((memq (char-before) '(nil ?\. ?! ??))
"See ")
diff --git a/lisp/loadup.el b/lisp/loadup.el
index bfec75f..0746f95 100644
--- a/lisp/loadup.el
+++ b/lisp/loadup.el
@@ -63,6 +63,10 @@
(expand-file-name "textmodes" dir)
(expand-file-name "vc" dir)))))
+;; Prevent build-time PATH getting stored in the binary.
+;; Mainly cosmetic, but helpful for Guix. (Bug#20330)
+(setq exec-path nil)
+
(if (eq t purify-flag)
;; Hash consing saved around 11% of pure space in my tests.
(setq purify-flag (make-hash-table :test 'equal :size 70000)))
@@ -352,6 +356,8 @@ lost after dumping")))
lost after dumping")))
(setq current-load-list nil)
+;; Avoid storing references to build directory in the binary.
+(setq custom-current-group-alist nil)
;; We keep the load-history data in PURE space.
;; Make sure that the spine of the list is not in pure space because it can
diff --git a/lisp/mail/emacsbug.el b/lisp/mail/emacsbug.el
index 8cd5900..f4ba226 100644
--- a/lisp/mail/emacsbug.el
+++ b/lisp/mail/emacsbug.el
@@ -295,7 +295,7 @@ usually do not have translators for other languages.\n\n")))
(insert-buffer-substring message-buf beg-pos end-pos))))
;; After Recent messages, to avoid the messages produced by
;; list-load-path-shadows.
- (unless (looking-back "\n")
+ (unless (looking-back "\n" (1- (point)))
(insert "\n"))
(insert "\n")
(insert "Load-path shadows:\n")
diff --git a/lisp/mail/footnote.el b/lisp/mail/footnote.el
index ea67443..86bb9e8 100644
--- a/lisp/mail/footnote.el
+++ b/lisp/mail/footnote.el
@@ -718,7 +718,7 @@ delete the footnote with that number."
end
(point-max))))
(Footnote-goto-char-point-max)
- (when (looking-back "\n\n")
+ (when (looking-back "\n\n" (- (point) 2))
(kill-line -1))))))))
(defun Footnote-renumber-footnotes (&optional arg)
diff --git a/lisp/mail/rmail.el b/lisp/mail/rmail.el
index d150324..74533f8 100644
--- a/lisp/mail/rmail.el
+++ b/lisp/mail/rmail.el
@@ -1787,7 +1787,7 @@ not be a new one). It returns non-nil if it got any new
messages."
;; Make sure we end with a blank line unless there are
;; no messages, as required by mbox format (Bug#9974).
(unless (bobp)
- (while (not (looking-back "\n\n"))
+ (while (not (looking-back "\n\n" (- (point) 2)))
(insert "\n")))
(setq found (or
(rmail-get-new-mail-1 file-name files delete-files)
@@ -2092,7 +2092,7 @@ Value is the size of the newly read mail after
conversion."
;; Make sure the read-in mbox data properly ends with a
;; blank line unless it is of size 0.
(unless (zerop size)
- (while (not (looking-back "\n\n"))
+ (while (not (looking-back "\n\n" (- (point) 2)))
(insert "\n")))
(if (not (and rmail-preserve-inbox (string= file tofile)))
(setq delete-files (cons tofile delete-files)))))
@@ -2127,7 +2127,7 @@ Value is the size of the newly read mail after
conversion."
Call with point at the end of the message."
(unless (bolp)
(insert "\n"))
- (unless (looking-back "\n\n")
+ (unless (looking-back "\n\n" (- (point 2)))
(insert "\n")))
(defun rmail-add-mbox-headers ()
diff --git a/lisp/man.el b/lisp/man.el
index d9124c2..c5dbcba 100644
--- a/lisp/man.el
+++ b/lisp/man.el
@@ -747,7 +747,8 @@ POS defaults to `point'."
;; Record the distance traveled.
(setq distance (- column (current-column)))
(when (looking-back
- (concat "([ \t]*\\(?:" Man-section-regexp "\\)[ \t]*)"))
+ (concat "([ \t]*\\(?:" Man-section-regexp "\\)[ \t]*)")
+ (line-beginning-position))
;; Skip section number backwards.
(goto-char (match-beginning 0))
(skip-chars-backward " \t"))
diff --git a/lisp/org/org-clock.el b/lisp/org/org-clock.el
index 41e799f..c0a45b3 100644
--- a/lisp/org/org-clock.el
+++ b/lisp/org/org-clock.el
@@ -1656,7 +1656,8 @@ Optional argument N tells to change by that many units."
(save-excursion ; Do not replace this with `with-current-buffer'.
(org-no-warnings (set-buffer (org-clocking-buffer)))
(goto-char org-clock-marker)
- (if (org-looking-back (concat "^[ \t]*" org-clock-string ".*"))
+ (if (org-looking-back (concat "^[ \t]*" org-clock-string ".*")
+ (line-beginning-position))
(progn (delete-region (1- (point-at-bol)) (point-at-eol))
(org-remove-empty-drawer-at "LOGBOOK" (point)))
(message "Clock gone, cancel the timer anyway")
diff --git a/lisp/org/org-mouse.el b/lisp/org/org-mouse.el
index 160099f..9b21814 100644
--- a/lisp/org/org-mouse.el
+++ b/lisp/org/org-mouse.el
@@ -191,7 +191,7 @@ Changing this variable requires a restart of Emacs to get
activated."
(interactive)
(end-of-line)
(skip-chars-backward "\t ")
- (when (org-looking-back ":[A-Za-z]+:")
+ (when (org-looking-back ":[A-Za-z]+:" (line-beginning-position))
(skip-chars-backward ":A-Za-z")
(skip-chars-backward "\t ")))
@@ -645,7 +645,7 @@ This means, between the beginning of line and the point."
'org-mode-restart))))
((or (eolp)
(and (looking-at "\\( \\|\t\\)\\(+:[0-9a-zA-Z_:]+\\)?\\(
\\|\t\\)+$")
- (org-looking-back " \\|\t")))
+ (org-looking-back " \\|\t" (- (point) 2))))
(org-mouse-popup-global-menu))
((funcall get-context :checkbox)
(popup-menu
diff --git a/lisp/org/org.el b/lisp/org/org.el
index 3e032d4..54924a9 100644
--- a/lisp/org/org.el
+++ b/lisp/org/org.el
@@ -7679,7 +7679,7 @@ command."
(re-search-forward org-outline-regexp-bol)
(beginning-of-line 0))
(skip-chars-backward " \r\n")
- (and (not (looking-back "^\*+"))
+ (and (not (looking-back "^\*+" (line-beginning-position)))
(looking-at "[ \t]+") (replace-match ""))
(unless (eobp) (forward-char 1))
(when (looking-at "^\\*")
@@ -8658,7 +8658,8 @@ links."
(when (equal (marker-buffer org-clock-marker) (current-buffer))
(save-excursion
(goto-char org-clock-marker)
- (looking-back "^.*") (match-string-no-properties 0))))
+ (buffer-substring-no-properties (line-beginning-position)
+ (point)))))
start beg end stars re re2
txt what tmp)
;; Find beginning and end of region to sort
diff --git a/lisp/progmodes/ada-mode.el b/lisp/progmodes/ada-mode.el
index 8afb92f..c1bc79c 100644
--- a/lisp/progmodes/ada-mode.el
+++ b/lisp/progmodes/ada-mode.el
@@ -1013,7 +1013,7 @@ If PARSE-RESULT is non-nil, use it instead of calling
`parse-partial-sexp'."
(defsubst ada-in-numeric-literal-p ()
"Return t if point is after a prefix of a numeric literal."
- (looking-back "\\([0-9]+#[0-9a-fA-F_]+\\)"))
+ (looking-back "\\([0-9]+#[0-9a-fA-F_]+\\)" (line-beginning-position)))
;;------------------------------------------------------------------
;; Contextual menus
diff --git a/lisp/progmodes/cc-mode.el b/lisp/progmodes/cc-mode.el
index 1f58ba1..3c1aec4 100644
--- a/lisp/progmodes/cc-mode.el
+++ b/lisp/progmodes/cc-mode.el
@@ -511,6 +511,14 @@ that requires a literal mode spec at compile time."
(set (make-local-variable 'comment-line-break-function)
'c-indent-new-comment-line)
+ ;; Prevent time-wasting activity on C-y.
+ (when (boundp 'yank-handled-properties)
+ (make-local-variable 'yank-handled-properties)
+ (let ((yank-cat-handler (assq 'category yank-handled-properties)))
+ (when yank-cat-handler
+ (setq yank-handled-properties (remq yank-cat-handler
+ yank-handled-properties)))))
+
;; For the benefit of adaptive file, which otherwise mis-fills.
(setq fill-paragraph-handle-comment nil)
@@ -839,6 +847,18 @@ Note that the style variables are always made local to the
buffer."
(defvar c-old-EOM 0)
(make-variable-buffer-local 'c-old-EOM)
+(defun c-called-from-text-property-change-p ()
+ ;; Is the primitive which invoked `before-change-functions' or
+ ;; `after-change-functions' one which merely changes text properties? This
+ ;; function must be called directly from a member of one of the above hooks.
+ ;;
+ ;; In the following call, frame 0 is `backtrace-frame', frame 1 is
+ ;; `c-called-from-text-property-change-p', frame 2 is
+ ;; `c-before/after-change', frame 3 is the primitive invoking the change
+ ;; hook.
+ (memq (cadr (backtrace-frame 3))
+ '(put-text-property remove-list-of-text-properties)))
+
(defun c-extend-region-for-CPP (beg end)
;; Set c-old-BOM or c-old-EOM respectively to BEG, END, each extended to the
;; beginning/end of any preprocessor construct they may be in.
@@ -1009,8 +1029,9 @@ Note that the style variables are always made local to
the buffer."
;; it/them from the cache. Don't worry about being inside a string
;; or a comment - "wrongly" removing a symbol from `c-found-types'
;; isn't critical.
- (unless c-just-done-before-change ; Guard against a spurious second
- ; invocation of before-change-functions.
+ (unless (or (c-called-from-text-property-change-p)
+ c-just-done-before-change) ; guard against a spurious second
+ ; invocation of before-change-functions.
(setq c-just-done-before-change t)
(setq c-maybe-stale-found-type nil)
(save-restriction
@@ -1105,51 +1126,53 @@ Note that the style variables are always made local to
the buffer."
;; This calls the language variable c-before-font-lock-functions, if non nil.
;; This typically sets `syntax-table' properties.
- (setq c-just-done-before-change nil)
- (c-save-buffer-state (case-fold-search open-paren-in-column-0-is-defun-start)
- ;; When `combine-after-change-calls' is used we might get calls
- ;; with regions outside the current narrowing. This has been
- ;; observed in Emacs 20.7.
- (save-restriction
- (save-match-data ; c-recognize-<>-arglists changes match-data
- (widen)
-
- (when (> end (point-max))
- ;; Some emacsen might return positions past the end. This has been
- ;; observed in Emacs 20.7 when rereading a buffer changed on disk
- ;; (haven't been able to minimize it, but Emacs 21.3 appears to
- ;; work).
- (setq end (point-max))
- (when (> beg end)
- (setq beg end)))
-
- ;; C-y is capable of spuriously converting category properties
- ;; c-</>-as-paren-syntax and c-cpp-delimiter into hard syntax-table
- ;; properties. Remove these when it happens.
- (when (eval-when-compile (memq 'category-properties c-emacs-features))
- (c-clear-char-property-with-value beg end 'syntax-table
- c-<-as-paren-syntax)
- (c-clear-char-property-with-value beg end 'syntax-table
- c->-as-paren-syntax)
- (c-clear-char-property-with-value beg end 'syntax-table nil))
-
- (c-trim-found-types beg end old-len) ; maybe we don't need all of these.
- (c-invalidate-sws-region-after beg end)
- ;; (c-invalidate-state-cache beg) ; moved to `c-before-change'.
- (c-invalidate-find-decl-cache beg)
-
- (when c-recognize-<>-arglists
- (c-after-change-check-<>-operators beg end))
-
- ;; (c-new-BEG c-new-END) will be the region to fontify. It may become
- ;; larger than (beg end).
- (setq c-new-BEG beg
- c-new-END end)
- (setq c-in-after-change-fontification t)
- (save-excursion
- (mapc (lambda (fn)
- (funcall fn beg end old-len))
- c-before-font-lock-functions))))))
+ ;; (c-new-BEG c-new-END) will be the region to fontify. It may become
+ ;; larger than (beg end).
+ (setq c-new-BEG beg c-new-END end)
+
+ (unless (c-called-from-text-property-change-p)
+ (setq c-just-done-before-change nil)
+ (c-save-buffer-state (case-fold-search
open-paren-in-column-0-is-defun-start)
+ ;; When `combine-after-change-calls' is used we might get calls
+ ;; with regions outside the current narrowing. This has been
+ ;; observed in Emacs 20.7.
+ (save-restriction
+ (save-match-data ; c-recognize-<>-arglists changes match-data
+ (widen)
+
+ (when (> end (point-max))
+ ;; Some emacsen might return positions past the end. This has been
+ ;; observed in Emacs 20.7 when rereading a buffer changed on disk
+ ;; (haven't been able to minimize it, but Emacs 21.3 appears to
+ ;; work).
+ (setq end (point-max))
+ (when (> beg end)
+ (setq beg end)))
+
+ ;; C-y is capable of spuriously converting category properties
+ ;; c-</>-as-paren-syntax and c-cpp-delimiter into hard syntax-table
+ ;; properties. Remove these when it happens.
+ (when (eval-when-compile (memq 'category-properties c-emacs-features))
+ (c-save-buffer-state ()
+ (c-clear-char-property-with-value beg end 'syntax-table
+ c-<-as-paren-syntax)
+ (c-clear-char-property-with-value beg end 'syntax-table
+ c->-as-paren-syntax)
+ (c-clear-char-property-with-value beg end 'syntax-table nil)))
+
+ (c-trim-found-types beg end old-len) ; maybe we don't need all of
these.
+ (c-invalidate-sws-region-after beg end)
+ ;; (c-invalidate-state-cache beg) ; moved to `c-before-change'.
+ (c-invalidate-find-decl-cache beg)
+
+ (when c-recognize-<>-arglists
+ (c-after-change-check-<>-operators beg end))
+
+ (setq c-in-after-change-fontification t)
+ (save-excursion
+ (mapc (lambda (fn)
+ (funcall fn beg end old-len))
+ c-before-font-lock-functions)))))))
(defun c-fl-decl-start (pos)
;; If the beginning of the line containing POS is in the middle of a "local"
@@ -1322,7 +1345,7 @@ This function is called from `c-common-init', once per
mode initialization."
(add-hook 'font-lock-mode-hook 'c-after-font-lock-init nil t))
;; Emacs 22 and later.
-(defun c-extend-after-change-region (_beg _end _old-len)
+(defun c-extend-after-change-region (beg end _old-len)
"Extend the region to be fontified, if necessary."
;; Note: the parameter OLD-LEN is ignored here. This somewhat indirect
;; implementation exists because it is minimally different from the
@@ -1336,10 +1359,11 @@ This function is called from `c-common-init', once per
mode initialization."
(when (eq font-lock-support-mode 'jit-lock-mode)
(save-restriction
(widen)
- (if (< c-new-BEG beg)
- (put-text-property c-new-BEG beg 'fontified nil))
- (if (> c-new-END end)
- (put-text-property end c-new-END 'fontified nil))))
+ (c-save-buffer-state () ; Protect the undo-list from put-text-property.
+ (if (< c-new-BEG beg)
+ (put-text-property c-new-BEG beg 'fontified nil))
+ (if (> c-new-END end)
+ (put-text-property end c-new-END 'fontified nil)))))
(cons c-new-BEG c-new-END))
;; Emacs < 22 and XEmacs
diff --git a/lisp/progmodes/ruby-mode.el b/lisp/progmodes/ruby-mode.el
index f2fb95c..0e2f66e 100644
--- a/lisp/progmodes/ruby-mode.el
+++ b/lisp/progmodes/ruby-mode.el
@@ -1392,7 +1392,8 @@ by `end-of-defun'."
(interactive "p")
(ruby-forward-sexp)
(let (case-fold-search)
- (when (looking-back (concat "^\\s *" ruby-block-end-re))
+ (when (looking-back (concat "^\\s *" ruby-block-end-re)
+ (line-beginning-position))
(forward-line 1))))
(defun ruby-beginning-of-indent ()
diff --git a/lisp/progmodes/sh-script.el b/lisp/progmodes/sh-script.el
index 135f945..e4d16eb 100644
--- a/lisp/progmodes/sh-script.el
+++ b/lisp/progmodes/sh-script.el
@@ -4344,7 +4344,7 @@ The document is bounded by `sh-here-document-word'."
(or arg (sh--maybe-here-document)))
(defun sh--maybe-here-document ()
- (or (not (looking-back "[^<]<<"))
+ (or (not (looking-back "[^<]<<" (line-beginning-position)))
(save-excursion
(backward-char 2)
(or (sh-quoted-p)
diff --git a/lisp/startup.el b/lisp/startup.el
index 7fa929a..cb8a6a9 100644
--- a/lisp/startup.el
+++ b/lisp/startup.el
@@ -907,7 +907,9 @@ please check its value")
((member argi '("-Q" "-quick"))
(setq init-file-user nil
site-run-file nil
- inhibit-x-resources t))
+ inhibit-x-resources t)
+ ;; Stop it showing up in emacs -Q's customize-rogue.
+ (put 'site-run-file 'standard-value '(nil)))
((member argi '("-no-x-resources"))
(setq inhibit-x-resources t))
((member argi '("-D" "-basic-display"))
@@ -920,7 +922,8 @@ please check its value")
(setq init-file-user (or argval (pop args))
argval nil))
((equal argi "-no-site-file")
- (setq site-run-file nil))
+ (setq site-run-file nil)
+ (put 'site-run-file 'standard-value '(nil)))
((equal argi "-debug-init")
(setq init-file-debug t))
((equal argi "-iconic")
diff --git a/lisp/textmodes/bibtex.el b/lisp/textmodes/bibtex.el
index 5933559..8a01852 100644
--- a/lisp/textmodes/bibtex.el
+++ b/lisp/textmodes/bibtex.el
@@ -2229,7 +2229,7 @@ Optional arg COMMA is as in `bibtex-enclosing-field'."
bibtex-entry-kill-ring))
;; If we copied an entry from a buffer containing only this one entry,
;; it can be missing the second "\n".
- (unless (looking-back "\n\n") (insert "\n"))
+ (unless (looking-back "\n\n" (- (point 2))) (insert "\n"))
(unless (functionp bibtex-reference-keys)
;; update `bibtex-reference-keys'
(save-excursion
diff --git a/lisp/textmodes/reftex-ref.el b/lisp/textmodes/reftex-ref.el
index be119d9..d0e09bf 100644
--- a/lisp/textmodes/reftex-ref.el
+++ b/lisp/textmodes/reftex-ref.el
@@ -857,7 +857,8 @@ Optional prefix argument OTHER-WINDOW goes to the label in
another window."
(docstruct (symbol-value reftex-docstruct-symbol))
;; If point is inside a \ref{} or \pageref{}, use that as
;; default value.
- (default (when (looking-back "\\\\\\(?:page\\)?ref{[-a-zA-Z0-9_*.:]*")
+ (default (when (looking-back "\\\\\\(?:page\\)?ref{[-a-zA-Z0-9_*.:]*"
+ (line-beginning-position))
(reftex-this-word "-a-zA-Z0-9_*.:")))
(label (completing-read (if default
(format "Label (default %s): " default)
diff --git a/lisp/textmodes/reftex.el b/lisp/textmodes/reftex.el
index 9572539..0b7e9e0 100644
--- a/lisp/textmodes/reftex.el
+++ b/lisp/textmodes/reftex.el
@@ -2932,7 +2932,7 @@ When LEVEL is non-nil, increase section numbers on that
level.
;;;***
-;;;### (autoloads nil "reftex-ref" "reftex-ref.el"
"64cd7a4eaec426177a8fb3689139d935")
+;;;### (autoloads nil "reftex-ref" "reftex-ref.el"
"2689a4cea701a9d284e0967c313da989")
;;; Generated autoloads from reftex-ref.el
(autoload 'reftex-label-location "reftex-ref" "\
diff --git a/lisp/textmodes/tex-mode.el b/lisp/textmodes/tex-mode.el
index e9c7e2f..c26c609 100644
--- a/lisp/textmodes/tex-mode.el
+++ b/lisp/textmodes/tex-mode.el
@@ -1761,13 +1761,13 @@ Mark is left at original location."
;; A better way to handle this, \( .. \) etc, is probably to
;; temporarily change the syntax of the \ in \( to punctuation.
((and latex-handle-escaped-parens
- (looking-back "\\\\[])}]"))
+ (looking-back "\\\\[])}]" (- (point) 2)))
(signal 'scan-error
(list "Containing expression ends prematurely"
(- (point) 2) (prog1 (point)
(goto-char pos)))))
((and latex-handle-escaped-parens
- (looking-back "\\\\\\([({[]\\)"))
+ (looking-back "\\\\\\([({[]\\)" (- (point) 2)))
(tex-next-unmatched-eparen (match-string 1)))
(t (goto-char newpos))))))
diff --git a/lisp/vc/log-view.el b/lisp/vc/log-view.el
index 98e9357..042ea13 100644
--- a/lisp/vc/log-view.el
+++ b/lisp/vc/log-view.el
@@ -466,7 +466,8 @@ It assumes that a log entry starts with a line matching
(goto-char (match-beginning 0))))
;; Don't advance past the end buttons inserted by
;; `vc-print-log-setup-buttons'.
- ((looking-back "Show 2X entries Show unlimited entries")
+ ((looking-back "Show 2X entries Show unlimited entries"
+ (line-beginning-position))
(setq looping nil)
(forward-line -1))))))
diff --git a/src/callproc.c b/src/callproc.c
index e1fe8ed..12c8143 100644
--- a/src/callproc.c
+++ b/src/callproc.c
@@ -1595,12 +1595,12 @@ init_callproc (void)
#ifdef HAVE_NS
const char *path_exec = ns_exec_path ();
#endif
+ /* Running uninstalled, so default to tem rather than PATH_EXEC. */
Vexec_path = decode_env_path ("EMACSPATH",
#ifdef HAVE_NS
path_exec ? path_exec :
#endif
- PATH_EXEC, 0);
- Vexec_path = Fcons (tem, Vexec_path);
+ SSDATA (tem), 0);
Vexec_path = nconc2 (decode_env_path ("PATH", "", 0), Vexec_path);
}
diff --git a/src/process.c b/src/process.c
index 3ffbbec..c745507 100644
--- a/src/process.c
+++ b/src/process.c
@@ -7498,40 +7498,6 @@ init_process_emacs (void)
memset (datagram_address, 0, sizeof datagram_address);
#endif
- {
- Lisp_Object subfeatures = Qnil;
- const struct socket_options *sopt;
-
-#define ADD_SUBFEATURE(key, val) \
- subfeatures = pure_cons (pure_cons (key, pure_cons (val, Qnil)), subfeatures)
-
-#ifdef NON_BLOCKING_CONNECT
- ADD_SUBFEATURE (QCnowait, Qt);
-#endif
-#ifdef DATAGRAM_SOCKETS
- ADD_SUBFEATURE (QCtype, Qdatagram);
-#endif
-#ifdef HAVE_SEQPACKET
- ADD_SUBFEATURE (QCtype, Qseqpacket);
-#endif
-#ifdef HAVE_LOCAL_SOCKETS
- ADD_SUBFEATURE (QCfamily, Qlocal);
-#endif
- ADD_SUBFEATURE (QCfamily, Qipv4);
-#ifdef AF_INET6
- ADD_SUBFEATURE (QCfamily, Qipv6);
-#endif
-#ifdef HAVE_GETSOCKNAME
- ADD_SUBFEATURE (QCservice, Qt);
-#endif
- ADD_SUBFEATURE (QCserver, Qt);
-
- for (sopt = socket_options; sopt->name; sopt++)
- subfeatures = pure_cons (intern_c_string (sopt->name), subfeatures);
-
- Fprovide (intern_c_string ("make-network-process"), subfeatures);
- }
-
#if defined (DARWIN_OS)
/* PTYs are broken on Darwin < 6, but are sometimes useful for interactive
processes. As such, we only change the default value. */
@@ -7753,4 +7719,39 @@ The variable takes effect when `start-process' is
called. */);
defsubr (&Sprocess_inherit_coding_system_flag);
defsubr (&Slist_system_processes);
defsubr (&Sprocess_attributes);
+
+ {
+ Lisp_Object subfeatures = Qnil;
+ const struct socket_options *sopt;
+
+#define ADD_SUBFEATURE(key, val) \
+ subfeatures = pure_cons (pure_cons (key, pure_cons (val, Qnil)), subfeatures)
+
+#ifdef NON_BLOCKING_CONNECT
+ ADD_SUBFEATURE (QCnowait, Qt);
+#endif
+#ifdef DATAGRAM_SOCKETS
+ ADD_SUBFEATURE (QCtype, Qdatagram);
+#endif
+#ifdef HAVE_SEQPACKET
+ ADD_SUBFEATURE (QCtype, Qseqpacket);
+#endif
+#ifdef HAVE_LOCAL_SOCKETS
+ ADD_SUBFEATURE (QCfamily, Qlocal);
+#endif
+ ADD_SUBFEATURE (QCfamily, Qipv4);
+#ifdef AF_INET6
+ ADD_SUBFEATURE (QCfamily, Qipv6);
+#endif
+#ifdef HAVE_GETSOCKNAME
+ ADD_SUBFEATURE (QCservice, Qt);
+#endif
+ ADD_SUBFEATURE (QCserver, Qt);
+
+ for (sopt = socket_options; sopt->name; sopt++)
+ subfeatures = pure_cons (intern_c_string (sopt->name), subfeatures);
+
+ Fprovide (intern_c_string ("make-network-process"), subfeatures);
+ }
+
}
diff --git a/test/automated/message-mode-tests.el
b/test/automated/message-mode-tests.el
index 397707f..4354b23 100644
--- a/test/automated/message-mode-tests.el
+++ b/test/automated/message-mode-tests.el
@@ -1,21 +1,23 @@
;;; message-mode-tests.el --- Tests for message-mode -*- lexical-binding: t;
-*-
-;; Copyright (C) 2015 Free Software Foundation, Inc.
+;; Copyright (C) 2015 Free Software Foundation, Inc.
;; Author: João Távora <address@hidden>
-;; This program is free software; you can redistribute it and/or modify
+;; 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.
-;; This program is distributed in the hope that it will be useful,
+;; 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 this program. If not, see <http://www.gnu.org/licenses/>.
+;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
;;; Commentary: