Mercurial > emacs
comparison lisp/subr.el @ 12258:95ebca0a74d8
(make-local-hook): Doc fix.
(shell-quote-argument) [WINDOWSNT]: Wrap in quotes only.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Fri, 16 Jun 1995 04:39:46 +0000 |
parents | f75e47f673f4 |
children | 005a5b596618 |
comparison
equal
deleted
inserted
replaced
12257:29b6db180047 | 12258:95ebca0a74d8 |
---|---|
568 When a hook is local, its local and global values | 568 When a hook is local, its local and global values |
569 work in concert: running the hook actually runs all the hook | 569 work in concert: running the hook actually runs all the hook |
570 functions listed in *either* the local value *or* the global value | 570 functions listed in *either* the local value *or* the global value |
571 of the hook variable. | 571 of the hook variable. |
572 | 572 |
573 This function does nothing if HOOK is already local in the current buffer. | 573 This function works by making `t' a member of the buffer-local value, |
574 which acts as a flag to run the hook functions in the default value as | |
575 well. This works for all normal hooks, but does not work for most | |
576 non-normal hooks yet. We will be changing the callers of non-normal | |
577 hooks so that they can handle localness; this has to be done one by | |
578 one. | |
579 | |
580 This function does nothing if HOOK is already local in the current | |
581 buffer. | |
574 | 582 |
575 Do not use `make-local-variable' to make a hook variable buffer-local." | 583 Do not use `make-local-variable' to make a hook variable buffer-local." |
576 (if (local-variable-p hook) | 584 (if (local-variable-p hook) |
577 nil | 585 nil |
578 (or (boundp hook) (set hook nil)) | 586 (or (boundp hook) (set hook nil)) |
854 | 862 |
855 (defun shell-quote-argument (argument) | 863 (defun shell-quote-argument (argument) |
856 "Quote an argument for passing as argument to an inferior shell." | 864 "Quote an argument for passing as argument to an inferior shell." |
857 ;; Quote everything except POSIX filename characters. | 865 ;; Quote everything except POSIX filename characters. |
858 ;; This should be safe enough even for really weird shells. | 866 ;; This should be safe enough even for really weird shells. |
859 (let ((result "") (start 0) end) | 867 (if (eq system-type 'windows-nt) |
860 (while (string-match "[^-0-9a-zA-Z_./]" argument start) | 868 (concat "\"" argument "\"") |
861 (setq end (match-beginning 0) | 869 (let ((result "") (start 0) end) |
862 result (concat result (substring argument start end) | 870 (while (string-match "[^-0-9a-zA-Z_./]" argument start) |
863 "\\" (substring argument end (1+ end))) | 871 (setq end (match-beginning 0) |
864 start (1+ end))) | 872 result (concat result (substring argument start end) |
865 (concat result (substring argument start)))) | 873 "\\" (substring argument end (1+ end))) |
874 start (1+ end))) | |
875 (concat result (substring argument start))))) | |
866 | 876 |
867 (defun make-syntax-table (&optional oldtable) | 877 (defun make-syntax-table (&optional oldtable) |
868 "Return a new syntax table. | 878 "Return a new syntax table. |
869 It inherits all letters and control characters from the standard | 879 It inherits all letters and control characters from the standard |
870 syntax table; other characters are copied from the standard syntax table." | 880 syntax table; other characters are copied from the standard syntax table." |