diff options
Diffstat (limited to 'lisp')
32 files changed, 409 insertions, 154 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 7732edb6b24..fa03faa1833 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,160 @@ +2006-05-23 Thien-Thi Nguyen <ttn@gnu.org> + + * emacs-lisp/ewoc.el (ewoc-delete): New function. + (ewoc-filter): Use `ewoc-delete'. + + * emacs-lisp/bindat.el (bindat-pack): Doc fix. + +2006-05-22 Stefan Monnier <monnier@iro.umontreal.ca> + + * textmodes/bibtex.el (bibtex-format-entry, bibtex-clean-entry): + Signal more user-friendly error messages. + + * complete.el (PC-do-completion): Undo the addition of implicit + wildcards if they did not lead to finding any match. + (read-file-name-internal): Don't add the final > if the completion is + not finished. + +2006-05-22 Reiner Steib <Reiner.Steib@gmx.de> + + * textmodes/bibtex.el (bibtex-maintain-sorted-entries): + Quote safe-local-variable predicate. + +2006-05-22 Thien-Thi Nguyen <ttn@gnu.org> + + * emacs-lisp/ewoc.el (ewoc-set-data): New function. + +2006-05-21 Roland Winkler <Roland.Winkler@physik.uni-erlangen.de> + + * textmodes/bibtex.el (bibtex-maintain-sorted-entries): Mark as safe. + + * progmodes/make-mode.el (makefile-special-targets-list) + (makefile-macro-table, makefile-target-table): Mark as risky. + (makefile-query-one-target-method): Make this the alias for the + following variable. + (makefile-query-one-target-method-function): Make this the real name. + + * textmodes/artist.el (artist-text-renderer): Make this the alias + for the following variable. + (artist-text-renderer-function): Make this the real name. + + * textmodes/flyspell.el (flyspell-generic-check-word-p): Make this + the alias for the following variable. + (flyspell-generic-check-word-predicate): Make this the real name. + + * textmodes/ispell.el (ispell-format-word): Make this the alias + for the following variable. + (ispell-format-word-function): Make this the real name. + (ispell-message-text-end): Mark as risky. + + * skeleton.el (skeleton-transformation, skeleton-filter) + (skeleton-pair-filter): Make these the aliases for the following + variables. + (skeleton-transformation-function, skeleton-filter-function) + (skeleton-pair-filter-function): Make these the real names. + + * progmodes/sh-script.el (sh-mode): Use skeleton-filter-function + and skeleton-pair-filter-function. + + * textmodes/sgml-mode.el (sgml-transformation): Make this the + alias for the following variable. + (sgml-transformation-function): Make this the real name. + (sgml-tag-alist): Mark as risky. + +2006-05-21 Richard Stallman <rms@gnu.org> + + * simple.el (kill-region): Interactively, pass point, then mark. + +2006-05-22 Thien-Thi Nguyen <ttn@gnu.org> + + * emacs-lisp/ewoc.el (ewoc-create): Add autoload cookie. + +2006-05-21 Romain Francoise <romain@orebokech.com> + + * dired-x.el (dired-mode-map): Don't bind M-g. + +2006-05-20 Richard Stallman <rms@gnu.org> + + * dired.el (dired-mode-map): Put dired-goto-file on j, not M-g. + (dired-goto-file): Doc fix. + +2006-05-21 Kim F. Storm <storm@cua.dk> + + * emulation/cua-base.el: Mention customizing cua-mode as alternative + way to enable built-in cua-mode if user loads older CUA-mode package. + + * ido.el (ido-read-file-name): Bind ido-show-dot-for-dired to nil + if default-filename is specified. + +2006-05-20 Eli Zaretskii <eliz@gnu.org> + + * menu-bar.el (menu-bar-manuals-menu) <info-apropos>: New menu item. + + * info.el (info-apropos): Make sure current-file and current-node + have non-nil values. Speed up by using add-to-list instead of + manual consing. + +2006-05-20 Micha,Ak(Bl Cadilhac <michael.cadilhac@lrde.org> (tiny change) + + * progmodes/make-mode.el (makefile-mode): Doc fix. + +2006-05-20 Eli Zaretskii <eliz@gnu.org> + + * dired-aux.el (dired-do-shell-command): Doc fix. + +2006-05-20 Kevin Ryde <user42@zip.com.au> + + * info-xref.el (info-xref-check-all-custom): Skip :tag part of + ``(custom-manual :tag "Foo" "(foo)Node")''. + +2006-05-20 Karl Chen <quarl@cs.berkeley.edu> + + * progmodes/cc-vars.el (c-backslash-column): Mark as safe if its + value is an integer. + +2006-05-20 Eli Zaretskii <eliz@gnu.org> + + * mail/rmail.el (rmail-mime-charset-pattern): Add "?:" before + "format". + (rmail-convert-to-babyl-format): Undo the change from 2006-04-19. + +2006-05-20 Martin Rudalics <rudalics@gmx.at> + + * progmodes/hideif.el (show-ifdef-block): Fix bug where parts of + a hidden block remained hidden if `hide-ifdef-lines' is non-nil. + +2006-05-20 Stefan Monnier <monnier@iro.umontreal.ca> + + * progmodes/gud.el (gdb-script-font-lock-keywords): Use a stricter + regexp for keywords. + +2006-05-20 Masayuki FUJII <boochang@m4.kcn.ne.jp> (tiny change) + + * dnd.el (dnd-get-local-file-name): Specify LITERAL in + replace-regexp-in-string. + + * term/w32-win.el (w32-drag-n-drop): Substitute '/' for '\', + encode, and escape file name on conversion to URL. + +2006-05-20 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> + + * dnd.el (dnd-handle-one-url): Change 3rd arg ARG to URL. + Don't unescape URL. + (dnd-get-local-file-name): Unescape URL on conversion to file name. + + * x-dnd.el (x-dnd-handle-file-name): Encode and escape file names + on conversion to URLs. + + * net/browse-url.el (browse-url-file-url): Encode file name on + conversion to URL. + + * term/mac-win.el (mac-ae-open-documents): Escape file name on + conversion to URL. + +2006-05-19 Eli Zaretskii <eliz@gnu.org> + + * progmodes/cc-styles.el (c-style-alist): Doc fix. + 2006-05-19 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> * term/mac-win.el (mac-bytes-to-digits): Remove function. @@ -41,14 +198,14 @@ * emacs-lisp/ewoc.el (ewoc--adjust): New func. (ewoc--insert-new-node): Don't insert trailing newline. - Instead, adjust succesor nodes' start markers. + Instead, adjust successor nodes's start markers. (ewoc--refresh-node): Delete all text from current node's start - marker to the next one's; adjust successor nodes' start markers. + marker to the next one's; adjust successor nodes's start markers. (ewoc--create): Doc fixes. (ewoc--refresh): Don't insert newline. (ewoc--set-hf): Use `ewoc--set-buffer-bind-dll-let*'. - * pcvs.el (cvs-make-cvs-buffer): Specify - extra newline for ewoc's header and footer. + * pcvs.el (cvs-make-cvs-buffer): + Specify extra newline for ewoc's header and footer. (cvs-update-header): Update initial header recognition. Append newline to final header and footer values. * pcvs-info.el (cvs-fileinfo-pp): Insert trailing newline. @@ -502,7 +659,7 @@ reference to the Lisp manual to the warning about pure space overflow. -2006-05-05 Micha,Ak(Bl Cadilhac <michael.cadilhac@lrde.org> +2006-05-05 Micha,Ak(Bl Cadilhac <michael.cadilhac@lrde.org> (tiny change) * textmodes/ispell.el (ispell-buffer-local-dict): Add a `no-reload' argument to avoid the call to `ispell-internal-change-dictionary' diff --git a/lisp/complete.el b/lisp/complete.el index 6620db860c3..d0e3fbe8ddf 100644 --- a/lisp/complete.el +++ b/lisp/complete.el @@ -369,7 +369,7 @@ of `minibuffer-completion-table' and the minibuffer contents.") (str (buffer-substring beg end)) (incname (and filename (string-match "<\\([^\"<>]*\\)>?$" str))) (ambig nil) - basestr + basestr origstr env-on regex p offset @@ -415,7 +415,7 @@ of `minibuffer-completion-table' and the minibuffer contents.") (file-name-nondirectory dir)) "*/" file)) (setq dir (file-name-directory dir))) - (setq str (concat dir file)))) + (setq origstr str str (concat dir file)))) ;; Look for wildcard expansions in directory name (and filename @@ -443,7 +443,14 @@ of `minibuffer-completion-table' and the minibuffer contents.") (setq str (concat dir (file-name-nondirectory str))) (insert str) (setq end (+ beg (length str))))) - (setq filename nil table nil pred nil)))) + (if origstr + ;; If the wildcards were introduced by us, it's possible + ;; that read-file-name-internal (especially our + ;; PC-include-file advice) can still find matches for the + ;; original string even if we couldn't, so remove the + ;; added wildcards. + (setq str origstr) + (setq filename nil table nil pred nil))))) ;; Strip directory name if appropriate (if filename @@ -943,10 +950,11 @@ absolute rather than relative to some directory on the SEARCH-PATH." (if (string-match "<\\([^\"<>]*\\)>?\\'" (ad-get-arg 0)) (let* ((string (ad-get-arg 0)) (action (ad-get-arg 2)) - (name (substring string (match-beginning 1) (match-end 1))) + (name (match-string 1 string)) (str2 (substring string (match-beginning 0))) (completion-table - (mapcar (lambda (x) (format "<%s>" x)) + (mapcar (lambda (x) + (format (if (string-match "/\\'" x) "<%s" "<%s>") x)) (PC-include-file-all-completions name (PC-include-file-path))))) (setq ad-return-value diff --git a/lisp/dired-aux.el b/lisp/dired-aux.el index e07689973e4..b4cb8933194 100644 --- a/lisp/dired-aux.el +++ b/lisp/dired-aux.el @@ -493,7 +493,8 @@ the Dired buffer, so output files usually are created there instead of in a subdir. In a noninteractive call (from Lisp code), you must specify -the list of file names explicitly with the FILE-LIST argument." +the list of file names explicitly with the FILE-LIST argument, which +can be produced by `dired-get-marked-files', for example." ;;Functions dired-run-shell-command and dired-shell-stuff-it do the ;;actual work and can be redefined for customization. (interactive diff --git a/lisp/dired-x.el b/lisp/dired-x.el index 0a467920f11..4d3734bbd5a 100644 --- a/lisp/dired-x.el +++ b/lisp/dired-x.el @@ -251,7 +251,6 @@ to nil: a pipe using `zcat' or `gunzip -c' will be used." (define-key dired-mode-map "*." 'dired-mark-extension) (define-key dired-mode-map "\M-!" 'dired-smart-shell-command) (define-key dired-mode-map "w" 'dired-copy-filename-as-kill) -(define-key dired-mode-map "\M-g" 'dired-goto-file) (define-key dired-mode-map "\M-G" 'dired-goto-subdir) (define-key dired-mode-map "F" 'dired-do-find-marked-files) (define-key dired-mode-map "Y" 'dired-do-relsymlink) diff --git a/lisp/dired.el b/lisp/dired.el index 7209248a75a..ca50e3b5767 100644 --- a/lisp/dired.el +++ b/lisp/dired.el @@ -1212,9 +1212,9 @@ Do so according to the former subdir alist OLD-SUBDIR-ALIST." (define-key map "f" 'dired-find-file) (define-key map "\C-m" 'dired-advertised-find-file) (define-key map "g" 'revert-buffer) - (define-key map "\M-g" 'dired-goto-file) (define-key map "h" 'describe-mode) (define-key map "i" 'dired-maybe-insert-subdir) + (define-key map "j" 'dired-goto-file) (define-key map "k" 'dired-do-kill-lines) (define-key map "l" 'dired-do-redisplay) (define-key map "m" 'dired-mark) @@ -2218,7 +2218,7 @@ instead of `dired-actual-switches'." (forward-line 1)))) (defun dired-goto-file (file) - "Go to file line of FILE in this dired buffer." + "Go to line describing file FILE in this dired buffer." ;; Return value of point on success, else nil. ;; FILE must be an absolute file name. ;; Loses if FILE contains control chars like "\007" for which ls diff --git a/lisp/dnd.el b/lisp/dnd.el index dec57481570..85881b3261f 100644 --- a/lisp/dnd.el +++ b/lisp/dnd.el @@ -69,39 +69,34 @@ if some action was made, or nil if the URL is ignored." ;; Functions -(defun dnd-handle-one-url (window action arg) +(defun dnd-handle-one-url (window action url) "Handle one dropped url by calling the appropriate handler. The handler is first located by looking at `dnd-protocol-alist'. If no match is found here, and the value of `browse-url-browser-function' is a pair of (REGEXP . FUNCTION), those regexps are tried for a match. If no match is found, just call `dnd-insert-text'. WINDOW is where the drop happend, ACTION is the action for the drop, -ARG is the URL that has been dropped. +URL is what has been dropped. Returns ACTION." (require 'browse-url) - (let* ((uri (replace-regexp-in-string - "%[A-Z0-9][A-Z0-9]" - (lambda (arg) - (format "%c" (string-to-number (substring arg 1) 16))) - arg)) - ret) + (let (ret) (or (catch 'done (dolist (bf dnd-protocol-alist) - (when (string-match (car bf) uri) - (setq ret (funcall (cdr bf) uri action)) + (when (string-match (car bf) url) + (setq ret (funcall (cdr bf) url action)) (throw 'done t))) nil) (when (not (functionp browse-url-browser-function)) (catch 'done (dolist (bf browse-url-browser-function) - (when (string-match (car bf) uri) + (when (string-match (car bf) url) (setq ret 'private) - (funcall (cdr bf) uri action) + (funcall (cdr bf) url action) (throw 'done t))) nil)) (progn - (dnd-insert-text window action uri) + (dnd-insert-text window action url) (setq ret 'private))) ret)) @@ -134,6 +129,11 @@ Return nil if URI is not a local file." ((string-match "^file:" uri) ; Old KDE, Motif, Sun (substring uri (match-end 0)))))) (when (and f must-exist) + (setq f (replace-regexp-in-string + "%[A-Z0-9][A-Z0-9]" + (lambda (arg) + (format "%c" (string-to-number (substring arg 1) 16))) + f nil t)) (let* ((decoded-f (decode-coding-string f (or file-name-coding-system diff --git a/lisp/emacs-lisp/bindat.el b/lisp/emacs-lisp/bindat.el index 455b049dc8a..823fcf869b6 100644 --- a/lisp/emacs-lisp/bindat.el +++ b/lisp/emacs-lisp/bindat.el @@ -171,8 +171,8 @@ ;; | INTEGER_CONSTANT ;; | DEREF -;; DEREF ::= ( [NAME | INTEGER]... ) -- Field NAME or Array index relative to -;; current structure spec. +;; DEREF ::= ( [NAME | INTEGER]... ) -- Field NAME or Array index relative +;; to current structure spec. ;; -- see bindat-get-field ;; A `union' specification @@ -415,7 +415,9 @@ e.g. corresponding to STRUCT.FIELD1[INDEX2].FIELD3..." ((eq type 'repeat) (let ((index 0)) (while (< index len) - (bindat--length-group (nth index (bindat-get-field struct field)) (nthcdr tail item)) + (bindat--length-group + (nth index (bindat-get-field struct field)) + (nthcdr tail item)) (setq index (1+ index))))) ((eq type 'union) (let ((tag len) (cases (nthcdr tail item)) case cc) @@ -436,7 +438,7 @@ e.g. corresponding to STRUCT.FIELD1[INDEX2].FIELD3..." (setq pos (+ pos len)))))))) (defun bindat-length (spec struct) - "Calculate raw-data length for STRUCT according to bindat specification SPEC." + "Calculate raw-data length for STRUCT according to bindat SPEC." (let ((pos 0)) (bindat--length-group struct spec) pos)) @@ -557,7 +559,9 @@ e.g. corresponding to STRUCT.FIELD1[INDEX2].FIELD3..." ((eq type 'repeat) (let ((index 0)) (while (< index len) - (bindat--pack-group (nth index (bindat-get-field struct field)) (nthcdr tail item)) + (bindat--pack-group + (nth index (bindat-get-field struct field)) + (nthcdr tail item)) (setq index (1+ index))))) ((eq type 'union) (let ((tag len) (cases (nthcdr tail item)) case cc) @@ -577,13 +581,14 @@ e.g. corresponding to STRUCT.FIELD1[INDEX2].FIELD3..." (defun bindat-pack (spec struct &optional raw-data pos) "Return binary data packed according to SPEC for structured data STRUCT. -Optional third arg RAW-DATA is a pre-allocated string or vector to unpack into. +Optional third arg RAW-DATA is a pre-allocated string or vector to pack into. Optional fourth arg POS is the starting offset into RAW-DATA. Note: The result is a multibyte string; use `string-make-unibyte' on it to make it unibyte if necessary." (let ((no-return raw-data)) (unless pos (setq pos 0)) - (unless raw-data (setq raw-data (make-vector (+ pos (bindat-length spec struct)) 0))) + (unless raw-data + (setq raw-data (make-vector (+ pos (bindat-length spec struct)) 0))) (bindat--pack-group struct spec) (if no-return nil (concat raw-data)))) diff --git a/lisp/emacs-lisp/ewoc.el b/lisp/emacs-lisp/ewoc.el index 7742de944cb..2cb90738072 100644 --- a/lisp/emacs-lisp/ewoc.el +++ b/lisp/emacs-lisp/ewoc.el @@ -96,6 +96,7 @@ ;; ;; (defun ewoc-create (pretty-printer &optional header footer) ;; (defalias 'ewoc-data 'ewoc--node-data) +;; (defun ewoc-set-data (node data) ;; (defun ewoc-location (node) ;; (defun ewoc-enter-first (ewoc data) ;; (defun ewoc-enter-last (ewoc data) @@ -106,6 +107,7 @@ ;; (defun ewoc-nth (ewoc n) ;; (defun ewoc-map (map-function ewoc &rest args) ;; (defun ewoc-filter (ewoc predicate &rest args) +;; (defun ewoc-delete (ewoc &rest nodes) ;; (defun ewoc-locate (ewoc &optional pos guess) ;; (defun ewoc-invalidate (ewoc &rest nodes) ;; (defun ewoc-goto-prev (ewoc arg) @@ -255,7 +257,7 @@ NODE and leaving the new node's start there. Return the new node." ;;; =========================================================================== ;;; Public members of the Ewoc package - +;;;###autoload (defun ewoc-create (pretty-printer &optional header footer) "Create an empty ewoc. @@ -296,6 +298,10 @@ respectively, of the ewoc." \(fn NODE)") +(defun ewoc-set-data (node data) + "Set NODE to encapsulate DATA." + (setf (ewoc--node-data node) data)) + (defun ewoc-enter-first (ewoc data) "Enter DATA first in EWOC. Return the new node." @@ -371,6 +377,27 @@ arguments will be passed to MAP-FUNCTION." (ewoc--refresh-node pp node)) (setq node (ewoc--node-next dll node)))))) +(defun ewoc-delete (ewoc &rest nodes) + "Delete NODES from EWOC." + (ewoc--set-buffer-bind-dll-let* ewoc + ((L nil) (R nil)) + (dolist (node nodes) + ;; If we are about to delete the node pointed at by last-node, + ;; set last-node to nil. + (if (eq (ewoc--last-node ewoc) node) + (setf (ewoc--last-node ewoc) nil)) + (delete-region (ewoc--node-start-marker node) + (ewoc--node-start-marker (ewoc--node-next dll node))) + (set-marker (ewoc--node-start-marker node) nil) + (setf L (ewoc--node-left node) + R (ewoc--node-right node) + ;; Link neighbors to each other. + (ewoc--node-right L) R + (ewoc--node-left R) L + ;; Forget neighbors. + (ewoc--node-left node) nil + (ewoc--node-right node) nil)))) + (defun ewoc-filter (ewoc predicate &rest args) "Remove all elements in EWOC for which PREDICATE returns nil. Note that the buffer for EWOC will be current-buffer when PREDICATE @@ -381,28 +408,13 @@ ARGS are given they will be passed to the PREDICATE." (ewoc--set-buffer-bind-dll-let* ewoc ((node (ewoc--node-nth dll 1)) (footer (ewoc--footer ewoc)) - (next nil) - (L nil) (R nil) + (goodbye nil) (inhibit-read-only t)) (while (not (eq node footer)) - (setq next (ewoc--node-next dll node)) (unless (apply predicate (ewoc--node-data node) args) - ;; If we are about to delete the node pointed at by last-node, - ;; set last-node to nil. - (if (eq (ewoc--last-node ewoc) node) - (setf (ewoc--last-node ewoc) nil)) - (delete-region (ewoc--node-start-marker node) - (ewoc--node-start-marker (ewoc--node-next dll node))) - (set-marker (ewoc--node-start-marker node) nil) - (setf L (ewoc--node-left node) - R (ewoc--node-right node) - ;; Link neighbors to each other. - (ewoc--node-right L) R - (ewoc--node-left R) L - ;; Forget neighbors. - (ewoc--node-left node) nil - (ewoc--node-right node) nil)) - (setq node next)))) + (push node goodbye)) + (setq node (ewoc--node-next dll node))) + (apply 'ewoc-delete ewoc goodbye))) (defun ewoc-locate (ewoc &optional pos guess) "Return the node that POS (a buffer position) is within. diff --git a/lisp/emulation/cua-base.el b/lisp/emulation/cua-base.el index 3ea0cd6b6d9..245c274abd3 100644 --- a/lisp/emulation/cua-base.el +++ b/lisp/emulation/cua-base.el @@ -1498,8 +1498,8 @@ shifted movement key, set `cua-highlight-region-shift-only'." ;;;###autoload (eval-after-load 'CUA-mode ;;;###autoload '(error (concat "\n\n" -;;;###autoload "CUA-mode is now part of the standard GNU Emacs distribution,\n" -;;;###autoload "so you may now enable and customize CUA via the Options menu.\n\n" +;;;###autoload "CUA-mode is now part of the standard GNU Emacs distribution, so you may\n" +;;;###autoload "now enable CUA via the Options menu or by customizing option `cua-mode'.\n\n" ;;;###autoload "You have loaded an older version of CUA-mode which does\n" ;;;###autoload "not work correctly with this version of GNU Emacs.\n\n" ;;;###autoload (if user-init-file (concat diff --git a/lisp/ido.el b/lisp/ido.el index d03c002d597..1c2617b814d 100644 --- a/lisp/ido.el +++ b/lisp/ido.el @@ -4475,6 +4475,8 @@ See `read-file-name' for additional parameters." (ido-directory-too-big (and (not ido-directory-nonreadable) (ido-directory-too-big-p ido-current-directory))) (ido-work-directory-index -1) + (ido-show-dot-for-dired (and ido-show-dot-for-dired + (not default-filename))) (ido-work-file-index -1) (ido-find-literal nil)) (setq ido-exit nil) diff --git a/lisp/info-xref.el b/lisp/info-xref.el index 75bc72f25b4..a6acfa8021c 100644 --- a/lisp/info-xref.el +++ b/lisp/info-xref.el @@ -301,7 +301,10 @@ quite a while." (lambda (symbol) (dolist (link (get symbol 'custom-links)) (when (memq (car link) '(custom-manual info-link)) - (if (info-xref-goto-node-p (cadr link)) + ;; skip :tag part of (custom-manual :tag "Foo" "(foo)Node") + (if (eq :tag (cadr link)) + (setq link (cddr link))) + (if (info-xref-goto-node-p (cadr link)) (setq good (1+ good)) (setq bad (1+ bad)) ;; symbol-file gives nil for preloaded variables, would need diff --git a/lisp/info.el b/lisp/info.el index 163441893db..2737999b090 100644 --- a/lisp/info.el +++ b/lisp/info.el @@ -2907,11 +2907,20 @@ Build a menu of the possible matches." manuals matches node nodes) (let ((Info-fontify-maximum-menu-size nil)) (Info-directory) + ;; current-node and current-file are nil when they invoke info-apropos + ;; as the first Info command, i.e. info-apropos loads info.el. In that + ;; case, we use (DIR)Top instead, to avoid signalling an error after + ;; the search is complete. + (when (null current-node) + (setq current-file Info-current-file) + (setq current-node Info-current-node)) (message "Searching indices...") (goto-char (point-min)) (re-search-forward "\\* Menu: *\n" nil t) (while (re-search-forward "\\*.*: *(\\([^)]+\\))" nil t) - (setq manuals (cons (match-string 1) manuals))) + ;; add-to-list makes sure we don't have duplicates in `manuals', + ;; so that the following dolist loop runs faster. + (add-to-list 'manuals (match-string 1))) (dolist (manual (nreverse manuals)) (message "Searching %s" manual) (condition-case err diff --git a/lisp/mail/rmail.el b/lisp/mail/rmail.el index faeec5abf02..195eb60830c 100644 --- a/lisp/mail/rmail.el +++ b/lisp/mail/rmail.el @@ -624,7 +624,7 @@ the variable `rmail-mime-feature'.") ;;;###autoload (defvar rmail-mime-charset-pattern (concat "^content-type:[ ]*text/plain;" - "\\(?:[ \t\n]*\\(format\\|delsp\\)=\"?[-a-z0-9]+\"?;\\)*" + "\\(?:[ \t\n]*\\(?:format\\|delsp\\)=\"?[-a-z0-9]+\"?;\\)*" "[ \t\n]*charset=\"?\\([^ \t\n\";]+\\)\"?") "Regexp to match MIME-charset specification in a header of message. The first parenthesized expression should match the MIME-charset name.") @@ -1994,7 +1994,7 @@ is non-nil if the user has supplied the password interactively. (re-search-backward rmail-mime-charset-pattern start t)))) - (intern (downcase (match-string 2)))))) + (intern (downcase (match-string 1)))))) (rmail-decode-region start (point) mime-charset))))) ;; Add an X-Coding-System: header if we don't have one. (save-excursion @@ -2155,7 +2155,7 @@ is non-nil if the user has supplied the password interactively. (re-search-backward rmail-mime-charset-pattern start t)))) - (intern (downcase (match-string 2)))))) + (intern (downcase (match-string 1)))))) (rmail-decode-region start (point) mime-charset))) (save-excursion (goto-char start) diff --git a/lisp/menu-bar.el b/lisp/menu-bar.el index a9987d589fd..9615e2e7ff1 100644 --- a/lisp/menu-bar.el +++ b/lisp/menu-bar.el @@ -1338,6 +1338,9 @@ key, a click, or a menu-item")) (define-key menu-bar-manuals-menu [order-emacs-manuals] '(menu-item "Ordering Manuals" view-order-manuals :help "How to order manuals from the Free Software Foundation")) +(define-key menu-bar-manuals-menu [info-apropos] + '(menu-item "Lookup Subject in all manuals..." info-apropos + :help "Find description of a subject in all installed manuals")) (define-key menu-bar-manuals-menu [info] '(menu-item "All Other Manuals (Info)" Info-directory :help "Read any of the installed manuals")) diff --git a/lisp/net/browse-url.el b/lisp/net/browse-url.el index 101b9cf210d..3f514a2aaab 100644 --- a/lisp/net/browse-url.el +++ b/lisp/net/browse-url.el @@ -680,6 +680,10 @@ interactively. Turn the filename into a URL with function (defun browse-url-file-url (file) "Return the URL corresponding to FILE. Use variable `browse-url-filename-alist' to map filenames to URLs." + (let ((coding (and default-enable-multibyte-characters + (or file-name-coding-system + default-file-name-coding-system)))) + (if coding (setq file (encode-coding-string file coding)))) ;; URL-encode special chars, do % first (let ((s 0)) (while (setq s (string-match "%" file s)) diff --git a/lisp/progmodes/cc-styles.el b/lisp/progmodes/cc-styles.el index 6f623623535..c2b9b435e4c 100644 --- a/lisp/progmodes/cc-styles.el +++ b/lisp/progmodes/cc-styles.el @@ -264,7 +264,7 @@ element of the list is added with `add-hook'. Do not change this variable directly. Use the function `c-add-style' to add new styles or modify existing styles (it is not a good idea to modify existing styles -- you should create a new style that inherits -the existing style.") +the existing style).") ;; Functions that manipulate styles diff --git a/lisp/progmodes/cc-vars.el b/lisp/progmodes/cc-vars.el index 64e38be62d0..0e6738710c5 100644 --- a/lisp/progmodes/cc-vars.el +++ b/lisp/progmodes/cc-vars.el @@ -812,6 +812,7 @@ macro exceeds this column then the next tab stop from that line is used as alignment column instead." :type 'integer :group 'c) +;;;###autoload(put 'c-backslash-column 'safe-local-variable 'integerp) (defcustom-c-stylevar c-backslash-max-column 72 "*Maximum alignment column for line continuation backslashes. diff --git a/lisp/progmodes/gud.el b/lisp/progmodes/gud.el index d2e6cfc4ae4..bda30b196e1 100644 --- a/lisp/progmodes/gud.el +++ b/lisp/progmodes/gud.el @@ -3166,7 +3166,7 @@ class of the file (using s to separate nested class ids)." (defvar gdb-script-font-lock-keywords '(("^define\\s-+\\(\\(\\w\\|\\s_\\)+\\)" (1 font-lock-function-name-face)) ("\\$\\(\\w+\\)" (1 font-lock-variable-name-face)) - ("^\\s-*\\(\\(\\w\\|\\s_\\)+\\)" (1 font-lock-keyword-face)))) + ("^\\s-*\\(\\w\\(\\w\\|\\s_\\)*\\)" (1 font-lock-keyword-face)))) ;; FIXME: The keyword "end" associated with "document" ;; should have font-lock-keyword-face (currently font-lock-doc-face). diff --git a/lisp/progmodes/hideif.el b/lisp/progmodes/hideif.el index 04e44e2dac1..a100424108d 100644 --- a/lisp/progmodes/hideif.el +++ b/lisp/progmodes/hideif.el @@ -928,15 +928,17 @@ Return as (TOP . BOTTOM) the extent of ifdef block." (setq hide-ifdef-hiding t)) (setq buffer-read-only (or hide-ifdef-read-only hif-outside-read-only))) - (defun show-ifdef-block () "Show the ifdef block (true or false part) enclosing or before the cursor." (interactive) - (if hide-ifdef-lines - (save-excursion - (beginning-of-line) - (hif-show-ifdef-region (1- (point)) (progn (end-of-line) (point)))) - (let ((top-bottom (hif-find-ifdef-block))) + (let ((top-bottom (hif-find-ifdef-block))) + (if hide-ifdef-lines + (hif-show-ifdef-region + (save-excursion + (goto-char (car top-bottom)) (line-beginning-position)) + (save-excursion + (goto-char (1+ (cdr top-bottom))) + (hif-end-of-line) (point))) (hif-show-ifdef-region (1- (car top-bottom)) (cdr top-bottom))))) diff --git a/lisp/progmodes/make-mode.el b/lisp/progmodes/make-mode.el index 3bbfeaac683..66507dd78df 100644 --- a/lisp/progmodes/make-mode.el +++ b/lisp/progmodes/make-mode.el @@ -246,6 +246,7 @@ You will be offered to complete on one of those in the minibuffer whenever you enter a \".\" at the beginning of a line in `makefile-mode'." :type '(repeat (list string)) :group 'makefile) +(put 'makefile-special-targets-list 'risky-local-variable t) (defcustom makefile-runtime-macros-list '(("@") ("&") (">") ("<") ("*") ("^") ("+") ("?") ("%") ("$")) @@ -544,7 +545,8 @@ This should identify a `make' command that can handle the `-q' option." :type 'string :group 'makefile) -(defcustom makefile-query-one-target-method 'makefile-query-by-make-minus-q +(defcustom makefile-query-one-target-method-function + 'makefile-query-by-make-minus-q "*Function to call to determine whether a make target is up to date. The function must satisfy this calling convention: @@ -560,6 +562,8 @@ The function must satisfy this calling convention: makefile, any nonzero integer value otherwise." :type 'function :group 'makefile) +(defvaralias 'makefile-query-one-target-method + 'makefile-query-one-target-method-function) (defcustom makefile-up-to-date-buffer-name "*Makefile Up-to-date overview*" "*Name of the Up-to-date overview buffer." @@ -670,9 +674,11 @@ The function must satisfy this calling convention: (defvar makefile-target-table nil "Table of all target names known for this buffer.") +(put 'makefile-target-table 'risky-local-variable t) (defvar makefile-macro-table nil "Table of all macro names known for this buffer.") +(put 'makefile-macro-table 'risky-local-variable t) (defvar makefile-browser-client "A buffer in Makefile mode that is currently using the browser.") @@ -724,11 +730,10 @@ The function must satisfy this calling convention: If you are editing a file for a different make, try one of the variants `makefile-automake-mode', `makefile-gmake-mode', -`makefile-makepp-mode', `makefile-bsdmake-mode' or, -`makefile-imake-mode'All but the -last should be correctly chosen based on the file name, except if -it is *.mk. This function ends by invoking the function(s) -`makefile-mode-hook'. +`makefile-makepp-mode', `makefile-bsdmake-mode' or, +`makefile-imake-mode'. All but the last should be correctly +chosen based on the file name, except if it is *.mk. This +function ends by invoking the function(s) `makefile-mode-hook'. It is strongly recommended to use `font-lock-mode', because that provides additional parsing information. This is used for @@ -1616,7 +1621,8 @@ with the generated name!" (defun makefile-query-targets (filename target-table prereq-list) "Fill the up-to-date overview buffer. -Checks each target in TARGET-TABLE using `makefile-query-one-target-method' +Checks each target in TARGET-TABLE using +`makefile-query-one-target-method-function' and generates the overview, one line per target name." (insert (mapconcat @@ -1625,7 +1631,7 @@ and generates the overview, one line per target name." (no-prereqs (not (member target-name prereq-list))) (needs-rebuild (or no-prereqs (funcall - makefile-query-one-target-method + makefile-query-one-target-method-function target-name filename)))) (format "\t%s%s" diff --git a/lisp/progmodes/sh-script.el b/lisp/progmodes/sh-script.el index bb8659ed662..ab3da050456 100644 --- a/lisp/progmodes/sh-script.el +++ b/lisp/progmodes/sh-script.el @@ -1390,11 +1390,11 @@ with your script for an edit-interpret-debug cycle." (make-local-variable 'sh-shell-file) (make-local-variable 'sh-shell) (make-local-variable 'skeleton-pair-alist) - (make-local-variable 'skeleton-pair-filter) + (make-local-variable 'skeleton-pair-filter-function) (make-local-variable 'comint-dynamic-complete-functions) (make-local-variable 'comint-prompt-regexp) (make-local-variable 'font-lock-defaults) - (make-local-variable 'skeleton-filter) + (make-local-variable 'skeleton-filter-function) (make-local-variable 'skeleton-newline-indent-rigidly) (make-local-variable 'sh-shell-variables) (make-local-variable 'sh-shell-variables-initialized) @@ -1422,10 +1422,10 @@ with your script for an edit-interpret-debug cycle." (font-lock-syntactic-face-function . sh-font-lock-syntactic-face-function)) skeleton-pair-alist '((?` _ ?`)) - skeleton-pair-filter 'sh-quoted-p + skeleton-pair-filter-function 'sh-quoted-p skeleton-further-elements '((< '(- (min sh-indentation (current-column))))) - skeleton-filter 'sh-feature + skeleton-filter-function 'sh-feature skeleton-newline-indent-rigidly t sh-indent-supported-here nil) (set (make-local-variable 'parse-sexp-ignore-comments) t) diff --git a/lisp/simple.el b/lisp/simple.el index 0e46b5969fb..a2f21465fad 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -2541,7 +2541,9 @@ to make one entry in the kill ring. In Lisp code, optional third arg YANK-HANDLER, if non-nil, specifies the yank-handler text property to be set on the killed text. See `insert-for-yank'." - (interactive "r") + ;; Pass point first, then mark, because the order matters + ;; when calling kill-append. + (interactive (list (point) (mark))) (condition-case nil (let ((string (filter-buffer-substring beg end t))) (when string ;STRING is nil if BEG = END @@ -3635,10 +3637,14 @@ Outline mode sets this." (setq new (point)) ;; Process intangibility within a line. - ;; Move to the chosen destination position from above, - ;; with intangibility processing enabled. - - ;; Avoid calling point-entered and point-left. + ;; With inhibit-point-motion-hooks bound to nil, a call to + ;; goto-char moves point past intangible text. + + ;; However, inhibit-point-motion-hooks controls both the + ;; intangibility and the point-entered/point-left hooks. The + ;; following hack avoids calling the point-* hooks + ;; unnecessarily. Note that we move *forward* past intangible + ;; text when the initial and final points are the same. (goto-char new) (let ((inhibit-point-motion-hooks nil)) (goto-char new) diff --git a/lisp/skeleton.el b/lisp/skeleton.el index 0b3fc82f025..d51fd91c3b4 100644 --- a/lisp/skeleton.el +++ b/lisp/skeleton.el @@ -39,14 +39,15 @@ ;; page 3: mirror-mode, an example for setting up paired insertion -(defvar skeleton-transformation 'identity +(defvar skeleton-transformation-function 'identity "*If non-nil, function applied to literal strings before they are inserted. It should take strings and characters and return them transformed, or nil which means no transformation. Typical examples might be `upcase' or `capitalize'.") +(defvaralias 'skeleton-transformation 'skeleton-transformation-function) ; this should be a fourth argument to defvar -(put 'skeleton-transformation 'variable-interactive +(put 'skeleton-transformation-function 'variable-interactive "aTransformation function: ") @@ -75,8 +76,9 @@ The variables `v1' and `v2' are still set when calling this.") ;;;###autoload -(defvar skeleton-filter 'identity +(defvar skeleton-filter-function 'identity "Function for transforming a skeleton proxy's aliases' variable value.") +(defvaralias 'skeleton-filter 'skeleton-filter-function) (defvar skeleton-untabify t "When non-nil untabifies when deleting backwards with element -ARG.") @@ -157,7 +159,7 @@ This command can also be an abbrev expansion (3rd and 4th columns in Optional second argument STR may also be a string which will be the value of `str' whereas the skeleton's interactor is then ignored." - (skeleton-insert (funcall skeleton-filter skeleton) + (skeleton-insert (funcall skeleton-filter-function skeleton) ;; Pretend C-x a e passed its prefix arg to us (if (or arg current-prefix-arg) (prefix-numeric-value (or arg @@ -199,7 +201,7 @@ SKELETON is made up as (INTERACTOR ELEMENT ...). INTERACTOR may be nil if not needed, a prompt-string or an expression for complex read functions. If ELEMENT is a string or a character it gets inserted (see also -`skeleton-transformation'). Other possibilities are: +`skeleton-transformation-function'). Other possibilities are: \\n go to next line and indent according to mode _ interesting point, interregion here @@ -360,7 +362,7 @@ automatically, and you are prompted to fill in the variable parts."))) (backward-delete-char-untabify (- element)) (delete-backward-char (- element))) (insert (if (not literal) - (funcall skeleton-transformation element) + (funcall skeleton-transformation-function element) element)))) ((or (eq element '\n) ; actually (eq '\n 'n) ;; The sequence `> \n' is handled specially so as to indent the first @@ -464,7 +466,7 @@ will attempt to insert pairs of matching characters.") "*If this is nil, paired insertion is inhibited before or inside a word.") -(defvar skeleton-pair-filter (lambda () nil) +(defvar skeleton-pair-filter-function (lambda () nil) "Attempt paired insertion if this function returns nil, before inserting. This allows for context-sensitive checking whether pairing is appropriate.") @@ -490,7 +492,7 @@ Elements might be (?` ?` _ \"''\"), (?\\( ? _ \" )\") or (?{ \\n > _ \\n ?} >). With no ARG, if `skeleton-pair' is non-nil, pairing can occur. If the region is visible the pair is wrapped around it depending on `skeleton-autowrap'. Else, if `skeleton-pair-on-word' is non-nil or we are not before or inside a -word, and if `skeleton-pair-filter' returns nil, pairing is performed. +word, and if `skeleton-pair-filter-function' returns nil, pairing is performed. Pairing is also prohibited if we are right after a quoting character such as backslash. @@ -512,7 +514,7 @@ symmetrical ones, and the same character twice for the others." (and (not mark) (or overwrite-mode (if (not skeleton-pair-on-word) (looking-at "\\w")) - (funcall skeleton-pair-filter)))) + (funcall skeleton-pair-filter-function)))) (self-insert-command (prefix-numeric-value arg)) (skeleton-insert (cons nil skeleton) (if mark -1)))))) @@ -526,13 +528,13 @@ symmetrical ones, and the same character twice for the others." ;; (kill-all-local-variables) ;; (make-local-variable 'skeleton-pair) ;; (make-local-variable 'skeleton-pair-on-word) -;; (make-local-variable 'skeleton-pair-filter) +;; (make-local-variable 'skeleton-pair-filter-function) ;; (make-local-variable 'skeleton-pair-alist) ;; (setq major-mode 'mirror-mode ;; mode-name "Mirror" ;; skeleton-pair-on-word t ;; ;; in the middle column insert one or none if odd window-width -;; skeleton-pair-filter (lambda () +;; skeleton-pair-filter-function (lambda () ;; (if (>= (current-column) ;; (/ (window-width) 2)) ;; ;; insert both on next line diff --git a/lisp/term/mac-win.el b/lisp/term/mac-win.el index 88b91b74aa4..5ad2fe700cb 100644 --- a/lisp/term/mac-win.el +++ b/lisp/term/mac-win.el @@ -1616,7 +1616,10 @@ in `selection-converter-alist', which see." (let ((ae (mac-event-ae event))) (dolist (file-name (mac-ae-list ae nil 'undecoded-file-name)) (if file-name - (dnd-open-local-file (concat "file:" file-name) nil))) + (dnd-open-local-file + (concat "file://" + (mapconcat 'url-hexify-string + (split-string file-name "/") "/")) nil))) (let ((selection-range (mac-ae-selection-range ae)) (search-text (mac-ae-text-for-search ae))) (cond (selection-range diff --git a/lisp/term/w32-win.el b/lisp/term/w32-win.el index 3987ad66f6a..31a794eeaa1 100644 --- a/lisp/term/w32-win.el +++ b/lisp/term/w32-win.el @@ -112,6 +112,14 @@ Switch to a buffer editing the last file dropped." (if (and (> x 0) (> y 0)) (set-frame-selected-window nil window)) (mapcar (lambda (file-name) + (let ((f (subst-char-in-string ?\\ ?/ file-name)) + (coding (or file-name-coding-system + default-file-name-coding-system))) + (setq file-name + (mapconcat 'url-hexify-string + (split-string (encode-coding-string f coding) + "/") + "/"))) (dnd-handle-one-url window 'private (concat "file:" file-name))) (car (cdr (cdr event))))) diff --git a/lisp/textmodes/artist.el b/lisp/textmodes/artist.el index 9305bdbf9bc..d5dcdd0d9ef 100644 --- a/lisp/textmodes/artist.el +++ b/lisp/textmodes/artist.el @@ -365,10 +365,11 @@ Example: "*If in X Windows, use this pointer shape while drawing with the mouse.") -(defcustom artist-text-renderer 'artist-figlet +(defcustom artist-text-renderer-function 'artist-figlet "Function for doing text rendering." :group 'artist-text :type 'symbol) +(defvaralias 'artist-text-renderer 'artist-text-renderer-function) (defcustom artist-figlet-program "figlet" @@ -2910,23 +2911,25 @@ Let blanks in TEXT overwrite any text already in the buffer." (defun artist-text-see-thru (x y) "Prompt for text to render, render it at X,Y. -This is done by calling the function specified by `artist-text-renderer', -which must return a list of strings, to be inserted in the buffer. +This is done by calling the function specified by +`artist-text-renderer-function', which must return a list of strings, +to be inserted in the buffer. Text already in the buffer ``shines thru'' blanks in the rendered text." (let* ((input-text (read-string "Type text to render: ")) - (rendered-text (artist-funcall artist-text-renderer input-text))) + (rendered-text (artist-funcall artist-text-renderer-function input-text))) (artist-text-insert-see-thru x y rendered-text))) (defun artist-text-overwrite (x y) "Prompt for text to render, render it at X,Y. -This is done by calling the function specified by `artist-text-renderer', -which must return a list of strings, to be inserted in the buffer. +This is done by calling the function specified by +`artist-text-renderer-function', which must return a list of strings, +to be inserted in the buffer. Blanks in the rendered text overwrites any text in the buffer." (let* ((input-text (read-string "Type text to render: ")) - (rendered-text (artist-funcall artist-text-renderer input-text))) + (rendered-text (artist-funcall artist-text-renderer-function input-text))) (artist-text-insert-overwrite x y rendered-text))) ;; diff --git a/lisp/textmodes/bibtex.el b/lisp/textmodes/bibtex.el index e4f0a3db545..74ec8beffa2 100644 --- a/lisp/textmodes/bibtex.el +++ b/lisp/textmodes/bibtex.el @@ -87,7 +87,7 @@ If this is a function, call it to generate the initial field text." :type '(choice (const :tag "None" nil) (string :tag "Initial text") (function :tag "Initialize Function" :value fun) - (other :tag "Default" t))) + (const :tag "Default" t))) (put 'bibtex-include-OPTkey 'risky-local-variable t) (defcustom bibtex-user-optional-fields @@ -153,7 +153,7 @@ narrowed to just the entry." (defcustom bibtex-maintain-sorted-entries nil "If non-nil, BibTeX mode maintains all entries in sorted order. Allowed non-nil values are: -plain All entries are sorted alphabetically. +plain or t All entries are sorted alphabetically. crossref All entries are sorted alphabetically unless an entry has a crossref field. These crossrefed entries are placed in alphabetical order immediately preceding the main entry. @@ -165,7 +165,10 @@ See also `bibtex-sort-ignore-string-entries'." :type '(choice (const nil) (const plain) (const crossref) - (const entry-class))) + (const entry-class) + (const t))) +(put 'bibtex-maintain-sorted-entries 'safe-local-variable + '(lambda (a) (memq a '(nil t plain crossref entry-class)))) (defcustom bibtex-sort-entry-class '(("String") @@ -1800,7 +1803,8 @@ Formats current entry according to variable `bibtex-entry-format'." ;; identify entry type (goto-char (point-min)) - (re-search-forward bibtex-entry-type) + (or (re-search-forward bibtex-entry-type nil t) + (error "Not inside a BibTeX entry")) (let ((beg-type (1+ (match-beginning 0))) (end-type (match-end 0))) (setq entry-list (assoc-string (buffer-substring-no-properties @@ -3876,7 +3880,8 @@ At end of the cleaning process, the functions in (interactive "P") (let ((case-fold-search t) (start (bibtex-beginning-of-entry)) - (_ (looking-at bibtex-any-entry-maybe-empty-head)) + (_ (or (looking-at bibtex-any-entry-maybe-empty-head) + (error "Not inside a BibTeX entry"))) (entry-type (bibtex-type-in-head)) (key (bibtex-key-in-head))) ;; formatting diff --git a/lisp/textmodes/flyspell.el b/lisp/textmodes/flyspell.el index 54b67a258a6..c20ecef31e0 100644 --- a/lisp/textmodes/flyspell.el +++ b/lisp/textmodes/flyspell.el @@ -271,21 +271,23 @@ If `flyspell-large-region' is nil, all regions are treated as small." ;;* using flyspell with mail-mode add the following expression */ ;;* in your .emacs file: */ ;;* (add-hook 'mail-mode */ -;;* '(lambda () (setq flyspell-generic-check-word-p */ -;;* 'mail-mode-flyspell-verify))) */ +;;* '(lambda () (setq flyspell-generic-check-word-predicate */ +;;* 'mail-mode-flyspell-verify))) */ ;;*---------------------------------------------------------------------*/ -(defvar flyspell-generic-check-word-p nil +(defvar flyspell-generic-check-word-predicate nil "Function providing per-mode customization over which words are flyspelled. Returns t to continue checking, nil otherwise. Flyspell mode sets this variable to whatever is the `flyspell-mode-predicate' property of the major mode name.") -(make-variable-buffer-local 'flyspell-generic-check-word-p) +(make-variable-buffer-local 'flyspell-generic-check-word-predicate) +(defvaralias 'flyspell-generic-check-word-p + 'flyspell-generic-check-word-predicate) ;;*--- mail mode -------------------------------------------------------*/ (put 'mail-mode 'flyspell-mode-predicate 'mail-mode-flyspell-verify) (put 'message-mode 'flyspell-mode-predicate 'mail-mode-flyspell-verify) (defun mail-mode-flyspell-verify () - "This function is used for `flyspell-generic-check-word-p' in Mail mode." + "Function used for `flyspell-generic-check-word-predicate' in Mail mode." (let ((header-end (save-excursion (goto-char (point-min)) (re-search-forward @@ -313,7 +315,7 @@ property of the major mode name.") ;;*--- texinfo mode ----------------------------------------------------*/ (put 'texinfo-mode 'flyspell-mode-predicate 'texinfo-mode-flyspell-verify) (defun texinfo-mode-flyspell-verify () - "This function is used for `flyspell-generic-check-word-p' in Texinfo mode." + "Function used for `flyspell-generic-check-word-predicate' in Texinfo mode." (save-excursion (forward-word -1) (not (looking-at "@")))) @@ -321,7 +323,7 @@ property of the major mode name.") ;;*--- tex mode --------------------------------------------------------*/ (put 'tex-mode 'flyspell-mode-predicate 'tex-mode-flyspell-verify) (defun tex-mode-flyspell-verify () - "This function is used for `flyspell-generic-check-word-p' in LaTeX mode." + "Function used for `flyspell-generic-check-word-predicate' in LaTeX mode." (and (not (save-excursion (re-search-backward "^[ \t]*%%%[ \t]+Local" nil t))) @@ -338,7 +340,7 @@ property of the major mode name.") (put 'html-mode 'flyspell-mode-predicate 'sgml-mode-flyspell-verify) (defun sgml-mode-flyspell-verify () - "This function is used for `flyspell-generic-check-word-p' in SGML mode." + "Function used for `flyspell-generic-check-word-predicate' in SGML mode." (not (save-excursion (let ((this (point-marker)) (s (progn (beginning-of-line) (point-marker))) @@ -368,7 +370,7 @@ property of the major mode name.") "Faces corresponding to text in programming-mode buffers.") (defun flyspell-generic-progmode-verify () - "Used for `flyspell-generic-check-word-p' in programming modes." + "Used for `flyspell-generic-check-word-predicate' in programming modes." (let ((f (get-text-property (point) 'face))) (memq f flyspell-prog-text-faces))) @@ -376,7 +378,8 @@ property of the major mode name.") (defun flyspell-prog-mode () "Turn on `flyspell-mode' for comments and strings." (interactive) - (setq flyspell-generic-check-word-p 'flyspell-generic-progmode-verify) + (setq flyspell-generic-check-word-predicate + 'flyspell-generic-progmode-verify) (flyspell-mode 1) (run-hooks 'flyspell-prog-mode-hook)) @@ -563,10 +566,10 @@ in your .emacs file. (add-hook 'pre-command-hook (function flyspell-pre-command-hook) t t) ;; we bound flyspell action to after-change hook (add-hook 'after-change-functions 'flyspell-after-change-function nil t) - ;; set flyspell-generic-check-word-p based on the major mode + ;; set flyspell-generic-check-word-predicate based on the major mode (let ((mode-predicate (get major-mode 'flyspell-mode-predicate))) (if mode-predicate - (setq flyspell-generic-check-word-p mode-predicate))) + (setq flyspell-generic-check-word-predicate mode-predicate))) ;; the welcome message (if (and flyspell-issue-message-flag flyspell-issue-welcome-flag @@ -979,8 +982,8 @@ Mostly we check word delimiters." (flyspell-word (flyspell-get-word following)) start end poss word) (if (or (eq flyspell-word nil) - (and (fboundp flyspell-generic-check-word-p) - (not (funcall flyspell-generic-check-word-p)))) + (and (fboundp flyspell-generic-check-word-predicate) + (not (funcall flyspell-generic-check-word-predicate)))) t (progn ;; destructure return flyspell-word info list. diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el index fed06a572bb..7bfedb1bd97 100644 --- a/lisp/textmodes/ispell.el +++ b/lisp/textmodes/ispell.el @@ -416,11 +416,12 @@ The following values are supported: :type 'boolean :group 'ispell) -(defcustom ispell-format-word (function upcase) +(defcustom ispell-format-word-function (function upcase) "*Formatting function for displaying word being spell checked. The function must take one string argument and return a string." :type 'function :group 'ispell) +(defvaralias 'ispell-format-word 'ispell-format-word-function) (defcustom ispell-use-framepop-p nil "When non-nil ispell uses framepop to display choices in a dedicated frame. @@ -1595,7 +1596,7 @@ quit spell session exited." ;; But that is silly; if the user asks for it, we should do it. - rms. (or quietly (message "Checking spelling of %s..." - (funcall ispell-format-word word))) + (funcall ispell-format-word-function word))) (ispell-send-string "%\n") ; put in verbose mode (ispell-send-string (concat "^" word "\n")) ;; wait until ispell has processed word @@ -1611,7 +1612,7 @@ quit spell session exited." (cond ((eq poss t) (or quietly (message "%s is correct" - (funcall ispell-format-word word))) + (funcall ispell-format-word-function word))) (and (fboundp 'extent-at) (extent-at start) (and (fboundp 'delete-extent) @@ -1619,8 +1620,8 @@ quit spell session exited." ((stringp poss) (or quietly (message "%s is correct because of root %s" - (funcall ispell-format-word word) - (funcall ispell-format-word poss))) + (funcall ispell-format-word-function word) + (funcall ispell-format-word-function poss))) (and (fboundp 'extent-at) (extent-at start) (and (fboundp 'delete-extent) @@ -1633,7 +1634,8 @@ quit spell session exited." (set-extent-property ext 'face ispell-highlight-face) (set-extent-property ext 'priority 2000))) (beep) - (message "%s is incorrect"(funcall ispell-format-word word)))) + (message "%s is incorrect" + (funcall ispell-format-word-function word)))) (t ; prompt for correct word. (save-window-excursion (setq replace (ispell-command-loop @@ -3359,6 +3361,7 @@ Don't read buffer-local settings or word lists." "*End of text which will be checked in `ispell-message'. If it is a string, limit at first occurrence of that regular expression. Otherwise, it must be a function which is called to get the limit.") +(put 'ispell-message-text-end 'risky-local-variable t) (defun ispell-mime-multipartp (&optional limit) diff --git a/lisp/textmodes/sgml-mode.el b/lisp/textmodes/sgml-mode.el index ff6df4a5a56..6136d22e432 100644 --- a/lisp/textmodes/sgml-mode.el +++ b/lisp/textmodes/sgml-mode.el @@ -49,13 +49,14 @@ :type 'integer :group 'sgml) -(defcustom sgml-transformation 'identity - "*Default value for `skeleton-transformation' (which see) in SGML mode." +(defcustom sgml-transformation-function 'identity + "*Default value for `skeleton-transformation-function' in SGML mode." :type 'function :group 'sgml) -(put 'sgml-transformation 'variable-interactive +(put 'sgml-transformation-function 'variable-interactive "aTransformation function: ") +(defvaralias 'sgml-transformation 'sgml-transformation-function) (defcustom sgml-mode-hook nil "Hook run by command `sgml-mode'. @@ -335,6 +336,7 @@ an optional alist of possible values." :type '(repeat (cons (string :tag "Tag Name") (repeat :tag "Tag Rule" sexp))) :group 'sgml) +(put 'sgml-tag-alist 'risky-local-variable t) (defcustom sgml-tag-help '(("!" . "Empty declaration for comment") @@ -391,7 +393,7 @@ a DOCTYPE or an XML declaration." (defun sgml-mode-facemenu-add-face-function (face end) (if (setq face (cdr (assq face sgml-face-tag-alist))) (progn - (setq face (funcall skeleton-transformation face)) + (setq face (funcall skeleton-transformation-function face)) (setq facemenu-end-add-face (concat "</" face ">")) (concat "<" face ">")) (error "Face not configured for %s mode" mode-name))) @@ -415,8 +417,8 @@ An argument of N to a tag-inserting command means to wrap it around the next N words. In Transient Mark mode, when the mark is active, N defaults to -1, which means to wrap it around the current region. -If you like upcased tags, put (setq sgml-transformation 'upcase) in -your `.emacs' file. +If you like upcased tags, put (setq sgml-transformation-function 'upcase) +in your `.emacs' file. Use \\[sgml-validate] to validate your document with an SGML parser. @@ -460,7 +462,8 @@ Do \\[describe-key] on the following bindings to discover what they do. (sgml-xml-guess) (if sgml-xml-mode (setq mode-name "XML") - (set (make-local-variable 'skeleton-transformation) sgml-transformation)) + (set (make-local-variable 'skeleton-transformation-function) + sgml-transformation-function)) ;; This will allow existing comments within declarations to be ;; recognized. (set (make-local-variable 'comment-start-skip) "\\(?:<!\\)?--[ \t]*") @@ -604,9 +607,9 @@ This only works for Latin-1 input." (if sgml-name-8bit-mode "ON" "OFF"))) ;; When an element of a skeleton is a string "str", it is passed -;; through skeleton-transformation and inserted. If "str" is to be -;; inserted literally, one should obtain it as the return value of a -;; function, e.g. (identity "str"). +;; through `skeleton-transformation-function' and inserted. +;; If "str" is to be inserted literally, one should obtain it as +;; the return value of a function, e.g. (identity "str"). (defvar sgml-tag-last nil) (defvar sgml-tag-history nil) @@ -614,9 +617,10 @@ This only works for Latin-1 input." "Prompt for a tag and insert it, optionally with attributes. Completion and configuration are done according to `sgml-tag-alist'. If you like tags and attributes in uppercase do \\[set-variable] -skeleton-transformation RET upcase RET, or put this in your `.emacs': - (setq sgml-transformation 'upcase)" - (funcall (or skeleton-transformation 'identity) +`skeleton-transformation-function' RET `upcase' RET, or put this +in your `.emacs': + (setq sgml-transformation-function 'upcase)" + (funcall (or skeleton-transformation-function 'identity) (setq sgml-tag-last (completing-read (if (> (length sgml-tag-last) 0) @@ -639,7 +643,7 @@ skeleton-transformation RET upcase RET, or put this in your `.emacs': ;; For xhtml's `tr' tag, we should maybe use \n instead. (if (eq v2 t) (setq v2 nil)) ;; We use `identity' to prevent skeleton from passing - ;; `str' through skeleton-transformation a second time. + ;; `str' through `skeleton-transformation-function' a second time. '(("") v2 _ v2 "</" (identity ',str) ?>)) ((eq (car v2) t) (cons '("") (cdr v2))) @@ -670,12 +674,12 @@ If QUIET, do not print a message when there are no attributes for TAG." (if (stringp (car alist)) (progn (insert (if (eq (preceding-char) ?\s) "" ?\s) - (funcall skeleton-transformation (car alist))) + (funcall skeleton-transformation-function (car alist))) (sgml-value alist)) (setq i (length alist)) (while (> i 0) (insert ?\s) - (insert (funcall skeleton-transformation + (insert (funcall skeleton-transformation-function (setq attribute (skeleton-read '(completing-read "Attribute: " @@ -1981,12 +1985,12 @@ Can be used as a value for `html-mode-hook'." "\" name=\"" (or v1 (setq v1 (skeleton-read "Name: "))) "\" value=\"" str ?\" (when (y-or-n-p "Set \"checked\" attribute? ") - (funcall skeleton-transformation + (funcall skeleton-transformation-function (if sgml-xml-mode " checked=\"checked\"" " checked"))) (if sgml-xml-mode " />" ">") (skeleton-read "Text: " (capitalize str)) (or v2 (setq v2 (if (y-or-n-p "Newline after text? ") - (funcall skeleton-transformation + (funcall skeleton-transformation-function (if sgml-xml-mode "<br />" "<br>")) ""))) \n)) @@ -2001,12 +2005,12 @@ Can be used as a value for `html-mode-hook'." "\" name=\"" (or (car v2) (setcar v2 (skeleton-read "Name: "))) "\" value=\"" str ?\" (when (and (not v1) (setq v1 (y-or-n-p "Set \"checked\" attribute? "))) - (funcall skeleton-transformation + (funcall skeleton-transformation-function (if sgml-xml-mode " checked=\"checked\"" " checked"))) (if sgml-xml-mode " />" ">") (skeleton-read "Text: " (capitalize str)) (or (cdr v2) (setcdr v2 (if (y-or-n-p "Newline after text? ") - (funcall skeleton-transformation + (funcall skeleton-transformation-function (if sgml-xml-mode "<br />" "<br>")) ""))) \n)) diff --git a/lisp/tumme.el b/lisp/tumme.el index 6a53ed16948..8f6e43e9cd6 100644 --- a/lisp/tumme.el +++ b/lisp/tumme.el @@ -976,7 +976,7 @@ displayed." (defun tumme-tag-files (arg) "Tag marked file(s) in dired. With prefix ARG, tag file at point." (interactive "P") - (let ((tag (read-string "Tag to add: ")) + (let ((tag (read-string "Tags to add (separate tags with a semicolon): ")) curr-file files) (if arg (setq files (dired-get-filename)) @@ -986,7 +986,7 @@ displayed." (defun tumme-tag-thumbnail () "Tag current thumbnail." (interactive) - (let ((tag (read-string "Tag to add: "))) + (let ((tag (read-string "Tags to add (separate tags with a semicolon): "))) (tumme-write-tag (tumme-original-file-name) tag)) (tumme-update-property 'tags (tumme-list-tags (tumme-original-file-name)))) diff --git a/lisp/x-dnd.el b/lisp/x-dnd.el index 3ad9a5f0e2c..04ef4f0b6dc 100644 --- a/lisp/x-dnd.el +++ b/lisp/x-dnd.el @@ -257,14 +257,20 @@ STRING is the uri-list as a string. The URIs are separated by \r\n." retval)) (defun x-dnd-handle-file-name (window action string) - "Prepend file:// to file names and call `dnd-handle-one-url'. + "Convert file names to URLs and call `dnd-handle-one-url'. WINDOW is the window where the drop happened. STRING is the file names as a string, separated by nulls." (let ((uri-list (split-string string "[\0\r\n]" t)) + (coding (and default-enable-multibyte-characters + (or file-name-coding-system + default-file-name-coding-system))) retval) (dolist (bf uri-list) ;; If one URL is handeled, treat as if the whole drop succeeded. - (let* ((file-uri (concat "file://" bf)) + (if coding (setq bf (encode-coding-string bf coding))) + (let* ((file-uri (concat "file://" + (mapconcat 'url-hexify-string + (split-string bf "/") "/"))) (did-action (dnd-handle-one-url window action file-uri))) (when did-action (setq retval did-action)))) retval)) |