aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPo Lu2023-06-21 08:52:25 +0800
committerPo Lu2023-06-21 08:52:25 +0800
commitaf13157653b05cbd98ea3d7f9b461b37fd69a6e4 (patch)
tree94217409e1d671315db57ed91c5186bf180f4892
parentd7abe9cdb721ec1b1edeb4671c83d1ed4d6d64ed (diff)
parentbc6068fe9451f62157c25c9568923ef6c49ed967 (diff)
downloademacs-af13157653b05cbd98ea3d7f9b461b37fd69a6e4.tar.gz
emacs-af13157653b05cbd98ea3d7f9b461b37fd69a6e4.zip
Merge remote-tracking branch 'origin/master' into feature/android
-rw-r--r--lisp/net/ldap.el69
-rw-r--r--lisp/progmodes/cperl-mode.el70
-rw-r--r--src/haikufns.c18
3 files changed, 75 insertions, 82 deletions
diff --git a/lisp/net/ldap.el b/lisp/net/ldap.el
index 78405414a28..5c3766a76b3 100644
--- a/lisp/net/ldap.el
+++ b/lisp/net/ldap.el
@@ -472,7 +472,8 @@ the associated values.
472If WITHDN is non-nil, each entry in the result will be prepended with 472If WITHDN is non-nil, each entry in the result will be prepended with
473its distinguished name WITHDN. 473its distinguished name WITHDN.
474Additional search parameters can be specified through 474Additional search parameters can be specified through
475`ldap-host-parameters-alist', which see." 475`ldap-host-parameters-alist', which see.
476See `ldap-search-internal' for the description of return value."
476 (interactive "sFilter:") 477 (interactive "sFilter:")
477 (or host 478 (or host
478 (setq host ldap-default-host) 479 (setq host ldap-default-host)
@@ -487,7 +488,9 @@ Additional search parameters can be specified through
487 (if ldap-ignore-attribute-codings 488 (if ldap-ignore-attribute-codings
488 result 489 result
489 (mapcar (lambda (record) 490 (mapcar (lambda (record)
490 (mapcar #'ldap-decode-attribute record)) 491 (append (and withdn (list (car record)))
492 (mapcar #'ldap-decode-attribute
493 (if withdn (cdr record) record))))
491 result)))) 494 result))))
492 495
493(defun ldap-password-read (host) 496(defun ldap-password-read (host)
@@ -570,8 +573,13 @@ RFC 1779 syntax).
570 `sizelimit' is the maximum number of matches to return. 573 `sizelimit' is the maximum number of matches to return.
571 `withdn' if non-nil each entry in the result will be prepended with 574 `withdn' if non-nil each entry in the result will be prepended with
572its distinguished name DN. 575its distinguished name DN.
573The function returns a list of matching entries. Each entry is itself 576
574an alist of attribute/value pairs." 577The function returns a list of matching entries. Each entry is
578itself a list ATTRS of (ATTR VALUE) pairs; `dn' attribute is not
579included.
580When `withdn' is non-nil the result is instead an alist with
581elements (DN . ATTRS), where DN is a string value and ATTRS is
582same as above."
575 (let* ((buf (get-buffer-create " *ldap-search*")) 583 (let* ((buf (get-buffer-create " *ldap-search*"))
576 (bufval (get-buffer-create " *ldap-value*")) 584 (bufval (get-buffer-create " *ldap-value*"))
577 (host (or (plist-get search-plist 'host) 585 (host (or (plist-get search-plist 'host)
@@ -703,35 +711,42 @@ an alist of attribute/value pairs."
703 (while (progn 711 (while (progn
704 (skip-chars-forward " \t\n") 712 (skip-chars-forward " \t\n")
705 (not (eobp))) 713 (not (eobp)))
706 (setq dn (buffer-substring (point) (line-end-position)))
707 (forward-line 1)
708 (while (looking-at "^\\([A-Za-z][-A-Za-z0-9]*\ 714 (while (looking-at "^\\([A-Za-z][-A-Za-z0-9]*\
709\\|[0-9]+\\(?:\\.[0-9]+\\)*\\)\\(;[-A-Za-z0-9]+\\)*[=:\t ]+\ 715\\|[0-9]+\\(?:\\.[0-9]+\\)*\\)\\(;[-A-Za-z0-9]+\\)*[=:\t ]+\
710\\(<[\t ]*file://\\)?\\(.*\\)$") 716\\(<[\t ]*file://\\)?\\(.*\\)$")
711 (setq name (match-string 1) 717 (setq name (match-string 1)
712 value (match-string 4)) 718 value (match-string 4))
713 ;; Need to handle file:///D:/... as generated by OpenLDAP 719 (when (memq system-type '(windows-nt ms-dos))
714 ;; on DOS/Windows as local files. 720 ;; Need to handle file:///D:/... as generated by
715 (if (and (memq system-type '(windows-nt ms-dos)) 721 ;; OpenLDAP on DOS/Windows as local files.
716 (eq (string-match "/\\(.:.*\\)$" value) 0)) 722 (save-match-data
717 (setq value (match-string 1 value))) 723 (when (eq (string-match "/\\(.:.*\\)$" value) 0)
718 ;; Do not try to open non-existent files 724 (setq value (match-string 1 value)))))
719 (if (match-string 3) 725 (cond ((match-string 3) ;normal value written to a file
720 (with-current-buffer bufval 726 (with-current-buffer bufval
721 (erase-buffer) 727 (erase-buffer)
722 (set-buffer-multibyte nil) 728 (set-buffer-multibyte nil)
723 (insert-file-contents-literally value) 729 (insert-file-contents-literally value)
724 (delete-file value) 730 (delete-file value)
725 (setq value (buffer-string))) 731 (setq value (buffer-string))))
726 (setq value " ")) 732 (;; dn is output inline
727 (setq record (cons (list name value) 733 (string-equal-ignore-case name "dn")
728 record)) 734 (setq dn value
735 name nil
736 value nil))
737 (t (setq value " ")))
738 (and name value
739 (setq record (cons (list name value)
740 record)))
729 (forward-line 1)) 741 (forward-line 1))
730 (cond (withdn 742 (when dn
731 (push (cons dn (nreverse record)) result)) 743 (cond (withdn
732 (record 744 (push (cons dn (nreverse record))
733 (push (nreverse record) result))) 745 result))
734 (setq record nil) 746 (record
747 (push (nreverse record) result))))
748 (setq record nil
749 dn nil)
735 (message "Parsing results... %d" numres) 750 (message "Parsing results... %d" numres)
736 (setq numres (1+ numres))) 751 (setq numres (1+ numres)))
737 (message "Parsing results... done") 752 (message "Parsing results... done")
diff --git a/lisp/progmodes/cperl-mode.el b/lisp/progmodes/cperl-mode.el
index 52c5d183dec..d08603c3255 100644
--- a/lisp/progmodes/cperl-mode.el
+++ b/lisp/progmodes/cperl-mode.el
@@ -1476,8 +1476,6 @@ the last)."
1476;; Fix for msb.el 1476;; Fix for msb.el
1477(defvar cperl-msb-fixed nil) 1477(defvar cperl-msb-fixed nil)
1478(defvar cperl-use-major-mode 'cperl-mode) 1478(defvar cperl-use-major-mode 'cperl-mode)
1479(defvar cperl-font-lock-multiline-start nil)
1480(defvar cperl-font-lock-multiline nil)
1481(defvar cperl-font-locking nil) 1479(defvar cperl-font-locking nil)
1482 1480
1483(defvar cperl-compilation-error-regexp-list 1481(defvar cperl-compilation-error-regexp-list
@@ -1686,7 +1684,6 @@ or as help on variables `cperl-tips', `cperl-problems',
1686 (when (< emacs-major-version 27) 1684 (when (< emacs-major-version 27)
1687 (setq-local open-paren-in-column-0-is-defun-start nil)) 1685 (setq-local open-paren-in-column-0-is-defun-start nil))
1688 ;; Until Emacs is multi-threaded, we do not actually need it local: 1686 ;; Until Emacs is multi-threaded, we do not actually need it local:
1689 (make-local-variable 'cperl-font-lock-multiline-start)
1690 (make-local-variable 'cperl-font-locking) 1687 (make-local-variable 'cperl-font-locking)
1691 (setq-local outline-regexp cperl-outline-regexp) 1688 (setq-local outline-regexp cperl-outline-regexp)
1692 (setq-local outline-level 'cperl-outline-level) 1689 (setq-local outline-level 'cperl-outline-level)
@@ -1759,7 +1756,6 @@ or as help on variables `cperl-tips', `cperl-problems',
1759 ;; to re-apply them. 1756 ;; to re-apply them.
1760 (setq cperl-syntax-done-to start) 1757 (setq cperl-syntax-done-to start)
1761 (cperl-fontify-syntactically end)))) 1758 (cperl-fontify-syntactically end))))
1762 (setq cperl-font-lock-multiline t) ; Not localized...
1763 (setq-local font-lock-multiline t) 1759 (setq-local font-lock-multiline t)
1764 (setq-local font-lock-fontify-region-function 1760 (setq-local font-lock-fontify-region-function
1765 #'cperl-font-lock-fontify-region-function) 1761 #'cperl-font-lock-fontify-region-function)
@@ -3609,7 +3605,7 @@ move point but does change match data."
3609 delim-begin delim-end) 3605 delim-begin delim-end)
3610 "Process a here-document's delimiters and body. 3606 "Process a here-document's delimiters and body.
3611The parameters MIN, MAX, END, OVERSHOOT, STOP-POINT, ERR-L are 3607The parameters MIN, MAX, END, OVERSHOOT, STOP-POINT, ERR-L are
3612used for recursive calls to `cperl-find-pods-here' to handle the 3608used for recursive calls to `cperl-find-pods-heres' to handle the
3613rest of the line which contains the delimiter. MATCHED-POS and 3609rest of the line which contains the delimiter. MATCHED-POS and
3614TODO-POS are initial values for this function's result. 3610TODO-POS are initial values for this function's result.
3615END-OF-HERE-DOC is the end of a previous here-doc in the same 3611END-OF-HERE-DOC is the end of a previous here-doc in the same
@@ -5623,7 +5619,6 @@ comment, or POD."
5623 (cond ((featurep 'ps-print) 5619 (cond ((featurep 'ps-print)
5624 (or cperl-faces-init 5620 (or cperl-faces-init
5625 (progn 5621 (progn
5626 (setq cperl-font-lock-multiline t)
5627 (cperl-init-faces)))) 5622 (cperl-init-faces))))
5628 ((not cperl-faces-init) 5623 ((not cperl-faces-init)
5629 (add-hook 'font-lock-mode-hook 5624 (add-hook 'font-lock-mode-hook
@@ -5768,20 +5763,9 @@ default function."
5768 "([^()]*)\\)?" ; prototype 5763 "([^()]*)\\)?" ; prototype
5769 cperl-maybe-white-and-comment-rex ; whitespace/comments? 5764 cperl-maybe-white-and-comment-rex ; whitespace/comments?
5770 "[{;]") 5765 "[{;]")
5771 2 (if cperl-font-lock-multiline 5766 2 '(if (eq (char-after (cperl-1- (match-end 0))) ?\{ )
5772 '(if (eq (char-after (cperl-1- (match-end 0))) ?\{ )
5773 'font-lock-function-name-face 5767 'font-lock-function-name-face
5774 'font-lock-variable-name-face) 5768 'font-lock-variable-name-face))
5775 ;; need to manually set 'multiline' for older font-locks
5776 '(progn
5777 (if (< 1 (count-lines (match-beginning 0)
5778 (match-end 0)))
5779 (put-text-property
5780 (+ 3 (match-beginning 0)) (match-end 0)
5781 'syntax-type 'multiline))
5782 (if (eq (char-after (cperl-1- (match-end 0))) ?\{ )
5783 'font-lock-function-name-face
5784 'font-lock-variable-name-face))))
5785 `(,(rx (sequence symbol-start 5769 `(,(rx (sequence symbol-start
5786 (or "package" "require" "use" "import" 5770 (or "package" "require" "use" "import"
5787 "no" "bootstrap") 5771 "no" "bootstrap")
@@ -5856,12 +5840,7 @@ default function."
5856 ;; "\\((" 5840 ;; "\\(("
5857 ;; cperl-maybe-white-and-comment-rex 5841 ;; cperl-maybe-white-and-comment-rex
5858 ;; "\\)?\\([$@%*]\\([a-zA-Z0-9_:]+\\|[^a-zA-Z0-9_]\\)\\)") 5842 ;; "\\)?\\([$@%*]\\([a-zA-Z0-9_:]+\\|[^a-zA-Z0-9_]\\)\\)")
5859 ;; (5 ,(if cperl-font-lock-multiline 5843 (1 font-lock-variable-name-face)
5860 (1 ,(if cperl-font-lock-multiline
5861 'font-lock-variable-name-face
5862 '(progn (setq cperl-font-lock-multiline-start
5863 (match-beginning 0))
5864 'font-lock-variable-name-face)))
5865 (,(rx (sequence point 5844 (,(rx (sequence point
5866 (eval cperl--ws*-rx) 5845 (eval cperl--ws*-rx)
5867 "," 5846 ","
@@ -5882,35 +5861,18 @@ default function."
5882 ;; Bug in font-lock: limit is used not only to limit 5861 ;; Bug in font-lock: limit is used not only to limit
5883 ;; searches, but to set the "extend window for 5862 ;; searches, but to set the "extend window for
5884 ;; facification" property. Thus we need to minimize. 5863 ;; facification" property. Thus we need to minimize.
5885 ,(if cperl-font-lock-multiline 5864 '(if (match-beginning 1)
5886 '(if (match-beginning 1) 5865 (save-excursion
5887 (save-excursion 5866 (goto-char (match-beginning 1))
5888 (goto-char (match-beginning 1)) 5867 (condition-case nil
5889 (condition-case nil 5868 (forward-sexp 1)
5890 (forward-sexp 1) 5869 (error
5891 (error 5870 (condition-case nil
5892 (condition-case nil 5871 (forward-char 200)
5893 (forward-char 200) 5872 (error nil)))) ; typeahead
5894 (error nil)))) ; typeahead 5873 (1- (point))) ; report limit
5895 (1- (point))) ; report limit 5874 (forward-char -2)) ; disable continued expr
5896 (forward-char -2)) ; disable continued expr 5875 nil
5897 '(if (match-beginning 1)
5898 (point-max) ; No limit for continuation
5899 (forward-char -2))) ; disable continued expr
5900 ,(if cperl-font-lock-multiline
5901 nil
5902 '(progn ; Do at end
5903 ;; "my" may be already fontified (POD),
5904 ;; so cperl-font-lock-multiline-start is nil
5905 (if (or (not cperl-font-lock-multiline-start)
5906 (> 2 (count-lines
5907 cperl-font-lock-multiline-start
5908 (point))))
5909 nil
5910 (put-text-property
5911 (1+ cperl-font-lock-multiline-start) (point)
5912 'syntax-type 'multiline))
5913 (setq cperl-font-lock-multiline-start nil)))
5914 (1 font-lock-variable-name-face))) 5876 (1 font-lock-variable-name-face)))
5915 ;; foreach my $foo ( 5877 ;; foreach my $foo (
5916 `(,(rx symbol-start "for" (opt "each") 5878 `(,(rx symbol-start "for" (opt "each")
diff --git a/src/haikufns.c b/src/haikufns.c
index b591c143900..b4e68495a35 100644
--- a/src/haikufns.c
+++ b/src/haikufns.c
@@ -259,6 +259,22 @@ haiku_set_tool_bar_lines (struct frame *f, Lisp_Object value, Lisp_Object oldval
259} 259}
260 260
261static void 261static void
262haiku_set_tool_bar_position (struct frame *f,
263 Lisp_Object new_value,
264 Lisp_Object old_value)
265{
266 Lisp_Object choice = list4 (Qleft, Qright, Qtop, Qbottom);
267
268 if (!NILP (Fmemq (new_value, choice)))
269 {
270 if (!EQ (new_value, Qtop))
271 error ("The only supported tool bar position is top");
272 }
273 else
274 wrong_choice (choice, new_value);
275}
276
277static void
262haiku_set_tab_bar_lines (struct frame *f, Lisp_Object value, Lisp_Object oldval) 278haiku_set_tab_bar_lines (struct frame *f, Lisp_Object value, Lisp_Object oldval)
263{ 279{
264 if (FRAME_TOOLTIP_P (f)) 280 if (FRAME_TOOLTIP_P (f))
@@ -3136,7 +3152,7 @@ frame_parm_handler haiku_frame_parm_handlers[] =
3136 gui_set_font_backend, 3152 gui_set_font_backend,
3137 gui_set_alpha, 3153 gui_set_alpha,
3138 haiku_set_sticky, 3154 haiku_set_sticky,
3139 NULL, /* set tool bar pos */ 3155 haiku_set_tool_bar_position,
3140 haiku_set_inhibit_double_buffering, 3156 haiku_set_inhibit_double_buffering,
3141 haiku_set_undecorated, 3157 haiku_set_undecorated,
3142 haiku_set_parent_frame, 3158 haiku_set_parent_frame,