[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] scratch/hyperbole 10ac3f59df 13/16: Fix a few minor miscompilatio
From: |
Stefan Monnier |
Subject: |
[elpa] scratch/hyperbole 10ac3f59df 13/16: Fix a few minor miscompilations and warnings |
Date: |
Mon, 19 Jun 2023 22:36:45 -0400 (EDT) |
branch: scratch/hyperbole
commit 10ac3f59df7e819d6f4f50bfa3e72d5508d4193f
Author: Stefan Monnier <monnier@iro.umontreal.ca>
Commit: Stefan Monnier <monnier@iro.umontreal.ca>
Fix a few minor miscompilations and warnings
* Makefile (LOAD_EL): Escape trailing double quote so it's not confused
with a beginning-of-string.
* hbut.el: Require `house-drv` to fix miscompilation of let-bindings of
`hui--ignore-action-key-depress-prev-point`.
Prefer #' to quote function names.
(hbut:max-len, ibut:label-start, ibut:label-end): Add `defvar`s to fix
some of the many warnings and to make sure they're compiled as dynvars.
(ibut:at-type-p): Remove unused `types` var.
(defib): Remove redundant indent property.
* hibtypes.el (org-link-outside-org-mode): Silence some warnings.
(grep-msg): Avoid NUL bytes in source files (makes Emacs thinks
they're binary).
* set.el: Prefer #' to quote function names.
---
Makefile | 2 +-
hbut.el | 28 ++++++++++++++++++----------
hibtypes.el | 9 ++++++---
set.el | 8 ++++----
4 files changed, 29 insertions(+), 18 deletions(-)
diff --git a/Makefile b/Makefile
index 6d881daee6..382ec79957 100644
--- a/Makefile
+++ b/Makefile
@@ -306,7 +306,7 @@ bin: src
# Create -l "file.el" load-file command-line args for each Hyperbole .el file
for use in
# eln native compile target below.
-LOAD_EL = $(shell echo "$(EL_KOTL) $(EL_COMPILE)" | sed - -e 's+ +" -l "./+g'
-e 's+^+-l "+')"
+LOAD_EL = $(shell echo "$(EL_KOTL) $(EL_COMPILE)" | sed - -e 's+ +" -l "./+g'
-e 's+^+-l "+')\"
load-hyperbole:
$(EMACS_BATCH) \
diff --git a/hbut.el b/hbut.el
index 5f30890b3a..a04cb21f64 100644
--- a/hbut.el
+++ b/hbut.el
@@ -22,6 +22,7 @@
(eval-and-compile (mapc #'require '(cl-lib elisp-mode help-mode hversion
hmoccur hbmap htz hbdata hact
hui-select view)))
+(require 'hmouse-drv) ;For `hui--ignore-action-key-depress-prev-point'.
;;; ************************************************************************
;;; Public declarations
@@ -218,6 +219,8 @@ Return nil if no matching button is found."
(defalias 'ebut:key-src-fmt #'hbut:key-src-fmt)
(defalias 'ebut:key-to-label #'hbut:key-to-label)
+(defvar hbut:max-len)
+
(defun ebut:label-p (&optional as-label start-delim end-delim pos-flag
two-lines-flag)
"Return key for the explicit button label that point is within, else nil.
This is the normalized key form of the explicit button's label.
@@ -694,7 +697,7 @@ Return nil if no matching button is found."
(defun gbut:help (label)
"Display help for Hyperbole global button with LABEL."
(interactive (list (hargs:read-match "Report on global button labeled: "
- (mapcar 'list (gbut:label-list))
+ (mapcar #'list (gbut:label-list))
nil t nil 'hbut)))
(let* ((lbl-key (hbut:label-to-key label))
(but (hbut:get lbl-key nil (gbut:file))))
@@ -1523,7 +1526,7 @@ If a file, always return a full path if optional
FULL-FLAG is non-nil."
(expand-file-name file default-directory)
file)))))
-(defalias 'hbut:summarize 'hbut:report)
+(defalias 'hbut:summarize #'hbut:report)
(defun hbut:to (lbl-key)
"Find the nearest explicit button or labeled/named implicit button.
@@ -1622,8 +1625,12 @@ associated arguments from the button."
(unless (string-match "::" type-name)
(setq ibut-type-symbol (intern-soft (concat "ibtypes::" type-name))))
(when ibut-type-symbol
- (let ((types (htype:category 'ibtypes))
+ (let (;; (types (htype:category 'ibtypes))
;; 'types' is a global var used in (hact) function, don't delete.
+ ;; FIXME: I can't see where `types' is used as a global var
+ ;; "in (hact) function", and the above binding was treated
+ ;; by Emacs as lexically-scoped so it wasn't affecting any
+ ;; other global `types' definition anyway.
(hrule:action 'actype:identity))
(funcall ibut-type-symbol))))))
@@ -1896,6 +1903,9 @@ Store new button attributes in the symbol, 'hbut:current."
[&optional ["&optional" arg &rest arg]]
&optional ["&rest" arg])))
+(defvar ibut:label-start)
+(defvar ibut:label-end)
+
(defun ibut:delete (&optional but-sym)
"Delete Hyperbole implicit button based on optional BUT-SYM.
Default is the symbol hbut:current'.
@@ -2132,10 +2142,10 @@ positions at which the button label delimiter begins
and ends."
(error "(ibut:key): Argument is not a Hyperbole implicit button symbol,
`%s'"
ibut)))
-(defalias 'ibut:to-key-src 'hbut:to-key-src)
-(defalias 'ibut:key-to-label 'hbut:key-to-label)
-(defalias 'ibut:label-to-key 'hbut:label-to-key)
-(defalias 'map-ibut 'ibut:map)
+(defalias 'ibut:to-key-src #'hbut:to-key-src)
+(defalias 'ibut:key-to-label #'hbut:key-to-label)
+(defalias 'ibut:label-to-key #'hbut:label-to-key)
+(defalias 'map-ibut #'ibut:map)
(defun ibut:map (but-func &optional regexp-match include-delims)
"Apply BUT-FUNC to the visible, named implicit buttons.
@@ -2475,7 +2485,7 @@ current."
t))
(t (error "(ibut:rename): Button '%s' not found in visible portion of
buffer." old-lbl))))
-(defalias 'ibut:summarize 'hbut:report)
+(defalias 'ibut:summarize #'hbut:report)
(defun ibut:to (name-key)
"Find the nearest implicit button with NAME-KEY (a name or name key).
@@ -2690,8 +2700,6 @@ type for ibtype is presently undefined."
(htype:create ,type ibtypes ,doc nil ,at-func
'(to-p ,to-func style ,style))))))
-(put 'defib 'lisp-indent-function 'defun)
-
;; Support edebug-defun for interactive debugging of ibtypes
(def-edebug-spec defib
(&define name lambda-list
diff --git a/hibtypes.el b/hibtypes.el
index ecb7dd5605..d10a100e6b 100644
--- a/hibtypes.el
+++ b/hibtypes.el
@@ -349,7 +349,7 @@ in all buffers."
(and buffer-file-name
(boundp 'hyrolo-file-list)
(set:member (current-buffer)
- (mapcar 'get-file-buffer hyrolo-file-list)))))
+ (mapcar #'get-file-buffer hyrolo-file-list)))))
(let ((address (mail-address-at-p)))
(when address
(ibut:label-set address (match-beginning 1) (match-end 1))
@@ -372,11 +372,14 @@ handle any links they recognize first."
;; Prevent infinite recursion, e.g. if called via
;; `org-metareturn-hook' from `org-meta-return' invocation.
(not hibtypes--within-org-link-outside-org-mode))
+ (require 'hsys-org)
+ (declare-function hsys-org-link-at-p "hsys-org" ())
+ (declare-function hsys-org-set-ibut-label "hsys-org" (start-end))
(let* ((hibtypes--within-org-link-outside-org-mode t)
(start-end (hsys-org-link-at-p)))
(when start-end
(hsys-org-set-ibut-label start-end)
- (hact 'org-open-at-point-global)))))
+ (hact #'org-open-at-point-global)))))
;;; ========================================================================
;;; Handles internal references within an annotated bibliography, delimiters=[]
@@ -1003,7 +1006,7 @@ in grep and shell buffers."
;; Grep matches, UNIX C compiler and Introl 68HC11 C
;; compiler errors, allowing for file names with
;; spaces followed by a null character rather than a :
- (looking-at "\\([^\t\n\r\"'`]+\\) ?\\([1-9][0-9]*\\)[ :]")
+ (looking-at "\\([^\t\n\r\"'`]+\\)\0 ?\\([1-9][0-9]*\\)[ :]")
;; HP C compiler errors
(looking-at "[a-zA-Z0-9]+: \"\\([^\t\n\r\",]+\\)\", line
\\([0-9]+\\):")
;; BSO/Tasking 68HC08 C compiler errors
diff --git a/set.el b/set.el
index 954cd21774..a7dc4a893c 100644
--- a/set.el
+++ b/set.el
@@ -90,7 +90,7 @@ valid set. With optional ARITY, return only subsets with
ARITY
members."
(cond ((null arity)
(setq arity 0)
- (cons nil (apply 'nconc (mapcar (lambda (_elt) (setq arity (1+ arity))
(set:combinations set arity))
+ (cons nil (apply #'nconc (mapcar (lambda (_elt) (setq arity (1+
arity)) (set:combinations set arity))
set))))
((= arity 1) set)
((<= arity 0) '(nil))
@@ -120,7 +120,7 @@ for comparison."
elements)
(nreverse set)))))
-(defalias 'set:delete 'set:remove)
+(defalias 'set:delete #'set:remove)
(defun set:difference (&rest sets)
"Return difference of any number of SETS.
Difference is the set of elements in the first set that are not in any of the
@@ -132,7 +132,7 @@ other sets. Uses `set:equal-op' for comparison."
(cdr sets))
rtn-set))
-(defalias 'set:size 'length)
+(defalias 'set:size #'length)
(defun set:empty (set)
"Return t if SET is empty."
@@ -170,7 +170,7 @@ Uses `set:equal-op' for comparison."
(setq lst (cdr lst))))
(null lst))))
-(defalias 'set:map 'mapcar)
+(defalias 'set:map #'mapcar)
(defun set:members (list)
"Return set of unique elements of LIST.
- [elpa] scratch/hyperbole b5780234d9 02/16: * hversion.el (hyperb:path-being-loaded): Delete function, (continued)
- [elpa] scratch/hyperbole b5780234d9 02/16: * hversion.el (hyperb:path-being-loaded): Delete function, Stefan Monnier, 2023/06/19
- [elpa] scratch/hyperbole 60cf4b3ab0 07/16: * hact.el: Fix broken lexical-binding cookie, Stefan Monnier, 2023/06/19
- [elpa] scratch/hyperbole 57d02f8456 09/16: hyperbole-autoloads.el: Remove needless definitions, Stefan Monnier, 2023/06/19
- [elpa] scratch/hyperbole 5aa8d7a577 10/16: * hycontrol.el (hycontrol-windows-mode-map): Don't autoload, Stefan Monnier, 2023/06/19
- [elpa] scratch/hyperbole fd3f79a9ee 15/16: * hargs.el (hargs:set-string-to-complete): Don't mess with windows, Stefan Monnier, 2023/06/19
- [elpa] scratch/hyperbole ab0338d714 05/16: Fix compilation of test file, Stefan Monnier, 2023/06/19
- [elpa] scratch/hyperbole 63e463172e 06/16: (kview:char-visible-p): Delete function, Stefan Monnier, 2023/06/19
- [elpa] scratch/hyperbole fbcfcc04a3 08/16: * hyperbole.el: Preload `kotl-autoloads`, Stefan Monnier, 2023/06/19
- [elpa] scratch/hyperbole fc7e33b5e5 11/16: * hui-select.el: Fix a few warnings and improve some docstrings, Stefan Monnier, 2023/06/19
- [elpa] scratch/hyperbole 12fa8e328d 12/16: (man-show): Fix miscompilation, Stefan Monnier, 2023/06/19
- [elpa] scratch/hyperbole 10ac3f59df 13/16: Fix a few minor miscompilations and warnings,
Stefan Monnier <=
- [elpa] scratch/hyperbole 02335b71bd 14/16: * hyrolo.el: A few cosmetic tweaks, Stefan Monnier, 2023/06/19
- [elpa] scratch/hyperbole a269d1536e 16/16: * hversion.el: Add FIXMEs., Stefan Monnier, 2023/06/19
- [elpa] scratch/hyperbole 824a71773c 04/16: Get rid of `hyperb:stack-frame`, Stefan Monnier, 2023/06/19