1. 31 Jul, 2021 17 commits
    • Lars Ingebrigtsen's avatar
      Document outline-minor-mode-cycle in the manual. · 59f80ffc
      Lars Ingebrigtsen authored
      * doc/emacs/text.texi (Outline Mode): Document outline-minor-mode-cycle.
      59f80ffc
    • Lars Ingebrigtsen's avatar
      Make `ffap-read-file-or-url' work again (to read URLs) · d3d6ea50
      Lars Ingebrigtsen authored
      * lisp/ffap.el (ffap--url-file-handler): New function (bug#44822).
      (ffap-read-file-or-url): Use it to allow switching between URLs
      and files.
      d3d6ea50
    • Lars Ingebrigtsen's avatar
      Add new user option python-forward-sexp-function · 2dcb0f8f
      Lars Ingebrigtsen authored
      * lisp/progmodes/python.el (python-forward-sexp-function): New
      user option (bug#41361).
      (python-mode): Use it.
      2dcb0f8f
    • Lars Ingebrigtsen's avatar
      Adjust how `replace-match' runs modification hooks · f6c5a801
      Lars Ingebrigtsen authored
      * src/editfns.c (Fsubst_char_in_region)
      (Ftranslate_region_internal):
      * src/cmds.c (internal_self_insert): Update callers.
      * src/insdel.c (replace_range): Allow inhibiting
      signal_after_change/update_compositions.
      * src/lisp.h: Update.
      
      * src/search.c (Freplace_match): Run the modification hooks at the
      end instead of before adjusting point (bug#42424).
      f6c5a801
    • Lars Ingebrigtsen's avatar
      Extend whitespace-empty to the end of the line · c4239ec3
      Lars Ingebrigtsen authored
      * lisp/whitespace.el (whitespace-empty): Restore Emacs 26 look by
      extending the face (bug#42112).
      c4239ec3
    • Lars Ingebrigtsen's avatar
      Revert "Fix `speedbar-directory-buttons' when using Tramp" · 5ecf39a5
      Lars Ingebrigtsen authored
      This reverts commit 5afad391.
      
      This patch can't possibly be correct, and it breaks the stated interface.
      5ecf39a5
    • Lars Ingebrigtsen's avatar
      Revert "Allow nil initializers in define-minor-mode" · 32b9c7d0
      Lars Ingebrigtsen authored
      This reverts commit 02cbb37d.
      
      This was mistakenly commited and doesn't really make much sense.
      32b9c7d0
    • Lars Ingebrigtsen's avatar
      Don't bind <mouse-2> and RET in *Help* buffers · 99600ee7
      Lars Ingebrigtsen authored
      * lisp/help-mode.el (help-mode-map): Remove key bindings for RET
      and <mouse-2> (bug#49784).
      (help-xref-stack, help-xref-forward-stack, help-xref-stack-item)
      (help-make-xrefs): Fix doc strings -- these aren't used by
      `help-follow', but by `help-follow-symbol'.
      (help-follow-mouse, help-follow): Make obsolete.
      99600ee7
    • Lars Ingebrigtsen's avatar
      Allow nil initializers in define-minor-mode · 02cbb37d
      Lars Ingebrigtsen authored
      * lisp/emacs-lisp/easy-mmode.el (define-minor-mode): Make the
      meaning of :initialize nil and a missing :initialize the same.
      02cbb37d
    • Alan Third's avatar
      Fix some macOS problems · 12c5ca4d
      Alan Third authored
      * src/nsmenu.m (update_frame_tool_bar): Make sure the toolbar isn't
      displayed when it's not supposed to be.
      * src/nsterm.m ([EmacsView layoutSublayersOfLayer:]): Reinstate code
      intended to prevent a crash when running redisplay.
      12c5ca4d
    • Alan Third's avatar
      Move parent frame setting code into EmacsWindow · 5a48c996
      Alan Third authored
      * src/nsterm.m (ns_make_frame_visible):
      (ns_set_parent_frame):
      ([EmacsWindow initWithEmacsFrame:fullscreen:screen:]):  Use new method.
      ([EmacsWindow setParentChildRelationships]): New method.
      5a48c996
    • Alan Third's avatar
      Move NS port toolbar handling to the window · 0b5cf485
      Alan Third authored
      * src/nsmenu.m (free_frame_tool_bar):
      (update_frame_tool_bar): Remove wait_for_tool_bar and get the toolbar
      from the window.
      * src/nsterm.h (EmacsView): Remove toolbar and wait_for_tool_bar.
      * src/nsterm.m (ns_update_begin):
      ([EmacsView windowDidEnterFullScreen]):
      ([EmacsView windowDidExitFullScreen]): Get the toolbar from the
      window, not the view.
      ([EmacsView dealloc]): Remove toolbar from view.
      ([EmacsView createToolbar:]): Move method to EmacsWindow.
      ([EmacsView initFrameFromEmacs:]): Don't create toolbar here any more.
      ([EmacsView toolbar]): Remove method.
      ([EmacsWindow initWithEmacsFrame:fullscreen:screen:]): Create toolbar here.
      ([EmacsWindow createToolbar:]): Moved from EmacsView.
      ([EmacsWindow dealloc]): Make sure we clean up the toolbar after
      closing the window.
      0b5cf485
    • Alan Third's avatar
      Fix macOS live resize drawing · 1ba02d85
      Alan Third authored
      * src/nsterm.m ([EmacsView layout]):
      ([EmacsView layoutSublayersOfLayer:]): Rename layout to
      layoutSublayersOfLayer.
      1ba02d85
    • Alan Third's avatar
      Change NS port resize detection · 960f3fc5
      Alan Third authored
      * src/nsterm.m ([EmacsView windowDidResize:]): Remove function, it's
      not performing a useful function any more.
      ([EmacsView viewDidResize]):
      ([EmacsView resizeWithOldSuperviewSize:]): Replace viewDidResize with
      resizeWithOldSuperviewSize.
      ([EmacsView initFrameFromEmacs:]): Remove the view resize notification
      as we don't need it any more.
      960f3fc5
    • Alan Third's avatar
      Tidy up NS port OS window handling · 1535c81f
      Alan Third authored
      * src/nsterm.h (EmacsWindow): Move above EmacsView definition and add
      new method definitions.
      (EmacsView): Remove redundant bwidth variable, and change NSWindow to
      EmacsWindow.
      (EmacsFSWindow): Delete definition.
      * src/nsterm.m (ns_set_undecorated): Rewrite to work in GNUstep using
      the new OS window creating methods.
      ([EmacsView initFrameFromEmacs:]): Move all NSWindow related code to
      new init method in EmacsWindow, and use said method.
      ([EmacsView toggleFullScreen:]): Use EmacsWindow instead of NSWindow.
      ([EmacsWindow initWithEmacsFrame:]):
      ([EmacsWindow initWithEmacsFrame:fullscreen:screen:]):
      ([EmacsWindow borderWidth]): New methods.
      (EmacsFSWindow): Remove implementation.
      1535c81f
    • Alan Third's avatar
      Simplify macOS drawing code · a4d2c88c
      Alan Third authored
      Convert EmacsSurface into a CALayer subclass so we can use the
      built-in relationships.  Also simplify the macOS versioning code.
      This will result in more warnings on older versions of macOS but makes
      reading the code easier.
      
      * configure.ac: Add QuartzCore framework.
      * src/nsterm.h (NS_DRAW_TO_BUFFER): Remove define and all references.
      (EmacsSurface, EmacsLayer): Rename EmacsSurface to EmacsLayer and
      modify the definition to fit the new function.
      * src/nsterm.m (ns_update_begin):
      (ns_update_end):
      (ns_focus):
      (ns_unfocus): Use the new overridden lockFocus and unlockFocus and
      simplify the frame management.
      ([EmacsView dealloc]):
      ([EmacsView viewDidResize:]):Don't explicitly release surfaces.
      ([EmacsView initFrameFromEmacs:]): Move the layer code to after the
      NSWindow has been created as creating the layer now relies on some of
      it's properties.
      ([EmacsView makeBackingLayer]): New function.
      ([EmacsView lockFocus]):
      ([EmacsView focusOnDrawingBuffer]): Rename to lockFocus.
      ([EmacsView unlockFocus]):
      ([EmacsView unfocusDrawingBuffer]): Rename to unlockFocus.
      ([EmacsView windowDidChangeBackingProperties]): Don't explicitly
      release surfaces but reset EmacsLayer properties.
      ([EmacsView layout]):
      ([EmacsView viewWillDraw]): Rename to layout.
      ([EmacsView wantsUpdateLayer]): Remove function and change all callers
      to [EmacsView wantsLayer].
      (EmacsSurface, EmacsLayer): Rename to EmacsLayer.
      ([EmacsSurface getSize]):
      ([EmacsSurface initWithSize:ColorSpace:Scale:]): Remove methods.
      ([EmacsSurface initWithColorSpace:]):
      ([EmacsLayer checkDimensions]):
      ([EmacsLayer releaseSurfaces]):
      ([EmacsLayer display]): New functions.
      * src/nsterm.m ([EmacsLayer dealloc]): Use releaseSurfaces.
      ([EmacsSurface getContext]): Automatically detect frame property
      changes and clear the cache if required.  Use built-in CALayer
      properties where available.
      ([EmacsLayer copyContentsTo:]): Use [CALayer contents] as source.
      a4d2c88c
    • Eli Zaretskii's avatar
  2. 30 Jul, 2021 23 commits
    • Adam Porter's avatar
      * lisp/emacs-lisp/cl-macs.el: Add cl-type pattern · 44fe0043
      Adam Porter authored
      * lisp/emacs-lisp/cl-macs.el:
      ((pcase-defmacro type)): Add 'cl-type' pattern.
      
      * test/lisp/emacs-lisp/pcase-tests.el (pcase-tests-cl-type): Add test.
      
      * doc/lispref/control.texi (pcase Macro): Update manual.
      
      With thanks to Stefan Monnier and Eli Zaretskii for their guidance.
      44fe0043
    • Eli Zaretskii's avatar
      d9bc7dbe
    • Eli Zaretskii's avatar
      Avoid segfault when set-fontset-font is called from non-GUI frames · 1da5b2c6
      Eli Zaretskii authored
      * src/fontset.c (check_fontset_name): Avoid crashes if this is
      called from a non-GUI frame.  (Bug#49782)
      1da5b2c6
    • Michael Albinus's avatar
      Change Tramp version to "2.5.2-pre" · 55a9c17c
      Michael Albinus authored
      * doc/misc/trampver.texi:
      * lisp/net/trampver.el: Change version to "2.5.2-pre".
      55a9c17c
    • Stephen Gildea's avatar
      ; fix 2 typos in MH-E comments · 3f70e856
      Stephen Gildea authored
      * lisp/mh-e/ChangeLog.1: fix typo
      * lisp/mh-e/mh-junk.el (mh-junk-allowlist): fix verb tense
      3f70e856
    • Dmitry Gutov's avatar
      Make fileloop skip missing files · df1dbaf1
      Dmitry Gutov authored
      * lisp/fileloop.el (fileloop-next-file): If a file doesn't exist,
      skip to the next one (bug#44979).
      df1dbaf1
    • Maxim Nikulin's avatar
      Tweak previous mailcap-view-file change · ce8d5c6f
      Maxim Nikulin authored
      * lisp/net/mailcap.el (mailcap-view-file): Remove the :noquery t
      mistakenly added (bug#12972).
      
      Copyright-paperwork-exempt: yes
      ce8d5c6f
    • k3tu0isui's avatar
      Fix problem when switching between different prolog versions · 9ffbe99b
      k3tu0isui authored
      * lisp/progmodes/prolog.el (run-prolog): Make switching between
      different prolog systems work more reliably (bug#45795).
      
      * lisp/progmodes/prolog.el (prolog-ensure-process): Don't start a
      new process if one already exists.
      
      Copyright-paperwork-exempt: yes
      9ffbe99b
    • Mattias Engdegård's avatar
      Simplify lexical let-optimisations · f472dd8e
      Mattias Engdegård authored
      Ensure in cconv that let-bindings have the normal form (VAR EXPR)
      where VAR is a valid variable name, so that we don't need to keep
      re-checking this all the time in the optimiser.
      
      * lisp/emacs-lisp/byte-opt.el
      (byte-optimize-enable-variable-constprop)
      (byte-optimize-warn-eliminated-variable): Remove; these were mainly
      used for debugging.
      * lisp/emacs-lisp/byte-opt.el (byte-optimize-let-form):
      Assume normalised let-bindings (with lexical-binding).
      Stop using the variables removed above.
      * lisp/emacs-lisp/cconv.el (cconv-convert): Ensure normalised
      let-bindings.  Malformed bindings are dropped after warning.
      
      remove byte-optimize-warn-eliminated-variable
      f472dd8e
    • Lars Ingebrigtsen's avatar
      Ensure that recover-file doesn't leave stale auto-save files behind · 16876744
      Lars Ingebrigtsen authored
      * lisp/files.el (recover-file): Don't leave stale auto-save files
      behind after crash recovery (bug#11331).
      16876744
    • Lars Ingebrigtsen's avatar
      Allow shell PROMPT strings to have ANSI codes · 2ece0f8d
      Lars Ingebrigtsen authored
      * lisp/comint.el (comint-output-filter): Don't overwrite ANSI
      codes from the prompt command (bug#11883).
      2ece0f8d
    • Max Nikulin's avatar
      mailcap.el: Avoid xdg-open silent failure · 920aaef9
      Max Nikulin authored
      * lisp/net/mailcap.el (mailcap-view-file): Use 'pipe :connection-type
      instead of 'pty to prevent killing of background process on handler
      exit.  Avoid regression similar to Bug#44824.
      
      Problem happens only in some desktop environments where mailcap handler
      launches actual viewer (as defined in .desktop files and obtained from
      mimeapps.list) in background.  E.g. xdg-open invokes "gio open" or
      kde-open5 for Gnome or KDE accordingly and these handlers launch e.g.
      eog or okular in background.  As soon as main process exits, temporary
      terminal session created by `start-process-shell-command' is terminated.
      As a result background processes receive SIGHUP.
      
      Previously command were executed with no buffer as well, so the change
      does not affect "needsterminal" and "copiousoutput" mailcap features,
      they are not supported as earlier.
      
      If main process of the handler fails then show a message with exit
      reason.  Output (including error messages) is ignored as before.
      Gtk applications tend to report significant amount of failed asserts
      hardly informative for majority of users (bug#12972).
      
      Copyright-paperwork-exempt: yes
      920aaef9
    • Lars Ingebrigtsen's avatar
      Fix case insensitivity in `read-file-name' · 88ba1a86
      Lars Ingebrigtsen authored
      * lisp/minibuffer.el (read-file-name-default): Make `read-file-name'
      actually respect `read-file-name-completion-ignore-case' (bug#14340).
      88ba1a86
    • Lars Ingebrigtsen's avatar
      Fix issue with mml-preview from outside Gnus · 0bd13463
      Lars Ingebrigtsen authored
      * lisp/gnus/gnus-art.el (gnus-mime-display-alternative): Be more
      resilient when running from outside Gnus.
      0bd13463
    • Lars Ingebrigtsen's avatar
      Work around long-standing seq.el compilation warning · 4053bd52
      Lars Ingebrigtsen authored
      * lisp/emacs-lisp/seq.el (seq-contains): When using cl-defgeneric
      to define an obsolete function, it'll complain about it being
      obsolete.  Suppress that warning.  (Should probably be fixed in
      cl-defgeneric instead.)
      4053bd52
    • Basil L. Contovounesios's avatar
      Remove a redundant let-binding from Ispell · 97894b07
      Basil L. Contovounesios authored
      Recent optimizer changes revealed a case-fold-search binding in
      Ispell that was made redundant in the revision of 2020-11-03
      "Simplify ispell-check-version’s use of -vv flag".
      
      * lisp/textmodes/ispell.el (ispell-check-version): Remove no-op
      binding of case-fold-search.
      97894b07
    • Michael Albinus's avatar
    • Michael Albinus's avatar
      Fix bug#49773 in Tramp · 245d3e9f
      Michael Albinus authored
      * lisp/net/tramp.el (tramp-handle-find-backup-file-name)
      (tramp-handle-lock-file, tramp-handle-make-auto-save-file-name):
      Check security hole only if action is in progress.  (Bug#49773)
      245d3e9f
    • Mattias Engdegård's avatar
      Optimise let and let* whose body is constant or the last variable · 52a55e11
      Mattias Engdegård authored
      Simplify  (let ((X1 E1) ... (Xn En)) Xn)
            =>  (progn E1 ... En)
      
      and       (let* ((X1 E1) ... (Xn En)) Xn)
            =>  (let* ((X1 E1) ... (Xn-1 En-1)) En)
      
      and similarly the case where the body is a constant, extending a
      previous optimisation that only applied to the constant nil.
      This reduces the number of bound variables, shortens the code, and
      enables further optimisations.
      
      * lisp/emacs-lisp/byte-opt.el (byte-optimize-letX): Rewrite using
      `pcase` and add the aforementioned transformations.
      * test/lisp/emacs-lisp/bytecomp-tests.el (bytecomp-tests--test-cases):
      Add test cases.
      52a55e11
    • Mattias Engdegård's avatar
      Move warnings about bad let-bindings from source optimiser to cconv · ab9c0644
      Mattias Engdegård authored
      * lisp/emacs-lisp/byte-opt.el (byte-optimize-let-form): Move warnings...
      * lisp/emacs-lisp/cconv.el (cconv-convert): ...here, which is an
      overall better place (closer to the front-end).
      ab9c0644
    • Mattias Engdegård's avatar
      Optimise prog1 better · dc9e2a17
      Mattias Engdegård authored
      Rewrite (prog1 CONST FORMS...) => (progn FORMS... CONST)
      where CONST is a compile-time constant, because putting the value last
      allows the lapcode peephole pass to do important improvements like
      branch elimination.  Also use progn instead of prog1 for `ignore`.
      
      * lisp/emacs-lisp/byte-opt.el (byte-optimize-form-code-walker):
      New `prog1` and `ignore` transforms.
      dc9e2a17
    • Mattias Engdegård's avatar
      Elide lexical variables in for-effect context in source optimiser · 9a633381
      Mattias Engdegård authored
      * lisp/emacs-lisp/byte-opt.el (byte-optimize-form-code-walker):
      Remove for-effect uses of lexical variables.  We previously relied on
      this being done by the lapcode peephole optimiser but at source level
      it enables more optimisation opportunities.
      Keywords are elided for the same reason.
      9a633381
    • Mattias Engdegård's avatar
      Single source optimiser entry point · 566e29f7
      Mattias Engdegård authored
      Make the optimiser aware of lexical arguments.  Otherwise we cannot
      know for sure whether a variable is lexical or dynamic during
      traversal.
      
      * lisp/emacs-lisp/byte-opt.el (byte-optimize-one-form): New optimiser
      entry point, replacing the recursive byte-optimize-form.
      * lisp/emacs-lisp/bytecomp.el (byte-optimize-one-form): Autoload.
      (byte-compile-keep-pending, byte-compile-top-level):
      Use byte-optimize-one-form.
      566e29f7