[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
feature/android af13157653b: Merge remote-tracking branch 'origin/master
From: |
Po Lu |
Subject: |
feature/android af13157653b: Merge remote-tracking branch 'origin/master' into feature/android |
Date: |
Tue, 20 Jun 2023 20:52:47 -0400 (EDT) |
branch: feature/android
commit af13157653b05cbd98ea3d7f9b461b37fd69a6e4
Merge: d7abe9cdb72 bc6068fe945
Author: Po Lu <luangruo@yahoo.com>
Commit: Po Lu <luangruo@yahoo.com>
Merge remote-tracking branch 'origin/master' into feature/android
---
lisp/net/ldap.el | 69 ++++++++++++++++++++++++++-----------------
lisp/progmodes/cperl-mode.el | 70 ++++++++++----------------------------------
src/haikufns.c | 18 +++++++++++-
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.
If WITHDN is non-nil, each entry in the result will be prepended with
its distinguished name WITHDN.
Additional search parameters can be specified through
-`ldap-host-parameters-alist', which see."
+`ldap-host-parameters-alist', which see.
+See `ldap-search-internal' for the description of return value."
(interactive "sFilter:")
(or host
(setq host ldap-default-host)
@@ -487,7 +488,9 @@ Additional search parameters can be specified through
(if ldap-ignore-attribute-codings
result
(mapcar (lambda (record)
- (mapcar #'ldap-decode-attribute record))
+ (append (and withdn (list (car record)))
+ (mapcar #'ldap-decode-attribute
+ (if withdn (cdr record) record))))
result))))
(defun ldap-password-read (host)
@@ -570,8 +573,13 @@ RFC 1779 syntax).
`sizelimit' is the maximum number of matches to return.
`withdn' if non-nil each entry in the result will be prepended with
its distinguished name DN.
-The function returns a list of matching entries. Each entry is itself
-an alist of attribute/value pairs."
+
+The function returns a list of matching entries. Each entry is
+itself a list ATTRS of (ATTR VALUE) pairs; `dn' attribute is not
+included.
+When `withdn' is non-nil the result is instead an alist with
+elements (DN . ATTRS), where DN is a string value and ATTRS is
+same as above."
(let* ((buf (get-buffer-create " *ldap-search*"))
(bufval (get-buffer-create " *ldap-value*"))
(host (or (plist-get search-plist 'host)
@@ -703,35 +711,42 @@ an alist of attribute/value pairs."
(while (progn
(skip-chars-forward " \t\n")
(not (eobp)))
- (setq dn (buffer-substring (point) (line-end-position)))
- (forward-line 1)
(while (looking-at "^\\([A-Za-z][-A-Za-z0-9]*\
\\|[0-9]+\\(?:\\.[0-9]+\\)*\\)\\(;[-A-Za-z0-9]+\\)*[=:\t ]+\
\\(<[\t ]*file://\\)?\\(.*\\)$")
(setq name (match-string 1)
value (match-string 4))
- ;; Need to handle file:///D:/... as generated by OpenLDAP
- ;; on DOS/Windows as local files.
- (if (and (memq system-type '(windows-nt ms-dos))
- (eq (string-match "/\\(.:.*\\)$" value) 0))
- (setq value (match-string 1 value)))
- ;; Do not try to open non-existent files
- (if (match-string 3)
- (with-current-buffer bufval
- (erase-buffer)
- (set-buffer-multibyte nil)
- (insert-file-contents-literally value)
- (delete-file value)
- (setq value (buffer-string)))
- (setq value " "))
- (setq record (cons (list name value)
- record))
+ (when (memq system-type '(windows-nt ms-dos))
+ ;; Need to handle file:///D:/... as generated by
+ ;; OpenLDAP on DOS/Windows as local files.
+ (save-match-data
+ (when (eq (string-match "/\\(.:.*\\)$" value) 0)
+ (setq value (match-string 1 value)))))
+ (cond ((match-string 3) ;normal value written to a file
+ (with-current-buffer bufval
+ (erase-buffer)
+ (set-buffer-multibyte nil)
+ (insert-file-contents-literally value)
+ (delete-file value)
+ (setq value (buffer-string))))
+ (;; dn is output inline
+ (string-equal-ignore-case name "dn")
+ (setq dn value
+ name nil
+ value nil))
+ (t (setq value " ")))
+ (and name value
+ (setq record (cons (list name value)
+ record)))
(forward-line 1))
- (cond (withdn
- (push (cons dn (nreverse record)) result))
- (record
- (push (nreverse record) result)))
- (setq record nil)
+ (when dn
+ (cond (withdn
+ (push (cons dn (nreverse record))
+ result))
+ (record
+ (push (nreverse record) result))))
+ (setq record nil
+ dn nil)
(message "Parsing results... %d" numres)
(setq numres (1+ numres)))
(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)."
;; Fix for msb.el
(defvar cperl-msb-fixed nil)
(defvar cperl-use-major-mode 'cperl-mode)
-(defvar cperl-font-lock-multiline-start nil)
-(defvar cperl-font-lock-multiline nil)
(defvar cperl-font-locking nil)
(defvar cperl-compilation-error-regexp-list
@@ -1686,7 +1684,6 @@ or as help on variables `cperl-tips', `cperl-problems',
(when (< emacs-major-version 27)
(setq-local open-paren-in-column-0-is-defun-start nil))
;; Until Emacs is multi-threaded, we do not actually need it local:
- (make-local-variable 'cperl-font-lock-multiline-start)
(make-local-variable 'cperl-font-locking)
(setq-local outline-regexp cperl-outline-regexp)
(setq-local outline-level 'cperl-outline-level)
@@ -1759,7 +1756,6 @@ or as help on variables `cperl-tips', `cperl-problems',
;; to re-apply them.
(setq cperl-syntax-done-to start)
(cperl-fontify-syntactically end))))
- (setq cperl-font-lock-multiline t) ; Not localized...
(setq-local font-lock-multiline t)
(setq-local font-lock-fontify-region-function
#'cperl-font-lock-fontify-region-function)
@@ -3609,7 +3605,7 @@ move point but does change match data."
delim-begin delim-end)
"Process a here-document's delimiters and body.
The parameters MIN, MAX, END, OVERSHOOT, STOP-POINT, ERR-L are
-used for recursive calls to `cperl-find-pods-here' to handle the
+used for recursive calls to `cperl-find-pods-heres' to handle the
rest of the line which contains the delimiter. MATCHED-POS and
TODO-POS are initial values for this function's result.
END-OF-HERE-DOC is the end of a previous here-doc in the same
@@ -5623,7 +5619,6 @@ comment, or POD."
(cond ((featurep 'ps-print)
(or cperl-faces-init
(progn
- (setq cperl-font-lock-multiline t)
(cperl-init-faces))))
((not cperl-faces-init)
(add-hook 'font-lock-mode-hook
@@ -5768,20 +5763,9 @@ default function."
"([^()]*)\\)?" ; prototype
cperl-maybe-white-and-comment-rex ;
whitespace/comments?
"[{;]")
- 2 (if cperl-font-lock-multiline
- '(if (eq (char-after (cperl-1- (match-end 0))) ?\{ )
+ 2 '(if (eq (char-after (cperl-1- (match-end 0))) ?\{ )
'font-lock-function-name-face
- 'font-lock-variable-name-face)
- ;; need to manually set 'multiline' for older font-locks
- '(progn
- (if (< 1 (count-lines (match-beginning 0)
- (match-end 0)))
- (put-text-property
- (+ 3 (match-beginning 0)) (match-end 0)
- 'syntax-type 'multiline))
- (if (eq (char-after (cperl-1- (match-end 0))) ?\{ )
- 'font-lock-function-name-face
- 'font-lock-variable-name-face))))
+ 'font-lock-variable-name-face))
`(,(rx (sequence symbol-start
(or "package" "require" "use" "import"
"no" "bootstrap")
@@ -5856,12 +5840,7 @@ default function."
;; "\\(("
;; cperl-maybe-white-and-comment-rex
;;
"\\)?\\([$@%*]\\([a-zA-Z0-9_:]+\\|[^a-zA-Z0-9_]\\)\\)")
- ;; (5 ,(if cperl-font-lock-multiline
- (1 ,(if cperl-font-lock-multiline
- 'font-lock-variable-name-face
- '(progn (setq cperl-font-lock-multiline-start
- (match-beginning 0))
- 'font-lock-variable-name-face)))
+ (1 font-lock-variable-name-face)
(,(rx (sequence point
(eval cperl--ws*-rx)
","
@@ -5882,35 +5861,18 @@ default function."
;; Bug in font-lock: limit is used not only to limit
;; searches, but to set the "extend window for
;; facification" property. Thus we need to minimize.
- ,(if cperl-font-lock-multiline
- '(if (match-beginning 1)
- (save-excursion
- (goto-char (match-beginning 1))
- (condition-case nil
- (forward-sexp 1)
- (error
- (condition-case nil
- (forward-char 200)
- (error nil)))) ; typeahead
- (1- (point))) ; report limit
- (forward-char -2)) ; disable continued expr
- '(if (match-beginning 1)
- (point-max) ; No limit for continuation
- (forward-char -2))) ; disable continued expr
- ,(if cperl-font-lock-multiline
- nil
- '(progn ; Do at end
- ;; "my" may be already fontified (POD),
- ;; so cperl-font-lock-multiline-start is nil
- (if (or (not cperl-font-lock-multiline-start)
- (> 2 (count-lines
- cperl-font-lock-multiline-start
- (point))))
- nil
- (put-text-property
- (1+ cperl-font-lock-multiline-start) (point)
- 'syntax-type 'multiline))
- (setq cperl-font-lock-multiline-start nil)))
+ '(if (match-beginning 1)
+ (save-excursion
+ (goto-char (match-beginning 1))
+ (condition-case nil
+ (forward-sexp 1)
+ (error
+ (condition-case nil
+ (forward-char 200)
+ (error nil)))) ; typeahead
+ (1- (point))) ; report limit
+ (forward-char -2)) ; disable continued expr
+ nil
(1 font-lock-variable-name-face)))
;; foreach my $foo (
`(,(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
@@ -258,6 +258,22 @@ haiku_set_tool_bar_lines (struct frame *f, Lisp_Object
value, Lisp_Object oldval
haiku_change_tool_bar_height (f, nlines * FRAME_LINE_HEIGHT (f));
}
+static void
+haiku_set_tool_bar_position (struct frame *f,
+ Lisp_Object new_value,
+ Lisp_Object old_value)
+{
+ Lisp_Object choice = list4 (Qleft, Qright, Qtop, Qbottom);
+
+ if (!NILP (Fmemq (new_value, choice)))
+ {
+ if (!EQ (new_value, Qtop))
+ error ("The only supported tool bar position is top");
+ }
+ else
+ wrong_choice (choice, new_value);
+}
+
static void
haiku_set_tab_bar_lines (struct frame *f, Lisp_Object value, Lisp_Object
oldval)
{
@@ -3136,7 +3152,7 @@ frame_parm_handler haiku_frame_parm_handlers[] =
gui_set_font_backend,
gui_set_alpha,
haiku_set_sticky,
- NULL, /* set tool bar pos */
+ haiku_set_tool_bar_position,
haiku_set_inhibit_double_buffering,
haiku_set_undecorated,
haiku_set_parent_frame,