commit 51b2669ad51441b3bd318c749e67b267defe4882 (HEAD, refs/remotes/origin/master) Author: Mark Oteiza Date: Tue Dec 13 22:56:42 2016 -0500 More image-dired polish * lisp/image-dired.el (image-dired-file-name-at-point): New function. (image-dired-thumbnail-mode, image-dired-display-image-mode): Disable undo list. Add image-dired-file-name-at-point to file-name-at-point-functions to facilitate find-file and friends. (image-dired-thumbnail-display-external): (image-dired-dired-display-external): Use start-process instead, to avoid needlessly blocking and using a shell. diff --git a/lisp/image-dired.el b/lisp/image-dired.el index c5fcadc..cff4ef8 100644 --- a/lisp/image-dired.el +++ b/lisp/image-dired.el @@ -1021,6 +1021,12 @@ With prefix argument ARG, remove tag from file at point." "Get original file name for thumbnail or display image at point." (get-text-property (point) 'original-file-name)) +(defun image-dired-file-name-at-point () + "Get abbreviated file name for thumbnail or display image at point." + (let ((f (image-dired-original-file-name))) + (when f + (abbreviate-file-name f)))) + (defun image-dired-associated-dired-buffer () "Get associated dired buffer at point." (get-text-property (point) 'associated-dired-buffer)) @@ -1416,13 +1422,15 @@ You probably want to use this together with fundamental-mode "image-dired-thumbnail" "Browse and manipulate thumbnail images using dired. Use `image-dired-minor-mode' to get a nice setup." - (message "image-dired-thumbnail-mode enabled")) + (buffer-disable-undo) + (add-hook 'file-name-at-point-functions 'image-dired-file-name-at-point nil t)) (define-derived-mode image-dired-display-image-mode fundamental-mode "image-dired-image-display" "Mode for displaying and manipulating original image. Resized or in full-size." - (message "image-dired-display-image-mode enabled")) + (buffer-disable-undo) + (add-hook 'file-name-at-point-functions 'image-dired-file-name-at-point nil t)) (defvar image-dired-minor-mode-map (let ((map (make-sparse-keymap))) @@ -1621,16 +1629,16 @@ Ask user how many thumbnails should be displayed per row." (message "No thumbnail at point") (if (not file) (message "No original file name found") - (call-process shell-file-name nil nil nil shell-command-switch - (format "%s \"%s\"" image-dired-external-viewer file)))))) + (start-process "image-dired-thumb-external" nil + image-dired-external-viewer file))))) ;;;###autoload (defun image-dired-dired-display-external () "Display file at point using an external viewer." (interactive) (let ((file (dired-get-filename))) - (call-process shell-file-name nil nil nil shell-command-switch - (format "%s \"%s\"" image-dired-external-viewer file)))) + (start-process "image-dired-external" nil + image-dired-external-viewer file))) (defun image-dired-window-width-pixels (window) "Calculate WINDOW width in pixels." commit c27b645956a11fab1dd8fa189254d525390958f5 Author: Phillip Lord Date: Thu Oct 27 08:07:05 2016 +0100 Replace ldefs-boot with a much smaller file * Makefile.in (bootstrap-build,generate-ldefs-boot): New targets. (bootstrap): Depend on bootstrap-build. * admin/ldefs-clean.el: New file. * lisp/Makefile.in (compile-first): Depend on loaddefs.el * lisp/ldefs-boot.el: Remove. * lisp/ldefs-boot-auto.el: New file. * lisp/ldefs-boot-manual.el: New file. * lisp/loadup.el: Load ldefs-boot-manual.el. * src/emacs.c (generating_ldefs_boot): New variable. (main): Check whether we are generating ldefs. * src/eval.c (autoload-do-load): Dump autoload forms to stderr when requested. * src/lisp.h (generating_ldefs_boot): New variable. * admin/gitmerge.el, admin/make-tarball.txt, admin/notes/copyright, lisp/Makefile.in, lisp/cus-dep.el, lisp/emacs-lisp/elint.el, lisp/finder.el, lisp/loadup.el, msdos/mainmake.v2: Update reference to ldefs-boot. * admin/update_autogen: Alter mechanism for ldefs-boot generation. diff --git a/Makefile.in b/Makefile.in index 2fead76..d7e30a8 100644 --- a/Makefile.in +++ b/Makefile.in @@ -1117,7 +1117,9 @@ check-info: info # * Run autogen.sh. # * Rebuild Makefile, to update the build procedure itself. # * Do the actual build. -bootstrap: bootstrap-clean +bootstrap: | bootstrap-clean bootstrap-build + +bootstrap-build: cd $(srcdir) && ./autogen.sh $(MAKE) MAKEFILE_NAME=force-Makefile force-Makefile $(MAKE) all @@ -1180,3 +1182,18 @@ check-declare: exit 1; \ fi $(MAKE) -C lisp $@ + +## Generating ldefs-boot-auto.el requires a completely clean build so +## that we can see which autoloads are actually called. The build has +## to complete because we use Emacs to clean the results up! We use +## loaddefs.el in place of ldefs-boot-auto, because if we are running +## this there is the possibility that ldefs-boot-auto is not +## sufficient for bootstrap. +generate-ldefs-boot: all + echo "Generating Bootstrap ldefs" + cp lisp/loaddefs.el lisp/ldefs-boot-auto.el + $(MAKE) -j 1 bootstrap \ + GENERATE_LDEFS_BOOT="generate-ldefs-boot" \ + 2>&1 | tee lisp/ldefs-boot-auto.temp + $(EMACS) -batch --load admin/ldefs-clean.el --funcall ldefs-clean + rm lisp/ldefs-boot-auto.temp diff --git a/admin/gitmerge.el b/admin/gitmerge.el index d2cb1e8..ca28863 100644 --- a/admin/gitmerge.el +++ b/admin/gitmerge.el @@ -292,7 +292,7 @@ Returns non-nil if conflicts remain." )) ;; Try to resolve the conflicts. (cond - ((member file '("configure" "lisp/ldefs-boot.el" + ((member file '("configure" "lisp/ldefs-boot-auto.el" "lisp/emacs-lisp/cl-loaddefs.el")) ;; We are in the file's buffer, so names are relative. (call-process "git" nil t nil "checkout" "--" diff --git a/admin/ldefs-clean.el b/admin/ldefs-clean.el new file mode 100644 index 0000000..89c77a7 --- /dev/null +++ b/admin/ldefs-clean.el @@ -0,0 +1,63 @@ +;; Copyright (C) 2016 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 . + +;;; Commentary: + +;; This file takes the output from the "generate-ldefs-boot" make +;; target, takes the relevant autoload forms, removes everything else +;; and adds some comments. + +(defun ldefs-clean-uniquify-region-lines (beg end) + "Remove duplicate adjacent lines in region." + (save-excursion + (goto-char beg) + (while (re-search-forward "^\\(.*\n\\)\\1+" end t) + (replace-match "\\1")))) + +(defun ldefs-clean-uniquify-buffer-lines () + "Remove duplicate adjacent lines in the current buffer." + (interactive) + (ldefs-clean-uniquify-region-lines (point-min) (point-max))) + +(defun ldefs-clean-up () + "Clean up output from build and turn it into ldefs-boot-auto.el." + (interactive) + (goto-char (point-max)) + ;; We only need the autoloads up till loaddefs.el is + ;; generated. After this, ldefs-boot.el is not needed + (search-backward " GEN loaddefs.el") + (delete-region (point) (point-max)) + (keep-lines "(autoload" (point-min) (point-max)) + (sort-lines nil (point-min) (point-max)) + (ldefs-clean-uniquify-buffer-lines) + (goto-char (point-min)) + (insert + ";; This file is autogenerated by admin/ldefs-clean.el +;; Do not edit +") + (goto-char (point-max)) + (insert + ";; Local Variables: +;; no-byte-compile: t +;; no-update-autoloads: t +;; End:")) + + +(defun ldefs-clean () + (find-file "lisp/ldefs-boot-auto.temp") + (ldefs-clean-up) + (write-file "ldefs-boot-auto.el")) diff --git a/admin/make-tarball.txt b/admin/make-tarball.txt index 77486cc..369d169 100644 --- a/admin/make-tarball.txt +++ b/admin/make-tarball.txt @@ -84,9 +84,7 @@ General steps (for each step, check for possible errors): make -C etc/refcards make -C etc/refcards clean -5. Copy lisp/loaddefs.el to lisp/ldefs-boot.el. - - Commit ChangeLog.N, etc/AUTHORS, lisp/ldefs-boot.el, and the +5. Commit ChangeLog.N, etc/AUTHORS, lisp/ldefs-boot.el, and the files changed by M-x set-version. If someone else made a commit between step 1 and now, diff --git a/admin/notes/copyright b/admin/notes/copyright index 2dc33c1..6cfc331 100644 --- a/admin/notes/copyright +++ b/admin/notes/copyright @@ -45,9 +45,9 @@ available. The definition of triviality is a little vague, but a rule of thumb is that any file with less than 15 lines of actual content is trivial. If -a file is auto-generated (eg ldefs-boot.el) from another one in the -repository, then it does not really matter about adding a copyright -statement to the generated file. +a file is auto-generated from another one in the repository, then it +does not really matter about adding a copyright statement to the +generated file. Legal advice says that we could, if we wished, put a license notice even in trivial files, because copyright law in general looks at the diff --git a/admin/update_autogen b/admin/update_autogen index f27bfe0..98be4ed 100755 --- a/admin/update_autogen +++ b/admin/update_autogen @@ -92,7 +92,7 @@ changelog_flag= ## Parameters. ldefs_in=lisp/loaddefs.el -ldefs_out=lisp/ldefs-boot.el +ldefs_boot=lisp/ldefs-boot.el changelog_n=$(sed -n 's/CHANGELOG_HISTORY_INDEX_MAX *= *//p' Makefile.in) changelog_files="ChangeLog.$changelog_n" sources="configure.ac lib/Makefile.am" @@ -370,19 +370,12 @@ echo "Running lisp/ make..." make -C lisp "$@" autoloads EMACS=../src/bootstrap-emacs || die "make src error" - -## Ignore comment differences. -[ ! "$lboot_flag" ] || \ - diff -q -I '^;' $ldefs_in $ldefs_out || \ - cp $ldefs_in $ldefs_out || die "cp ldefs_boot error" - - echo "Checking status of loaddef files..." ## It probably would be fine to just check+commit lisp/, since ## making autoloads should not effect any other files. But better ## safe than sorry. -modified=$(status $genfiles $ldefs_out) || die +modified=$(status $genfiles) || die commit "loaddefs" $modified || die "commit error" @@ -396,6 +389,14 @@ commit "loaddefs" $modified || die "commit error" } + +## Regenerate ldefs-boot if we are told to +[ ! "$lboot_flag" ] || { + make generate-ldefs-boot || die + modified=$(status $ldefs_boot) || die + commit $ldefs_boot $modified || die "commit error" +} + exit 0 ### update_autogen ends here diff --git a/lisp/Makefile.in b/lisp/Makefile.in index 12bb9c7..34f2b2c 100644 --- a/lisp/Makefile.in +++ b/lisp/Makefile.in @@ -230,7 +230,7 @@ FORCE: tagsfiles = $(shell find ${srcdir} -name '*.el') tagsfiles := $(filter-out ${srcdir}/%loaddefs.el,${tagsfiles}) -tagsfiles := $(filter-out ${srcdir}/ldefs-boot.el,${tagsfiles}) +tagsfiles := $(filter-out ${srcdir}/ldefs-boot%.el,${tagsfiles}) tagsfiles := $(filter-out ${srcdir}/eshell/esh-groups.el,${tagsfiles}) ETAGS = ../lib-src/etags${EXEEXT} @@ -283,7 +283,7 @@ $(THEFILE)c: .PHONY: compile-first compile-main compile compile-always -compile-first: $(COMPILE_FIRST) +compile-first: loaddefs.el $(COMPILE_FIRST) # In 'compile-main' we could directly do # ... | xargs $(MAKE) @@ -450,7 +450,7 @@ check-declare: check-defun-dups: sed -n -e '/^(defun /s/\(.\)(.*/\1/p' \ $$(find . -name '*.el' -print | \ - grep -Ev '(loaddefs|ldefs-boot)\.el') | sort | uniq -d + grep -Ev '(loaddefs|ldefs-boot*)\.el') | sort | uniq -d # Dependencies diff --git a/lisp/cus-dep.el b/lisp/cus-dep.el index b31c60f..90da4a8 100644 --- a/lisp/cus-dep.el +++ b/lisp/cus-dep.el @@ -33,7 +33,7 @@ ;; See finder-no-scan-regexp in finder.el. (defvar custom-dependencies-no-scan-regexp "\\(^\\.#\\|\\(loaddefs\\|\ -ldefs-boot\\|cus-load\\|finder-inf\\|esh-groups\\|subdirs\\)\\.el$\\)" +ldefs-boot.*\\|cus-load\\|finder-inf\\|esh-groups\\|subdirs\\)\\.el$\\)" "Regexp matching file names not to scan for `custom-make-dependencies'.") (require 'autoload) diff --git a/lisp/emacs-lisp/elint.el b/lisp/emacs-lisp/elint.el index 7f0f947..ab0a54c 100644 --- a/lisp/emacs-lisp/elint.el +++ b/lisp/emacs-lisp/elint.el @@ -105,7 +105,7 @@ are as follows, and suppress messages about the indicated features: :version "23.2" :group 'elint) -(defcustom elint-directory-skip-re "\\(ldefs-boot\\|loaddefs\\)\\.el\\'" +(defcustom elint-directory-skip-re "\\(ldefs-boot.*\\|loaddefs\\)\\.el\\'" "If nil, a regexp matching files to skip when linting a directory." :type '(choice (const :tag "Lint all files" nil) (regexp :tag "Regexp to skip")) diff --git a/lisp/finder.el b/lisp/finder.el index da537a5..e6d666a 100644 --- a/lisp/finder.el +++ b/lisp/finder.el @@ -130,8 +130,8 @@ Keywords and package names both should be symbols.") ;; useful, and because in parallel builds of Emacs they may get ;; modified while we are trying to read them. ;; http://lists.gnu.org/archive/html/emacs-pretest-bug/2007-01/msg00469.html -;; ldefs-boot is not auto-generated, but has nothing useful. -(defvar finder-no-scan-regexp "\\(^\\.#\\|\\(loaddefs\\|ldefs-boot\\|\ +;; ldefs-boot-* are not auto-generated during build, but has nothing useful. +(defvar finder-no-scan-regexp "\\(^\\.#\\|\\(loaddefs\\|ldefs-boot-.*\\|\ cus-load\\|finder-inf\\|esh-groups\\|subdirs\\|leim-list\\)\\.el$\\)" "Regexp matching file names not to scan for keywords.") diff --git a/lisp/ldefs-boot-auto.el b/lisp/ldefs-boot-auto.el new file mode 100644 index 0000000..914fec8 --- /dev/null +++ b/lisp/ldefs-boot-auto.el @@ -0,0 +1,125 @@ +;; This file is autogenerated by admin/ldefs-clean.el +;; Do not edit +(autoload 'Info-directory "info" nil nil nil) +(autoload 'Info-index "info" nil nil nil) +(autoload 'View-exit-and-edit "view" nil nil nil) +(autoload 'add-change-log-entry "add-log" nil nil nil) +(autoload 'add-log-current-defun "add-log" nil nil nil) +(autoload 'batch-byte-compile "bytecomp" nil nil nil) +(autoload 'browse-url "browse-url" nil nil nil) +(autoload 'buffer-face-mode "face-remap" nil nil nil) +(autoload 'byte-compile "bytecomp" nil nil nil) +(autoload 'byte-compile-disable-warning "bytecomp" nil nil nil) +(autoload 'byte-compile-enable-warning "bytecomp" nil nil nil) +(autoload 'byte-compile-file "bytecomp" nil nil nil) +(autoload 'byte-compile-inline-expand "byte-opt" nil nil nil) +(autoload 'byte-compile-unfold-lambda "byte-opt" nil nil nil) +(autoload 'byte-optimize-form "byte-opt" nil nil nil) +(autoload 'byte-optimize-lapcode "byte-opt" nil nil nil) +(autoload 'byte-recompile-directory "bytecomp" nil nil nil) +(autoload 'char-displayable-p "mule-util" nil nil nil) +(autoload 'color-name-to-rgb "color" nil nil nil) +(autoload 'comint-redirect-results-list-from-process "comint" nil nil nil) +(autoload 'comint-redirect-send-command-to-process "comint" nil nil nil) +(autoload 'compilation-mode "compile" nil nil nil) +(autoload 'compilation-shell-minor-mode "compile" nil nil nil) +(autoload 'compilation-start "compile" nil nil nil) +(autoload 'create-image "image" nil nil nil) +(autoload 'custom-save-all "cus-edit" nil nil nil) +(autoload 'customize-face "cus-edit" nil nil nil) +(autoload 'customize-group "cus-edit" nil nil nil) +(autoload 'customize-option "cus-edit" nil nil nil) +(autoload 'customize-set-variable "cus-edit" nil nil nil) +(autoload 'debug "debug" nil nil nil) +(autoload 'define-ccl-program "ccl" nil nil t) +(autoload 'define-derived-mode "derived" nil nil t) +(autoload 'define-minor-mode "easy-mmode" nil nil t) +(autoload 'delete-extract-rectangle "rect" nil nil nil) +(autoload 'describe-char "descr-text" nil nil nil) +(autoload 'describe-function "help-fns" nil nil nil) +(autoload 'describe-function-1 "help-fns" nil nil nil) +(autoload 'describe-package "package" nil nil nil) +(autoload 'describe-variable "help-fns" nil nil nil) +(autoload 'desktop-save "desktop" nil nil nil) +(autoload 'diff-mode "diff-mode" nil nil nil) +(autoload 'dired "dired" nil nil nil) +(autoload 'dired-mode "dired" nil nil nil) +(autoload 'dired-noselect "dired" nil nil nil) +(autoload 'display-call-tree "bytecomp" nil nil nil) +(autoload 'display-warning "warnings" nil nil nil) +(autoload 'easy-menu-create-menu "easymenu" nil nil nil) +(autoload 'ediff-patch-file "ediff" nil nil nil) +(autoload 'edit-kbd-macro "edmacro" nil nil nil) +(autoload 'extract-rectangle "rect" nil nil nil) +(autoload 'find-definition-noselect "find-func" nil nil nil) +(autoload 'find-function-search-for-symbol "find-func" nil nil nil) +(autoload 'find-lisp-object-file-name "help-fns" nil nil nil) +(autoload 'find-variable-noselect "find-func" nil nil nil) +(autoload 'format-kbd-macro "edmacro" nil nil nil) +(autoload 'goto-address-mode "goto-addr" nil nil nil) +(autoload 'grep-compute-defaults "grep" nil nil nil) +(autoload 'help-C-file-name "help-fns" nil nil nil) +(autoload 'help-buffer "help-mode" nil nil nil) +(autoload 'help-insert-xref-button "help-mode" nil nil nil) +(autoload 'help-make-xrefs "help-mode" nil nil nil) +(autoload 'help-mode "help-mode" nil nil nil) +(autoload 'help-setup-xref "help-mode" nil nil nil) +(autoload 'help-with-tutorial "tutorial" nil nil nil) +(autoload 'help-xref-button "help-mode" nil nil nil) +(autoload 'hi-lock-face-buffer "hi-lock" nil nil nil) +(autoload 'image-type-available-p "image" nil nil nil) +(autoload 'info "info" nil nil nil) +(autoload 'info-emacs-manual "info" nil nil nil) +(autoload 'insert-image "image" nil nil nil) +(autoload 'insert-rectangle "rect" nil nil nil) +(autoload 'isearch-process-search-multibyte-characters "isearch-x" nil nil nil) +(autoload 'jka-compr-uninstall "jka-compr" nil nil nil) +(autoload 'log-edit "log-edit" nil nil nil) +(autoload 'log-view-mode "log-view" nil nil nil) +(autoload 'lookup-nested-alist "mule-util" nil nil nil) +(autoload 'make-display-table "disp-table" nil nil nil) +(autoload 'make-glyph-code "disp-table" nil nil nil) +(autoload 'multi-isearch-buffers "misearch" nil nil nil) +(autoload 'multi-isearch-buffers-regexp "misearch" nil nil nil) +(autoload 'multi-isearch-files "misearch" nil nil nil) +(autoload 'multi-isearch-files-regexp "misearch" nil nil nil) +(autoload 'open-network-stream "network-stream" nil nil nil) +(autoload 'package-initialize "package" nil nil nil) +(autoload 'parse-time-string "parse-time" nil nil nil) +(autoload 'pp "pp" nil nil nil) +(autoload 'pp-buffer "pp" nil nil nil) +(autoload 'read-kbd-macro "edmacro" nil nil nil) +(autoload 'regexp-opt "regexp-opt" nil nil nil) +(autoload 'rx "rx" nil nil t) +(autoload 'seconds-to-string "time-date" nil nil nil) +(autoload 'seconds-to-time "time-date" nil nil nil) +(autoload 'server-start "server" nil nil nil) +(autoload 'set-nested-alist "mule-util" nil nil nil) +(autoload 'smerge-mode "smerge-mode" nil nil nil) +(autoload 'smerge-start-session "smerge-mode" nil nil nil) +(autoload 'standard-display-8bit "disp-table" nil nil nil) +(autoload 'tags-query-replace "etags" nil nil nil) +(autoload 'tags-search "etags" nil nil nil) +(autoload 'text-scale-increase "face-remap" nil nil nil) +(autoload 'thing-at-point "thingatpt" nil nil nil) +(autoload 'time-to-days "time-date" nil nil nil) +(autoload 'timezone-make-date-arpa-standard "timezone" nil nil nil) +(autoload 'tmm-menubar "tmm" nil nil nil) +(autoload 'truncate-string-to-width "mule-util" nil nil nil) +(autoload 'url-handler-mode "url-handlers" nil nil nil) +(autoload 'variable-at-point "help-fns" nil nil nil) +(autoload 'vc-register "vc" nil nil nil) +(autoload 'vc-responsible-backend "vc" nil nil nil) +(autoload 'vc-transfer-file "vc" nil nil nil) +(autoload 'view-buffer "view" nil nil nil) +(autoload 'view-buffer-other-window "view" nil nil nil) +(autoload 'view-file "view" nil nil nil) +(autoload 'view-mode-enter "view" nil nil nil) +(autoload 'visit-tags-table "etags" nil nil nil) +(autoload 'warn "warnings" nil nil nil) +(autoload 'wdired-change-to-wdired-mode "wdired" nil nil nil) +(autoload 'widget-value "wid-edit" nil nil nil) +;; Local Variables: +;; no-byte-compile: t +;; no-update-autoloads: t +;; End: diff --git a/lisp/ldefs-boot-manual.el b/lisp/ldefs-boot-manual.el new file mode 100644 index 0000000..183703d --- /dev/null +++ b/lisp/ldefs-boot-manual.el @@ -0,0 +1,19 @@ +;; These appear to be necessary as they are used elsewhere in macro definitions. +(load "emacs-lisp/gv.el") +(load "emacs-lisp/nadvice.el") +(load "emacs-lisp/inline.el") + +;; This variable is used by bytecomp.el +(defvar warning-series nil) + +;; This variable is used by emacs-lisp-mode which is used heavily +;; during the byte-compile phase +(defvar electric-pair-text-pairs '((34 . 34))) + + +(load "ldefs-boot-auto.el") + +;; Local Variables: +;; no-byte-compile: t +;; no-update-autoloads: t +;; End: diff --git a/lisp/loadup.el b/lisp/loadup.el index 5c16464..e9dd683 100644 --- a/lisp/loadup.el +++ b/lisp/loadup.el @@ -143,19 +143,21 @@ (load "button") ;; We don't want to store loaddefs.el in the repository because it is -;; a generated file; but it is required in order to compile the lisp files. -;; When bootstrapping, we cannot generate loaddefs.el until an -;; emacs binary has been built. We therefore compromise and keep -;; ldefs-boot.el in the repository. This does not need to be updated -;; as often as the real loaddefs.el would. Bootstrap should always -;; work with ldefs-boot.el. Therefore, Whenever a new autoload cookie -;; gets added that is necessary during bootstrapping, ldefs-boot.el -;; should be updated by overwriting it with an up-to-date copy of -;; loaddefs.el that is uncorrupted by local changes. -;; autogen/update_autogen can be used to periodically update ldefs-boot. +;; a generated file; but it is required in order to compile the lisp +;; files. When bootstrapping, we cannot generate loaddefs.el until an +;; emacs binary has been built. We therefore support the build with +;; two files, ldefs-boot-manual.el and ldefs-boot-auto.el, which +;; contain the autoloads that are actually called during bootstrap. +;; These do not need to be updated as often as the real loaddefs.el +;; would. Bootstrap should always work with ldefs-boot-manual.el. +;; Therefore, Whenever a new autoload cookie gets added that is +;; necessary during bootstrapping, ldefs-boot-auto.el should be +;; updated using the "generate-ldefs-boot" make target. +;; autogen/update_autogen can be used to periodically update +;; ldefs-boot. (condition-case nil (load "loaddefs.el") ;; In case loaddefs hasn't been generated yet. - (file-error (load "ldefs-boot.el"))) + (file-error (load "ldefs-boot-manual.el"))) (let ((new (make-hash-table :test 'equal))) ;; Now that loaddefs has populated definition-prefixes, purify its contents. diff --git a/msdos/mainmake.v2 b/msdos/mainmake.v2 index 98716ac..f89caf9 100644 --- a/msdos/mainmake.v2 +++ b/msdos/mainmake.v2 @@ -156,7 +156,7 @@ TAGS tags: lib-src FRC cd lib-src if exist etags.exe mv -f etags.exe ../bin cd .. - - find $(CURDIR)/lisp -iname "*.el" -a -! -( -iname "*loaddefs.el" -o -iname "ldefs-boot.el" -) | ./bin/etags -o lisp/TAGS - + - find $(CURDIR)/lisp -iname "*.el" -a -! -( -iname "*loaddefs.el" -o -iname "ldefs-boot-auto.el" -) | ./bin/etags -o lisp/TAGS - cd $(CURDIR) cd src ../bin/etags --include=../lisp/TAGS \ diff --git a/src/Makefile.in b/src/Makefile.in index ffc741d..9703768 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -764,6 +764,10 @@ endif @: Compile some files earlier to speed up further compilation. $(MAKE) -C ../lisp compile-first EMACS="$(bootstrap_exe)" + +generate-ldefs-boot: bootstrap-emacs$(EXEEXT) + $(RUN_TEMACS) --batch $(BUILD_DETAILS) --load loadup bootstrap + ifeq ($(AUTO_DEPEND),yes) -include $(ALLOBJS:%.o=${DEPDIR}/%.d) else diff --git a/src/emacs.c b/src/emacs.c index 424ee05..dc13b15 100644 --- a/src/emacs.c +++ b/src/emacs.c @@ -130,6 +130,8 @@ Lisp_Object Vlibrary_cache; on subsequent starts. */ bool initialized; +bool generating_ldefs_boot; + #ifndef CANNOT_DUMP /* Set to true if this instance of Emacs might dump. */ # ifndef DOUG_LEA_MALLOC @@ -685,7 +687,10 @@ main (int argc, char **argv) stack_bottom = &stack_bottom_variable; dumping = !initialized && (strcmp (argv[argc - 1], "dump") == 0 - || strcmp (argv[argc - 1], "bootstrap") == 0); + || strcmp (argv[argc - 1], "bootstrap") == 0 ); + + generating_ldefs_boot = getenv ("GENERATE_LDEFS_BOOT"); + /* True if address randomization interferes with memory allocation. */ # ifdef __PPC64__ diff --git a/src/eval.c b/src/eval.c index 0b257e2..1d39730 100644 --- a/src/eval.c +++ b/src/eval.c @@ -1968,6 +1968,28 @@ it defines a macro. */) if (!CONSP (fundef) || !EQ (Qautoload, XCAR (fundef))) return fundef; + /* In the special case that we are generating ldefs-boot-auto.el, + then be noisy about the autoload. */ + if( generating_ldefs_boot ) + { + fprintf(stderr, "(autoload '"); + Fprin1(funname,Qexternal_debugging_output); + fprintf(stderr, " "); + Fprin1(Fcar (Fcdr (fundef)),Qexternal_debugging_output); + fprintf(stderr, " nil nil "); + + Lisp_Object kind = Fnth (make_number (4), fundef); + if (! (EQ (kind, Qt) || EQ (kind, Qmacro))) + { + fprintf(stderr, "nil"); + } + else + { + fprintf(stderr, "t"); + } + fprintf(stderr, ")\n"); + } + if (EQ (macro_only, Qmacro)) { Lisp_Object kind = Fnth (make_number (4), fundef); diff --git a/src/lisp.h b/src/lisp.h index 5b77dc8..66e9bd5 100644 --- a/src/lisp.h +++ b/src/lisp.h @@ -619,6 +619,8 @@ extern bool might_dump; Used during startup to detect startup of dumped Emacs. */ extern bool initialized; +extern bool generating_ldefs_boot; + /* Defined in floatfns.c. */ extern double extract_float (Lisp_Object); commit 9e6618becaa15b104f18d54371f35f065f430f81 Author: Reuben Thomas Date: Tue Dec 13 00:43:21 2016 +0000 Remove support for aspell < 0.60 (from 2004) lisp/textmodes/ispell.el (ispell-check-version): Require Aspell 0.60. (ispell-aspell-dictionary-alist): Remove check that we have Aspell 0.60. diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el index c45b620..37a6ffc 100644 --- a/lisp/textmodes/ispell.el +++ b/lisp/textmodes/ispell.el @@ -727,8 +727,7 @@ Otherwise returns the library directory name, if that is defined." ;; Make sure these variables are (re-)initialized to the default value (setq ispell-really-aspell nil - ispell-aspell-supports-utf8 nil - ispell-really-hunspell nil + ispell-really-hunspell nil ispell-encoding8-command nil) (goto-char (point-min)) @@ -742,24 +741,24 @@ Otherwise returns the library directory name, if that is defined." nil t) (match-string 1))))) - (let ((aspell-minver "0.50") - (aspell8-minver "0.60") - (ispell-minver "3.1.12") - (hunspell8-minver "1.1.6")) - - (unless (version<= ispell-minver ispell-program-version) - (error "%s release %s or greater is required" - ispell-program-name - ispell-minver)) + (let* ((aspell8-minver "0.60") + (ispell-minver "3.1.12") + (hunspell8-minver "1.1.6") + (minver (cond + ((not (version<= ispell-minver ispell-program-version)) + ispell-minver) + ((and ispell-really-aspell + (not (version<= aspell8-minver ispell-really-aspell))) + aspell8-minver)))) + + (if minver + (error "%s release %s or greater is required" + ispell-program-name + minver)) (cond (ispell-really-aspell - (if (version<= aspell-minver ispell-really-aspell) - (if (version<= aspell8-minver ispell-really-aspell) - (progn - (setq ispell-aspell-supports-utf8 t) - (setq ispell-encoding8-command "--encoding="))) - (setq ispell-really-aspell nil))) + (setq ispell-encoding8-command "--encoding=")) (ispell-really-hunspell (if (version<= hunspell8-minver ispell-really-hunspell) (setq ispell-encoding8-command "-i") @@ -838,8 +837,6 @@ Internal use.") (defun ispell-find-aspell-dictionaries () "Find Aspell's dictionaries, and record in `ispell-aspell-dictionary-alist'." - (unless (and ispell-really-aspell ispell-encoding8-command) - (error "This function only works with Aspell >= 0.60")) (let* ((dictionaries (split-string (with-temp-buffer commit 97f327d8de4d4f37b6cd90ab91f895a20a9de80c Author: Reuben Thomas Date: Tue Dec 13 00:30:51 2016 +0000 Minor docstring and comment fixes to ispell.el lisp/textmodes/ispell.el (ispell-aspell-dictionary-alist): Mention ispell-aspell-dictionary-alist, not ispell-dictionary-alist. (ispell-set-spellchecker-params): Change double-single quotes to single single quotes in comment. diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el index 6733c75..c45b620 100644 --- a/lisp/textmodes/ispell.el +++ b/lisp/textmodes/ispell.el @@ -837,7 +837,7 @@ See `ispell-buffer-with-debug' for an example of use." Internal use.") (defun ispell-find-aspell-dictionaries () - "Find Aspell's dictionaries, and record in `ispell-dictionary-alist'." + "Find Aspell's dictionaries, and record in `ispell-aspell-dictionary-alist'." (unless (and ispell-really-aspell ispell-encoding8-command) (error "This function only works with Aspell >= 0.60")) (let* ((dictionaries @@ -1277,7 +1277,7 @@ aspell is used along with Emacs).") (run-hooks 'ispell-initialize-spellchecker-hook) - ;; Add dicts to ``ispell-dictionary-alist'' unless already present. + ;; Add dicts to `ispell-dictionary-alist' unless already present. (dolist (dict (append found-dicts-alist ispell-base-dicts-override-alist ispell-dictionary-base-alist)) commit 94834bdf94a89d8687638068e15a05f963dee60b Author: Reuben Thomas Date: Mon Dec 5 21:11:52 2016 +0000 Remove unused variable * lisp/textmodes/ispell.el (current-ispell-directory): Remove. diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el index c55d316..6733c75 100644 --- a/lisp/textmodes/ispell.el +++ b/lisp/textmodes/ispell.el @@ -2768,8 +2768,6 @@ Keeps argument list for future Ispell invocations for no async support." (let* (;; Basename of dictionary used by the spell-checker (dict-bname (or (car (cdr (member "-d" (ispell-get-ispell-args)))) ispell-current-dictionary)) - ;; The directory where process was started. - (current-ispell-directory default-directory) ;FIXME: Unused? ;; The default directory for the process. ;; Use "~/" as default-directory unless using Ispell with per-dir ;; personal dictionaries commit 6b5ac5837a1d519bc24a69d58343213fa149fc10 Author: Reuben Thomas Date: Sun Dec 4 22:01:56 2016 +0000 Remove XEmacs-specific ispell-with-no-warnings * lisp/textmodes/ispell.el (ispell-with-no-warnings): Remove this defmacro, needed only for XEmacs. (ispell-command-loop, ispell-message): Use with-no-warnings directly. diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el index 398e83e..c55d316 100644 --- a/lisp/textmodes/ispell.el +++ b/lisp/textmodes/ispell.el @@ -118,10 +118,6 @@ ;; Recursive edits (?C-r or ?R) inside a keyboard text replacement check (?r) ;; can cause misalignment errors. -;;; XEmacs21 does not have `with-no-warnings'. Taken from org mode. -(defmacro ispell-with-no-warnings (&rest body) - (cons (if (fboundp 'with-no-warnings) 'with-no-warnings 'progn) body)) - ;;; Code: (eval-when-compile (require 'cl-lib)) @@ -2077,7 +2073,7 @@ Global `ispell-quit' set to start location to continue spell session." " -- dict: " (or ispell-current-dictionary "default") " -- prog: " (file-name-nondirectory ispell-program-name))) ;; No need for horizontal scrollbar in choices window - (ispell-with-no-warnings + (with-no-warnings (setq horizontal-scroll-bar nil)) (erase-buffer) (if guess @@ -3849,18 +3845,18 @@ You can bind this to the key C-c i in GNUS or mail by adding to (cite-regexp ;Prefix of quoted text (cond ((functionp 'sc-cite-regexp) ; supercite >= 3.0 - (ispell-with-no-warnings + (with-no-warnings (concat "\\(" (sc-cite-regexp) "\\)" "\\|" (ispell-non-empty-string sc-reference-tag-string)))) ((equal major-mode 'message-mode) ; GNUS >= 5 (concat "In article <" "\\|" "[^,;&+=\n]+ <[^,;&+=]+> writes:" "\\|" - (ispell-with-no-warnings message-cite-prefix-regexp) + (with-no-warnings message-cite-prefix-regexp) "\\|" default-prefix)) ((equal major-mode 'mh-letter-mode) ; mh mail message (concat "[^,;&+=\n]+ writes:" "\\|" - (ispell-with-no-warnings + (with-no-warnings (ispell-non-empty-string mh-ins-buf-prefix)))) ((not internal-messagep) ; Assume nn sent us this message. (concat "In [a-zA-Z.]+ you write:" "\\|" commit 8af9cb220d1e0b16ee7ad4b5514f8d53b152bcf3 Author: Reuben Thomas Date: Sun Dec 4 21:58:00 2016 +0000 Remove meaningless defconst ispell-version * lisp/textmodes/ispell.el (ispell-version): Since ispell.el is now firmly part of Emacs, and the version hasn’t changed since 2003, and isn’t used anywhere, remove it. 3rd-party code can better use the Emacs version, or feature or function checks. (ispell-check-version): No longer report ispell.el version. diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el index 894e2ea..398e83e 100644 --- a/lisp/textmodes/ispell.el +++ b/lisp/textmodes/ispell.el @@ -671,11 +671,6 @@ here just for backwards compatibility.") ;;; The following are used by ispell, and should not be changed. ;;; ********************************************************************** - - -(defconst ispell-version "ispell.el 3.6 - 7-Jan-2003") - - (defun ispell-check-version (&optional interactivep) "Ensure that `ispell-program-name' is valid and has the correct version. Returns version number if called interactively. @@ -710,13 +705,11 @@ Otherwise returns the library directory name, if that is defined." (if (string-match "\\`aspell" speller) "-v" "-vv")))) (goto-char (point-min)) (if interactivep - ;; Report version information of ispell and ispell.el + ;; Report version information of ispell (progn (end-of-line) - (setq result (concat (buffer-substring-no-properties (point-min) - (point)) - ", " - ispell-version)) + (setq result (buffer-substring-no-properties (point-min) + (point))) (message "%s" result)) ;; return LIBDIR or LIBRARYVAR (overrides LIBDIR) env. (progn commit e1aa788807684ff7a0797db3a8787863f2520da1 Author: Reuben Thomas Date: Sun Dec 4 21:55:19 2016 +0000 Remove boundp test for always-bound symbol * lisp/textmodes/ispell.el (ispell-message): mail-yank-prefix is defvar’d at the top of the file, so remove a test to see if it is bound. diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el index 412e838..894e2ea 100644 --- a/lisp/textmodes/ispell.el +++ b/lisp/textmodes/ispell.el @@ -3851,8 +3851,7 @@ You can bind this to the key C-c i in GNUS or mail by adding to (point-max))) (t (min (point-max) (funcall ispell-message-text-end)))))) (default-prefix ; Vanilla cite prefix (just used for cite-regexp) - (if (and (boundp 'mail-yank-prefix) mail-yank-prefix) - (ispell-non-empty-string mail-yank-prefix) + (if (ispell-non-empty-string mail-yank-prefix) " \\|\t")) (cite-regexp ;Prefix of quoted text (cond commit db6e1f82976a7f232a4a206a3c850ed34cfbfdd3 Author: Reuben Thomas Date: Sun Dec 4 21:50:18 2016 +0000 Remove support for ispell < 3.1.12 * lisp/textmodes/ispell.el (ispell-offset): Remove. (ispell-check-version): Require ispell >= 3.1.12, released in 1994. (ispell-process-line): No longer use ispell-offset. diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el index b3fee99..412e838 100644 --- a/lisp/textmodes/ispell.el +++ b/lisp/textmodes/ispell.el @@ -673,9 +673,6 @@ here just for backwards compatibility.") -(defvar ispell-offset -1 - "Offset that maps protocol differences between ispell 3.1 versions.") - (defconst ispell-version "ispell.el 3.6 - 7-Jan-2003") @@ -758,13 +755,10 @@ Otherwise returns the library directory name, if that is defined." (let ((aspell-minver "0.50") (aspell8-minver "0.60") - (ispell0-minver "3.1.0") (ispell-minver "3.1.12") (hunspell8-minver "1.1.6")) - (if (version<= ispell0-minver ispell-program-version) - (or (version<= ispell-minver ispell-program-version) - (setq ispell-offset 0)) + (unless (version<= ispell-minver ispell-program-version) (error "%s release %s or greater is required" ispell-program-name ispell-minver)) @@ -3360,7 +3354,7 @@ Returns the sum SHIFT due to changes in word replacements." ;; Markers can move with highlighting! This destroys ;; end of region markers line-end and ispell-region-end (let ((word-start - (copy-marker (+ ispell-start ispell-offset (car (cdr poss))))) + (copy-marker (+ ispell-start (car (cdr poss))))) (word-len (length (car poss))) (line-end (copy-marker ispell-end)) (line-start (copy-marker ispell-start)) commit 3affed01e15e54ca240aecea32d4fc1e329b21ea Author: Reuben Thomas Date: Sun Dec 4 21:47:02 2016 +0000 Remove unused constant * lisp/textmodes/ispell.el (ispell-required-version): Remove. diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el index 2f91ec2..b3fee99 100644 --- a/lisp/textmodes/ispell.el +++ b/lisp/textmodes/ispell.el @@ -673,10 +673,6 @@ here just for backwards compatibility.") -;; The version must be 3.1 or greater for this version of ispell.el -;; There is an incompatibility between version 3.1.12 and lower versions. -(defconst ispell-required-version '(3 1 12) - "Ispell versions with which this version of ispell.el is known to work.") (defvar ispell-offset -1 "Offset that maps protocol differences between ispell 3.1 versions.") commit 8315d50bce7661dd56eaa745b3f893c7862a1748 Author: Reuben Thomas Date: Sun Dec 4 19:20:19 2016 +0000 Remove support for old versions of supercite and GNUS from ispell.el * lisp/textmodes/ispell.el (ispell-message): Require supercite >= 3.0 and GNUS >= 5. Not exactly the bleeding edge! diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el index 3abefdc..2f91ec2 100644 --- a/lisp/textmodes/ispell.el +++ b/lisp/textmodes/ispell.el @@ -3866,16 +3866,11 @@ You can bind this to the key C-c i in GNUS or mail by adding to " \\|\t")) (cite-regexp ;Prefix of quoted text (cond - ((functionp 'sc-cite-regexp) ; sc 3.0 + ((functionp 'sc-cite-regexp) ; supercite >= 3.0 (ispell-with-no-warnings (concat "\\(" (sc-cite-regexp) "\\)" "\\|" (ispell-non-empty-string sc-reference-tag-string)))) - ((boundp 'sc-cite-regexp) ; sc 2.3 - (concat "\\(" sc-cite-regexp "\\)" "\\|" - (ispell-with-no-warnings - (ispell-non-empty-string sc-reference-tag-string)))) - ((or (equal major-mode 'news-reply-mode) ;GNUS 4 & below - (equal major-mode 'message-mode)) ;GNUS 5 + ((equal major-mode 'message-mode) ; GNUS >= 5 (concat "In article <" "\\|" "[^,;&+=\n]+ <[^,;&+=]+> writes:" "\\|" (ispell-with-no-warnings message-cite-prefix-regexp) commit b989c415acb0059c0b39caade20b8d87031c1477 Author: Reuben Thomas Date: Sun Dec 4 14:39:42 2016 +0000 Remove remaining mentions of XEmacs from ispell.el * lisp/textmodes/ispell.el (ispell-valid-dictionary-list): (ispell-add-per-file-word-list): Remove mentions of XEmacs from comments. diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el index c2d6d60..3abefdc 100644 --- a/lisp/textmodes/ispell.el +++ b/lisp/textmodes/ispell.el @@ -1331,8 +1331,7 @@ aspell is used along with Emacs).") "Return a list of valid dictionaries. The variable `ispell-library-directory' defines their location." ;; Initialize variables and dictionaries alists for desired spellchecker. - ;; Make sure ispell.el is loaded to avoid some autoload loops in XEmacs - ;; (and may be others) + ;; Make sure ispell.el is loaded to avoid some autoload loops. (if (featurep 'ispell) (ispell-set-spellchecker-params)) @@ -4189,6 +4188,6 @@ Both should not be used to define a buffer-local dictionary." ; LocalWords: minipage pers dict unhighlight buf grep sync prev inc ; LocalWords: fn oldot NB AIX msg init read's bufs pt cmd Quinlan eg ; LocalWords: uuencoded unidiff sc nn VM SGML eval IspellPersDict -; LocalWords: lns XEmacs HTML casechars Multibyte +; LocalWords: lns HTML casechars Multibyte ;;; ispell.el ends here commit 8886f156b305b76ffd69a96d7470eb3b700f43a4 Author: Reuben Thomas Date: Sun Dec 4 14:38:51 2016 +0000 Remove XEmacs-specific minibuffer handling code from ispell.el * lisp/textmodes/ispell.el (ispell-init-process): Assume we are not in XEmacs. diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el index 8978d14..c2d6d60 100644 --- a/lisp/textmodes/ispell.el +++ b/lisp/textmodes/ispell.el @@ -2794,7 +2794,7 @@ Keeps argument list for future Ispell invocations for no async support." (current-ispell-directory default-directory) ;FIXME: Unused? ;; The default directory for the process. ;; Use "~/" as default-directory unless using Ispell with per-dir - ;; personal dictionaries and not in a minibuffer under XEmacs + ;; personal dictionaries (default-directory (if (or ispell-really-aspell ispell-really-hunspell @@ -2807,9 +2807,8 @@ Keeps argument list for future Ispell invocations for no async support." ".ispell_" (or dict-bname "default"))))) - ;; Ispell, in a minibuffer, and XEmacs - (and (window-minibuffer-p) - (not (fboundp 'minibuffer-selected-window)))) + ;; Ispell, in a minibuffer + (window-minibuffer-p)) (expand-file-name "~/") (expand-file-name default-directory)))) ;; Check if process needs restart @@ -2841,12 +2840,11 @@ Keeps argument list for future Ispell invocations for no async support." (unless (equal ispell-process-directory (expand-file-name "~/")) ;; At this point, `ispell-process-directory' will be "~/" unless using - ;; Ispell with directory-specific dicts and not in XEmacs minibuffer. + ;; Ispell with directory-specific dicts. ;; If not, kill ispell process when killing buffer. It may be in a ;; removable device that would otherwise become un-mountable. (with-current-buffer - (if (and (window-minibuffer-p) ;; In minibuffer - (fboundp 'minibuffer-selected-window)) ;; Not XEmacs. + (if (window-minibuffer-p) ;; In minibuffer ;; In this case kill ispell only when parent buffer is killed ;; to avoid over and over ispell kill. (window-buffer (minibuffer-selected-window)) commit 6e88249cdcfefee6ed8f27ff4e93e433ac58ada0 Author: Reuben Thomas Date: Sun Dec 4 14:37:37 2016 +0000 Remove XEmacs-specific horizontal scrollbar handling in ispell.el * lisp/textmodes/ispell.el (ispell-command-loop): Remove XEmacs-specific code. diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el index f0bb569..8978d14 100644 --- a/lisp/textmodes/ispell.el +++ b/lisp/textmodes/ispell.el @@ -2094,15 +2094,9 @@ Global `ispell-quit' set to start location to continue spell session." "-- %b -- word: " word " -- dict: " (or ispell-current-dictionary "default") " -- prog: " (file-name-nondirectory ispell-program-name))) - ;; XEmacs: no need for horizontal scrollbar in choices window + ;; No need for horizontal scrollbar in choices window (ispell-with-no-warnings - (and (fboundp 'set-specifier) - (boundp 'horizontal-scrollbar-visible-p) - (set-specifier horizontal-scrollbar-visible-p nil - (cons (current-buffer) nil)))) - (ispell-with-no-warnings - (and (boundp 'horizontal-scroll-bar) - (setq horizontal-scroll-bar nil))) + (setq horizontal-scroll-bar nil)) (erase-buffer) (if guess (progn commit 8245e5b9b00b4a839aa201d7883d5e55e8f66879 Author: Reuben Thomas Date: Sun Dec 4 14:35:42 2016 +0000 Remove XEmacs-specific code dealing with enable-multibyte-characters * lisp/textmodes/ispell.el (ispell-decode-string): (ispell-init-process): Remove XEmacs-specific guard. diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el index 6a28db6..f0bb569 100644 --- a/lisp/textmodes/ispell.el +++ b/lisp/textmodes/ispell.el @@ -1451,17 +1451,8 @@ used as key in `ispell-local-dictionary-alist' and `ispell-dictionary-alist'.") This is passed to the Ispell process using the `-p' switch.") (defun ispell-decode-string (str) - "Decodes multibyte character strings. -Protects against bogus binding of `enable-multibyte-characters' in XEmacs." - ;; FIXME: enable-multibyte-characters is read-only, so bogus bindings are - ;; really nasty (they signal an error in Emacs): Who does that? --Stef - (if (and (or (featurep 'xemacs) - (and (boundp 'enable-multibyte-characters) - enable-multibyte-characters)) - (fboundp 'decode-coding-string) - (ispell-get-coding-system)) - (decode-coding-string str (ispell-get-coding-system)) - str)) + "Decodes multibyte character strings." + (decode-coding-string str (ispell-get-coding-system))) ;; Return a string decoded from Nth element of the current dictionary. (defun ispell-get-decoded-string (n) @@ -2871,11 +2862,7 @@ Keeps argument list for future Ispell invocations for no async support." (if ispell-async-processp (set-process-filter ispell-process 'ispell-filter)) - ;; Protect against XEmacs bogus binding of `enable-multibyte-characters'. - (if (and (or (featurep 'xemacs) - (and (boundp 'enable-multibyte-characters) - enable-multibyte-characters)) - (fboundp 'set-process-coding-system) + (if (and enable-multibyte-characters ;; Evidently, some people use the synchronous mode even ;; when async subprocesses are supported, in which case ;; set-process-coding-system is bound, but commit ff5deddc83ea07916c161457920bee301dc3e5f8 Author: Reuben Thomas Date: Sun Dec 4 14:19:26 2016 +0000 Remove XEmacs-specific code from ispell.el * lisp/textmodes/ispell.el (ispell-menu-xemacs): Remove (ispell-menu-map-needed): Remove XEmacs-specific check. (ispell-word): Remove XEmacs-specific extent code. (ispell-init-process): Remove XEmacs workaround for local add-hook. Assume we have set-process-query-on-exit-flag. (ispell-kill-ispell, ispell-change-dictionary): Remove XEmacs workaround for called-interactively-p. diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el index a6dd905..6a28db6 100644 --- a/lisp/textmodes/ispell.el +++ b/lisp/textmodes/ispell.el @@ -833,22 +833,10 @@ See `ispell-buffer-with-debug' for an example of use." ;; Redo menu when loading ispell to get dictionary modifications (setq ispell-menu-map nil) -;;;###autoload -(defvar ispell-menu-xemacs nil - "Spelling menu for XEmacs. -If nil when package is loaded, a standard menu will be set, -and added as a submenu of the \"Edit\" menu.") - -;; Break out XEmacs menu and split into several calls to avoid having -;; long lines in loaddefs.el. Detect need off following constant. - ;;; Set up dictionary ;;;###autoload (defvar ispell-menu-map-needed - ;; only needed when not version 18 and not XEmacs. - (and (not ispell-menu-map) - (not (featurep 'xemacs)) - 'reload)) + (unless ispell-menu-map 'reload)) (defvar ispell-library-directory (condition-case () (ispell-check-version) @@ -1932,32 +1920,20 @@ quit spell session exited." (cond ((eq poss t) (or quietly (message "%s is correct" - (funcall ispell-format-word-function word))) - (and (featurep 'xemacs) - (extent-at start) - (and (fboundp 'delete-extent) - (delete-extent (extent-at start))))) + (funcall ispell-format-word-function word)))) ((stringp poss) (or quietly (message "%s is correct because of root %s" (funcall ispell-format-word-function word) - (funcall ispell-format-word-function poss))) - (and (featurep 'xemacs) - (extent-at start) - (and (fboundp 'delete-extent) - (delete-extent (extent-at start))))) + (funcall ispell-format-word-function poss)))) ((null poss) (message "Error checking word %s using %s with %s dictionary" (funcall ispell-format-word-function word) (file-name-nondirectory ispell-program-name) (or ispell-current-dictionary "default"))) (ispell-check-only ; called from ispell minor mode. - (if (fboundp 'make-extent) - (if (fboundp 'set-extent-property) - (let ((ext (make-extent start end))) - (set-extent-property ext 'face ispell-highlight-face) - (set-extent-property ext 'priority 2000))) - (beep) + (progn + (beep) (message "%s is incorrect" (funcall ispell-format-word-function word)))) (t ; prompt for correct word. @@ -2890,10 +2866,7 @@ Keeps argument list for future Ispell invocations for no async support." ;; to avoid over and over ispell kill. (window-buffer (minibuffer-selected-window)) (current-buffer)) - ;; 'local does not automatically make hook buffer-local in XEmacs. - (if (featurep 'xemacs) - (make-local-hook 'kill-buffer-hook)) - (add-hook 'kill-buffer-hook + (add-hook 'kill-buffer-hook (lambda () (ispell-kill-ispell t)) nil 'local))) (if ispell-async-processp @@ -2938,12 +2911,8 @@ Keeps argument list for future Ispell invocations for no async support." (let ((extended-char-mode (ispell-get-extended-character-mode))) (if extended-char-mode ; ~ extended character mode (ispell-send-string (concat extended-char-mode "\n")))) - (if ispell-async-processp - (if (featurep 'emacs) - (set-process-query-on-exit-flag ispell-process nil) - (if (fboundp 'set-process-query-on-exit-flag) - (set-process-query-on-exit-flag ispell-process nil) - (process-kill-without-query ispell-process))))))) + (when ispell-async-processp + (set-process-query-on-exit-flag ispell-process nil))))) ;;;###autoload (defun ispell-kill-ispell (&optional no-error clear) @@ -2955,9 +2924,7 @@ With CLEAR, buffer session localwords are cleaned." ;; to optimize the common cases. (run-hooks 'ispell-kill-ispell-hook) (if (or clear - (if (featurep 'xemacs) - (interactive-p) - (called-interactively-p 'interactive))) + (called-interactively-p 'interactive)) (setq ispell-buffer-session-localwords nil)) (if (not (and ispell-process (eq (ispell-process-status) 'run))) @@ -3006,9 +2973,7 @@ By just answering RET you can find out what the current dictionary is." ;; Specified dictionary is the default already. Could reload ;; the dictionaries if needed. (ispell-internal-change-dictionary) - (and (if (featurep 'xemacs) - (interactive-p) - (called-interactively-p 'interactive)) + (when (called-interactively-p 'interactive) (message "No change, using %s dictionary" dict))) (t ; reset dictionary! (if (or (assoc dict ispell-local-dictionary-alist) commit ada717efc4cd541fe26b0e8a15698e1c6a732444 Author: Reuben Thomas Date: Sun Dec 4 14:15:50 2016 +0000 Remove some commented-out code lisp/textmodes/ispell.el (ispell-process) ispell-valid-dictionary-list): Remove commented-out code. diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el index 95e87e4..a6dd905 100644 --- a/lisp/textmodes/ispell.el +++ b/lisp/textmodes/ispell.el @@ -860,11 +860,7 @@ and added as a submenu of the \"Edit\" menu.") (defvar ispell-async-processp (and (fboundp 'delete-process) (fboundp 'process-send-string) - (fboundp 'accept-process-output) - ;;(fboundp 'make-process) - ;;(fboundp 'set-process-filter) - ;;(fboundp 'process-kill-without-query) - ) + (fboundp 'accept-process-output)) "Non-nil means that the OS supports asynchronous processes.") ;; Make ispell.el work better with aspell. @@ -1452,7 +1448,6 @@ The variable `ispell-library-directory' defines their location." (define-key ispell-menu-map [ispell-buffer] `(menu-item ,(purecopy "Spell-Check Buffer") ispell-buffer :help ,(purecopy "Check spelling of selected buffer"))) - ;;(put 'ispell-region 'menu-enable 'mark-active) (fset 'ispell-menu-map (symbol-value 'ispell-menu-map)))) commit c89dc9d8f354260cb1a32823660b676166fdaf94 Author: Reuben Thomas Date: Sun Dec 4 14:05:07 2016 +0000 Remove XEmacs and old Emacs highlighting code * lisp/textmodes/ispell.el (ispell-highlight-spelling-error-xemacs): Remove. (ispell-highlight-spelling-error): Assume display-color-p exists. diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el index 6246eb3..95e87e4 100644 --- a/lisp/textmodes/ispell.el +++ b/lisp/textmodes/ispell.el @@ -2633,17 +2633,6 @@ Optional REFRESH will unhighlighted then highlight, using block cursor (if (eq 'block refresh) start (- start 2)) end t)))) -(defun ispell-highlight-spelling-error-xemacs (start end &optional highlight) - "Highlight the word from START to END using `isearch-highlight'. -When the optional third arg HIGHLIGHT is set, the word is highlighted, -otherwise it is displayed normally." - (if highlight - (isearch-highlight start end) - (isearch-dehighlight)) - ;;(sit-for 0) - ) - - (defun ispell-highlight-spelling-error-overlay (start end &optional highlight) "Highlight the word from START to END using overlays. When the optional third arg HIGHLIGHT is set, the word is highlighted @@ -2679,14 +2668,9 @@ The variable `ispell-highlight-face' selects the face to use for highlighting." (defun ispell-highlight-spelling-error (start end &optional highlight refresh) - (cond - ((featurep 'xemacs) - (ispell-highlight-spelling-error-xemacs start end highlight)) - ((and (featurep 'faces) - (or (and (fboundp 'display-color-p) (display-color-p)) - window-system)) - (ispell-highlight-spelling-error-overlay start end highlight)) - (t (ispell-highlight-spelling-error-generic start end highlight refresh)))) + (if (display-color-p) + (ispell-highlight-spelling-error-overlay start end highlight) + (ispell-highlight-spelling-error-generic start end highlight refresh))) (defun ispell-display-buffer (buffer) "Show BUFFER in new window above selected one. commit 854ed8a6d5e2c85de38a25a7b2158b11d885d1db Author: Reuben Thomas Date: Sun Dec 4 14:02:48 2016 +0000 Assume Emacs supports [:alpha:] in regexps * lisp/textmodes/ispell.el (ispell-emacs-alpha-regexp): Remove. (ispell-set-spellchecker-params): Remove tests of ispell-emacs-alpha-regexp. diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el index 5670bcd..6246eb3 100644 --- a/lisp/textmodes/ispell.el +++ b/lisp/textmodes/ispell.el @@ -666,12 +666,6 @@ here just for backwards compatibility.") "Alist with known matching locales for standard dict names in `ispell-dictionary-base-alist'.") -(defvar ispell-emacs-alpha-regexp - (if (string-match "^[[:alpha:]]+$" "abcde") - "[[:alpha:]]" - nil) - "[[:alpha:]] if Emacs supports [:alpha:] regexp, nil -otherwise (current XEmacs does not support it).") ;;; ********************************************************************** ;;; The following are used by ispell, and should not be changed. @@ -1244,11 +1238,9 @@ aspell is used along with Emacs).") (setq ispell-library-directory (ispell-check-version)) t) (error nil)) - ispell-encoding8-command - ispell-emacs-alpha-regexp) + ispell-encoding8-command) ;; auto-detection will only be used if spellchecker is not - ;; ispell, supports a way to set communication to UTF-8 and - ;; Emacs flavor supports [:alpha:] + ;; ispell and supports a way to set communication to UTF-8. (if ispell-really-aspell (or ispell-aspell-dictionary-alist (ispell-find-aspell-dictionaries)) @@ -1262,9 +1254,8 @@ aspell is used along with Emacs).") ;; installed dictionaries and add to it elements of the original ;; list that are not present there. Allow distro info. (let ((found-dicts-alist - (if (and ispell-encoding8-command - ispell-emacs-alpha-regexp) - (if ispell-really-aspell + (if ispell-encoding8-command + (if ispell-really-aspell ispell-aspell-dictionary-alist (if ispell-really-hunspell ispell-hunspell-dictionary-alist)) @@ -1331,28 +1322,26 @@ aspell is used along with Emacs).") (push dict all-dicts-alist))) (setq ispell-dictionary-alist all-dicts-alist)) - ;; If Emacs flavor supports [:alpha:] use it for global dicts. If - ;; spellchecker also supports UTF-8 via command-line option use it + ;; If spellchecker supports UTF-8 via command-line option, use it ;; in communication. This does not affect definitions in your ;; init file. - (if ispell-emacs-alpha-regexp - (let (tmp-dicts-alist) - (dolist (adict ispell-dictionary-alist) - (cl-pushnew (if (cadr adict) ;; Do not touch hunspell uninitialized entries - (list - (nth 0 adict) ; dict name - "[[:alpha:]]" ; casechars - "[^[:alpha:]]" ; not-casechars - (nth 3 adict) ; otherchars - (nth 4 adict) ; many-otherchars-p - (nth 5 adict) ; ispell-args - (nth 6 adict) ; extended-character-mode - (if ispell-encoding8-command - 'utf-8 - (nth 7 adict))) - adict) - tmp-dicts-alist :test #'equal)) - (setq ispell-dictionary-alist tmp-dicts-alist))))) + (let (tmp-dicts-alist) + (dolist (adict ispell-dictionary-alist) + (cl-pushnew (if (cadr adict) ;; Do not touch hunspell uninitialized entries + (list + (nth 0 adict) ; dict name + "[[:alpha:]]" ; casechars + "[^[:alpha:]]" ; not-casechars + (nth 3 adict) ; otherchars + (nth 4 adict) ; many-otherchars-p + (nth 5 adict) ; ispell-args + (nth 6 adict) ; extended-character-mode + (if ispell-encoding8-command + 'utf-8 + (nth 7 adict))) + adict) + tmp-dicts-alist :test #'equal)) + (setq ispell-dictionary-alist tmp-dicts-alist)))) (defun ispell-valid-dictionary-list () "Return a list of valid dictionaries. commit 3ac94b992c15cd4f45c470d6bd5a978d1bb9565f Author: Reuben Thomas Date: Sun Dec 4 13:59:59 2016 +0000 Remove some XEmacs-specific code from ispell.el * lisp/textmodes/ispell.el: Remove XEmacs menubar setup. (ispell-int-char): Remove. diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el index 5ad7d05..5670bcd 100644 --- a/lisp/textmodes/ispell.el +++ b/lisp/textmodes/ispell.el @@ -1466,62 +1466,6 @@ The variable `ispell-library-directory' defines their location." ;;(put 'ispell-region 'menu-enable 'mark-active) (fset 'ispell-menu-map (symbol-value 'ispell-menu-map)))) -;;; XEmacs versions 19 & 20 -(if (and (featurep 'xemacs) - (featurep 'menubar) - ;;(null ispell-menu-xemacs) - (not (and (boundp 'infodock-version) infodock-version))) - (let ((dicts (if (fboundp 'ispell-valid-dictionary-list) - (reverse (ispell-valid-dictionary-list)))) - (current-menubar (or current-menubar default-menubar)) - (menu - '(["Help" (describe-function 'ispell-help) t] - ;;["Help" (popup-menu ispell-help-list) t] - ["Check Message" ispell-message t] - ["Check Buffer" ispell-buffer t] - ["Check Comments" ispell-comments-and-strings t] - ["Check Word" ispell-word t] - ["Check Region" ispell-region (or (not zmacs-regions) (mark))] - ["Continue Check" ispell-continue t] - ["Complete Word Frag"ispell-complete-word-interior-frag t] - ["Complete Word" ispell-complete-word t] - ["Kill Process" (ispell-kill-ispell nil 'clear) t] - ["Customize..." (customize-group 'ispell) t] - ;; flyspell-mode may not be bound... - ;;["flyspell" flyspell-mode - ;; :style toggle :selected flyspell-mode ] - "-" - ["Save Personal Dict"(ispell-pdict-save t t) t] - ["Change Dictionary" ispell-change-dictionary t]))) - (if (null dicts) - (setq dicts (cons "default" nil))) - (dolist (name dicts) - (setq menu (append menu - (list - (vector - (concat "Select " (capitalize name)) - (list 'ispell-change-dictionary name) - t))))) - (setq ispell-menu-xemacs menu) - (if current-menubar - (progn - (if (car (find-menu-item current-menubar '("Cmds"))) - (progn - ;; XEmacs 21.2 - (delete-menu-item '("Cmds" "Spell-Check")) - (add-menu '("Cmds") "Spell-Check" ispell-menu-xemacs)) - ;; previous - (delete-menu-item '("Edit" "Spell")) ; in case already defined - (add-menu '("Edit") "Spell" ispell-menu-xemacs)))))) - -(defalias 'ispell-int-char - ;; Allow incrementing characters as integers in XEmacs 20 - (if (and (featurep 'xemacs) - (fboundp 'int-char)) - 'int-char - ;; Emacs and XEmacs 19 or earlier - 'identity)) - ;;; ********************************************************************** @@ -2230,12 +2174,12 @@ Global `ispell-quit' set to start location to continue spell session." ;; not so good if there are over 20 or 30 options, but then, if ;; there are that many you don't want to scan them all anyway... (while (memq count command-characters) ; skip command characters. - (setq count (ispell-int-char (1+ count)) + (setq count (1+ count) skipped (1+ skipped))) (insert "(" count ") " (car choices) " ") (setq choices (cdr choices) - count (ispell-int-char (1+ count)))) - (setq count (ispell-int-char (- count ?0 skipped)))) + count (1+ count))) + (setq count (- count ?0 skipped))) (run-hooks 'ispell-update-post-hook) @@ -2382,13 +2326,12 @@ Global `ispell-quit' set to start location to continue spell session." (window-width)) (insert "\n")) (while (memq count command-characters) - (setq count (ispell-int-char (1+ count)) + (setq count (1+ count) skipped (1+ skipped))) (insert "(" count ") " (car choices) " ") (setq choices (cdr choices) - count (ispell-int-char (1+ count)))) - (setq count (ispell-int-char - (- count ?0 skipped)))) + count (1+ count))) + (setq count (- count ?0 skipped))) (setq textwin (selected-window)) (ispell-show-choices) (select-window textwin)))) commit 028249ebcd0287026c61b41b82eb489eec7e0097 Author: Reuben Thomas Date: Sun Dec 4 13:55:31 2016 +0000 Generalise over-specific documentation * lisp/textmodes/ispell.el (ispell-personal-dictionary): Rather than document precise personal wordlist filenames for only two supported spelling checkers, simply say that the default personal dictionary depends on the chosen spelling checker. The user can check the spelling checker’s documentation if necessary. This is simpler, and works for other supported (and future, or unknown) spelling checkers. diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el index 462cb32..5ad7d05 100644 --- a/lisp/textmodes/ispell.el +++ b/lisp/textmodes/ispell.el @@ -349,9 +349,7 @@ window system by evaluating the following on startup to set this variable: ;;;###autoload (defcustom ispell-personal-dictionary nil "File name of your personal spelling dictionary, or nil. -If nil, the default personal dictionary, (\"~/.ispell_DICTNAME\" for ispell or -\"~/.aspell.LANG.pws\" for Aspell) is used, where DICTNAME is the name of your -default dictionary and LANG the two letter language code." +If nil, the default personal dictionary for your spelling checker is used." :type '(choice file (const :tag "default" nil)) :group 'ispell) commit 51d011d6bbc0bc03bb41893037d41b19f9ff014d Author: Reuben Thomas Date: Sun Dec 4 13:52:04 2016 +0000 Remove tests for built-in functions * lisp/textmodes/ispell.el (buffer-substring-no-properties): Remove back-up definition. (ispell-add-per-file-word-list): Remove tests for comment-padright and comment-normalize-vars. diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el index 554905c..462cb32 100644 --- a/lisp/textmodes/ispell.el +++ b/lisp/textmodes/ispell.el @@ -132,10 +132,6 @@ "User variables for Emacs ispell interface." :group 'applications) -(if (not (fboundp 'buffer-substring-no-properties)) - (defun buffer-substring-no-properties (start end) - (buffer-substring start end))) - (defalias 'check-ispell-version 'ispell-check-version) ;;; ********************************************************************** @@ -2300,15 +2296,15 @@ Global `ispell-quit' set to start location to continue spell session." ((= char ?i) ; accept and insert word into pers dict (ispell-send-string (concat "*" word "\n")) (setq ispell-pdict-modified-p '(t)) ; dictionary modified! - (and (fboundp 'flyspell-unhighlight-at) - (flyspell-unhighlight-at start)) + (when (fboundp 'flyspell-unhighlight-at) + (flyspell-unhighlight-at start)) nil) ((or (= char ?a) (= char ?A)) ; accept word without insert (ispell-send-string (concat "@" word "\n")) (cl-pushnew word ispell-buffer-session-localwords :test #'equal) - (and (fboundp 'flyspell-unhighlight-at) - (flyspell-unhighlight-at start)) + (when (fboundp 'flyspell-unhighlight-at) + (flyspell-unhighlight-at start)) (or ispell-buffer-local-name ; session localwords might conflict (setq ispell-buffer-local-name (buffer-name))) (if (null ispell-pdict-modified-p) @@ -4259,8 +4255,8 @@ Both should not be used to define a buffer-local dictionary." ;; Returns optionally adjusted region-end-point. -;; If comment-padright is defined, newcomment must be loaded. -(declare-function comment-add "newcomment" (arg)) +;; If comment-normalize-vars is defined, newcomment must be loaded. +(declare-function comment-normalize-vars "newcomment" (&optional noerror)) (defun ispell-add-per-file-word-list (word) "Add WORD to the per-file word list." @@ -4286,16 +4282,12 @@ Both should not be used to define a buffer-local dictionary." (unless found (newline)) (insert (if comment-start (concat - (if (fboundp 'comment-padright) - ;; Try and use the proper comment marker, - ;; e.g. ";;" rather than ";". - (progn - ;; XEmacs: comment-normalize-vars - ;; (newcomment.el) only in >= 21.5 - (and (fboundp 'comment-normalize-vars) - (comment-normalize-vars)) - (comment-padright comment-start - (comment-add nil))) + (progn + ;; Try and use the proper comment marker, + ;; e.g. ";;" rather than ";". + (comment-normalize-vars) + (comment-padright comment-start + (comment-add nil)) comment-start) " ") "") commit a3ca97e7272b55995c6ce972042496ed79b0cf92 Author: Reuben Thomas Date: Sun Dec 4 01:06:26 2016 +0000 Remove unused ispell-looking-back * lisp/textmodes/ispell.el (ispell-looking-back): Remove unused alias. diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el index 14a782d..554905c 100644 --- a/lisp/textmodes/ispell.el +++ b/lisp/textmodes/ispell.el @@ -118,21 +118,6 @@ ;; Recursive edits (?C-r or ?R) inside a keyboard text replacement check (?r) ;; can cause misalignment errors. -;; XEmacs does not have looking-back -(defalias 'ispell-looking-back - (if (fboundp 'looking-back) 'looking-back - (lambda (regexp &optional limit &rest ignored) - "Return non-nil if text before point matches regular expression REGEXP. -Like `looking-at' except matches before point, and is slower. -LIMIT if non-nil speeds up the search by specifying a minimum -starting position, to avoid checking matches that would start -before LIMIT. - -This is a stripped down compatibility function for use when -full featured `looking-back' function is missing." - (save-excursion - (re-search-backward (concat "\\(?:" regexp "\\)\\=") limit t))))) - ;;; XEmacs21 does not have `with-no-warnings'. Taken from org mode. (defmacro ispell-with-no-warnings (&rest body) (cons (if (fboundp 'with-no-warnings) 'with-no-warnings 'progn) body)) commit 8edf0eb4d37194c327742cc75b2dbc1088c962c1 Author: Reuben Thomas Date: Sun Dec 4 00:54:04 2016 +0000 Assume we have version<= for checking ispell version * lisp/textmodes/ispell.el (ispell-check-minver): Remove. (ispell-check-version): Use version<= directly. diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el index 25099e3..14a782d 100644 --- a/lisp/textmodes/ispell.el +++ b/lisp/textmodes/ispell.el @@ -118,42 +118,6 @@ ;; Recursive edits (?C-r or ?R) inside a keyboard text replacement check (?r) ;; can cause misalignment errors. -;;; Compatibility code for XEmacs and (not too) older emacsen: -(defalias 'ispell-check-minver - (if (fboundp 'version<=) 'version<= - (lambda (minver version) - "Check if string VERSION is at least string MINVER. -Both must be in [0-9]+.[0-9]+... format. This is a fallback -compatibility function in case `version<=' is not available." - (let ((pending t) - (return t) - start-ver start-mver) - ;; Loop until an absolute greater or smaller condition is reached - ;; or until no elements are left in any of version and minver. In - ;; this case version is exactly the minimal, so return OK. - (while pending - (let (ver mver) - (if (string-match "[0-9]+" version start-ver) - (setq start-ver (match-end 0) - ver (string-to-number (match-string 0 version)))) - (if (string-match "[0-9]+" minver start-mver) - (setq start-mver (match-end 0) - mver (string-to-number (match-string 0 minver)))) - - (if (or ver mver) - (progn - (or ver (setq ver 0)) - (or mver (setq mver 0)) - ;; If none of below conditions match, this element is the - ;; same. Go checking next element. - (if (> ver mver) - (setq pending nil) - (if (< ver mver) - (setq pending nil - return nil)))) - (setq pending nil)))) - return)))) - ;; XEmacs does not have looking-back (defalias 'ispell-looking-back (if (fboundp 'looking-back) 'looking-back @@ -829,8 +793,8 @@ Otherwise returns the library directory name, if that is defined." (ispell-minver "3.1.12") (hunspell8-minver "1.1.6")) - (if (ispell-check-minver ispell0-minver ispell-program-version) - (or (ispell-check-minver ispell-minver ispell-program-version) + (if (version<= ispell0-minver ispell-program-version) + (or (version<= ispell-minver ispell-program-version) (setq ispell-offset 0)) (error "%s release %s or greater is required" ispell-program-name @@ -838,14 +802,14 @@ Otherwise returns the library directory name, if that is defined." (cond (ispell-really-aspell - (if (ispell-check-minver aspell-minver ispell-really-aspell) - (if (ispell-check-minver aspell8-minver ispell-really-aspell) + (if (version<= aspell-minver ispell-really-aspell) + (if (version<= aspell8-minver ispell-really-aspell) (progn (setq ispell-aspell-supports-utf8 t) (setq ispell-encoding8-command "--encoding="))) (setq ispell-really-aspell nil))) (ispell-really-hunspell - (if (ispell-check-minver hunspell8-minver ispell-really-hunspell) + (if (version<= hunspell8-minver ispell-really-hunspell) (setq ispell-encoding8-command "-i") (setq ispell-really-hunspell nil)))))) result)) commit f25c8b34c7a500bd0e891a64a73bdf999217efb3 Author: Reuben Thomas Date: Sun Dec 4 00:49:35 2016 +0000 Remove ispell.el pre-GNU Emacs comments * lisp/textmodes/ispell.el (Commentary): Remove original maintainer details, as Emacs version, bug report address and so forth should be used instead for this version. Remove in-line change history; use git instead. diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el index 5d5d422..25099e3 100644 --- a/lisp/textmodes/ispell.el +++ b/lisp/textmodes/ispell.el @@ -3,12 +3,7 @@ ;; Copyright (C) 1994-1995, 1997-2016 Free Software Foundation, Inc. ;; Author: Ken Stevens -;; Maintainer: Ken Stevens -;; Stevens Mod Date: Mon Jan 7 12:32:44 PST 2003 -;; Stevens Revision: 3.6 ;; Status : Release with 3.1.12+ and 3.2.0+ ispell. -;; Bug Reports : ispell-el-bugs@itcorp.com -;; Web Site : http://kdstevens.com/~stevens/ispell-page.html ;; Keywords: unix wp ;; This file is part of GNU Emacs. @@ -123,78 +118,6 @@ ;; Recursive edits (?C-r or ?R) inside a keyboard text replacement check (?r) ;; can cause misalignment errors. -;; HISTORY - -;; Modifications made in latest versions: - -;; Revision 3.6 2003/01/07 12:32:44 kss -;; Removed extra -d LIB in dictionary defs. (Pavel Janik) -;; Filtered process calls with duplicate dictionary entries. -;; Fixed bug where message-text-end is inside a mime skipped region. -;; Minor fixes to get ispell menus right in XEmacs -;; Fixed skip regexp so it doesn't match stuff like `/.\w'. -;; Detecting dictionary change not working. Fixed. kss -;; function `ispell-change-dictionary' now only completes valid dicts. - -;; Revision 3.5 2001/7/11 18:43:57 kss -;; Added fix for aspell to work in XEmacs (ispell-check-version). -;; Added Portuguese dictionary definition. -;; New feature: MIME mail message support, Fcc support. -;; Bug fix: retain comment syntax on lines with region skipping. (TeX $ bug...) -;; Improved allocation for graphic mode lines. (Miles Bader) -;; Support -v flag for old versions of aspell. (Eli Zaretskii) -;; Clear minibuffer on ^G from ispell-help (Tak Ota) - -;; Revision 3.4 2000/8/4 09:41:50 kss -;; Support new color display functions. -;; Fixed misalignment offset bug when replacing a string after a shift made. -;; Set to standard Author/Maintainer heading, -;; ensure localwords lists are separated from the text by newline. (Dave Love) -;; Added dictionary definition for Italian (William Deakin) -;; HTML region skipping greatly improved. (Chuck D. Phillips) -;; improved menus. Fixed regexp matching http/email addresses. -;; one arg always for XEmacs sleep-for (gunnar Evermann) -;; support for synchronous processes (Eli Zaretskii) - -;; Revision 3.3 1999/11/29 11:38:34 kss -;; Only word replacements entered in from the keyboard are rechecked. -;; This fixes a bug in tex parsing and misalignment. -;; Exceptions exist for recursive edit and query-replace, with tex error -;; condition tested. Recursive editing improved. -;; XEmacs repair for when `enable-multibyte-characters' defined - Didier Verna. -;; ispell-help fixed for XEmacs. Choices minibuffer now displayed in XEmacs. -;; Only list valid dictionaries in Spell menu. Russian dictionary doesn't allow -;; run-together words, and uses koi8-r font. Don't skip text in html -;; fonts. - -;; Revision 3.2 1999/5/7 14:25:14 kss -;; Accept ispell versions 3.X.Y where X>=1 -;; fine tuned latex region skipping. Fixed bug in ispell-word that did not -;; point in right place on words < 2 chars. Simplified ispell-minor-mode. -;; Fixed bug in TeX parsing when math commands are in the comments. -;; Removed calls to `when' macro. - -;; Revision 3.1 1998/12/1 13:21:52 kss -;; Improved and fixed customize support. -;; Improved and fixed comments in variables and messages. -;; A coding system is now required for all languages. -;; casechars improved for castellano, castellano8, and norsk dictionaries. -;; Dictionary norsk7-tex removed. Dictionary polish added. -;; Dictionaries redefined at load-time to support dictionary changes. -;; Menu redefined at load time to support dictionary changes. -;; ispell-check-version added as an alias for `check-ispell-version'. -;; Spelling suggestions returned in order generated by ispell. -;; Small bug fixed in matching ispell error messages. -;; Robustness added to ensure `case-fold-search' doesn't get redefined. -;; Fixed bug that didn't respect case of word in `ispell-complete-word'. -;; Multibyte character coding support added for process interactions. -;; Ensure ispell process has terminated before starting new process. -;; This can otherwise confuse process filters and hang ispell. -;; Improved skipping support for SGML. -;; Fixed bug using ^M rather than \r in `ispell-minor-check'. -;; Improved message reference matching in `ispell-message'. -;; Fixed bug in returning to nroff mode from tex mode. - ;;; Compatibility code for XEmacs and (not too) older emacsen: (defalias 'ispell-check-minver (if (fboundp 'version<=) 'version<= commit aacb20c0b73dc34e53c268e39131332d779cfe35 Author: Mark Oteiza Date: Tue Dec 13 11:47:21 2016 -0500 More small fixes for image-dired * lisp/image-dired.el: Fix commentary to refer to correct Emacs manual node. (image-dired--with-db-file): Add declare forms. (image-dired-hidden-p): Rewrite with cl-loop. It's not necessary to run through the whole list. diff --git a/lisp/image-dired.el b/lisp/image-dired.el index 30705f8..c5fcadc 100644 --- a/lisp/image-dired.el +++ b/lisp/image-dired.el @@ -79,7 +79,7 @@ ;; ;; This information has been moved to the manual. Type `C-h r' to open ;; the Emacs manual and go to the node Thumbnails by typing `g -;; Thumbnails RET'. +;; Image-Dired RET'. ;; ;; Quickstart: M-x image-dired RET DIRNAME RET ;; @@ -516,6 +516,7 @@ before warning the user." (defmacro image-dired--with-db-file (&rest body) "Run BODY in a temp buffer containing `image-dired-db-file'. Return the last form in BODY." + (declare (indent 0) (debug t)) `(with-temp-buffer (if (file-exists-p image-dired-db-file) (insert-file-contents image-dired-db-file)) @@ -2238,13 +2239,8 @@ image-dired-file-comment-list: (defun image-dired-hidden-p (file) "Return t if image FILE has a \"hidden\" tag." - (let (hidden) - (mapc - (lambda (tag) - (if (member tag image-dired-gallery-hidden-tags) - (setq hidden t))) - (cdr (assoc file image-dired-file-tag-list))) - hidden)) + (cl-loop for tag in (cdr (assoc file image-dired-file-tag-list)) + if (member tag image-dired-gallery-hidden-tags) return t)) (defun image-dired-gallery-generate () "Generate gallery pages. commit 86762eb174653ead8fa8c5d1cd5b263e9e0a2ac6 Author: Mark Oteiza Date: Tue Dec 13 11:41:45 2016 -0500 Remove image-dired-kill-buffer-and-window This breaks window layout, especially when quitting a image-dired-display-image-mode buffer. * lisp/image-dired.el (image-dired-thumbnail-mode-map): (image-dired-display-image-mode-map): Replace in keymap and menu items bindings to image-dired-kill-buffer-and-window with quit-window. (image-dired-kill-buffer-and-window): Remove. diff --git a/lisp/image-dired.el b/lisp/image-dired.el index 80b5733..30705f8 100644 --- a/lisp/image-dired.el +++ b/lisp/image-dired.el @@ -1331,7 +1331,7 @@ You probably want to use this together with (define-key map " " 'image-dired-display-next-thumbnail-original) (define-key map (kbd "DEL") 'image-dired-display-previous-thumbnail-original) (define-key map "c" 'image-dired-comment-thumbnail) - (define-key map "q" 'image-dired-kill-buffer-and-window) + (define-key map "q" 'quit-window) ;; Mouse (define-key map [mouse-2] 'image-dired-mouse-display-image) @@ -1348,7 +1348,7 @@ You probably want to use this together with (easy-menu-define nil map "Menu for `image-dired-thumbnail-mode'." '("Image-Dired" - ["Quit" image-dired-kill-buffer-and-window] + ["Quit" quit-window] ["Delete thumbnail from buffer" image-dired-delete-char] ["Remove tag from thumbnail" image-dired-tag-thumbnail-remove] ["Tag thumbnail" image-dired-tag-thumbnail] @@ -1378,14 +1378,14 @@ You probably want to use this together with (defvar image-dired-display-image-mode-map (let ((map (make-sparse-keymap))) - (define-key map "q" 'image-dired-kill-buffer-and-window) + (define-key map "q" 'quit-window) (define-key map "f" 'image-dired-display-current-image-full) (define-key map "s" 'image-dired-display-current-image-sized) (easy-menu-define nil map "Menu for `image-dired-display-image-mode-map'." '("Image-Dired" - ["Quit" image-dired-kill-buffer-and-window] + ["Quit" quit-window] ["Display original, sized to fit" image-dired-display-current-image-sized] ["Display original, full size" image-dired-display-current-image-full])) map) @@ -2336,15 +2336,6 @@ when using per-directory thumbnail file storage")) (insert " \n") (insert "")))) -(defun image-dired-kill-buffer-and-window () - "Kill the current buffer and, if possible, also the window." - (interactive) - (let ((buffer (current-buffer))) - (condition-case nil - (delete-window (selected-window)) - (error nil)) - (kill-buffer buffer))) - (defvar image-dired-widget-list nil "List to keep track of meta data in edit buffer.") commit bed0373855ea67ca0c393175e6b870b8a7c5ab9c Author: Mark Oteiza Date: Tue Dec 13 11:32:04 2016 -0500 Replace image-dired-setup-dired-keybindings with a minor mode * lisp/image-dired.el (image-dired-thumbnail-mode): Fix docstring to remove mention of nonexistent image-dired-dired and to refer to the new minor mode. (image-dired-minor-mode-map): New keymap assimilated from image-dired-setup-dired-keybindings. In the future, the keymap parent should be removed, and perhaps also the duplicate bindings that already exist in dired-mode-map. (image-dired-setup-dired-keybindings): Remove. Replace with an obsolete function alias. (image-dired-minor-mode): New minor mode, assuming the role of image-dired-setup-dired-keybindings. diff --git a/lisp/image-dired.el b/lisp/image-dired.el index 7978f07..80b5733 100644 --- a/lisp/image-dired.el +++ b/lisp/image-dired.el @@ -1414,8 +1414,7 @@ You probably want to use this together with (define-derived-mode image-dired-thumbnail-mode fundamental-mode "image-dired-thumbnail" "Browse and manipulate thumbnail images using dired. -Use `image-dired-dired' and `image-dired-setup-dired-keybindings' to get a -nice setup to start with." +Use `image-dired-minor-mode' to get a nice setup." (message "image-dired-thumbnail-mode enabled")) (define-derived-mode image-dired-display-image-mode @@ -1424,98 +1423,65 @@ nice setup to start with." Resized or in full-size." (message "image-dired-display-image-mode enabled")) +(defvar image-dired-minor-mode-map + (let ((map (make-sparse-keymap))) + ;; (set-keymap-parent map dired-mode-map) + ;; Hijack previous and next line movement. Let C-p and C-b be + ;; though... + (define-key map "p" 'image-dired-dired-previous-line) + (define-key map "n" 'image-dired-dired-next-line) + (define-key map [up] 'image-dired-dired-previous-line) + (define-key map [down] 'image-dired-dired-next-line) + + (define-key map (kbd "C-S-n") 'image-dired-next-line-and-display) + (define-key map (kbd "C-S-p") 'image-dired-previous-line-and-display) + (define-key map (kbd "C-S-m") 'image-dired-mark-and-display-next) + + (define-key map "\C-td" 'image-dired-display-thumbs) + (define-key map [tab] 'image-dired-jump-thumbnail-buffer) + (define-key map "\C-ti" 'image-dired-dired-display-image) + (define-key map "\C-tx" 'image-dired-dired-display-external) + (define-key map "\C-ta" 'image-dired-display-thumbs-append) + (define-key map "\C-t." 'image-dired-display-thumb) + (define-key map "\C-tc" 'image-dired-dired-comment-files) + (define-key map "\C-tf" 'image-dired-mark-tagged-files) + + ;; Menu for dired + (easy-menu-define nil map + "Menu for `image-dired-minor-mode'." + '("Image-dired" + ["Copy with EXIF file name" image-dired-copy-with-exif-file-name] + ["Comment files" image-dired-dired-comment-files] + ["Mark tagged files" image-dired-mark-tagged-files] + ["Jump to thumbnail buffer" image-dired-jump-thumbnail-buffer] + + ["Toggle movement tracking" image-dired-toggle-movement-tracking] + ["Toggle append browsing" image-dired-toggle-append-browsing] + ["Toggle display properties" image-dired-toggle-dired-display-properties] + + ["Display in external viewer" image-dired-dired-display-external] + ["Display image" image-dired-dired-display-image] + ["Display this thumbnail" image-dired-display-thumb] + ["Display thumbnails append" image-dired-display-thumbs-append] + + ["Create thumbnails for marked files" image-dired-create-thumbs] + + ["Mark and display next" image-dired-mark-and-display-next] + ["Display thumb for previous file" image-dired-previous-line-and-display] + ["Display thumb for next file" image-dired-next-line-and-display])) + map) + "Keymap for `image-dired-minor-mode'.") + ;;;###autoload -(defun image-dired-setup-dired-keybindings () +(define-minor-mode image-dired-minor-mode "Setup easy-to-use keybindings for the commands to be used in dired mode. Note that n, p and and will be hijacked and bound to `image-dired-dired-x-line'." - (interactive) + :keymap image-dired-minor-mode-map) - ;; Hijack previous and next line movement. Let C-p and C-b be - ;; though... - - (define-key dired-mode-map "p" 'image-dired-dired-previous-line) - (define-key dired-mode-map "n" 'image-dired-dired-next-line) - (define-key dired-mode-map [up] 'image-dired-dired-previous-line) - (define-key dired-mode-map [down] 'image-dired-dired-next-line) - - (define-key dired-mode-map (kbd "C-S-n") 'image-dired-next-line-and-display) - (define-key dired-mode-map (kbd "C-S-p") 'image-dired-previous-line-and-display) - (define-key dired-mode-map (kbd "C-S-m") 'image-dired-mark-and-display-next) - - (define-key dired-mode-map "\C-td" 'image-dired-display-thumbs) - (define-key dired-mode-map "\C-tt" 'image-dired-tag-files) - (define-key dired-mode-map "\C-tr" 'image-dired-delete-tag) - (define-key dired-mode-map [tab] 'image-dired-jump-thumbnail-buffer) - (define-key dired-mode-map "\C-ti" 'image-dired-dired-display-image) - (define-key dired-mode-map "\C-tx" 'image-dired-dired-display-external) - (define-key dired-mode-map "\C-ta" 'image-dired-display-thumbs-append) - (define-key dired-mode-map "\C-t." 'image-dired-display-thumb) - (define-key dired-mode-map "\C-tc" 'image-dired-dired-comment-files) - (define-key dired-mode-map "\C-tf" 'image-dired-mark-tagged-files) - - ;; Menu for dired - (define-key dired-mode-map [menu-bar image-dired] - (cons "Image-Dired" (make-sparse-keymap "Image-Dired"))) - - (define-key dired-mode-map [menu-bar image-dired image-dired-copy-with-exif-file-name] - '("Copy with EXIF file name" . image-dired-copy-with-exif-file-name)) - - (define-key dired-mode-map [menu-bar image-dired image-dired-dired-comment-files] - '("Comment files" . image-dired-dired-comment-files)) - - (define-key dired-mode-map [menu-bar image-dired image-dired-mark-tagged-files] - '("Mark tagged files" . image-dired-mark-tagged-files)) - - (define-key dired-mode-map [menu-bar image-dired image-dired-delete-tag] - '("Remove tag from files" . image-dired-delete-tag)) - - (define-key dired-mode-map [menu-bar image-dired image-dired-tag-files] - '("Tag files" . image-dired-tag-files)) - - (define-key dired-mode-map [menu-bar image-dired image-dired-jump-thumbnail-buffer] - '("Jump to thumbnail buffer" . image-dired-jump-thumbnail-buffer)) - - (define-key dired-mode-map [menu-bar image-dired image-dired-toggle-movement-tracking] - '("Toggle movement tracking" . image-dired-toggle-movement-tracking)) - - (define-key dired-mode-map - [menu-bar image-dired image-dired-toggle-append-browsing] - '("Toggle append browsing" . image-dired-toggle-append-browsing)) - - (define-key dired-mode-map - [menu-bar image-dired image-dired-toggle-disp-props] - '("Toggle display properties" . image-dired-toggle-dired-display-properties)) - - (define-key dired-mode-map - [menu-bar image-dired image-dired-dired-display-external] - '("Display in external viewer" . image-dired-dired-display-external)) - (define-key dired-mode-map - [menu-bar image-dired image-dired-dired-display-image] - '("Display image" . image-dired-dired-display-image)) - (define-key dired-mode-map - [menu-bar image-dired image-dired-display-thumb] - '("Display this thumbnail" . image-dired-display-thumb)) - (define-key dired-mode-map - [menu-bar image-dired image-dired-display-thumbs-append] - '("Display thumbnails append" . image-dired-display-thumbs-append)) - (define-key dired-mode-map - [menu-bar image-dired image-dired-display-thumbs] - '("Display thumbnails" . image-dired-display-thumbs)) - - (define-key dired-mode-map - [menu-bar image-dired image-dired-create-thumbs] - '("Create thumbnails for marked files" . image-dired-create-thumbs)) - - (define-key dired-mode-map - [menu-bar image-dired image-dired-mark-and-display-next] - '("Mark and display next" . image-dired-mark-and-display-next)) - (define-key dired-mode-map - [menu-bar image-dired image-dired-previous-line-and-display] - '("Display thumb for previous file" . image-dired-previous-line-and-display)) - (define-key dired-mode-map - [menu-bar image-dired image-dired-next-line-and-display] - '("Display thumb for next file" . image-dired-next-line-and-display))) +;;;###autoload +(define-obsolete-function-alias 'image-dired-setup-dired-keybindings 'image-dired-minor-mode + "26.1") (declare-function clear-image-cache "image.c" (&optional filter))