summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
Diffstat (limited to 'lisp')
-rw-r--r--lisp/ChangeLog54
-rw-r--r--lisp/Makefile.in22
-rw-r--r--lisp/epg.el20
-rw-r--r--lisp/info-look.el7
-rw-r--r--lisp/jit-lock.el25
-rw-r--r--lisp/loadup.el34
-rw-r--r--lisp/minibuffer.el4
-rw-r--r--lisp/net/tramp-adb.el7
-rw-r--r--lisp/net/tramp-compat.el14
-rw-r--r--lisp/net/tramp-gvfs.el2
-rw-r--r--lisp/net/tramp-sh.el134
-rw-r--r--lisp/net/tramp.el22
-rw-r--r--lisp/subr.el16
-rw-r--r--lisp/textmodes/reftex-vars.el9
-rw-r--r--lisp/textmodes/reftex.el1
15 files changed, 251 insertions, 120 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index afb1ffd06fe..59e2a227e42 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,55 @@
+2013-04-23 Tassilo Horn <tsdh@gnu.org>
+
+ * textmodes/reftex.el (reftex-compile-variables): Add autoload
+ cookie.
+
+ * textmodes/reftex-vars.el (reftex-label-regexps): Call
+ `reftex-compile-variables' after changes to this variable.
+
+2013-04-23 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * jit-lock.el: Fix signals in jit-lock-force-redisplay.
+ Use lexical-binding.
+ (jit-lock-force-redisplay): Use markers, check buffer's continued
+ existence and beware narrowed buffers.
+ (jit-lock-fontify-now): Adjust call accordingly.
+
+2013-04-22 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * minibuffer.el (minibuffer-completion-contents): Fix obsolescence info
+ to avoid misleading the user.
+
+2013-04-22 Leo Liu <sdl.web@gmail.com>
+
+ * info-look.el: Prefer latex2e.info. (Bug#14240)
+
+2013-04-22 Michael Albinus <michael.albinus@gmx.de>
+
+ Fix pack/unpack coding. Reported by David Smith <davidsmith@acm.org>.
+
+ * net/tramp-compat.el (tramp-compat-call-process): Move function ...
+ * net/tramp.el (tramp-call-process): ... here
+ (tramp-set-completion-function, tramp-parse-putty):
+ * net/tramp-adb.el (tramp-adb-execute-adb-command):
+ * net/tramp-gvfs.el (tramp-gvfs-send-command):
+ * net/tramp-sh.el (tramp-sh-handle-set-file-times)
+ (tramp-set-file-uid-gid, tramp-sh-handle-write-region)
+ (tramp-call-local-coding-command): Use `tramp-call-process'
+ instead of `tramp-compat-call-process'.
+
+ * net/tramp-sh.el (tramp-perl-pack, tramp-perl-unpack): New defconst.
+ (tramp-local-coding-commands, tramp-remote-coding-commands): Use them.
+ (tramp-sh-handle-file-local-copy, tramp-sh-handle-write-region):
+ (tramp-find-inline-compress):Improve traces.
+ (tramp-maybe-send-script): Check for Perl binary.
+ (tramp-get-inline-coding): Do not redirect STDOUT for local decoding.
+
+2013-04-22 Daiki Ueno <ueno@gnu.org>
+
+ * epg.el (epg-context-pinentry-mode): New function.
+ (epg-context-set-pinentry-mode): New function.
+ (epg--start): Pass --pinentry-mode option to gpg command.
+
2013-04-21 Xue Fuqiao <xfq.free@gmail.com>
* comint.el: (comint-dynamic-complete-functions, comint-mode-map):
@@ -53,7 +105,7 @@
2013-04-19 Masatake YAMATO <yamato@redhat.com>
* progmodes/sh-script.el (sh-imenu-generic-expression):
- Handle function names with a single character. (Bug#11182)
+ Handle function names with a single character. (Bug#14111)
2013-04-19 Dima Kogan <dima@secretsauce.net> (tiny change)
diff --git a/lisp/Makefile.in b/lisp/Makefile.in
index 1e701df348f..9e56d835b6d 100644
--- a/lisp/Makefile.in
+++ b/lisp/Makefile.in
@@ -24,6 +24,10 @@ abs_top_builddir = @abs_top_builddir@
lisp = $(srcdir)
VPATH = $(srcdir)
+# Empty for all systems except MinGW, where xargs needs an explicit
+# limitation.
+XARGS_LIMIT = @XARGS_LIMIT@
+
# You can specify a different executable on the make command line,
# e.g. "make EMACS=../src/emacs ...".
@@ -160,21 +164,21 @@ $(lisp)/cus-load.el:
custom-deps: doit
cd $(lisp); $(setwins_almost); \
echo Directories: $$wins; \
- $(emacs) -l cus-dep --eval '(setq generated-custom-dependencies-file "$(lisp)/cus-load.el")' -f custom-make-dependencies $$wins
+ $(emacs) -l cus-dep --eval '(setq generated-custom-dependencies-file (reveal-filename "$(lisp)/cus-load.el"))' -f custom-make-dependencies $$wins
$(lisp)/finder-inf.el:
$(MAKE) $(MFLAGS) finder-data
finder-data: doit
cd $(lisp); $(setwins_almost); \
echo Directories: $$wins; \
- $(emacs) -l finder --eval '(setq generated-finder-keywords-file "$(lisp)/finder-inf.el")' -f finder-compile-keywords-make-dist $$wins
+ $(emacs) -l finder --eval '(setq generated-finder-keywords-file (reveal-filename "$(lisp)/finder-inf.el"))' -f finder-compile-keywords-make-dist $$wins
# The chmod +w is to handle env var CVSREAD=1.
autoloads: $(LOADDEFS) doit
cd $(lisp) && chmod +w $(AUTOGEN_VCS)
cd $(lisp); $(setwins_almost); \
echo Directories: $$wins; \
- $(emacs) -l autoload --eval '(setq generated-autoload-file "$(lisp)/loaddefs.el")' -f batch-update-autoloads $$wins
+ $(emacs) -l autoload --eval '(setq generated-autoload-file (reveal-filename "$(lisp)/loaddefs.el"))' -f batch-update-autoloads $$wins
# This is required by the bootstrap-emacs target in ../src/Makefile, so
# we know that if we have an emacs executable, we also have a subdirs.el.
@@ -274,7 +278,7 @@ compile-main: compile-clean
test -f $$el || continue; \
test ! -f $${el}c && GREP_OPTIONS= grep '^;.*no-byte-compile: t' $$el > /dev/null && continue; \
echo "$${el}c"; \
- done | xargs echo) | \
+ done | xargs $(XARGS_LIMIT) echo) | \
while read chunk; do \
$(MAKE) $(MFLAGS) compile-targets EMACS="$(EMACS)" TARGETS="$$chunk"; \
done
@@ -369,7 +373,7 @@ mh-autoloads: $(MH_E_DIR)/mh-loaddefs.el
$(MH_E_DIR)/mh-loaddefs.el: $(MH_E_SRC)
$(emacs) -l autoload \
--eval "(setq generate-autoload-cookie \";;;###mh-autoload\")" \
- --eval "(setq generated-autoload-file \"$@\")" \
+ --eval "(setq generated-autoload-file (reveal-filename \"$@\"))" \
--eval "(setq make-backup-files nil)" \
-f batch-update-autoloads $(MH_E_DIR)
@@ -387,7 +391,7 @@ TRAMP_SRC = $(TRAMP_DIR)/tramp.el $(TRAMP_DIR)/tramp-adb.el \
$(TRAMP_DIR)/tramp-loaddefs.el: $(TRAMP_SRC)
$(emacs) -l autoload \
--eval "(setq generate-autoload-cookie \";;;###tramp-autoload\")" \
- --eval "(setq generated-autoload-file \"$@\")" \
+ --eval "(setq generated-autoload-file (reveal-filename \"$@\"))" \
--eval "(setq make-backup-files nil)" \
-f batch-update-autoloads $(TRAMP_DIR)
@@ -409,21 +413,21 @@ CAL_SRC = $(CAL_DIR)/cal-bahai.el $(CAL_DIR)/cal-china.el \
$(CAL_DIR)/cal-loaddefs.el: $(CAL_SRC)
$(emacs) -l autoload \
--eval "(setq generate-autoload-cookie \";;;###cal-autoload\")" \
- --eval "(setq generated-autoload-file \"$@\")" \
+ --eval "(setq generated-autoload-file (reveal-filename \"$@\"))" \
--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 \"$@\")" \
+ --eval "(setq generated-autoload-file (reveal-filename \"$@\"))" \
--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 \"$@\")" \
+ --eval "(setq generated-autoload-file (reveal-filename \"$@\"))" \
--eval "(setq make-backup-files nil)" \
-f batch-update-autoloads $(CAL_DIR)
diff --git a/lisp/epg.el b/lisp/epg.el
index 3f04aa2e07a..c36de7e4624 100644
--- a/lisp/epg.el
+++ b/lisp/epg.el
@@ -195,7 +195,7 @@
cipher-algorithm digest-algorithm compress-algorithm
(list #'epg-passphrase-callback-function)
nil
- nil nil nil nil nil nil)))
+ nil nil nil nil nil nil nil)))
(defun epg-context-protocol (context)
"Return the protocol used within CONTEXT."
@@ -289,6 +289,12 @@ This function is for internal use only."
(signal 'wrong-type-argument (list 'epg-context-p context)))
(aref (cdr context) 14))
+(defun epg-context-pinentry-mode (context)
+ "Return the mode of pinentry invocation."
+ (unless (eq (car-safe context) 'epg-context)
+ (signal 'wrong-type-argument (list 'epg-context-p context)))
+ (aref (cdr context) 15))
+
(defun epg-context-set-protocol (context protocol)
"Set the protocol used within CONTEXT."
(unless (eq (car-safe context) 'epg-context)
@@ -407,6 +413,14 @@ This function is for internal use only."
(signal 'wrong-type-argument (list 'epg-context-p context)))
(aset (cdr context) 14 operation))
+(defun epg-context-set-pinentry-mode (context mode)
+ "Set the mode of pinentry invocation."
+ (unless (eq (car-safe context) 'epg-context)
+ (signal 'wrong-type-argument (list 'epg-context-p context)))
+ (unless (memq mode '(nil ask cancel error loopback))
+ (signal 'epg-error (list "Unknown pinentry mode" mode)))
+ (aset (cdr context) 15 mode))
+
(defun epg-make-signature (status &optional key-id)
"Return a signature object."
(cons 'epg-signature (vector status key-id nil nil nil nil nil nil nil nil
@@ -1152,6 +1166,10 @@ This function is for internal use only."
(if (epg-context-textmode context) '("--textmode"))
(if (epg-context-output-file context)
(list "--output" (epg-context-output-file context)))
+ (if (epg-context-pinentry-mode context)
+ (list "--pinentry-mode"
+ (symbol-name (epg-context-pinentry-mode
+ context))))
args))
(coding-system-for-write 'binary)
(coding-system-for-read 'binary)
diff --git a/lisp/info-look.el b/lisp/info-look.el
index afe4301c659..e43cd731547 100644
--- a/lisp/info-look.el
+++ b/lisp/info-look.el
@@ -881,8 +881,11 @@ Return nil if there is nothing appropriate in the buffer near point."
(info-lookup-maybe-add-help
:mode 'latex-mode
:regexp "\\\\\\([a-zA-Z]+\\|[^a-zA-Z]\\)"
- :doc-spec '(("(latex)Command Index" nil
- "`" "\\({[^}]*}\\)?'")))
+ :doc-spec `((,(if (Info-find-file "latex2e" t)
+ ;; From http://home.gna.org/latexrefman
+ "(latex2e)Command Index"
+ "(latex)Command Index")
+ nil "`" "\\({[^}]*}\\)?'")))
(info-lookup-maybe-add-help
:mode 'emacs-lisp-mode
diff --git a/lisp/jit-lock.el b/lisp/jit-lock.el
index d879735c344..9359a65a1b8 100644
--- a/lisp/jit-lock.el
+++ b/lisp/jit-lock.el
@@ -1,4 +1,4 @@
-;;; jit-lock.el --- just-in-time fontification
+;;; jit-lock.el --- just-in-time fontification -*- lexical-binding: t -*-
;; Copyright (C) 1998, 2000-2013 Free Software Foundation, Inc.
@@ -412,21 +412,24 @@ Defaults to the whole buffer. END can be out of bounds."
;; eagerly extend the refontified region with
;; jit-lock-after-change-extend-region-functions.
(when (< start orig-start)
- (run-with-timer 0 nil 'jit-lock-force-redisplay
- (current-buffer) start orig-start))
+ (run-with-timer 0 nil #'jit-lock-force-redisplay
+ (copy-marker start) (copy-marker orig-start)))
;; Find the start of the next chunk, if any.
(setq start (text-property-any next end 'fontified nil))))))))
-(defun jit-lock-force-redisplay (buf start end)
+(defun jit-lock-force-redisplay (start end)
"Force the display engine to re-render buffer BUF from START to END."
- (with-current-buffer buf
- (with-buffer-prepared-for-jit-lock
- ;; Don't cause refontification (it's already been done), but just do
- ;; some random buffer change, so as to force redisplay.
- (put-text-property start end 'fontified t))))
-
-
+ (when (marker-buffer start)
+ (with-current-buffer (marker-buffer start)
+ (with-buffer-prepared-for-jit-lock
+ (when (> end (point-max))
+ (setq end (point-max) start (min start end)))
+ (when (< start (point-min))
+ (setq start (point-min) end (max start end)))
+ ;; Don't cause refontification (it's already been done), but just do
+ ;; some random buffer change, so as to force redisplay.
+ (put-text-property start end 'fontified t)))))
;;; Stealth fontification.
diff --git a/lisp/loadup.el b/lisp/loadup.el
index 00c52341058..7509689e2b7 100644
--- a/lisp/loadup.el
+++ b/lisp/loadup.el
@@ -290,9 +290,12 @@
(equal (nth 4 command-line-args) "dump"))
(not (eq system-type 'ms-dos)))
(let* ((base (concat "emacs-" emacs-version "."))
+ (exelen (if (eq system-type 'windows-nt) -4))
(files (file-name-all-completions base default-directory))
- (versions (mapcar (function (lambda (name)
- (string-to-number (substring name (length base)))))
+ (versions (mapcar (function
+ (lambda (name)
+ (string-to-number
+ (substring name (length base) exelen))))
files)))
(setq emacs-bzr-version (condition-case nil (emacs-bzr-get-version)
(error nil)))
@@ -311,8 +314,18 @@
"-"
(substring name (match-end 0)))))
(if (memq system-type '(ms-dos windows-nt))
- (setq name (expand-file-name
- (if (fboundp 'x-create-frame) "DOC-X" "DOC") "../etc"))
+ (let ((name1 (expand-file-name
+ (if (fboundp 'x-create-frame) "DOC-X" "DOC")
+ "../etc")))
+ ;; There will be no DOC-X on MS-Windows when we build
+ ;; using the Posix Makefile's. In that case, we want
+ ;; to create DOC-XX.YY.ZZ, as on Unix.
+ (if (file-exists-p name1)
+ (setq name name1)
+ (setq name (concat (expand-file-name "../etc/DOC-") name))
+ (if (file-exists-p name)
+ (delete-file name))
+ (copy-file (expand-file-name "../etc/DOC") name t)))
(setq name (concat (expand-file-name "../etc/DOC-") name))
(if (file-exists-p name)
(delete-file name))
@@ -388,18 +401,25 @@
(dump-emacs "emacs" "temacs")
(message "%d pure bytes used" pure-bytes-used)
;; Recompute NAME now, so that it isn't set when we dump.
- (if (not (or (memq system-type '(ms-dos windows-nt))
+ (if (not (or (eq system-type 'ms-dos)
;; Don't bother adding another name if we're just
;; building bootstrap-emacs.
(equal (nth 3 command-line-args) "bootstrap")
(equal (nth 4 command-line-args) "bootstrap")))
- (let ((name (concat "emacs-" emacs-version)))
+ (let ((name (concat "emacs-" emacs-version))
+ (exe (if (eq system-type 'windows-nt) ".exe" "")))
(while (string-match "[^-+_.a-zA-Z0-9]+" name)
(setq name (concat (downcase (substring name 0 (match-beginning 0)))
"-"
(substring name (match-end 0)))))
+ (setq name (concat name exe))
(message "Adding name %s" name)
- (add-name-to-file "emacs" name t)))
+ ;; When this runs on Windows, invocation-directory is not
+ ;; necessarily the current directory.
+ (add-name-to-file (expand-file-name (concat "emacs" exe)
+ invocation-directory)
+ (expand-file-name name invocation-directory)
+ t)))
(kill-emacs)))
;; For machines with CANNOT_DUMP defined in config.h,
diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el
index 978b3a5b130..ef949f7482e 100644
--- a/lisp/minibuffer.el
+++ b/lisp/minibuffer.el
@@ -638,8 +638,8 @@ If ARGS are provided, then pass MESSAGE through `format'."
(defun minibuffer-completion-contents ()
"Return the user input in a minibuffer before point as a string.
-That used to be what completion commands operate on."
- (declare (obsolete minibuffer-contents "24.4"))
+In Emacs-22, that was what completion commands operated on."
+ (declare (obsolete nil "24.4"))
(buffer-substring (field-beginning) (point)))
(defun delete-minibuffer-contents ()
diff --git a/lisp/net/tramp-adb.el b/lisp/net/tramp-adb.el
index a71df54db58..613b2067955 100644
--- a/lisp/net/tramp-adb.el
+++ b/lisp/net/tramp-adb.el
@@ -982,11 +982,10 @@ PRESERVE-UID-GID and PRESERVE-EXTENDED-ATTRIBUTES are completely ignored."
(setq args (append (list "-s" (tramp-file-name-host vec)) args)))
(with-temp-buffer
(prog1
- (unless (zerop (apply 'call-process tramp-adb-program nil t nil args))
+ (unless
+ (zerop (apply 'tramp-call-process tramp-adb-program nil t nil args))
(buffer-string))
- (tramp-message
- vec 6 "%s %s\n%s"
- tramp-adb-program (mapconcat 'identity args " ") (buffer-string)))))
+ (tramp-message vec 6 "%s" (buffer-string)))))
(defun tramp-adb-find-test-command (vec)
"Checks, whether the ash has a builtin \"test\" command.
diff --git a/lisp/net/tramp-compat.el b/lisp/net/tramp-compat.el
index ed61fbcfa76..d4115352b34 100644
--- a/lisp/net/tramp-compat.el
+++ b/lisp/net/tramp-compat.el
@@ -438,20 +438,6 @@ This is, the first, empty, element is omitted. In XEmacs, the first
element is not omitted."
(delete "" (split-string string pattern)))
-(defun tramp-compat-call-process
- (program &optional infile destination display &rest args)
- "Calls `call-process' on the local host.
-This is needed because for some Emacs flavors Tramp has
-defadvised `call-process' to behave like `process-file'. The
-Lisp error raised when PROGRAM is nil is trapped also, returning 1."
- (let ((default-directory
- (if (file-remote-p default-directory)
- (tramp-compat-temporary-file-directory)
- default-directory)))
- (if (executable-find program)
- (apply 'call-process program infile destination display args)
- 1)))
-
(defun tramp-compat-process-running-p (process-name)
"Returns `t' if system process PROCESS-NAME is running for `user-login-name'."
(when (stringp process-name)
diff --git a/lisp/net/tramp-gvfs.el b/lisp/net/tramp-gvfs.el
index 6f066f56a2b..7c3b393873c 100644
--- a/lisp/net/tramp-gvfs.el
+++ b/lisp/net/tramp-gvfs.el
@@ -1572,7 +1572,7 @@ COMMAND is usually a command from the gvfs-* utilities.
(tramp-gvfs-maybe-open-connection vec)
(erase-buffer)
(tramp-message vec 6 "%s %s" command (mapconcat 'identity args " "))
- (setq result (apply 'tramp-compat-call-process command nil t nil args))
+ (setq result (apply 'tramp-call-process command nil t nil args))
(tramp-message vec 6 "\n%s" (buffer-string))
(zerop result))))
diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el
index f28df1ce160..e45c2cf8511 100644
--- a/lisp/net/tramp-sh.el
+++ b/lisp/net/tramp-sh.el
@@ -767,6 +767,16 @@ while (my $data = <STDIN>) {
Escape sequence %s is replaced with name of Perl binary.
This string is passed to `format', so percent characters need to be doubled.")
+(defconst tramp-perl-pack
+ "%s -e 'binmode STDIN; binmode STDOUT; print pack(q{u*}, join q{}, <>)'"
+ "Perl program to use for encoding a file.
+Escape sequence %s is replaced with name of Perl binary.")
+
+(defconst tramp-perl-unpack
+ "%s -e 'binmode STDIN; binmode STDOUT; print unpack(q{u*}, join q{}, <>)'"
+ "Perl program to use for decoding a file.
+Escape sequence %s is replaced with name of Perl binary.")
+
(defconst tramp-vc-registered-read-file-names
"echo \"(\"
while read file; do
@@ -1309,7 +1319,7 @@ of."
;; without `set-file-times', this function is an alias for this.
;; We are local, so we don't need the UTC settings.
(zerop
- (tramp-compat-call-process
+ (tramp-call-process
"touch" nil nil nil "-t"
(format-time-string "%Y%m%d%H%M.%S" time)
(tramp-shell-quote-argument filename)))))
@@ -1343,7 +1353,7 @@ be non-negative integers."
;; `set-file-uid-gid'. On W32 "chown" might not work.
(let ((uid (or (and (natnump uid) uid) (tramp-get-local-uid 'integer)))
(gid (or (and (natnump gid) gid) (tramp-get-local-gid 'integer))))
- (tramp-compat-call-process
+ (tramp-call-process
"chown" nil nil nil
(format "%d:%d" uid gid) (tramp-shell-quote-argument filename))))))
@@ -2891,40 +2901,39 @@ the result will be a local, non-Tramp, filename."
(rem-enc
(save-excursion
(with-tramp-progress-reporter
- v 3 (format "Encoding remote file %s" filename)
+ v 3
+ (format "Encoding remote file `%s' with `%s'" filename rem-enc)
(tramp-barf-unless-okay
v (format rem-enc (tramp-shell-quote-argument localname))
"Encoding remote file failed"))
- (if (functionp loc-dec)
- ;; If local decoding is a function, we call it. We
- ;; must disable multibyte, because
- ;; `uudecode-decode-region' doesn't handle it
- ;; correctly.
- (with-temp-buffer
- (set-buffer-multibyte nil)
- (insert-buffer-substring (tramp-get-buffer v))
- (with-tramp-progress-reporter
- v 3 (format "Decoding remote file %s with function %s"
- filename loc-dec)
+ (with-tramp-progress-reporter
+ v 3 (format "Decoding local file `%s' with `%s'"
+ tmpfile loc-dec)
+ (if (functionp loc-dec)
+ ;; If local decoding is a function, we call it.
+ ;; We must disable multibyte, because
+ ;; `uudecode-decode-region' doesn't handle it
+ ;; correctly.
+ (with-temp-buffer
+ (set-buffer-multibyte nil)
+ (insert-buffer-substring (tramp-get-buffer v))
(funcall loc-dec (point-min) (point-max))
;; Unset `file-name-handler-alist'. Otherwise,
;; epa-file gets confused.
(let (file-name-handler-alist
(coding-system-for-write 'binary))
- (write-region (point-min) (point-max) tmpfile))))
-
- ;; If tramp-decoding-function is not defined for this
- ;; method, we invoke tramp-decoding-command instead.
- (let ((tmpfile2 (tramp-compat-make-temp-file filename)))
- ;; Unset `file-name-handler-alist'. Otherwise,
- ;; epa-file gets confused.
- (let (file-name-handler-alist
- (coding-system-for-write 'binary))
- (write-region (point-min) (point-max) tmpfile2))
- (with-tramp-progress-reporter
- v 3 (format "Decoding remote file %s with command %s"
- filename loc-dec)
+ (write-region (point-min) (point-max) tmpfile)))
+
+ ;; If tramp-decoding-function is not defined for this
+ ;; method, we invoke tramp-decoding-command instead.
+ (let ((tmpfile2 (tramp-compat-make-temp-file filename)))
+ ;; Unset `file-name-handler-alist'. Otherwise,
+ ;; epa-file gets confused.
+ (let (file-name-handler-alist
+ (coding-system-for-write 'binary))
+ (with-current-buffer (tramp-get-buffer v)
+ (write-region (point-min) (point-max) tmpfile2)))
(unwind-protect
(tramp-call-local-coding-command
loc-dec tmpfile2 tmpfile)
@@ -3149,28 +3158,25 @@ Returns a file name in `tramp-auto-save-directory' for autosaving this file."
(with-temp-buffer
(set-buffer-multibyte nil)
;; Use encoding function or command.
- (if (functionp loc-enc)
- (with-tramp-progress-reporter
- v 3 (format "Encoding region using function `%s'"
- loc-enc)
- (let ((coding-system-for-read 'binary))
- (insert-file-contents-literally tmpfile))
- ;; The following `let' is a workaround for the
- ;; base64.el that comes with pgnus-0.84. If
- ;; both of the following conditions are
+ (with-tramp-progress-reporter
+ v 3 (format "Encoding local file `%s' using `%s'"
+ tmpfile loc-enc)
+ (if (functionp loc-enc)
+ ;; The following `let' is a workaround for
+ ;; the base64.el that comes with pgnus-0.84.
+ ;; If both of the following conditions are
;; satisfied, it tries to write to a local
;; file in default-directory, but at this
;; point, default-directory is remote.
;; (`call-process-region' can't write to
;; remote files, it seems.) The file in
;; question is a tmp file anyway.
- (let ((default-directory
+ (let ((coding-system-for-read 'binary)
+ (default-directory
(tramp-compat-temporary-file-directory)))
- (funcall loc-enc (point-min) (point-max))))
+ (insert-file-contents-literally tmpfile)
+ (funcall loc-enc (point-min) (point-max)))
- (with-tramp-progress-reporter
- v 3 (format "Encoding region using command `%s'"
- loc-enc)
(unless (zerop (tramp-call-local-coding-command
loc-enc tmpfile t))
(tramp-error
@@ -3183,8 +3189,8 @@ Returns a file name in `tramp-auto-save-directory' for autosaving this file."
;; writes to remote file. Because this happens on
;; the remote host, we cannot use the function.
(with-tramp-progress-reporter
- v 3
- (format "Decoding region into remote file %s" filename)
+ v 3 (format "Decoding remote file `%s' using `%s'"
+ filename rem-dec)
(goto-char (point-max))
(unless (bolp) (newline))
(tramp-send-command
@@ -3204,7 +3210,7 @@ Returns a file name in `tramp-auto-save-directory' for autosaving this file."
(erase-buffer)
(and
;; cksum runs locally, if possible.
- (zerop (tramp-compat-call-process "cksum" tmpfile t))
+ (zerop (tramp-call-process "cksum" tmpfile t))
;; cksum runs remotely.
(tramp-send-command-and-check
v
@@ -3382,6 +3388,9 @@ Only send the definition if it has not already been done."
(unless (member name scripts)
(with-tramp-progress-reporter vec 5 (format "Sending script `%s'" name)
;; The script could contain a call of Perl. This is masked with `%s'.
+ (when (and (string-match "%s" script)
+ (not (tramp-get-remote-perl vec)))
+ (tramp-error vec 'file-error "No Perl available on remote host"))
(tramp-barf-unless-okay
vec
(format "%s () {\n%s\n}" name
@@ -3811,11 +3820,6 @@ process to set up. VEC specifies the connection."
(tramp-send-command
vec (format "unset %s" (mapconcat 'identity unset " ")) t))))
-;; CCC: We should either implement a Perl version of base64 encoding
-;; and decoding. Then we just use that in the last item. The other
-;; alternative is to use the Perl version of UU encoding. But then
-;; we need a Lisp version of uuencode.
-;;
;; Old text from documentation of tramp-methods:
;; Using a uuencode/uudecode inline method is discouraged, please use one
;; of the base64 methods instead since base64 encoding is much more
@@ -3832,11 +3836,9 @@ process to set up. VEC specifies the connection."
(autoload 'uudecode-decode-region "uudecode")
(defconst tramp-local-coding-commands
- '((b64 base64-encode-region base64-decode-region)
+ `((b64 base64-encode-region base64-decode-region)
(uu tramp-uuencode-region uudecode-decode-region)
- (pack
- "perl -e 'binmode STDIN; binmode STDOUT; print pack(q{u*}, join q{}, <>)'"
- "perl -e 'binmode STDIN; binmode STDOUT; print unpack(q{u*}, join q{}, <>)'"))
+ (pack ,(format tramp-perl-pack "perl") ,(format tramp-perl-unpack "perl")))
"List of local coding commands for inline transfer.
Each item is a list that looks like this:
@@ -3871,9 +3873,7 @@ with the encoded or decoded results, respectively.")
(uu "uuencode xxx" "uudecode -o -")
(uu "uuencode xxx" "uudecode -p")
(uu "uuencode xxx" tramp-uudecode)
- (pack
- "perl -e 'binmode STDIN; binmode STDOUT; print pack(q{u*}, join q{}, <>)'"
- "perl -e 'binmode STDIN; binmode STDOUT; print unpack(q{u*}, join q{}, <>)'"))
+ (pack tramp-perl-pack tramp-perl-unpack))
"List of remote coding commands for inline transfer.
Each item is a list that looks like this:
@@ -4014,7 +4014,7 @@ INPUT can also be nil which means `/dev/null'.
OUTPUT can be a string (which specifies a filename), or t (which
means standard output and thus the current buffer), or nil (which
means discard it)."
- (tramp-compat-call-process
+ (tramp-call-process
tramp-encoding-shell
(when (and input (not (string-match "%s" cmd))) input)
(if (eq output t) t nil)
@@ -4022,7 +4022,7 @@ means discard it)."
tramp-encoding-command-switch
(concat
(if (string-match "%s" cmd) (format cmd input) cmd)
- (if (stringp output) (concat "> " output) ""))))
+ (if (stringp output) (concat " >" output) ""))))
(defconst tramp-inline-compress-commands
'(("gzip" "gzip -d")
@@ -4051,7 +4051,7 @@ Goes through the list `tramp-inline-compress-commands'."
decompress (nth 1 item))
(tramp-message
vec 5
- "Checking local compress command `%s', `%s' for sanity"
+ "Checking local compress commands `%s', `%s' for sanity"
compress decompress)
(unless
(zerop
@@ -4067,7 +4067,7 @@ Goes through the list `tramp-inline-compress-commands'."
(throw 'next nil))
(tramp-message
vec 5
- "Checking remote compress command `%s', `%s' for sanity"
+ "Checking remote compress commands `%s', `%s' for sanity"
compress decompress)
(unless (tramp-send-command-and-check
vec (format "echo %s | %s | %s" magic compress decompress) t)
@@ -4981,10 +4981,12 @@ function cell is returned to be applied on a buffer."
;; Windows shells need the program file name after
;; the pipe symbol be quoted if they use forward
;; slashes as directory separators.
- (if (and (string-match "local" prop)
- (memq system-type '(windows-nt)))
- "(%s | \"%s\" >%%s)"
- "(%s | %s >%%s)")
+ (cond
+ ((and (string-match "local" prop)
+ (memq system-type '(windows-nt)))
+ "(%s | \"%s\")")
+ ((string-match "local" prop) "(%s | %s)")
+ (t "(%s | %s >%%s)"))
coding compress))
(compress
(format
@@ -4997,7 +4999,9 @@ function cell is returned to be applied on a buffer."
"(%s <%%s | %s)")
compress coding))
((string-match "decoding" prop)
- (format "%s >%%s" coding))
+ (cond
+ ((string-match "local" prop) (format "%s" coding))
+ (t (format "%s >%%s" coding))))
(t
(format "%s <%%s" coding)))))))
diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el
index 7795d9f808c..4ec3a4b7829 100644
--- a/lisp/net/tramp.el
+++ b/lisp/net/tramp.el
@@ -1717,7 +1717,7 @@ Example:
;; Windows registry.
(and (memq system-type '(cygwin windows-nt))
(zerop
- (tramp-compat-call-process
+ (tramp-call-process
"reg" nil nil nil "query" (nth 1 (car v)))))
;; Configuration file.
(file-exists-p (nth 1 (car v)))))
@@ -2769,7 +2769,7 @@ User may be nil."
User is always nil."
(if (memq system-type '(windows-nt))
(with-temp-buffer
- (when (zerop (tramp-compat-call-process
+ (when (zerop (tramp-call-process
"reg" nil t nil "query" registry-or-dirname))
(goto-char (point-min))
(loop while (not (eobp)) collect
@@ -3897,6 +3897,24 @@ ALIST is of the form ((FROM . TO) ...)."
;;; Compatibility functions section:
+(defun tramp-call-process
+ (program &optional infile destination display &rest args)
+ "Calls `call-process' on the local host.
+This is needed because for some Emacs flavors Tramp has
+defadvised `call-process' to behave like `process-file'. The
+Lisp error raised when PROGRAM is nil is trapped also, returning 1.
+Furthermore, traces are written with verbosity of 6."
+ (let ((default-directory
+ (if (file-remote-p default-directory)
+ (tramp-compat-temporary-file-directory)
+ default-directory)))
+ (tramp-message
+ (vector tramp-current-method tramp-current-user tramp-current-host nil nil)
+ 6 "%s %s %s" program infile args)
+ (if (executable-find program)
+ (apply 'call-process program infile destination display args)
+ 1)))
+
;;;###tramp-autoload
(defun tramp-read-passwd (proc &optional prompt)
"Read a password from user (compat function).
diff --git a/lisp/subr.el b/lisp/subr.el
index 7fe3d411580..dc968542cd0 100644
--- a/lisp/subr.el
+++ b/lisp/subr.el
@@ -4655,4 +4655,20 @@ as alpha versions."
(prin1-to-string (make-hash-table)))))
(provide 'hashtable-print-readable))
+;; This is used in lisp/Makefile.in to generate file names for
+;; autoloads, custom-deps, and finder-data.
+(defun reveal-filename (file)
+ "Produce the real file name for FILE.
+
+On systems other than MS-Windows, just returns FILE.
+On MS-Windows, converts /d/foo/bar form of file names
+passed by MSYS Make into d:/foo/bar that Emacs can grok.
+
+This function is called from lisp/Makefile."
+ (when (and (eq system-type 'windows-nt)
+ (string-match "\\`/[a-zA-Z]/" file))
+ (setq file (concat (substring file 1 2) ":" (substring file 2))))
+ file)
+
+
;;; subr.el ends here
diff --git a/lisp/textmodes/reftex-vars.el b/lisp/textmodes/reftex-vars.el
index c00cf36c79e..a220002286e 100644
--- a/lisp/textmodes/reftex-vars.el
+++ b/lisp/textmodes/reftex-vars.el
@@ -873,7 +873,14 @@ DOWNCASE t: Downcase words before using them."
The default value matches usual \\label{...} definitions and
keyval style [..., label = {...}, ...] label definitions. It is
assumed that the regexp group 1 matches the label text, so you
-have to define it using \\(?1:...\\) when adding new regexps."
+have to define it using \\(?1:...\\) when adding new regexps.
+
+When changed from Lisp, make sure to call
+`reftex-compile-variables' afterwards to make the change
+effective."
+ :set (lambda (symbol value)
+ (set symbol value)
+ (reftex-compile-variables))
:group 'reftex-defining-label-environments
:type '(repeat (regexp :tag "Regular Expression")))
diff --git a/lisp/textmodes/reftex.el b/lisp/textmodes/reftex.el
index 21083fd188a..8b5dee5a037 100644
--- a/lisp/textmodes/reftex.el
+++ b/lisp/textmodes/reftex.el
@@ -811,6 +811,7 @@ This enforces rescanning the buffer on next use."
(reftex-kill-buffer (reftex-make-index-buffer-name tag)))
(cdr (assoc 'index-tags (symbol-value reftex-docstruct-symbol)))))
+;;;###autoload
(defun reftex-compile-variables ()
;; Compile the information in reftex-label-alist & Co.