and `down'.
EVENT may be an event or an event type. If EVENT is a symbol
that has never been used in an event that has been read as input
-in the current Emacs session, then this function can return nil,
-even when EVENT actually has modifiers."
+in the current Emacs session, then this function may fail to include
+the `click' modifier."
(let ((type event))
(if (listp type)
(setq type (car type)))
(put 'eval-after-load 'lisp-indent-function 1)
(defun eval-after-load (file form)
- "Arrange that, if FILE is ever loaded, FORM will be run at that time.
+ "Arrange that if FILE is loaded, FORM will be run immediately afterwards.
If FILE is already loaded, evaluate FORM right now.
If a matching file is loaded again, FORM will be evaluated again.
(or (not process)
(not (memq (process-status process) '(run stop open listen)))
(not (process-query-on-exit-flag process))
- (yes-or-no-p "Buffer has a running process; kill it? "))))
+ (yes-or-no-p
+ (format "Buffer %S has a running process; kill it? "
+ (buffer-name (current-buffer)))))))
(add-hook 'kill-buffer-query-functions 'process-kill-buffer-query-function)
(listp last-nonmenu-event)
use-dialog-box)
(setq answer
- (x-popup-dialog t `(,prompt ("yes" . act) ("No" . skip))))
+ (x-popup-dialog t `(,prompt ("Yes" . act) ("No" . skip))))
(setq prompt (concat prompt
(if (eq ?\s (aref prompt (1- (length prompt))))
"" " ")
NUM specifies which parenthesized expression in the last regexp.
Value is nil if NUMth pair didn't match, or there were less than NUM pairs.
Zero means the entire text matched by the whole regexp or whole string.
-STRING should be given if the last search was by `string-match' on STRING."
+STRING should be given if the last search was by `string-match' on STRING.
+If STRING is nil, the current buffer should be the same buffer
+the search/match was performed in."
(if (match-beginning num)
(if string
(substring string (match-beginning num) (match-end num))
NUM specifies which parenthesized expression in the last regexp.
Value is nil if NUMth pair didn't match, or there were less than NUM pairs.
Zero means the entire text matched by the whole regexp or whole string.
-STRING should be given if the last search was by `string-match' on STRING."
+STRING should be given if the last search was by `string-match' on STRING.
+If STRING is nil, the current buffer should be the same buffer
+the search/match was performed in."
(if (match-beginning num)
(if string
(substring-no-properties string (match-beginning num)
(eq t (compare-strings str1 nil nil
str2 0 (length str1) ignore-case)))
-(defun string-mark-left-to-right (str)
- "Return a string that can be safely embedded in left-to-right text.
-If STR ends in right-to-left (RTL) script, return a string
-consisting of STR followed by an invisible left-to-right
-mark (LRM) character. Otherwise, return STR."
+(defun bidi-string-mark-left-to-right (str)
+ "Return a string that can be safely inserted in left-to-right text.
+
+Normally, inserting a string with right-to-left (RTL) script into
+a buffer may cause some subsequent text to be displayed as part
+of the RTL segment (usually this affects punctuation characters).
+This function returns a string which displays as STR but forces
+subsequent text to be displayed as left-to-right.
+
+If STR contains any RTL character, this function returns a string
+consisting of STR followed by an invisible left-to-right mark
+\(LRM) character. Otherwise, it returns STR."
(unless (stringp str)
(signal 'wrong-type-argument (list 'stringp str)))
- (if (and (> (length str) 0)
- (eq (get-char-code-property (aref str (1- (length str)))
- 'bidi-class)
- 'R))
+ (if (string-match "\\cR" str)
(concat str (propertize (string ?\x200e) 'invisible t))
str))
\f